Date:2010-05-02 23:32:06 (3 years 11 months ago)
Author:Mirko Vogt
Commit:76a779fbfa3f5a1e688364a8f4ff29be6640ff64
Message: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
Files: scripts/reflash_ben.sh (1 diff)

Change Details

scripts/reflash_ben.sh
154154
155155if [ "$B" == "TRUE" ]; then
156156    log "flashing bootloader..."
157    usbboot -c "nprog 0 ${WORKING_DIR}/${LOADER} 0 0 -n" >> "${LOG_FILE}"
157    tmp=$(usbboot -c "nprog 0 ${WORKING_DIR}/${LOADER} 0 0 -n" 3>> "${LOG_FILE}" 2>&1 >&3)
158    test "${tmp}" && abort "error while flashing bootloader:\n${tmp}"
158159fi
159160if [ "$K" == "TRUE" ]; then
160161    log "flashing kernel..."
161    usbboot -c "nprog 1024 ${WORKING_DIR}/${KERNEL} 0 0 -n" >> "${LOG_FILE}"
162    tmp=$(usbboot -c "nprog 1024 ${WORKING_DIR}/${KERNEL} 0 0 -n" 3>> "${LOG_FILE}" 2>&1 >&3)
163    test "${tmp}" && abort "error while flashing kernel:\n${tmp}"
162164fi
163165if [ "$R" == "TRUE" ]; then
164166    log "erase nand rootfs partition..."
165    usbboot -c "boot;nerase 16 512 0 0" >> "${LOG_FILE}"
167    usbboot -c "boot;nerase 16 512 0 0" >> "${LOG_FILE}" 2>&1
166168    log "flashing rootfs..."
167    usbboot -c "nprog 2048 ${WORKING_DIR}/${ROOTFS} 0 0 -n" >> "${LOG_FILE}"
169    tmp=$(usbboot -c "nprog 2048 ${WORKING_DIR}/${ROOTFS} 0 0 -n" 3>> "${LOG_FILE}" 2>&1 >&3)
170    test "${tmp}" && abort "error while flashing rootfs:\n${tmp}"
168171fi
169172log "done"

Archive Download the corresponding diff file



interactive