nmeum / android-tools

Unoffical CMake-based build system for android command line utilities
Apache License 2.0
176 stars 51 forks source link

fastboot format cannot generate f2fs image #109

Closed JamiKettunen closed 11 months ago

JamiKettunen commented 1 year ago

It tries to call make_f2fs which doesn't exist. Perhaps just instead calling mkfs.f2fs would be enough?

$ fastboot --version
fastboot version 34.0.0-android-tools
Installed as /usr/bin/fastboot
$ fastboot format:f2fs userdata
/usr/bin/make_f2fs failed with status 1
fastboot: error: Cannot generate image for userdata
Biswa96 commented 1 year ago

Perhaps just instead calling mkfs.f2fs would be enough?

It seems reasonable to me. The andorid's f2fs-tools repository is as same as the git.kernel.org one.

According to the fastboot code, it seem that this issue should happen with previous versions also. Could you check if this happens with older versions of android-tools?

JamiKettunen commented 1 year ago

@Biswa96 The oldest package I had around in cache was 31.0.3p1 and it still fails in the same way.

Same problem also on 31.0.3p2, 33.0.3p1 & 33.0.3p2.

JamiKettunen commented 11 months ago

Still a problem on 34.0.1 & 34.0.4

JamiKettunen commented 11 months ago

Out of curiosity I made the ln -s mkfs.f2fs /usr/bin/make_f2fs symlink and was met with:

$ fastboot format:f2fs userdata

    F2FS-tools: mkfs.f2fs Ver: 1.16.0 (2023-04-11)

Info: Disable heap-based policy
Info: Debug level = 1
Info: Trim is disabled
Info: Set conf for android
Info: Enable Project quota
    Error: Sparse mode is only supported for android
/usr/bin/make_f2fs failed with status 255
fastboot: error: Cannot generate image for userdata
Biswa96 commented 11 months ago

Should make_f2fs be provided in android-tools? It is provided in official platform-tools binary tarball.

The f2fs-tools directory is not used in any cmake files. I wonder why it was added in first place.

JamiKettunen commented 11 months ago

Probably makes sense yeah, it looks like f2fs-tools has to be built with something special so it supports Android sparse mode (not sure what exactly) which might not be feasible to enable across distros

Biswa96 commented 11 months ago

OK, I shall try adding that. Is there any command other than fastboot format:f2fs userdata which can reproduce the issue?

JamiKettunen commented 11 months ago

Not that I know of at least

Biswa96 commented 11 months ago

I have added a pull request to fix this issue. Would you like to test the tarball from GitHub Actions artifacts of that pull request?