Android img文件

android编译后生成的ramdisk是一个gzip格式的文件
# file ramdisk.img
ramdisk.img: gzip compressed data, from Unix

那么先解压,因为后缀不是.gz,所以用-s 选项
gunzip -S .img ramdisk.img

这样生成了一个新文件ramdisk
查看是什么格式
# file ramdisk
ramdisk: ASCII cpio archive (SVR4 with no CRC)

ok,是一个cpio格式的文件
再次解压
先创建一个目录,假设叫rfs,并进入
# cpio -i -F ../ramdisk
512 blocks
ok,那么得到结果是
# ll
total 160
drwxrwx--x 2 root root   4096 2010-08-21 19:10 data
-rw-r--r-- 1 root root    118 2010-08-21 19:10 default.prop
drwxr-xr-x 2 root root   4096 2010-08-21 19:10 dev
-rwxr-x--- 1 root root 107412 2010-08-21 19:10 init
-rwxr-x--- 1 root root   1677 2010-08-21 19:10 init.goldfish.rc
-rwxr-x--- 1 root root  12995 2010-08-21 19:10 init.rc
drwxr-xr-x 2 root root   4096 2010-08-21 19:10 proc
drwxr-x--- 2 root root   4096 2010-08-21 19:10 sbin
drwxr-xr-x 2 root root   4096 2010-08-21 19:10 sys
drwxr-xr-x 2 root root   4096 2010-08-21 19:10 system

这就是全部内容了。

生成就是一个逆向的操作而已。

注:
其实ramdisk.img的内容就是out/target/product/generic/root的压缩而已。
打包命令:make ramdisk


Qualcomm AMSS side image
2%      backup at...    [OK]
4%      backup nv...    [OK]        #phone is standby
6%      Enter download mode...  [OK]
7%      Send parameter reruest...       [OK]
9%      Downloading hex file... [OK]   #NPRG7627.hex or NPRG7627.hex,  exec in IMEM(internal memory)
9%      Checking license...     [OK]
10%     Set trust mode...       [OK]
12%     Downloading partition table...  [OK]
13%     Downloading qcsblhd_cfgdata.mbn and qcsbl.mbn...        [OK]
15%     Downloading oemsblhd.mbn and oemsbl.mbn...      [OK]
50%     Downloading amsshd.mbn and amss.mbn...  [OK]
55%     Downloading appsboothd.mbn and appsboot.mbn...  [OK] # From Android side compiled
65%     Downloading efs.mbn...  [OK]
98%     restore nv...   [OK]     #phone is standby
99%     restore at...   [OK]
100%    End Download... [OK]
********************************************************
        Success to update.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值