Introducing XDA:DevCon – A Conference For Developers By Developers
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
Tip us?
 
fxjumper
Old
(Last edited by fxjumper; 6th August 2012 at 08:50 PM.) Reason: modification
#1  
fxjumper's Avatar
Member - OP
Thanks Meter 56
Posts: 30
Join Date: Nov 2011
Location: Lyon
Default [KERNEL] About flashing kernel for all Roms

Hi,

Because i like to test many different Roms with kernels, i created my own script to flash properly with the recovery.
Often, the Kernels are available for a Rom in particular, in a zip file containing a boot.img with the kernels modules contained in /system/lib/modules

The problem is that to start, Android does not need that kernel, but also the image of a micro file system (zImage) containing startup instructions, but also a list of parameters to pass to the kernel.

The boot.img is the concatenation of the kernel with its startup parameters, and zImage.

To properly replace a kernel, so we need to retrieve the current settings, the current zImage, and reform the boot.img with the new kernel, and of course, replace the modules.

This recovery script make these step:
- Extract the kernel from the boot.img file
- Get the boot parameters of actual kernel.
- Get the actual zImage
- Rebuild the boot.img with new kernel, old boot parameters, old zImage
- Replace the modules in /system/lib/modules
- Flash the new boot.img

Before do that.
Download the kernel from other Rom, you want to flash
Extract from the zip file, boot.img and /system/lib/modules directory


Get my kernel_flash.zip
Extract it.
Replace the system/lib/modules content with the new one.
Replace the boot.img with the new one.
Rebuild you zip file with 7zip (www.7zip.org)
This zip file containing:
META-INF
boot.img
kernel
system
version.txt

And flash it under recovery.

I tested these method with Senses Roms, with AOKP or AOSP Roms. Always in my system started succefully.

You should be able to flash this kernel on any ROM (except the boot stock that has an offset of 256 bytes incompatible with the script)

As is, this kernel_flash.zip file contains a yoda kernel 2.1, overclocked to 1.5 Ghz, you can test with your ROM.


Sorry for my english.
Thank you to Google for translation assistance
Thank you for the kernel to yoda (my kernel_flash.zip contain 3.0.16-yoda_v2.1)
Thank you to all XDA developers who allowed me to further my understanding
Attached Files
File Type: zip flash_kernel.zip - [Click for QR Code] (5.17 MB, 143 views)
The Following 4 Users Say Thank You to fxjumper For This Useful Post: [ Click to Expand ]
 
gav-collins1983
Old
#2  
gav-collins1983's Avatar
Senior Member
Thanks Meter 539
Posts: 1,477
Join Date: Dec 2010
Location: dudley
looks promising, but does this work also for s-on users ? i dont know if you knew this already, but there is https://play.google.com/store/apps/d...imagegui&hl=en this app in playstore, which works for both s-on and s-off users, and also flashes recovery
Galaxy S4 GT-I9505
ROM Stock JB 4.2.2
KERNEL Stock 3.4.0-431985
STATE Rooted / UnLocked
FIRMWARE XXUAME2
RECOVERY TWRP 2.5
PATCHES PimpMyRom , Chainfire 3D , kernel tuner
ANTUTU-=25314
QUADRANT-=best

Note2 <S3 <Evo3D <S2 <dhd <Omnia HD <Omnia 2 < Omnia 1
 
fxjumper
Old
#3  
fxjumper's Avatar
Member - OP
Thanks Meter 56
Posts: 30
Join Date: Nov 2011
Location: Lyon
Quote:
Originally Posted by gav-collins1983 View Post
looks promising, but does this work also for s-on users ? i dont know if you knew this already, but there is https://play.google.com/store/apps/d...imagegui&hl=en this app in playstore, which works for both s-on and s-off users, and also flashes recovery
For s-on:

After flashing kernel under recovery, only /system/lib/modules files are copied
Keep in Recovery,
You need to flash the kernel with fastboot.

Open a terminal
with adb, pull the boot image:
Code:
adb pull /tmp/newboot.img boot.img
Restart in fastboot mode
Code:
adb reboot bootloader
Flash the boot.img file
Code:
fastboot flash boot boot.img
 
Pacattack
Old
#4  
Pacattack's Avatar
Senior Member
Thanks Meter 739
Posts: 1,096
Join Date: Feb 2011
Quote:
Originally Posted by fxjumper View Post
For s-on:

After flashing kernel under recovery, only /system/lib/modules files are copied
Keep in Recovery,
You need to flash the kernel with fastboot.

Open a terminal
with adb, pull the boot image:
Code:
adb pull /tmp/newboot.img boot.img
Restart in fastboot mode
Code:
adb reboot bootloader
Flash the boot.img file
Code:
fastboot flash boot boot.img
would it flash the kernel if you are using 4ext recovery ?
 
fxjumper
Old
#5  
fxjumper's Avatar
Member - OP
Thanks Meter 56
Posts: 30
Join Date: Nov 2011
Location: Lyon
Quote:
Originally Posted by Pacattack View Post
would it flash the kernel if you are using 4ext recovery ?
My phone is S-OFF

4ext recovery flash the kernel.

I know 4ext dispose a S-ON mode to flash the boot.img on the first boot, but i don't know if it works in this case.

Try it
 
Post Reply+
Tags
boot.img, flash, kernel
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

report this ad
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Go to top of page...