4 # Copyright (C) 2015 OpenWrt.org
6 # This is free software, licensed under the GNU General Public License v2.
7 # See /LICENSE for more information.
12 echo "SYNTAX: $0 <file> <bootfs image> <rootfs image> <bootfs size> <rootfs size> <u-boot image>"
26 # Set the u-boot storage to 2M
27 set `ptgen -o $OUTPUT -h $head -s $sect -l 1024 -t 53 -p 2M -t c -p ${BOOTFSSIZE}M -t 83 -p ${ROOTFSSIZE}M`
29 UBOOTOFFSET="$(($1 / 512))"
30 UBOOTSIZE="$(($2 / 512))"
31 BOOTOFFSET="$(($3 / 512))"
32 BOOTSIZE="$(($4 / 512))"
33 ROOTFSOFFSET="$(($5 / 512))"
34 ROOTFSSIZE="$(($6 / 512))"
36 dd bs=512 if="$UBOOT" of="$OUTPUT" seek="$UBOOTOFFSET" conv=notrunc
37 dd bs=512 if="$BOOTFS" of="$OUTPUT" seek="$BOOTOFFSET" conv=notrunc
38 dd bs=512 if="$ROOTFS" of="$OUTPUT" seek="$ROOTFSOFFSET" conv=notrunc