2 # Usage: ./construct-rom.sh [-p] components ...
6 if [ "$1" = "-p" ]; then
13 if [ $DOPAD -eq 1 ]; then
17 # Get the size of all the components together
19 for c
in $COMPONENTS; do
20 size
=`du -b $c | cut -f1`
21 ROMSIZE
=`expr $ROMSIZE + $size` || true
24 # Pad to a power of 2, starting with 128k
30 if [ $ROMSIZE -gt $RSIZE ]; then
31 RSIZE
=`expr $RSIZE "*" 2`
35 if [ $ROMSIZE -lt $RSIZE ]; then
36 PAD
=`expr $RSIZE - $ROMSIZE`
43 dd if=/dev
/zero of
=$PADFILE bs
=1 count
=$PAD > /dev
/null
2>&1
44 COMPONENTS
="$PADFILE $COMPONENTS"
49 if [ $DOPAD -eq 1 ]; then