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

feat: make ext4 building require less memory #89

Merged
merged 1 commit into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions build
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ container_engine=podman
target_dir=.build

container_run_opts=(
--memory 4G
--security-opt seccomp=unconfined
--security-opt apparmor=unconfined
--security-opt label=disable
Expand Down
7 changes: 4 additions & 3 deletions builder/image.d/make_reproducible_ext4
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,13 @@ export E2FSPROGS_FAKE_TIME=$timestamp
uuid=${uuid:-$(echo -n "$hash_prefix:uuid" | uuid_hash)}
hash_seed=$(echo -n "$hash_prefix:hash_seed" | uuid_hash)

large_journal_options=()
if [ "$resize" = 1 ] && [ "$large_journal" = 1 ]; then
# pretend disk is 64GB in size to get sane defaults for journal size
truncate -s 64G "$target"
truncate -s +1G "$target"
large_journal_options+=(-J size=512)
fi

mke2fs -t ext4 -b 4096 -E hash_seed="$hash_seed" -U "$uuid" ${label:+"-L"} ${label:+"$label"} -I 256 -d "$source" "$target"
mke2fs -t ext4 -b 4096 "${large_journal_options[@]}" -E hash_seed="$hash_seed" -U "$uuid" ${label:+"-L"} ${label:+"$label"} -I 256 -d "$source" "$target"

if [ "$quota" = 1 ]; then
tune2fs -Q usrquota,grpquota,prjquota "$target"
Expand Down