Files
systemd/units/systemd-sysext-sysroot.service
T
Kai Lüke 0eee5712fd 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)
2026-10-16 11:36:32 +01:00

34 lines
1.1 KiB
Desktop File

# SPDX-License-Identifier: LGPL-2.1-or-later
#
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
[Unit]
Description=Merge System Extension Images into /sysroot/usr/ and /sysroot/opt/
Documentation=man:systemd-sysext-sysroot.service(8)
ConditionCapability=CAP_SYS_ADMIN
ConditionDirectoryNotEmpty=|/sysroot/etc/extensions
ConditionDirectoryNotEmpty=|/sysroot/var/lib/extensions
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
After=modprobe@loop.service modprobe@dm_mod.service sysroot.mount sysroot-usr.mount systemd-volatile-root.service
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=systemd-sysext --root=/sysroot refresh
[Install]
WantedBy=initrd.target