[Q] Booting to recovery with ADB - LG Optimus 4X HD

Good morning guys,
I potentially have a couple of hundred of these to update with an AOSP ROM. I dont have any problems with the update, all smooth sailing, but I'm trying to script as much as possible to automated the process - Unlock bootloader, get root, push all the files then install the ROM.
For some reason though the command 'adb reboot recovery' doesn't work as expected. It just reboots the phone back to the normal OS.
Has anyone else encountered this? or a work around?
I can issue 'adb reboot-bootloader' and it will reboot into the bootloader correctly where I can issue fastboot commands but not to the recovery (Which is CWM latest as of today, which I think is 6.1.1?)
Thanks in advance!

Code:
adb shell
su
echo "boot-recovery" | /system/bin/dd of=/dev/block/mmcblk0p5 bs=1 count=13
reboot / reboot recovery

Adam77Root said:
Code:
adb shell
su
echo "boot-recovery" | /system/bin/dd of=/dev/block/mmcblk0p5 bs=1 count=13
reboot / reboot recovery
Click to expand...
Click to collapse
Your a genius.
As a side note this didn't require root access.

Adam77Root said:
Code:
adb shell
su
echo "boot-recovery" | /system/bin/dd of=/dev/block/mmcblk0p5 bs=1 count=13
reboot / reboot recovery
Click to expand...
Click to collapse
Maybe you can help me out a little futher. What I'm trying to do is automate the superuser install.
From the look of that, is that writing to one of the recovery commands located under /cache/recovery ? Perhaps the command file?
If it is or not, perhaps you know of a way to write the /cache/recover/command file to run an update ZIP immediately on rebooting into the recovery? My reading seems to be going in circles.
From my reading what I would need to do is:
* Copy the superuser.zip to the sdcard
* write 'boot-recovery' to 'a' file as you mentioned above
* write '--update_package=/sdcard/superuser.zip' to the file /cache/recovery/command
Obviously without root already I cant just write to that file so I thought it might be possible to use 'dd' as above?
Then rebooting into recovery should automatically run the update zip? Or am I mad?

You do need root to write into the command file. 'dd' tool also needs root.

Related

[GUIDE] Steps to root stocked Nexus One android without flashing(unlocked bootloader)

Disclaimer 1 : I tried to look for something like this but I did not found it. Then I tried to achieve it. Sorry if they are well known steps
This guide allows to root a Nexus One with unlocked bootloader with NO need to flash recovery
USE THAT INFORMATION AT YOUR RISK!!
Updated: Added a line to work with Gingerbread
That steps are for Ubuntu. If you are any interested windows user, please let me know.
Prerequisites:
Unlocked bootloader
adb working properly
1. Download fastboot
Code:
wget --referer=http://developer.htc.com/adp.html http://dl4.htc.com/RomCode/ADP/fastboot.zip
unzip fastboot.zip
chmod u+x fastboot
rm fastboot.zip
2. Obtain busybox (anyone have any direct link?) - NOT GOING TO FLASH CM, JUST GETTING busybox from a trusted place
Code:
wget http://download.cyanogenmod.com/get/update-cm-7.0.0-N1-signed.zip
unzip update-cm-7.0.0-N1-signed.zip system/xbin/busybox
rm update-cm-7.0.0-N1-signed.zip
3. Download su
-- UPDATE: that link broken, you have to donwload it from Google Play
Code:
wget http://dl.dropbox.com/u/6408470/su-releases/su-2.3.6.1-ef-signed.zip
unzip su-2.3.6.1-ef-signed.zip system/app/Superuser.apk system/bin/su
rm su-2.3.6.1-ef-signed.zip
4. Download recovery-RA - NOT GOING TO FLASH IT, DON'T WORRY!!!
Code:
wget -O recovery-RA-passion-v2.2.1.img http://files.androidspin.com/files/amon_ra/RECOVERY/recovery-RA-passion-v2.2.1.img
md5sum recovery-RA-passion-v2.2.1.img
echo ... Validate md5sum is 3def709ab1c9e051a92a1c8b1504a36a
5. Reboot to bootloader - JUST BOOTING WITH, NO FLASHING
Code:
adb devices
adb wait-for-device
adb reboot-bootloader
fastboot boot recovery-RA-passion-v2.2.1.img
echo ... Waiting for recovery image load
while [ -z `adb shell pwd 2> /dev/null` ]
do
sleep 1
done
6. Root it!
Code:
adb shell mount /system
adb push system/xbin/busybox /system/bin/busybox
adb shell chmod 4755 /system/bin/busybox
adb push system/bin/su /system/bin/su
adb shell chmod 4755 /system/bin/su
adb push system/app/Superuser.apk /system/app/Superuser.apk
adb shell chmod 4755 /system/app/Superuser.apk
7. Reboot and enjoy rooting
Code:
adb shell reboot
Will this work on stock Gingerbread?
If you are running Nexus One with Gingerbread, as I understand, it can work. I've not tried, you can try.... at your risk ;-)
Helleqn said:
Will this work on stock Gingerbread?
Click to expand...
Click to collapse
If you have an unlocked bootloader, yes, it will work. If you have an unlocked bootloader, you can install pretty much anything you want, whenever you want...
Sent from my Nexus One using XDA Premium App
Helleqn said:
Will this work on stock Gingerbread?
Click to expand...
Click to collapse
I've added a adb command (mount /system) to work with Gingerbread. It works on mine.
It also works on 2.3.4
Yep. Worked great for me. But with all due respect, it seemed a little fishy to me that your directions have users pull busybox from Cyanogenmod but then have them pull su and Superuser.apk from a random file on a Dropbox account especially since both files are available in the already trusted Cyanogenmod download that was used for busybox. And even more so because the Superuser.apk file using your instructions is a larger file than the one included with Cyanogenmod. So I only used the files from CM and it worked like a charm.
Not accusing you or anything. I'm just pointing that out.
The easier way is to do step 5, then flash the su zip from step 3, and you're pretty much done. You can install busybox through the Market app...
Don't worry for the link, I toke it from the original post for that su release:
http://forum.xda-developers.com/showthread.php?t=682828
I agree it's enough with CM but I intend to get the last version... may be it's not the best option...
Thanks for your comments.

