Skip to content

Commit

Permalink
create_disk.sh: opt out of EXT4 orphan_file feature on older targets
Browse files Browse the repository at this point in the history
Fedora 39 has a newer e2fsprogs whose `mkfs.ext4` now turns on a new
`orphan_file` feature by default. This feature is not supported by the
`e2fsck` currently in RHEL 9.

As mentioned in the comment, ideally we'd use the `mkfs.*` tools
from the target system and not from cosa. But for now, just do some
version testing to know when to opt out to avoid having to add another
`image.yaml` knob for it.

See: #3653 (comment)
  • Loading branch information
jlebon committed Nov 16, 2023
1 parent 6d638cf commit 1c280e7
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/create_disk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,21 @@ bootargs=
if [ "${bootfs_metadata_csum_seed}" == "true" ]; then
bootargs="-O metadata_csum_seed"
fi

# Detect if the target system supports orphan_file.
# https://github.com/coreos/coreos-assembler/pull/3653#issuecomment-1813181723
# Ideally, we'd do feature detection here but there's no clean way to do that.
# So just use version comparisons. (But ideally ideally, we use the mkfs.*
# binaries from the target system, not cosa.)
e2fsprogs_version=$(jq -r '.["rpmostree.rpmdb.pkglist"][] | select(.[0] == "e2fsprogs") | .[2]' \
"builds/${buildid}/${arch}/commitmeta.json")
if [ "${e2fsprogs_version}" != "1.47.0" ] && \
[ "$(echo -e "${e2fsprogs_version}\n1.47.0" | sort -V | tail -n1)" = "1.47.0" ]; then
# target system has e2fsprogs older than 1.47.0; it won't support
# orphan_file so make sure we opt out of it
bootargs+="-O ^orphan_file"
fi

case "${bootfs}" in
ext4verity)
# Need blocks to match host page size; TODO
Expand Down

0 comments on commit 1c280e7

Please sign in to comment.