The following external tools are needed:
- imgRePackerRK_106.zip (https://forum.xda-developers.com/sho....php?t=2257331)
- rkcrc: (https://github.com/naobsd/rkutils)
Unpack the ROM image
$ imgrepackerrk wasser-3.0.6-minix-x7-rk3188.img
Strip the 8 byte header from the extracted boot image
$ dd if=boot.img.krnl of=bootimg.cpio.gz skip=8 bs=1 count=20000000
Extract the cpio archive to a directory
$ mkdir newboot $ cd newboot $ gzip -dc ../bootimg.cpio.gz | cpio -iduvm
Edit the files as needed.
Note: I'm using the Mali patch as an example. Pay attention to the path to the module. It may vary between Android versions.
Open file 'init.rk30board.rc' with a text editor, find the line containing the entry for the 'mali.ko' kernel module and edit it to look as follows:
insmod /system/lib/modules/mali.ko mali_dvfs=133,200,266,300,400,600,798 mali_init_clock=133
Recreate the raw boot image file
Boot images can not contain touched/modified files, so the dates of the edited files need to be reset. In the new Lollipop ROM there's a symbolic link inside the boot image which will trigger an error but it shouldn't cause any problems.
$ find . -exec touch -d "1970-01-01 01:00" {} \;
$ find . ! -name "." | sort | cpio -oa -H newc | gzip -n > ../newboot.cpio.gz $ cd ..
Add CRC to the file to create the final image file
Note: You need to have a version of the rkcrc utility which supports the -k parameter.
$ rkcrc -k newboot.cpio.gz newboot.img
FINAL NOTE: Before attempting to flash the new boot image, you might want to do the following checks:
- Is the size of the new boot image file within ballpark of the unmodified one?
- Can it be taken apart with this process?
Comment