yashsingh1/xdaforums huggingface dataset:
[EVO 4G Android Development] riwright:
Workaround for the 'exec ... permission denied' errors

Seconded. This is exactly how I had to get past the 'exec .... permission denied' error.

HW 0003, hboot 2.02.0000, started from Sprint base ROM 3.30.651.2

Had both the Radio-V2 PU-FAIL & the Bootloader IC-FAIL during the first PCIMG36-ENG.zip flash. (I guess this is normal?) No errors during the PCIMG36-MR.zip flash.

It seems that the file renaming commands are failing. This seems to be because the system/shell [somehow] gets into a state where basic system commands like 'mv' aren't recognized. Or maybe it's that we can't even get to a shell from adb at that point. What ever the reason, the effect is that you end up in a loop where you can only flash PCIMG36-ENG.zip (since it is called PCIMG36.zip at that point due to the first 'adb push' command).

The workaround is simply to use some other means to rename the PCIMG36-XX.zip files from & to PCIMG36.zip. You can verify this by checking the size of the .zip files on the sdcard against the PCIMG36-XX.zip files in Zikronkix's original in D/L .zip.

So, as clearly outlined above.

1) Get to the red triangle (this is part of the process, you can still run adb commands here)

2) Use some other means to do the .zip file renaming on the sdcard.

3) Get back to the red triangle and carry on with the instruction steps.

Rooted and running EViO ROM. The whole process takes ~20mins. Thx Zikronkix!!!
[EVO 4G Android Development] Noobe:
Ok for the first time ever i am seeing the green text on the recovery screen where the phone and red triangle is. So what do i do from there? I dont want to leave because after two weeks of trying to get there im there lol.

Step 10 i skipped because i got an error while trying to do it.

it gave me no such file or directory. And i skipped to 11 and when i did the steps for 11 i got no errors

And i got to the recovery and i got the green letter. So i flashed the zip and then i flashed unrevoked. Now im at the bootloader and i have S-OFF and im reflashing the PC36IMG
[EVO 4G Android Development] riwright:
That error was when you tried to rename the files, right? This is the cause and the beginning of the loop you are stuck in.

Does this hboot flash look just like the last time? You need to rename (exchange) the PCIMG36.zip files in order to continue. You will have to power down your phone (take out the battery), take out the sdcard and do the file renaming by some other means.
[EVO 4G Android Development] Noobe:
So i now have S-Off on hboot 2.02

Firmware version 2.1-update1

baseband version 1.36.00.04.02

Kernel version 2.6.29-ac94cf60 htc-kernel@and 18-2#1

Build Number 1.17.651.1 CL 160858 test keys

Software 1.17.651.1

Browser Version webkit 3.1

PRI Version 1.34_003

PRL Version 60671

So im guessing im fully rooted now. Am i correct? If so how do i start installing some roms
[EVO 4G Android Development] zikronix:
added to the faq
[EVO 4G Android Development] Noobe:
Hmmm. Ok i have other means of doing that. But i have a question. Why do i have to do that if i already have S-Off and i was already rooted before?
[EVO 4G Android Development] n1ghtl1fe:
got this far

12) With any luck you should be at a recovery. Now Select flash zip and choose unrevoked-forever.zip. Wait for it to complete. Select Reboot from the menu

got an update success then i reboot and it hangs at htc evo 4g screen : /

i pulled battery and went into bootloader to try step 12a

"12A) Ok so you got kicked to the boot loader. It should scan your card and find the pc36img.zip chose yes to flash this file and when it ask you to reboot....reboot by pressing vol-up....Proceed to step 13"

it goes thru the checking of the pc36img but then it doesnt give me the option to flash it

it does say s-off at the top of the bootloader tho
[EVO 4G Android Development] J Piddy:
Ok so I run step 7 and 8 and I get this

C:\Users\Owner\Desktop\hboot202-s_off-V71>adb shell

$ chmod 0755 /data/local/tmp/rageagainstthecage

