[Recovery][WIP] ClockworkMod 6.0.3.7


Nov 4, 2013
54
5
18
#1
This is a first attempt to use ClockworkMod Recovery on the Mi3 tegra4 (pisces).

Working so far:
  • adbd in recovery
  • nandroid backup/restore, including system1, boot1
  • running any update.zip (including AROMA)
  • choose system to install update to
  • set active system
Limitations:
  • does not correctly apply MIUI weekly updates (probably partition names not found, investigating)
Anything else untested.

Installing:

(1) Disable automatic recovery reflashing (while running MIUI, requires busybox installed and a root shell, eg "adb root; adb shell")
Code:
mount -o remount,rw /system
chmod 444 /system/etc/install-recovery.sh
mount -o remount,ro /system
Theoretically, this first step should be optional. CWM offers to do it for you when selecting reboot. BUT -- I didn't find a way to get directly to recovery from fastboot. And once MIUI is running, it overwrites your recovery. Bummer....

(2) Flash using fastboot
Code:
adb reboot-recovery
{wait for fastboot}
fastboot flash recovery cwm-*-pisces-*.img
Use at your own risk, right now this is largely untested
Download: cwm-6.0.3.7-pisces-a20131110a.img
Older Releases:
cwm-pisces

Source:
Note: As there's no kernel source available yet, the kernel is left out of device tree. For building yourself, extract stock kernel from your boot image and place it in the device tree (filename "kernel")

History:

a20131110a:
  • Integrated all fixes by M1cha that are not related to TDB -- backup/restore of boot1 now working
  • Set default storage to /sdcard/0, nandroid backups now accessible via MTP

a20131110:
  • Integrated boot-system selection and recovery-check for both systems
  • Used biggest font for readability on fullHD display

a20131109a: Integrated the first dualsystem support modification by M1cha

a20131109: Unmodified CyanogenMod source, no dualsystem support at all
 
Last edited:
Nov 4, 2013
54
5
18
#2
Success :) Integrating M1cha's changes in this newer CWM version works -- a bit tedious, but got a version up and running with initial (buggy) dualsystem support, updating OP now.

I think I'll try to integrate more of M1cha's code fixing some issues for dualsystem, but leave out TDB (true dual boot) for now, as there isn't anything other than MIUI available for the Mi3.
 
Likes: hvung1982
Nov 4, 2013
54
5
18
#3
I think I found an easier installation method, so if anyone could confirm?

(1) Flash using fastboot:
adb reboot-bootloader
{wait for fastboot screen}
fastboot flash recovery cwm-*-pisces-*.img

(2) Boot new recovery:
Type fastboot reboot and press enter while holding Vol+ key should take you directly to CWM.

(3) Let CWM disable recovery flashing (offered automatically when selecting reboot)
 
Nov 4, 2013
54
5
18
#5
Well, thanks ;) Still hoping for feedback from people who actually own a Mi3 (I know there aren't many yet, so, we will see...) cause "works for me" doesn't really seem good enough...

Meanwhile, I'm trying to replace stock kernel image by some open-source kernel, found a kind of promising tree and figured it would be enough for recovery to have working drivers for mmc block device, framebuffer, buttons eventdev and some basic platform stuff. Still this is challenging -- there's no way to even get the stock kernel's .config and I'm not exactly an expert for ARM platforms ;) Well, at least trying...

edit: Progress so far ... I could identify a lot of drivers just from the kernel output of stock kernel -- and find them in the source-tree linked above. But the cross-toolchain coming with CM10.1 chokes on it right now ("internal error" in binutils-2.21 :mad:). Going to try newer/different toolchains. Error was caused by trying to build kernel in "thumb" binary mode, not even newest linaro toolchain seems to support this. Back on gcc-4.6 toolchain

edit2: Tegra aic326x sound driver is totally b0rked in this tree, trying to replace it with something -- any hints? kernel.org original doesn't even have this driver :eek:

edit3: thinking about giving up ... heaps of linker errors from the drivers needed for pisces all linking errors were caused either by old/unneeded drivers or missing automatic config dependencies :) Still: ... want original xiaomi source :(

edit4: Ok, giving up (for now). Managed to fix all build problems and find most of the needed drivers, but without console messages, I have NO IDEA why this damn thing won't boot. Framebuffer console doesn't work and I don't get RAM console working because the tegra platform source uses an older interface to pstore than the rest of this tree... Really need original source as a starting point. Well, maybe time to build some mods flashable with CWM ;)
 
Last edited:
Nov 4, 2013
54
5
18
#7
Did you already try? If so -- can you confirm installation method from post #3 is working?

Right now, i find adb in recovery doesn't work any more.

-- Update --
Solution: If this happens on a Windows PC, uninstall Xiami driver manually and force installation of "Android Composite ADB Interface" from AppData\Local\MiPhoneManager\main\Driver\android_winusb.inf
On a Linux PC, this just shouldn't happen ;)
 
Last edited:

bmn11

Members
Aug 4, 2014
23
5
15
#11
Sorry for resurrecting the old thread but the download link is broken. Any chance someone could re-up it please?