Changeset c32c6e0 in freewrt


Ignore:
Timestamp:
Jun 14, 2007, 5:14:54 PM (18 years ago)
Author:
Thorsten Glaser <tg@…>
Children:
59aee88
Parents:
5ee7f4b2
Message:

make this actually useful (tested)

git-svn-id: svn://www.freewrt.org/trunk/freewrt@2806 afb5a338-a214-0410-bd46-81f09a774fd1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • scripts/flash.sh

    r5ee7f4b2 rc32c6e0  
    1414
    1515me=${0##*/}
     16wd=$(pwd)
    1617
    1718die() {
     
    112113        TF=$(mktemp /tmp/fwflash.XXXXXXXXXX) || die Cannot mktemp
    113114        TI=$(mktemp /tmp/fwflash.XXXXXXXXXX) || { rm $TF; die Cannot mktemp; }
    114         trap 'rm -f $TF $TI; exit 0' 0
    115         trap 'rm -f $TF $TI; exit 1' 1 2 3 5 13 15
     115        trap 'cd "$wd"; rm -f $TF $TI; exit 0' 0
     116        trap 'cd "$wd"; rm -f $TF $TI; exit 1' 1 2 3 5 13 15
    116117        randsrc=/dev/arandom
    117118        [[ -e $randsrc ]] || randsrc=/dev/urandom
     
    135136                [[ $p = fwcf.helper || -x $p ]] || die Cannot find fwcf.helper
    136137                # create fwcf filesystem image
    137                 $p -M "$paddir" >$TF || die Error creating fwcf filesystem image
     138                $p -M "$paddir" >$TI || die Error creating fwcf filesystem image
     139                dd if=$TI of=$TF conv=notrunc 2>&-
    138140                echo "TRX file constructed from '$imgfile' and FWCF from '$paddir'"
    139141        else
     
    153155sleep 3
    154156
     157imgdir=${imgfile%/*}
     158[[ $imgdir = $imgfile ]] && imgdir=.
     159imgfile=${imgfile##*/}
     160cd "$imgdir"
    155161case $flashtype in
    156162wl500g)
     
    175181        ;;
    176182esac
     183cd "$wd"
    177184cat <<-EOF
    178185        After flashing is finished and the device has rebooted, it will need
Note: See TracChangeset for help on using the changeset viewer.