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


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
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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"
Note: See TracChangeset for help on using the changeset viewer.