From 504cb88686d2f30f0cc08c26ad3f151e741de264 Mon Sep 17 00:00:00 2001 From: Connor Baker Date: Thu, 23 Jan 2025 12:51:54 -0800 Subject: [PATCH] systemd: patch meson build file for environmentd generator to include missing conditional --- ...ontext_init-fix-driver-name-checking.patch | 2 +- ...uggest-systemdctl-edit-runtime-on-sy.patch | 2 +- ...nerator-conditionally-install-files-.patch | 28 +++++++++++++++++++ pkgs/os-specific/linux/systemd/default.nix | 2 ++ 4 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 pkgs/os-specific/linux/systemd/0020-environment-d-generator-conditionally-install-files-.patch diff --git a/pkgs/os-specific/linux/systemd/0015-tpm2_context_init-fix-driver-name-checking.patch b/pkgs/os-specific/linux/systemd/0015-tpm2_context_init-fix-driver-name-checking.patch index 41e836ca04eba0..fe8ac0ddd913ad 100644 --- a/pkgs/os-specific/linux/systemd/0015-tpm2_context_init-fix-driver-name-checking.patch +++ b/pkgs/os-specific/linux/systemd/0015-tpm2_context_init-fix-driver-name-checking.patch @@ -27,7 +27,7 @@ filename_is_valid with path_is_valid. 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/tpm2-util.c b/src/shared/tpm2-util.c -index 36a0f906da..e0f42abca2 100644 +index 5b6b3ea93c..8ab04241b6 100644 --- a/src/shared/tpm2-util.c +++ b/src/shared/tpm2-util.c @@ -721,7 +721,7 @@ int tpm2_context_new(const char *device, Tpm2Context **ret_context) { diff --git a/pkgs/os-specific/linux/systemd/0016-systemctl-edit-suggest-systemdctl-edit-runtime-on-sy.patch b/pkgs/os-specific/linux/systemd/0016-systemctl-edit-suggest-systemdctl-edit-runtime-on-sy.patch index 6c7a1aff4094e3..50dd842cc221ea 100644 --- a/pkgs/os-specific/linux/systemd/0016-systemctl-edit-suggest-systemdctl-edit-runtime-on-sy.patch +++ b/pkgs/os-specific/linux/systemd/0016-systemctl-edit-suggest-systemdctl-edit-runtime-on-sy.patch @@ -30,7 +30,7 @@ are written into `$XDG_CONFIG_HOME/systemd/user`. 1 file changed, 3 insertions(+) diff --git a/src/systemctl/systemctl-edit.c b/src/systemctl/systemctl-edit.c -index c42a31153d..154dbf0402 100644 +index 7165fa1cf7..7498cf9f4c 100644 --- a/src/systemctl/systemctl-edit.c +++ b/src/systemctl/systemctl-edit.c @@ -323,6 +323,9 @@ int verb_edit(int argc, char *argv[], void *userdata) { diff --git a/pkgs/os-specific/linux/systemd/0020-environment-d-generator-conditionally-install-files-.patch b/pkgs/os-specific/linux/systemd/0020-environment-d-generator-conditionally-install-files-.patch new file mode 100644 index 00000000000000..2e1e569b9ce4d1 --- /dev/null +++ b/pkgs/os-specific/linux/systemd/0020-environment-d-generator-conditionally-install-files-.patch @@ -0,0 +1,28 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jared Baur +Date: Thu, 23 Jan 2025 12:29:57 -0800 +Subject: [PATCH] environment-d-generator: conditionally install files into + sysconfdir + +Make environment-d-generator respect the `install-sysconfdir` meson +option. +--- + src/environment-d-generator/meson.build | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/src/environment-d-generator/meson.build b/src/environment-d-generator/meson.build +index cc41b6b334..de16b0cfae 100644 +--- a/src/environment-d-generator/meson.build ++++ b/src/environment-d-generator/meson.build +@@ -13,6 +13,8 @@ executables += [ + ] + + install_emptydir(environmentdir) +-meson.add_install_script(sh, '-c', +- ln_s.format(sysconfdir / 'environment', +- environmentdir / '99-environment.conf')) ++if install_sysconfdir ++ meson.add_install_script(sh, '-c', ++ ln_s.format(sysconfdir / 'environment', ++ environmentdir / '99-environment.conf')) ++endif diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index 59ecbb865ef9b4..b075606cfb6497 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -5,6 +5,7 @@ pkgsCross, testers, fetchFromGitHub, + fetchpatch, fetchzip, buildPackages, makeBinaryWrapper, @@ -241,6 +242,7 @@ stdenv.mkDerivation (finalAttrs: { ./0016-systemctl-edit-suggest-systemdctl-edit-runtime-on-sy.patch ./0017-meson.build-do-not-create-systemdstatedir.patch ./0018-Revert-bootctl-update-list-remove-all-instances-of-s.patch # https://github.com/systemd/systemd/issues/33392 + ./0020-environment-d-generator-conditionally-install-files-.patch # https://github.com/systemd/systemd/pull/36140 ] ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isGnu) [ ./0019-timesyncd-disable-NSCD-when-DNSSEC-validation-is-dis.patch