[One (M7) General] nkk71:
Retired content, you can disregard this post

[WIP][POSSIBLE FIX][GUIDE][INFO][02-May-2014]HTC One M7 - "Active Cmdline Overflow" error and bootloader bootloop

This is a work in progress and a collaboration of [MENTION=4513061]cschmitt[/MENTION] and myself.

And it is still a rough draft!! so excuse any bad formatting (lack of colours, bold, italic, etc.)

Symptoms

1) Bootloader shows "active cmdline overflow (xxxx bytes)"

2) Unable to enter recovery (neither custom nor stock)

3) (possibly) everything you try reboots to bootloader

Cause

Basically it's because of a corrupt mmcblk0p19 [misc] partition, the [misc] partition includes the bootloader command block (BCB); [MENTION=1477137]schmitt[/MENTION] can elaborate on that more than I.

The most often times we've seen this, is when flashing HTC Droid DNA (device=dlx) ROM or kernel (kernel is included in the ROM) on a HTC One M7. The DLX kernel is in mmcblk0p19, and during installation this part of the installer script - run_program("/sbin/dd", "if=/tmp/boot.img", "of=/dev/block/mmcblk0p19") - will overwrite and therefore corrupt your [misc] partition.

Problems (and why even an RUU won't restore your phone)

Some partitions, in particular mmcblk0p19 [misc] and mmcblk0p6 [mfg], are not contained in any RUU, as they are specific to each individual phone.

So what does a normal [misc] partition look like:

the ones that vary from device to device are the ones in bold green at offsets 0x304 and 0x31C, and what impact or influence they have I don't know.

OK, now get to the point, how do we fix this

Well you need adb commands, root and busybox... which are only available in a custom recovery or a rooted ROM (with USB debugging enabled)

and [MENTION=4513061]cschmitt[/MENTION] has modified TWRP to disregard the BCB http://xdaforums.com/showpost.php?p=52262603&postcount=13

Download from AndroidFileHost: http://www.androidfilehost.com/?fid=23329332407590873 only applicable for M7_U or M7_UL models.

Step 1: Install the noBCB recovery

C:\ADB3>[B][COLOR="Blue"]fastboot devices[/COLOR][/B]
HT34xxxxxxxx fastboot [I]<- we're in bootloader[/I]

C:\ADB3>[B][COLOR="Blue"]fastboot flash recovery twrp-recovery-2.7-m7-nobcb.img[/COLOR][/B]
target reported max download size of 1514139648 bytes
sending 'recovery' (11278 KB)...
OKAY [ 1.500s]
writing 'recovery'...
OKAY [ 1.240s]
finished. total time: 2.740s

C:\ADB3>[B][COLOR="Blue"]fastboot erase cache[/COLOR][/B]
******** Did you mean to fastboot format this partition?
erasing 'cache'...
OKAY [ 0.090s]
finished. total time: 0.090s

C:\ADB3>[B][COLOR="Blue"]fastboot reboot-bootloader[/COLOR][/B]
rebooting into bootloader...
OKAY [ 0.040s]
finished. total time: 0.040s

--> enter RECOVERY

Step 2: Backup your current mmcblk0p19

C:\ADB3>[B][COLOR="Blue"]adb devices[/COLOR][/B]
List of devices attached
HT34xxxxxxxx recovery [I]<- you need to be in custom recovery to
ensure [B]root[/B] privileges[/I]

C:\ADB3>[B][COLOR="Blue"]adb shell dd if=/dev/block/mmcblk0p19 of=/tmp/mmcblk0p19_bak.img[/COLOR][/B]
2045+0 records in
2045+0 records out
1047040 bytes (1022.5KB) copied, 0.048894 seconds, 20.4MB/s

C:\ADB3>[B][COLOR="Blue"]adb pull /tmp/mmcblk0p19_bak.img[/COLOR][/B]
2272 KB/s (1047040 bytes in 0.450s)

C:\ADB3>[B][COLOR="Blue"]dir[/COLOR][/B]
Volume in drive C has no label.
Volume Serial Number is 0622-9D4A

Directory of C:\ADB3

02/05/2014 18:40 <DIR> .
02/05/2014 18:40 <DIR> ..
02/05/2014 18:40 1,047,040 mmcblk0p19_bak.img
[B][I]^^ there it is[/I][/B]

Step 3: Repair mmcblk0p19

As I mentioned this is a work in progress, so for the time being, if you were able to backup your current mmcblk0p19, please compress and upload it, along with a "fastboot getvar all" (excluding IMEI and s/n).

And we'll have a look when we can, and send a "repaired" one back to you.

Step 4: Restore your repaired mmcblk0p19

C:\ADB3>[B][COLOR="Blue"]adb devices[/COLOR][/B]
List of devices attached
HT34xxxxxxxx recovery [I]<- you need to be in custom recovery to
ensure [B]root[/B] privileges[/I]

C:\ADB3>[B][COLOR="Blue"]adb push mmcblk0p19_repaired.img /tmp/[/COLOR][/B]
2130 KB/s (1047040 bytes in 0.479s)

C:\ADB3>[B][COLOR="Blue"]adb shell dd if=/tmp/mmcblk0p19_repaired.img of=/dev/block/mmcblk0p19[/COLOR][/B]
2045+0 records in
2045+0 records out
1047040 bytes (1022.5KB) copied, 0.048894 seconds, 20.4MB/s

C:\ADB3>[B][COLOR="Blue"]adb reboot bootloader[/COLOR][/B]

You should now be back in bootloader with NO active cmdline overflow, be able to flash, enter the recovery of your choice, and install things appropriate for your phone.

:victory:

-------------------------------------------------------------------------------------------------------------------------------------------

Revision history

2nd May 2014:

Initial preview release.​

-------------------------------------------------------------------------------------------------------------------------------------------

Disclaimer:

We are not responsible for anything going wrong with your phone!

credits:

[MENTION=4513061]cschmitt[/MENTION] for his work on the noBCB recovery, as well as his continued work on TWRP: http://xdaforums.com/showthread.php?t=2708134

-------------------------------------------------------------------------------------------------------------------------------------------

If you found this thread useful or educational, please press the THANKS button for both of us :).

-------------------------------------------------------------------------------------------------------------------------------------------