yashsingh1/xdaforums huggingface dataset:
[Huawei Ascend Mate 2] xordos:
Thanks, I will take a look that.

Right now, I am using their online builder:

http://builder.clockworkmod.com/

Still I am wondering, how that online builder (or the manual compile steps in your link) decide which partition is system/data/cache etc? Is that device-by-name is universal?

Also, is that safe to flash the recovery? if recovery image is bad, am I be able to boot normally to phone, and use adb to restore stock recovery?

Thanks.
[Huawei Ascend Mate 2] ScoobSTi:
Man, I wish I could help but I don't know anything about this. :(

If there's a CWM forum, try asking there. Hopefully we can find someone to help us.
[Huawei Ascend Mate 2] xordos:
I will answer my own question..

That online builder looks like is not working.

The build process will extract recovery.fstab from the the ramdisk image inside the recovery image.

The local build of the recovery did went through, but the whole process is so complex, and I have never done this before. I am pretty sure I will miss here and there. So my confident of the generated recovery.img is very low.

-rwxr--r-- 1 16777216 Sep 6 18:36 recovery_mmcblk0p19.img

-rw-r--r-- 1 8456192 Sep 6 21:53 recovery_new.img

Anyway, following command can flash the recovery easily.

fastboot.exe devices
fastboot.exe flash recovery recovery.img

The things is, with my recovery image flashed, it can't enter the recovery mode, following is detail:

1. "fastboot flash" to flash recovery.

2. hold 10 seconds to reboot ( or use fastboot reboot)

3. The phone will boot normally into android OS.

4. Then I shutdown the phone.

5. Before it completely shutdown, it showed Huawei logo once as usually, then it show the BootLoader screen. means the phone won't shut off completly.

(or In step 4. I use usb adb cmd "adb reboot recovery" it will same result in step 5)

If I flash back the original recovery in step 1, then in step 4, "adb reboot recovery" will easily reboot into recovery without hold any key. So keys holding is not a issue here.

So, I am not sure "always go into bootloader" means what, the recovery image is bad? or the phone has some checksum/sig check before it load recovery.

Anyway, I didn't try fastboot flash system, but looks like fastboot is one way to flash some partitions, following is the help:

