模擬器中ramdisk.img或者recovery.img重新解壓打包步驟。
阿新 • • 發佈:2019-01-09
1、首先刪除img字尾
# gunzip -S .img ramdisk.img
2、檢視檔案型別
# file ramdisk
ramdisk: ASCII cpio archive (SVR4 with no CRC)
是一個cpio格式的檔案
3、解壓cpio檔案
# mkdir ramdisk_ok
# cd ramdisk_ok/
# cpio -i -F ../ramdisk
# ls -la
drwxrwxr-x 8 yonghe yonghe 4096 1月 19 15:04 . drwxr-x--- 4 yonghe yonghe 4096 1月 19 15:10 .. drwxrwx--x 2 yonghe yonghe 4096 1月 19 15:04 data -rw-r--r-- 1 yonghe yonghe 116 1月 19 15:04 default.prop drwxr-xr-x 2 yonghe yonghe 4096 1月 19 15:04 dev -rw-r--r-- 1 yonghe yonghe 8870 1月 19 15:04 file_contexts -rw-r----- 1 yonghe yonghe 953 1月 19 15:04 fstab.goldfish -rwxr-x--- 1 yonghe yonghe 175260 1月 19 15:04 init -rwxr-x--- 1 yonghe yonghe 919 1月 19 15:04 init.environ.rc -rwxr-x--- 1 yonghe yonghe 2979 1月 19 15:04 init.goldfish.rc -rwxr-x--- 1 yonghe yonghe 19970 1月 19 15:06 init.rc -rwxr-x--- 1 yonghe yonghe 1795 1月 19 15:04 init.trace.rc -rwxr-x--- 1 yonghe yonghe 3915 1月 19 15:04 init.usb.rc drwxr-xr-x 2 yonghe yonghe 4096 1月 19 15:04 proc -rw-r--r-- 1 yonghe yonghe 2161 1月 19 15:04 property_contexts drwxr-x--- 2 yonghe yonghe 4096 1月 19 15:04 sbin -rw-r--r-- 1 yonghe yonghe 656 1月 19 15:04 seapp_contexts -rw-r--r-- 1 yonghe yonghe 74768 1月 19 15:04 sepolicy drwxr-xr-x 2 yonghe yonghe 4096 1月 19 15:04 sys drwxr-xr-x 2 yonghe yonghe 4096 1月 19 15:04 system -rw-r--r-- 1 yonghe yonghe 272 1月 19 15:04 ueventd.goldfish.rc -rw-r--r-- 1 yonghe yonghe 4024 1月 19 15:04 ueventd.rc
4、修改ramdisk目錄下的內容。
5、重新打包
# cd ../
# gzip -c ramdisk > ramdisk.img