Repository navigation
Conversation
…an inode table sized to the tree pack_image sized an image from du -sb, the bytes in its tree, plus an eighth and 16 MiB. Every image is ext4 in 4096-byte blocks, so each file takes whole blocks: a tree of many small files counted far less than it needs, and mke2fs would fail with no room. And mke2fs.conf's small type gives a file system under 512 MiB one inode per 4 KiB, a sixteenth of the image in an inode table a read-only image never fills. The size now counts blocks, with a sixteenth for extent and index blocks, 256 bytes an inode and 16 MiB for the bitmaps and group descriptors; make_ext4 takes the inode count, the tree's entries plus an eighth and 64. The root image keeps mke2fs.conf's ratio.
DevomB
added a commit
that referenced
this pull request
Oct 16, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A software image is sized from the 4 KiB blocks its tree takes, with an inode table sized to the tree, so an image of many small files fits.
pack_imagesized an image fromdu -sb, the bytes in its tree, plus an eighth and 16 MiB. Since every image is ext4 in 4096-byte blocks (#531), each file takes whole blocks. A tree of 100,000 one-KiB files counts as 100 MiB but needs 390 MiB of blocks, and mke2fs fails with no room. On top of that, mke2fs.conf'ssmalltype gives a file system under 512 MiB one inode per 4 KiB: 6.25 % of the image is inode table that a read-only image never fills.make_ext4takes the inode count as an optional sixth argument (-N): the tree's entries plus an eighth plus 64. The root image passes none, and keeps mke2fs.conf's ratio, as before.Checked:
bash -n. The awk was run on a sample of a file of 100 and one of 5000 bytes, directories of 4096, 0 and 12288 bytes, symlinks of 20 and 80 bytes and an empty file: 9 blocks, 8 entries. The images job's own checks still hold: two mke2fs runs give the same image, and the block size is 4096.The images' own fingerprints (image_inputs in 04-images.sh) do not cover 06-iso.sh, so a cached image build stays current; stage 06 packs anew. Not urgent: today's images fit.