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