Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: partitioning: disable orphan_file (FEATURE_C12) for ext4 filesystems on 1.47+ e2fsprogs host #6809

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions lib/functions/image/partitioning.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,19 @@ function prepare_partitions() {
# parttype[nfs] is empty

mkopts[ext4]="-q -m 2" # for a long time we had '-O ^64bit,^metadata_csum' here
# Hack: newer versions of e2fsprogs in combination with recent kernels enable orphan_file (FEATURE_C12) by default; that can't be handled by older versions of e2fsprogs
# at the same time, older versions don't know about orphan_file at all, so we can't simply disable for all.
# run & parse the version of e2fsprogs to determine if we need to disable orphan_file
declare e2fsprogs_version
e2fsprogs_version=$(e2fsck -V 2>&1 | head -1 | cut -d " " -f 2 | xargs echo -n)
# use linux-version compare to check if the version is at least 1.47
if linux-version compare "${e2fsprogs_version}" ge "1.47"; then
display_alert "e2fsprogs version" "$e2fsprogs_version supports orphan_file" "info"
mkopts[ext4]="-q -m 2 -O ^orphan_file"
else
display_alert "e2fsprogs version" "$e2fsprogs_version does not support orphan_file" "info"
fi

# mkopts[fat] is empty
mkopts[ext2]=''
# mkopts[f2fs] is empty
Expand Down