diff --git a/combustion b/combustion index 78450c9..caba864 100644 --- a/combustion +++ b/combustion @@ -79,6 +79,15 @@ cleanup() { # umount and remount so that the new default subvol is used umount -R /sysroot + # Manual umount confuses systemd sometimes because it's async and the + # .mount unit might still be active when the "start" is queued, making + # it a noop, which ultimately leaves /sysroot unmounted + # (https://github.com/systemd/systemd/issues/20329). To avoid that, + # wait until systemd processed the umount events. In a chroot (or with + # SYSTEMD_OFFLINE=1) systemctl always succeeds, so avoid an infinite loop. + if ! systemctl is-active does-not-exist.mount; then + while systemctl is-active sysroot.mount; do sleep 0.5; done + fi systemctl start sysroot.mount } @@ -96,6 +105,9 @@ if ! [ -d "${config_mount}/combustion" ]; then exit 0 fi +# Make sure /sysroot is mounted +systemctl start sysroot.mount + # Copy config mkdir "${exchangedir}" config_dir="${exchangedir}/config" diff --git a/combustion.changes b/combustion.changes index d1784f4..ea4957d 100644 --- a/combustion.changes +++ b/combustion.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue Jul 27 06:37:56 UTC 2021 - Fabian Vogt + +- Drop explicit dependency on sysroot.mount. Instead, handle starting and + stopping of the unit explicitly to avoid conflicts. +- Add workaround for gh#systemd/systemd#20329 + ------------------------------------------------------------------- Mon Jun 21 07:07:23 UTC 2021 - Fabian Vogt diff --git a/combustion.service b/combustion.service index 129c61a..d69426a 100644 --- a/combustion.service +++ b/combustion.service @@ -5,8 +5,10 @@ DefaultDependencies=false ConditionKernelCommandLine=|ignition.firstboot ConditionKernelCommandLine=|combustion.firstboot -Requires=sysroot.mount -After=sysroot.mount +# /sysroot needs to be available, but it's temporarily stopped +# for remounting so a direct requirement is not possible +Requires=initrd-root-device.target +After=initrd-root-device.target # combustion-prepare sets up network, if required Requires=combustion-prepare.service