Changeset 3724

Show
Ignore:
Timestamp:
04/07/08 10:32:19 (8 months ago)
Author:
tg
Message:

new option -s, to be used together with -F:
do *not* write empty FWCF filesystem (131072 bytes),
just invalidate its signature magic (1 byte)

to work around bootloader issues

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/freewrt/scripts/flash.sh

    r3644 r3724  
    5959tftp=tftp 
    6060typeset -i nflag=0 
     61typeset -i sflag=0 
    6162typeset -i xflag=0 
    6263 
    63 while getopts ":c:D:Ff:nt:x" ch; do 
     64while getopts ":c:D:Ff:nst:x" ch; do 
    6465        case $ch in 
    6566        (c)     tftp=$OPTARG 
     
    7980                ;; 
    8081        (n)     nflag=1 
     82                ;; 
     83        (s)     sflag=1 
    8184                ;; 
    8285        (t)     imgtype=$OPTARG 
     
    194197        dd if=/dev/zero of=$TI bs=$padsize count=1 2>&- 
    195198        dd if="$imgfile" of=$TI conv=notrunc 2>&- 
    196         cat $TF >>$TI 
     199        if (( sflag )); then 
     200                [[ -n $padfile || -n $paddir ]] && die Cannot use -s without -F 
     201                printf '!' >>$TI 
     202        else 
     203                cat $TF >>$TI 
     204        fi 
    197205        imgfile=$TI 
    198206else