From 89a59542e5d65151967c831d73a751f90fce7462 Mon Sep 17 00:00:00 2001 From: Dan Streetman Date: Thu, 19 Oct 2023 15:24:51 -0400 Subject: [PATCH] systemd: enable zstd support in journald Also for mariner 2, force journald to not use zstd compression, to retain backwards compatibility. Fixes: #6424 --- ...d-journal-files-for-backwards-compatibility.patch | 12 ++++++++++++ SPECS/systemd/systemd.spec | 10 ++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 SPECS/systemd/mariner-2-do-not-default-zstd-journal-files-for-backwards-compatibility.patch diff --git a/SPECS/systemd/mariner-2-do-not-default-zstd-journal-files-for-backwards-compatibility.patch b/SPECS/systemd/mariner-2-do-not-default-zstd-journal-files-for-backwards-compatibility.patch new file mode 100644 index 0000000000..c7a045659d --- /dev/null +++ b/SPECS/systemd/mariner-2-do-not-default-zstd-journal-files-for-backwards-compatibility.patch @@ -0,0 +1,12 @@ +diff -urpN a/src/libsystemd/sd-journal/journal-file.c b/src/libsystemd/sd-journal/journal-file.c +--- a/src/libsystemd/sd-journal/journal-file.c 2022-01-18 11:35:43.000000000 +0000 ++++ b/src/libsystemd/sd-journal/journal-file.c 2023-10-19 19:15:42.093295820 +0000 +@@ -3254,7 +3254,7 @@ int journal_file_open( + .flags = flags, + .writable = (flags & O_ACCMODE) != O_RDONLY, + +-#if HAVE_ZSTD ++#if HAVE_ZSTD && 0 /* For Mariner 2, disable journal compression with zstd for backwards compatibility */ + .compress_zstd = compress, + #elif HAVE_LZ4 + .compress_lz4 = compress, diff --git a/SPECS/systemd/systemd.spec b/SPECS/systemd/systemd.spec index 7d7ea46e0c..5106740bf6 100644 --- a/SPECS/systemd/systemd.spec +++ b/SPECS/systemd/systemd.spec @@ -1,7 +1,7 @@ Summary: Systemd-250 Name: systemd Version: 250.3 -Release: 17%{?dist} +Release: 18%{?dist} License: LGPLv2+ AND GPLv2+ AND MIT Vendor: Microsoft Corporation Distribution: Mariner @@ -27,6 +27,8 @@ Patch5: backport-helper-util-macros.patch Patch6: CVE-2022-4415.patch Patch7: serve-stale-0001-resolved-added-serve-stale-feature-implementation-of.patch Patch8: serve-stale-0002-resolved-Initialize-until_valid-while-storing-negati.patch +# Patch9 should be dropped for mariner 3 +Patch9: mariner-2-do-not-default-zstd-journal-files-for-backwards-compatibility.patch BuildRequires: audit-devel BuildRequires: cryptsetup-devel BuildRequires: docbook-dtd-xml @@ -49,6 +51,7 @@ BuildRequires: python3-jinja2 BuildRequires: tpm2-tss-devel BuildRequires: util-linux-devel BuildRequires: xz-devel +BuildRequires: zstd-devel Requires: %{name}-rpm-macros = %{version}-%{release} Requires: glib Requires: kmod @@ -134,7 +137,7 @@ meson --prefix %{_prefix} \ -Dlibcryptsetup=true \ -Dgcrypt=true \ -Dlz4=true \ - -Dzstd=false \ + -Dzstd=true \ -Ddbuspolicydir=%{_sysconfdir}/dbus-1/system.d \ -Ddbussessionservicedir=%{_datadir}/dbus-1/services \ -Ddbussystemservicedir=%{_datadir}/dbus-1/system-services \ @@ -283,6 +286,9 @@ fi %files lang -f %{name}.lang %changelog +* Thu Oct 19 2023 Dan Streetman - 250.3-18 +- Enable zstd support for journalctl, but force journald to not use zstd to keep backwards compatibility + * Fri Jul 07 2023 Dan Streetman - 250.3-17 - Add support to systemd-resolved to serve stale dns data