1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2025-02-03 09:11:05 +02:00

as usbboot often exists with exit code 0 (success), even if an major error occured, we have to handle things differently...

test for output on stderr and if there is something, we assume an major error happened
This commit is contained in:
Mirko Vogt 2010-05-02 23:32:06 +02:00
parent 1c0e1e46e0
commit 76a779fbfa

View File

@ -154,16 +154,19 @@ usbboot -c "boot" > "${LOG_FILE}" || abort "can't boot device - xburst-tools set
if [ "$B" == "TRUE" ]; then if [ "$B" == "TRUE" ]; then
log "flashing bootloader..." log "flashing bootloader..."
usbboot -c "nprog 0 ${WORKING_DIR}/${LOADER} 0 0 -n" >> "${LOG_FILE}" tmp=$(usbboot -c "nprog 0 ${WORKING_DIR}/${LOADER} 0 0 -n" 3>> "${LOG_FILE}" 2>&1 >&3)
test "${tmp}" && abort "error while flashing bootloader:\n${tmp}"
fi fi
if [ "$K" == "TRUE" ]; then if [ "$K" == "TRUE" ]; then
log "flashing kernel..." log "flashing kernel..."
usbboot -c "nprog 1024 ${WORKING_DIR}/${KERNEL} 0 0 -n" >> "${LOG_FILE}" tmp=$(usbboot -c "nprog 1024 ${WORKING_DIR}/${KERNEL} 0 0 -n" 3>> "${LOG_FILE}" 2>&1 >&3)
test "${tmp}" && abort "error while flashing kernel:\n${tmp}"
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 512 0 0" >> "${LOG_FILE}" usbboot -c "boot;nerase 16 512 0 0" >> "${LOG_FILE}" 2>&1
log "flashing rootfs..." log "flashing rootfs..."
usbboot -c "nprog 2048 ${WORKING_DIR}/${ROOTFS} 0 0 -n" >> "${LOG_FILE}" tmp=$(usbboot -c "nprog 2048 ${WORKING_DIR}/${ROOTFS} 0 0 -n" 3>> "${LOG_FILE}" 2>&1 >&3)
test "${tmp}" && abort "error while flashing rootfs:\n${tmp}"
fi fi
log "done" log "done"