...
flashall flash boot, system, and if found,
recovery, tos
flash <partition> [ <filename> ] write a file to a flash partition
erase <partition> erase a flash partition
format[:[<fs type>][:[<size>]] <partition> format a flash partition.
Can override the fs type and/or
size the bootloader reports.

.

I also searched some other Chinese varies Mate2 ROM, they are very differnt, the CPU is different, and the kernel command line (which is configured in the recovery partition) is quite different, so I doubt MT2_L03 can use recovery image from others like MT2_C00.

:(
[Huawei Ascend Mate 2] xordos:
For ROM Developers, please see attachment for the device files.

I only updated BoardConfig.mk on those partition size. ( I double checked the size from /proc/partitions as well as the dd file size, they matching)

The recovery.fstab is original that extract from stock recovery image by the build tool automatically.

I am build on CM souce code branch 10.2.

Please let me know if you have any idea.

Without a working recovery to backup/restore, Having root on the phone is pretty dangerous. That's also the reason I am still not try xposed on my phone yet.

Hope we can have a working recovery soon.

Thanks.
[Huawei Ascend Mate 2] Modding.MyMind:
I wouldn't bother with CWM.. Personal preference I guess. I would aim to build TWRP. Also, sync OmniRom. TWRP is officially located within the OmniRom source now.

http://docs.omnirom.org/Setting_Up_A_Compile_Environment
[Huawei Ascend Mate 2] Modding.MyMind:
Can someone pull me their boot.img, recovery.img, build.prop and collect all of their "getprop" information. Zip it all up and throw it up on dev host or another cloud service. Would like to review.
[Huawei Ascend Mate 2] xordos:
hey, i am outside right now,will upload tonight

EDIT: [MENTION=5537766]Modding.MyMind[/MENTION]

uploaded....Here is the list of files in the zip:

09/05/2014 01:03 PM 12,582,912 boot_mmcblk0p18.img

09/07/2014 04:19 PM 13,109 build.prop

09/06/2014 02:17 AM 2,966 device_mount.txt

09/06/2014 02:18 AM 9,104 device_names.txt

09/07/2014 04:19 PM 20,936 getprop.txt

09/07/2014 04:14 PM 1,168 md5sum.txt

09/07/2014 04:18 PM 1,194 proc_partition.txt

09/06/2014 06:36 PM 16,777,216 recovery_mmcblk0p19.img

File location:

https://drive.google.com/file/d/0B-nJFDpWA4MdaWFEckVfUERSRk0/edit?usp=sharing

md5: c73da57ebc630a244ec86f15937251ea mt2_l03_upload.zip

Please let me know if you need anything else.

Thanks a lot.
[Huawei Ascend Mate 2] ScoobSTi:
You guys are simply amazing! :D :good:
[Huawei Ascend Mate 2] Modding.MyMind:
Thanks, will be syncing OmniRom to my computer tomorrow after work. Meanwhile, will be looking over the contents inside the zip. Don't remove them on the cloud just yet lol. Won't be able to download it until tomorrow. I will let you know when that happens so if you wish to remove them later on you may.
[Huawei Ascend Mate 2] Modding.MyMind:
[MENTION=3266877]xordos[/MENTION] and [MENTION=4968780]ScoobSTi[/MENTION], can either of you confirm that you can currently install a recovery to your device now that ya'll are unlocked. Pull your stock recovery and in turn try to install that same recovery to see if the screen reports back successful.
[Huawei Ascend Mate 2] xordos:
yes, I already did that when i test my cwm recovery. The phone will boot normally into OS, so I dd out new partition image, and verified using bvi or other binary editor. Then i can restore stock recovery back. pls see post #6 for details.
[Huawei Ascend Mate 2] Modding.MyMind:
Awesome, great news. Just wanted to verify so I had reassurance that if my first TWRP build is buggy you or another tester could get back to your stock recovery :).
[Huawei Ascend Mate 2] Modding.MyMind:
[MENTION=3266877]xordos[/MENTION], Syncing OmniROm now. Downloaded your zip that you provided. Will begin my work.
[Huawei Ascend Mate 2] Modding.MyMind:
Quick question, is the storage sdcard path located at /data/media, or no? Need to know. Reviewing the zip I got and it was giving me mixed feelings on that issue.

Almost done building the device configuration folder.

---------- Post added at 02:33 PM ---------- Previous post was at 02:32 PM ----------

Also, what is ya'lls device resolution? Need that as well lol.
[Huawei Ascend Mate 2] aragon257:
/storage/sdcard0 - I think

720x1280
[Huawei Ascend Mate 2] Modding.MyMind:
Thanks. Makes it easier for me.

---------- Post added at 02:54 PM ---------- Previous post was at 02:52 PM ----------

Is this device CDMA or GSM? Looking at it tells me it is GSM but wanted to verify with you guys.

---------- Post added at 03:00 PM ---------- Previous post was at 02:54 PM ----------

I'm also not seeing a partition for the internal sdcard. I have to assume it's fused with /data/media. Will hit up the build.prop to verify. It will tell me there. And I see there is an external sdcard as well (up to 64 gigs). Useful info for building.

---------- Post added at 03:02 PM ---------- Previous post was at 03:00 PM ----------

And I see it is CDMA with no SIM card according to the build.prop. Also, just so you guys know, the internal sdcard is in fact fused with /data/media.
[Huawei Ascend Mate 2] USHAM2:
It is GSM ..Also, very few 64GB microSD cards are compatible with this device. 32GB is preferred.
[Huawei Ascend Mate 2] Modding.MyMind:
Thanks, knowing if it were GSM or CDMA was very important to me. I looked back at the build.prop and saw that is in fact GSM. Read the info wrong lol. It happens :). Working to complete the device configuration before the syncing is complete so I can jump straight in to building TWRP for you guys.
[Huawei Ascend Mate 2] xordos:
This is the info I just copy from my phone manually, I have triple checked so they should be correct:

