Image拼接脚本

#!/bin/bash
OFFSET_UBOOT=0
OFFSET_NV=262144
OFFSET_USER=393216
OFFSET_ZIMAGE=1048576
OFFSET_UPDATER=4194394
OFFSET_APPFS=8912896
TARGET=img.bin
dd if=/dev/zero of=$TARGET bs=1M count=16
dd if=u-boot-with-spl.bin of=$TARGET conv=notrunc seek=0 bs=1
dd if=nv.img of=$TARGET conv=notrunc seek=$OFFSET_NV bs=1
dd if=usrdata.jffs2 of=$TARGET conv=notrunc seek=$OFFSET_USER  bs=1
dd if=zImage  of=$TARGET conv=notrunc seek=$OFFSET_ZIMAGE bs=1
dd if=updater.cramfs  of=$TARGET conv=notrunc seek=$OFFSET_UPDATER  bs=1

dd if=appfs.cramfs  of=$TARGET conv=notrunc seek=$OFFSET_APPFS bs=1

脚本的功能是把几个独立的Image(例如uboot,kernel,rootfs)拼接成一个Image,方便工厂用编程器烧录.

你可能感兴趣的:(Image拼接脚本)