Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

S-ON Kernel Installer v0.57 9-27-12

OP xHausx

22nd August 2012, 09:36 PM   |  #1  
xHausx's Avatar
OP Forum Moderator / Recognized Developer
Flag Central Florida
Thanks Meter: 4,538
 
6,781 posts
Join Date:Joined: Jul 2010
Donate to Me
More
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.
  1. Download and add the "kernel" folder to your update zip
  2. 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!")
    )
    ));
  3. 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
The Following 54 Users Say Thank You to xHausx For This Useful Post: [ View ]
22nd August 2012, 10:31 PM   |  #2  
xHausx's Avatar
OP Forum Moderator / Recognized Developer
Flag Central Florida
Thanks Meter: 4,538
 
6,781 posts
Join Date:Joined: Jul 2010
Donate to Me
More
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 to flash a new boot image from fastboot.
Last edited by xHausx; 19th May 2013 at 04:49 AM.
The Following 18 Users Say Thank You to xHausx For This Useful Post: [ View ]
22nd August 2012, 10:37 PM   |  #3  
xHausx's Avatar
OP Forum Moderator / Recognized Developer
Flag Central Florida
Thanks Meter: 4,538
 
6,781 posts
Join Date:Joined: Jul 2010
Donate to Me
More
Reserved for later use
Last edited by xHausx; 25th August 2012 at 05:23 AM.
The Following 11 Users Say Thank You to xHausx For This Useful Post: [ View ]
23rd August 2012, 12:13 AM   |  #4  
Cuppeerr's Avatar
Senior Member
Flag Grapevine, Texas
Thanks Meter: 821
 
2,766 posts
Join Date:Joined: Mar 2010
Donate to Me
More
Cute
23rd August 2012, 12:14 AM   |  #5  
sivarticus85's Avatar
Senior Member
Flag Atlanta GA
Thanks Meter: 151
 
848 posts
Join Date:Joined: Jan 2011
More
Does this work for AOSP based kernels as well?
23rd August 2012, 12:54 AM   |  #6  
xHausx's Avatar
OP Forum Moderator / Recognized Developer
Flag Central Florida
Thanks Meter: 4,538
 
6,781 posts
Join Date:Joined: Jul 2010
Donate to Me
More
Quote:
Originally Posted by -Cupper-

Cute

Thanks Cupper

Quote:
Originally Posted by sivarticus85

Does this work for AOSP based kernels as well?

Yup, it's all the same to it. The only thing it needs to work is for some sort of kernel to already be installed.
The Following 2 Users Say Thank You to xHausx For This Useful Post: [ View ]
23rd August 2012, 01:02 AM   |  #7  
P.Mobile's Avatar
Senior Member
Flag RhOdE IsLAnD... 401
Thanks Meter: 936
 
4,341 posts
Join Date:Joined: Nov 2011
More
good stuff!!!!!!!
23rd August 2012, 01:40 AM   |  #8  
scottspa74's Avatar
Senior Member
Thanks Meter: 2,927
 
8,620 posts
Join Date:Joined: Apr 2009
More
Good stuff man. Like always, xhausx contributing genius stuff for all. Thanks. :thumbup:

Sent from my EVO using xda premium
The Following User Says Thank You to scottspa74 For This Useful Post: [ View ]
23rd August 2012, 01:52 AM   |  #9  
Blackcircle's Avatar
Senior Member
Flag No.Virginia
Thanks Meter: 95
 
414 posts
Join Date:Joined: Aug 2009
More
Awesome. Thanks.
via eVo.
23rd August 2012, 02:35 AM   |  #10  
Zarboz's Avatar
Known Scammer
Flag Denver
Thanks Meter: 9,264
 
3 posts
Join Date:Joined: Mar 2009
Donate to Me
More
implimenting in my next installer

The Following 3 Users Say Thank You to Zarboz For This Useful Post: [ View ]
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes