FS#56955 - [android-tools] fastboot format errors out

Attached to Project: Community Packages
Opened by Parker Reed (parkerlreed) - Thursday, 04 January 2018, 22:14 GMT
Last edited by Anatol Pomozov (anatolik) - Tuesday, 23 January 2018, 06:26 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Anatol Pomozov (anatolik)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description: Trying to perform any of the fastboot formatting actions throws an error

[parker@yoga710 angler-opm3.171019.013]$ fastboot format userdata
Couldn't parse erase-block-size '0x'.
Couldn't parse logical-block-size '0x'.
mke2fs 1.43.7 (16-Oct-2017)

Bad option(s) specified: android_sparse

Extended options are separated by commas, and may take an argument which
is set off by an equals ('=') sign.

Valid extended options are:
mmp_update_interval=<interval>
num_backup_sb=<0|1|2>
stride=<RAID per-disk data chunk in blocks>
stripe-width=<RAID stride * data disks in blocks>
offset=<offset to create the file system>
resize=<resize maximum size in blocks>
packed_meta_blocks=<0 to disable, 1 to enable>
lazy_itable_init=<0 to disable, 1 to enable>
lazy_journal_init=<0 to disable, 1 to enable>
root_owner=<uid of root dir>:<gid of root dir>
test_fs
discard
nodiscard
quotatype=<quota type(s) to be enabled>

/usr/bin/mke2fs failed with status 1
mke2fs failed: 1
error: Cannot generate image for userdata

Additional info:
* android-tools 8.1.0_r1-1
* Using android-sdk-platform-tools from AUR, fastboot format works.

Steps to reproduce:

1. Install Android tools
2. Plug in phone booted into bootloader
3. Try to format a partition
This task depends upon

Closed by  Anatol Pomozov (anatolik)
Tuesday, 23 January 2018, 06:26 GMT
Reason for closing:  Fixed
Comment by Anatol Pomozov (anatolik) - Friday, 05 January 2018, 15:51 GMT
It looks like fastboot uses android extension to e2fs. The change that added it is here https://android.googlesource.com/platform/external/e2fsprogs/+/f9e0f1d4a7cf32c4091eee7d2a1676cac1d17438%5E%21/#F0

We need to:
1) compile android-specific mke2fs and put it into android-tools package
2) patch fastboot to use that version of the tool instead of system one. Here is where fastboot calls mke2fs https://android.googlesource.com/platform/system/core/+/master/fastboot/fs.cpp#126
Comment by Brian Parsons (bparsons) - Sunday, 07 January 2018, 19:49 GMT
Until this is sorted - android-sdk-platform-tools includes a version of mke2fs which includes the option that fastboot is looking for. Putting that version first in your path (ie. PATH=/opt/android-sdk/platform-tools/:$PATH) before executing fastboot (or the script including it) will not error out.
Comment by Anatol Pomozov (anatolik) - Friday, 19 January 2018, 23:08 GMT
I just pushed 8.1.0_r7-1 to [testing]. This new version of the package contains additional Android-specific tools: mke2fs.android e2fsdroid ext2simg. I also patched fastboot to use mke2fs.android.

Could you please check if this new version fixes your problem?

Loading...