Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,738,867 Members 41,829 Now Online
XDA Developers Android and Mobile Development Forum

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

Tip us?
 
xHausx
Old
(Last edited by xHausx; 28th September 2012 at 11:11 PM.) Reason: updated
#1  
xHausx's Avatar
Forum Moderator / Recognized Developer - OP
Thanks Meter 4509
Posts: 6,766
Join Date: Jul 2010
Location: Central Florida

 
DONATE TO ME
Default 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.
  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:
    Select 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
The Following 54 Users Say Thank You to xHausx For This Useful Post: [ Click to Expand ]
 
xHausx
Old
(Last edited by xHausx; 19th May 2013 at 03:49 AM.)
#2  
xHausx's Avatar
Forum Moderator / Recognized Developer - OP
Thanks Meter 4509
Posts: 6,766
Join Date: Jul 2010
Location: Central Florida

 
DONATE TO ME
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:
    Select 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:
    Select 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.
The Following 18 Users Say Thank You to xHausx For This Useful Post: [ Click to Expand ]
 
xHausx
Old
(Last edited by xHausx; 25th August 2012 at 04:23 AM.)
#3  
xHausx's Avatar
Forum Moderator / Recognized Developer - OP
Thanks Meter 4509
Posts: 6,766
Join Date: Jul 2010
Location: Central Florida

 
DONATE TO ME
Reserved for later use
The Following 11 Users Say Thank You to xHausx For This Useful Post: [ Click to Expand ]
 
Cuppeerr
Old
#4  
Cuppeerr's Avatar
Senior Member
Thanks Meter 816
Posts: 2,751
Join Date: Mar 2010
Location: Grapevine, Texas

 
DONATE TO ME
Cute
Personal Phone: Htc One M8
Rom: Viper Rom

Business Phone: iPhone 5s
__________________
Get a Dropbox with 2.0GB of storage free, and both of us will get extra 500mb of free space!
__________________
Instagram
Twitter
__________________
Please Check Out My New Website!!!
http://www.iPhonesRx.com
__________________
If I helped you then hit the thanks button. Please and thanks
__________________
And yes, i'm a bish. Thanks deck.
 
sivarticus85
Old
#5  
sivarticus85's Avatar
Senior Member
Thanks Meter 136
Posts: 798
Join Date: Jan 2011
Location: Atlanta GA
Does this work for AOSP based kernels as well?
 
xHausx
Old
#6  
xHausx's Avatar
Forum Moderator / Recognized Developer - OP
Thanks Meter 4509
Posts: 6,766
Join Date: Jul 2010
Location: Central Florida

 
DONATE TO ME
Quote:
Originally Posted by -Cupper- View Post
Cute
Thanks Cupper

Quote:
Originally Posted by sivarticus85 View Post
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: [ Click to Expand ]
 
P.Mobile
Old
#7  
P.Mobile's Avatar
Senior Member
Thanks Meter 935
Posts: 4,336
Join Date: Nov 2011
Location: RhOdE IsLAnD... 401
good stuff!!!!!!!
 
scottspa74
Old
#8  
scottspa74's Avatar
Senior Member
Thanks Meter 2778
Posts: 8,369
Join Date: Apr 2009
Good stuff man. Like always, xhausx contributing genius stuff for all. Thanks. :thumbup:

Sent from my EVO using xda premium
Evo LTE=$XXX.XX ~ XDADevs = PRICELESS
------
Evo LTE. AKA "the beast" . Thanks regaw_lienad, you're a genius.
ROM: AOKP
Kernel: komodo v7
Hboot: lazy panda S-off 1.12.222

Evo 4G HW002
Rom: Deck GB
Kernel: SZ 0.savaged zen21
Recovery: AmonRa 1.80

- thanks whitslack & fastRX8 & Netarchy & Toast, of course. - my Evo: the house that toast built (& many other XDAers)- thank you all
The Following User Says Thank You to scottspa74 For This Useful Post: [ Click to Expand ]
 
Blackcircle
Old
#9  
Blackcircle's Avatar
Senior Member
Thanks Meter 77
Posts: 390
Join Date: Aug 2009
Location: No.Virginia
Awesome. Thanks.
via eVo.
ROM: NFSFAN 6.5 V1 Final---HTC Touch
ROM: EnergyROM 23559 April 18th, 2010 Co0kie 1.7.1 Sense 2.5---HTC Touch Pro 2

HTC Evo 4G-MikG 2.2
HTC Evo 4G-Synergy
HTC Evo 3D-Virus Eternity
HTC Evo 4G LTE
 
Zarboz
Old
#10  
Zarboz's Avatar
Known Scammer
Thanks Meter 9256
Posts: 0
Join Date: Mar 2009
Location: Denver

 
DONATE TO ME
implimenting in my next installer
 
Building a better droid is the purpose of today Android History
G1->mytouch 3g -> Mytouch slide -> Mytouch 4g -> HD2 magldr -> Thunderbolt -> Evo 3D -> Sensation -> Evo 4g -> Evo 3D -> HTC vivid -> One X -> One S -> ( Evo LTE (thanks xda) -> Droid DNA
I stay HTC.
Checkout my new project at EasyDevStudio
[showp1984] Times of day and sleep are something for weak people - I am a cybernetic organism, and have a sleep mode.
ლ(ಠ益ಠლ)
Come hangout
irc.freenode.net
#teamblackout
I BUY BRICKED PHONES!


The Following 3 Users Say Thank You to Zarboz For This Useful Post: [ Click to Expand ]
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes