From b49b06245f92a87fbe50ccf6b34ef1f2957e782298c13748ca8d75435731f612 Mon Sep 17 00:00:00 2001 From: Fabian Vogt Date: Thu, 24 Mar 2022 12:31:18 +0000 Subject: [PATCH] Accepting request 964647 from home:favogt:combustion - Bump version to 0.3 - Use the Wiki page as URL (boo#1195383) - Don't touch /sysroot/etc/ after creating a new snapshot, it ends up in the old snapshot's overlay - Disable ignition-mount.service's ExecStop instead of stopping the unit (boo#1197309) - Be more --quiet with systemctl OBS-URL: https://build.opensuse.org/request/show/964647 OBS-URL: https://build.opensuse.org/package/show/devel:kubic:ignition/combustion?expand=0&rev=26 --- combustion | 18 ++++++------------ combustion.changes | 19 +++++++++++++++++++ combustion.spec | 4 ++-- module-setup.sh | 6 ++++++ 4 files changed, 33 insertions(+), 14 deletions(-) diff --git a/combustion b/combustion index 12a192e..8af0419 100644 --- a/combustion +++ b/combustion @@ -92,21 +92,16 @@ cleanup() { # (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 + if ! systemctl --quiet is-active does-not-exist.mount; then + while systemctl --quiet is-active sysroot.mount; do sleep 0.5; done fi systemctl start sysroot.mount } +# Note: The /sysroot remounting during cleanup happens unconditionally. +# This is needed as ignition-mount.service's ExecStop is also disabled unconditionally. trap cleanup EXIT -# ignition-mount.service mounts stuff below /sysroot in ExecStart and umounts -# it on ExecStop, failing if umounting fails. This conflicts with the -# mounts/umounts done by combustion. Ignition is already done, so just stop it. -if systemctl --quiet is-active ignition-mount.service; then - systemctl stop ignition-mount.service -fi - if ! [ -d "${config_mount}/combustion" ]; then echo "No config found - doing nothing." exit 0 @@ -165,6 +160,8 @@ if [ -x /sysroot/usr/sbin/transactional-update ]; then chmod a+x script ./script echo \$? > "${exchangedir}/retval" + # Snapshot got touched while the policy isn't active, needs relabeling again. + [ -e /etc/selinux/.relabelled ] && >> /etc/selinux/.autorelabel EOF echo "transactional-update failed" exit 1 @@ -175,9 +172,6 @@ EOF chroot /sysroot transactional-update --no-selfupdate rollback exit 1 fi - - # Snapshot got touched while the policy isn't active, needs relabeling again. - [ -e /sysroot/etc/selinux/.relabelled ] && >> /sysroot/etc/selinux/.autorelabel else mount -o remount,rw /sysroot if ! chroot /sysroot sh -e -c "cd '${config_dir}'; chmod a+x script; ./script"; then diff --git a/combustion.changes b/combustion.changes index d9f4bf4..bb196ee 100644 --- a/combustion.changes +++ b/combustion.changes @@ -1,3 +1,22 @@ +------------------------------------------------------------------- +Thu Mar 24 09:40:34 UTC 2022 - Fabian Vogt + +- Bump version to 0.3 +- Use the Wiki page as URL (boo#1195383) +- Don't touch /sysroot/etc/ after creating a new snapshot, it ends up + in the old snapshot's overlay + +------------------------------------------------------------------- +Wed Mar 23 15:15:15 UTC 2022 - Fabian Vogt + +- Disable ignition-mount.service's ExecStop instead of stopping the + unit (boo#1197309) + +------------------------------------------------------------------- +Mon Mar 21 13:20:39 UTC 2022 - Fabian Vogt + +- Be more --quiet with systemctl + ------------------------------------------------------------------- Thu Mar 3 11:58:07 UTC 2022 - Fabian Vogt diff --git a/combustion.spec b/combustion.spec index 2268ba8..d4d961d 100644 --- a/combustion.spec +++ b/combustion.spec @@ -17,12 +17,12 @@ Name: combustion -Version: 0.2 +Version: 0.3 Release: 0 Summary: System for initial configuration of appliances License: GPL-2.0-or-later Group: System/Management -URL: https://build.opensuse.org/package/show/home:Vogtinator:combustion/combustion +URL: https://en.opensuse.org/Portal:MicroOS/Combustion Source1: LICENSE Source2: README Source3: module-setup.sh diff --git a/module-setup.sh b/module-setup.sh index 1322306..c894a9a 100644 --- a/module-setup.sh +++ b/module-setup.sh @@ -11,6 +11,12 @@ install() { inst_multiple awk chroot findmnt grep rmdir inst_simple "${moddir}/combustion" "/usr/bin/combustion" + # ignition-mount.service mounts stuff below /sysroot in ExecStart and umounts + # it on ExecStop, failing if umounting fails. This conflicts with the + # mounts/umounts done by combustion. Just let combustion do it instead. + mkdir -p "${initdir}/${systemdsystemunitdir}/ignition-mount.service.d/" + echo -e "[Service]\nExecStop=" > "${initdir}/${systemdsystemunitdir}/ignition-mount.service.d/noexecstop.conf" + # Wait up to 10s (30s on aarch64) for the config drive devtimeout=10 [ "$(uname -m)" = "aarch64" ] && devtimeout=30