From 0eee5712fd90c398ee1877471821c6346c062d3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kai=20L=C3=BCke?= Date: Tue, 8 Sep 2026 16:43:24 +0900 Subject: [PATCH] sysext: Order sysext unit after confext to provide guarantees Up to now there was no clear ordering of confext and sysext units. Normally, configuration should be able to influence the behavior of services (config files or unit drop-ins), so it makes sense to order confext before sysext. The mounting from the initrd for the final system makes this less important together with the fact that live merges/ refreshes can encode unit restarts now. Yet I think it's better to know what gets merged first and if wanted one can avoid encoding restarts if one doesn't care about later live content changes. Where it matters more for me is consistent behavior for the refresh check during boot for non-verity images because they get compared by file handle and mount ID which means whether the overlay was set up or not determines the identity and decides if we do a refresh or not and this should not vary by boot merely due to timing or other dependencies impacting the ordering. (Note that one extension type shipping another extension type is not the reason for the ordering and these cycles should be avoided because they never free the mounts and backing loop devices.) (cherry picked from commit 7197b862b2a132ea044fed59d914d5eb3e8ae9dd) --- units/systemd-sysext-initrd.service | 1 + units/systemd-sysext-sysroot.service | 1 + units/systemd-sysext.service | 1 + 3 files changed, 3 insertions(+) diff --git a/units/systemd-sysext-initrd.service b/units/systemd-sysext-initrd.service index 2d9fb59cf2..de106abad3 100644 --- a/units/systemd-sysext-initrd.service +++ b/units/systemd-sysext-initrd.service @@ -21,6 +21,7 @@ ConditionPathExists=/etc/initrd-release ConditionKernelCommandLine=!rd.systemd.sysext=0 DefaultDependencies=no +After=systemd-confext-initrd.service Before=local-fs-pre.target cryptsetup-pre.target systemd-tmpfiles-setup.service Wants=local-fs-pre.target cryptsetup-pre.target Conflicts=initrd-switch-root.target diff --git a/units/systemd-sysext-sysroot.service b/units/systemd-sysext-sysroot.service index d68c70da69..b6a586925e 100644 --- a/units/systemd-sysext-sysroot.service +++ b/units/systemd-sysext-sysroot.service @@ -18,6 +18,7 @@ ConditionPathExists=/etc/initrd-release ConditionKernelCommandLine=!systemd.sysext=0 DefaultDependencies=no +After=systemd-confext-sysroot.service Conflicts=shutdown.target Before=initrd-root-fs.target shutdown.target Wants=modprobe@loop.service modprobe@dm_mod.service diff --git a/units/systemd-sysext.service b/units/systemd-sysext.service index 3246ea7fb7..1ee16be617 100644 --- a/units/systemd-sysext.service +++ b/units/systemd-sysext.service @@ -20,6 +20,7 @@ ConditionPathExists=!/etc/initrd-release ConditionKernelCommandLine=!systemd.sysext=0 DefaultDependencies=no +After=systemd-confext.service After=local-fs.target Before=sysinit.target systemd-tmpfiles-setup.service Conflicts=shutdown.target