Ignore:
Timestamp:
Apr 18, 2008, 3:14:36 PM (11 years ago)
Author:
bruno
Message:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.6/mindi/mindi

    r1927 r1928  
    293293        incoming=`ReadLine`
    294294    done
    295 }
    296 
    297 
    298 CopyImageToDisk() {
    299     local image dev procno res comment
    300     image=$1
    301     dev=$2
    302     comment=$3
    303     [ ! -f "$image" ] && [ ! -b "$image" ] && Die "Image $image does not exist. Did you run out of disk space?"
    304     Prompt "About to write $comment. Please press ENTER."
    305     echo -en "Formatting disk..."
    306     if which fdformat > /dev/null ; then
    307         fdformat -n $dev > /dev/null 2> /dev/null || Die "Cannot format $dev - is your Linux distro broken?"
    308     elif which superformat > /dev/null ; then
    309         superformat $dev > /dev/null 2> /dev/null || Die "Cannot format $dev - is your Linux distro broken?"
    310     else
    311         Die "Please install either fdformat or superformat."
    312     fi
    313     echo -en "\nWriting $comment"
    314     if echo $image | grep "mindi-[r|b]oot\.1440" &> /dev/null ; then
    315         cat $image > $dev &
    316     else
    317         dd if=$image of=$dev &> /dev/null &
    318     fi
    319     procno=$!
    320     ps $procno > /dev/null 2> /dev/null
    321     while [ "$?" -eq "0" ] ; do
    322         sleep 3
    323         echo -en "."
    324         ps $procno > /dev/null 2> /dev/null
    325     done
    326     echo -e "$DONE"
    327     LogIt "$comment has been written."
    328295}
    329296
Note: See TracChangeset for help on using the changeset viewer.