reboot/reboot recovery doesnt work in terminal - Desire HD Q&A, Help & Troubleshooting

im having trouble wirh "reboot recovery" command in my terminal/adb shell
when i try to run in terminal, i get "not permitted!"
and adb shell says [1] Segmentation fault reboot recovery
if i try running reboot -f in terminal or adb shell, i get "usage: reboot [-n] [-p] [rebootcommand]"
i've checked /system/bin, and the reboot bin is there
i've checked the permisssions, originally set to rwsr-sr-x
changing them to rwxr-xr-x makes no change
i found several threads with ppl having the same trouble:
http://forum.xda-developers.com/showpost.php?p=16022907&postcount=2040
http://forum.xda-developers.com/showthread.php?t=1280074
http://forum.xda-developers.com/showthread.php?t=935715
the only one i found useful is the 1st one
the only way i got reboot working is by deleting /system/bin/reboot, and using "reboot -f". without the -f switch nothing happens. if i do reboot recovery -f, it only rebots
but what i really want is to reboot into recovery. any idea on how to? i read in first linked post that the problem is in symlinked reboot to busybox, thats why deleting helped somewhat. anyone has an idea on how to get rebooting to recovery in terminal working?
oh, and my rom is rcmix 4.0. i've read that problem is rom related. but i dont want to switch, because it would defeat the purpouse in the first place....

You need an insecure boot img to run adb as root. No root no reboot. From terminal instead try sudo -i reboot recovery.

sudo not found
and i have root, i do get # in terminal and adb shell. adb commands like push/pull/chmod work fine
about insecure boot image, as far as i can understand you need that in order to have root, whuch i do have. and afaik, that means pretty much all custom kernels? if im missing something here, please do explane...

Related

ADB problem : unable to run any command.

Hello all,
I have a problem with the adb shell.
I rooted my HTC Hero, the superuser permission app is well installed, my ROM is MoDaCo Custom ROM 3.0 core.
I can push/pull files with adb, no problem.
When I go to shell mode (adb shell command), I am in root by default. When I type ANY command (ls, mount, cat, cd, trythismyfriendyoullgetitrepeated...), the shell repeats my command in the output and does nothing, EXCEPT for reboot or exit (they work after repeating themselves in the output)...
What's the point? I am totally lost...
Thanks in advance.
I made a new install of the rom, and like magic it fixed everything... Well, no problem anymore, although I don't understand what happened.

[Guide] How to recover your semi-brick

