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> <rootfs image> <rootfs size> <u-boot image> <cfg image>"
25 set `ptgen -o $OUTPUT -h $head -s $sect -l 1024 \
27 -t 83 -p ${ROOTFSSIZE}M \
30 UBOOTOFFSET
="$(($1 / 512))"
31 UBOOTSIZE
="$(($2 / 512))"
32 ROOTFSOFFSET
="$(($3 / 512))"
33 ROOTFSSIZE
="$(($4 / 512))"
34 CFGFSOFFSET
="$(($5 / 512))"
35 CFGFSSIZE
="$(($6 / 512))"
37 dd bs
=512 if="$UBOOT" of
="$OUTPUT" seek
="$UBOOTOFFSET" conv
=notrunc
38 dd bs
=512 if="$ROOTFS" of
="$OUTPUT" seek
="$ROOTFSOFFSET" conv
=notrunc
40 mkdosfs
"$CFGFS" -C 1024
41 dd bs
=512 if="$CFGFS" of
="$OUTPUT" seek
="$CFGFSOFFSET" conv
=notrunc