Skip to content

Commit

Permalink
feat: make ext4 building require less memory => allow building with 4…
Browse files Browse the repository at this point in the history
…G mem cap
  • Loading branch information
nkraetzschmar committed Jul 4, 2024
1 parent 11da873 commit 29f040f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
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=(
--cgroup-conf=memory.high=4294967296
--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

0 comments on commit 29f040f

Please sign in to comment.