模拟器中ramdisk.img或者recovery.img重新解压打包步骤。

来源:互联网 发布:数据包与数据帧的区别 编辑:程序博客网 时间:2024/06/10 01:49

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.propdrwxr-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.rcdrwxr-xr-x 2 yonghe yonghe   4096  1月 19 15:04 proc-rw-r--r-- 1 yonghe yonghe   2161  1月 19 15:04 property_contextsdrwxr-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 sepolicydrwxr-xr-x 2 yonghe yonghe   4096  1月 19 15:04 sysdrwxr-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

0 0
原创粉丝点击