Changeset 3203 in MondoRescue for branches/3.2/mindi/rootfs


Ignore:
Timestamp:
Dec 6, 2013, 3:40:40 PM (10 years ago)
Author:
Bruno Cornec
Message:
  • Test /tmp/mountlist.txt existence before using it in mindi, as mindi can be use in standalone mode without mondoarchive creating that file
Location:
branches/3.2/mindi/rootfs
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/mindi/rootfs/etc/init.d/rcS

    r3200 r3203  
    511511                for l in $EXCLUDE_LVS; do
    512512                    # FIXME: Should search for all possible device names here
    513                     grep -Ev "/dev/$v/$l" /tmp/mountlist.txt > /tmp/mountlist.txt.new
    514                     grep -Ev "/dev/mapper/${v}-$l" /tmp/mountlist.txt.new > /tmp/mountlist.txt
     513                    if [ -f "/tmp/mountlist.txt" ]; then
     514                        grep -Ev "/dev/$v/$l" /tmp/mountlist.txt > /tmp/mountlist.txt.new
     515                        grep -Ev "/dev/mapper/${v}-$l" /tmp/mountlist.txt.new > /tmp/mountlist.txt
     516                    fi
    515517                done
    516518            done
     
    577579        return;
    578580    fi
    579     if [ "`grep mpath /tmp/mountlist.txt`" ]; then
     581    if [ -f "/tmp/mountlist.txt" ] && [ "`grep mpath /tmp/mountlist.txt`" ]; then
    580582        if [ -x /sbin/multipath ]; then
    581583            echo "Starting Mpath..."
     
    602604    fi
    603605
    604     raid_devices=`grep /dev/md /tmp/mountlist.txt | cut -d' ' -f1`
     606    if [ -f "/tmp/mountlist.txt" ]; then
     607        raid_devices=`grep /dev/md /tmp/mountlist.txt | cut -d' ' -f1`
     608    else
     609        raid_devices=""
     610    fi
     611
    605612    if which raidstart > /dev/null 2> /dev/null ; then
    606613        for i in $raid_devices ; do
     
    879886    for d in $MINDI_EXCLUDE_DEVS ; do
    880887        echo "Mountlist exclusion == $d"
    881         perl -i -ne 'print $_ unless m~$d~' /tmp/mountlist.txt
     888        if [ -e "/tmp/mountlist.txt" ]; then
     889            perl -i -ne 'print $_ unless m~$d~' /tmp/mountlist.txt
     890        fi
    882891    done
    883892else
     
    965974sleep 2
    966975#clear
    967 if [ -e "/dev/md0" ] && [ ! -e "/dev/md/0" ] && [ "`grep /dev/md/ /tmp/mountlist.txt`" != "" ] ; then
     976if [ -e "/dev/md0" ] && [ ! -e "/dev/md/0" ] && [ -e "/tmp/mountlist.txt" ] && [ "`grep /dev/md/ /tmp/mountlist.txt`" != "" ] ; then
    968977    LogIt "Creating /dev/md/* softlinks just in case." 1
    969978    mkdir -p /dev/md
  • branches/3.2/mindi/rootfs/sbin/post-init

    r2915 r3203  
    88sleep 1
    99
    10 echo "Here is my /tmp/mountlist.txt" >> $LOGFILE
    11 cat /tmp/mountlist.txt >> $LOGFILE
     10if [ -f "/tmp/mountlist.txt" ]; then
     11    echo "Here is my /tmp/mountlist.txt" >> $LOGFILE
     12    cat /tmp/mountlist.txt >> $LOGFILE
     13fi
    1214
    1315iso=`grep iso /proc/cmdline`
Note: See TracChangeset for help on using the changeset viewer.