In phone memu: settings - device -- more -- storage,

I remeber the phone default value for "default storage location" is Internal, I just set it back to this value and the result is:

ls:

/sdcard ---> /storage/sdcard0

mount:

/dev/block/vold/179:25 /storage/sdcard0

/dev/block/vold/179:65 /storage/sdcard1

/dev/block/vold/179:65 /mnt/sec/asec

=========================

I have changed "default storage location" to external for my phone, in this case:

ls:

/sdcard ---> /storage/sdcard0

mount:

/dev/block/vold/179:25 /storage/sdcard1

/dev/block/vold/179:65 /storage/sdcard0

/dev/block/vold/179:65 /mnt/sec/asec

=========================

Regarding the /data/media, I heard about the media device partition kinds of thing on different tablet, I am not sure about that. Here is some "ls" output from our device. Also, I have include some mount output in early zip file I uploaded.

(below info is captured when I set default storage to internal)

ls -l /data
drwxrwx--- media_rw media_rw 1970-01-04 13:03 media

ls -lR /data/media output:
media:
drwxrwx--- media_rw media_rw 1970-01-04 13:03 0
drwxrwx--- media_rw media_rw 1970-01-04 13:03 obb

media/0:

media/obb:

Additional info:

Just read about this info, scared me: http://www.xda-developers.com/android/what-is-a-data-media-device/

So, with default storage set to "Internal", and reboot the phone (reboot is not required when switching, but I rebooted just to make sure)

After it bootup, the /sdcard and mount info is same as I pasted above.

Then I took a picture with stock camera app, and the photo is save on external storage /storage/sdcard1/DCIM/Camera

Sorry not want to confuse you, just want to give you as much info as I can.

Additional Info 2:

Also, in the recovery.fstab from recovery partition, it has:

/dev/block/platform/msm_sdcc.1/by-name/userdata /data ext4 noatime,nosuid,nodev,barrier=1,data=ordered,noauto_da_alloc wait,check

/dev/block/mmcblk1p1 /sdcard vfat nosuid,nodev,barrier=1,data=ordered,nodelalloc wait

Then following is some lines from "ls -l /dev/block"

//compare with /dev/block/vold/179:25, this should be the internal storage:
brw------- root root [B]179, 25[/B] 1970-01-02 10:16 mmcblk0p25
//compare with /dev/block/vold/179:65, this should be the external SD card:
brw------- root root [B]179, 65[/B] 1970-01-02 10:16 mmcblk1p1

And:

/dev/block/platform/msm_sdcc.1/mmcblk0p25 --> /dev/block/mmcblk0p25

/dev/block/platform/msm_sdcc.2/mmcblk1p1 --> /dev/block/mmcblk1p1

Thank you.
[Huawei Ascend Mate 2] :
[MENTION=3266877]xordos[/MENTION], partition 25 would be "grow" according to your device info. Is there such a folder on your device by that name?
[Huawei Ascend Mate 2] xordos:
I think I am just updating above post while you reading, I believe the p25 is the internal storage.

//compare with /dev/block/vold/179:25, this should be the internal storage:

brw------- root root 179, 25 1970-01-02 10:16 mmcblk0p25

//compare with /dev/block/vold/179:65, this should be the external SD card:

brw------- root root 179, 65 1970-01-02 10:16 mmcblk1p1
[Huawei Ascend Mate 2] :
Yea, your device is confusing me lol. The build.prop shows a config of the sdcard being fused with /data/media which is currently not looking like it. Yet, instead is fused with partition 25 which is /grow instead of /data since /data is actually partition 24.

Looks like this section of your phone will be trial and error on my builds due to the unnecessary complications HAM2 as brought forth with it haha. I will focus on partition 25 for now.

---------- Post added at 05:35 PM ---------- Previous post was at 05:31 PM ----------

I do need to know if there is a "/grow" directory on your device? Or, if not, then "/HWUserData"? It is showing as a vfat. If yes, check the contents and see what that directory has going on.

