Index: /trunk/software/rootfs/flash.sh =================================================================== --- /trunk/software/rootfs/flash.sh (revision 345) +++ /trunk/software/rootfs/flash.sh (revision 346) @@ -1,33 +1,12 @@ #!/bin/sh -# -# This script flashes the NAND parition for the root filesystem on the OSWALD -# with a bzipped tarball of a root filesystem found on the second partition of -# the inserted SD card in the root directory. -# Exit if any command exits with a non-zero status -set -o errexit - -trap errorhandler 0 1 2 3 15 - -errorhandler() { - echo -e "\n" - echo "WARNING: An error may have occurred while flashing" - echo "the NAND with the new root filesystem. The SD card" - echo "may be bad if the untarring process segfaulted or" - echo "the system might not have tar installed with bzip2" - echo "support if the process never started." - if [ -n "$(grep /media/nand /proc/mounts)" ] ; then - umount /media/nand - fi - exit 1 -} +flash_eraseall /dev/mtd3 +nandwrite -p /dev/mtd3 /media/mmcblk0p1/uImage flash_eraseall -j /dev/mtd4 -[ -d /media/nand ] || mkdir /media/nand +mkdir /media/nand mount -t jffs2 /dev/mtdblock4 /media/nand tar jxvf /media/mmcblk0p2/rootfs.tar.bz2 -C /media/nand umount /media/nand echo "default-on" > /sys/class/leds/oswaldboard\:\:usr/trigger -echo "SUCCESS: The device has been flashed with a new" -echo "root filesystem. The SD card should now be " -echo "removed before turning off the device." +halt