Accepting request 839821 from devel:kubic:ignition

OBS-URL: https://build.opensuse.org/request/show/839821
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/combustion?expand=0&rev=5
This commit is contained in:
Dominique Leuenberger 2020-10-07 12:17:40 +00:00 committed by Git OBS Bridge
commit 7c43ba9943
3 changed files with 43 additions and 15 deletions

View File

@ -89,6 +89,13 @@ if ! [ -d "${config_mount}/combustion" ]; then
exit 0 exit 0
fi fi
# 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
# Copy config # Copy config
mkdir "${exchangedir}" mkdir "${exchangedir}"
config_dir="${exchangedir}/config" config_dir="${exchangedir}/config"
@ -125,20 +132,29 @@ if [ -r /etc/resolv.conf ]; then
fi fi
fi fi
# t-u doesn't allow running arbitrary commands and if [ -x /sysroot/usr/sbin/transactional-update ]; then
# also ignores the shell's exit code, so DIY. # t-u doesn't allow running arbitrary commands and
if ! chroot /sysroot transactional-update shell <<EOF; then # also ignores the shell's exit code, so DIY.
cd "${config_dir}" if ! chroot /sysroot transactional-update shell <<EOF; then
chmod a+x script cd "${config_dir}"
./script chmod a+x script
echo \$? > "${exchangedir}/retval" ./script
echo \$? > "${exchangedir}/retval"
EOF EOF
echo "transactional-update failed" echo "transactional-update failed"
exit 1 exit 1
fi fi
if [ "$(cat "${exchangedir}/retval")" -ne 0 ]; then if ! [ -e "${exchangedir}/retval" ] || [ "$(cat "${exchangedir}/retval")" -ne 0 ]; then
echo "Command failed, rolling back" echo "Command failed, rolling back"
chroot /sysroot transactional-update --no-selfupdate rollback chroot /sysroot transactional-update --no-selfupdate rollback
exit 1 exit 1
fi
else
mount -o remount,rw /sysroot
if ! chroot /sysroot sh -e -c "cd '${config_dir}'; chmod a+x script; ./script"; then
echo "Command failed"
exit 1
fi
chroot /sysroot snapper --no-dbus create -d "After combustion configuration" || :
fi fi

View File

@ -1,3 +1,15 @@
-------------------------------------------------------------------
Tue Oct 6 10:19:57 UTC 2020 - Fabian Vogt <fvogt@suse.com>
- Implement support for systems without transactional-update
- Require rmdir explicitly
-------------------------------------------------------------------
Mon Oct 5 08:33:19 UTC 2020 - Fabian Vogt <fvogt@suse.com>
- Fail properly when the retval file doesn't exist
- Stop ignition-mount.service to avoid conflict (boo#1176746)
------------------------------------------------------------------- -------------------------------------------------------------------
Thu Sep 17 10:56:44 UTC 2020 - Fabian Vogt <fvogt@suse.com> Thu Sep 17 10:56:44 UTC 2020 - Fabian Vogt <fvogt@suse.com>

View File

@ -8,7 +8,7 @@ install() {
inst_simple "${moddir}/combustion.rules" "/etc/udev/rules.d/70-combustion.rules" inst_simple "${moddir}/combustion.rules" "/etc/udev/rules.d/70-combustion.rules"
mkdir -p "${initdir}/${systemdsystemunitdir}/initrd.target.requires/" mkdir -p "${initdir}/${systemdsystemunitdir}/initrd.target.requires/"
ln_r "../combustion.service" "${systemdsystemunitdir}/initrd.target.requires/combustion.service" ln_r "../combustion.service" "${systemdsystemunitdir}/initrd.target.requires/combustion.service"
inst_multiple awk chroot findmnt inst_multiple awk chroot findmnt rmdir
inst_simple "${moddir}/combustion" "/usr/bin/combustion" inst_simple "${moddir}/combustion" "/usr/bin/combustion"
# Wait up to 10s (30s on aarch64) for the config drive # Wait up to 10s (30s on aarch64) for the config drive