Skip to content

Commit

Permalink
create_disk: add support for bootfs_metadata_csum_seed image.yaml knob
Browse files Browse the repository at this point in the history
Add support for a bootfs_metadata_csum_seed image.yaml knob that tells
us to enable the metadata_csum_seed ext4 filesystem feature. This is
gated behind an image.yaml knob because support for this feature flag
was only recently added to grub.
https://lists.gnu.org/archive/html/grub-devel/2021-06/msg00031.html

This helps us not have to run a filesystem check before running tune2fs
to randomize the filesystem UUID on first boot. See
coreos/fedora-coreos-tracker#735 for more context.

The knob in image.yaml will look like:

```
bootfs_metadata_csum_seed: true
```
  • Loading branch information
dustymabe authored and ravanelli committed Aug 25, 2021
1 parent 4adf902 commit f9b1da3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/create_disk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ os_name=$(getconfig "osname")
rootfs_size=$(getconfig "rootfs-size")
buildid=$(getconfig "buildid")
imgid=$(getconfig "imgid")
bootfs_metadata_csum_seed=$(getconfig_def "bootfs_metadata_csum_seed" "false")

set -x

Expand Down Expand Up @@ -157,6 +158,14 @@ udevtrig
root_dev="${disk}${ROOTPN}"

bootargs=
# If the bootfs_metadata_csum_seed image.yaml knob is set to true then
# we'll enable the metadata_csum_seed filesystem feature. This is
# gated behind an image.yaml knob because support for this feature
# flag was only recently added to grub.
# https://lists.gnu.org/archive/html/grub-devel/2021-06/msg00031.html
if [ "${bootfs_metadata_csum_seed}" == "true" ]; then
bootargs="-O metadata_csum_seed"
fi
case "${bootfs}" in
ext4verity)
# Need blocks to match host page size; TODO
Expand Down

0 comments on commit f9b1da3

Please sign in to comment.