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


Ignore:
Timestamp:
Mar 22, 2010, 1:56:46 PM (14 years ago)
Author:
Bruno Cornec
Message:

r3763@localhost: bruno | 2010-03-18 12:03:49 +0100

  • Fix CMDLINE variable initialization to do it after /proc is mounted
  • Fix backup-media-type handling in mondorestore (wrong test)
File:
1 edited

Legend:

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

    r2603 r2607  
    77
    88export MINDI_CACHE=CCC
    9 
    10 if [ -e "/proc/cmdline" ]; then
    11     export CMDLINE="/proc/cmdline"
    12 elif [ -e "/tmp/cmdline" ]; then
    13     export CMDLINE="/tmp/cmdline"
    14 else
    15     export CMDLINE="/dev/null"
    16 fi
    17 
    189
    1910
     
    721712#/bin/update
    722713mount /proc/ /proc -v -t proc
     714
     715# Now we can look at command line
     716if [ -e "/proc/cmdline" ]; then
     717    # Linux
     718    export CMDLINE="/proc/cmdline"
     719elif [ -e "/tmp/cmdline" ]; then
     720    # BSD ?
     721    export CMDLINE="/tmp/cmdline"
     722else
     723    export CMDLINE="/dev/null"
     724fi
     725
    723726mkdir /sys 2> /dev/null
    724727mount /sys/ /sys -v -t sysfs 2>> $LOGFILE
     
    891894
    892895fi
    893 if [ -f $MINDI_CACHE/mondorestore.cfg ] && [ grep "backup-media-type" $MINDI_CACHE/mondorestore.cfg > /dev/null 2> /dev/null ]; then
    894     LogIt "backup-media-type is specified in config file - great."
    895     LogIt "Calling post-init"
    896     # start-netfs moved it under /tmp as the NFS share is already unmounted
    897     if [ "`echo $pre | grep -E '^/tmp/isodir'`" ]; then
    898         pre=`echo $pre | sed 's|^/tmp/isodir|/tmp|'`
    899     fi
    900     if [ -x $pre ]; then
    901         echo "Executing preliminary script $pre"
    902         LogIt "Executing preliminary script $pre"
    903         $pre
    904     fi
    905     post-init
     896if [ -f $MINDI_CACHE/mondorestore.cfg ]; then
     897    grep -q "backup-media-type" $MINDI_CACHE/mondorestore.cfg
     898    if [ $? -eq 0 ]; then
     899        LogIt "backup-media-type is specified in config file - great."
     900        LogIt "Calling post-init"
     901        # start-netfs moved it under /tmp as the NFS share is already unmounted
     902        if [ "`echo $pre | grep -E '^/tmp/isodir'`" ]; then
     903            pre=`echo $pre | sed 's|^/tmp/isodir|/tmp|'`
     904        fi
     905        if [ -x $pre ]; then
     906            echo "Executing preliminary script $pre"
     907            LogIt "Executing preliminary script $pre"
     908            $pre
     909        fi
     910        post-init
     911    else
     912        LogIt "backup-media-type is not specified in config file."
     913        LogIt "I think this media has no archives on it."
     914    fi
    906915else
    907     LogIt "backup-media-type is not specified in config file."
     916    LogIt "$MINDI_CACHE/mondorestore.cfg not found."
    908917    LogIt "I think this media has no archives on it."
    909918fi
Note: See TracChangeset for help on using the changeset viewer.