Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake: Add make_f2fs tool for fastboot #125

Merged
merged 1 commit into from
Sep 30, 2023
Merged

Conversation

Biswa96
Copy link
Collaborator

@Biswa96 Biswa96 commented Sep 16, 2023

Fixes #109

make_f2fs tool is reqired by fastboot. If the make_f2fs executable is
not present the following error is shown.

$ fastboot format:f2fs userdata
/usr/bin/make_f2fs failed with status 1
fastboot: error: Cannot generate image for userdata

This commit also splits libext2_uuid static library from libext2fs

make_f2fs tool is reqired by fastboot. If the make_f2fs executable is
not present the following error is shown.

$ fastboot format:f2fs userdata
/usr/bin/make_f2fs failed with status 1
fastboot: error: Cannot generate image for userdata

This commit also splits libext2_uuid static library from libext2fs
@JamiKettunen
Copy link
Contributor

Format with f2fs appears to work at first glance (though with excess output) but when the device reboots it can still mount userdata as ext4 with all data intact

$ 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
Info: not exist /proc/version!
Info: Segments per section = 1
Info: Sections per zone = 1
Info: sector size = 512
Info: total sectors = 103219136 (50399 MB)
Info: zone aligned segment0 blkaddr: 512
Info: add quota type = 0 => 4
Info: add quota type = 1 => 5
Info: add quota type = 2 => 6
Info: format version with
  "6.4.16-0-generic"
[f2fs_init_sit_area: 640] 	Filling sit area at offset 0x00600000
[f2fs_init_nat_area: 674] 	Filling nat area at offset 0x00a00000
[f2fs_write_root_inode:1292] 	Writing root inode (hot node), 14c00 0 200 at offset 0x00084992
[f2fs_write_default_quota:1368] 	Writing quota data, at offset 00015201, 00015202
[f2fs_write_qf_inode:1425] 	Writing quota inode (hot node), 14c00 0 200 at offset 0x00084993
[f2fs_write_default_quota:1368] 	Writing quota data, at offset 00015203, 00015204
[f2fs_write_qf_inode:1425] 	Writing quota inode (hot node), 14c00 0 200 at offset 0x00084994
[f2fs_write_default_quota:1368] 	Writing quota data, at offset 00015205, 00015206
[f2fs_write_qf_inode:1425] 	Writing quota inode (hot node), 14c00 0 200 at offset 0x00084995
[f2fs_update_nat_root:1479] 	Writing nat root, at offset 0x00000a00
[f2fs_add_default_dentry_root:1676] 	Writing default dentry root, at offset 0x00015200
Info: Overprovision ratio = 0.650%
Info: Overprovision segments = 163 (GC reserved = 160)
[f2fs_write_check_point_pack: 837] 	Writing main segments, cp at offset 0x00000200
[f2fs_write_check_point_pack: 993] 	Writing Segment summary for HOT/WARM/COLD_DATA, at offset 0x00000201
[f2fs_write_check_point_pack:1020] 	Writing Segment summary for HOT_NODE, at offset 0x00000202
[f2fs_write_check_point_pack:1032] 	Writing Segment summary for WARM_NODE, at offset 0x00000203
[f2fs_write_check_point_pack:1043] 	Writing Segment summary for COLD_NODE, at offset 0x00000204
[f2fs_write_check_point_pack:1051] 	Writing cp page2, at offset 0x00000205
[f2fs_write_check_point_pack:1071] 	Writing NAT bits pages, at offset 0x000003fe
[f2fs_write_check_point_pack:1092] 	Writing cp page 1 of checkpoint pack 2, at offset 0x00000400
[f2fs_write_check_point_pack:1111] 	Writing cp page 2 of checkpoint pack 2, at offset 0x00000405
[f2fs_write_super_block:1144] 	Writing super block, at offset 0x00000000
Info: format successful
Sending 'userdata' (97 KB)                         OKAY [  0.004s]
Writing 'userdata'                                 OKAY [  0.549s]
Finished. Total time: 0.806s

For reference if I try with ext4 instead it makes a >4M image instead and formats as expected so maybe it just doesn't override; I'll do more testing tomorrow but this is a bit odd, maybe I'll also try official platform tools for reference

@Biswa96
Copy link
Collaborator Author

Biswa96 commented Sep 23, 2023

Hi, did you compare the expected behavior with official platform tools?

@Biswa96
Copy link
Collaborator Author

Biswa96 commented Sep 30, 2023

I am merging this because this fixes the error in the issue.

@Biswa96 Biswa96 merged commit a8def2c into nmeum:master Sep 30, 2023
14 checks passed
@Biswa96 Biswa96 deleted the add_make_f2fs branch September 30, 2023 05:52
@JamiKettunen
Copy link
Contributor

Sorry for delay, I did try official tools too and they behaved the same (including verbose output)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fastboot format cannot generate f2fs image
2 participants