Skip to content

Commit 19b6829

Browse files
author
Xiangfu Liu
committedJan 31, 2012
reflash_m1.sh cleanup help message
1 parent e3f089a commit 19b6829

File tree

1 file changed

+27
-32
lines changed

1 file changed

+27
-32
lines changed
 

‎scripts/reflash_m1.sh

+27-32
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# version of me
44
__VERSION__="2011-12-13"
5-
echo "File name: $0, Version of me: ${__VERSION__}"
5+
echo -e "File name: $0\t version: ${__VERSION__}"
66

77

88
STANDBY="standby.fpg"
@@ -21,30 +21,26 @@ MAC_DIR="${HOME}/.qi/milkymist/bios-mac/tmp"
2121

2222
# Functions ###########################################################
2323
call-help() {
24-
echo "
25-
Usage: ./reflash_m1.sh version: ${__VERSION__}
26-
--release [VERSION]
27-
by default it will download 'currect' release
28-
VERSION can found at http://milkymist.org/updates/
29-
--snapshot <VERSION> [data]
30-
if 'data' enable will reflash data partitions <VERSION> can found
31-
at http://fidelio.qi-hardware.com/~xiangfu/build-milkymist/
32-
--local-folder <PATH>
33-
all files must be under <PATH>
34-
--lock-flash
35-
lock 'standby' and 'rescue' partitions
36-
--read-flash <PARTITION>
37-
read from RESCUE partition, by default only read 'standby.bin'
38-
PARTITION: standby soc bios splash flickernoise
39-
--bios-mac 00 2a
40-
'00' '2a' is the last MAC address
41-
--rc3 00 2a
42-
used in factory flash, this options will reflash data partition
24+
echo -e \
25+
"Usage: ./reflash_m1.sh [OPTION] [PARAM]...
26+
27+
--release [VERSION] by default it will download the latest release
28+
--snapshot <VERSION> [data] if 'data' enable, it will REFLASH DATA PARTITION
29+
--local-folder please use m1nor instread
30+
--lock-flash lock 'standby' and 'rescue' partitions
31+
--read-flash <PARTITION> read from RESCUE partition, by default only read
32+
'standby.bin'
33+
PARTITION: standby soc bios splash flickernoise
34+
--bios-mac XX XX 'XX' 'XX' is the last MAC address
35+
--rc3 XX XX used in factory flash, reflash all partitions
36+
4337
NOTICE: '--bios-mac' and '--rc3' needs command 'mkmmimg'
44-
Written by: Xiangfu Liu <xiangfu.z@gmail.com>
45-
Please report bugs to <devel@lists.milkymist.org>
46-
"
38+
'--release' VERSION can found at http://milkymist.org/updates/
39+
'--snapshot' VERSION can found at
40+
http://fidelio.qi-hardware.com/~xiangfu/build-milkymist/
4741
42+
Written by: Xiangfu Liu <xiangfu@openmobilefree.net>
43+
Please report bugs to <devel@lists.milkymist.org>\tversion: ${__VERSION__}"
4844
}
4945

5046
# $1: is the file name you want save
@@ -204,9 +200,9 @@ call-create-bios () {
204200
printf "\\x$(printf "%x" 0x00)" >> ${MAC_DIR}/${MAC_TMP}
205201

206202
cat ${MAC_DIR}/${HEAD_TMP} \
207-
${MAC_DIR}/${MAC_TMP} \
208-
${MAC_DIR}/${REMAIN_TMP} \
209-
> $1
203+
${MAC_DIR}/${MAC_TMP} \
204+
${MAC_DIR}/${REMAIN_TMP} \
205+
> $1
210206

211207
mkmmimg $1 write
212208
}
@@ -291,7 +287,7 @@ if [ "$1" == "--snapshot" ]; then
291287
fi
292288

293289
if [ "$1" == "--local-folder" ]; then
294-
echo "Not support yet!"
290+
echo "Please use m1nor from http://projects.qi-hardware.com/index.php/p/wernermisc/source/tree/master/m1/tools/m1nor"
295291
exit 1
296292
fi
297293

@@ -318,8 +314,8 @@ fi
318314

319315
if [ "$1" == "--bios-mac" ]; then
320316
if [ "$#" != "3" ]; then
321-
call-help
322-
exit 1
317+
call-help
318+
exit 1
323319
fi
324320

325321
BIOS_RESCUE_MAC="bios.$2$3.bin"
@@ -336,8 +332,8 @@ fi
336332

337333
if [ "$1" == "--rc3" ]; then
338334
if [ "$#" != "3" ]; then
339-
call-help
340-
exit 1
335+
call-help
336+
exit 1
341337
fi
342338

343339
BIOS_RESCUE_MAC="bios.$2$3.bin"
@@ -382,7 +378,6 @@ if [ "$1" == "--rc3" ]; then
382378
exit 0
383379
fi
384380

385-
386381
# nomally not reach here
387382
call-help
388383
exit 1

0 commit comments

Comments
 (0)
Please sign in to comment.