chmod 0755 /data/local/tmp/rageagainstthecage

$ chmod 0755 /data/local/flash_image

chmod 0755 /data/local/flash_image

$ ./data/local/tmp/rageagainstthecage

./data/local/tmp/rageagainstthecage

[*] CVE-2010-EASY Android local root exploit (C) 2010 by 743C

[*] checking NPROC limit ...

[+] RLIMIT_NPROC={3316, 3316}

[*] Searching for adb ...

[+] Found adb as PID 78

[*] Spawning children. Dont type anything and wait for reset!

[*]

[*] If you like what we are doing you can send us PayPal money to

[*] 7-4-3-C@web.de so we can compensate time, effort and HW costs.

[*] If you are a company and feel like you profit from our work,

[*] we also accept donations > 1000 USD!

[*]

[*] adb connection will be reset. restart adb server on desktop and re-login.

$

C:\Users\Owner\Desktop\hboot202-s_off-V71>adb shell

# ./data/local/flash_image misc /sdcard/mtd-eng.imgsync

./data/local/flash_image misc /sdcard/mtd-eng.imgsync

error opening /sdcard/mtd-eng.imgsync: No such file or directory

# ./data/local/flash_image misc /sdcard/mtd-eng.img sync

./data/local/flash_image misc /sdcard/mtd-eng.img sync

usage: ./data/local/flash_image partition file.img

# reboot bootloader

reboot bootloader

C:\Users\Owner\Desktop\hboot202-s_off-V71>

But when I run the bootloader and it runs the PC36IMG I keep getting Main version is older! It never even asks me to load image, it just tries on its own. I see that someone else had this problem but I did not see how to fix it. Any ideas?
[EVO 4G Android Development] Noobe:
I see so that means u didnt root your phone before trying to do this process. Because i no longer get the 4g animation since im rooted i get some HTC Intro
[EVO 4G Android Development] n1ghtl1fe:
it doesnt get past the boot screen just stays there i phone never makes it to a point where it should show the boot animation. i followed everything step for step and did what someone a few posts suggested with the pc36img renamings since i got no such file or directory error
[EVO 4G Android Development] runningnak3d:
Update for the other unfortunate souls out there that were getting permission denied when trying to install busybox / run recovery from adb... use another PC.

I thought I had cleaned out all of the HTC Sync drivers from the box. I had tried using Driver Cleaner, cleaning up all the files manually (the DLLs, the INF, and the CAT files). So I *thought* I had a clean machine to work from -- short of reinstalling the OS. Now, that may have been the case since I switched PCs, or it could have been the USB port, or even the USB port drivers on my desktop. Suffice it to say switching over to my laptop that was a virgin / never had attempted this, worked.

Now I did install the hboot drivers from the unrevoked site right from the get go, and since my phone is rooted now, I really don't want to do S-ON to try and see if it was the USB port or the fact that I hadn't completely cleaned the various drivers I had installed -- but I might, cause I really want to know.

However, since there are people that have tried this on Macs and on Linux, I am *fairly* certain it is safe to say that if you are getting "file not found" or "permission denied" on /system/sbin/sh when you try to do step 10 and 11 -- you have a bad USB port, or bad USB port driver.

Now to find a cool ROM to flash. Thanks so much to zirkronix, amoamare, and everyone else that helped with this.

-- Brian
[EVO 4G Android Development] Noobe:
Hmmmmmmmm this makes sense. I was getting this last night. And up to a point the phone wasnt even recognizing being plugged in because the usb debugging wasnt being recognized. But once i unplugged the phone and plugged it back in then tried the steps again. I finally was able to get to the green options in recovery for the first time in two weeks and now i have S-Off on my phone and it was rooted previously
[EVO 4G Android Development] zikronix:
ill update the first poet when i get a chance but you gonna have to rename the files manually.
[EVO 4G Android Development] Rem3Dy:
What hboot did you start with. My guess is you got lucky with one of the 0004 hardware that shipped with the previous hboot .96.0000 I think.
[EVO 4G Android Development] n1ghtl1fe:
i did rename them manually then all went well until i flashed the rom in the custom recovery and it took me to the SPRINT EVO 4G screen and stayed there. I wasnt able to do step 12A either because it just kept reading pc36img.zip but never asking to flash it. I reinstalled original RUU and my phones back to stock i will try again i guess from step one
[EVO 4G Android Development] zikronix:
Just sent u pm
[EVO 4G Android Development] denstark:
Hey Zik, there's no longer a download link in the OP! Not sure if that's on purpose.
[EVO 4G Android Development] J Piddy:
Anyone know my next step with main version is older? I posted the adb if that helps couple posts back?
[EVO 4G Android Development] denstark:
You never flashed mtd-eng.img -- sync is a totally different command and is meant to be run after flashing. so it should go:

./data/local/flash_image misc /sdcard/mtd-eng.img

sync

I believe that's why you're getting the main version problem.
[EVO 4G Android Development] zikronix:
Wtf half the post is missing. Ill fix it in a sec
[EVO 4G Android Development] wolffer691:
Ok i was going to try and download the hdboot file but it seems to be missing can someone post it and please post one that extracts i have downloaded it several times and every time i get it i get a crc error when it extracts!:p
[EVO 4G Android Development] m1gramme:
Problems with /sbin

I'm not sure if this is the complete solution but I know anyone on linux trying this when you get

C:\Users\rn_zippy\Downloads\android-sdk_r07-windows\android-sdk-windows\tools>ad

b shell busybox --install /sbin

- exec '/system/bin/sh' failed: Permission denied (13) -

the way to fix it is to run this command before you adb push recovery /

chmod -R +x recovery/ (this is done on shell on computer not phone, it changes permissions of directory)

adb reboot recovery (rebboot into recovery)

Then proceed with

adb push recovery /

adb shell busybox --install /sbin

adb shell nohup /sbin/recovery &

again I do not know about the success with Windows but it appears that this step was needed for linux.

For anyone trying on linux there is a good thread at #9302857 lithid-cm modified this thread for linux users because I and some others were having some questions. Hope this helps
[EVO 4G Android Development] mr6gryme:
Im not tripping right! is the download link missing?? i cant see it on the 1st page!!!
[EVO 4G Android Development] denstark:
It'll be back in just a minute ;)

Edit:

Saw the link, but it's a 404
[EVO 4G Android Development] zikronix:
fixed...i dont know wtf happened.
[EVO 4G Android Development] J Piddy:
Ok I got yeah. That is where I was unclear of. I thought it was just from the same command just a new line. I will try that. Thanks

That is why I love this place. It is my drug.
[EVO 4G Android Development] mr6gryme:
got it!!! thanks alot guys!! i had no idea what was going on!! I was flashing EVO's over 2 metro no problemo on 2.2 and then all of sudden Unrevoked stop working!!!!! LIFE SAVERS!!!!!!!!!!!!
[EVO 4G Android Development] denstark:
Am just working on rooting mine now, after following this thread for about a week. However, I encountered a really odd error:

# ./data/local/flash_image misc /sdcard/mtd-eng.img
./data/local/flash_image misc /sdcard/mtd-eng.img
mtd: read error at 0x00000000 (Out of memory)
mtd: read error at 0x00040000 (Out of memory)
mtd: read error at 0x00080000 (Out of memory)
mtd: read error at 0x000c0000 (Out of memory)
mtd: write error at 0x00000000 (Out of memory)
mtd: re-read error at 0x00000000 (Out of memory)
mtd: write error at 0x00000000 (Out of memory)
mtd: re-read error at 0x00000000 (Out of memory)
mtd: skipping write block at 0x00000000
mtd: write error at 0x00040000 (Out of memory)
mtd: re-read error at 0x00040000 (Out of memory)
mtd: write error at 0x00040000 (Out of memory)
mtd: re-read error at 0x00040000 (Out of memory)
mtd: skipping write block at 0x00040000
mtd: write error at 0x00080000 (Out of memory)
mtd: re-read error at 0x00080000 (Out of memory)
mtd: write error at 0x00080000 (Out of memory)
mtd: re-read error at 0x00080000 (Out of memory)
mtd: skipping write block at 0x00080000
mtd: write error at 0x000c0000 (Out of memory)
mtd: re-read error at 0x000c0000 (Out of memory)
mtd: write error at 0x000c0000 (Out of memory)
mtd: re-read error at 0x000c0000 (Out of memory)
mtd: skipping write block at 0x000c0000
error writing misc: No space left on device
#

Haven't seen that before, so I wanted to know if anyone else got this or if it's not normal.
[EVO 4G Android Development] Testrunner:
Brick

Well, not a brick but I am stuck. I cant see the download link for the recovery file:

1) Download File above PC36IMG_Recovery.zip and Rename to PC36IMG.zip.

copy to the root of your SDCard and power off phone

Is this a separate download and is it missing? I could really use some help.

thanks!
[EVO 4G Android Development] J Piddy:
Ok another quick question. I had to manually rename the files in step 10 so do I need to do the same for step 13 or should it rename with adb this time?

edit: Ok never mind I am good to go. I just downloaded androzip and renamed it. Going to flash Myn rom now.
[EVO 4G Android Development] n1ghtl1fe:
still cant seem to get it after trying about 4 times. not sure what the deal is if anyone wants to chat that can help or maybe ill make a video of exactly what im doing and whats going on see if that helps : /
[EVO 4G Android Development] poppyseth:
after step 10 I got a different HTC boot screen and then I booted into the ROM... I never got the red triangle... what should I do next? Just proceed?
[EVO 4G Android Development] runningnak3d:
4G / WIFI

Just a heads up to anyone that doesn't have 4G or Wifi when they have completed this, flash another ROM (or flash another kernel) :)

Apparently the PC36IMG-MR.zip ROM that is now included in this root method has a kernel that doesn't work with rev 0003.2 wifi / 4g radios. I flashed Myn's Warm and had working 4G / wifi again. Finding the proper ROM / kernel combo is outside the scope of what this thread is about, but I just wanted to point out you could use that ROM as a "test" ROM.

Also, and I hope that this will be added to the procedure -- the MINUTE you can boot into amon_ra recovery BEFORE flashing unrevoked-forever.zip, do a nandroid backup. I would go so far as to then power down the phone, remove the SD card, copy that backup to your PC. If you lose your wimax partition, your RSA keys are GONE. The nandroid restore will be the ONLY way to get them back.

-- Brian

EDIT: I mistakenly listed Amon_ra as the person who built PC36IMG-MR.zip. I was under the impression that he built it when he made the new recovery to fix the phones that were only seeing half the space on their partitions. I appologize to both Amon and zikronix.
[EVO 4G Android Development] runningnak3d:
You either didn't type reboot bootloader, or after flashing you told the phone to reboot. Either way, you need to power off the phone, and hold down the vol-down + power to get back into the bootloader and choose recovery. Make sure you don't have a PC36IMG.zip on your SD card or it will flash it again. Once at recovery, just continue on from where you left off...

-- Brian
[EVO 4G Android Development] runningnak3d:
You have actual bad blocks -- return your phone.

-- Brian
[EVO 4G Android Development] denstark:
I had figured it out -- what a mess it was! I accidentally ran rageagainstthecage too many times and it had put my phone into a crawl (which was my fault, I shouldn't have ran it so many times... was being impatient, as I thought it hadn't taken when it didn't boot me out right away) so I tried to reboot it. I thought I had, so I re-pushed the flash_image and img-mtd files, and tried to flash and got those errors. I gave the phone an actual reboot from adb (adb reboot) and started over. All went well! I had to manually rename the files (Thank you so so much, HTC Hero, for being my sd card reader) and it worked perfectly! I'm now in a custom rom and loving it! :D

So THANK YOU everyone, zikronix, and anyone else who helped. Thank you thank you thank you!
[EVO 4G Android Development] poppyseth:
Finally got the red triangle... got the "no such file" error, pulled the SD and renamed the files, inserted it back in, got the red triangle again, and still am getting the "no such file"... any ideas??
[EVO 4G Android Development] denstark:
If you've renamed the files manually, then you no longer have to run the adb commands. Start at step 11:

adb push recovery /
adb shell busybox --install /sbin
adb shell nohup /sbin/recovery &
[EVO 4G Android Development] n1ghtl1fe:
when you type the second adb busybox command r u supposed to see anything happen because it just takes me to the next line without an message at all
[EVO 4G Android Development] denstark:
Nope -- it won't say a thing.
[EVO 4G Android Development] n1ghtl1fe:
thanks im making attempt 5 well see what happens. fresh RUU install restart and wiped then fresh dl and extract of hboot202-s_off files slow and steady lets see whats good. (ive never had problems with the 4 g1's i rooted and the first root steps for when the g1 first came out were harder lol, also rooted two mytouch slides no problem)
[EVO 4G Android Development] strauss0829:
Zikronix. I got phone rooted but 4g don't work any ideas I am rooted with clockwork and custom rom
[EVO 4G Android Development] strauss0829:
Ok Zikronix I flashed ra 1.8 how do I fix 4g
[EVO 4G Android Development] zikronix:
THAT IS IN CORRECT.

THE ROM THAT I MADE THE PC36IMG-MR file has the latest kernerl and it may not work with your phone...

it has NOTHING to do with his recovery
[EVO 4G Android Development] poppyseth:
Thanks a bunch guys... My last post was "premature" and I was following the guide a little too closely. Anyways it was a success, even survived a power outage and almost **** myself. I am currently booting Calkulin's ROM and all is good...

In regards to the drivers, I used the unrevoked drivers after uninstalling HTC Sync from my previous Hero root (for anyone who was wondering)

Thanks to everyone who put work into this... it is much appreciated.

Zikronix... I just bought you a couple beers... thanks
[EVO 4G Android Development] n1ghtl1fe:
after this step "12) With any luck you should be at a recovery. Now Select flash zip and choose unrevoked-forever.zip. Wait for it to complete. Select Reboot from the menu" how long can it take to boot?
[EVO 4G Android Development] runningnak3d:
I apologize, I thought that he made the whole ROM -- didn't realize that you made it and only included his recovery.

I will edit my post accordingly -- but the fact still stands that the kernel included in PC36IMG-MR.zip doesn't work with the 4G / wifi radio in rev 0003.2.

Something some people may not be aware of, but there are several revs of 0003 (well at least 2), the original 0003 and 0003.2.

Again I apologize, especially to Amon for the misunderstanding on who built the ROM.

-- Brian
[EVO 4G Android Development] zikronix:
hope that your rsa keys are not tossed....which could have been caused by clockwork...because the partition information is not correct.

if you had backed up your phone with amon ra before then you may be lucky

you can do this from adb shell in side the rom

cat /dev/mtd/mtd0 | grep RSA

returned output show appear as this:

# cat /dev/mtd/mtd0 | busybox grep RSA

cat mtd0 | busybox grep RSA

RSA-REQUEST

RSA-REPLY

RSA-REJECT

RSA-ACK

RSA-1024

RSA-REQUEST

RSA-REPLY

RSA-REJECT

RSA-ACK

RSA-1024

RSA

ReRSA

RSA requests

RSA replies

-----BEGIN RSA PRIVATE KEY-----

-----END RSA PRIVATE KEY-----

#

the important lines are BEGIN RSA PRIVATE KEY and END RSA PRIVATE KEY.

If you have those two lines, your keys are still likely to be intact.

If those two lines are missing, your keys are likely missing.

/dev/mtd/mtd0 is where the wimax image is stored.
[EVO 4G Android Development] zikronix:
that may be...correct becuase i did use the kernel out of the new ota and i know it didnt get pushed to everyone. i may change that file tonight i gotta tweak the guide some any way.
[EVO 4G Android Development] strauss0829:
Ok but if they are missing how do u get them back???
[EVO 4G Android Development] zikronix:
you cant!

if there missing return your phone unrooted of course.
[EVO 4G Android Development] denstark:
Keep in mind you're just looking for those two lines -- there won't be anything in between them
[EVO 4G Android Development] strauss0829:
Could it be the Rom I'm using just doesn't switch to 4g when I hit it
[EVO 4G Android Development] strauss0829:
Or if it isn't the Rom could u flash back to stock then reroot
[EVO 4G Android Development] zikronix:
yea thanks for clarifying that
[EVO 4G Android Development] strauss0829:
?????????????
[EVO 4G Android Development] zikronix:
possibley depending on kernel etc radio.

if its just turning on and off you could try the tree.xml fix....flashing back to stock and rerooting will not restore your rsa keys....once they are gone they are gone.
[EVO 4G Android Development] strauss0829:
Well when I hit 4g it just keeps scanning
[EVO 4G Android Development] n1ghtl1fe:
good ****

hell yea after several attempts i got it too work the renaming thing being my biggest issue.

FOR PEOPLE HAVING TROUBLE GETTING THIS TO WORK:

-first off i got my phone last night around 8:30 brand new so it works on newest evos

-i couldnt figure it out a few times trying so i wiped, reformatted sd card (added ext3 parition), and deleted all files that have to do with the .zip on this page.

-redownload everything and re extract

-have a few beers (helped me ;) )

- read the **** i went thru a lot of this thread

-if u get file or directory not found USE the renaming trick in the first question in the FAQ

-keep trying it works just minor details, attempt i got it to work i turned off 4g and wifi before hand that could have helped.

thanks for this root GL everyone else
[EVO 4G Android Development] zikronix:
did you try the tree.xml trick in the faq or grep for the rsa keys
[EVO 4G Android Development] zikronix:
ok guys those that have been successful....any major things i need to change in the guide
[EVO 4G Android Development] denstark:
May want to also specify that Fail-PU may happen when flashing the first rom, and that if that happens you will most likely have to do the rename trick with an SD card reader (or another phone that can read SD cards!). Other than that, it looks good to me.

Also, I sent you a PM, did you get it?
[EVO 4G Android Development] strauss0829:
Not yet I will when I get home... how do I do that EXACTLY
[EVO 4G Android Development] zikronix:
check the faq
[EVO 4G Android Development] zikronix:
its listed in step 9....not quite liek that....but yea its there.

yea i got the pm. just been busy atm

ok so i updated the instructions and added some stuff to the faq.
[EVO 4G Android Development] strauss0829:
ok Zikronix heres what it said when i ran it

Microsoft Windows [Version 6.1.7600]

Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\Dan>cd\SDK\android-sdk-windows\tools

C:\SDK\android-sdk-windows\tools>adb devices

* daemon not running. starting it now on port 5037 *

* daemon started successfully *

List of devices attached

HT0ATHL06631 device

C:\SDK\android-sdk-windows\tools>adb shell

# cat /dev/mtd/mtd0 | grep RSA

cat /dev/mtd/mtd0 | grep RSA

RSA-REQUEST

RSA-REPLY

RSA-REJECT

RSA-ACK

RSA-1024

RSA-REQUEST

RSA-REPLY

RSA-REJECT

RSA-ACK

RSA-1024

RSA

ReRSA

RSA requests

RSA replies

-----BEGIN RSA PRIVATE KEY-----

-----END RSA PRIVATE KEY-----
[EVO 4G Android Development] strauss0829:
So does that mean my files are in tact and its the rom because after I checked what you told me too I tried 4g again and it just says scanning
[EVO 4G Android Development] runningnak3d:
You need to do the XML fix -- it is in the FAQ...

-- Brian
[EVO 4G Android Development] strauss0829:
Soory ok but where is that can u just tell me how to do it ???