Bug 3516 - ext2fsprogs: Add initial directory support to mke2fs ext4
Summary: ext2fsprogs: Add initial directory support to mke2fs ext4
Status: VERIFIED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: deployment (show other bugs)
Version: 1.4
Hardware: x86 Multiple
: Medium+ enhancement
Target Milestone: 1.4 M3
Assignee: Darren Hart
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2012-11-29 23:22 UTC by Darren Hart
Modified: 2013-03-27 16:29 UTC (History)
3 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: New (Never tested)
Verified:
Documentation change: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Darren Hart 2012-11-29 23:22:02 UTC
From the result of Bug 3439, in order to complete initial filesystem population support across the supported filesystems, we need to implement the feature in mke2fs, part of the ext2fsprogs package.

This is to be implemented with a new "-d DIRECTORY" argument passed to mke2fs. The contents of DIRECTORY will be used to populated the newly formatted image. Content and meta-data, including permissions, should be copied exactly.

Where possible, the changes shall be limited to mke2fs.c unless we receive instruction from the upstream maintainers to move the code into libext2fs or as part of a refactoring exercise after we are feature complete.

A partially working prototype is being developed here:

http://git.infradead.org/users/dvhart/e2fsprogs/shortlog/refs/heads/initialdir

Currently the changes successfully create the directory hierarchy and link in the files and symlinks. Content is not yet copied over, nor is the meta-data such as permissions, etc. Devices, sockets, and fifos are not yet implemented.
Comment 1 Darren Hart 2012-12-03 20:58:22 UTC
There is some discussion on the linux-ext4 list about this. Andreas Dilger pointed me to debugfs (the ext2fsprogs tool, not the in-kernel debug filesystem) which has much of this already implemented. I have an example script that gets us fairly far using debugfs. Some changes to ext2fsprogs would still be required, but this may be a more direct route to a solution.

Long term, I would still like to see the filesystem population code moved into libextfs from debugfs and reused in mke2fs to implement the initial directory option. More discussion on the list is required however. If you are interested in participating in these discussions, please subscribe to the list:

http://vger.kernel.org/vger-lists.html#linux-ext4
Comment 2 Darren Hart 2013-01-29 05:09:30 UTC
The symlink implementation is complete and merged into libext2fs. I'm marking this one as resolved. The next step is to incorporate the debugfs script into yocto for a proof of concept.
Comment 3 Mihai Lindner 2013-03-27 16:29:45 UTC
Symlink implementation merged into upstream as of e2fsprogs-1.42.7, released 2013-01-21, commit f01c1a6bce5e6674cbfa5260db1691bca01a4410