- split_bootimg.pl
- mkbootimg
- mkbootfs
- ro.secure=1
- ro.allow.mock.location=0
- ro.debuggable=0
- persist.service.adb.enable=0
- ro.secure=0
- ro.allow.mock.location=0
- ro.debuggable=1
- persist.service.adb.enable=1
- split the boot.img: split_bootimg.pl boot.img, after running the command, two files are generated: boot.img-kernel and boot.img-ramdisk.gz.
- create a temp folder (e.g. ramdisk), change to that folder, run the following command to extract the boot.img-ramdisk.gz: cat ../boot.img-ramdisk.gz | gzip -d | cpio -idm.
- make the changes to the ramdisk file system in ramdisk folder, e.g. change the default.prop file to get adb root permissions.
- return the parent folder, and run the following command to recreate the ramdisk package: mkbootfs ./ramdisk | gzip > ramdisk-new.gz
- recreate the boot image: mkbootimg --kernel boot.img-kernel --ramdisk ramdisk-new.gz -o boot-new.img
more things can be done with the above steps, such as change the boot up sequence by modify the init.rc.