yashsingh1/xdaforums huggingface dataset:
[Sprint HTC One (M7)] tdhite:
I don't use Goo manager, so no clue in all honesty.

With that said, flashing via fastboot is really the best way, imho, whenever dealing with a recovery:

download the file to your PC -- it'll be named "openrecovery-m7wls-2.7.1.2-06-18.2014.img" unless you decide to change it;

plug in phone to USB;

type "adb devices" to make sure it 'took' -- you should see your device listed;

type "adb reboot bootloader" (after reboot, the display should show "fastboot usb" or similar);

type "fastboot flash recovery [full_path_to]openrecovery-m7wls-2.7.1.2-06-18.2014.img

All that above assumes the "adb" and "fastboot" commands are on your PATH. If not, either make that so, or first 'cd' to the directory in which those commands exist. I use Linux (Arch) myself, and always have the Android SDK on my path.

where you see "[full_path_to]" it means to put the directory where you downloaded the image. For instance, might look like

c:/users/myusername/downloads/openrecovery-m7wls-2.7.1.2-06-18.2014.img

After that, use the bootloader menu to reboot into recovery.

It's really very simple.

With all that said -- I'll add an openrecovery script to the mix, if possible, on the next update (a couple weeks or so).

--
[Sprint HTC One (M7)] pmacevad:
Thanks for the detailed reply. It's tough to get to the computer most days working nights and dealing with my kids lol. I'll give it a shot shortly cause note is actually a good time. Thanks again [MENTION=4988866]tdhite[/MENTION]

Sent from my rooted & s-off'd Sprint HTC One, powered by Android OS ?
[Sprint HTC One (M7)] kickyoace:
Flash image gui works really well on rooted phones you can get it from the play store (donate) or here http://xdaforums.com/showthread.php?t=2086361

(free)
[Sprint HTC One (M7)] raptoro07:
I use Flash GUI too and it works fine. Flashed 2.7.1.2 this morning. :)
[Sprint HTC One (M7)] pmacevad:
Thanks for the help and advice guys! Ended up using fastboot and even decided to update firmware while I was at it lol. Thanks again, all is well.

Sent from my rooted & s-off'd Sprint HTC One, powered by Android OS ?
[Sprint HTC One (M7)] tdhite:
Good on ya, dude! :good:
[Sprint HTC One (M7)] Darealboot:
I'm sure this has been covered a few times in the thread but have some compassion please. I'm a full time single dad of an autistic 5 year old and my browsing time is VERY limited. So here goes.. I got a refurb the other day and it has hboot 1.57. I wen we through my normal process of unlocking boot loader blah blah. So I go to fastboot the latest twrp. It flashed fine. I go to wipe my caches and make a backup. It says "failed can't mount cache partition" so I go in to mount and try to manually check the box next to cache and it just vibrates and won't let me check it. It says there's only 37 mb available... Which is hogwash cause its a fresh phone. Someone please help so I can get on with my life! I'm not a newb, but unfamiliar with the innards of how twrp actually works or I'd do this on my own. I've never run in to this problem before. I've tried multiple versions of twrp and they all yield the same results. :pulling out hair: if I can't wipe caches, I can't flash a custom Rom and if there's only 37 mb available I certainly can't make a backup.
[Sprint HTC One (M7)] budeone:
Darealboot, sorry you are having issues. Someone may have a better response than mine.

If you know you can fastboot, you may want to try if no other options come up..

In TWRP under Wipe theres an Advanced Wipe menu. Go there and select Data, format the partition. I guess last resort.

other things to try are to do a factory reset from the bootloader as opposed to recovery.

