Skip to content

Commit

Permalink
coreos-boot-edit: persist boot UUID in /run
Browse files Browse the repository at this point in the history
The new `boot` karg will only show up on the second boot and onwards. So
for the first boot, let's persist it in `/run` to tell
`coreos-boot-mount-generator` the UUID to use.
  • Loading branch information
jlebon committed Oct 1, 2021
1 parent d03db1c commit fd174d9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,7 @@ if [ -z "${boot}" ]; then
exit 1
fi
rdcore kargs --boot-mount ${bootmnt} --append boot=UUID=${UUID}
# but also put it in /run for the first boot real root mount
mkdir -p /run/coreos
echo "${UUID}" > /run/coreos/bootfs_uuid
fi
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ elif [ -n "${bootkarg}" ]; then
/dev/*) bootdev=$bootkarg;;
*) echo "Unknown boot karg '${bootkarg}'; falling back to ${bootdev}";;
esac
# This is used for the first boot only
elif [ -f /run/coreos/bootfs_uuid ]; then
bootdev=/dev/disk/by-uuid/$(cat /run/coreos/bootfs_uuid)
fi

# We mount read-only by default mostly to protect
Expand Down

0 comments on commit fd174d9

Please sign in to comment.