[DEV] CWM for Locked Bootloader XMS,XMD. New Installer for Windows OS.

Search This thread

JustArchi

Inactive Recognized Developer
Mar 7, 2013
8,739
38,807
Warsaw
Please... read my OP carefully.
I see @Rachit Rawat and @[Nut} have successfully add recovery to stock rom Jb 4.2 for xperia L and Xperia Z too with locked bootloader condition.

May i try to explain, with this method we just hijack the boot process of stock kernel, stock ramdisk to boot our custom boot script to launch the recovery. just like that. and about the unmout -l (lazy unmout) its to unmount every mountpoint that was mounted by original ramdisk so before the recovery launch its clean from mountpoint of original ramdisk.

Please check @Rachit Rawat thread here
Xperia L stock recovery
http://xdaforums.com/xperia-l/orig-development/cwm-recovery-installer-t2589320

thanks for you reply.

I know what you're trying to do, I can read source code. And I didn't say that it's impossible. I said that you're gonna have a bad time.
 
E

E.T.N

Guest
You're asking for troubles guys.

First of all, correct me if I'm wrong, I'm not experienced with fastboot yet. You have root and rom with busybox, regardless if stock or not. Isn't it possible to simply just flash proper boot.img in kernel block? Bootloader is required to use fastboot and flash unsigned images, by using root in the ROM you're not touching bootloader at all. And including custom recovery in stock boot.img is pretty damn easy.

Second thing, you're trying to do potentially dangerous thing. Dangerous as hell, this can lead to pretty serious filesystem corruptions, as lazy unmounting (umount -l) is never safe. I have knowledge about what you're trying to do, as I included pocket debian in my ArchiDroid since ages and it also uses chroot capability, but it extends android, not trying to hack it and run remote code. Killing services, unmounting filesystems and patching things is not proper thing to do.

Hey archi,
Some devices can't be unlocked due to carrier contract or user's preference to retain warranty. This is where a recovery that runs on locked devices comes in handy.

Whilst I agree with your point on lazy umount , I would like to point out that if you look at code, all the binaries and files namely recovery.tar, busybox and scripts were busybox cp to /sbin. The script e2fsck runs and copies everything required to /sbin beforehand, thus negating any chances of mount lock.

Having said that, it's still a good idea to run a fuser -m /system to look for locking PID's. Imperatively, fuser -km /system can be used to kill relating processes.

A small tip to op,
Look for these services in init.target.rc

service xyz /system/abc/file
user root
oneshot

You can patch this easily to run a custom script which can be used to tar xf a recovery tarball. Put it in chroot jail and exec init.
 
Last edited:

JustArchi

Inactive Recognized Developer
Mar 7, 2013
8,739
38,807
Warsaw
I'm still wondering what will happen if you flash custom boot.img for your locked bootloader device using root in ROM itself through dd.
 
E

E.T.N

Guest
You're right but I'm talking about root and flashing from ROM itself and not bootloader. You can always use dd on /dev/block then.
Custom kernels that aren't signed with Sony's private key will not boot if the bootloader is flagged as locked by trim area (TA). So in this case, a soft brick will happen.
 
E

E.T.N

Guest
So does this mean that we will never get cwm? Please say no
After a quick peek in your kernel source, I think you should be able to get recovery to boot on stock kernel. However you may need to align fb to correct 4096 byte boundary otherwise recovery graphics will be jittery.
 
D

Deleted member 4736004

Guest
Man even though this is your third post on xda, i hope you can make this work for us on a locked bootloader. Good luck

actually it was I :p Had trouble logging in with my original account so made a temporary account.
I'll look into this if I get time. Again no guarantee.
 
  • Like
Reactions: trocLas

gamer649

Senior Member
Feb 8, 2013
1,326
594
@rachitrawat

Just tried to install and then boot into CWM, it shows a pink LED at the Sony logo. Pressing either of the volume buttons makes the phone hang and then reboot. I will report with philZ recovery once my phone rebooots.

EDIT: philZ recovery produces the same result.