Man.. I wish you luck
[Sprint HTC One (M7)] GadgetFreak:
Do have a theme installed? I have noticed that some of the themes do not play well with this fork in the TWRP family, especially some of the newer ones for the mainline version of TWRP. I had the same issue, and once I downgraded to an earlier them, the ability to wipe and mount both was restored,
[Sprint HTC One (M7)] Darealboot:
Thanks for your responses. Actually I tried multiple twrps AND multiple cwms. All of them are the same. Detecting only 37mb of available space. It's like the mounting points aren't meshing from boot loader. I'm gonna brick it and take it back to Sprint. "I took an ota and it won't turn on!" Haha! I think something is jacked with it. I've been doing this for years and haven't run in to this ever.
[Sprint HTC One (M7)] tdhite:
You don't need to brick it. If it loads TWRP, it'll fix.

99% of the time your error is because you followed some set of instructions that said to "erase cache" in fastboot. The instructions in this thread says "do not do that" -- it's entirely wrong. There's simply no reason to do that at all when you load a recovery, if anything, just format cache, not erase it. Erase *removes* the file system and does not create one in its place. Format properly creates the file system. So ...

Do this:

1) Load up TWRP (mine, of course ;) )

2) Go to Wipe -> Advanced

3) Wipe the Cache partition, and *only* the cache partition.

That will reformat the /cache partition for you, then you should be able to mount it.

Let me know if that works, if not, I'll tell you how to get TWRP to tell you what's wrong, but it's slightly more involved so let's not go there yet.
[Sprint HTC One (M7)] Darealboot:
I never erased cache. In fact I've never tried to erase it. This is what I did just like I always do.

1. Unlocked boot loader.

2. Attempted using goo manager to install the latest stable build. That would not complete. So it was unsuccessful.

3. Went to team wins website and grabbed the latest .img and fastbooted it.

4. Rebooted directly to recovery via bootloader.

5. Attempted to wipe cache/dalvik through advanced wipe. (Failed and started getting errors)

6. Attempted to make a backup (failed only 37 mb available)

7. Attempted multiple versions of twrp and cwm. All yield the same results of only seeing 37 mb of available storage

8. Started banging my head on the wall.

......I'll try it and let you know what happens
[Sprint HTC One (M7)] Darealboot:
Ok so Idk what happened but all is well after flashing the recovery in this thread.. thanks and thanks...
[Sprint HTC One (M7)] Aldo101t:
does this recovery erase your firmware numbers(getvar all) the official twrp 2.7.1.1 does, just wondering, don't know if it means anything or not, but I didn't like that, when my main version is blank.
[Sprint HTC One (M7)] tdhite:
I don't know what you're flashing, but TWRP doesn't 'erase' values from firmware (it doesn't even (normally) mount the firmware partitions unless you ask it to) -- version-main just isn't setup for a lot of custom ROMs. So it's just empty -- no big deal.

If you really want to see a version-main value, flash a Sense ROM, or worst case, RUU back to stock. The likelihood of it sticking, though, has all to do with what you flash, not TWRP.

I haven't had a version-main value for, ohhhhhh well, a very long time. I use P.A.C. Rom since I'm a developer there, but when I load up Bad Boyz to do some Sensish stuff, my bet is version-main shows up (though I never cared to look in all honesty).

So you can feel a little better (?) -- here's my vars (with x-outs where I felt like it):

(bootloader) version: 0.5

(bootloader) version-bootloader: 1.55.0000

(bootloader) version-baseband: 1.00.20.1108

(bootloader) version-cpld: None

(bootloader) version-microp: None

(bootloader) version-main:

(bootloader) version-misc: PVT SHIP S-OFF

(bootloader) serialno: FAXXXXXXXXX

(bootloader) imei: XXXXXXXXXXXXX

(bootloader) meid: XXXXXXXXXXXXXX

(bootloader) product: m7_wls

(bootloader) platform: HBOOT-8064

(bootloader) modelid: PN0720000

(bootloader) cidnum: SPCS_001

(bootloader) battery-status: good

(bootloader) battery-voltage: 3727mV

(bootloader) partition-layout: Generic

(bootloader) security: off

(bootloader) build-mode: SHIP

(bootloader) boot-mode: FASTBOOT

