S-ON Kernel Installer v0.57 9-27-12 Now that the new hboot doesn't allow S-ON devices to flash kernels I went ahead and adapted this for the LTE. It's something I started for the Evo 3D back in January, but when a new way to get S-OFF was found I sat it aside and had forgotten about it.
When used it tries to flash the kernel like normal and doesn't do anything special if able to, otherwise it will copy a script to the system partition and install the kernel when the ROM tries to boot up. All that's needed is for a few lines to be added to the updater-script and it can do the rest.
I'll update this with more information at a later time, but for now I just want to say thank you to everyone who has helped contribute ideas and tested. As always, any help with improving it is welcomed.
How To Use It
This is mainly for ROM and kernel devs to use before releasing, but it can easily be added to any that don't normally use it. For more detailed instructions see
Page 3.
- Download and add the "kernel" folder to your update zip
- Edit your updater-script and use the following when you are ready to install the boot.img
Code:
ui_print("Installing Kernel, please wait..."); package_extract_file("boot.img", "/tmp/boot.img"); package_extract_dir("kernel", "/tmp/kernel"); set_perm_recursive(0, 2000, 0777, 0777, "/tmp/kernel"); run_program("/tmp/kernel/install_kernel.sh", "/tmp/boot.img", "/tmp/bootready.tmp");; ifelse(file_getprop("/tmp/bootready.tmp","kernel.ready") != "READY",( ifelse(file_getprop("/tmp/bootready.tmp","kernel.ready") == "STARTUP", ui_print("Kernel Will Be Installed On Startup."), ui_print("ERROR: Kernel Not Installed!") ) ));
- Sign the zip and it can then be installed like normal from any device with a custom recovery
Changes
v0.57- flashboot.sh - Fixed the case statement that verifies the kernel flashed properly
- flashboot.sh - Moved the call for DD to save the old kernel so that it always gets used
Downloads/Sources
Kernel Folder on DevHost (MD5:
27eB86aae3562e147d86b8dfe7a04786)
Google Code
Github - All files including the flashboot binary source
__________________
Last edited by xHausx; 29th September 2012 at 12:11 AM. Reason: updated
Thanks Meter
2402

Forum Moderator / Recognized Developer
|OP|
Posts: 5,476
Join Date: Jul 2010
Location: Central Florida


The Following 41 Users Say Thank You to xHausx For This Useful Post: Show/Hide
xHausx

22nd August 2012, 10:31 PM
How Can I Test It With S-OFF?
- If you comment out the dd command that writes the boot.img it will act like your device has S-ON.
Edit install_kernel.sh and change:
Code:
echo "-Trying to write the new boot.img and verify it's MD5" $BBDD if=$BOOTPADDED of=$BLOCKBOOT; sync rm -f $BOOTOLD
to:
Code:
echo "-Trying to write the new boot.img and verify it's MD5" #$BBDD if=$BOOTPADDED of=$BLOCKBOOT; sync rm -f $BOOTOLD
Where Are The Log Files?- In the recovery it uses: /tmp/recovery.log
- On boot it uses: /data/local/bootinfo.txt
What Does This Need To Work?- A custom recovery
- A valid kernel already installed with init scripts to start either /system/bin/app_process or /system/bin/netd
What Recoveries Does It work With?- Most of my testing has been done with TWRP, but it should work just as well with any other recovery
Why Did My Phone Reboot Back To The Recovery?- If it is unable to flash the kernel it will leave the old one in place and reboot back to the recovery. If you are able to, please pull the log file from /data/local/bootinfo.txt and send it to me so I can see what needs to be fixed.
What If I Get A Bootloop?- Either the kernel you flashed doesn't work with your ROM or there was an error and it's unable to reboot back to the recovery. If you hold volume down it should bring up the bootloader, from there use the volume and power buttons to select 'Recovery'.
Why Does My Phone Boot Straight To The Bootloader?- You either managed to wipe your boot partition (kernel) or sometimes this will happen when upgrading hboots. If you are S-ON you will need flash a new boot image from fastboot.