systemd: 253.5 -> 254-rc1

This is an early preparation for systemd v254 which causes some patch reflows
and EFI-related cleanups to their new build system with elf2efi, requiring pyelftools
as a Python packge.

authored by Raito Bezarius and committed by nikstur fe6e2993 18b50081

+94 -139
-1
nixos/modules/system/boot/systemd/initrd.nix
··· 57 57 "systemd-ask-password-console.service" 58 58 "systemd-fsck@.service" 59 59 "systemd-halt.service" 60 - "systemd-hibernate-resume@.service" 61 60 "systemd-journald-audit.socket" 62 61 "systemd-journald-dev-log.socket" 63 62 "systemd-journald.service"
+1 -1
pkgs/os-specific/linux/systemd/0001-Start-device-units-for-uninitialised-encrypted-devic.patch
··· 13 13 1 file changed, 4 deletions(-) 14 14 15 15 diff --git a/rules.d/99-systemd.rules.in b/rules.d/99-systemd.rules.in 16 - index 3dbba1f850..40d367d1c8 100644 16 + index c0defc31de..8f80235731 100644 17 17 --- a/rules.d/99-systemd.rules.in 18 18 +++ b/rules.d/99-systemd.rules.in 19 19 @@ -20,10 +20,6 @@ SUBSYSTEM=="block", TAG+="systemd"
+19 -13
pkgs/os-specific/linux/systemd/0002-Don-t-try-to-unmount-nix-or-nix-store.patch
··· 1 1 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 2 - From: Eelco Dolstra <eelco.dolstra@logicblox.com> 3 - Date: Fri, 12 Apr 2013 13:16:57 +0200 2 + From: Raito Bezarius <masterancpp@gmail.com> 3 + Date: Mon, 19 Jun 2023 02:11:35 +0200 4 4 Subject: [PATCH] Don't try to unmount /nix or /nix/store 5 5 6 6 They'll still be remounted read-only. 7 7 8 8 https://github.com/NixOS/nixos/issues/126 9 + 10 + Original-Author: Eelco Dolstra <eelco.dolstra@logicblox.com> 9 11 --- 10 12 src/shared/fstab-util.c | 2 ++ 11 - src/shutdown/umount.c | 2 ++ 12 - 2 files changed, 4 insertions(+) 13 + src/shutdown/umount.c | 6 ++++-- 14 + 2 files changed, 6 insertions(+), 2 deletions(-) 13 15 14 16 diff --git a/src/shared/fstab-util.c b/src/shared/fstab-util.c 15 - index 164e71a150..68e0766594 100644 17 + index 4ffec25c75..b99031c54e 100644 16 18 --- a/src/shared/fstab-util.c 17 19 +++ b/src/shared/fstab-util.c 18 - @@ -41,6 +41,8 @@ bool fstab_is_extrinsic(const char *mount, const char *opts) { 20 + @@ -43,6 +43,8 @@ bool fstab_is_extrinsic(const char *mount, const char *opts) { 19 21 /* Don't bother with the OS data itself */ 20 22 if (PATH_IN_SET(mount, 21 23 "/", ··· 25 27 "/etc")) 26 28 return true; 27 29 diff --git a/src/shutdown/umount.c b/src/shutdown/umount.c 28 - index 61bd9d2601..a6243da417 100644 30 + index 1586c2e214..fcae95f824 100644 29 31 --- a/src/shutdown/umount.c 30 32 +++ b/src/shutdown/umount.c 31 - @@ -531,6 +531,8 @@ static int delete_md(MountPoint *m) { 32 - 33 + @@ -170,8 +170,10 @@ int mount_points_list_get(const char *mountinfo, MountPoint **head) { 33 34 static bool nonunmountable_path(const char *path) { 34 - return path_equal(path, "/") 35 + assert(path); 36 + 37 + - return PATH_IN_SET(path, "/", "/usr") || 38 + - path_startswith(path, "/run/initramfs"); 39 + + return PATH_IN_SET(path, "/", "/usr") 35 40 + || path_equal(path, "/nix") 36 41 + || path_equal(path, "/nix/store") 37 - #if ! HAVE_SPLIT_USR 38 - || path_equal(path, "/usr") 39 - #endif 42 + + || path_startswith(path, "/run/initramfs"); 43 + } 44 + 45 + static void log_umount_blockers(const char *mnt) {
+3 -3
pkgs/os-specific/linux/systemd/0003-Fix-NixOS-containers.patch
··· 10 10 1 file changed, 2 insertions(+) 11 11 12 12 diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c 13 - index 3dabe12672..e5aa4feb1e 100644 13 + index e170958fc5..898a674631 100644 14 14 --- a/src/nspawn/nspawn.c 15 15 +++ b/src/nspawn/nspawn.c 16 - @@ -5638,6 +5638,7 @@ static int run(int argc, char *argv[]) { 16 + @@ -5648,6 +5648,7 @@ static int run(int argc, char *argv[]) { 17 17 goto finish; 18 18 } 19 19 } else { ··· 21 21 _cleanup_free_ char *p = NULL; 22 22 23 23 if (arg_pivot_root_new) 24 - @@ -5652,6 +5653,7 @@ static int run(int argc, char *argv[]) { 24 + @@ -5662,6 +5663,7 @@ static int run(int argc, char *argv[]) { 25 25 "Directory %s doesn't look like it has an OS tree (/usr/ directory is missing). Refusing.", arg_directory); 26 26 goto finish; 27 27 }
+15 -11
pkgs/os-specific/linux/systemd/0004-Add-some-NixOS-specific-unit-directories.patch
··· 1 1 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 2 - From: Eelco Dolstra <eelco.dolstra@logicblox.com> 3 - Date: Fri, 19 Dec 2014 14:46:17 +0100 2 + From: Raito Bezarius <masterancpp@gmail.com> 3 + Date: Mon, 19 Jun 2023 02:13:42 +0200 4 4 Subject: [PATCH] Add some NixOS-specific unit directories 5 5 6 6 Look in `/nix/var/nix/profiles/default/lib/systemd/{system,user}` for ··· 8 8 `nix-env -iA nixos.$package`. 9 9 10 10 Also, remove /usr and /lib as these don't exist on NixOS. 11 + 12 + Original-Author: Eelco Dolstra <eelco.dolstra@logicblox.com> 11 13 --- 12 14 src/basic/path-lookup.c | 17 ++--------------- 13 15 src/core/systemd.pc.in | 8 ++++---- 14 16 2 files changed, 6 insertions(+), 19 deletions(-) 15 17 16 18 diff --git a/src/basic/path-lookup.c b/src/basic/path-lookup.c 17 - index c99e9d8786..b9f85d1f8c 100644 19 + index 7d158a8295..f9bd62b631 100644 18 20 --- a/src/basic/path-lookup.c 19 21 +++ b/src/basic/path-lookup.c 20 22 @@ -92,11 +92,7 @@ int xdg_user_data_dir(char **ret, const char *suffix) { ··· 62 64 STRV_IFNOTNULL(generator_late)); 63 65 break; 64 66 65 - @@ -808,7 +799,6 @@ char **generator_binary_paths(LookupScope scope) { 66 - case LOOKUP_SCOPE_SYSTEM: 67 + @@ -808,7 +799,6 @@ char **generator_binary_paths(RuntimeScope scope) { 68 + case RUNTIME_SCOPE_SYSTEM: 67 69 add = strv_new("/run/systemd/system-generators", 68 70 "/etc/systemd/system-generators", 69 71 - "/usr/local/lib/systemd/system-generators", 70 72 SYSTEM_GENERATOR_DIR); 71 73 break; 72 74 73 - @@ -816,7 +806,6 @@ char **generator_binary_paths(LookupScope scope) { 74 - case LOOKUP_SCOPE_USER: 75 + @@ -816,7 +806,6 @@ char **generator_binary_paths(RuntimeScope scope) { 76 + case RUNTIME_SCOPE_USER: 75 77 add = strv_new("/run/systemd/user-generators", 76 78 "/etc/systemd/user-generators", 77 79 - "/usr/local/lib/systemd/user-generators", 78 80 USER_GENERATOR_DIR); 79 81 break; 80 82 81 - @@ -855,12 +844,10 @@ char **env_generator_binary_paths(bool is_system) { 82 - if (is_system) 83 + @@ -855,14 +844,12 @@ char **env_generator_binary_paths(RuntimeScope runtime_scope) { 84 + case RUNTIME_SCOPE_SYSTEM: 83 85 add = strv_new("/run/systemd/system-environment-generators", 84 86 "/etc/systemd/system-environment-generators", 85 87 - "/usr/local/lib/systemd/system-environment-generators", 86 88 SYSTEM_ENV_GENERATOR_DIR); 87 - else 89 + break; 90 + 91 + case RUNTIME_SCOPE_USER: 88 92 add = strv_new("/run/systemd/user-environment-generators", 89 93 "/etc/systemd/user-environment-generators", 90 94 - "/usr/local/lib/systemd/user-environment-generators", 91 95 USER_ENV_GENERATOR_DIR); 96 + break; 92 97 93 - if (!add) 94 98 diff --git a/src/core/systemd.pc.in b/src/core/systemd.pc.in 95 99 index 693433b34b..5932a21b5b 100644 96 100 --- a/src/core/systemd.pc.in
+2 -2
pkgs/os-specific/linux/systemd/0005-Get-rid-of-a-useless-message-in-user-sessions.patch
··· 13 13 1 file changed, 2 insertions(+), 1 deletion(-) 14 14 15 15 diff --git a/src/core/manager.c b/src/core/manager.c 16 - index 4bc8a06bd2..342892490e 100644 16 + index 22ec6e79b1..771e8e7f16 100644 17 17 --- a/src/core/manager.c 18 18 +++ b/src/core/manager.c 19 - @@ -1486,7 +1486,8 @@ static unsigned manager_dispatch_stop_when_bound_queue(Manager *m) { 19 + @@ -1559,7 +1559,8 @@ static unsigned manager_dispatch_stop_when_bound_queue(Manager *m) { 20 20 if (!unit_is_bound_by_inactive(u, &culprit)) 21 21 continue; 22 22
+10 -10
pkgs/os-specific/linux/systemd/0006-hostnamed-localed-timedated-disable-methods-that-cha.patch
··· 11 11 3 files changed, 25 insertions(+) 12 12 13 13 diff --git a/src/hostname/hostnamed.c b/src/hostname/hostnamed.c 14 - index 36ab0148b9..7d458d196d 100644 14 + index 9ef45f8e75..99b1ec2e36 100644 15 15 --- a/src/hostname/hostnamed.c 16 16 +++ b/src/hostname/hostnamed.c 17 - @@ -1028,6 +1028,9 @@ static int method_set_static_hostname(sd_bus_message *m, void *userdata, sd_bus_ 17 + @@ -1053,6 +1053,9 @@ static int method_set_static_hostname(sd_bus_message *m, void *userdata, sd_bus_ 18 18 if (r < 0) 19 19 return r; 20 20 ··· 24 24 name = empty_to_null(name); 25 25 26 26 context_read_etc_hostname(c); 27 - @@ -1091,6 +1094,9 @@ static int set_machine_info(Context *c, sd_bus_message *m, int prop, sd_bus_mess 27 + @@ -1116,6 +1119,9 @@ static int set_machine_info(Context *c, sd_bus_message *m, int prop, sd_bus_mess 28 28 if (r < 0) 29 29 return r; 30 30 ··· 35 35 36 36 context_read_machine_info(c); 37 37 diff --git a/src/locale/localed.c b/src/locale/localed.c 38 - index 841e5e3e91..a21e34430b 100644 38 + index f544a73580..ce00c262cc 100644 39 39 --- a/src/locale/localed.c 40 40 +++ b/src/locale/localed.c 41 - @@ -264,6 +264,9 @@ static int method_set_locale(sd_bus_message *m, void *userdata, sd_bus_error *er 41 + @@ -229,6 +229,9 @@ static int method_set_locale(sd_bus_message *m, void *userdata, sd_bus_error *er 42 42 43 43 use_localegen = locale_gen_check_available(); 44 44 ··· 48 48 /* If single locale without variable name is provided, then we assume it is LANG=. */ 49 49 if (strv_length(l) == 1 && !strchr(l[0], '=')) { 50 50 if (!locale_is_valid(l[0])) 51 - @@ -382,6 +385,9 @@ static int method_set_vc_keyboard(sd_bus_message *m, void *userdata, sd_bus_erro 51 + @@ -347,6 +350,9 @@ static int method_set_vc_keyboard(sd_bus_message *m, void *userdata, sd_bus_erro 52 52 if (r < 0) 53 53 return bus_log_parse_error(r); 54 54 ··· 57 57 + 58 58 vc_context_empty_to_null(&in); 59 59 60 - FOREACH_STRING(name, in.keymap ?: in.toggle, in.keymap ? in.toggle : NULL) { 61 - @@ -607,6 +613,9 @@ static int method_set_x11_keyboard(sd_bus_message *m, void *userdata, sd_bus_err 60 + r = vc_context_verify_and_warn(&in, LOG_ERR, error); 61 + @@ -465,6 +471,9 @@ static int method_set_x11_keyboard(sd_bus_message *m, void *userdata, sd_bus_err 62 62 if (r < 0) 63 63 return bus_log_parse_error(r); 64 64 ··· 67 67 + 68 68 x11_context_empty_to_null(&in); 69 69 70 - if (!x11_context_is_safe(&in)) 70 + r = x11_context_verify_and_warn(&in, LOG_ERR, error); 71 71 diff --git a/src/timedate/timedated.c b/src/timedate/timedated.c 72 - index ad483301ef..31ed86955b 100644 72 + index ad1d492d6b..331af34505 100644 73 73 --- a/src/timedate/timedated.c 74 74 +++ b/src/timedate/timedated.c 75 75 @@ -665,6 +665,10 @@ static int method_set_timezone(sd_bus_message *m, void *userdata, sd_bus_error *
+14 -14
pkgs/os-specific/linux/systemd/0008-Change-usr-share-zoneinfo-to-etc-zoneinfo.patch
··· 35 35 <literal>Etc/UTC</literal>. The resulting link should lead to the 36 36 corresponding binary 37 37 diff --git a/src/basic/time-util.c b/src/basic/time-util.c 38 - index 0bea149324..4b16115d43 100644 38 + index 1db630003a..31744c3e68 100644 39 39 --- a/src/basic/time-util.c 40 40 +++ b/src/basic/time-util.c 41 - @@ -1283,7 +1283,7 @@ static int get_timezones_from_zone1970_tab(char ***ret) { 41 + @@ -1350,7 +1350,7 @@ static int get_timezones_from_zone1970_tab(char ***ret) { 42 42 43 43 assert(ret); 44 44 ··· 47 47 if (!f) 48 48 return -errno; 49 49 50 - @@ -1322,7 +1322,7 @@ static int get_timezones_from_tzdata_zi(char ***ret) { 51 - _cleanup_strv_free_ char **zones = NULL; 52 - int r; 50 + @@ -1391,7 +1391,7 @@ static int get_timezones_from_tzdata_zi(char ***ret) { 51 + 52 + assert(ret); 53 53 54 54 - f = fopen("/usr/share/zoneinfo/tzdata.zi", "re"); 55 55 + f = fopen("/etc/zoneinfo/tzdata.zi", "re"); 56 56 if (!f) 57 57 return -errno; 58 58 59 - @@ -1434,7 +1434,7 @@ int verify_timezone(const char *name, int log_level) { 59 + @@ -1503,7 +1503,7 @@ int verify_timezone(const char *name, int log_level) { 60 60 if (p - name >= PATH_MAX) 61 61 return -ENAMETOOLONG; 62 62 ··· 65 65 66 66 fd = open(t, O_RDONLY|O_CLOEXEC); 67 67 if (fd < 0) 68 - @@ -1492,7 +1492,7 @@ int get_timezone(char **ret) { 68 + @@ -1563,7 +1563,7 @@ int get_timezone(char **ret) { 69 69 if (r < 0) 70 70 return r; /* returns EINVAL if not a symlink */ 71 71 ··· 75 75 return -EINVAL; 76 76 77 77 diff --git a/src/firstboot/firstboot.c b/src/firstboot/firstboot.c 78 - index 9e79f84691..1a1c75718c 100644 78 + index 1956ab3b13..9ef356f8af 100644 79 79 --- a/src/firstboot/firstboot.c 80 80 +++ b/src/firstboot/firstboot.c 81 - @@ -512,7 +512,7 @@ static int process_timezone(void) { 81 + @@ -630,7 +630,7 @@ static int process_timezone(int rfd) { 82 82 if (isempty(arg_timezone)) 83 83 return 0; 84 84 85 85 - e = strjoina("../usr/share/zoneinfo/", arg_timezone); 86 86 + e = strjoina("zoneinfo/", arg_timezone); 87 87 88 - (void) mkdir_parents(etc_localtime, 0755); 89 - r = symlink_atomic(e, etc_localtime); 88 + r = symlinkat_atomic_full(e, pfd, f, /* make_relative= */ false); 89 + if (r < 0) 90 90 diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c 91 - index e5aa4feb1e..a7a8fae860 100644 91 + index 898a674631..c41a416e04 100644 92 92 --- a/src/nspawn/nspawn.c 93 93 +++ b/src/nspawn/nspawn.c 94 - @@ -1918,8 +1918,8 @@ int userns_mkdir(const char *root, const char *path, mode_t mode, uid_t uid, gid 94 + @@ -1924,8 +1924,8 @@ int userns_mkdir(const char *root, const char *path, mode_t mode, uid_t uid, gid 95 95 static const char *timezone_from_path(const char *path) { 96 96 return PATH_STARTSWITH_SET( 97 97 path, ··· 103 103 104 104 static bool etc_writable(void) { 105 105 diff --git a/src/timedate/timedated.c b/src/timedate/timedated.c 106 - index 31ed86955b..8db8d8c288 100644 106 + index 331af34505..722c4b5b4f 100644 107 107 --- a/src/timedate/timedated.c 108 108 +++ b/src/timedate/timedated.c 109 109 @@ -282,7 +282,7 @@ static int context_read_data(Context *c) {
+1 -1
pkgs/os-specific/linux/systemd/0009-localectl-use-etc-X11-xkb-for-list-x11.patch
··· 10 10 1 file changed, 1 insertion(+), 1 deletion(-) 11 11 12 12 diff --git a/src/locale/localectl.c b/src/locale/localectl.c 13 - index fb83881cc7..c47a33134a 100644 13 + index d8db9d9d22..4601bb5431 100644 14 14 --- a/src/locale/localectl.c 15 15 +++ b/src/locale/localectl.c 16 16 @@ -297,7 +297,7 @@ static int list_x11_keymaps(int argc, char **argv, void *userdata) {
+2 -2
pkgs/os-specific/linux/systemd/0010-build-don-t-create-statedir-and-don-t-touch-prefixdi.patch
··· 8 8 1 file changed, 3 deletions(-) 9 9 10 10 diff --git a/meson.build b/meson.build 11 - index b1f5477836..1a39484855 100644 11 + index 395eca1943..082cd748bb 100644 12 12 --- a/meson.build 13 13 +++ b/meson.build 14 - @@ -4278,9 +4278,6 @@ install_data('LICENSE.GPL2', 14 + @@ -4707,9 +4707,6 @@ install_data('LICENSE.GPL2', 15 15 install_subdir('LICENSES', 16 16 install_dir : docdir) 17 17
+2 -2
pkgs/os-specific/linux/systemd/0011-add-rootprefix-to-lookup-dir-paths.patch
··· 12 12 1 file changed, 4 insertions(+), 2 deletions(-) 13 13 14 14 diff --git a/src/basic/constants.h b/src/basic/constants.h 15 - index 5d68cc6332..33c06c1f65 100644 15 + index 3f96786da9..6e8fb40c08 100644 16 16 --- a/src/basic/constants.h 17 17 +++ b/src/basic/constants.h 18 - @@ -73,13 +73,15 @@ 18 + @@ -74,13 +74,15 @@ 19 19 "/run/" n "\0" \ 20 20 "/usr/local/lib/" n "\0" \ 21 21 "/usr/lib/" n "\0" \
+2 -2
pkgs/os-specific/linux/systemd/0012-systemd-shutdown-execute-scripts-in-etc-systemd-syst.patch
··· 10 10 1 file changed, 1 insertion(+) 11 11 12 12 diff --git a/src/shutdown/shutdown.c b/src/shutdown/shutdown.c 13 - index 5dee1b3a92..c08cf80548 100644 13 + index 8395bb429d..14fbc85bb4 100644 14 14 --- a/src/shutdown/shutdown.c 15 15 +++ b/src/shutdown/shutdown.c 16 - @@ -339,6 +339,7 @@ static void init_watchdog(void) { 16 + @@ -334,6 +334,7 @@ static void init_watchdog(void) { 17 17 int main(int argc, char *argv[]) { 18 18 static const char* const dirs[] = { 19 19 SYSTEM_SHUTDOWN_PATH,
+2 -2
pkgs/os-specific/linux/systemd/0013-systemd-sleep-execute-scripts-in-etc-systemd-system-.patch
··· 9 9 1 file changed, 1 insertion(+) 10 10 11 11 diff --git a/src/sleep/sleep.c b/src/sleep/sleep.c 12 - index 288fa4ae84..07deb19d7c 100644 12 + index de1f6c7ec1..d0cdebd80a 100644 13 13 --- a/src/sleep/sleep.c 14 14 +++ b/src/sleep/sleep.c 15 - @@ -186,6 +186,7 @@ static int execute( 15 + @@ -224,6 +224,7 @@ static int execute( 16 16 }; 17 17 static const char* const dirs[] = { 18 18 SYSTEM_SLEEP_PATH,
+2 -2
pkgs/os-specific/linux/systemd/0014-path-util.h-add-placeholder-for-DEFAULT_PATH_NORMAL.patch
··· 10 10 1 file changed, 3 insertions(+), 3 deletions(-) 11 11 12 12 diff --git a/src/basic/path-util.h b/src/basic/path-util.h 13 - index 56f01f41d8..f9b8627388 100644 13 + index 97175bee11..3839704901 100644 14 14 --- a/src/basic/path-util.h 15 15 +++ b/src/basic/path-util.h 16 - @@ -24,11 +24,11 @@ 16 + @@ -25,11 +25,11 @@ 17 17 # define PATH_SBIN_BIN_NULSTR(x) PATH_NORMAL_SBIN_BIN_NULSTR(x) 18 18 #endif 19 19
+3 -3
pkgs/os-specific/linux/systemd/0016-inherit-systemd-environment-when-calling-generators.patch
··· 16 16 1 file changed, 8 insertions(+) 17 17 18 18 diff --git a/src/core/manager.c b/src/core/manager.c 19 - index 342892490e..1117251fe0 100644 19 + index 771e8e7f16..acf3ead8d7 100644 20 20 --- a/src/core/manager.c 21 21 +++ b/src/core/manager.c 22 - @@ -3771,9 +3771,17 @@ static int build_generator_environment(Manager *m, char ***ret) { 22 + @@ -3899,9 +3899,17 @@ static int build_generator_environment(Manager *m, char ***ret) { 23 23 * adjust generated units to that. Let's pass down some bits of information that are easy for us to 24 24 * determine (but a bit harder for generator scripts to determine), as environment variables. */ 25 25 ··· 35 35 return -ENOMEM; 36 36 +#endif 37 37 38 - r = strv_env_assign(&nl, "SYSTEMD_SCOPE", MANAGER_IS_SYSTEM(m) ? "system" : "user"); 38 + r = strv_env_assign(&nl, "SYSTEMD_SCOPE", runtime_scope_to_string(m->runtime_scope)); 39 39 if (r < 0)
+2 -2
pkgs/os-specific/linux/systemd/0017-core-don-t-taint-on-unmerged-usr.patch
··· 17 17 1 file changed, 4 deletions(-) 18 18 19 19 diff --git a/src/core/manager.c b/src/core/manager.c 20 - index 1117251fe0..bf5600a6cf 100644 20 + index acf3ead8d7..bdbab16829 100644 21 21 --- a/src/core/manager.c 22 22 +++ b/src/core/manager.c 23 - @@ -4617,10 +4617,6 @@ char* manager_taint_string(const Manager *m) { 23 + @@ -4754,10 +4754,6 @@ char* manager_taint_string(const Manager *m) { 24 24 if (m->taint_usr) 25 25 stage[n++] = "split-usr"; 26 26
+2 -2
pkgs/os-specific/linux/systemd/0018-tpm2_context_init-fix-driver-name-checking.patch
··· 27 27 1 file changed, 1 insertion(+), 1 deletion(-) 28 28 29 29 diff --git a/src/shared/tpm2-util.c b/src/shared/tpm2-util.c 30 - index 4345b95106..424a334df1 100644 30 + index ae8a8bc073..c284b244f8 100644 31 31 --- a/src/shared/tpm2-util.c 32 32 +++ b/src/shared/tpm2-util.c 33 - @@ -176,7 +176,7 @@ int tpm2_context_new(const char *device, Tpm2Context **ret_context) { 33 + @@ -582,7 +582,7 @@ int tpm2_context_new(const char *device, Tpm2Context **ret_context) { 34 34 fn = strjoina("libtss2-tcti-", driver, ".so.0"); 35 35 36 36 /* Better safe than sorry, let's refuse strings that cannot possibly be valid driver early, before going to disk. */
-46
pkgs/os-specific/linux/systemd/0019-bootctl-also-print-efi-files-not-owned-by-systemd-in.patch
··· 1 - From bc0f378a1149b59e88e9345e579d62fec7f50cdf Mon Sep 17 00:00:00 2001 2 - From: Arian van Putten <arian.vanputten@gmail.com> 3 - Date: Wed, 31 May 2023 13:27:13 +0200 4 - Subject: [PATCH] bootctl: also print efi files not owned by systemd in status 5 - 6 - We should not skip over unknown entries in EFI/BOOT/ but 7 - also print them out in status so people are aware that they are there. 8 - 9 - (cherry picked from commit a680d4fb87bad829989949e5ea4fc6db90453456) 10 - --- 11 - src/boot/bootctl-status.c | 11 +++++------ 12 - 1 file changed, 5 insertions(+), 6 deletions(-) 13 - 14 - diff --git a/src/boot/bootctl-status.c b/src/boot/bootctl-status.c 15 - index 2e2bf1f7e1..f1ac4a9c8a 100644 16 - --- a/src/boot/bootctl-status.c 17 - +++ b/src/boot/bootctl-status.c 18 - @@ -225,9 +225,8 @@ static int enumerate_binaries( 19 - return log_error_errno(errno, "Failed to open file '%s' for reading: %m", filename); 20 - 21 - r = get_file_version(fd, &v); 22 - - if (r == -ESRCH) /* Not the file we are looking for. */ 23 - - continue; 24 - - if (r < 0) 25 - + 26 - + if (r < 0 && r != -ESRCH) 27 - return r; 28 - 29 - if (*previous) { /* Let's output the previous entry now, since now we know that there will be 30 - @@ -242,10 +241,10 @@ static int enumerate_binaries( 31 - /* Do not output this entry immediately, but store what should be printed in a state 32 - * variable, because we only will know the tree glyph to print (branch or final edge) once we 33 - * read one more entry */ 34 - - if (r > 0) 35 - - r = asprintf(previous, "/%s/%s (%s%s%s)", path, de->d_name, ansi_highlight(), v, ansi_normal()); 36 - - else 37 - + if (r == -ESRCH) /* No systemd-owned file but still interesting to print */ 38 - r = asprintf(previous, "/%s/%s", path, de->d_name); 39 - + else /* if (r >= 0) */ 40 - + r = asprintf(previous, "/%s/%s (%s%s%s)", path, de->d_name, ansi_highlight(), v, ansi_normal()); 41 - if (r < 0) 42 - return log_oom(); 43 - 44 - -- 45 - 2.39.2 (Apple Git-143) 46 -
+12 -20
pkgs/os-specific/linux/systemd/default.nix
··· 55 55 , e2fsprogs 56 56 , elfutils 57 57 , linuxHeaders ? stdenv.cc.libc.linuxHeaders 58 - , gnu-efi 59 58 , iptables 60 59 , withSelinux ? false 61 60 , libselinux ··· 117 116 , withNss ? !stdenv.hostPlatform.isMusl 118 117 , withOomd ? true 119 118 , withPam ? true 119 + , withPasswordQuality ? false 120 120 , withPCRE2 ? true 121 121 , withPolkit ? true 122 122 , withPortabled ? !stdenv.hostPlatform.isMusl ··· 152 152 let 153 153 wantCurl = withRemote || withImportd; 154 154 wantGcrypt = withResolved || withImportd; 155 - version = "253.6"; 155 + version = "254-rc1"; 156 156 157 157 # Bump this variable on every (major) version change. See below (in the meson options list) for why. 158 158 # command: ··· 167 167 # This has proven to be less error-prone than the previous systemd fork. 168 168 src = fetchFromGitHub { 169 169 owner = "systemd"; 170 - repo = "systemd-stable"; 171 - rev = "v${version}"; 172 - hash = "sha256-LZs6QuBe23W643bTuz+MD2pzHiapsBJBHoFXi/QjzG4="; 170 + repo = "systemd"; 171 + rev = "v254-rc1"; 172 + hash = "sha256-66moj7uYOaI+PHkl5HX/RrwfupCR1bAWlQ6z6+sMhRk="; 173 173 }; 174 174 175 175 # On major changes, or when otherwise required, you *must* reformat the patches, ··· 196 196 ./0016-inherit-systemd-environment-when-calling-generators.patch 197 197 ./0017-core-don-t-taint-on-unmerged-usr.patch 198 198 ./0018-tpm2_context_init-fix-driver-name-checking.patch 199 - ./0019-bootctl-also-print-efi-files-not-owned-by-systemd-in.patch 200 199 ] ++ lib.optional stdenv.hostPlatform.isMusl ( 201 200 let 202 201 oe-core = fetchzip { ··· 231 230 232 231 postPatch = '' 233 232 substituteInPlace src/basic/path-util.h --replace "@defaultPathNormal@" "${placeholder "out"}/bin/" 234 - substituteInPlace src/boot/efi/meson.build \ 235 - --replace \ 236 - "run_command(cc.cmd_array(), '-print-prog-name=objcopy', check: true).stdout().strip()" \ 237 - "'${stdenv.cc.bintools.targetPrefix}objcopy'" 238 233 '' + lib.optionalString withLibBPF '' 239 234 substituteInPlace meson.build \ 240 235 --replace "find_program('clang'" "find_program('${stdenv.cc.targetPrefix}clang'" 241 - # BPF does not work with stack protector 242 - substituteInPlace src/core/bpf/meson.build \ 243 - --replace "clang_flags = [" "clang_flags = [ '-fno-stack-protector'," 244 236 '' + lib.optionalString withUkify '' 245 237 substituteInPlace src/ukify/ukify.py \ 246 238 --replace \ ··· 327 319 328 320 # Support for PKCS#11 in systemd-cryptsetup, systemd-cryptenroll and systemd-homed 329 321 { name = "libp11-kit.so.0"; pkg = opt (withHomed || withCryptsetup) p11-kit; } 322 + 323 + # Password quality support 324 + { name = "libpasswdqc.so.1"; pkg = opt withPasswordQuality null; } 330 325 ]; 331 326 332 327 patchDlOpen = dl: ··· 397 392 docbook_xml_dtd_42 398 393 docbook_xml_dtd_45 399 394 bash 400 - (buildPackages.python3Packages.python.withPackages (ps: with ps; [ lxml jinja2 ])) 395 + (buildPackages.python3Packages.python.withPackages (ps: with ps; [ lxml jinja2 ] ++ lib.optional withEfi ps.pyelftools)) 401 396 ] 402 397 ++ lib.optionals withLibBPF [ 403 398 bpftools ··· 424 419 ++ lib.optionals withCompression [ bzip2 lz4 xz zstd ] 425 420 ++ lib.optional withCoredump elfutils 426 421 ++ lib.optional withCryptsetup (lib.getDev cryptsetup.dev) 427 - ++ lib.optional withEfi gnu-efi 428 422 ++ lib.optional withKexectools kexec-tools 429 423 ++ lib.optional withKmod kmod 430 424 ++ lib.optional withLibidn2 libidn2 ··· 540 534 "-Dman=true" 541 535 542 536 "-Defi=${lib.boolToString withEfi}" 543 - "-Dgnu-efi=${lib.boolToString withEfi}" 537 + "-Dbootloader=${lib.boolToString withEfi}" 544 538 545 539 "-Dukify=${lib.boolToString withUkify}" 546 - ] ++ lib.optionals withEfi [ 547 - "-Defi-libdir=${toString gnu-efi}/lib" 548 - "-Defi-includedir=${toString gnu-efi}/include/efi" 549 540 ] ++ lib.optionals (withShellCompletions == false) [ 550 541 "-Dbashcompletiondir=no" 551 542 "-Dzshcompletiondir=no" ··· 589 580 where = [ 590 581 "man/systemd-analyze.xml" 591 582 "man/systemd.service.xml" 583 + "man/systemd-run.xml" 592 584 "src/analyze/test-verify.c" 593 585 "src/test/test-env-file.c" 594 586 "src/test/test-fileio.c" ··· 598 590 { 599 591 search = "/bin/cat"; 600 592 replacement = "${coreutils}/bin/cat"; 601 - where = [ "test/create-busybox-container" "test/test-execute/exec-noexecpaths-simple.service" "src/journal/cat.c" ]; 593 + where = [ "test/test-execute/exec-noexecpaths-simple.service" "src/journal/cat.c" ]; 602 594 } 603 595 { 604 596 search = "/usr/lib/systemd/systemd-fsck";