Closed salvogiangri closed 9 months ago
Would not it be possible to use the sload.f2fs executable from Linux distribution? For example, ArchLinux has that sload.f2fs executable in f2fs-tools package.
Do those also have specific Android code included (https://android.googlesource.com/platform/external/f2fs-tools/+/refs/heads/main/Android.bp#49)? erofs-utils didn't so I had to use a community fork (https://github.com/sekaiacg/erofs-utils)
I confirm f2fs-tools package does not have Android specific code, when trying to run sload_f2fs
with sparse flag the following error occurs:
Error: Sparse mode is only supported for android
I have tried to build sload_f2fs program but it shows segfault.
$ ~/install/bin/sload_f2fs
Error: Device not specified
Wrong program.
Error: Device not specified
Wrong program.
Segmentation fault (core dumped)
Certainly, I am missing something basic. I shall look into it.
Certainly, I am missing something basic.
I forgot to define the macros from libf2fs.
Do you need sload_f2fs only or other tools also?
AOSP build system (which is what I'm trying to use rn) only uses make_f2fs
(which is already set up here) and sload_f2fs
. The other tools I see in Android.bp are make_f2fs_casefold
and fsck.f2fs
(which includes resize.f2fs
, defrag.f2fs
, dump.f2fs
). I don't seem to need those at the moment but it would be great to have those as well just in case.
The other tools may conflict with distro provided files. If those tools are renamed then the scripts will fail to find. I'll stick with sload_f2fs only.
I have created pull request to add the sload_f2fs executable. Would you like to test the change please?
Thank you for your time! Will test as soon as possible.
As you are working with f2fs tools, may I ask if you know some basic tests which can be done in CI with this f2fs tools?
I'm currently using those to build flashable OS images in a project of mine (https://github.com/BlackMesa123/UN1CA/blob/4a49c4c7be7cd9b2dbb7ed1f65b0ac686f5ee24d/scripts/build_fs_image.sh#L106-L116). What mkf2fsuserimg.sh
does is as simple as:
truncate
to create an empty file with a specific sizemake_f2fs
to create an F2FS FS over the previously created file with the specified flags set when running mkf2fsuserimg.sh
sload_f2fs
to copy over all the files in the newly created image with the correct permissions/capabilites/secontext (fs_config/file_context)The only thing I can think of atm is creating a dummy F2FS FS and verify that the image is correctly created as expected
It would be great if support for building the other executables in f2fs-tools could be added, some missing executables are required by the mkf2fsuserimg.sh script to work, such as sload_f2fs.