Changeset 764 in MondoRescue for trunk/mindi


Ignore:
Timestamp:
Aug 8, 2006, 12:34:37 AM (18 years ago)
Author:
Bruno Cornec
Message:

merge -r728:763 $SVN_M/branches/stable

Location:
trunk/mindi
Files:
11 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/mindi/ChangeLog

    r687 r764  
    33MINDI CHANGES
    44
    5 1.0.9 (2006-06-26)
     51.0.9 (2006-08-05)
     6- Fix for bug #22 RHEL4 + LVM + LABEL support (Bruno Cornec)
     7- Fix for bug #8 keyboard support incorrect (Bruno Cornec)
     8- New NFS/PXE support. start-nfs is now a fixed script. Allow more possibilities at restore time (Bruno Cornec)
     9- new global variables + Bug fixes for LVM (Bruno Cornec)
     10- SuSE RPMS now use bzip2 (Lars Rupp/Bruno Cornec)
     11- Fix a bug for filesystems with LABEL in fstab not mounted (Bruno Cornec)
     12- Qlogic 2300 and 2200 are now supported (Bruno Cornec)
     13- Use busybox 1.1.3 for net part (Bruno Cornec)
     14- Fix various screen corruption for 'Configure LVM' (Andree Leidenfrost)
     15- Fix Adaptec Zero-Channel RAID Cards support bug #6455 (Bruno Cornec)
     16- Fix a bug with redhat_label not initialized in the loop systematically
     17(Anthony P. Machon/Bruno Cornec)
    618- nfsmount option added to allow redeployment from another NFS server (Bruno Cornec)
    719- Replaced all occurrences of egrep with 'grep -E' and of fgrep with 'grep -F' (Andree Leidenfrost)
  • trunk/mindi/README

    r270 r764  
    2828
    2929You can get the latest packages from
    30 http://developer.berlios.de/project/showfiles.php?group_id=2524.
     30ftp://ftp.mondorescue.org
    3131
    3232Please see file 'INSTALL' for instructions about how to build and install
     
    5050
    5151Apart from the above-mentioned documentation, there is a Wiki with growing
    52 contents at the following URL: http://developer.berlios.de/wiki/?group_id=2524.
     52contents at the following URL: http://www.mondorescue.org/cgi-bin/trac.cgi/wiki
    5353
    5454Also, there is a mailing list mondo-devel@lists.sourceforge.net. Please go to
  • trunk/mindi/analyze-my-lvm

    r729 r764  
    169169
    170170ListLvmDrivesAndPartitions() {
    171     $LVMCMD vgdisplay -v |grep "PV Name" | sed 's/(#)//' | awk '{print $3}'
     171    $LVMCMD vgdisplay -v 2> /dev/null |grep "PV Name" | sed 's/(#)//' | awk '{print $3}'
    172172}
    173173
  • trunk/mindi/distributions/gentoo/mindi.ebuild

    r588 r764  
    77DESCRIPTION="A program that creates emergency boot disks/CDs using your kernel, tools and modules."
    88HOMEPAGE="http://www.mondorescue.org"
    9 SRC_URI="ftp://ftp.mondorescue.org/src/${PVR}.tar.gz"
     9SRC_URI="ftp://ftp.mondorescue.org/src/${P}.tar.gz"
    1010
    1111LICENSE="GPL-2"
     
    3030    export DONT_RELINK=1
    3131    export RPMBUILDMINDI="true"
    32     ./install.sh
     32    ${WORKDIR}/${P}/install.sh
    3333}
    3434
  • trunk/mindi/distributions/mandriva/spec.m4

    r729 r764  
    22dnl
    33dnl SSS is replaced by the source package format
    4 define(`SSS', `ftp://ftp.mondorescue.org/src/%{name}-%{version}-TTT.tar.bz2')dnl
     4define(`SSS', `ftp://ftp.mondorescue.org/src/%{name}-%{version}.tar.bz2')dnl
    55dnl DDD is replaced by the list of dependencies specific to that distro
    66define(`DDD', `, which, grep >= 2.5')dnl
  • trunk/mindi/distributions/redhat/spec.m4

    r729 r764  
    22dnl
    33dnl SSS is replaced by the source package format
    4 define(`SSS', `ftp://ftp.mondorescue.org/src/%{name}-%{version}-TTT.tar.gz')dnl
     4define(`SSS', `ftp://ftp.mondorescue.org/src/%{name}-%{version}.tar.gz')dnl
    55dnl DDD is replaced by the list of dependencies specific to that distro
    66define(`DDD', `, which, grep >= 2.5')dnl
  • trunk/mindi/distributions/suse/spec.m4

    r729 r764  
    22dnl
    33dnl SSS is replaced by the source package format
    4 define(`SSS', `ftp://ftp.mondorescue.org/src/%{name}-%{version}-TTT.tar.bz2')dnl
     4define(`SSS', `ftp://ftp.mondorescue.org/src/%{name}-%{version}.tar.bz2')dnl
    55dnl DDD is replaced by the list of dependencies specific to that distro
    66define(`DDD', `, syslinux')dnl
  • trunk/mindi/mindi

    r729 r764  
    284284    [ "$KBDEPTH" -gt "128" ] && Die "Edit $MINDI_SBIN/mindi and disable FindAndAddUserKeyboardMappingFile (line 2160, approx.)"
    285285    if [ -e "$bigdir/$mappath" ] ; then
    286     echo "$mappath already added" >> $LOGFILE
    287     return
     286        echo "$mappath already added" >> $LOGFILE
     287        return
    288288    elif [ -d "$bigdir/$mappath" ] ; then
    289289        echo "Cannot add $mappath: it's a directory. Sorry."
     
    298298        fi
    299299    else
    300     echo -en "`basename $mappath | tr '.' '#' | sed s/#kmap#gz// | sed s/#inc#gz//` " | tr '#' '.'
     300        echo -en "`basename $mappath | tr '.' '#' | sed s/#kmap#gz// | sed s/#inc#gz//` " | tr '#' '.'
    301301    fi
    302302
     
    610610    [ ! -e "$KEYDIR" ] && KEYDIR=/usr/share
    611611    if [ ! -e "$KEYDIR" ] ; then
    612     LogIt "Keyboard mapping directory not found. I shall use default map at boot-time.\n"
    613     return 0
     612        LogIt "Keyboard mapping directory not found. I shall use default map at boot-time.\n"
     613        return 0
    614614    fi
    615615    if [ -e "/etc/sysconfig/keyboard" ] ; then
    616     echo "Red Hat-style config detected." >> $LOGFILE
    617     keyfile=/etc/sysconfig/keyboard
     616        echo "Red Hat-style config detected." >> $LOGFILE
     617        keyfile=/etc/sysconfig/keyboard
    618618    elif [ -e "/etc/rc.d/rc.keymap" ] ; then
    619     echo "Slackware-style config detected." >> $LOGFILE
    620     keyfile=/etc/rc.d/rc.keymap
     619        echo "Slackware-style config detected." >> $LOGFILE
     620        keyfile=/etc/rc.d/rc.keymap
    621621    elif [ -e "/etc/rc.config" ] ; then
    622622        echo "Debian-style config detected." >> $LOGFILE
    623     keyfile=/etc/rc.config
     623        keyfile=/etc/rc.config
    624624    elif [ -e "/etc/console/boottime.kmap.gz" ] ; then
    625625        echo "Debian-style config detected." >> $LOGFILE
    626     echo -en "Adding the following keyboard mapping tables: "
    627     mkdir -p $bigdir/tmp
    628     echo "/etc/console/boottime.kmap.gz" > $bigdir/tmp/KEYMAP-LIVES-HERE
    629     KBDEPTH=0
    630     mkdir -p $bigdir/etc/console
    631     cp /etc/console/boottime.kmap.gz $bigdir/etc/console
    632     echo -e "$DONE"
    633     return 0
    634     else
    635     echo -en "Searching for rc.config ..."
    636     keyfile=`find /etc -name rc.config | head -n1`
    637     if [ "$keyfile" = "" ] || [ ! -e "$keyfile" ] ; then
    638         LogIt "Unknown config detected. Default keyboard map will be used.\n"
    639         return
    640     else
    641         echo "Found $keyfile" >> $LOGFILE
    642     fi
     626        echo -en "Adding the following keyboard mapping tables: "
     627        mkdir -p $bigdir/tmp
     628        echo "/etc/console/boottime.kmap.gz" > $bigdir/tmp/KEYMAP-LIVES-HERE
     629        KBDEPTH=0
     630        mkdir -p $bigdir/etc/console
     631        cp /etc/console/boottime.kmap.gz $bigdir/etc/console
     632        echo -e "$DONE"
     633        return 0
     634    else
     635        echo -en "Searching for rc.config ..."
     636        keyfile=`find /etc -name rc.config | head -n1`
     637        if [ "$keyfile" = "" ] || [ ! -e "$keyfile" ] ; then
     638            LogIt "Unknown config detected. Default keyboard map will be used.\n"
     639            return
     640        else
     641            echo "Found $keyfile" >> $LOGFILE
     642        fi
    643643    fi
    644644    if [ ! -e "$KEYDIR/keymaps" ] ; then
     
    650650    [ ! "$locale" ] && locale=`grep '.map$' "$keyfile" | sed 's/^.* //'`        # Slackware
    651651    echo "locale=$locale" >> $LOGFILE
    652     mp=`find $KEYDIR/keymaps | grep "i[3-8]86" | grep -F "${locale}." | grep -vx " *#.*"`
     652    mp=`find $KEYDIR/keymaps | grep "i[3-8]86" | grep -F "/${locale}." | grep -vx " *#.*"`
    653653    [ ! "$mp" ] && mp=`find $KEYDIR/keymaps | grep "i[3-8]86" | grep "$locale[^r][^/]" | grep -vx " *#.*"`
     654    # If we have multiple keymaps then log it !!
     655    echo "$mp" | grep -q " "
     656    if [ $? -eq 0 ]; then
     657        echo "WARNING: Multiple keymaps found: $mp" | tee -a $LOGFILE
     658        echo "The following one will be used" >> $LOGFILE
     659    fi
    654660    for i in $mp ; do
    655661        mappath=$i
     
    661667    echo "mappath = $mappath" >> $LOGFILE
    662668    if [ ! -e "$mappath" ] || [ -d "$mappath" ] ; then
    663     LogIt "Keyboard mapping file not found. Default keyboard map will be used.\n"
    664     return
     669        LogIt "Keyboard mapping file not found. Default keyboard map will be used.\n"
     670        return
    665671    fi
    666672    echo -en "Adding the following keyboard mapping tables: "
     
    926932        fi
    927933        cp -f $MONDO_TMP/BOOTLOADER.* $bigdir 2> /dev/null || LogIt "\nMondo v1.2x defaults to LILO as the bootloader, BTW.\n"
    928     if [ -e "$MONDO_TMP/start-nfs" ] ; then
     934    if [ -e "$MONDO_TMP/NFS-DEV" ] ; then
    929935        LogIt "Incorporating NFS-related settings\n"
    930         cp -f $MONDO_TMP/start-nfs $bigdir/sbin || Die "Cannot find start-nfs"
    931         for r in NFS-SERVER-MOUNT NFS-SERVER-PATH NFS-DEV NFS-CLIENT-IPADDR NFS-SERVER-IPADDR ; do
    932         cp -f $MONDO_TMP/$r $bigdir/tmp || Die "Cannot copy $r - did you run out of disk space?"
    933                 echo "Copying $r to ramdisk" >> $LOGFILE
     936        for r in NFS-* ISO-PREFIX ; do
     937            cp -f $MONDO_TMP/$r $bigdir/tmp || Die "Cannot copy $r - did you run out of disk space?"
     938            echo "Copying $r to ramdisk" >> $LOGFILE
    934939        done
    935940    fi
     
    11221127
    11231128
    1124 
    11251129#ListKernelModules() {
    11261130    #local output q
     
    11401144        if [ ! -e "$fname" ] ; then
    11411145            echo "Warning - $fname does not exist; cannot be LDD'd." >> $LOGFILE
    1142         if echo $fname | grep lvm &> /dev/null ; then
    1143         echo "This warning only affects you if you are using LVM." >> $LOGFILE
    1144         if lsmod | grep lvm &> /dev/null ; then
    1145             echo "I think you are, so please take heed!" >> $LOGFILE
    1146 #           LogIt "Where is liblvm? You need it."
    1147         else
    1148             echo "I don't think you are, so don't worry about it." >> $LOGFILE
    1149         fi
    1150         fi
     1146            if echo $fname | grep lvm &> /dev/null ; then
     1147                echo "This warning only affects you if you are using LVM." >> $LOGFILE
     1148                if lsmod | grep lvm &> /dev/null ; then
     1149                    echo "I think you are, so please take heed!" >> $LOGFILE
     1150#                   LogIt "Where is liblvm? You need it."
     1151                else
     1152                    echo "I don't think you are, so don't worry about it." >> $LOGFILE
     1153                fi
     1154            fi
    11511155        elif [ -h "$fname" ] && [ -x "$fname" ] ; then
    1152         echo "$fname is softlink" >> $LOGFILE
     1156            echo "$fname is softlink" >> $LOGFILE
    11531157#            echo "$fname will not be LDD'd. It is a softlink to `WhatSoftlinkPointsTo $fname`, which should already be in queue to be analyzed." >> $LOGFILE
    11541158#            echo "$fname"
     
    13771381    all_partitions=""
    13781382   
    1379     if [ -d "/proc/lvm" ] || [ -d "/dev/mapper" ]; then
     1383    if [ $LVM != "false" ]; then
    13801384        echo -en "\rAnalyzing LVM...\r"
    13811385        all_partitions=`$MINDI_LIB/analyze-my-lvm | grep -F ">>>" | cut -d' ' -f2-32`
     
    13871391    done
    13881392    [ "$IMAGE_DEVS" != "" ] && all_partitions="`echo "$all_partitions $IMAGE_DEVS" | tr ' ' '\n' | sort -u | tr '\n ' ' '`"
    1389     printf "        %-15s %-15s %-15s %-15s\n" DEVICE MOUNTPOINT FORMAT "SIZE (MB)"
     1393    printf "        %-15s %-15s %-15s %-15s %-15s\n" DEVICE MOUNTPOINT FORMAT "SIZE (MB)" LABEL
    13901394    useless_dev="/dev/floppy /dev/fd0h1440 /dev/fd0H1440 /dev/cdrom /dev/cdrom/cdrom /dev/cdrom/cdrom1 /dev/cdrom/cdrom2 /dev/cdrom0 /dev/cdrom1 /dev/cdrom2 /dev/cdrom3 /dev/cdrw /dev/scd /dev/ram :/ /dev/sr0 /dev/sr1 /dev/cdrom1"
    13911395    for c_p in $all_partitions ; do
     
    14181422            actual_dev=""
    14191423   
    1420             # 1st try : blkid, the good way
     1424            # 1st try : blkid, the good way for all LABEL
    14211425            if [ -x "/sbin/blkid" ]; then
    1422                 actual_dev=`/sbin/blkid | /bin/grep "$current_partition" | /bin/cut -d':' -f1`
     1426                actual_dev=`/sbin/blkid | /bin/grep "$redhat_label" | grep LABEL= | /bin/cut -d':' -f1`
     1427                # For LVM FS it will give a /dev/dm-# which should then be converted
     1428                if [ $LVM = "v2" ] && [ "`echo $actual_dev | grep '/dev/dm'`" ]; then
     1429                    major=`/bin/ls -l $actual_dev | awk '{print $5}'`
     1430                    minor=`/bin/ls -l $actual_dev | awk '{print $6}'`
     1431                    for dev in `ls /dev/mapper/*`; do
     1432                        major1=`/bin/ls -l $dev | awk '{print $5}'`
     1433                        minor1=`/bin/ls -l $dev | awk '{print $6}'`
     1434                        if [ $major1 = $major ] && [ $minor1 = $minor ]; then
     1435                            actual_dev=`/bin/ls -l $dev | awk '{print $10}'`
     1436                            break
     1437                        fi
     1438                    done
     1439                fi
    14231440            fi
    14241441   
    14251442            # 2nd try, which works on a standard partition (ext2/3), but not on swap
     1443            # For LVM gives a /dev/mapper entry
    14261444            if [ "x$actual_dev" = "x" ]; then
    14271445                actual_dev=`/bin/mount -l | /bin/grep "\[$redhat_label\]" | /bin/cut -d' ' -f1`
    14281446            fi
    14291447   
    1430             # 3rd try, with vol_id (which works with swap)
     1448            # 3rd try, with vol_id
     1449            # SWAP only
    14311450            if [ "x$actual_dev" = "x" -a -x "/sbin/vol_id" ]; then
    14321451                list_swaps=`cat /proc/swaps | /bin/grep "/dev/" | /bin/awk '{ print $1 }' `
     
    14411460
    14421461            # 4th try : pre-formated LABEL. Format is : LABEL=SWAP-mydevice. e.g. : LABEL=SWAP-hda5
     1462            # SWAP only
    14431463            if [ "x$actual_dev" = "x" -a  _"`echo $current_partition | /bin/grep -i 'LABEL=SWAP'`" != _"" ]; then
    14441464                try_dev="`echo "$redhat_label" | /bin/cut -d '-' -f2`"
     
    14531473                current_partition=$actual_dev
    14541474            else
    1455                 Die "Your system uses a labelled swap partition, but you lack the tool to support it.\nPlease replace swap labels with their correct devices in /etc/fstab or install blkid|vol_id\n"
     1475                Die "Your system uses a labelled partition ($current_partition), but you lack the tool to support it.\nPlease replace labels with their correct devices in /etc/fstab or install blkid|vol_id\n"
    14561476            fi
    14571477        else
     
    14591479        fi
    14601480
    1461     partition_format=`$AWK '$1 == "'"$str_to_find_fmt_with"'" {print $3}' $MY_FSTAB`
    1462     # Some distributions such as Debian do not put /dev/<VG>/<LV> in fstab
    1463     # for LVM partitions but use /dev/mapper/<VG>-<LV> instead. Fortunately,
    1464     # the former is then a link to the latter, so we test whether
    1465     # $current_partition is actually such a link or not and set
    1466     # $current_lvolume accordingly. Note that $current_lvolume may well be an
    1467     # ordinary device. It is just to make sure that we feed the right value
    1468     # into any of the LVM tools if possible.
    1469     if [ -d "/dev/mapper" ] && [ -z "`lvm lvdisplay $current_partition 2> /dev/null`" ]; then
    1470         partition_stub="`echo "$current_partition" | sed "s|^/dev/mapper/|/dev/|" | cut -d"-" -f1`"
    1471         current_lvolume="`find /dev -lname "$current_partition" | grep "^$partition_stub"`"
    1472     fi
    1473     if [ -z "$current_lvolume" ]; then
     1481        partition_format=`$AWK '$1 == "'"$str_to_find_fmt_with"'" {print $3}' $MY_FSTAB`
     1482        # Some distributions such as Debian do not put /dev/<VG>/<LV> in fstab
     1483        # for LVM partitions but use /dev/mapper/<VG>-<LV> instead. Fortunately,
     1484        # the former is then a link to the latter, so we test whether
     1485        # $current_partition is actually such a link or not and set
     1486        # $current_lvolume accordingly. On Debian you may find more than one answer
     1487        # so we remove the one corresponding to /dev/.static
     1488        # On RedHat even if the device name is different (/dev/mapper/<VG><LV>), the
     1489        # principle is the same and we need to find the link to it as well.
     1490        # Note that $current_lvolume may well be an
     1491        # ordinary device. It is just to make sure that we feed the right value
     1492        # into any of the LVM tools if possible.
     1493
    14741494        current_lvolume="$current_partition"
    1475     fi
    1476     # End of LVM device style variation code (other than $current_lvolume).
    1477     if [ -d "/proc/lvm" ] && [ "`lvdisplay $current_lvolume 2> /dev/null`" ]; then
    1478         partition_size="lvm"
    1479     elif [ -d "/dev/mapper" ] && [ "`lvm lvdisplay $current_lvolume 2> /dev/null`" ]; then
    1480         partition_size="lvm"
    1481     else
    1482         partition_size=`SizeOfPartition $current_partition`
    1483         [ "`echo "$current_partition" | grep "[0-9]"`" = "" ] && continue
    1484         [ "`echo "$current_partition" | grep -c "^/"`" -ne "1" ] && continue
    1485         if [ "$partition_format" = "swap" ] || [ "$partition_mountpt" = "swap" ] ; then
    1486         partition_size=`grep -Fv "Priority" /proc/swaps | tr -s '\t' ' ' | grep -F "$current_partition" | $AWK '{print $3}'`
    1487         [ "$partition_mountpt" != "swap" ] && partition_mountpt="swap"
     1495        if [ $LVM = "v2" ] && [ "`echo $current_partition | grep -E '^/dev/mapper/'`" ]; then
     1496            # .static dir are a Debian specificity
     1497            current_lvolume="`find /dev -lname "$current_partition" | grep -Ev '^/dev/\.static/'`"
     1498            echo $current_lvolume | grep -q ' '
     1499            if [ $? -eq 0]; then
     1500                echo "WARNING: Multiple Logical Volumes found. Report to dev team" >> $LOGFILE 
     1501            fi
     1502        fi
     1503        #
     1504        # End of LVM device style variation code (other than $current_lvolume).
     1505
     1506        if [ $LVM != "false" ] && [ "`$LVMCMD lvdisplay $current_lvolume 2> /dev/null`" ]; then
     1507            # Size computed via LVM not directly
     1508            partition_size="lvm"
     1509        else
     1510            partition_size=`SizeOfPartition $current_partition`
     1511            [ "`echo "$current_partition" | grep "[0-9]"`" = "" ] && continue
     1512            [ "`echo "$current_partition" | grep -c "^/"`" -ne "1" ] && continue
     1513            if [ "$partition_format" = "swap" ] || [ "$partition_mountpt" = "swap" ] ; then
     1514                partition_size=`grep -Fv "Priority" /proc/swaps | tr -s '\t' ' ' | grep -F "$current_partition" | $AWK '{print $3}'`
     1515                [ "$partition_mountpt" != "swap" ] && partition_mountpt="swap"
    14881516                [ "$partition_format" != "swap" ] && partition_format="swap"
    1489         if [ "$partition_size" = "" ] ; then
    1490             totalsize=0
    1491             items=0
    1492             for i in `tr -s ' ' '\t' < /proc/swaps | grep -Fv "Filename" | cut -f3` ; do
    1493             totalsize=$(($totalsize+$i))
    1494             items=$(($items+1))
    1495             done
    1496                     [ "$items" -gt "0" ] && partition_size=$(($totalsize/$items)) || partition_size=0
    1497             [ "$partition_size" -lt "125000" ] && partition_size=125000
    1498             echo "I'm guessing $c_p is $(($partition_size/1024))MB" >> $LOGFILE
    1499         fi
    1500         fi
    1501     fi
    1502     [ "$partition_mountpt" = "swap" ] && partition_format="swap"
    1503     [ "$partition_format" = "swap" ] && partition_mountpt="swap"
    1504     if [ "$partition_mountpt" = "" ] ; then
    1505         if [ "`pvdisplay $current_lvolume 2> /dev/null`" != "" ] || [ "`lvm pvdisplay $current_lvolume 2> /dev/null`" != "" ] ; then
    1506         if  [ "`grep -F device /etc/raidtab 2> /dev/null | grep -w $current_partition`" ] ; then
    1507             partition_mountpt="raid"
    1508             partition_format="raid"
     1517                if [ "$partition_size" = "" ] ; then
     1518                    totalsize=0
     1519                    items=0
     1520                    for i in `tr -s ' ' '\t' < /proc/swaps | grep -Fv "Filename" | cut -f3` ; do
     1521                        totalsize=$(($totalsize+$i))
     1522                        items=$(($items+1))
     1523                    done
     1524                    [ "$items" -gt "0" ] && partition_size=$(($totalsize/$items)) || partition_size=0
     1525                    [ "$partition_size" -lt "125000" ] && partition_size=125000
     1526                    echo "I'm guessing $c_p is $(($partition_size/1024))MB" >> $LOGFILE
     1527                fi
     1528            fi
     1529        fi
     1530        [ "$partition_mountpt" = "swap" ] && partition_format="swap"
     1531        [ "$partition_format" = "swap" ] && partition_mountpt="swap"
     1532        if [ "$partition_mountpt" = "" ] ; then
     1533            if [ "`$LVMCMD pvdisplay $current_lvolume 2> /dev/null`" != "" ] ; then
     1534                if  [ "`grep -F device /etc/raidtab 2> /dev/null | grep -w $current_partition`" ] ; then
     1535                    partition_mountpt="raid"
     1536                    partition_format="raid"
     1537                else
     1538                    partition_mountpt="lvm"
     1539                    partition_format="lvm"
     1540                fi
     1541            fi
     1542        fi
     1543        psz=$partition_size
     1544        echo "Examining $current_partition (mount=$partition_mountpt fmt=$partition_format psz=$psz)" >> $LOGFILE
     1545        [ "$psz" != "lvm" ] && psz=$(($psz/1024))
     1546        if [ "`echo " $IMAGE_DEVS " | grep -F " $current_partition "`" != "" ] ; then
     1547            partition_mountpt="image"
     1548            old_partition_fmt=$partition_format
     1549#           partition_format="`$FDISK -l 2>> $LOGFILE | tr -s '\t' ' ' | grep -w "$absolute_partition" | $AWK 'x=$(NF-1}'`"
     1550            partition_format="`$FDISK -l 2>> $LOGFILE | tr '*' ' ' | tr '+' ' ' | tr -s ' ' '\t' | grep -w "$absolute_partition" | cut -f5`"
     1551            echo "------- $FDISK -l log ------------" >> $LOGFILE
     1552            cat $FDISKLOG >> $LOGFILE
     1553            echo "------- $FDISK log end ------------" >> $LOGFILE
     1554            partition_size=$(($partition_size+1)); # just in case
     1555            if [ "$partition_format" = "Linux" ] ; then
     1556                echo "Are you imaging a mounted swap partition? Silly..." >> $LOGFILE
     1557                echo "Reverting format from $old_partition_fmt to $partition_format" >> $LOGFILE
     1558                partition_format=$old_partition_fmt
     1559            fi
     1560        fi
     1561        if [ "$EXCLUDE_DEVS" ] && [ "`echo " $EXCLUDE_DEVS " | grep -F " $current_partition "`" ] || [ "`echo " $EXCLUDE_DEVS " | grep " $current_partition "`" ] ; then
     1562            echo "Excluding $current_partition from mountlist" >> $LOGFILE
     1563            continue
     1564        fi
     1565        if [ ! "$partition_mountpt" ] ; then
     1566            for qq in "" `find /dev/ida/c*d* ! -name '*p*'` ; do
     1567                partition_format=`$FDISK -l $qq 2>> $LOGFILE | grep -w "$c_p" | sed 's/12/|/' | tr -s '\t' ' ' | cut -d'|' -f2 | cut -d' ' -f2-9`
     1568                echo "------- $FDISK -l $qq log ------------" >> $LOGFILE
     1569                cat $FDISKLOG >> $LOGFILE
     1570                echo "------- $FDISK log end ------------" >> $LOGFILE
     1571                [ "$partition_format" ] && break
     1572            done
     1573            if [ "$partition_format" = "Compaq diagnostics" ] ; then
     1574                partition_format="compaq"
     1575            elif [ ! "`grep -F device /etc/raidtab 2> /dev/null | grep -w $current_partition`" ] ; then
     1576                LogIt "Unable to find mountpoint of $current_partition - ignoring\n"
     1577                continue
     1578            fi
     1579        fi
     1580        partition_format="`echo "$partition_format" | cut -d',' -f1`"; # in case user has ext3,ext2 or something dumb like that
     1581        [ "$partition_format" = "auto" ] && partition_format="`mount | grep -w $current_partition | awk '{print$5;}'`"; # in case user uses 'auto' (dumb!)
     1582        unofficial_outstring=`printf "\t%-15s %-15s %-15s %7s\n" $current_partition $partition_mountpt $partition_format $psz`
     1583        if [ "$current_partition" = "" ] ; then
     1584            echo "Unknown partition (outstring = $unofficial_outstring)" >> $LOGFILE
     1585        elif [ "$partition_mountpt" = "" ] && [ -f "/etc/raidtab" ] ; then
     1586            if [ "`grep -F device /etc/raidtab 2>/dev/null | grep -F $current_partition`" ] ; then
     1587                partition_mountpt=raid
     1588                partition_format=raid
     1589                printf "\t%-15s %-15s %-15s %7s %-15s\n" $current_partition $partition_mountpt $partition_format $psz "$redhat_label"
     1590                printf "%s %s %s %s %s\n" $current_partition $partition_mountpt $partition_format $partition_size "$redhat_label" >> $mountlist
     1591            else
     1592                echo "Unknown mountpoint (outstring = $unofficial_outstring)" >> $LOGFILE
     1593            fi
     1594        elif [ "$partition_format" = "" ] ; then
     1595            echo "Unknown format (outstring = $unofficial_outstring)" >> $LOGFILE
     1596        elif [ "$partition_size" = "" ] ; then
     1597            echo "Unknown partition size (outstring = $unofficial_outstring)" >> $LOGFILE
     1598        elif [ "$partition_mountpt" = "/proc" ] || [ "$partition_mountpt" = "/dev/pts" ] ; then
     1599            continue
    15091600        else
    1510 #           lvm_dev="`pvdisplay $current_lvolume | grep -i "VG N" | head -n1 | tr -s ' ' ' ' | cut -d' ' -f3`"
    1511             partition_mountpt="lvm"
    1512             partition_format="lvm"
    1513         fi
    1514         fi
    1515     fi
    1516     psz=$partition_size
    1517     echo "Examining $current_partition (mount=$partition_mountpt fmt=$partition_format psz=$psz)" >> $LOGFILE
    1518     [ "$psz" != "lvm" ] && psz=$(($psz/1024))
    1519     if [ "`echo " $IMAGE_DEVS " | grep -F " $current_partition "`" != "" ] ; then
    1520         partition_mountpt="image"
    1521             old_partition_fmt=$partition_format
    1522 #       partition_format="`$FDISK -l 2>> $LOGFILE | tr -s '\t' ' ' | grep -w "$absolute_partition" | $AWK 'x=$(NF-1}'`"
    1523         partition_format="`$FDISK -l 2>> $LOGFILE | tr '*' ' ' | tr '+' ' ' | tr -s ' ' '\t' | grep -w "$absolute_partition" | cut -f5`"
    1524             echo "------- $FDISK -l log ------------" >> $LOGFILE
    1525             cat $FDISKLOG >> $LOGFILE
    1526             echo "------- $FDISK log end ------------" >> $LOGFILE
    1527         partition_size=$(($partition_size+1)); # just in case
    1528             if [ "$partition_format" = "Linux" ] ; then
    1529                 echo "Are you imaging a mounted swap partition? Silly..." >> $LOGFILE
    1530                 echo "Reverting format from $old_partition_fmt to $partition_format" >> $LOGFILE
    1531                 partition_format=$old_partition_fmt
    1532             fi
    1533     fi
    1534         if [ "$EXCLUDE_DEVS" ] && [ "`echo " $EXCLUDE_DEVS " | grep -F " $current_partition "`" ] || [ "`echo " $EXCLUDE_DEVS " | grep " $current_partition "`" ] ; then
    1535             echo "Excluding $current_partition from mountlist" >> $LOGFILE
    1536             continue
    1537         fi
    1538         if [ ! "$partition_mountpt" ] ; then
    1539         for qq in "" `find /dev/ida/c*d* ! -name '*p*'` ; do
    1540         partition_format=`$FDISK -l $qq 2>> $LOGFILE | grep -w "$c_p" | sed 's/12/|/' | tr -s '\t' ' ' | cut -d'|' -f2 | cut -d' ' -f2-9`
    1541                 echo "------- $FDISK -l $qq log ------------" >> $LOGFILE
    1542                 cat $FDISKLOG >> $LOGFILE
    1543                 echo "------- $FDISK log end ------------" >> $LOGFILE
    1544         [ "$partition_format" ] && break
    1545         done
    1546         if [ "$partition_format" = "Compaq diagnostics" ] ; then
    1547         partition_format="compaq"
    1548         elif [ ! "`grep -F device /etc/raidtab 2> /dev/null | grep -w $current_partition`" ] ; then
    1549         LogIt "Unable to find mountpoint of $current_partition - ignoring\n"
    1550         continue
    1551         fi
    1552     fi
    1553     partition_format="`echo "$partition_format" | cut -d',' -f1`"; # in case user has ext3,ext2 or something dumb like that
    1554     [ "$partition_format" = "auto" ] && partition_format="`mount | grep -w $current_partition | awk '{print$5;}'`"; # in case user uses 'auto' (dumb!)
    1555     unofficial_outstring=`printf "\t%-15s %-15s %-15s %7s\n" $current_partition $partition_mountpt $partition_format $psz`
    1556     if [ "$current_partition" = "" ] ; then
    1557         echo "Unknown partition (outstring = $unofficial_outstring)" >> $LOGFILE
    1558     elif [ "$partition_mountpt" = "" ] && [ -f "/etc/raidtab" ] ; then
    1559         if [ "`grep -F device /etc/raidtab 2>/dev/null | grep -F $current_partition`" ] ; then
    1560             partition_mountpt=raid
    1561             partition_format=raid
    1562             printf "\t%-15s %-15s %-15s %7s %-15s\n" $current_partition $partition_mountpt $partition_format $psz "$redhat_label"
     1601            if [ "$partition_format" = "dos" ] || [ "$partition_format" = "msdos" ] ; then
     1602                echo "Stupid bastard..." >> $LOGFILE
     1603                partition_format="vfat"
     1604            fi
     1605            printf "\t%-15s %-15s %-15s %7s %-15s\n" $current_partition $partition_mountpt $partition_format $psz "$redhat_label"
    15631606            printf "%s %s %s %s %s\n" $current_partition $partition_mountpt $partition_format $partition_size "$redhat_label" >> $mountlist
    1564         else
    1565             echo "Unknown mountpoint (outstring = $unofficial_outstring)" >> $LOGFILE
    1566         fi
    1567         elif [ "$partition_format" = "" ] ; then
    1568         echo "Unknown format (outstring = $unofficial_outstring)" >> $LOGFILE
    1569     elif [ "$partition_size" = "" ] ; then
    1570         echo "Unknown partition size (outstring = $unofficial_outstring)" >> $LOGFILE
    1571     elif [ "$partition_mountpt" = "/proc" ] || [ "$partition_mountpt" = "/dev/pts" ] ; then
    1572         continue
    1573     else
    1574             if [ "$partition_format" = "dos" ] || [ "$partition_format" = "msdos" ] ; then
    1575                 echo "Stupid bastard..." >> $LOGFILE
    1576                 partition_format="vfat"
    1577             fi
    1578         printf "\t%-15s %-15s %-15s %7s %-15s\n" $current_partition $partition_mountpt $partition_format $psz "$redhat_label"
    1579         printf "%s %s %s %s %s\n" $current_partition $partition_mountpt $partition_format $partition_size "$redhat_label" >> $mountlist
    1580     fi
     1607        fi
    15811608    done
    15821609}
     
    16111638    rm -f $1.tmp
    16121639    if [ "$CDRECOVERY" != "yes" ] ; then
    1613         if [ -e "$MONDO_TMP/start-nfs" ] ; then
     1640        if [ -e "$MONDO_TMP/NFS-DEV" ] ; then
    16141641            echo -en "Press <enter> to continue.\n" >> $1
    16151642        elif [ ! "$MONDO_TMP" ] ; then
     
    16941721    cd $TMP_ROOT/iso/isolinux
    16951722    cat $iso_cfg_file | HackSyslinuxFile $ramdisk_size $TMP_ROOT/iso > isolinux.cfg || Die "Cannot copy isolinux.cfg from mindi_home to tmp_root - did you run out of disk space?"
    1696     if [ -e "$MONDO_TMP/start-nfs" ] ; then
    1697     mv isolinux.cfg isolinux.cfg.old
    1698     sed s/interactive/iso/ isolinux.cfg.old > isolinux.cfg
     1723    if [ -e "$MONDO_TMP/NFS-DEV" ] ; then
     1724        mv isolinux.cfg isolinux.cfg.old
     1725        sed s/interactive/iso/ isolinux.cfg.old > isolinux.cfg
    16991726    fi
    17001727    if [ "$ARCH" != "ia64" ] ; then
    17011728        cp $ISOLINUX isolinux.bin || Die "Cannot copy isolinux.bin ($ISOLINUX) to tmp_root - did you run out of disk space?"
    1702     cp $ISOLINUX ../
     1729        cp $ISOLINUX ../
    17031730    fi
    17041731    cd $TMP_ROOT/iso
     
    17081735    [ "$MONDO_SHARE" ] && cp -f $MONDO_SHARE/autorun .   
    17091736    if [ -d "/home/MondoCD" ] ; then
    1710     cp -pRdu /home/MondoCD/* .
     1737        cp -pRdu /home/MondoCD/* .
    17111738    fi
    17121739    if [ "$ARCH" != "ia64" ] ; then
     
    17481775    if [ "`DidMondoCallMe`" ] ; then
    17491776        if [ "$CDRECOVERY" != "yes" ] ; then
    1750             if [ -e "$MONDO_TMP/start-nfs" ] ; then
     1777            if [ -e "$MONDO_TMP/NFS-DEV" ] ; then
    17511778                echo -en "Press <enter> to continue.\n"
    17521779            elif [ ! "$MONDO_TMP" ] ; then
     
    18561883        echo -en "default=RESTORE\n"
    18571884    elif [ "$disksize" -gt "2880" ] && [ "`DidMondoCallMe`" ] ; then
    1858         if [ -e "$MONDO_TMP/start-nfs" ] ; then
     1885        if [ -e "$MONDO_TMP/NFS-DEV" ] ; then
    18591886            echo -en "default=iso\n"
    18601887        else
     
    18771904    elif [ "$disksize" -gt "2880" ] ; then
    18781905        if [ "`DidMondoCallMe`" ] ; then
    1879             if [ -e "$MONDO_TMP/start-nfs" ] ; then
     1906            if [ -e "$MONDO_TMP/NFS-DEV" ] ; then
    18801907                options="iso"
    18811908            else
     
    21032130#    tar -zxf $MINDI_LIB/dev.tgz || LogIt "Cannot untar dev.tgz\n" <--- present for LILO; is it nec. for SYSLINUX too?
    21042131    cat $sys_cfg_file | HackSyslinuxFile $ramdisk_size $mountpoint > syslinux.cfg || Die "Cannot copy syslinux.cfg from mindi_home to tmp_root"
    2105     if [ -e "$MONDO_TMP/start-nfs" ] ; then
     2132    if [ -e "$MONDO_TMP/NFS-DEV" ] ; then
    21062133        mv syslinux.cfg syslinux.cfg.orig
    21072134        sed s/interactive/iso/ syslinux.cfg.orig > syslinux.cfg
     
    22922319    cp -f $TMP_ROOT/mountlist.txt $CACHE_LOC
    22932320    [ "`DidMondoCallMe`" ] && cp -f $minidir_root/$noof_disks/tmp/mountlist.txt $MONDO_TMP/.
    2294     [ -d "/proc/lvm" ] && $MINDI_LIB/analyze-my-lvm > $minidir_root/$noof_disks/tmp/i-want-my-lvm
    2295     [ -d "/dev/mapper" ] && $MINDI_LIB/analyze-my-lvm > $minidir_root/$noof_disks/tmp/i-want-my-lvm
     2321    [ $LVM != "false" ] && $MINDI_LIB/analyze-my-lvm > $minidir_root/$noof_disks/tmp/i-want-my-lvm
    22962322    cat $minidir_root/$noof_disks/tmp/mountlist.txt >> $LOGFILE
    22972323    ZipMinidirsIntoTarballs $minidir_root $tardir $noof_disks
     
    28402866        list_of_groovy_mods="$CDROM_MODS `WhichOfTheseModulesAreLoaded "$SCSI_MODS"`"
    28412867    fi
    2842     if [ -e "$MONDO_TMP/start-nfs" ] ; then
    2843         cp -a $MONDO_TMP/start-nfs $mountpoint/sbin
     2868    if [ -e "$MONDO_TMP/NFS-DEV" ] ; then
    28442869        # For PXE boot
    28452870        list_of_groovy_mods="$list_of_groovy_mods $NET_MODS"
     
    30443069mkdir -p $MONDO_ROOT
    30453070
     3071if [ -d "/proc/lvm" ]; then
     3072    # LVM v1
     3073    LVMCMD=""
     3074    LVM="v1"
     3075elif [ -d "/dev/mapper" ]; then
     3076    # LVM v2
     3077    LVMCMD="lvm"
     3078    LVM="v2"
     3079else
     3080    LVM="false"
     3081fi
     3082
    30463083if [ "$#" -ge "2" ] ; then
    30473084    if [ "$1" = "--max-compressed-size" ] ; then
  • trunk/mindi/rootfs/sbin/LogIt

    r30 r764  
    11#!/bin/sh
     2#
     3# $Id$
     4#
    25
    36#    if [ ! -e "/bin/date" ] ; then
     
    811currdate=""
    912
    10     LOGFILE=/tmp/mondo-restore.log
    11     if [ ! -e "/tmp/mondo-restore.log" ] ; then
    12         echo "...first line..." > /tmp/mondo-restore.log
    13     fi
    14 #    mkdir -p /var/log
    15 #    ln -s -f /tmp/mondo-restore.log /var/log/mondo-restore.log
     13LOGFILE=/tmp/mondo-restore.log
     14if [ ! -e "$LOGFILE" ] ; then
     15    echo "...first line..." > $LOGFILE
     16fi
    1617
    1718# LogIt $phrase ------ log only
  • trunk/mindi/rootfs/sbin/init

    r649 r764  
    11#!/bin/sh
    22#
    3 # 04/20/2005
    4 # - fix for 'skip the tape datadisks' bug (Joseph Smith)
     3# $Id$
    54#
    6 # 10/13/2004
    7 # - echo 0 > /proc/sys/kernel/exec-shield to disable exec-shield
    8 #
    9 # 07/25
    10 # - removed sbminst
    11 #
    12 # 06/25
    13 # - klogd -c 2 (was -c 5)
    14 #
    15 # 06/21
    16 # - experimented w/ calling ctrlaltdel to setup soft reset
    17 # - don't softlink /var/log
    18 #
    19 # 06/16
    20 # - insmod dm_mod as well as dm-mod
    21 #
    22 # 05/24
    23 # - added Andree's vc.tgz
    24 #
    25 # 05/14
    26 # - open => openvt (part of busybox)
    27 # - nash removed. dm.tgz added
    28 #
    29 # 04/21
    30 # - compare original lsmod output w/ new lsmod output
    31 #
    32 # 04/13
    33 # - mount /sys if appropriate
    34 #
    35 # 04/03
    36 # - use 'dd if=$tapedev bs=32k count=1024' instead of 'tar -zxf $tapedev'
    37 #   to extract aux datadisk files from tape
    38 #
    39 # 25/03
    40 # - wait 7s, not 2s, while installing modules
    41 #
    42 # 18/01/2004
    43 # - logging mondo-restore.cfg, not mondo-restore.log --- FIXED
    44 #
    45 # 11/23/2003
    46 # - if find-and-mount-cdrom fails once, try again
    47 # - open scrolling log of /tmp/mondo-restore.log later than previously
    48 #
    49 # 11/18
    50 # - disabled clear()'s
    51 # - reboot at end
    52 #
    53 # 11/15
    54 # - softlink /var/log to /tmp/tmpfs/var/log
    55 # - klogd -c 5 now (was -c 1)
    56 #
    57 # 11/10
    58 # - don't call mondorestore if backup-media-type is not specified in
    59 #   config file /tmp/mondo-restore.cfg
    60 #
    61 # 10/21
    62 # - softlink nano to pico if nano found
    63 #
    64 # 10/16
    65 # - create /dev/md/* softlinks if necessary
    66 #
    67 # 10/12
    68 # - start devfs if /tmp/USE-DEVFS found
    69 # - create simple /etc/devfsd.conf file
    70 #
    71 # 10/09
    72 # - try various mount commands to get tmpfs online (use initiative)
    73 #
    74 # 09/24
    75 # - also try /dev/st0, /dev/osst0, /dev/ht0 if [tapedev] fails
    76 # - modify media-dev in mondo-restore.cfg if we succeed :)
    77 #
    78 # 09/15
    79 # - create /tmp/null and /tmp/stdout and /tmp/stderr
    80 #   as copies of the real thing, just in case partimagehack
    81 #   still uses them
    82 #
    83 # 08/01
    84 # - tmpfs ramdisk is now 48m
    85 #
    86 # 07/14
    87 # - added mkdirs at start
    88 #
    89 # 06/04
    90 # - remount root as rw just in case
    91 #
    92 # 05/04
    93 # - replaced /mnt/groovy-stuff with $GROOVY
    94 #
    95 # 04/30
    96 # - if your CD was created by Mondoarchive when it backed up
    97 #   to ISO(s) then re-jig tmp/mondo-restore.cfg accordingly;
    98 #   this is nec. if you backup to a hard disk directory but
    99 #   then burn the ISOs to physical CDs
    100 #
    101 # 04/26
    102 # - offer user the chance to specify another tape device, if
    103 #   the one they specified at backup-time refuses to act as
    104 #   aux data disk at boot-time
    105 #
    106 # 04/21
    107 # - start scsi if cciss
    108 # - use ataraid.tgz too
    109 #
    110 # 05/03
    111 # - mount / -o rw,remount at end, just in case
    112 #   RH9 futzes with the mountpoint
    113 #
    114 # 04/04
    115 # - increased tmpfs ramdisk size from 34m to 38m
    116 #
    117 # 01/01 - 01/31/2003
    118 # - fixed issue with LVM and SW Raid devices (Brian Borgeson)
    119 # - friendlier 'upgrade your ram' msg
    120 # - better fallback msg
    121 # - if /tmp/2880.siz exists then assume boot CD
    122 #
    123 # 11/01 - 12/31/2002
    124 # - updated intro msg
    125 # - if /dev/boot_device and /BOOTLOADER.DEVICE exist then
    126 #   copy device /dev/boot_device to pathname contained
    127 #   in /BOOTLOADER.DEVICE text file
    128 #
    129 # 04/01 - 08/31/2002
    130 # - handle new 'backup_media_type' entry in mondo-restore.cfg
    131 # - added 'sleep 2' at start of WelcomeMessage
    132 # - disabled a silly 'abort' line at end
    133 # - better handling of devfs (DuckX) --- new RunDevfsd()
    134 # - assume start-nfs is in /sbin
    135 # - extract rd.tgz, raw.tgz, ida.tgz, cciss.tgz to /; they include
    136 #   /dev entries which would otherwise fill up the ramdisk at bkp-time
    137 #
    138 # 01/01 - 03/31/2002
    139 # - Carl Wilhelm Soderstrom disabled exec sh; replaced with exit 1
    140 # - if you are an idiot & your computer has very little RAM,
    141 #   this script will no longer abort; it will merely warn you
    142 # - run chmod 755 `which start-nfs` before running start-nfs
    143 # - use a ramdisk for /tmp (after copying old /tmp stuff into it)
    144 # - fixed segfaults ('open') by replacing 'sh' call with '/bin/sh' call
    145 # - changed LaunchTerminals() to try to work with newly-compiled 'open'
    146 # - don't write 'start-nfs error' if start-nfs doesn't exist; just go on
    147 # - added tmpfs and some space-checking
    148 # - cleaned up script
    149 # - added stuff to start NFS services if necessary
    150 # - reordered some of the main() stuff, for elegance's sake
    151 # - added Petris and 'tail -f /tmp/mondo-restore.log' to LaunchTerminals()
    152 # - changed /usr/share/ to /usr/local/
    153 #
    154 # 2001
    155 # - fix some typos
    156 # - added lots of cool stuff to make Mindi _nearly_ boot from tape
    157 # - restructured the welcome msg echoed to screen
    158 # - broke up spaghetti code; made lots of subroutines
    159 #
     5# init script launched during the restore process
    1606#------------------------------------------------------------
    1617
     
    23278    openvt 6 /bin/sh
    23379    openvt 7 /bin/sh /sbin/wait-for-petris
    234 #    openvt 8 /usr/bin/tail -f /tmp/mondo-restore.log
    23580}
    23681
     
    385230    LogIt "Devfs found. Testing kernel support..."
    386231    if [ ! -e "/dev/.devfsd" ] ; then
    387         mount -t devfs devfs /dev 2>> /tmp/mondo-restore.log
     232        mount -t devfs devfs /dev 2>> $LOGFILE
    388233            if [ "$?" -ne "0" ] ; then
    389234        LogIt "Error while trying to mount devfs"
     
    441286    if [ -e "/tmp/i-want-my-lvm" ] ; then
    442287        LogIt "Scanning LVM's..." 1
    443     if which lvm ; then
    444         MyInsmod dm-mod
    445         MyInsmod dm_mod
    446         lvm vgscan --mknodes
    447     else
    448         vgscan
    449     fi
    450         grep -E "^#.*vgchange" /tmp/i-want-my-lvm | sed s/#// > /tmp/start-lvm
     288        if which lvm ; then
     289            MyInsmod dm-mod
     290            MyInsmod dm_mod
     291            lvm vgscan --mknodes
     292        else
     293            vgscan
     294        fi
     295        grep -E "^#.*vgchange" /tmp/i-want-my-lvm | sed "s/^#[ ]*//" > /tmp/start-lvm
    451296        chmod +x /tmp/start-lvm
    452297        echo -en "Starting LVM's..."
     
    461306# pipe vgscan's output, strip it, run 'vgchange' on its output, etc.etc.
    462307    LogIt "LVM's have been started."
    463 }
    464 
    465 
    466 
    467 StartNfs() {
    468     # using mount -o nolock avoids portmap requirement
    469     #if which portmap > /dev/null 2> /dev/null ; then
    470         #LogIt "Running portmap"
    471     #portmap
    472         #[ "$?" -eq "0" ] && LogIt "Portmap started OK" || LogIt "Portmap error"
    473         if [ -e "/sbin/start-nfs" ] ; then
    474             chmod 755 /sbin/start-nfs
    475         LogIt "Starting NFS..."
    476             /sbin/start-nfs
    477         fi
    478     #fi
    479308}
    480309
     
    539368        mount_cmd="mount /dev/shm -t tmpfs -o size=$size" ; # was 34m until 04/2003
    540369        LogIt "Trying '$mount_cmd'"
    541     $mount_cmd /tmp/tmpfs 2>> /tmp/mondo-restore.log
     370    $mount_cmd /tmp/tmpfs 2>> /$LOGFILE
    542371    res=$?
    543372    [ "$res" -eq "0" ] && break
     
    635464fi
    636465
    637 #if [ -e "/tmp/2880.siz" ] ; then
    638 #    HandleCDROMorFloppies
    639 #el
    640466if [ "`grep -i 'tape ' /tmp/mondo-restore.cfg`" ] || [ "`grep -i udev /tmp/mondo-restore.cfg`" ] ; then
    641         HandleTape
     467    HandleTape
    642468    ExtractDataDisksAndLoadModules
    643 elif [ -e "/sbin/start-nfs" ] && [ "`grep -i pxe /proc/cmdline`" ]; then
    644     StartNfs
    645     imgname=`grep iso-prefix /tmp/mondo-restore.cfg | cut -d' ' -f2-`
    646     if [ "$imgname" = "" ]; then
    647         imgname="mondorescue"
    648     fi
    649     if [ "`grep -i prefix /proc/cmdline`" ] ; then
    650         for i in `cat /proc/cmdline` ; do
    651             if [ "`echo $i | grep -i prefix`" ] ; then
    652                 imgname=`echo $i | cut -d'=' -f2`
    653             fi
    654         done
    655     fi
    656     dirimg=`grep nfs-server-path /tmp/mondo-restore.cfg | cut -d' ' -f2-`
    657     if [ "$dirimg" = "" ]; then
    658         dirimg="/"
    659     fi
    660     LogIt "Mounting NFS image $imgname-1.iso in $dirimg on /mnt/cdrom in loopback"
    661     losetup /dev/loop7 /tmp/isodir/$dirimg/$imgname-1.iso
    662     mount -o ro -t iso9660 /dev/loop7 /mnt/cdrom
     469elif [ "`grep -i pxe /proc/cmdline`" ]; then
     470    /sbin/start-nfs
     471
    663472    # Simulate a local CD
    664473    echo "/mnt/cdrom" > /tmp/CDROM-LIVES-HERE
    665         CD_MOUNTED_OK=yes
     474    CD_MOUNTED_OK=yes
    666475    ExtractDataDisksAndLoadModules
    667476else
    668477    HandleCDROMorFloppies
    669478    ExtractDataDisksAndLoadModules
    670     if [ -e "/sbin/start-nfs" ]; then
    671         StartNfs
    672     fi
     479    /sbin/start-nfs
    673480fi
    674481res=$?
     
    710517fi
    711518hack-cfg-if-necessary || LogIt "Cannot find hack-cfg-if-necessary"
    712 openvt 8 /usr/bin/tail -f /tmp/mondo-restore.log
     519openvt 8 /usr/bin/tail -f $LOGFILE
    713520
    714521#-------------------------------
  • trunk/mindi/rootfs/sbin/post-init

    r274 r764  
    7272else
    7373    if [ "$iso$nuke$compare$interactive" != "" ] ; then
    74     LogIt "FYI, this CD was made by Mindi, not Mondo." 1
    75     exit 0
    76 
     74        LogIt "FYI, this CD was made by Mindi, not Mondo." 1
     75        exit 0
    7776    else
    78     LogIt "Mindi-Linux has finished booting."
     77        LogIt "Mindi-Linux has finished booting."
    7978    fi
    8079fi
Note: See TracChangeset for help on using the changeset viewer.