Android img文件

    技术2022-05-12  18

    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)