Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: Add libarchive support for mke2fs #107

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

russdill
Copy link

This patch isn't quite ready for merging, but just posted to get a take on what people think. It links in libarchive to allow population of a new ext2/3/4 filesystem in the same way as the root-directory option. Unpacking with file attributes and extended file attributes as supported by the source archive should be functional.

@josch
Copy link
Contributor

josch commented Jul 22, 2022

Maybe you'd like to add the testcases I submitted as a pull request to your repo: russdill#1

These testcases are nearly 1:1 those that I wrote for #118 except that they use the -a option whereas my variant overloads the -d option.

@tytso
Copy link
Owner

tytso commented Jul 23, 2022

Many Linux distributions require that if you link against an external library, it must be linked in as a shared library. But that means that for programs like mke2fs which is required for use by the installer and/or an "essential" package, it drags in that library package as new mandatory dependency. This bloats things like Docker containers, installers that are supposed to fit on USB thumb drives, etc., etc.

One solution to this problem is to make usage of the library optional, and to bring it in using dlopen. For an example of this please see: https://github.com/tytso/e2fsprogs/blob/master/lib/ss/get_readline.c This allows the debugfs program to have readline functionality if it is available --- but if the shared libraries are not available, then debugfs still works.

@josch
Copy link
Contributor

josch commented Jul 23, 2022

Thank you for your input @tytso! I added a commit to #118 that uses dlopen and I also pushed a commit that does the same for this pull request here: russdill#1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants