包里的resources目录下的代码,是从三星开源网站的i9100 update2包里获取,编译命令是从内核编译过程获取,基本代码从gitpub的z4mod获取,本机测试通过。 首先安装编译器,我安装的是: http://www./sgpp ... 2-arm-none-eabi.bin 在ubuntu下可以直接运行apt-get来安装一个编译器:
sudo apt-get install gcc-4.5-arm-linux-gnueabi | 没有安装realpath工具的需要安装,脚本会调用: sudo apt-get install realpath | *以下操作都是在root shell(在shell下运行sudo -i)下进行的,我使用root权限来解包、修改和打包是因为这样可以保留initramfs文件的权限。 解包zImage: root@ubuntu-xiaolu:~/xiaolu/initramfs/tmp# ./unpack zImagexwki8 xwki8 [I] Extracting gzip'd kernel image from file: zImagexwki8 (start = 16621) [I] CPIO compression type detected = none | offset = 163840 [I] Extracting non-compressed CPIO image from kernel image (offset = 163840) [I] Expanding CPIO archive: initramfs.cpio to xwki8. | 得到xwki8目录,进入目录就可以修改和增加文件了: 重新打包initramfs: 修改repack,把下边的行,改为自己安装的编译器的目录和库文件目录: COMPILER=/home/xiaolu/CodeSourcery/Sourcery_G _Lite/bin/arm-none-eabi COMPILER_LIB=/home/xiaolu/CodeSourcery/Sourcery_G _Lite/lib/gcc/arm-none-eabi/4.5.2 | 重建zImage,得到new_zImage,改名成zImage,打包成tar就可以刷机了: root@ubuntu-xiaolu:~/xiaolu/initramfs/tmp# ./repack zImagexwki8 initramfs.cpio [I] ---------------------------kernel repacker for i9100--------------------------- [I] Extracting gzip'd kernel from zImagexwki8 (start = 16621) [I] Non-compressed CPIO image from kernel image (offset = 163840) [I] CPIO image MAX size:3045376 [I] Head count:3209216 [I] Making head.img ( from 0 ~ 163840 ) [I] Making a tail.img ( from 3209216 ~ 10612864 ) [I] Current ramdsize using cat : 3045376 with required size : 3045376 bytes [I] Current ramdsize using gzip -f4 : 1911748 with required size : 3045376 bytes [I] gzip -f4 accepted! [I] Merging [head ramdisk] padding tail [I] Now we are rebuilding the zImage [I] Image ---> piggy.gzip [I] piggy.gzip ---> piggy.gzip.o [I] Compiling head.o [I] Compiling misc.o [I] Compiling decompress.o [I] Compiling lib1funcs.o [I] Create vmlinux.lds [I] head.o misc.o piggy.gzip.o decompress.o lib1funcs.o---> vmlinux [I] vmlinux ---> zImage [I] New zImage size:5254168 [I] Padding new zImage to 8387840 bytes [I] new_zImage has been created [I] Cleaning up... [I] finished... | 解包和打包initramfs截图:
|