Skip to contentSkip to conversation

Populate f2fs with files during mkfs.f2fs

f2fs-dev Tomas Mudrunka 2 participants 5 messages Mar 19, 2022 – Mar 28, 2022

lore
Share & tools
lore
#0 lore raw

Hello,
i've noticed that mkfs.f2fs does not allow files to be copied to filesystem during formating by mkfs.f2fs. Do you think it would be hard to add such feature?

I understand that this might be a weird request which in some sense defies the definition of filesystem formating process. But there are also some arguments for this case.

In the world of embedded development we often need to build firmware images to be flashed into the device. And F2FS is one of the best suited filesystems for embedded and perhaps the one best for managed flash. So we naturaly want to use it and build into our fw images. However to build such image i need to create f2fs image, format it and then mount it using loopback, copy data to it, unmount, sync, handle errors, etc... And we have huge makefiles or stuff like genimage, to put all the image partitions and bootloaders and everything together. It just adds quite complexity to the embedded build systems.

Turns out that quite few filesystems already have this feature to simplify creating filesystem images without need for mounting or root permissions:

mkfs.ext4 -d ./input_directory
mkfs.ubifs -d ./input_directory
mkfs.jffs2 -d ./input_directory
mkcramfs (obviously)
mksquashfs (obviously)

would you please consider adding such feature as well?

Thank you

Signature · 9 lines
S pozdravem
Best regards
     Tomáš Mudruňka - SPOJE.NET s.r.o.


_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
#1 lore raw
Quoted 23 lines · Tomas Mudrunka

Hello,
i've noticed that mkfs.f2fs does not allow files to be copied to filesystem during formating by mkfs.f2fs.
Do you think it would be hard to add such feature?

I understand that this might be a weird request which in some sense defies the definition of filesystem formating process. But there are also some arguments for this case.

In the world of embedded development we often need to build firmware images to be flashed into the device. And F2FS is one of the best suited filesystems for embedded and perhaps the one best for managed flash. So we naturaly want to use it and build into our fw images. However to build such image i need to create f2fs image, format it and then mount it using loopback, copy data to it, unmount, sync, handle errors, etc... And we have huge makefiles or stuff like genimage, to put all the image partitions and bootloaders and everything together. It just adds quite complexity to the embedded build systems.

Turns out that quite few filesystems already have this feature to simplify creating filesystem images without need for mounting or root permissions:

Quoted 7 lines

mkfs.ext4 -d ./input_directory
mkfs.ubifs -d ./input_directory
mkfs.jffs2 -d ./input_directory
mkcramfs (obviously)
mksquashfs (obviously)

would you please consider adding such feature as well?

Hi Tomas,

Can sload.f2fs satisfy this requirement?

Thanks,

Quoted 3 lines

Thank you

_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

#2 lore raw

Dne 2022-03-21 07:03, Chao Yu napsal:

Quoted 30 lines · Tomas Mudrunka
Quoted 29 lines

Hello,
i've noticed that mkfs.f2fs does not allow files to be copied to filesystem during formating by mkfs.f2fs.
Do you think it would be hard to add such feature?

I understand that this might be a weird request which in some sense defies the definition of filesystem formating process. But there are also some arguments for this case.

In the world of embedded development we often need to build firmware images to be flashed into the device. And F2FS is one of the best suited filesystems for embedded and perhaps the one best for managed flash. So we naturaly want to use it and build into our fw images. However to build such image i need to create f2fs image, format it and then mount it using loopback, copy data to it, unmount, sync, handle errors, etc... And we have huge makefiles or stuff like genimage, to put all the image partitions and bootloaders and everything together. It just adds quite complexity to the embedded build systems.

Turns out that quite few filesystems already have this feature to simplify creating filesystem images without need for mounting or root permissions:

mkfs.ext4 -d ./input_directory
mkfs.ubifs -d ./input_directory
mkfs.jffs2 -d ./input_directory
mkcramfs (obviously)
mksquashfs (obviously)

Quoted 5 lines
Quoted 1 line

would you please consider adding such feature as well?

Hi Tomas,

Can sload.f2fs satisfy this requirement?

Yes, that is exactly what i needed.
I didn't realized i can find it in separate tool.

Thank you.

Signature · 9 lines
S pozdravem
Best regards
     Tomáš Mudruňka - SPOJE.NET s.r.o.


_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
#3 lore raw

Re: [f2fs-dev] F2FS support in genimage

In reply to Chao Yu

Dne 2022-03-21 07:03, Chao Yu napsal:

Quoted 3 lines

Hi Tomas,
Can sload.f2fs satisfy this requirement?
Thanks,

BTW it worked, so we've already added F2FS support to genimage:

https://github.com/pengutronix/genimage/pull/185
https://github.com/pengutronix/genimage/

Someone might find that helpful

Cheers

Signature · 9 lines
S pozdravem
Best regards
     Tomáš Mudruňka


_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
#4 lore raw

Re: [f2fs-dev] F2FS support in genimage