FORUMS
Remove All Ads from XDA

Creating boot images for Mi 5C

6 posts
Thanks Meter: 6
 
By usedbytes, Junior Member on 18th March 2017, 12:33 AM
Post Reply Email Thread
Hi, this might be more suitable in the ROMS/development section, but I don't have a post count high enough to post there.

I've been hacking around on the Mi 5C since I got it last week. I thought I'd share what I've learnt.

With regards to the device itself - it's very nice. Metal construction, vivid screen, great build quality. I'm very pleased with it - though even after changing the language there's a lot of Chinese stuff in the stock ROM which I can't read. Obviously no play store/GMS either. I haven't spent any time trying to sideload those because I'm flashing it pretty regularly at the moment.

Bootloader Unlocking
The process for unlocking the bootloader is the same as for other Xiaomi phones, put in a request on en.miui.com/unlock, then wait for a code and use their unlocking tool to unlock.
I had success with version 1.1.1111.11231 of the Mi Unlock Tool, which you can find in the MIUI forums.

Boot Images
I initially had some trouble getting the (unlocked) bootloader to accept any boot images which I created. It would tell me "image verify failed".
After fiddling around with creating different images and comparing them to the stock one in the Xiaomi ROM, I discovered that the bootloader is expecting the images to have a sha256 checksum rather than sha1.
I don't know what the motivation for that was - but if you swap sha1 for sha256, it works fine.

I've got a patched version of mkbootimg on Github at usedbytes/mkbootimg (branch sha256) which lets you specify sha256 on the command line. I've submitted a pull request to get it back into osm0sis' repo, which is where Google sent me to get the mkbootimg source code.

With that mkbootimg, you can create boot images for the mi5c with the following parameters (taken from the stock ROM):
Code:
mkbootimg \
    --kernel $KERNEL_IMAGE \
    --ramdisk $RAMDISK \
    --cmdline "console=ttyS0,115200 earlyprintk=uart8250-32bit,0xF900B000 androidboot.hardware=song no_console_suspend debug user_debug=31 loglevel=9" \
    --base 0x0 \
    --pagesize 4096 \
    --kernel_offset 0x0a080000 \
    --ramdisk_offset 0x0c400000 \
    --dt $DEVICETREE \
    --tags_offset 0xc200000 \
    --os_version 0.0.0 \
    --os_patch_level 0 \
    --second_offset 0x00f00000 \
    --hash sha256 \
    --id \
    -o $OUTFILE
Root
I have managed to root it by manually installing SuperSU into my init ramdisk. That was quite an involved process which I won't go in to.
If anyone is really interested I can write it up - but it would be better to find a better way, such as porting TWRP.

TWRP/Custom ROM
Xiaomi haven't released any source for the Mi 5C, and I'm not sure if we can expect them to.
I do intend to try and port TWRP to it, but having never done anything like that before I don't know if I'll succeed.
My eventual goal is to get AOSP onto it, but again having not tried building a custom ROM before, it will be a challenge.

Hopefully the information here can help someone who knows what they are doing start some development on this device!
The Following 5 Users Say Thank You to usedbytes For This Useful Post: [ View ] Gift usedbytes Ad-Free
 
 
26th March 2017, 05:22 PM |#2  
Junior Member
Thanks Meter: 0
 
More
Hi, very nice work dude !
I have some questions though.
Is there a way to enable some network band ? Because you surely have noticed that this phone doesn't work very well in 3G outside China.
Plus do you think you can create a custom global MIUI ROM ?
27th March 2017, 09:09 AM |#3  
Junior Member
Thanks Meter: 2
 
More
Hi!
Big thanks to usedbyte for expanded description to create modified boot for Mi5C.
I make a custom fastboot rom for this device with all translations and patches at Multirom.me Team
https://yadi.sk/d/V3Btc_NB3GFbZx
The Following User Says Thank You to Alting For This Useful Post: [ View ] Gift Alting Ad-Free
27th March 2017, 03:38 PM |#4  
Junior Member
Thanks Meter: 0
 
More
Quote:
Originally Posted by Alting

Hi!
Big thanks to usedbyte for expanded description to create modified boot for Mi5C.
I make a custom fastboot rom for this device with all translations and patches at Multirom.me Team

Hi, could you explain how I can install it ? Because TWRP isn't port on Mi5C yet. Thanks !
28th March 2017, 10:22 AM |#5  
Junior Member
Thanks Meter: 2
 
More
Quote:
Originally Posted by Calentyth

Hi, could you explain how I can install it ? Because TWRP isn't port on Mi5C yet. Thanks !

You must first unlock your device and install via fastboot.
My friend make a full archive for fastboot: https://yadi.sk/d/dHsiZDef3GGpWr
28th March 2017, 09:48 PM |#6  
OP Junior Member
Thanks Meter: 6
 
More
Quote:
Originally Posted by Alting

Hi!
Big thanks to usedbyte for expanded description to create modified boot for Mi5C.
I make a custom fastboot rom for this device with all translations and patches at Multirom.me Team
https://yadi.sk/d/V3Btc_NB3GFbZx

Hey Alting, np.

Whats in your ROM exactly?
28th March 2017, 09:55 PM |#7  
OP Junior Member
Thanks Meter: 6
 
More
Quote:
Originally Posted by IXI Nyx IXI

Hi, very nice work dude !
I have some questions though.
Is there a way to enable some network band ? Because you surely have noticed that this phone doesn't work very well in 3G outside China.
Plus do you think you can create a custom global MIUI ROM ?

Well there's a thread on the MiUi forums about unlocking FDD LTE: en.miui.com/thread-538090-1-1.html
but there's another thread by the same guy saying it's not possible: en.miui.com/thread-526343-1-1.html

To be honest, I haven't actually put a SIM card in mine - I've been spending all my time hacking around on it. I will put a SIM in and see what happens.
29th March 2017, 07:56 AM |#8  
Junior Member
Thanks Meter: 2
 
More
Quote:
Originally Posted by usedbytes

Hey Alting, np.

Whats in your ROM exactly?

It's just fastboot version of MultiROM Team ROM (https://multirom.me/).
Included translate to all languages of global version MIUI, gapps, e.t.c.
31st March 2017, 10:15 AM |#9  
Junior Member
Thanks Meter: 0
 
More
Hey,
I am trying to unlock the Mi5C and I already have the unlock code but when I use the Mi Flash Unlock Tool v1.1.1111.11231 it says that it couldn't verify the device.

Do you have any clue on how to solve this issue? My MIUI version is 8.1.13.0 China Stable.

Thank you so much!

Albert
31st March 2017, 11:36 AM |#10  
Member
Thanks Meter: 15
 
More
look here:
http://en.miui.com/thread-536089-1-1.html
Someone talks about the installing Mi PC Suite and removing the ADB driver.
Not sure if that is helpful as I do not have a Xiaomi phone & have not used the PC Suite.
31st March 2017, 12:23 PM |#11  
OP Junior Member
Thanks Meter: 6
 
More
Quote:
Originally Posted by alloveras

Hey,
I am trying to unlock the Mi5C and I already have the unlock code but when I use the Mi Flash Unlock Tool v1.1.1111.11231 it says that it couldn't verify the device.

Do you have any clue on how to solve this issue? My MIUI version is 8.1.13.0 China Stable.

Thank you so much!

Albert

I had this problem as well actually. Firstly you need to make sure that you're logged in to your Mi account on the phone.
The thing that made it work for me though was finding the device in device-manager (I don't remember what it was called - some random USB device) and removing the driver for it.
There were instructions on the MiUI forums about it - if you search for the error message you should be able to find it
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes