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

Search This thread

xHausx

Inactive Recognized Developer
Jul 5, 2010
6,778
4,519
Central Florida
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:

xHausx

Inactive Recognized Developer
Jul 5, 2010
6,778
4,519
Central Florida
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:

xHausx

Inactive Recognized Developer
Jul 5, 2010
6,778
4,519
Central Florida
implimenting in my next installer :D
Would be a nice setup, aroma choose the way to install, boot.img or anykernel flash
Then you can flash the modules either way...

Thanks for the script. It will definitely get used.


Let me know if you need any help implementing it. I know the instructions aren't very detailed yet so I'll see about clarifying them some more here in a little bit.
 
Last edited:

cgrimm9

Senior Member
Sep 4, 2010
243
52
I don't mean to highjack anyone thread I was ready to do this since meanrom went with the evilz kernal. since I was s-on on the 1.15 boot. I was going to do this till I found a app on the market place called flash image gui which installed the kernal right on the phone.was simple and just plain easy no typeing anthing in just a click of a buttone.
 

JohnCorleone

Senior Member
Dec 19, 2010
16,188
5,864
Whittier,CA
I don't mean to highjack anyone thread I was ready to do this since meanrom went with the evilz kernal. since I was s-on on the 1.15 boot. I was going to do this till I found a app on the market place called flash image gui which installed the kernal right on the phone.was simple and just plain easy no typeing anthing in just a click of a buttone.

I used Flash Image GUI on my NS4G all of the time. The last 2 updates were to add this phone and the Nexus 7. It takes about 10 seconds to flash a kernel or recovery img. Its a JoeyKrim app...so you know its legit. It actually saved me last night when testing a N7 kernel overclocked over 1.99. . The kernel somehow made my N7 not boot to recovery no matter what I tried so I stuck a different kernel in that app, flashed it and once it booted I flashed the CWM 6.0.1.0 and I was completely fixed. Money well spent.

Edit..XhausX, I bought my first 2 HTCs ever about 2 weeks ago. They are both s on 1.13 but I need to either return on to full stock or use your rooted stock. I need to help my mother out. She's using a Samsung Moment! Ouch.... I am downloading that now. Is it a simple wipe and flash? If its more difficult, I will gladly shoot a donation your way if you can help me. I think I prefer her to be rooted stock so your odex version is the call...should have mentioned I know squat about the HTC methods. Regaw_Leinard got me where I am now

Sent from my EVO using Xparent SkyBlue Tapatalk 2
 
Last edited:

xHausx

Inactive Recognized Developer
Jul 5, 2010
6,778
4,519
Central Florida
I don't mean to highjack anyone thread I was ready to do this since meanrom went with the evilz kernal. since I was s-on on the 1.15 boot. I was going to do this till I found a app on the market place called flash image gui which installed the kernal right on the phone.was simple and just plain easy no typeing anthing in just a click of a buttone.

Since the kernel is only writeable from the rom this does something similar, except it does it after you flash the rom and it's automatic.

You could look at it as the rom itself installs it's own kernel. That's one of the reasons why it may look so convoluted, but for a rom/kernel dev to actually implement it is easy once you know how it works.

I used Flash Image GUI on my NS4G all of the time. The last 2 updates were to add this phone and the Nexus 7. It takes about 10 seconds to flash a kernel or recovery img. Its a JoeyKrim app...so you know its legit. It actually saved me last night when testing a N7 kernel overclocked over 1.99. . The kernel somehow made my N7 not boot to recovery no matter what I tried so I stuck a different kernel in that app, flashed it and once it booted I flashed the CWM 6.0.1.0 and I was completely fixed. Money well spent.

Edit..XhausX, I bought my first 2 HTCs ever about 2 weeks ago. They are both s on 1.13 but I need to either return on to full stock or use your rooted stock. I need to help my mother out. She's using a Samsung Moment! Ouch.... I am downloading that now. Is it a simple wipe and flash? If its more difficult, I will gladly shoot a donation your way if you can help me. I think I prefer her to be rooted stock so your odex version is the call...should have mentioned I know squat about the HTC methods. Regaw_Leinard got me where I am now

Sent from my EVO using Xparent SkyBlue Tapatalk 2

If you no longer need it rooted personally I would get s-off first and then run the latest RUU to restore it to stock. That way you'll always be able to re-root anytime without hassle, but the device can still be completely stock and used normally.
 
Last edited:

xHausx

Inactive Recognized Developer
Jul 5, 2010
6,778
4,519
Central Florida
+1 on that, where do i add this in the updater and what do we do with Blk21 just leave it or will it work around it.

Usually it's best to run it last so everything else is already in place. It will also check the recovery for the mount point, so that line won't be needed with it.

For your paranoid android rom you could use something like this: http://pastebin.com/rGVDKK2u

I'm not able to test it atm though so you'll probably want to verify it's good first.

Is it possible to get a mirror of the Dev-Host file? The 'drivers are currently being updated', and I wanted to try adding this to my stock 2.13.651.1 ROM so as to avoid the inevitable questions from noobs that are S-ON about why the ROM won't boot :rolleyes:.

mirror: https://dl.dropbox.com/u/18734200/kernel-installer-v0.56.zip
 

Captain_Throwback

Recognized Developer
Usually it's best to run it last so everything else is already in place. It will also check the recovery for the mount point, so that line won't be needed with it.

For your paranoid android rom you could use something like this: http://pastebin.com/rGVDKK2u

I'm not able to test it atm though so you'll probably want to verify it's good first.



mirror: https://dl.dropbox.com/u/18734200/kernel-installer-v0.56.zip
And of course the Dropbox link is now dead too :eek:.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 54
    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
    18
    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.
    11
    Reserved for later use
    3
    implimenting in my next installer :D
    Would be a nice setup, aroma choose the way to install, boot.img or anykernel flash
    Then you can flash the modules either way...

    Thanks for the script. It will definitely get used.


    Let me know if you need any help implementing it. I know the instructions aren't very detailed yet so I'll see about clarifying them some more here in a little bit.
    3
    implimenting in my next installer :D