(bootloader) commitno-bootloader: dirty-371c4f408e

(bootloader) hbootpreupdate: 11

(bootloader) gencheckpt: 0

all: Done!
​

LOL -- looks like my battery is a little low (gonna have to charge 'er up I guess).

With all that said -- what are you trying to do that you're so worried about version-main (which is just a version history thing in all reality).
[Sprint HTC One (M7)] Aldo101t:
i'm not trying to do anything special, how I came across this was my adb devices wouldn't show up, so I checked the getvar, and no main version and serial no. , so I tried to reflash modified firmware and it wouldn't(I was on official twrp 2.7.1.1, then I flashed twrp 2.6.3.0 and the firmware flashed ok, and before that the recovery was doing weird stuff(2.7.1.1), it would hang on the twrp screen for minutes a couple of times it froze up, but I had no problems installing or restoring etc. so if a blank main ver doesn't mean anything I won't worry about it. (I was on 4.4.4 beanstalk at the time) so thanks for the reply and heads up, appreciate it.
[Sprint HTC One (M7)] cschmitt:
Many twrp builds for m7 include the misc partition in twrp.fstab which is where the BCB lives and mistakenly wipe the wrong area on every recovery reboot, deleting the OS version and a couple other parameters stored there.

For reference:

http://xdaforums.com/showthread.php?p=53733669

I understand that partition layout is a little different on m7wls, but if misc is referenced in twrp.fstab the same thing is probably happening.
[Sprint HTC One (M7)] tdhite:
LOL -- load up this TWRP version (2.7.1.2) from this thread and stop the thrashing :). It'll just work. :good:
[Sprint HTC One (M7)] tdhite:
That is true -- we do load up /misc ***if one asks***, but it's not loaded by default. If there's a bug in the official TWRP, lemme know and I'll patch it and submit.

recovery.fstab for this TWRP does list /misc, but it's not loaded unless asked:

/boot emmc /dev/block/mmcblk0p35

/recovery emmc /dev/block/mmcblk0p36

/misc emmc /dev/block/mmcblk0p19

/system ext4 /dev/block/mmcblk0p37

/cache ext4 /dev/block/mmcblk0p38

/data ext4 /dev/block/mmcblk0p39

Logs from a TWRP boot:

/misc | /dev/block/mmcblk0p19 | Size: 0MB

Flags: IsPresent

Primary_Block_Device: /dev/block/mmcblk0p19

Display_Name: misc

Storage_Name: misc

Backup_Path: /misc

Backup_Name: misc

Backup_Display_Name: misc

Storage_Path: /misc

Current_File_System: emmc

Fstab_File_System: emmc

Backup_Method: dd

It would honestly astonish me if TWRP official truly tried to incorrectly write /misc, but hey -- stranger things have happened and I haven't swum in that area of the code for a few months.

Thanks, brother [MENTION=4513061]cschmitt[/MENTION].

--- update ---

has to be here:

https://github.com/omnirom/android_...3ce00e045fa290821807/bootloader.cpp#L317-L335

I'll look into it and let y'all know. But it's still benign. Though I bet I can add a trick to fixup even broken /misc partitions.
[Sprint HTC One (M7)] Aldo101t:
I already did, thank you
[Sprint HTC One (M7)] cschmitt:
Bug is detailed in the post I referenced. Basically twrp expects BCB at the beginning of misc partition but on m7 it's located at offset 0x800. OS version is stored in 0x000 area and gets wiped when twrp thinks it's clearing the BCB.

---------- Post added at 10:39 PM ---------- Previous post was at 10:18 PM ----------

check finish_recovery() in recovery.cpp which calls set_bootloader_message with an empty struct to clear the BCB. The comments at the top of recovery.cpp spell out that finish_recovery is called prior to reboot.

Then check set_bootloader_message and ..._block_name in bootloader.cpp, where it opens /misc by device name and then writes out the bootloader_message to the partition.