[Q] Terminal command to reboot in recovery?

Just by curiosity I tried 'reboot recovery' and I had a normal reboot. It works on other devices...
Perhaps a different partitioning problem? Is there a way to do this by terminal or Adb command?
adb reboot recovery?
Code:
su
dd of=/dev/block/mmcblk0p3 seek=6144 bs=1
reboot
Thanks, i supposed it has to do with more specific commands than usual !!

Phone doesn't boot

Hello,
I downloaded the latest version of busybox on my o4x, after I downloaded that, I turned off my device. When I tried to turn it back on, it got stuck on the 'loading apps' page, so I can't basicly do nothing with the phone. I let it load apps for like 10 hours (while on the charger) but that didn't work, and I let my phone run out of battery and after a couple of hours turn it back on, that also didn't work.
Does anyone know how to fix it, or can at least tell me what the problem is?!
Thanks,
Luuk
Try to clear dalvik cache, so that it gets rebuilt. Then try again. If you don't have CWM installed, you might as well be able to do it manually, but unfortunately I don't know the commands for that atm.
luuk.vandeven said:
Hello,
I downloaded the latest version of busybox on my o4x, after I downloaded that, I turned off my device. When I tried to turn it back on, it got stuck on the 'loading apps' page, so I can't basicly do nothing with the phone. I let it load apps for like 10 hours (while on the charger) but that didn't work, and I let my phone run out of battery and after a couple of hours turn it back on, that also didn't work.
Does anyone know how to fix it, or can at least tell me what the problem is?!
Thanks,
Luuk
Click to expand...
Click to collapse
I had the same problem. You can start the P880 in stock recovery and connect it to pc. After the drivers are installed, you have access via adb. Because you installed busybox, i think your device is rooted. So you cann access your P880 with "adb shell", in the shell "su", then you have to mount system and you can push another busybox (e.q. from root, the o4xr directory contains a functionally busybox) to your phone (/system/xbin)
Just download o4xr.zip from the "How to Root" thread.
Then do the following:
- extract o4xr.zip and switch to that folder
- adb shell "su -c 'mount -o remount,rw -t ext4 /dev/block/mmcblk0p33 /system'"
- adb push busybox /sdcard/
- adb shell "su -c 'cat /sdcard/busybox > /data/local/busybox'"
- adb shell "su -c 'chmod 777 /data/local/busybox'"
- adb shell "su -c 'cat /sdcard/busybox > /system/xbin/busybox'"
- adb shell "su -c 'chmod 777 /system/xbin/busybox'"
- At this point the device will reboot itself automatically (Don't know why?), if not: adb shell 'su -c reboot'
- Delete /sdcard/busybox
- Done
I´ve done all this and its booting again with no problems....
Allright, it all sound really complicated to me. I will do my very best! But how exactly do I boot my phone in stock recovery mode, volume up and power button at the same time?
Bogeyof said:
I had the same problem. You can start the P880 in stock recovery and connect it to pc. After the drivers are installed, you have access via adb. Because you installed busybox, i think your device is rooted. So you cann access your P880 with "adb shell", in the shell "su", then you have to mount system and you can push another busybox (e.q. from root, the o4xr directory contains a functionally busybox) to your phone (/system/xbin)
Just download o4xr.zip from the "How to Root" thread.
Then do the following:
- extract o4xr.zip and switch to that folder
- adb shell "su -c 'mount -o remount,rw -t ext4 /dev/block/mmcblk0p33 /system'"
- adb push busybox /sdcard/
- adb shell "su -c 'cat /sdcard/busybox > /data/local/busybox'"
- adb shell "su -c 'chmod 777 /data/local/busybox'"
- adb shell "su -c 'cat /sdcard/busybox > /system/xbin/busybox'"
- adb shell "su -c 'chmod 777 /system/xbin/busybox'"
- At this point the device will reboot itself automatically (Don't know why?), if not: adb shell 'su -c reboot'
- Delete /sdcard/busybox
- Done
I´ve done all this and its booting again with no problems....
Click to expand...
Click to collapse
luuk.vandeven said:
Allright, it all sound really complicated to me. I will do my very best! But how exactly do I boot my phone in stock recovery mode, volume up and power button at the same time?
Click to expand...
Click to collapse
Vol- & Power. Vol+ & Power will bring you to "Emergency mode", this might work as well. Just make sure you have adb access.
Hello
Thanks for the guidance' the only thing is that "adb push busybox /sdcard/" is not recognized so I pushed the file into /temp I created and then continued accordingly
yishay said:
Hello
Thanks for the guidance' the only thing is that "adb push busybox /sdcard/" is not recognized so I pushed the file into /temp I created and then continued accordingly
Click to expand...
Click to collapse
Normally u can push directly through /data/local without the /sdcard step. But its ok to push it to any other local tem-folder before moving it to /system/xbin...
Search for total commander the pc version and the adb plugin then you can access the phone file system, il post what next to do,
* total commander - http://www.ghisler.com/ - officall free version
adb plugin -- http://www.totalcmd.net/plugring/android_adb.html
---------- Post added at 03:53 PM ---------- Previous post was at 03:43 PM ----------
basically what you need to do is said in this extract from a previous post i had done
open total commander and then click configuration and then click options then next click the plugins tab followed by the the WFX button,
then point it at the installed adb plugin,
Once you have done that click the Drive tab in total commander it will be set a drive C:/ and change to Network Neighbourhood, now go to your phone and plug in your usb lead while powering it up and holding the power key and volume up and not releasing until it starts.
Now in total commander click adb in the explorer part and it access you into your phones file system so click on the root folder then click the system folder and then click the Xbin folder i replace the busybox inside with the busybox file which is in o4xr
Please
Hello,
Thanks for the support, but I don't understand anything from your post. I'm not a real geek, and know how all this stuff works, so my phone is still dead. Lg won't take it back for repair, and other phone companies can't manage to fix my phone. So can you please give me some more specific instructions, sorry that i'm a noob, but I miss my phone .
I only understood the 'download the onxr4 file and extract it', after that I lost it:silly:.
Bogeyof said:
I had the same problem. You can start the P880 in stock recovery and connect it to pc. After the drivers are installed, you have access via adb. Because you installed busybox, i think your device is rooted. So you cann access your P880 with "adb shell", in the shell "su", then you have to mount system and you can push another busybox (e.q. from root, the o4xr directory contains a functionally busybox) to your phone (/system/xbin)
Just download o4xr.zip from the "How to Root" thread.
Then do the following:
- extract o4xr.zip and switch to that folder
- adb shell "su -c 'mount -o remount,rw -t ext4 /dev/block/mmcblk0p33 /system'"
- adb push busybox /sdcard/
- adb shell "su -c 'cat /sdcard/busybox > /data/local/busybox'"
- adb shell "su -c 'chmod 777 /data/local/busybox'"
- adb shell "su -c 'cat /sdcard/busybox > /system/xbin/busybox'"
- adb shell "su -c 'chmod 777 /system/xbin/busybox'"
- At this point the device will reboot itself automatically (Don't know why?), if not: adb shell 'su -c reboot'
- Delete /sdcard/busybox
- Done
I´ve done all this and its booting again with no problems....
Click to expand...
Click to collapse
Try reflash the *.KDZ .
See this thread :-
http://forum.xda-developers.com/showthread.php?t=2069723
Then boot into recovery [ (power on) + (vol-) ] .
Then wipe cache ,, and do factory resert . This will delete all your apps .
Good Luck .
Sent From LG-P880
Try Use THANKS Button If I Helped
Kdz flash
luuk.vandeven said:
Hello,
I downloaded the latest version of busybox on my o4x, after I downloaded that, I turned off my device. When I tried to turn it back on, it got stuck on the 'loading apps' page, so I can't basicly do nothing with the phone. I let it load apps for like 10 hours (while on the charger) but that didn't work, and I let my phone run out of battery and after a couple of hours turn it back on, that also didn't work.
Does anyone know how to fix it, or can at least tell me what the problem is?!
Thanks,
Luuk
Click to expand...
Click to collapse
do the kdz flash. Easiest and safest. Worked for me with the same prob like you.
Did that
I already did that al long time ago, didn't work though. I'm considering to buy a new phone, I've been having these prpblems for several weeks now.
OS_Hacking said:
Try reflash the *.KDZ .
See this thread :-
http://forum.xda-developers.com/showthread.php?t=2069723
Then boot into recovery [ (power on) + (vol-) ] .
Then wipe cache ,, and do factory resert . This will delete all your apps .
Good Luck .
Sent From LG-P880
Try Use THANKS Button If I Helped
Click to expand...
Click to collapse
luuk.vandeven said:
I already did that al long time ago, didn't work though. I'm considering to buy a new phone, I've been having these prpblems for several weeks now.
Click to expand...
Click to collapse
Why don't you just send it to LG for repair. They'll fix it for you and you'll get it back as good as new. And after you have done that, stop messing around with busybox.
luuk.vandeven said:
I already did that al long time ago, didn't work though. I'm considering to buy a new phone, I've been having these prpblems for several weeks now.
Click to expand...
Click to collapse
What doy exactly mean? You tried that but didn't work or you are unable to do a kdz flash? Please be clear.
!!
OS_Hacking said:
Try reflash the *.KDZ .
See this thread :-
http://forum.xda-developers.com/showthread.php?t=2069723
Then boot into recovery [ (power on) + (vol-) ] .
Then wipe cache ,, and do factory resert . This will delete all your apps .
Good Luck .
Sent From LG-P880
Try Use THANKS Button If I Helped
Click to expand...
Click to collapse
Dude...
You are my man! I've got the problem solved, so thank you!!

[Tool] Flashe 1.2

Welcome to Flashe!:victory:
Flashe is basically an all-in-one installer which only requires a few clicks and you are root,unlocked(bootloader), and you can choose a recovery to install in the process. This is much easier than using ADB commands or fastboot.:good:
The program does included a feature that allows you to use a custom boot image and get rid of the "unlocked bootloader" screen.
WARNING: USE AT YOUR OWN RISK
Requirements:
-Atrix HD,Razr HD,Razr MAXX
- .bin logo file(rename to logo when put in flashe folder)
- .iso for your recovery(CWM,TWRP, or Philz)
Future Update:
-Downloads the required files from a server
-Menu(choose to install other things
-GUI, instead of text there is a actual button interface.
Errors:
You MUST allow the program to boot you into recovery otherwise the custom recovery is lost due to the android os overwriting it. If you have any other errors pm
me!
This uses djrbliss's exploit,special thanks to him for his exploit, but the rest is all coded in by me.
Enjoy!
Alienware258 said:
This uses djrbliss's exploit,special thanks to him for his exploit, but the rest is all coded in by me.
Click to expand...
Click to collapse
But how is this any different than MythTools? : http://forum.xda-developers.com/showthread.php?t=2262726
And if this is a Windows program, then we have no idea what commands you're sending to the phone. No Open Source? No thanks. I really suggest everybody use Myth instead...
Oh, and Trend Micro identified it as a virus and deleted it: http://about-threats.trendmicro.com/us/malware/ANDROIDOS_ROOTRAZR.A
quasihellfish said:
But how is this any different than MythTools? : http://forum.xda-developers.com/showthread.php?t=2262726
And if this is a Windows program, then we have no idea what commands you're sending to the phone. No Open Source? No thanks. I really suggest everybody use Myth instead...
Oh, and Trend Micro identified it as a virus and deleted it: http://about-threats.trendmicro.com/us/malware/ANDROIDOS_ROOTRAZR.A
Click to expand...
Click to collapse
I totally agree
quasihellfish said:
But how is this any different than MythTools? : http://forum.xda-developers.com/showthread.php?t=2262726
And if this is a Windows program, then we have no idea what commands you're sending to the phone. No Open Source? No thanks. I really suggest everybody use Myth instead...
Oh, and Trend Micro identified it as a virus and deleted it: http://about-threats.trendmicro.com/us/malware/ANDROIDOS_ROOTRAZR.A
Click to expand...
Click to collapse
I looked at the threat, and it calls it a threat because it is a rooting tool.
Also,When I first started rooting I did not get how to use it at all(Mythtools).Instead I used programs on my android.So I made this to help new users coming to the atrix community once I finished learning ADB commands and some fastboot commands.
Here is the source:
Code:
adb kill-server
adb wait-for-device
adb push pwn /data/local/tmp/pwn
adb shell chmod 755 /data/local/tmp/pwn
adb push su /data/local/tmp/su
adb push busybox /data/local/tmp/busybox
adb install Superuser.apk
adb shell /data/local/tmp/pwn
adb shell rm /data/local/tmp/pwn
adb shell rm /data/local/tmp/su
adb shell rm /data/local/tmp/busybox
adb reboot
adb wait-for-device
adb push unlock /data/local/tmp
adb shell chmod 755 /data/local/tmp/unlock
adb shell su -c /data/local/tmp/unlock
adb shell rm /data/local/tmp/unlock
adb reboot bootloader
fastboot getvar all
fastboot continue
adb wait-for-device
adb reboot bootloader
echo [-] To continue you will need a boot file which will
echo [-] replace the "Unlocked Bootloader" image. Name it:
echo [-] logo.bin
echo [-] Continue when you are in the bootloader and have the file.
pause
fastboot flash logo logo.bin
fastboot continue
echo [-] Processe complete!
echo [-] -Root installed
echo [-] -Bootloader unlocked
echo [-] ---------------------
echo [-] This next step will install a recovery.
echo [-] Recovery will allow you to install your own roms,etc(depending on the selected recovery)
echo [-] Rename your recovery image "rec" so it should be 'rec.img' then continue.
pause
adb reboot bootloader
echo [-] Continue once in bootloader
pause
fastboot devices
fastboot flash recovery rec.img
echo [-] Once finished flashing continue...
pause
adb reboot recovery
echo [-] Complete! You now should have recovery installed. Enjoy!
pause

Can't press power button in recovery mode

Well, after wiping data using adb shell I wanted to install a rom with CWM recovery that was already installed from someone but as soon as I got on recovery mode power button was unable to press. When phone is on or off, power button works perfect. The problem is in the recovery mode. Is there any way I can flash the rom and the gapps without using my phones buttons? Through adb maybe?
Dont use cwm, its outdated, install twrp 2.8.6.0.
Marko055 said:
Dont use cwm, its outdated, install twrp 2.8.6.0.
Click to expand...
Click to collapse
Ok mate, I'll give it a try. Is there anyway I can install it from adb? Because my cwm don't let me press the powerbutton and also I dont have access to my rom because I cant install gapss
Installation guide:
[Method 1° ~ fastboot]
Code:
$ adb reboot oem-unlock
$ fastboot flash recovery /PATH-TO-THE-IMG-FOLDER-ON-YOUR-COMPUTER/twrp.img
$ fastboot reboot
[Method 2° ~ adb] (put the recovery.img in your sdcard)
Code:
$ adb shell
$ su
# cat /sdcard/twrp.img > /dev/block/mmcblk0p1
# sync
# exit
$ exit
Marko055 said:
[Method 2° ~ adb] (put the recovery.img in your sdcard)
Code:
$ adb shell
$ su
# cat /sdcard/twrp.img > /dev/block/mmcblk0p1
# sync
# exit
$ exit
Click to expand...
Click to collapse
Worked like a charm thank you so much for your help!
zhulk13 said:
Worked like a charm thank you so much for your help!
Click to expand...
Click to collapse
One more thing, install theme, its way better for eyes.
http://forum.xda-developers.com/android/themes/theme-twrp-materialised-dark-light-play-t2915584
Marko055 said:
One more thing, install theme, its way better for eyes.
http://forum.xda-developers.com/android/themes/theme-twrp-materialised-dark-light-play-t2915584
Click to expand...
Click to collapse
Wow! I didn't even know that there are themes for recoveries! Thank you very much!!

Categories

Resources