Changeset 1977 in MondoRescue for branches/stable/mindi/rootfs


Ignore:
Timestamp:
Jun 2, 2008, 10:49:01 AM (16 years ago)
Author:
Bruno Cornec
Message:

svn merge -r 1938:1976 $SVN_M/branches/2.2.6

Location:
branches/stable/mindi/rootfs
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mindi/rootfs/sbin/init

    r1939 r1977  
    105105    [ "$1" != "" ] && tapedev=$1
    106106    [ ! "$tapedev" ] && tapedev=`grep media-dev /tmp/mondo-restore.cfg | tr -s ' ' ' ' | cut -d' ' -f2`
    107 #    tar -zxf $tapedev
     107    mt -f $tapedev rewind
     108    mt -f $tapedev fsf 2
    108109    dd if=$tapedev bs=32k count=1024 | tar -zx
    109110    res=$?
    110111    if [ "$res" -eq "0" ] ; then
    111     grep -v media-dev /tmp/mondo-restore.cfg > /tmp/mr.cfg
    112     echo "media-dev=$tapedev" >> /tmp/mr.cfg
    113         cp -f /tmp/mr.cfg /tmp/mondo-restore.cfg
     112        # Store the dev name in case we changed it interactively
     113        sed -i "s/^media-dev .*$/media-dev  $tapedev/" /tmp/mondo-restore.cfg
     114
     115        #grep -v media-dev /tmp/mondo-restore.cfg > /tmp/mr.cfg
     116        #echo "media-dev $tapedev" >> /tmp/mr.cfg
     117        #cp -f /tmp/mr.cfg /tmp/mondo-restore.cfg
    114118    fi
    115119    cd $old_pwd
     
    120124    local res tapedev
    121125    tapedev="" ; # will be set by UntarTapeStuff()
     126
     127    # Here we can add the USB storage module, it's working even with OBDR !
     128    modprobe -q usb-storage
     129    # Tape takes some time to appear
     130    sleep 10
    122131    cd $GROOVY
    123     UntarTapeStuff $tapedev || UntarTapeStuff /dev/st0 || UntarTapeStuff /dev/osst0 || UntarTapeStuff /dev/ht0
     132    UntarTapeStuff $tapedev
    124133    res=$?
    125134    while [ "$res" -ne "0" ] ; do
     
    139148        fi
    140149    done
     150    # For post-init
     151    export TAPEDEV=$tapedev
    141152
    142153    if [ "$res" -ne "0" ] ; then
     
    146157        res=$?
    147158    else
    148     #   clear
    149159        LogIt "Using tape as extended datadisk. Good." 3
    150160        echo "Using tape as extd ddisk." > /tmp/TAPEDEV-HAS-DATA-DISKS
     
    584594    export DENY_MODS=" "
    585595fi
    586 
     596if [ "`grep -i 'obdr ' /tmp/mondo-restore.cfg`" ]; then
     597    # Do not try to load usb storage when dealing with OBDR it makes the modprobe hang :-(
     598    export DENY_MODS="usb-storage $DENY_MODS"
     599fi
    587600if [ "`grep -i forcemods /proc/cmdline`" ]; then
    588601    export FORCE_MODS="`cat /proc/cmdline | sed 's~.*forcemods=\"\(.*\)\".*~\1~'` mondonone"
     
    623636fi
    624637
    625 if [ "`grep -i 'tape ' /tmp/mondo-restore.cfg`" ] || [ "`grep -i udev /tmp/mondo-restore.cfg`" ]; then
     638if [ "`grep -i 'obdr ' /tmp/mondo-restore.cfg`" ] || [ "`grep -i ' udev' /tmp/mondo-restore.cfg`" ]; then
    626639    HandleTape
    627640    ExtractDataDisksAndLoadModules
     
    635648    ExtractDataDisksAndLoadModules
    636649elif [ "`grep -i usb= /proc/cmdline`" ] || [ "`grep -i usb /tmp/mondo-restore.cfg | grep media-type`" ]; then
    637     # We need to get here exported variables from start-nfs
    638650    . /sbin/start-usb
    639651
  • branches/stable/mindi/rootfs/sbin/post-init

    r1621 r1977  
    104104done
    105105
     106mondoopt=""
     107if [ "`grep -i 'obdr ' /tmp/mondo-restore.cfg`" ]; then
     108    mondoopt="$mondoopt -o -d $TAPEDEV"
     109fi
     110
     111if [ "`grep -i 'debug' /proc/cmdline`" ]; then
     112    mondoopt="$mondoopt -K 99"
     113fi
     114
    106115if [ "$compare" ] ; then
    107116    LogIt "------------------COMPARE MODE-----------------" 1
    108     mondorestore --compare
     117    mondorestore $mondoopt -Z compare
    109118elif [ "$nuke" ] ; then
    110119    LogIt "-------------------NUKE MODE-------------------" 1
    111     mondorestore --nuke
     120    mondorestore $mondoopt -Z nuke
    112121elif [ "$expert" ] ; then
    113122    if [ "`grep tapedev /tmp/mondo-restore.cfg`" ] ; then
     
    119128        LogIt "Tape Mode -- calling mondorestore..."
    120129            if [ "$nuke" ] ; then
    121                 mondorestore --nuke
     130                mondorestore $mondoopt -Z nuke
    122131            else
    123                 mondorestore; # MR will detect & access the tape
     132                mondorestore $mondoopt; # MR will detect & access the tape
    124133            fi
    125134    fi
     
    132141            LogIt "Cdstream Mode -- calling mondorestore..."
    133142            if [ "$nuke" ] ; then
    134                 mondorestore --nuke
     143                mondorestore -Z nuke $mondoopt
    135144            else
    136                 mondorestore; # MR will detect & access the cdstream
     145                mondorestore $mondoopt; # MR will detect & access the cdstream
    137146            fi
    138147        fi
     
    147156else
    148157    LogIt "------------------INTERACTIVE------------------" 1
    149     mondorestore --interactive
     158    mondorestore -Z interactive $mondoopt
    150159fi
    151160
    152 [ -e "/tmp/DO-MBR-PLEASE" ] && LogIt "PLEASE RUN 'mondorestore --mbr' NOW TO INITIALIZE YOUR BOOT SECTOR." 1
     161[ -e "/tmp/DO-MBR-PLEASE" ] && LogIt "PLEASE RUN 'mondorestore -Z mbr' NOW TO INITIALIZE YOUR BOOT SECTOR." 1
    153162
    154163exit 0
Note: See TracChangeset for help on using the changeset viewer.