Changeset 346
- Timestamp:
- 07/03/09 12:12:59 (5 months ago)
- Files:
-
- trunk/software/rootfs/flash.sh (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/software/rootfs/flash.sh
r345 r346 1 1 #!/bin/sh 2 #3 # This script flashes the NAND parition for the root filesystem on the OSWALD4 # with a bzipped tarball of a root filesystem found on the second partition of5 # the inserted SD card in the root directory.6 2 7 # Exit if any command exits with a non-zero status 8 set -o errexit 9 10 trap errorhandler 0 1 2 3 15 11 12 errorhandler() { 13 echo -e "\n" 14 echo "WARNING: An error may have occurred while flashing" 15 echo "the NAND with the new root filesystem. The SD card" 16 echo "may be bad if the untarring process segfaulted or" 17 echo "the system might not have tar installed with bzip2" 18 echo "support if the process never started." 19 if [ -n "$(grep /media/nand /proc/mounts)" ] ; then 20 umount /media/nand 21 fi 22 exit 1 23 } 3 flash_eraseall /dev/mtd3 4 nandwrite -p /dev/mtd3 /media/mmcblk0p1/uImage 24 5 25 6 flash_eraseall -j /dev/mtd4 26 [ -d /media/nand ] ||mkdir /media/nand7 mkdir /media/nand 27 8 mount -t jffs2 /dev/mtdblock4 /media/nand 28 9 tar jxvf /media/mmcblk0p2/rootfs.tar.bz2 -C /media/nand 29 10 umount /media/nand 30 11 echo "default-on" > /sys/class/leds/oswaldboard\:\:usr/trigger 31 echo "SUCCESS: The device has been flashed with a new" 32 echo "root filesystem. The SD card should now be " 33 echo "removed before turning off the device." 12 halt
