Changeset 346

Show
Ignore:
Timestamp:
07/03/09 12:12:59 (5 months ago)
Author:
hardert
Message:

Revert to the old flash script for now since the new one interacts
poorly with the auto-flashing script

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/software/rootfs/flash.sh

    r345 r346  
    11#!/bin/sh 
    2 # 
    3 # This script flashes the NAND parition for the root filesystem on the OSWALD 
    4 # with a bzipped tarball of a root filesystem found on the second partition of 
    5 # the inserted SD card in the root directory. 
    62 
    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 
     3flash_eraseall /dev/mtd3 
     4nandwrite -p /dev/mtd3 /media/mmcblk0p1/uImage 
    245 
    256flash_eraseall -j /dev/mtd4 
    26 [ -d /media/nand ] || mkdir /media/nand 
     7mkdir /media/nand 
    278mount -t jffs2 /dev/mtdblock4 /media/nand 
    289tar jxvf /media/mmcblk0p2/rootfs.tar.bz2 -C /media/nand 
    2910umount /media/nand 
    3011echo "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." 
     12halt