1. Preparatory work:
Prepare an Ubuntu machine, copy the boot.img to the machine, download the necessary tools
sudo apt-get install abootimg
git clone https://github.com/anestisb/android-simg2img.git
CD android-simg2img
Make
sudo cp Simg2img/usr/bin
2. Unzip the boot image
Abootimg-x boot.img
mkdir RAMDisk
CD RAMDisk
Gunzip-c. /initrd.img | Cpio-i
3. Modify the Default.prop file to make
Ro.secure=0
Ro.debuggable=1
4. Modify the init.rc to make
On property:ro.debuggable=1
Start Console
Service ADBD/SBIN/ADBD
Class Core
Socket ADBD Stream 660 system system
Disabled
Seclabel U:r:su:s0
On Post-fs
# Once everything is setup, no need to modify/
Mount Rootfs ROOTFS/RW remount
5. Modify the Fstab.freescale so that the Mount permission can be written
/dev/block/mmcblk0p5/system ext4 RW Wait
6. Repackaging RAMDisk files
CD ramdisk/
Find. | Cpio–o–h NEWC | Gzip >. /new-ramdisk.img
7. Create a new boot.img
The new-randisk.img file size will be different from the original initrd.img because it is unpacked and then packaged.
If larger than the original, you need to reset the size of the boot.img,
View the original size
Cat Bootimg.cfg,
The first line is the size of the original boot.img,
Use Ls-l to view the size of the initrd.img and new-ramdisk.img two files,
In the original boot.img size based on the size of the two file (newsize-bytes), note that the number of bytes added is best block integer times, such as 4096 bytes and so on.
Then use the command to generate a new image:
Abootimg--create new-boot.img-f bootimg.cfg-k zimage-r new-ramdisk.img-c "Bootsize=newsize-bytes"
8. Boot.img the generated new-boot.img into the Development Board as the
After rebooting, the system partition becomes writable.
Android 4.4 System How to get root permissions