summaryrefslogtreecommitdiff
path: root/polux
diff options
context:
space:
mode:
authorJérémy Dufour2012-11-22 17:20:25 +0100
committerJérémy Dufour2012-11-22 17:27:16 +0100
commit64840b9e24eefae37f2aa2b6059285f40365bfa5 (patch)
treef5b3cb83315ed905128fd7eea20b69a08ce5745b /polux
parent7724b3be5f3a84de5eddc3ee84849035cadd90e5 (diff)
polux/tools/makeflash: add support for mse500 boards, closes #3536
Diffstat (limited to 'polux')
-rwxr-xr-xpolux/tools/makeflash/makeflash.sh30
1 files changed, 22 insertions, 8 deletions
diff --git a/polux/tools/makeflash/makeflash.sh b/polux/tools/makeflash/makeflash.sh
index 74774f5be7..dcaf703ef4 100755
--- a/polux/tools/makeflash/makeflash.sh
+++ b/polux/tools/makeflash/makeflash.sh
@@ -1,27 +1,41 @@
#!/bin/bash
-if [ $# -lt 5 ]
+if [ $# -lt 6 ]
then
- echo "Usage: $0 <output> <bootloader> <nvram> <userfs> <image>"
+ echo "Usage: $0 [spc200|mse500] <output> <bootloader> <nvram> <userfs> <image>"
exit
fi
+BOARD=$1
+case "$BOARD" in
+ spc200|mse500)
+ ;;
+ *)
+ echo "Un-supported board type $BOARD"
+ exit
+ ;;
+esac
+
declare -A IMAGES
-OUTPUT=$1
-IMAGES[file_boot]="$2"
+OUTPUT=$2
+IMAGES[file_boot]="$3"
IMAGES[spc200_boot]="64"
-IMAGES[file_nvram]="$3"
+IMAGES[mse500_boot]="128"
+IMAGES[file_nvram]="$4"
IMAGES[spc200_nvram]="64"
-IMAGES[file_userfs]="$4"
+IMAGES[mse500_nvram]="64"
+IMAGES[file_userfs]="$5"
IMAGES[spc200_userfs]="512"
-IMAGES[file_image]="$5"
+IMAGES[mse500_userfs]="512"
+IMAGES[file_image]="$6"
IMAGES[spc200_image]="1728"
+IMAGES[mse500_image]="1728"
touch "$OUTPUT"
offset=$((0))
for IMAGE in "boot" "nvram" "userfs" "image"
do
dd if="${IMAGES[file_$IMAGE]}" of="$OUTPUT" bs="1024" seek="$offset"
- offset=$(($offset+${IMAGES[spc200_$IMAGE]}))
+ offset=$(($offset+${IMAGES[${BOARD}_$IMAGE]}))
done