1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-11-23 23:16:16 +02:00

reflash_ben.sh, new option b k r, reboot device after reflash

This commit is contained in:
Xiangfu Liu 2011-03-02 11:46:28 +08:00
parent 0cd3169e25
commit 9ef5915d39

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
# version of me # version of me
__VERSION__="2011-11-20" __VERSION__="2011-03-02"
# use 'http' to download and flash images, use 'file' to flash images present in the <WORKING_DIR> # use 'http' to download and flash images, use 'file' to flash images present in the <WORKING_DIR>
PROTOCOL="http" PROTOCOL="http"
@ -20,11 +20,12 @@ KERNEL="openwrt-xburst-qi_lb60-uImage.bin"
ROOTFS="openwrt-xburst-qi_lb60-root.ubi" ROOTFS="openwrt-xburst-qi_lb60-root.ubi"
# options for reflash bootloader, kernel, rootfs # options for reflash bootloader, kernel, rootfs
B="TRUE" B="FALSE"
K="TRUE" K="FALSE"
R="TRUE" R="FALSE"
ALL="TRUE"
while getopts d:l:h OPTIONS while getopts d:l:hbkr OPTIONS
do do
case $OPTIONS in case $OPTIONS in
d) d)
@ -35,6 +36,18 @@ do
PROTOCOL="file" PROTOCOL="file"
VERSION="Local" VERSION="Local"
;; ;;
b)
ALL="FALSE"
B="TRUE"
;;
k)
ALL="FALSE"
K="TRUE"
;;
r)
ALL="FALSE"
R="TRUE"
;;
*) *)
echo "\ echo "\
@ -60,6 +73,12 @@ Please report bugs to developer@lists.qi-hardware.com"
esac esac
done done
if [ "$ALL" == "TRUE" ]; then
B="TRUE"
K="TRUE"
R="TRUE"
fi
# where the verbose output goes to # where the verbose output goes to
LOG_FILE="${WORKING_DIR}/log.txt" LOG_FILE="${WORKING_DIR}/log.txt"
@ -198,7 +217,7 @@ if [ "$K" == "TRUE" ]; then
fi fi
if [ "$R" == "TRUE" ]; then if [ "$R" == "TRUE" ]; then
log "erase nand rootfs partition..." log "erase nand rootfs partition..."
usbboot -c "boot;nerase 16 1024 0 0" >> "${LOG_FILE}" 2>&1 usbboot -c "nerase 16 1024 0 0" >> "${LOG_FILE}" 2>&1
log "flashing rootfs..." log "flashing rootfs..."
progress_prepare progress_prepare
while read ILINE while read ILINE
@ -207,4 +226,10 @@ if [ "$R" == "TRUE" ]; then
progress_finish progress_finish
test "${tmp}" && abort "error while flashing rootfs:\n${tmp}" test "${tmp}" && abort "error while flashing rootfs:\n${tmp}"
fi fi
if [ "$ALL" == "TRUE" ]; then
log "reboot device..."
usbboot -c "reset" >> "${LOG_FILE}" 2>&1
fi
log "done" log "done"