parted picked.img
GNU Parted 2.3
(parted) p
Model: (file)
Disk /opt/kaifaban/A20_SDK2015/20160907_emmc_flash.img: 1615MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 1049kB 14.7MB 13.6MB primary ext2
2 14.7MB 766MB 751MB primary ext4
(parted) unit
Unit? [compact]? B
(parted) p
Model: (file)
Disk /opt/kaifaban/A20_SDK2015/20160907_emmc_flash.img:
1614807040B
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 1048576B 14680063B 13631488B primary ext2
2 14680064B 765854719B 751174656B primary ext4
(第一分区) mount -o loop,offset=1048576 20160907_emmc_flash.img img_dump/
(第二分区) mount -o loop,offset=14680064 20160907_emmc_flash.img img_dump/
替换里面的相关文件,
注意:第一分区里的几个文件uEnv.txt,script.bin,uImage 和
第二分区里的/bootfs目录下的uEnv.txt,script.bin,uImage都需要替换
第二分区里的rootfs.tar.gz为真正的文件系统,来自${CB_OUTPUT_DIR}/rootfs.tar.gz
具体见脚本boardenvsetup.sh