|
|
Subscribe / Log in / New account

make_ext4fs to generate filesystem

make_ext4fs to generate filesystem

Posted Oct 9, 2020 15:05 UTC (Fri) by jhhaller (guest, #56103)
In reply to: make_ext4fs to generate filesystem by djwong
Parent article: The ABI status of filesystem formats

The -d option would still require root access to allow creating device file entries which may not match the host's devices.
Setting the correct file ownership is another aspect requiring root access. The protofile addresses both of these issues,
as it overwrites the filesystem owner, permissions, and allows creating device files. I doubt mkfs was originally
concerned with CI systems, but creating filesystem images on a non-native host was likely an early concern.


to post comments

make_ext4fs to generate filesystem

Posted Oct 12, 2020 16:36 UTC (Mon) by mebrown (subscriber, #7960) [Link]

The yocto build system has a utility called 'pseudo'.

It uses an LD_PRELOAD library such that anything doing a mknod() libc call is saved to a database instead of invoking the underlying mknod() call, and instead just creates a regular placeholder file.

Then when you run mke2fs, similarly the LD_PRELOAD then hooks stat() such that mke2fs reading the placeholder file actually reads the details from the database instead of the filesystem.

Seems a little hacky at first, but seems to work well enough in practice.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds