A good number of us have done whitslack's update process to achieve a rooted 1.47.651.1 rev (the latest OTA with radio and wimax radio) install. His process worked great and left me with everything running properly and I thank him for the hard work he put into making this possible for me and so many others!!!
However, and to his credit, he left the entire system in it's default state. This means that certain commands that did work under under other rooted stock roms like those released by flipzmode don't work once whitslack's process is completed. They include:
adb remount - post whitslack results in permission denied instead of a writable system partition.
adb shell - post whitslack results in a non root $ prompt instead of going directly to the root # prompt. you must manually enter su to get to the # prompt once you adb shell into the phone.
In order to restore these functions a minor change was needed to the kernel's ram disk image to allow these functions to work as they do for other rooted ROMs. To that end, I made the necessary change and repackaged the kernel into a flashable zip file format. I've been running it for several days now with no problem at all.
Included here are both the stock, unmodified, ramdisk & kernel (stock-kernel.zip) and the 1.47 kernel with the default.prop file modified to allow those functions (
default-prop-mod-kernel.zip). Just in case you want to flop back and forth for some reason.
Do a nandroid backup before applying the zip file so you can revert easily and quickly if you need to...
The packages are signed so any recovery should be able to flash them without issue. Just place the .zip file in the root of your sd card, reboot the phone into recovery and flash the kernel.
So, if your going to continue to run the stock rooted rom and would like these commands to work this should do the trick for you.
Thanks and credit go to
ffolks who's install script I borrowed from his Higher Framerate on Novatek Panels kernel to package this with.
And to
dsixda who's Android Basic Kitchen, v0.61 was used to unpack and repack the boot.img file.
Hope you find it usefull.
Thanks very nice and handy to have I am not using the most recent radio because my area doesn't like it as much and i get better 4g reception without it for some weird reason but will defiantly keep this handy just incase I need a replacement evo or something my i/o evo is already rooted right
If you are like me and you like your stock Desire rom, you rooted it using unrEVOked or some other methods, you made some custom adjustment to it and you really don't want to load a fully fledged 3rd party rom but still, you'd like to tweak it a little bit more, you'll quickly realize that you are going to need a working init.d system in order to start custom scripts on boot.
This thread will try to explain how to add init.d support to your rom, without needing to flash a new rom and wipe everything, we're just going to flash a new boot.img.
Requirements
Rooted HTC Desire
New modified boot.img, supported firmware versions: 2.10.405.2, 2.29.405.2/5, check your firmware version here: (Settings -> About Phone -> Software information -> Software number)
Download this one: View attachment boot_2.10.405.2.zip if your "Software number" is: 2.10.405.2
Download this one: View attachment boot_2.29.405.2_5.zip if your "Software number" is: 2.29.405.2 or 2.29.405.5
Make sure you download the one matching your "Software number", the wrong one will cause boot loops and weird behaviors.
ADB shell access
flash_image binary, usually provided by unrEVOked under /data/local/flash_image but if you don't have grab it here: View attachment flash_image.zip
busybox correctly installed under /system/xbin
HOW-TO
NOTE: if your Desire is not S-OFF (meaning you can't write to the /system directory), you'll need to do the whole procedure in recovery mode.
Do a nandroid backup, this in order to save your current boot.img, and also because it's never a bad idea
Make sure the nandroid backup went ok
Check your exact firmware version (Settings -> About Phone -> Software information -> Software number) and download the corresponding modified boot.img
Copy and unzip the downloaded boot.img to your sdcard or wherever you like it
Obtain adb shell access, become root (su) and wipe the existing boot image with:
Code:
cat /dev/zero > /dev/mtd/mtd2
ignore the "write: No space left on device", it's normal.
Flash the new boot image:
Code:
flash_image boot /sdcard/boot.img
where "/sdcard/boot.img" is the path where you copied the downloaded boot.img
Remount the /system partition read-write if you're not in recovery mode:
Code:
mount -o remount,rw /system
or mount it if you are in recovery mode:
Code:
mount /system
Create the init.d directory where all the custom boot scripts will be executed:
Code:
mkdir /system/etc/init.d
and set permissions:
Code:
chmod 755 /system/etc/init.d
Important: unzip and copy the View attachment 99complete.zip script to the newly created /system/etc/init.d/99complete, set permissions:
Code:
chmod 755 /system/etc/init.d/99complete
and ownership:
Code:
chown root.shell /system/etc/init.d/99complete
Failure to do so will cause a boot loops.
Cross your fingers and reboot! If anything goes wrong you can always boot into recovery and fix errors or you can restore the nandroid backup (you can just restore the boot.img if you don't want to do a full restore).
From now on, every script you put inside /system/etc/init.d will be executed at boot before almost any other initializations. Make sure you set the correct permissions to your scripts (i.e. 755).
Thanks to: teppic74 for providing stock roms with init.d support (thread) where I extracted the boot images.
Technical explanation
The provided boot.img are the original HTC provided boot.img with the init.rc script modified to stop the init process until the cm.filesystem.ready property is set to 1:
Code:
start sysinit
on property:cm.filesystem.ready=1
class_start default
where the sysinit service is the service in charge of starting all the scripts inside /etc/init.d:
Code:
# Execute files in /etc/init.d before booting
service sysinit /system/bin/logwrapper /system/xbin/busybox run-parts /system/etc/init.d
disabled
oneshot
and the last of this script, 99completed, only sets that property to 1 so the normal system boot can continue:
Code:
#!/system/bin/sh
sync;
setprop cm.filesystem.ready 1;
of course changing init.rc is only possible by flashing a new boot.img with init.rc modified inside the ramdisk because that file, even if you can see it under / will be overwritten at every boot.
Another small modification of the new boot.img is the default.prop, in which rc.secure is set to 0 allowing to gain direct access through "adb shell"
Sounds great
Thx for your work!
So if I get that right, it's the same as if we'd flash teppic74 ROM, and nandrestoring everything except system & boot?
Just our stock ROM with init.d support?
Does that also mean we could flash the optional mods from teppic74 thread like a2sd?
Ty again!
Puenos said:
Sounds great
Does that also mean we could flash the optional mods from teppic74 thread like a2sd?
Ty again!
Click to expand...
Click to collapse
Well you could but effectively all you need is an apps2sd+ script and you can adb push it to the correct location. /system/etc/init.d
Really? I would have tried flashing either a2sd provided in teppic74's thread or even a2sd script by DT? last I would have compared to firerat's script. But if all you need to do is pushing via adb.. Is there a script out for a2sd especially for stock/sense? (like kali advised using firerat with CM?)
Thank you
Not sure to be honest, I haven't used sense for a long time. But assume if the one teppic uses on his, works - it should work for you too.
I'm just using Sense because of it's Mail-widget, haha
But I guess I'll just give it a try then, will report back, when I've managed so set everything up without having my phone exploding, hehe
But thank you very much
exactly this boot.img will just enable init.d support, no need to flash a new system.img but you just need to create the init.d directory and put the 99complete script, after that you can install any mod you like, also the ones provided in teppic74's thread.
You can also try data2whatever by melethron (that's what I'm using), just make sure you have busybox correctly installed.
hope you enjoy it and happy new year!
well I hv software number 2.11.832.3 so what I hv to do...?
r3vb07inf said:
well I hv software number 2.11.832.3 so what I hv to do...?
Click to expand...
Click to collapse
unfortunately I don't have a boot.img for that software number, you'll need to manually extract your boot.img, modify a file (init.rc) and reflash it, if you don't know how to do it I can try to do it for you but I'll need a download link for your original firmware version
You could make a universal (froyo) update zip using Koush's AnyKernel installer, then you're able to update the ramdisk only and add the init.d folder/script. Thats how i did it for CM7.
worstenbrood said:
You could make a universal (froyo) update zip using Koush's AnyKernel installer, then you're able to update the ramdisk only and add the init.d folder/script. Thats how i did it for CM7.
Click to expand...
Click to collapse
interesting, an update script that can extract the boot.img, unpack, change files, repack it and reflash it...is it safe? I may think about building an update.zip this way but I'm pretty scared by how safe it can be to automatically mess with a boot.img..
EDIT: one problem of this is that the init.rc needs to be extracted and modified, but it may be different from one firmware and another
moebius83 said:
interesting, an update script that can extract the boot.img, unpack, change files, repack it and reflash it...is it safe? I may think about building an update.zip this way but I'm pretty scared by how safe it can be to automatically mess with a boot.img..
EDIT: one problem of this is that the init.rc needs to be extracted and modified, but it may be different from one firmware and another
Click to expand...
Click to collapse
Should be the same between all froyo rom's. Check this update zip, it's for gingerbread tho, you have to replace the ramdisk-new.gz with a froyo one (with edited init.rc offcourse). It also contains /system/etc/init.d/99complete.
Edit: Don't be scared, everyone who releases custom kernels uses this method. The other way around then, keep the original ramdisk and merge it with the new kernel.
Hello there
Really appreciate all your efforts
Kindaa feeling real dumb in comparison! lol
Anyways
My Desire specs :
2.2
2.32.415.3
Baseband 32.49.00.32U_5.11.05.27
Now this has built in arabic enabled support and that is the main reason I would like to keep it
Am yet to run into a custom ROM that would provide that without having to downgrade my version
Also, had a lotta fun trying to root, just couldn't root, up untill a few days back when unrevoked came out with thier new 3.3 version
I noticed you had only two software versions from which to start...
So what about my case? could you please help this newbie along?!!
docnasef said:
Hello there
Really appreciate all your efforts
Kindaa feeling real dumb in comparison! lol
Anyways
My Desire specs :
2.2
2.32.415.3
Baseband 32.49.00.32U_5.11.05.27
Now this has built in arabic enabled support and that is the main reason I would like to keep it
Am yet to run into a custom ROM that would provide that without having to downgrade my version
Also, had a lotta fun trying to root, just couldn't root, up untill a few days back when unrevoked came out with thier new 3.3 version
I noticed you had only two software versions from which to start...
So what about my case? could you please help this newbie along?!!
Click to expand...
Click to collapse
Same thing happens to me. My spec:
2.2
2.13.707.1
32.44.00.32U
Can you help as well? Or where or how (from RUU) can I find the ramdisk-new.gz as worstenbrood's mention.
mumu_li said:
Same thing happens to me. My spec:
2.2
2.13.707.1
32.44.00.32U
Can you help as well? Or where or how (from RUU) can I find the ramdisk-new.gz as worstenbrood's mention.
Click to expand...
Click to collapse
Thanks "worstenbrood" then I can extract boot.img from stock rom. Based on the guide, I made a new boot.img. But with this new boot.img, the phone hangs at the first screen(waiting at least for 15 mins). I don't know why. I also did as worstenbrood suggest and the system boot loopless.
Can somebody help?
I attached my boot.img (original and modified) for your information.
mumu_li said:
Thanks "worstenbrood" then I can extract boot.img from stock rom. Based on the guide, I made a new boot.img. But with this new boot.img, the phone hangs at the first screen(waiting at least for 15 mins). I don't know why. I also did as worstenbrood suggest and the system boot loopless.
Can somebody help?
I attached my boot.img (original and modified) for your information.
Click to expand...
Click to collapse
did you create the /system/etc/init.d directory and the 99complete file with the correct permissions? as noted on the OP this is needed because that file will tell the boot process to continue, otherwise you'll be stuck at the boot screen
EDIT: also, do you have busybox installed under /system/xbin?
docnasef said:
Hello there
Really appreciate all your efforts
Kindaa feeling real dumb in comparison! lol
Anyways
My Desire specs :
2.2
2.32.415.3
Baseband 32.49.00.32U_5.11.05.27
Now this has built in arabic enabled support and that is the main reason I would like to keep it
Am yet to run into a custom ROM that would provide that without having to downgrade my version
Also, had a lotta fun trying to root, just couldn't root, up untill a few days back when unrevoked came out with thier new 3.3 version
I noticed you had only two software versions from which to start...
So what about my case? could you please help this newbie along?!!
Click to expand...
Click to collapse
@ moebius83
If you could help, I would really appreciate it...
Please take into consideration That I am more or less android dumb!
I attached the url for my original RUU if that helps?
http://www.mediafire.com/?ih3lbbm7yfag7d2
Would REALLY appreciate your help.
Thanks m8!
mumu_li said:
Thanks "worstenbrood" then I can extract boot.img from stock rom. Based on the guide, I made a new boot.img. But with this new boot.img, the phone hangs at the first screen(waiting at least for 15 mins). I don't know why. I also did as worstenbrood suggest and the system boot loopless.
Can somebody help?
I attached my boot.img (original and modified) for your information.
Click to expand...
Click to collapse
i created a update.zip which replaces the ramdisk only and add /system/etc/init.d/99complete. It should work for every froyo release.
worstenbrood said:
i created a update.zip which replaces the ramdisk only and add /system/etc/init.d/99complete. It should work for every froyo release.
Click to expand...
Click to collapse
great job, I was just going to make the same update.zip, you were faster, I'll link it on the OP, thanks again!
DO NOT FLASH ANYTHING FOUND HERE YET!!!
FOR DEVELOPMENT AND SHARING PURPOSES ONLY
if you flash anything before we say it's ok to, we take no resopnsibility...
the purpose of this thread is to get all of the devs together and working on this. this is a great method of getting us a fully functional recovery without needing the bootloader unlocked. this will work on a number of motorola devices as well.
Preface
ok, the bootstrap recovery works, however, without being able to boot directly into the recovery from a power up state, it makes actual "recovery" difficult. the bootstrap recovery is great, and nitro did an awesome job with it as well as adapting it to the atrix 2 with ninja-like quickness. but i would like to build onto his awesome work and expand it's functionality.
the purpose of ARecovery is to provide a fully functional recovery that you can boot directly into, like you can with any clockworkmod recovery device that has a locked bootloader.
there has been a couple different ways this has been achieved on other devices, some will actually use an sdcard as a recovery partition, others have used a hijacked boot file to launch recovery. the hijacked boot file worked great on the xperia line of phones, so this is the method i am using.
i have had some help from doomlord putting this together, and he is one of the top xperia devs. he has given me some guidance on how the hijack boot could work on the atrix 2 and i am in the process of putting this together. so whatever comes of this project, we owe it all to doomlord
The Plan
what i plan to do, is actually use nitro's bootstrap recovery to initially flash the ARecovery package, this will move the files i plan on using for the hijack boot.
The files that will initially be flashed will be the hijacked boot file, the redirected file and the arecovery package.
the hijacked boot file is emc_mgt_tool, this file is called early on in the boot sequence in init.mapphone_utms.rc. this file will be replaced with this code (which is a work in progress and i will update this script as i work on it):
Code:
#!/system/bin/sh
cat /dev/input/event3 > /dev/keycheck&
sleep 3
kill -9 $!
if [ -s /dev/keycheck ]
then
# remount rootfs rw
mount -o remount,rw rootfs /
# Umount MTDs
umount -l /cache
umount -l /data
# Mount recovery partition
cd /
rm -r etc
# stock files will need to be added to arecovery.tar
rm -r /sbin
# stock files will need to be added to arecovery.tar
tar -xf /system/xbin/arecovery.tar
# Umount /system
umount -l /system
# chroot
chroot / /init
fi
# Continue normal booting
/system/bin/enc_mgt_tool2
exit
this script at boot will be activated with a hardware keypress, if triggered, the ARecovery process will start. if not triggered, boot will continue by being passed to the redirected file.
Progress
Pretty much where i am at right now, is still pretty much the beginning. stock system files need to be added to the arecovery.tar and the hijack script needs work. i will continue working on this until an sbf is found. when the sbf is found, i will start testing this.
doomlord has pretty much said that when we get an sbf, let him know and he'll help put this together.
and again, this will work on a number of motorola devices, so the more devs in on this, the better.
i attached arecovery_flash.zip. this is the initial flash package that contains the ARecovery stuff.
DO NOT FLASH THIS!!!
do not flash
version .01 download
Change Log:
11-16-2011
The start
11-16-2011 version .01
added stock sbin and etc to recovery.tar
added redirect file
Take a look at this a see what you think?
http://hash-of-codes.blogspot.com/p/how-to-safestrap.html
JRW 28 said:
Take a look at this a see what you think?
http://hash-of-codes.blogspot.com/p/how-to-safestrap.html
Click to expand...
Click to collapse
even this would need to be built basically the same way as we are doing here
Just making the announcement that it's available here, links are below.
The link is in the developers reference stickied here, and boot shares a post with hboot, which is where you will find the known information about this.
We now have an insecure boot image for 1.55.531.3.
Blue6IX said:
I took nlarge's copy of the boot.img and made a new insecure boot image for the 1.55.531.3 people. You can now enjoy adb remount access.
I posted it and much more then just this in the doubleshot developers reference under boot, hboot (stickied in the dev section)
Developers - feel free to use as needed.
Here is the part about the insecure boot image for 1.55.531.3 users:
(must have root to use this)
I made a new insecure boot image for the 1.55.531.3 update, since the old one will cause boot loops with 1.55.531.3:
doubleshot_1-55-531-3_update_insecure_boot.img
download link
MD5: 3e07acc5debd7f9f469d31486aa7c87d
(special thanks to yogi2010, etn40ff and jkilo on getting this new insecure boot image put together, and nlarge for providing the image to work from.)
To install for end users: ( with root...)
[1] - download to sdcard
[2] - rename to boot.img
[3] - open terminal emulator and type:
Code:
su
...grant superuser to the terminal and then type:
Code:
dd if=/sdcard/boot.img of=/dev/block/mmcblk0p20
...and then reboot the doubleshot. You will now have 'adb remount' access.
We changed from this:
Code:
ro.secure=1
ro.allow.mock.location=0
ro.debuggable=0
persist.service.adb.enable=0
...to this:
Code:
ro.secure=0
ro.allow.mock.location=0
ro.debuggable=1
persist.service.adb.enable=1
Thanks for posting the boot.img from a device that came with the 1.55.531.3 update.
The insecure boot.img from before the 1.55.531.3 update caused bootloops on the new update, so an updated insecure boot.img was needed going forward.
I am concentrating all of the information like this into the developers reference, and creating anything we are missing along the way. Over the next few weeks i'll be flushing it out with all the info i've learned about our beloved doubleshot, so stay tuned.
Click to expand...
Click to collapse
I expect this to fall back and get buried like the insecure boot image Paul (from MoDaCo) posted for us back in the beginning, but it needs to be in the dev section.
Thanks!
FYI- flashed and running smooth
rooted 1.55.531.3 with clockwork recovery and SU
Could I simply place replace the boot.img in a ROM zip with this one? Or is the Terminal Emulator way safer?
I would term emulator it to be safe. In theory replacing should work though... Make a nandroid and try it
rooted 1.55.531.3 with clockwork recovery and SU
Does this kill s-off?
Delivered via candygram for Mr. Mongo.
Sinfamy said:
Could I simply place replace the boot.img in a ROM zip with this one? Or is the Terminal Emulator way safer?
Click to expand...
Click to collapse
Terminal is probably safer - but - it should be okay to replace in a ROM. I know Daniel is updating/has updated his 1.55.531.3 ROM with it.
It's not signed, trying to dd a signed image to a partition may not be the best, so you can put this in a PG59IMG.zip as well. The files like this that make up PG59IMG.zip files ARE signed, so just taking one out and flashing it to a partition would be not wise.
The extracted partition nlarge gave me to work with for the 1.55.531.3 version I made (the one here) was 16 megs to start with (the whole partition) but the actual, needed info only comes to a little under 3 and a half megs.
blackknightavalon said:
Does this kill s-off?
Delivered via candygram for Mr. Mongo.
Click to expand...
Click to collapse
Nope, nothing to do with S-OFF or ON - but it does give adb remount access if you are able to gain root and flash it.
This is only for people on 1.55.531.3 software - if you are on anything older (retail launch or first HTC update) then you should go to the developers reference i linked to in the first post and pick up the insecure boot image I made for that software instead.
Problem was the old boot image causes boot loops on the new update, so we needed an updated one from the new software.
Hope that helps clear things up, I won't get a chance to swing by again until tomorrow.