On Tue, Apr 12, 2022 at 09:06:42PM -0700, Darrick J. Wong wrote:
Possibly the answer here is that protofiles have have their day, and mkfs.xfs should just grow the means to import a directory tree into the filesystem so that you can run the image creation tools as non-root.
It would definitely be more useful. We use the mke2fs -d option in quite a lot of places. However it's my understanding (maybe wrong?) that the reason that option exists in e2fsprogs is because that already has a nice userspace library for creating and parsing ext4 filesystems (-lext2fs) and that no such library exists for XFS. So that would need to be implemented first which is a significant amount of work.
If it would be more generally useful for libguestfs to be able to format and populate filesystems, we could talk about committing xfs_protofile into the upstream xfsprogs distribution, as well as enhancing it to pick up extended attributes and fsxattrs from the files it's importing?
libguestfs can already format & populate filesystems, and because that is generic it can do it for any filesystem including XFS, and for both new and existing filesystems: https://libguestfs.org/virt-make-fs.1.html https://libguestfs.org/virt-format.1.html https://libguestfs.org/virt-tar-in.1.html Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-builder quickly builds VMs from scratch http://libguestfs.org/virt-builder.1.html