system.img ext4 and yaffs2

打包system.img
(for MTK):
Target system image: out/target/product/72_cu_ics/system.img
cd  out/target/product/72_cu_ics/
../../../../out/host/linux-x86/bin/make_ext4fs -s -l 512M -a system system.img system

(for QUALCOMM-2KB page nand):
out/host/linux-x86/bin/mkyaffs2image -f -c 2048 -s 64 out/target/product/msm7627a_vicuna/system out/target/product/msm7627a_vicuna/system.2knand.img

System.img details

System image is a sparsed ext4 loop mounted file system. To open (mount) system image use the commands below

      ./simg2img system.img system.img.raw
      mkdir tmp 
      sudo mount -t ext4 -o loop system.img.raw tmp/

After this, all your system image files are part of tmp folder.

Make any changes you need in the tmp folder. To re-create the parsed system image (system.img.new) use the command below. This can be individually flashed using fastboot command

      sudo ./make_ext4fs -s -l 512M -a system system.img.new tmp/
      sudo umount tmp
      rm -rf tmp
 
# find . | cpio -o -H newc | gzip > ../ramdisk-new.img 这两个镜像都属于yaffs2文件格式,生成方式是一样的。我们就以system.img为例来说明。

  System.img >> system目录树 所需工具unyaffs, 下载地址 

  # mkdir system 

  # cd system 

  # unyaffs ../system.img 

  system目录树 >> system.img 

  所需工具 mkyaffs2image,Android源码编译后会生成该工具,在 out/host/linux-x86/bin 目录下。 

  命令格式: 

  # mkyaffs2image system/ system_new.img 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值