Changeset 2462 in MondoRescue for branches/2.2.10/mindi/rootfs/sbin


Ignore:
Timestamp:
Oct 20, 2009, 4:07:00 PM (15 years ago)
Author:
Bruno Cornec
Message:

r3548@localhost: bruno | 2009-10-16 19:18:27 +0200

  • mindi now boots in a QEMU VM without busybox
  • mindi is now noarch as a consequence
  • MINDI_LIB becomes MINDI_DATA for coherency and as a consequence
  • CACHEDIR becomes MINDI_CACHE for coherency and it's a build parameter and not hardcoded anymore in mindi
  • THat variable is also used at restore time for mondorestore.cfg e.g.
  • FAILSAFE kernel is gone. Just use another kernel of your choice. Most std kernels work anyway
  • TurnTgzIntoRdz rewritten and now really computes data disk size and not suppose its size
  • Interface mondo/mindi changed again => incompatible
  • Non-bootable media not supported anymore.
  • Mondorescue adapted to these changes but not tested yet
  • Doc updated as well
Location:
branches/2.2.10/mindi/rootfs/sbin
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.10/mindi/rootfs/sbin/find-and-mount-cdrom

    r2445 r2462  
    77    for device in /dev/hd? /dev/scd? /dev/rcd? /dev/sr? /dev/cd? /dev/ide/*/*/*/*/cd /dev/scsi/*/*/*/*/cd; do
    88        [ ! "$SECOND_TRY" ] && LogIt "Trying $device"
    9         if [ "`grep "using-cdstream yes" /tmp/mondo-restore.cfg 2> /dev/null`" ]; then
     9        if [ "`grep "using-cdstream yes" $MINDI_CACHE/mondorestore.cfg 2> /dev/null`" ]; then
    1010            pwd=`pwd`
    1111            cd $GROOVY
     
    7575fi
    7676[ "$1" = "--second-try" ] && exit 1;
    77 if [ "`grep "using-cdstream yes" /tmp/mondo-restore.cfg 2 > /dev/null`" ] ; then
     77if [ "`grep "using-cdstream yes" $MINDI_CACHE/mondorestore.cfg 2 > /dev/null`" ] ; then
    7878    LogIt "Because you are using cdstream, I won't try to mount CD."
    7979    exit 0
  • branches/2.2.10/mindi/rootfs/sbin/hack-cfg-if-necessary

    r1983 r2462  
    1616LogIt "OK, we've found /mnt/cdrom/archives/*; great."
    1717
    18 if ! grep "backup-media-type iso" /tmp/mondo-restore.cfg 2 > /dev/null ; then
     18if ! grep "backup-media-type iso" $MINDI_CACHE/mondorestore.cfg 2 > /dev/null ; then
    1919    LogIt "Config file is fine, BTW."
    2020    exit 0
    2121fi
    2222
    23 LogIt "Re-jigging mondo-restore.cfg because you backed up to ISOs and then burned them to CDs" 1
    24 sed -i 's/backup-media-type iso/backup-media-type cdr/' /tmp/mondo-restore.cfg
     23LogIt "Re-jigging mondorestore.cfg because you backed up to ISOs and then burned them to CDs" 1
     24sed -i 's/backup-media-type iso/backup-media-type cdr/' $MINDI_CACHE/mondorestore.cfg
    2525LogIt "Done re-jigging. Yay."
    2626exit 0
  • branches/2.2.10/mindi/rootfs/sbin/init

    r2445 r2462  
    55# init script launched during the restore process
    66#------------------------------------------------------------
     7
     8export MINDI_CACHE=CCC
    79
    810if [ -e "/proc/cmdline" ]; then
     
    117119    cd $GROOVY
    118120    [ "$1" != "" ] && tapedev=$1
    119     [ ! "$tapedev" ] && tapedev=`grep media-dev /tmp/mondo-restore.cfg 2>/dev/null | tr -s ' ' ' ' | cut -d' ' -f2`
     121    [ ! "$tapedev" ] && tapedev=`grep media-dev $MINDI_CACHE/mondorestore.cfg 2>/dev/null | tr -s ' ' ' ' | cut -d' ' -f2`
    120122    mt -f $tapedev rewind
    121123    mt -f $tapedev fsf 2
     
    124126    if [ "$res" -eq "0" ] ; then
    125127        # Store the dev name in case we changed it interactively
    126         if [ -f "/tmp/mondo-restore.cfg" ]; then
    127             sed -i "s/^media-dev .*$/media-dev  $tapedev/" /tmp/mondo-restore.cfg
     128        if [ -f "$MINDI_CACHE/mondorestore.cfg" ]; then
     129            sed -i "s/^media-dev .*$/media-dev  $tapedev/" $MINDI_CACHE/mondorestore.cfg
    128130        fi
    129131    fi
     
    340342        return
    341343    fi
    342     if [ -x ./mindi-rsthw ]; then
     344    if [ -x $MINDI_CACHE/mindi-rsthw ]; then
    343345        grep -q RESTORE $CMDLINE
    344346        if [ "$?" -ne 0 ]; then
     
    354356        fi
    355357        if [ "$answer" = "YES" ] ; then
    356             ./mindi-rsthw
     358            $MINDI_CACHE/mindi-rsthw
    357359        fi
    358360    fi
     
    454456        return;
    455457    fi
    456     if [ "`grep mpath /tmp/mountlist.txt`" ]; then
     458    if [ "`grep mpath $MINDI_CACHE/mountlist.txt`" ]; then
    457459        if [ -x /sbin/multipath ]; then
    458460            echo "Starting Mpath..."
     
    478480    fi
    479481
    480     raid_devices=`grep /dev/md /tmp/mountlist.txt | cut -d' ' -f1`
     482    raid_devices=`grep /dev/md $MINDI_CACHE/mountlist.txt | cut -d' ' -f1`
    481483    if which raidstart > /dev/null 2> /dev/null ; then
    482484        for i in $raid_devices ; do
     
    537539    local res
    538540    mount | grep /mnt/cdrom && return 0
    539     [ "`grep "backup_media_type" /tmp/mondo-restore.cfg 2> /dev/null | grep "cdstream"`" ] && return
     541    [ "`grep "backup_media_type" $MINDI_CACHE/mondorestore.cfg 2> /dev/null | grep "cdstream"`" ] && return
    540542    LogIt "Trying to mount CD-ROM a 2nd time..."
    541543    find-and-mount-cdrom --second-try
     
    641643    # Retry failed udev events now that local filesystems are mounted read-write
    642644    # (useful for rules creating network ifcfg files)
    643     if [ -e "/tmp/USE-UDEV" ] ; then
     645    if [ -e "$MINDI_CACHE/USE-UDEV" ] ; then
    644646        if [ -x /sbin/udevadm ]; then
    645647            /sbin/udevadm trigger --retry-failed
     
    681683    export DENY_MODS=" "
    682684fi
    683 if [ "`grep -i 'obdr ' /tmp/mondo-restore.cfg 2> /dev/null`" ]; then
     685if [ "`grep -i 'obdr ' $MINDI_CACHE/mondorestore.cfg 2> /dev/null`" ]; then
    684686    # Do not try to load usb storage when dealing with OBDR it makes the modprobe hang :-(
    685687    export DENY_MODS="usb-storage $DENY_MODS"
     
    702704fi
    703705
    704 if [ -e "/tmp/USE-UDEV" ] ; then
     706if [ -e "$MINDI_CACHE/USE-UDEV" ] ; then
    705707    RunUdevd
    706708fi
     
    719721#-------------------------------
    720722UseTmpfs
    721 if [ ! -e "/tmp/mondo-restore.cfg" ] ; then
    722     LogIt "Warning - /tmp/mondo-restore.cfg not found"
     723if [ ! -e "$MINDI_CACHE/mondorestore.cfg" ] ; then
     724    LogIt "Warning - $MINDI_CACHE/mondorestore.cfg not found"
    723725fi
    724726if [ "`grep -i pxe $CMDLINE`" ] || [ "`grep -i net $CMDLINE`" ]; then
     
    727729fi
    728730
    729 if [ "`grep -i 'obdr ' /tmp/mondo-restore.cfg 2>/dev/null`" ] || [ "`grep -i ' udev' /tmp/mondo-restore.cfg 2>/dev/null`" ]; then
     731if [ "`grep -i 'obdr ' $MINDI_CACHE/mondorestore.cfg 2>/dev/null`" ] || [ "`grep -i ' udev' $MINDI_CACHE/mondorestore.cfg 2>/dev/null`" ]; then
    730732    HandleTape
    731733    ExtractDataDisksAndLoadModules
     
    736738    ExtractDataDisksAndLoadModules
    737739    # Fake the conf file to force it to NFS mode, even if we made originally a CD (mandatory for mondorestore to work correctly)
    738     sed -i "s/backup-media-type.*/backup-media-type netfs/" /tmp/mondo-restore.cfg
    739 elif [ "`grep -i usb= $CMDLINE`" ] || [ "`grep -i usb /tmp/mondo-restore.cfg 2>/dev/null | grep media-type`" ]; then
     740    sed -i "s/backup-media-type.*/backup-media-type netfs/" $MINDI_CACHE/mondorestore.cfg
     741elif [ "`grep -i usb= $CMDLINE`" ] || [ "`grep -i usb $MINDI_CACHE/mondorestore.cfg 2>/dev/null | grep media-type`" ]; then
    740742    . /sbin/start-usb
    741743
     
    752754res=$?
    753755ConfigureLoggingDaemons
    754 if [ -e "/tmp/USE-DEVFS" ] ; then
     756if [ -e "$MINDI_CACHE/USE-DEVFS" ] ; then
    755757    umount /mnt/cdrom 2> /dev/null
    756758    mv /dev/cdrom /cdrom.lnk 2> /dev/null
     
    769771mkdir -p /tmp/tmpfs
    770772sleep 2
    771 if [ -e "/dev/md0" ] && [ ! -e "/dev/md/0" ] && [ "`grep /dev/md/ /tmp/mountlist.txt`" != "" ] ; then
     773if [ -e "/dev/md0" ] && [ ! -e "/dev/md/0" ] && [ "`grep /dev/md/ $MINDI_CACHE/mountlist.txt`" != "" ] ; then
    772774    LogIt "Creating /dev/md/* softlinks just in case." 1
    773775    mkdir -p /dev/md
     
    776778    cp -af /dev/md2 /dev/md/2 2> /dev/null
    777779fi
    778 [ -e "/tmp/mountlist.txt" ] && cp -f /tmp/mountlist.txt /tmp/mountlist.original
     780[ -e "$MINDI_CACHE/mountlist.txt" ] && cp -f $MINDI_CACHE/mountlist.txt $MINDI_CACHE/mountlist.original
    779781
    780782if ! [ "`grep -i "pxe" $CMDLINE`" ] ; then
     
    843845    fi
    844846fi
    845 if grep "backup-media-type" /tmp/mondo-restore.cfg > /dev/null 2> /dev/null ; then
     847if grep "backup-media-type" $MINDI_CACHE/mondorestore.cfg > /dev/null 2> /dev/null ; then
    846848    LogIt "backup-media-type is specified in config file - great."
    847849    LogIt "Calling post-init"
  • branches/2.2.10/mindi/rootfs/sbin/post-init

    r2378 r2462  
    77sleep 1
    88
    9 echo "Here is my /tmp/mountlist.txt" >> $LOGFILE
    10 cat /tmp/mountlist.txt >> $LOGFILE
     9echo "Here is my $MINDI_CACHE/mountlist.txt" >> $LOGFILE
     10cat $MINDI_CACHE/mountlist.txt >> $LOGFILE
     11echo "-----------------------------------" >> $LOGFILE
     12
    1113
    1214iso=`grep iso $CMDLINE`
     
    4547
    4648mondoopt=""
    47 if [ "`grep -i 'obdr ' /tmp/mondo-restore.cfg 2> /dev/null`" ]; then
     49if [ "`grep -i 'obdr ' $MINDI_CACHE/mondorestore.cfg 2> /dev/null`" ]; then
    4850    mondoopt="$mondoopt -o -d $TAPEDEV"
    4951fi
     
    6062    mondorestore $mondoopt -Z nuke
    6163elif [ "$expert" ] ; then
    62     if [ "`grep tapedev /tmp/mondo-restore.cfg 2> /dev/null`" ] ; then
     64    if [ "`grep tapedev $MINDI_CACHE/mondorestore.cfg 2> /dev/null`" ] ; then
    6365    LogIt "-------------------TAPE MODE-------------------" 1
    6466    loc=`which mondorestore 2> /dev/null`
     
    7375            fi
    7476    fi
    75     elif [ "`grep using-cdstream /tmp/mondo-restore.cfg 2> /dev/null`" ] ; then
     77    elif [ "`grep using-cdstream $MINDI_CACHE/mondorestore.cfg 2> /dev/null`" ] ; then
    7678        LogIt "------------------CDSTREAM MODE------------------" 1
    7779        loc=`which mondorestore 2> /dev/null`
  • branches/2.2.10/mindi/rootfs/sbin/start-netfs

    r2444 r2462  
    1111
    1212# Get info from config file
    13 ipdev=`grep netfs-dev /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-`
    14 ipaddress=`grep netfs-client-ipaddr /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-`
    15 ipnetmask=`grep netfs-client-netmask /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-`
    16 ipbroadcast=`grep netfs-client-broadcast /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-`
    17 ipgateway=`grep netfs-client-defgw /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-`
    18 proto=`grep netfs-proto /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-`
     13ipdev=`grep netfs-dev $MINDI_CACHE/mondorestore.cfg 2> /dev/null | cut -d' ' -f2-`
     14ipaddress=`grep netfs-client-ipaddr $MINDI_CACHE/mondorestore.cfg 2> /dev/null | cut -d' ' -f2-`
     15ipnetmask=`grep netfs-client-netmask $MINDI_CACHE/mondorestore.cfg 2> /dev/null | cut -d' ' -f2-`
     16ipbroadcast=`grep netfs-client-broadcast $MINDI_CACHE/mondorestore.cfg 2> /dev/null | cut -d' ' -f2-`
     17ipgateway=`grep netfs-client-defgw $MINDI_CACHE/mondorestore.cfg 2> /dev/null | cut -d' ' -f2-`
     18proto=`grep netfs-proto $MINDI_CACHE/mondorestore.cfg 2> /dev/null | cut -d' ' -f2-`
    1919ipconf=""
    2020pre=""
    2121post=""
    22 export netfsmount=`grep netfs-server-mount /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-`
    23 export imgname=`grep iso-prefix /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-`
     22export netfsmount=`grep netfs-server-mount $MINDI_CACHE/mondorestore.cfg 2> /dev/null | cut -d' ' -f2-`
     23export imgname=`grep iso-prefix $MINDI_CACHE/mondorestore.cfg 2> /dev/null | cut -d' ' -f2-`
    2424if [ "$imgname" = "" ]; then
    2525    export imgname="mondorescue"
    2626fi
    27 export dirimg=`grep netfs-server-path /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-`
     27export dirimg=`grep netfs-server-path $MINDI_CACHE/mondorestore.cfg 2> /dev/null | cut -d' ' -f2-`
    2828if [ "$dirimg" = "" ]; then
    2929    export dirimg="/"
  • branches/2.2.10/mindi/rootfs/sbin/start-usb

    r2329 r2462  
    77
    88# Get info from config file
    9 MRUSBDEV=`grep usb-dev /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-`
     9MRUSBDEV=`grep usb-dev $MINDI_CACHE/mondorestore.cfg 2> /dev/null | cut -d' ' -f2-`
    1010
    1111# info from cmdline are predominent
Note: See TracChangeset for help on using the changeset viewer.