Change Details
data/qi_lb60/scripts/reflash_ben.sh |
1 | 1 | #!/bin/bash |
2 | 2 | # version of me |
3 | | __VERSION__="2011-11-20" |
| 3 | __VERSION__="2011-03-02" |
4 | 4 | |
5 | 5 | # use 'http' to download and flash images, use 'file' to flash images present in the <WORKING_DIR> |
6 | 6 | PROTOCOL="http" |
... | ... | |
20 | 20 | ROOTFS="openwrt-xburst-qi_lb60-root.ubi" |
21 | 21 | |
22 | 22 | # options for reflash bootloader, kernel, rootfs |
23 | | B="TRUE" |
24 | | K="TRUE" |
25 | | R="TRUE" |
| 23 | B="FALSE" |
| 24 | K="FALSE" |
| 25 | R="FALSE" |
| 26 | ALL="TRUE" |
26 | 27 | |
27 | | while getopts d:l:h OPTIONS |
| 28 | while getopts d:l:hbkr OPTIONS |
28 | 29 | do |
29 | 30 | case $OPTIONS in |
30 | 31 | d) |
... | ... | |
35 | 36 | PROTOCOL="file" |
36 | 37 | VERSION="Local" |
37 | 38 | ;; |
| 39 | b) |
| 40 | ALL="FALSE" |
| 41 | B="TRUE" |
| 42 | ;; |
| 43 | k) |
| 44 | ALL="FALSE" |
| 45 | K="TRUE" |
| 46 | ;; |
| 47 | r) |
| 48 | ALL="FALSE" |
| 49 | R="TRUE" |
| 50 | ;; |
38 | 51 | *) |
39 | 52 | echo "\ |
40 | 53 | |
... | ... | |
60 | 73 | esac |
61 | 74 | done |
62 | 75 | |
| 76 | if [ "$ALL" == "TRUE" ]; then |
| 77 | B="TRUE" |
| 78 | K="TRUE" |
| 79 | R="TRUE" |
| 80 | fi |
| 81 | |
63 | 82 | # where the verbose output goes to |
64 | 83 | LOG_FILE="${WORKING_DIR}/log.txt" |
65 | 84 | |
... | ... | |
198 | 217 | fi |
199 | 218 | if [ "$R" == "TRUE" ]; then |
200 | 219 | log "erase nand rootfs partition..." |
201 | | usbboot -c "boot;nerase 16 1024 0 0" >> "${LOG_FILE}" 2>&1 |
| 220 | usbboot -c "nerase 16 1024 0 0" >> "${LOG_FILE}" 2>&1 |
202 | 221 | log "flashing rootfs..." |
203 | 222 | progress_prepare |
204 | 223 | while read ILINE |
... | ... | |
207 | 226 | progress_finish |
208 | 227 | test "${tmp}" && abort "error while flashing rootfs:\n${tmp}" |
209 | 228 | fi |
| 229 | |
| 230 | if [ "$ALL" == "TRUE" ]; then |
| 231 | log "reboot device..." |
| 232 | usbboot -c "reset" >> "${LOG_FILE}" 2>&1 |
| 233 | fi |
| 234 | |
210 | 235 | log "done" |
Download the corresponding diff file