Lol, really need this device in my hand right now :P
[Huawei Ascend Mate 2] xordos:
no, do not see either
[Huawei Ascend Mate 2] :
Hmmm, well this makes it tough. Your internal sdcard point to p25 which is /grow "also known as /HWUserData, as seen in the stock recovery fstab.

In the BoardConfig.mk file I need to specify the internal storage path. So, by default, I will use the one you mentioned above since I currently cannot determine at the moment how it is fused. Mkg thanks for your assistance. You have been a great help bro. OmniRom has finished syncing. Got a few more things to add in to the device configuration folder and I shall begin the first build.
[Huawei Ascend Mate 2] :
First TWRP alpha build has begun now.
[Huawei Ascend Mate 2] :
Initial build always takes the longest lol....

Anyways, figured I would share a pic of it building for some comfort for you guys/gals.

[MENTION=3266877]xordos[/MENTION], I'm currently using the values for the partition sizes you gave in your zip back on the first page. Hope they are good to go lol.
[Huawei Ascend Mate 2] :
Twrp testing!

Alright, here is the first alpha build. [MENTION=3266877]xordos[/MENTION], I have much confidence in you so I would like if you could test it and report back. I believe you already have your stock recovery saved on the side so that is good.

Here is the link to download TWRP. Anyone WITH SOME KNOWLEDGE may test as well. If you are not sure of your skills then please don't.

http://d-h.st/hPk

IF YOU ARE NOT TESTING THEN DO NOT USE THIS RECOVERY!!!!!!!!!! IF YOU DO NOT KNOW HOW TO TEST THEN DO NOT USE THIS RECOVERY!!!!!!!!!!! IF YOU DO NOT KNOW WHAT A RECOVERY IS THEN DO NOT USE THIS RECOVERY!!!!!!!!!!!!! YOU HAVE BEEN WARNED!!!!!!!!!!!!!
[Huawei Ascend Mate 2] xordos:
Thanks you.... In progress..

Update:

Sorry, bad news... It can't boot into recovery.

1) adb reboot bootloader -- go into boot loader

2) fastboot.exe flash recovery HAM2TWRPRECOVERY.img

3) fastboot reboot -- enter OS ok

4) adb reboot recovery -- instead goto recovery, it went into boot loader again... :(

5) fastboot reboot -- enter OS, dd out new partition, verified it is updated image..

No (vol / power) keys holding needed using above command.
[Huawei Ascend Mate 2] :
If it boots up for you then you should be able to take screenshots throughout the recovery by pressing your volume down + power key. The screen will flash when it takes the shot and store it on your phone.

Fingers crossed that it boots up lol.

---------- Post added at 10:53 PM ---------- Previous post was at 10:48 PM ----------

Boot to your bootloader and manually select to enter the recovery. See if it will let you in this way.
[Huawei Ascend Mate 2] xordos:
Not sure if we are talking about same screen, in the bootloader screen, I can run the fastboot cmd, there is no selection can be done on the phone, it only show the bootloader is UNLOCKED, and press power 10 seconds to reboot.

Let me try using key combination to enter recovery.
[Huawei Ascend Mate 2] :
Ah, I gotcha. Strange little bootloader the device has lol. Let me know.

---------- Post added at 11:22 PM ---------- Previous post was at 11:08 PM ----------

[MENTION=3266877]xordos[/MENTION], not sure if you have tried it, but I saw on another mate device that they would power off the device and while powering the device back on they held down the volume up button which would boot up the recovery??

Gotta get my hands on this device so I can rip it apart haha.
[Huawei Ascend Mate 2] ScoobSTi:
Yes, this is correct. When you power it back on, the power button and volume + button have to be pressed together.

(Power button & volume + ) = Recovery

(Power button & volume - ) = Bootloader
[Huawei Ascend Mate 2] :
Let the testing for TWRP begin :)
[Huawei Ascend Mate 2] xordos:
still no luck...Try all above combination, actually it will always boot into bootloader regardless I press vol+ or vol- with power.

