Hi, On Thu, May 11, 2017 at 06:14:21PM +0200, Clemens Gruber wrote: > On Mon, May 08, 2017 at 10:02:10AM +0200, Michael Olbrich wrote: > > mkfs.ext4 in the current version can add content to the filesystem. So that > > is the way to go. I started a patch for genimage to use it, but so far I'm > > lacking the time to finish this. > > The main problem is, that mkfs.ext4 checks /etc/mke2fs.conf by default and > > looks up some stuff in /proc when deciding what to do. So it's a bit tricky > > to make sure that the build host does not influence the creation of the > > image. > > Ok, so considering these problems of host influences when using > mkfs.ext4, even though -d is now a supported option, shouldn't we then > give make_ext4fs a try? No, I want the generated filesystem to be as close as possible to something created on the target. > If mkfs.ext4 reads from /proc, we would have to patch this out or work > with upstream e2fsprogs adding a flag to skip these host system lookups? I don't think patching is necessary. What I've seen was just defaults for some options. So this just needs review and some options. > If you still prefer mkfs.ext4, please send the current state of your > patch. I've attached my genimage patch. I think the lazy_* stuff was related to the /proc issue. I'm not sure I like the tool selection, but I don't want to break old setups either. > While we're at it, I thought we could also add support for f2fs image > creation. The problem there however is, that neither the mkfs.f2fs tool > nor any other 3rd party tool I know of can create a f2fs filesystem with > a pre-defined root directory. But maybe I missed something. I never used f2fs, so I have no idea. > And loop-mounting to copy stuff to it, is probably not an option. That requires root access and is not easily integrated. > By the way: > In my platformconfig, I currently use IMAGE_ROOT_EXT from section image2 > and not IMAGE_EXT2 from section image, so in my case, genext2fs is > called from rules/post/image_ext2.make and not via genimage from > rules/image-root-ext.make. That makes no sense. rules/image-root-ext.make is used by IMAGE_EXT2. > What is the purpose of there being two image sections image and image2 > and is one of them deprecated or discouraged? Only use the new image stuff. It's a rewrite of the other rules using genimage and other internal changes. It should also be easier to use. I just didn't want to remove the old rules until we had all the existing features. I should probably remove the rules that have a matching in the new image section. Regards, Michael -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |