diff --git a/0001-tmpfiles-make-purge-hard-to-mis-use.patch b/0001-tmpfiles-make-purge-hard-to-mis-use.patch index 033b575..79964e8 100644 --- a/0001-tmpfiles-make-purge-hard-to-mis-use.patch +++ b/0001-tmpfiles-make-purge-hard-to-mis-use.patch @@ -1,4 +1,4 @@ -From 1e788a7fb535a37a8268aa7dc5130f670eb72a6b Mon Sep 17 00:00:00 2001 +From 45cfee930ab4067348cea5244c9c2dc31c64d14d Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Tue, 23 Jul 2024 13:14:05 +0200 Subject: [PATCH] tmpfiles: make --purge hard to (mis-)use @@ -10,10 +10,10 @@ Follow-up for https://github.com/systemd/systemd/pull/33383. 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c -index 8cc8c1ccd6..14048545db 100644 +index 5a4f989668..c5b544f1df 100644 --- a/src/tmpfiles/tmpfiles.c +++ b/src/tmpfiles/tmpfiles.c -@@ -4197,6 +4197,7 @@ static int parse_argv(int argc, char *argv[]) { +@@ -4213,6 +4213,7 @@ static int parse_argv(int argc, char *argv[]) { ARG_IMAGE_POLICY, ARG_REPLACE, ARG_DRY_RUN, @@ -21,7 +21,7 @@ index 8cc8c1ccd6..14048545db 100644 ARG_NO_PAGER, }; -@@ -4220,10 +4221,18 @@ static int parse_argv(int argc, char *argv[]) { +@@ -4236,10 +4237,18 @@ static int parse_argv(int argc, char *argv[]) { { "replace", required_argument, NULL, ARG_REPLACE }, { "dry-run", no_argument, NULL, ARG_DRY_RUN }, { "no-pager", no_argument, NULL, ARG_NO_PAGER }, @@ -40,7 +40,7 @@ index 8cc8c1ccd6..14048545db 100644 assert(argc >= 0); assert(argv); -@@ -4330,6 +4339,10 @@ static int parse_argv(int argc, char *argv[]) { +@@ -4346,6 +4355,10 @@ static int parse_argv(int argc, char *argv[]) { arg_dry_run = true; break; @@ -51,7 +51,7 @@ index 8cc8c1ccd6..14048545db 100644 case ARG_NO_PAGER: arg_pager_flags |= PAGER_DISABLE; break; -@@ -4349,6 +4362,10 @@ static int parse_argv(int argc, char *argv[]) { +@@ -4365,6 +4378,10 @@ static int parse_argv(int argc, char *argv[]) { return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Refusing --purge without specification of a configuration file."); @@ -63,26 +63,27 @@ index 8cc8c1ccd6..14048545db 100644 return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Option --replace= is not supported with --cat-config/--tldr."); diff --git a/test/units/TEST-22-TMPFILES.18.sh b/test/units/TEST-22-TMPFILES.18.sh -index 5d24197c81..de23bbb95f 100755 +index c81f6bd0ef..dd536172d4 100755 --- a/test/units/TEST-22-TMPFILES.18.sh +++ b/test/units/TEST-22-TMPFILES.18.sh -@@ -21,7 +21,7 @@ systemd-tmpfiles --purge --dry-run - <<<"$c" - test -f /tmp/somedir/somefile +@@ -24,7 +24,7 @@ test -f /tmp/somedir/somefile grep -q baz /tmp/somedir/somefile + grep -q qux /tmp/someotherfile -systemd-tmpfiles --purge - <<<"$c" +systemd-tmpfiles --purge --destroy-data - <<<"$c" test ! -f /tmp/somedir/somefile test ! -d /tmp/somedir/ - -@@ -29,6 +29,6 @@ systemd-tmpfiles --create --purge --dry-run - <<<"$c" - test ! -f /tmp/somedir/somefile + grep -q qux /tmp/someotherfile +@@ -34,7 +34,7 @@ test ! -f /tmp/somedir/somefile test ! -d /tmp/somedir/ + grep -q qux /tmp/someotherfile -systemd-tmpfiles --create --purge - <<<"$c" +systemd-tmpfiles --create --destroy-data --purge - <<<"$c" test -f /tmp/somedir/somefile grep -q baz /tmp/somedir/somefile + grep -q qux /tmp/someotherfile -- -2.45.2 +2.47.0 diff --git a/33738.patch b/33738.patch deleted file mode 100644 index 58ab604..0000000 --- a/33738.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 69c5d6bea7cc2168a2a483d232aa9a77202173f0 Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Tue, 16 Jul 2024 17:46:09 +0200 -Subject: [PATCH] rules: Add uaccess tag to /dev/udmabuf - -In some cases userspace may need to create dmabuffers from userspace -on such example is the software ISP part of libcamera which needs to -allocate dma-buffers for the output of the software ISP. - -At first the plan was to allow console users access to /dev/dma_heap/*, -this was discussed with various kernel folks here: -https://lore.kernel.org/all/bb372250-e8b8-4458-bc99-dd8365b06991@redhat.com/ - -Giving console users access to the dma_heap's was deemed a bad idea -because memory allocated this way is not accounted in cgroup limits. - -Giving access to /dev/udmabuf OTOH was deemed acceptable so that -is what this patch adds. - -Resolves: #32662 ---- - rules.d/70-uaccess.rules.in | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/rules.d/70-uaccess.rules.in b/rules.d/70-uaccess.rules.in -index b82ce04a39d38..e683bb1114461 100644 ---- a/rules.d/70-uaccess.rules.in -+++ b/rules.d/70-uaccess.rules.in -@@ -34,6 +34,8 @@ SUBSYSTEM=="sound", TAG+="uaccess", \ - SUBSYSTEM=="video4linux", TAG+="uaccess" - SUBSYSTEM=="dvb", TAG+="uaccess" - SUBSYSTEM=="media", TAG+="uaccess" -+# libcamera software ISP used with some cams requires udmabuf access -+KERNEL=="udmabuf", TAG+="uaccess" - - # industrial cameras, some webcams, camcorders, set-top boxes, TV sets, audio devices, and more - SUBSYSTEM=="firewire", TEST=="units", ENV{IEEE1394_UNIT_FUNCTION_MIDI}=="1", TAG+="uaccess" diff --git a/34707.patch b/34707.patch deleted file mode 100644 index 5d8e278..0000000 --- a/34707.patch +++ /dev/null @@ -1,233 +0,0 @@ -From da81a108653e2ef19102698dbc0184bd18b084d9 Mon Sep 17 00:00:00 2001 -From: Mike Yuan -Date: Thu, 10 Oct 2024 21:16:05 +0200 -Subject: [PATCH 1/4] core/manager: still send out STATUS=Ready for user - manager - -This effectively reverts 37d15cd132f3a8a0bf42fb252c1604e804171ff2. - -The offending commit wrongly assumed that the second READY=1 -notification is for system scope only, but it also serves the purpose -of flushing out previous STATUS= containing user unit job status. ---- - src/core/manager.c | 14 +++++++------- - 1 file changed, 7 insertions(+), 7 deletions(-) - -diff --git a/src/core/manager.c b/src/core/manager.c -index 2789f0e3d0c9c..456ad46135b72 100644 ---- a/src/core/manager.c -+++ b/src/core/manager.c -@@ -3885,7 +3885,7 @@ static void manager_notify_finished(Manager *m) { - log_taint_string(m); - } - --static void manager_send_ready_user_scope(Manager *m) { -+static void manager_send_ready_on_basic_target(Manager *m) { - int r; - - assert(m); -@@ -3904,18 +3904,18 @@ static void manager_send_ready_user_scope(Manager *m) { - m->status_ready = false; - } - --static void manager_send_ready_system_scope(Manager *m) { -+static void manager_send_ready_on_idle(Manager *m) { - int r; - - assert(m); - -- if (!MANAGER_IS_SYSTEM(m)) -- return; -- - /* Skip the notification if nothing changed. */ - if (m->ready_sent && m->status_ready) - return; - -+ /* Note that for user managers, we might have already sent READY=1 in manager_send_ready_user_scope(). -+ * But we still need to flush STATUS=. The second READY=1 will be treated as a noop so it doesn't -+ * hurt to send it twice. */ - r = sd_notify(/* unset_environment= */ false, - "READY=1\n" - "STATUS=Ready."); -@@ -3940,7 +3940,7 @@ static void manager_check_basic_target(Manager *m) { - return; - - /* For user managers, send out READY=1 as soon as we reach basic.target */ -- manager_send_ready_user_scope(m); -+ manager_send_ready_on_basic_target(m); - - /* Log the taint string as soon as we reach basic.target */ - log_taint_string(m); -@@ -3971,7 +3971,7 @@ void manager_check_finished(Manager *m) { - if (hashmap_buckets(m->jobs) > hashmap_size(m->units) / 10) - m->jobs = hashmap_free(m->jobs); - -- manager_send_ready_system_scope(m); -+ manager_send_ready_on_idle(m); - - /* Notify Type=idle units that we are done now */ - manager_close_idle_pipe(m); - -From 155098a702c4f6de6b1dca534661492625773fed Mon Sep 17 00:00:00 2001 -From: Mike Yuan -Date: Thu, 10 Oct 2024 21:06:35 +0200 -Subject: [PATCH 2/4] core/manager-serialize: drop serialization for - Manager.ready_sent - -This field indicates whether READY=1 has been sent to -the service manager/supervisor. Whenever we reload/reexec/soft-reboot, -manager_send_reloading() always resets it to false first, -so that READY=1 is sent after reloading finishes. Hence -we utterly get "false" at all times. Kill it. ---- - src/core/manager-serialize.c | 12 +----------- - 1 file changed, 1 insertion(+), 11 deletions(-) - -diff --git a/src/core/manager-serialize.c b/src/core/manager-serialize.c -index 62dfce93a0a85..3f624619dfd19 100644 ---- a/src/core/manager-serialize.c -+++ b/src/core/manager-serialize.c -@@ -92,7 +92,6 @@ int manager_serialize( - (void) serialize_item_format(f, "current-job-id", "%" PRIu32, m->current_job_id); - (void) serialize_item_format(f, "n-installed-jobs", "%u", m->n_installed_jobs); - (void) serialize_item_format(f, "n-failed-jobs", "%u", m->n_failed_jobs); -- (void) serialize_bool(f, "ready-sent", m->ready_sent); - (void) serialize_bool(f, "taint-logged", m->taint_logged); - (void) serialize_bool(f, "service-watchdogs", m->service_watchdogs); - -@@ -356,15 +355,6 @@ int manager_deserialize(Manager *m, FILE *f, FDSet *fds) { - else - m->n_failed_jobs += n; - -- } else if ((val = startswith(l, "ready-sent="))) { -- int b; -- -- b = parse_boolean(val); -- if (b < 0) -- log_notice("Failed to parse ready-sent flag '%s', ignoring.", val); -- else -- m->ready_sent = m->ready_sent || b; -- - } else if ((val = startswith(l, "taint-logged="))) { - int b; - -@@ -558,7 +548,7 @@ int manager_deserialize(Manager *m, FILE *f, FDSet *fds) { - - if (q < _MANAGER_TIMESTAMP_MAX) /* found it */ - (void) deserialize_dual_timestamp(val, m->timestamps + q); -- else if (!STARTSWITH_SET(l, "kdbus-fd=", "honor-device-enumeration=")) /* ignore deprecated values */ -+ else if (!STARTSWITH_SET(l, "kdbus-fd=", "honor-device-enumeration=", "ready-sent=")) /* ignore deprecated values */ - log_notice("Unknown serialization item '%s', ignoring.", l); - } - } - -From a375e145190482e8a2f0971bffb332e31211622f Mon Sep 17 00:00:00 2001 -From: Mike Yuan -Date: Thu, 10 Oct 2024 21:32:17 +0200 -Subject: [PATCH 3/4] units/{user,capsule}@.service: issue daemon-reexec when - notify-reloading - -Closes #28367 (but not really in the exact form, see below) - -We have the problem of restarting all user manager instances -after upgrade. Current approaches involve systemctl kill -with SIGRTMIN+25, which is async and feels rather ugly [1][2]; -or systemctl --machine=user@ --user, which requires entering -each user session. Neither is particularly elegant. -Instead, let's just signal daemon-reexec when user@.service -is reloaded from system manager. Our long goal of dropping -daemon-reload in favor of reexec (see TODO) is unlikely to happen -due to user dbus restrictions, but here the synchronization -is done via READY=1. - -[1] https://gitlab.archlinux.org/archlinux/packaging/packages/systemd/-/blob/main/systemd.install?ref_type=heads#L37 -[2] https://salsa.debian.org/systemd-team/systemd/-/blob/debian/master/debian/systemd.postinst#L24 - -#28367 would not really work for us now I come to think about it, -because all processes will be reparented to pid1 as soon as -original user manager process exits. This alternative approach -seems good enough for our use case. ---- - units/capsule@.service.in | 4 ++++ - units/user@.service.in | 4 ++++ - 2 files changed, 8 insertions(+) - -diff --git a/units/capsule@.service.in b/units/capsule@.service.in -index f2bb9e3a45a83..a64298786e490 100644 ---- a/units/capsule@.service.in -+++ b/units/capsule@.service.in -@@ -23,6 +23,10 @@ StateDirectory=capsules/%i - RuntimeDirectory=capsules/%i - LogExtraFields=CAPSULE=%i - Slice=capsule.slice -+# Reexecute the manager on service reload, instead of reloading. -+# This provides a synchronous method for restarting all user manager -+# instances after upgrade. -+ReloadSignal=RTMIN+25 - KillMode=mixed - Delegate=pids memory cpu - DelegateSubgroup=init.scope -diff --git a/units/user@.service.in b/units/user@.service.in -index 5695465747217..381ab2a0db54e 100644 ---- a/units/user@.service.in -+++ b/units/user@.service.in -@@ -20,6 +20,10 @@ PAMName=systemd-user - Type=notify-reload - ExecStart={{LIBEXECDIR}}/systemd --user - Slice=user-%i.slice -+# Reexecute the manager on service reload, instead of reloading. -+# This provides a synchronous method for restarting all user manager -+# instances after upgrade. -+ReloadSignal=RTMIN+25 - KillMode=mixed - Delegate=pids memory cpu - DelegateSubgroup=init.scope - -From 2d0af8bc354f4a1429cebedfb387af72c88720a0 Mon Sep 17 00:00:00 2001 -From: Daan De Meyer -Date: Thu, 10 Oct 2024 22:37:39 +0200 -Subject: [PATCH 4/4] rpm/systemd-update-helper: Use systemctl reload to - reexec/reload user managers - -Let's always use systemctl reload to reexec and reload user managers -now that it always implies a reexec. This moves all the job management -logic to pid 1 instead of bash and reduces the complexity of the logic -as we remove systemd-run, pam and systemd-stdio-bridge from the equation. ---- - src/rpm/systemd-update-helper.in | 20 ++++---------------- - 1 file changed, 4 insertions(+), 16 deletions(-) - -diff --git a/src/rpm/systemd-update-helper.in b/src/rpm/systemd-update-helper.in -index c81e16c3d3ffb..8af914935261a 100755 ---- a/src/rpm/systemd-update-helper.in -+++ b/src/rpm/systemd-update-helper.in -@@ -107,25 +107,13 @@ case "$command" in - - [ -d /run/systemd/system ] || exit 0 - -- users=$(systemctl list-units 'user@*' --legend=no | sed -n -r 's/.*user@([0-9]+).service.*/\1/p') -- -- if [[ "$command" =~ reexec ]]; then -- for user in $users; do -- SYSTEMD_BUS_TIMEOUT={{UPDATE_HELPER_USER_TIMEOUT_SEC}}s \ -- systemctl --user -M "$user@" daemon-reexec & -- done -- wait -- fi -- -- if [[ "$command" =~ reload ]]; then -- for user in $users; do -- SYSTEMD_BUS_TIMEOUT={{UPDATE_HELPER_USER_TIMEOUT_SEC}}s \ -- systemctl --user -M "$user@" daemon-reload & -- done -- wait -+ if [[ "$command" =~ reexec|reload ]]; then -+ SYSTEMD_BUS_TIMEOUT={{UPDATE_HELPER_USER_TIMEOUT_SEC}}s systemctl reload "user@*.service" - fi - - if [[ "$command" =~ restart ]]; then -+ users=$(systemctl list-units 'user@*' --legend=no | sed -n -r 's/.*user@([0-9]+).service.*/\1/p') -+ - for user in $users; do - SYSTEMD_BUS_TIMEOUT={{UPDATE_HELPER_USER_TIMEOUT_SEC}}s \ - systemctl --user -M "$user@" reload-or-restart --marked & diff --git a/systemd.spec b/systemd.spec index 6a962cd..6d2f175 100644 --- a/systemd.spec +++ b/systemd.spec @@ -47,7 +47,7 @@ Name: systemd Url: https://systemd.io # Allow users to specify the version and release when building the rpm by # setting the %%version_override and %%release_override macros. -Version: %{?version_override}%{!?version_override:256.7} +Version: %{?version_override}%{!?version_override:257~rc1} Release: %autorelease %global stable %(c="%version"; [ "$c" = "${c#*.*}" ]; echo $?) @@ -114,12 +114,6 @@ GIT_DIR=../../src/systemd/.git git diffab -M v233..master@{2017-06-15} -- hwdb/[ Patch0010: https://github.com/systemd/systemd/pull/26494.patch %endif -# Requested in https://bugzilla.redhat.com/show_bug.cgi?id=2298422 -Patch0011: https://github.com/systemd/systemd/pull/33738.patch - -# Simplify user manager upgrades -Patch0012: https://github.com/systemd/systemd/pull/34707.patch - # Those are downstream-only patches, but we don't want them in packit builds: # https://bugzilla.redhat.com/show_bug.cgi?id=2251843 Patch0491: https://github.com/systemd/systemd/pull/30846.patch