[9001] Kernel - Extracting initrd.img from zImage and package again
Disclaimer: Do only use this information if you know what you're doing!
PATH=$PATH:/home/markus/android/sdk/platform-tools
Get kernel from phone:
adb shell
su
dd if=/dev/block/mmcblk0p8 of=/sdcard/external_sd/stockboot.img
Exit adb shell
adb pull /sdcard/external_sd/stockboot.img
Separate the zImage from the ramdisk (see below for abootimg):
abootimg -x stockboot.img
unpacks the archive and copies contents to working directory:
gunzip -c initrd.img | cpio -i
Do your edits, e.g. default.prop, add:
debug.performance.tuning=1
video.accelerate.hw=1
windowsmgr.max_events_per_sec=150
--> move all files to new folder, cd into this folder:
repacks files from working directory into an archive (MAKE SURE NO OTHER FILES ARE IN THE WORKING DIRECTORY!!)
find . | cpio -o -H newc | gzip > ../myinitrd.img
New boot.img:
./mkbootimg --kernel zImage --ramdisk myinitrd.img --cmdline "console=null androidboot.hardware=qcom androidboot.emmc=true hw=6" -o myBuiltBoot.img --base 0x00400000 --pagesize 4096
You can also use abootimg to create your new .img file, it has an easier syntax as it exports the commandline to a .cfg file and you can use that while creating the package.
Push your new kernel.img to the phone:
adb push myBuiltBoot.img /sdcard/external_sd/myBuiltBoot.img
Write kernel to kernel-partition in phone:
adb shell
su
dd if=/sdcard/external_sd/myBuiltBoot.img of=/dev/block/mmcblk0p8
adb reboot
< pray >
Sources:
http://forums.androidcentral.com/lg-...-nandroid.html
http://forum.xda-developers.com/show....php?t=1227269
http://forum.xda-developers.com/show....php?t=1292557
Also quite handy: http://packages.debian.org/de/sid/abootimg
Current Device: Google Galaxy Nexus GSM i9250, XenonHD JB 
Siemens A50 -> Siemens M65 -> Sony Ericsson Z710i -> Sony Ericsson W595 -> HTC Desire (SLCD) -> Palm Pre (Minus) -> Samsung Galaxy S Plus (GT-I9001) -> Huawei Honor U8860 (returned b.c. of bad touchscreen) -> Samsung Galaxy S Plus (GT-I9001) -> Google Galaxy Nexus
|