YES YOU NEED TO READ THIS WHOLE POST, PROB MORE THEN ONCE TO MAKE SURE YOU GOT IT. YES I KNOW HOW LONG IT IS, I TYPED IT!
the reason i call it a semi-brick is because a true brick can bot be recovered with out opening the case.
first go here and read this for info: http://forum.xda-developers.com/showthread.php?t=838484
now since your here im going to assume that its too late.
*things you will need.
copy of cwm recovery. get it here (the manual install link): http://forum.xda-developers.com/showpost.php?p=9145724&postcount=28
adb installed and working.
a known good rom, or nandroid backup. here is one: http://forum.xda-developers.com/showthread.php?t=836042 (use odex one)
a wpthis.ko for YOUR specfic kernel (run (adb shell cat /proc/version) that will tell you what kernel you have)
*first thing we need to know is, are you s-off or s-on now?
if your s-off just boot into clockwork mod recovery, wipe the phone and flash a known good rom and be done with it. if you dont have cwm recovery installed. boot into fastboot (vol down+power) you must have the sdk/adb installed and working, and type fastboot flash recovery LocationOfRecovery.img (where LocationOfRecovery.img= where you have the recovery, ie c:\android\recovery.img). once thats installed follow instructions above.
*if you are s-on:
will the phone boot into android? if so your not bad off.
if you want to unroot to return the phone, follow the unroot thread here: http://forum.xda-developers.com/showthread.php?t=835971
if you dont want to unroot then you have a couple of different options. if you have cwm recovery still installed, just follow instructions above and flash a known good rom. ive been told that boot.img (kernel) wont flash if you are s-on. the way to fix this (temporarily) is boot into recovery, but before you flash run these commands:
(put wpthis.ko in sdk folder)
adb remount
adb push wpthis.ko /data/local/wpthis.ko (specific for your kernel)
adb shell
# insmod /data/local/wpthis.ko (should get same function not implemented error as when u rooted first time)
then proceed to flash the rom. once booted into android skip down to, "now to get back to s-off"
*if you have stock or eng-recovery installed.
will the phone attempt to boot android at all? where is it stuck at?
a good min after it starts to try to boot, type these commands:
adb remount
adb shell
if you can get in shell then theres still hope. back out shell for a second and start here:
put the cwm recovery.img and wpthis.ko in your sdk folder
adb remount
adb push wpthis.ko /data/local/wpthis.ko (specific for your kernel)
adb push recovery.img /data/local/recovery.img
adb shell
# insmod /data/local/wpthis.ko (should get same function not implemented error as when u rooted first time)
# dd if=/data/local/recovery.img of=/dev/block/mmcblk0p21 (now wait a min or 2 to give it time to finish)
#sync (give it another min or to just to be safe)
#reboot recovery
at this point you should be in cwm recovery. follow instructions above for flashing with s-on.
*if you cannot get into shell while booting, but have eng-recovery installed, there might be some options.(however this is all theory)
boot into recovery-
if you are on linux using adb, you can try taking sh from /system/bin folder of any custom rom, chmod 0755 it, then push it to /system/bin and adb shell might work.
windows-
boot into recovery.
a system.img compatible with your installed kernel pushed may work. put the system.img into the sdk folder.
adb push system.img /data/block/mmcblk0p25
then reboot and see where you are. if that dont work, grab the modified miscnew.img here: http://www.4shared.com/file/pUPfrGi-/mmcblk0p17.html
rename it misc.img put it in sdk folder and
adb push misc.img /dev/block/mmcblk0p17
then reboot into bootloader with PC10IMG.zip on root of sdcard and it should run though. if it does your fully stock and get to start all over again.
*if you cannot get into shell, and you have stock recovery, im sorry your pretty screwed. as of right now the only thing thats gonna bring it back is a full img/update signed from htc thats equal to or higher then the version currently on the phone. (well and jtag of course)
*well now you've done one of the steps above. your booted into android, you have perm root, and cwm recovery installed, just still s-on. dont worry your almost there!
first take that wpthis.ko for you kernel and push it, and the eng hboot.
adb push wpthis.ko /data/local/
adb push hboot-eng.img /data/local
then from adb shell, or terminal root prompt:
# insmod /data/local/wpthis.ko (again you should get the function not implemented error)
NOW REMEMBER THIS NEXT STEP COULD MEAN DEATH FOR YOU G2 IF TYPED WRONG, AND AFTER ALL THIS HARD WORK!
# dd if=/data/local/hboot-eng.img of=/dev/block/mmcblk0p18
wait a few mins to be sure its done.
# sync
wait a few more just cause.
reboot, you should now be s-off, cwm recovery installed, and free to do whatever you want. just dont go screwing it up again
* as new methods are discovered, or ones here are proven wrong, i will update as necessary. as of the writing post, 2 devices that i know of have been saved!
good luck!
wpthis.ko for bacon bits.03 kernel: http://www.4shared.com/file/OAcd1bix/wpthis-263221-cyanogenmod.html
coby kyros mid8048-8 stucks on start up logo screen after rom update can anyone tall me what to do o thing to make a sdcard boot but i dont know how pls helppppp.tnks

[Q] ADB Shell Won't Allow me to run as SU

So I'm trying to get into su to run gfree_verify to make sure my permaroot S-off/SIM card unlock/SuperCID was successful, but I'm getting a permission denied error.
What happens is, I type adb shell, then I type su, there's a really long delay, then it tells me Permission Denied. However, when I run the Terminal Emulator from my phone and type in the su command, I get root access just fine.
I used the "official" method that is on the HTC Vision Wiki that is located here. The only thing, however, is that my Android SDK install wasn't installed using any type of installer. I just extracted a zip file and shoved it in a random folder. I did make sure to run the Command Prompt as Administrator before issuing the adb shell command, but I'm still unable to get superuser access through the PC. Trying to use the adb root command gives me an "adbd cannot run as root in production builds" error.
Did I do something incorrectly?
adb kill-server
adb start-server
See if that works. If not, try rebooting your computer.
Sent from a Western Union telegram.
Does the Superuser app seem to be installed correctly on your phone ?
Do you have the output from gfree ? I wonder if it didn't work correctly with your kernel, it doesn't work with all kernels. What ROM/kernel do you have ?
Which procedure did you use, the one in the Wiki, or one involving dd'ing the eng hboot ?
steviewevie said:
Does the Superuser app seem to be installed correctly on your phone ?
Do you have the output from gfree ? I wonder if it didn't work correctly with your kernel, it doesn't work with all kernels. What ROM/kernel do you have ?
Which procedure did you use, the one in the Wiki, or one involving dd'ing the eng hboot ?
Click to expand...
Click to collapse
I rebooted the daemeon, computer, and also the phone. No dice.
The Superuser app is correctly installed. When I ran Adfree and attempted to go into SU in Terminal, I got the usual Allow Superuser access dialog. Both worked without any problems; like I said, I can get root access from the on-the-phone terminal, it's when I attempted to get root access from the adb shell command on my computer where I have problems.
No special ROMs, completely stock post-November OTA update. The only thing I flashed after permarooting was the Clockwork Recovery mod, but adb shell SU wasn't working before this. I initially used some outdated instructions (involving the use of the dd command, and the wpathis.ko or something). I read some more and learned these were out of dated, so I unrooted. I then used the instructions that are on the wiki using gfree to permroot.
gfree_verify works without any problems if I run it from the Terminal Emulator on my phone. Returns the proper values to indicate I'm SIM Unlocked, SuperCID, and S-off. I'm glad it works, but I still don't like the fact I can't use the adb shell. Typing characters on the G2 is a pain in the ass.
I still want to know why I can't enter superuser from the PC adb shell. Am I doing something incorrectly?
Thanks a lot for your help!
Try clearing data for the SuperUser app?
go in your recovery screen from boot, select your mount options, and mount everything lol. Not sure if it'll fix it but everytime I have adb permission issues that seems to fix it and I don't think it could hurt.
dietotherhythm said:
go in your recovery screen from boot, select your mount options, and mount everything lol. Not sure if it'll fix it but everytime I have adb permission issues that seems to fix it and I don't think it could hurt.
Click to expand...
Click to collapse
This worked perfectly! When I entered su from the command prompt, the SuperUser app popped up on the phone's side and I hit allow. It then let me through.
What exactly was broken though? Why did mounting everything from the Clockwork Recovery menu fix this?

Kindle fire 8.9 error updating binary in zip

OK, I had my kindle running cyanogenmod 11. I was having problems with some apps running on it, root was acting weird. Root checkers said it was rooted, but some apps that required root weren't installing right.
Fast forward, I thought perhaps I needed to flash the new version. I got into recovery to run it and flash it and this is the error I have.
So all the forums said, just wipe it then it will work. Of course now I have no OS on the thing. TWRP is fine, but I can't use the tablet.
So some other forums suggested it's either a mounting to E:\ problem or a rooting problems. I can get in to ADB, I've pushed many different roms over and they all have similar errors.
All of the Root tools I can find require you to come in the front door. TWRP fails when it goes to 'fix permission' and every time I reboot says , 'root is gone, swipe to fix' but it's not seeming to stick.
Any ideas on how to make sure I can mount the new rom and get this back up and running.
As I said, I've tried many roms, directly downloaded from CM website: Download:
cm-12.1-20160129-NIGHTLY-d2tmo.zip (284.96 MB)
sha1: e461a1dc263d927de3b6748d3b877310e7b1fd39
Download: cm-12.1-20151117-SNAPSHOT-YOG7DAO1K7-d2tmo.zip (286.1 MB)
sha1: bfb989917775ff190b8b795d93c1e439ccf8a514
I'm running TWRP 2.6.0.0 and have a binary ADB driver of 1.0.31. I can ping 4.2.2.2 so I'm pretty sure since the issue is coming from the device itself, and the way it's erroring reminds me of other permission problems I've seen in other devices that it's a root issue.
Is there a simple command line ADB tool or something that I can use to validate/set root?
Thanks!
kyleyarbrough said:
OK, I had my kindle running cyanogenmod 11. I was having problems with some apps running on it, root was acting weird. Root checkers said it was rooted, but some apps that required root weren't installing right.
Fast forward, I thought perhaps I needed to flash the new version. I got into recovery to run it and flash it and this is the error I have.
So all the forums said, just wipe it then it will work. Of course now I have no OS on the thing. TWRP is fine, but I can't use the tablet.
So some other forums suggested it's either a mounting to E:\ problem or a rooting problems. I can get in to ADB, I've pushed many different roms over and they all have similar errors.
All of the Root tools I can find require you to come in the front door. TWRP fails when it goes to 'fix permission' and every time I reboot says , 'root is gone, swipe to fix' but it's not seeming to stick.
Any ideas on how to make sure I can mount the new rom and get this back up and running.
As I said, I've tried many roms, directly downloaded from CM website: Download:
cm-12.1-20160129-NIGHTLY-d2tmo.zip (284.96 MB)
sha1: e461a1dc263d927de3b6748d3b877310e7b1fd39
Download: cm-12.1-20151117-SNAPSHOT-YOG7DAO1K7-d2tmo.zip (286.1 MB)
sha1: bfb989917775ff190b8b795d93c1e439ccf8a514
I'm running TWRP 2.6.0.0 and have a binary ADB driver of 1.0.31. I can ping 4.2.2.2 so I'm pretty sure since the issue is coming from the device itself, and the way it's erroring reminds me of other permission problems I've seen in other devices that it's a root issue.
Is there a simple command line ADB tool or something that I can use to validate/set root?
Thanks!
Click to expand...
Click to collapse
Your TWRP version is out of date. Flash the 2.8.7.0 image from this thread, reboot into TWRP and make sure your TWRP version is now 2.8.7.0, and try flashing CM12.1 after that.
Sent from my Amazon Jem using XDA Labs
monster1612 said:
Your TWRP version is out of date. Flash the 2.8.7.0 image from this thread, reboot into TWRP and make sure your TWRP version is now 2.8.7.0, and try flashing CM12.1 after that.
Sent from my Amazon Jem using XDA Labs
Click to expand...
Click to collapse
HI! thanks for that advice. I wish I could. I've tried several methods, and although I can get into ADB shell, I can't access su:
besides kindle fire first aide and other batch files, I found some manual instructions:
http://forum.xda-developers.com/showthread.php?t=2277105
Here's what it tells me to do (among many other things): I realize this is just backing up stuff that doesn't exist etc, but it's indicative of the problems without having su.
adb shell su -c "dd if=/dev/block/mmcblk0boot0 of=/sdcard/boot0block.img"
adb shell su -c "dd if=/dev/block/platform/omap/omap_hsmmc.1/by-name/boot of=/sdcard/stock-boot.img"
adb shell su -c "dd if=/dev/block/platform/omap/omap_hsmmc.1/by-name/recovery of=/sdcard/stock-recovery.img"
adb shell su -c "dd if=/dev/block/platform/omap/omap_hsmmc.1/by-name/system of=/sdcard/stock-system.img"
mkdir C:\KFHD8Backup
adb pull /sdcard/stock-boot.img/ [C:\KFHD8Backup]
adb pull /sdcard/stock-recovery.img/ [C:\KFHD8Backup]
adb pull /sdcard/stock-system.img/ [C:\KFHD8Backup]
but if I go into adb shell and type any commands, like just simple su:
I get /sbin/sh: su: not found
when I do whoami: I get root
but I get a funky prompt:
~#^[[61;5R
instead of a normal # root prompt.
So I'm kind of stuck because I can't really do anything without the su, and it says I'm root. So can I adb push over the files and mount the right drives or whatever to get it to recognize su. At that point I can install twrp, but i'm sure at that point my existing twrp will work too!
I can't seem to get it into fastboot mode either. When I adb devices it says I'm in recovery, not device and in TWRP it says no OS installed. So my only functioning loader is TWRP. (or however you put that more accurately).
I feel like with adb push working, I should be able to do something to get this back, but all the tools expect you to just push a button, not do it the hard way.
So long story short, if you can point me to a thread that tells me how to update TWRP or how to push SU over with ADB or anything that would be awesome. I"m not a complete turd at this, but I think I broke it using something like kingoroot instead of just using the bin4ry while I still had the cyanogenmod working somewhat. So I'm thinking that's why i got the funky prompt, and that's why my su is gone from where it should be.

Recover after having deleted /dev/.../modem

Well, I have essentially done everything wrong that you can do wrong.
For security considerations, I wanted to disable my baseband modem on my LG G4 H815 (currently having /e/ installed) - see this beautiful post for the instructions.
As I don't have root, I had the genius idea to do it all via the TWRP recovery. Once booted into the recovery, I had to enter my encryption lock, but that didn't work. I had yet another genius idea, thinking that I probably wouldn't have to unlock the encryption, as I only wanted to disable the modem (and didn't care to backup my data). So I entered TWRP leaving the system read-only.
Then I entered the terminal and wanted to disable the relevant services, as described in the post. However, the pm command wasn't available in the TWRP shell, so I had the genius idea to just skip those steps.
I then wanted to override the radio with zeros (as described in the post). However, the exact file from the post didn't exist, so I had the genius idea to overwrite /dev/block/platform/soc.0/f9824900.sdhci/by-name/modem instead. However, I firstly wanted to back it up to my external SD (I assumed that wouldn't be affected by the encryption) and did so with dd. After also having the modem overwritten with 0s (and synced) I rebooted to system, where I got the error that "Settings," stopped working and my phone started rebooting to recovery.
I thought "oh well, I'll just restore the backup modem from the SD", however I had to realize that (probably because I hadn't mounted the SD properly) the file didn't exist on the SD (anymore).
That's the current state. As I don't really want to lose my data (that I didn't backup), I haven't tried re-flashing anything yet (especially as I don't know if this'd help).
Is there any way to recover the "modem" without losing my data? Or, even better, is there a way to continue disabling the modem, with my phone properly booting again?
I really appreciate your help - please let me know if you need further information.
EDIT: It would probably be super helpful (and enough) if someone out there with the H815 could dump the content of their modem dev and share it with me. I don't think (?) that's included in a system image - at least it isn't mounted in system.
EDIT: Let me provide some instructions on how to (presumably) safe my day, if you have an H815 with TWRP recovery and adb on your computer:
Reboot to recovery:
Bash:
adb reboot recovery
In TWRP, mount your Micro SD card or another partition you can read & write to (Mount -> Tick Micro SD card)
Restart adb:
Bash:
adb kill-server
Enter adb shell:
Code:
adb shell
In adb shell, validate that your SD (or other partition) is correctly mounted (you should get the contents of your external SD):
Bash:
ls /external_sd
In adb shell, dump data from modem and exit adb shell:
Bash:
dd if=/dev/block/platform/soc.0/f9824900.sdhci/by-name/modem of=/external_sd/modem.img
sync
exit
Pull dump from device:
Bash:
adb pull /external_sd/modem.img
Upload modem.img from your computer (from the directory you executed above command from) to some cloud
Share a link to the file with me
I'd be very grateful if someone could do this. Please feel free to ask questions about the procedure or to help me in any other way.
Turns out, someone already did upload a modem - it's even linked in the install instructions for /e/. I used this file (flashed via TWRP) and it seems to have fixed my issues.
Of course, now the modem still isn't disabled - so if someone has an idea on how to achieve this without bricking my phone (preferrably also without having to root it), feel free to make me happy.
I now have tried killing the modem with rooting my phone, but it lead to the same error. Before deleting the modem, I ran the following commands in adb shell to mimick the disabled services from the original post as best as possible:
Bash:
su -c "pm disable com.android.cellbroadcastreceiver"
su -c "pm disable com.android.mms"
su -c "pm disable com.android.phone"
su -c "pm disable com.android.providers.telephony"
su -c "pm disable com.android.smspush"
su -c "pm disable com.android.mms.service"
su -c "pm disable foundation.e.message"
su -c "pm disable com.android.server.telecom"
su -c "pm disable com.qualcomm.qcrilmsgtunnel"
su -c "pm disable foundation.e.esmssync"
Do I have to put this in a startup script? And if so, how do I do this?
It does seem as if they stayed deactivated though:
Bash:
$ su -c "pm list packages" -d
package:com.android.providers.telephony
package:com.android.mms.service
package:com.android.terminal
package:foundation.e.message
package:com.qualcomm.qcrilmsgtunnel
package:com.android.cellbroadcastreceiver
package:com.android.server.telecom
package:com.android.smspush
package:foundation.e.esmssync
package:com.android.phone
I'd love to know how I can achieve this.
EDIT: Now my phone reboots as soon as it's disconnected from my computer (and doesn't boot anymore)...

Categories

Resources