Skip to content

Commit

Permalink
coreos-boot-edit: inject boot= karg on first boot
Browse files Browse the repository at this point in the history
This ensures that the rootfs will always mount the correct boot
filesystem in the future (see previous patch).

Part of: coreos/fedora-coreos-tracker#976
  • Loading branch information
jlebon authored and HuijingHei committed Oct 10, 2023
1 parent 330fa9e commit d49ab3d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,16 @@ root=$(karg root)
if [ -z "${root}" ]; then
rdcore rootmap /sysroot --boot-mount ${bootmnt}
fi

# And similarly, only inject boot= if it's not already present.
boot=$(karg boot)
if [ -z "${boot}" ]; then
# XXX: `rdcore rootmap --inject-boot-karg` or maybe `rdcore bootmap`
eval $(blkid -o export "${bootdev}")
if [ -z "${UUID}" ]; then
# This should never happen
echo "Boot filesystem ${bootdev} has no UUID" >&2
exit 1
fi
rdcore kargs --boot-mount ${bootmnt} --append boot=UUID=${UUID}
fi
4 changes: 4 additions & 0 deletions tests/kola/root-reprovision/luks/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ case "${AUTOPKGTEST_REBOOT_MARK:-}" in
grep root=UUID= /proc/cmdline
grep rd.luks.name= /proc/cmdline
ok "found root kargs"

# while we're here, sanity-check that we have a boot=UUID karg too
grep boot=UUID= /proc/cmdline
ok "found boot karg"
;;
*) fatal "unexpected mark: ${AUTOPKGTEST_REBOOT_MARK}";;
esac

0 comments on commit d49ab3d

Please sign in to comment.