Fixes for make_ext4fs / mkfs.ext4(mke2fs)

Alex Zakharov uglym8 at gmail.com
Mon Oct 16 11:03:17 UTC 2023


Hey all,
While waiting for my Salsa login approval I decided to introduce the
changes that might be interesting for the reproducibility topic.
At the moment *https://reproducible-builds.org/docs/system-images/
<https://reproducible-builds.org/docs/system-images/>* suggests you:
"Instead of using mkfs.ext, make_ext4fs can be used. make_ext4fs is
creating the whole filesystem at once."

I think we can mention (after verification, see below please) that now we
can also use mkfs.ext4 (mke2fs)
https://github.com/tytso/e2fsprogs/pull/164 (although I am not sure that I
covered all but the simple case here).

I'd like to also propose a few fixes for make_ext4fs as well, namely:
- Adding proper hard links support (try to use a directory with two files,
say, perf and trace, that are hard links, and see that current make_ext4fs
will create two files each having hard link of 1, thus doubling the
occupied storage size)
- (Optional) different handling of lost+found directory (the current one
though being correct, is not the best implementation:
questionable/redundant calloc() and memcpy() and memory leaks)
- (Optional) Add CFLAGS_EXTRA and LDFLAGS_EXTRA to facilitate the cross
compiling (verified on ARM). You can easily cross compile it like this:

CC=arm-linux-gnueabihf-gcc EXTRA_CFLAGS=-I/home/xxxx/arm_build/zlib-1.2.13/
EXTRA_LDFLAGS=-L/home/xxxx/make_ext4fs_works/repo/arm_build/zlib-1.2.13/
 make
https://github.com/uglym8/make_ext4fs/tree/Fix-hardlinks-handling

Best,
Alex.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.reproducible-builds.org/pipermail/rb-general/attachments/20231016/c82b7cae/attachment.htm>


More information about the rb-general mailing list