EDIT 2: All recoveries produce the same result on my device.
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 6
    Updated July 23, 2014. The recovery only for Stock JB 4.1, 4.2

    The New Installer is for Windows OS.
    Please Set USB debug "ON" in phone and adb driver is already installed in Windows OS and of course Full root.

    Link download:

    New info:
    All recovery is worked as expected, recovery: CWM, PHILZ-touch, and TWRP only on firmware 4.1-4.2.
    And always read the last 10 post.

    Just backing up my XM now, after I have done that I will start the testing on lower firmwares. Been a busy day and I've only been able to start doing stuff for the recoveries.

    EDIT 1: Well, got some good news to report, on the 4.1.2 firmware for the Xperia M SS all 3 recoveries boot as expected (I haven't tested them). I will test on the 4.2.2 Xperia M DS firmware tomorrow morning.

    EDIT 2: Some more good news, on the 4.2.2 firmware for the Xperia M DS only thw CWM and philZ recoveries boot as expected, I can't seem to install TWRP as I keep getting protocol errors in the installer. Again, I haven't tested them.
    @rachitrawat Results are now up for you to look at :)

    Confirmed working on my XM. :good:

    I just installed "recoverie Philz" on my XM with android 4.2.2 and it works 100%.:laugh:

    Many thanks for the most excellent work.

    Translated by google translator. sorry

    Requirement:
    Must be full root

    Quick Installation:
    • Download and extract the installer on your windows pc - http://d-h.st/QsQ
    • Open or click twice install.bat
    • Follow instruction on screen.
    • Don't forget to allow the pc, to access adb on the phone.
    • And allow adb shell in superSU.

    How to boot the recovery:
    • Whatever which the recovery you use. Here the way.
    • Power off the phone. And then turn it on.
    • Wait until the pink LED is shown.
    • Press the vol up button, 1 second after the pink LED is shown.
    • Then the phone should boot to the recovery.

    Mini FAQ:
    Q: the phone not shown the pink LED
    A: please check this files are in the right folder/directory.
    • /system/xbin/busybox
    • /system/bin/recovery.tar
    • /system/bin/recovery.sh
    • and this's script type file /system/bin/e2fsck
    • the original file is renamed to /system/bin/e2fsck.bin
    6
    I think I might have made some progress towards building a working recovery today. I have started to install Ubuntu to dual boot with windows 8.1, while I haven't been able to access the desktop to Ubuntu I have been able to install it. I believe it is a graphics card problem, something I will look into tomorrow. If I am able to access the desktop and fix the problem with the dual boot I will be able to set up a build environment and start to compile the recoveries. Wish me luck, I'm gonna need it.
    3
    Good news (sort of). I have managed to adapt the install.bat into a script what can be run on Linux and Ubuntu (probably Mac too as that is a Unix based system). The script is still ONLY for 4.2.2 and lower (I haven't managed to get any recovery to boot on 4.3 as of yet).

    To use the script;
    1) Download the attachment on this post.
    2) Extract the zip to anywhere (preferably the desktop or the directory where the install.bat file is located).
    2a) If you extracted the file to your desktop you will have to move it to where the install.bat is located.
    3) Right click install.sh and then click properties.
    4) Click permissions.
    5) Set all the permissions to read and write and tick the box next to allow executing file as program. Click close.
    6) Open terminal.
    7) Navigate to the directory where install.sh is.
    8) Type
    Code:
    ./install.sh
    and then click enter.
    9) Install recovery on 4.2.2 and lower.
    3
    Just backing up my XM now, after I have done that I will start the testing on lower firmwares. Been a busy day and I've only been able to start doing stuff for the recoveries.


    EDIT 1: Well, got some good news to report, on the 4.1.2 firmware for the Xperia M SS all 3 recoveries boot as expected (I haven't tested them). I will test on the 4.2.2 Xperia M DS firmware tomorrow morning.

    EDIT 2: Some more good news, on the 4.2.2 firmware for the Xperia M DS only thw CWM and philZ recoveries boot as expected, I can't seem to install TWRP as I keep getting protocol errors in the installer. Again, I haven't tested them.
    @rachitrawat Results are now up for you to look at :)
    2
    If I'm right it won't flash due to it being modified and unsigned and locked bootloaders only accepting signed boot.img's.

    You're right but I'm talking about root and flashing from ROM itself and not bootloader. You can always use dd on /dev/block then.