It not that the user is deliberately taking some action to wipe misc, it's done automatically by the recovery during every reboot.

For builds of twrp that don't include /misc in twrp.fstab this wipe doesn't occur because the recovery can't lookup the /misc partition and therefore the wipe fails, writing 'Cannot load volume /misc!' to the recovery.log. I've verified this in a number of older recovery.logs.

Older versions of twrp (2.6.x.x) don't exhibit this problem because they don't reference /misc in twrp.fstab -- only never versions since 2.7+ seem to have included that reference.
[Sprint HTC One (M7)] tdhite:
From the post:

"I think the solution is to fix get/set_bootloader_message_* in bootloader.cpp so that it can accept an offset for the read/write instead of assuming 0x0."

We're on the same page. That's an easy fix -- can just add an offset #define to the device tree BoardConfig.mk and pick it up there. You sure about 0x800?

:cyclops:
[Sprint HTC One (M7)] cschmitt:
Think so, verified it by factory reset in bootloader and then pulling misc partition.
[Sprint HTC One (M7)] tdhite:
Update coming today (maybe tomorrow)...

Merging in fixes for the /misc partition blowing away the mainver and other info; kernel upgrades; other maintenance items.

Also switching out of goo.im as the main mirror (though I'll keep a copy there for folks who use goomanager) -- I'm finally sick of their transitions just not working out so well when they move sites.

Been working on AOSP kernels for a bit, so time to get back to TWRP and keeping Sprint M7 ahead of the game!

:cowboy:
[Sprint HTC One (M7)] Riff76:
I'd like to make some themes for this. How do I get started?
[Sprint HTC One (M7)] tdhite:
Here ya go: http://www.teamw.in/project/twrp2themers

In this new version, we'll also be giving /devlog as a mount option so if folks ever need, they can clean that up as desired, or checkout the logs stored therein. Good material when one needs it. So in the mount page there'll be another option now.
[Sprint HTC One (M7)] tdhite:
Updated: [RECOVERY][07-19-2014] TWRP2 Touch Recovery 2.7.1.3

The Title says it all -- it's on ...

Updated, fresh and minty. Smells really good! :cowboy:

Downloads post has the link, as always read the Disclaimer and for more details look to the Change Logs.

The basics:

The mainver overwrite (/misc bug) is fixed. It wasn't just mainver, and while benign, frustrated lots of folks. Omnirom is updated too, which is what I merged, it's just not 'out' for release yet. The tdhite TWRP is all fixed up.

Also switched out to using the new 'official' model of partitions, known by devs as 'by-name' which is good and bad -- but the good really outweighs the bad for the future. You won't notice a difference, it's mostly internal, but useful down the road.

Finally -- with that switch, added the /devlog partition to the mountables so it'll show up on the Mount page. Devs -- you're gonna appreciate that over time.

Anyway -- have fun, I'm going to remove links to the prior version in the next few weeks because the /misc bug is not something we should carry forward in any way, imho.

:cowboy:
[Sprint HTC One (M7)] zyrzox:
Howdy -

Just flashed 2.7.1.3 and it wiped my data partition without any warning or way of stopping it upon my first reboot to recovery.

Such a shame.
[Sprint HTC One (M7)] cschmitt:
Sorry to hear that, but there is an explanation based on recent changes to TWRP to properly handle the bootloader control block (bcb) located in the /misc partition:

In the past TWRP for m7 didn't mount the /misc partition because of (insert long story.) Some recent commits have re-enabled the /misc partition and proper handling of the bcb.

If you've ever issued a factory reset from the bootloader menu (and it appears that did happen) then it wrote a 'recovery --wipe_data' command into the bcb. Normally, this command would be acted upon by the next boot into stock recovery by performing a wipe of the /data partition and then erasing the command from the bcb upon completion.

But if you had TWRP installed then that command was never acted upon by the older recoveries because they didn't read the bcb because (insert same long story), but that command is still there in the bcb, just waiting...

So there you are, the bcb contains a command to factory reset, but TWRP is ignoring it...for now.

Then along comes the recent TWRP builds (2.7.1.2+) that read the bcb on boot. You flash it and boot into recovery, TWRP starts, reads the wipe_data command out of the bcb and proceeds to wipe the /data partition.
[Sprint HTC One (M7)] tx_jaycee:
So the short story is to backup before installing the new recovery....
[Sprint HTC One (M7)] GadgetFreak:
Isn't that always the story with these phones?
[Sprint HTC One (M7)] tdhite:
It's true -- all operations that you do new means nandroid first, but folks don't always do that. To be fair, though, I could just as easily have warned more deeply on the nature of recent changes. All TWRPs that have new code will do this, and when the day comes for an official release, there'll be a crapload more folks running into it. So I've updated the Downloads link.

:eek:
[Sprint HTC One (M7)] cschmitt:
We might want to come up with a precautionary solution for those upgrading from earlier versions. I'm thinking a flashable zip to run prior to upgrade that will dd into the BCB to clear any lingering recovery commands. I'll put something together.
[Sprint HTC One (M7)] zyrzox:
I take full responsibility for my own stupidity. I contemplated running a backup prior to flashing the new recovery and thought "meh, I'll just wait so it writes in the newest format" -- and learned my lesson the hard way! I've been using TWRP for a long time and have never had anything like this happen with a new version, so it was quite a surprise.

I did read through all of the instructions and a few past posts prior to flashing the update and didn't see anything that seemed particularly noteworthy, so I went for it! The updated risk/recommendation language on the download link will most likely help others to avoid making the same mistake I made.

However, I don't recall ever having initiated a factory reset from the bootloader so I'm wondering if there is some other way that bit gets set.

In any case, thanks for your hard work and for providing us with a fantastic recovery! It just keeps getting better!
[Sprint HTC One (M7)] cschmitt:
Bootloader control block (BCB) reset script.

Useful for ensuring that BCB is clear

prior

to upgrading to TWRP 2.7.1.2+ to prevent a possible unintended factory reset based on existing bcb commands.

See discussion here

Flash it in existing recovery, then install TWRP 2.7.1.2
[Sprint HTC One (M7)] raptoro07:
I don't understand. This thread/recovery is for the Sprint M7. M7wls. From what I can see Slightly is not for the Sprint variant, they are different. You were able to install Slightly on Sprint variant with 2.7.1.2 and it worked?
[Sprint HTC One (M7)] smokin901:
Yes I modified the ROM to work on sprint m7
[Sprint HTC One (M7)] tdhite:
[MENTION=4513061]cschmitt[/MENTION]

Can you commit to github? I'd like to add to the downloads link, but want fills to have source to everything offered here.

Credit all you, brother.
[Sprint HTC One (M7)] tdhite:
Smells like your starting to see some benefits of by-name partition based mounts.

Send me the updater-script. I'll help out.

_----------_

Edit. I missed the true error. You have a file list error somewhere so setting metadata fails. Send me your updater-script and a link to the zip. I can check what your missing.
[Sprint HTC One (M7)] smokin901:
Nope that is not the error at all. In fact system partition does not get mounted at all hence setting metadata fails.
[Sprint HTC One (M7)] tdhite:
Yes. Then you have a slew of missing files. LOL.

Try specifying the device nodes fully, for example instead of trying to mount "system" mount " /dev/block/platform/msm_sdcc.1/by-name/system"

In other words, your mount for system should look like:

mount("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/system", "/system");

Note that you need not worry which block device that actually is, the kernel already maps it to /dev/block/mmcblk0p37 for the m7wls/m7spr devices. Other devices will also map correctly for their system setup, presuming recent TWRP/CWM code.

To understand, the "mount" edify call requires the parameters:

fstype: any supported file system (e.g,, ext4)

partittion_type: any supported partition type (e.g., EMMC or MTD)

partition: a block device to mount (block device is a path in /dev)

mount_point: a directory (which need not exist as the call will create it) on which to mount the block device

If you want to understand more deeply, the code for mount is here:

https://github.com/omnirom/android_bootable_recovery/blob/android-4.4/updater/install.c#L52-L136
[Sprint HTC One (M7)] lespea:
Tried upgrading to 2.7.1.3 (from 2.7.1.1) and it wouldn't ask me for my encryption password when loading recovery so I couldn't see any of my files. Installed 2.7.1.2 which worked as expected. If I'm doing something stupid let me know...
[Sprint HTC One (M7)] tdhite:
Hmmmm .... that's a new one .... I'll take a look later this evening.

Can you send me a log (which would be in /cache/recovery presuming you didn't clear /cache for whatever reason one might want to do that)
[Sprint HTC One (M7)] lespea:
Sorry for the late reply; forgot to check back on this issue.

I grabbed all of the logs files that I had in that folder (had to re-flash to this new version first)

I can't post links apparently? mega[dot]co[dot]nz/#!NNYimYSa!ZDhLvHbYNKLnG6u2vhciLV-MQxwiVu0sJV0OGOthNT4
[Sprint HTC One (M7)] Dogpack:
This won't flash for me. Need to allow m7wls instead of m7spr?
[Sprint HTC One (M7)] StormyNight:
m7wls and m7spr is pretty much the same thing. People just prefer m7

spr

because it actually says

Spr

int (and also bucketloads of other devices use spr), instead of wls which says nothing imo.

The official codename is m7_wls though.
[Sprint HTC One (M7)] Dogpack:
The script gave an error on m7wls, due to the code below. I'm assuming the included values can be changed for a successful flash, but wanted to be sure this was just an oversight and not intentional, before flashing.
[Sprint HTC One (M7)] miggsr:
Have you tried to flash the official one from teamwin website? Once that installs use flashify to install this recovery...
[Sprint HTC One (M7)] Dogpack:
I wasn't clear enough in my original post, by misleading using the term "flash" . I was referring to executing cschmitt's bootloader control block script, not with actually flashing the recovery. The recovery is flashed successfully, and didn't get the partition wipe issue. Thanks.
[Sprint HTC One (M7)] tdhite:
You don't need the flash anymore. Since you have TWRP flashed and no wipe occurred on your data, there was not a latent request lurking on your misc partition.
[Sprint HTC One (M7)] Danger Dan:
So I've read this over and over trying to understand everything. My problem is I'm on 2.7.1.3. If I flash the script in my recovery will that allow my recovery to flash roms because it will only flash certain roms? Or am I misunderstanding?
[Sprint HTC One (M7)] pmacevad:
Will the new version be incorporated into the recovery flasher? No CPU access at the present to fastboot flash to update. Is there another method I'm missing to update from 2.7.1.2?

Sent from my rooted & s-off'd Sprint HTC One, powered by Android OS ?
[Sprint HTC One (M7)] miggsr:
Go to app store flashify can flash recovery img files from phone no need for pc
[Sprint HTC One (M7)] Dogpack:
OTG

I seem to have an issue with OTG.

OTG works after initial flash and boot into recovery. However on a subsequent boot into recovery, it stops working. The only way I can seem to resolve the issue is to flash the recovery again.
[Sprint HTC One (M7)] miggsr:
Have you tried the method I recommended above?
[Sprint HTC One (M7)] Dogpack:
I don't understand. Maybe I'm miss understanding something. Why would flashify make a difference?

I have 2.7.1.3 installed and never had trouble installing it. My current issue is specifically with OTG usage within recovery 2.7.1.3. My post prior was simply trying to point out that there was an issue with the previously posted bootloader control block reset script where it won't run on m7wls devices. I don't see where flashify will help resolve either of these issues.
[Sprint HTC One (M7)] StormyNight:
OTG with 2.7.1.3 works for me - used it to flash Viper.