I have a Nexus 5 with AOSP ROM 4.4.4.
I try to "pull" boot.img from the device, unzip it, edit "init.rc", repack it in boot.img and put it on the device.
I follow many guides, but none of them have the same scenario as mine:
( http://droidcore.blogspot.co.il/2012/12/how-to-edit-initrc-in-android.html and http://www.digitalinternals.com/mobile/android-mmc-mmcblk-partition -layout / 259 / )
- The device section is mmcblck, so from
ls -l /dev/block/platform/msm_sdcc.1/by-name/I got that download /dev/block/mmcblk0p19:
lrwxrwxrwx root root 1971-02-28 21:30 boot → / DEV / block / mmcblk0p19
I created boot.img with the command: cat /dev/block/mmcblk0p19 > /mnt/sdcard/boot.imgand pulled this boot.img to my computer. This boot.img is ~ 23 MB.
I unmkbootimgboot.img with the tool in http://droidcore.blogspot.co.il/2012/12/how-to-edit-initrc-in-android.html and got 2 files: initramfs.cpio.gzwhich is ~ 500 KB and kernel.gzthat is ~ 8.4 MB. I received the following data:
Core Size 8405280
Kernel Address 0x8000
Size Ramdisk 498992
Ramdisk Address 0x2900000
Secondary size 0
Secondary Address 0xf00000
Kernel Tag Address 0x2700000
Flash Page Size 2048
Board Name: "
Command line "console = ttyHSL0,115200, n8 androidboot.hardware = hammerhead user_debug = 31 maxcpus = 2 msm_watchdog_v2.enable = 1"
Extracting kernel.gz
... Extract initramfs.cpio.gz ...
Done.
To recompile this image, use:
mkbooting --kernel kernel.gz --ramdisk initramfs.cpio.gz --base 0x26fff00 --cmdline 'console = ttyHSL0,115200, n8 androidboot.hardware = hammerhead user_debug = 31 maxcpus = 2 msm_watchdog_v2.enable = 1' -o new_boot.img
initramfs.cpio.gz : gunzip -c initramfs.cpio.gz | sudo sh -c 'cd ../ && cpio -i' ( http://www.wiki.xilinx.com/Build+and+Modify+a+Rootfs) , init. rc . .
initramfs.cpio.gz : sh -c 'cd ../ && sudo find . | sudo cpio -H newc -o' | gzip -9 > new_initramfs.cpio.gz ~ 500 .
mkbootimg 2 : ./mkbooting --kernel kernel.gz --ramdisk initramfs.cpio.gz --base 0x26fff00 --cmdline 'console=ttyHSL0,115200,n8 androidboot.hardware=hammerhead user_debug=31 maxcpus=2 msm_watchdog_v2.enable=1' -o new_boot.img, boot.img, ~ 8.5
, ( )
:
, !
************* *************
:
unmkbootimg : http://whiteboard.ping.se/Android/Unmkbootimg
unmkbootimg :
*** ****
mkbootimg!
OFF_KERNEL_ADDR - 0xFD908100
OFF_RAMDISK_ADDR - 0x00200100
OFF_SECOND_ADDR - 0xFE800100
mkbootimg.c, , .
: https://gist.github.com/jberkel/1087757 !!!