Then as soon as I flash stock recovery, everything goes back to normal.

==== Some other info

BTW, not to discourage anyone, I have read some chinese mate 2 like this:

http://bbs.mo8.com/thread-1719-1-1.html

https://translate.google.com/transl...//bbs.mo8.com/thread-1719-1-1.html&edit-text=

At the very beginning:

"华为mate2正式出货B112版本，bootloader已经去掉对boot recovery的校验，

所以现在可以制作第三方reocvery了"

Translate:

"Huawei Mate2 officially released B112 version, bootloader has removed validation to boot recovery, so now 3rd party recovery can be made"

Of course, they are talking about chinese version Mate2.
[Huawei Ascend Mate 2] :
Hmmm, so if I read that correctly, the current bootloader for the U.S. variant checks the recovery and refuses to boot if it isn't validated as the official stock recovery?

Sounds like some mess HTC would do with their whole S-On and S-Off stuff.
[Huawei Ascend Mate 2] xordos:
Yes, that's just my guess as well that US version may has similar stuff.

Oh, yeah, I also came across some article about HTC and that "3 bytes swap" trick. :) Man, hopefully we can get some leak from Huawei, either how their validation works, or they can release some completely clean bootloader.
[Huawei Ascend Mate 2] :
A HAM2 device is being mailed to me. Hopefully I can figure out this dilemma when I get my hands on it. Would be easier for me if I can snoop around myself.
[Huawei Ascend Mate 2] xordos:
Woh, great, thank you!! Hopefully we can get over all these nonsense.
[Huawei Ascend Mate 2] joe.stone:
The not booting recovery or boot image issue is related to the locked bootloader. If the bootloader is unlocked it will boot if bootimage parameters is correct.

When you enter to the stock recovery you can easily check the status of the bootoader.

On this image you can see that the bootloader is unlocked , but the secureboot is enabled.

It can happen that you have to press both volume buttons to enter twrp recovery.
[Huawei Ascend Mate 2] ScoobSTi:
[MENTION=5537766]Modding.MyMind[/MENTION] you are amazing!

I've been trying to figure out how to donate but it seems impossible...
[Huawei Ascend Mate 2] xordos:
Thanks for the info.

Right now I am in office, with stock recovery.

I just tried hold all 3 buttons to start, it shows something new (will take screen shot later), and not same as your picture.

The screen is like a recovery screen that has a android robot as the background:

Installing System Update .... //only this line in chinese

check sd update pkg is exist...
make sure usb cable has been inserted!
usb update starting....

I heard this is something called "Force Flash"...not sure which this utils called? like ODIN?

I wait a few minutes, since no cable connected, I guess I will just force reboot.

BTW, in your picture, which menu to select to show those "SecureBoot" info?
[Huawei Ascend Mate 2] joe.stone:
The two volume buttons with power on is dload mode. It means that it will install stock rom in update.app format which must be in dload folder of the sdcard. I mentioned this because on Mate sometimes it happens that only with this combanition brings up twrp recovery The picture is posted with stock recovery. With twrp the dload method (vol+ & Vol- & power on) is not working.

The secureboot info is shown as : This Phone is secureboot phone.

I had exactly the same issues until I managed to unlock Mate's bootloader. After bootloader unlock it boots any compatible boot or recovery image.

If may I suggest : First try with boot.img. download the stock boot.img from the phone with dd then unpack and repack the img. Flash it and see is it booting or not. If not booting you have two ways tor recover the phone . One is dload method , the second is fastboot. (Vol-) . If the recovery is overwritten you loose the dload method. On Mate with locked bootloader only Huawei digitally signed boot or recovery worked.
[Huawei Ascend Mate 2] xordos:
but right now, the mate2 phone bootloader is already unlocked, then we have gain root access. Then now we are trying to build customized recovery and got stuck here. we are suspecting there is still some sig/genius check on recovery. Or you mean after bootloader unlocked, we should be able to boot to customized recovery?
[Huawei Ascend Mate 2] :
Well, I wish I could assist with this slight hiccup but until I get the device in my hand I'm out for this count. If resolved then I can continue my work lol. Till then, I am a sitting duck at the moment.
[Huawei Ascend Mate 2] :
Hey guys, not sure if there has been any progress here with the recovery dilemma but in the meantime if you need to reach out to me sent me a pm or tag my name via "mention". Currently converting my daily device to be all F2FS compatible. TWRP is good to go and now working on the kernel source for my device which is building as we speak after working out some slight errors, then comes the ramdisk.

Keeping myself occupied lol.
[Huawei Ascend Mate 2] xordos:
Not much progress, retried a few more times with same result (power with vol+ or vol- or all 3 keys together). I even flash an MT2-C00 (which is different CPU/kernel) recovery, see if they can pass validation and boot into recovery then freeze. But its the same, it always goes directly into bootloader screen. :(

BTW, attached is the screen shot of dlmode when using stock recovery ( hold 3 keys when booting ).

For completeness, I also attached recovery and bootloader screen shot.
[Huawei Ascend Mate 2] :
The phone is in my possession.

---------- Post added at 06:44 PM ---------- Previous post was at 06:33 PM ----------

OK guys, to get things moving along rather quickly I need one of you to run that program which unlocks the bootloader. I will PM you the S/N and IMEI number so that you can send back to me in a PM the 16 digit code.

The program requires windows to run and I do not use windows. Strictly Linux :P. Contact me immediately for assistance in this very small matter.
[Huawei Ascend Mate 2] lilila:
I will do that right now.
[Huawei Ascend Mate 2] :
PM sent.
[Huawei Ascend Mate 2] lilila:
I failed to do it.

Here is the error message.
[Huawei Ascend Mate 2] :
I sent them an email about this. I hope they can resolve the problem quickly..... Grrr..

I feel like I am dealing with HTC all over again.
[Huawei Ascend Mate 2] xordos:
:( thats really strange.
[Huawei Ascend Mate 2] :
Agreed
[Huawei Ascend Mate 2] BBCHAMPs:
Maybe someone could do it on there end? with your IMEI and S/N. Sketchy, i know, but its worth a shot. Maybe you entered the captcha wrong?
[Huawei Ascend Mate 2] :
Already tried with two people. Both got the same error. I'm not concerned with the info being given out since I do not use the device daily. My current device is actually a K2_CL (HTC One SV) with Boost Mobile. Given that the MT2-L03 is a gsm device I wouldnt be able to flash it over to Boost since they handle CDMA phones.

The device was kindly given to me for free so I may do some work on it, but until I can get the bootloader unlocked there isn't much I can do unless I go in blindfolded.
[Huawei Ascend Mate 2] Shaky156:
I can fix this when I have free time lol
[Huawei Ascend Mate 2] Shaky156:
Im not sure what application was used and who it was provided by to unlock the bootloader but, here is an official way of unlocking the bootloader from huawei website themselves.

http://emui.huawei.com/plugin.php?id=unlock&mod=unlock&action=apply
[Huawei Ascend Mate 2] xordos:
Yes, but the only problem is this official URL only has MT2_C00 which is not our MT2_L03, and I tried select MT2_C00 and input my phone info, it doesn't work, says something invalid/mismatch.

And this thread is about how we successfully unlock bootloader and root the phone, That application provides an "Other" option, and our MT2_L03 worked using this app:

http://xdaforums.com/ascend-mate2/general/progress-rooting-ham2-t2867975

There is a dozen people (or much much more include me) has successfully retrieved the unlock code. But not Modding.MyMind, I guess he is special, so he got special treatment :)
[Huawei Ascend Mate 2] gierso:
[MENTION=5537766]Modding.MyMind[/MENTION]

Shoot me the imei and SN data via PM so i can try to create the unlock code . I.just unlocked mine last week

Let me see if i can :)

Enviado desde mi MT2-L03 HAM2 ... i'm lovin' it
[Huawei Ascend Mate 2] Shaky156:
Ah right I understand, I dont own the device, but I will create TWRP for everyone here when I have the free time