Changeset 618 in MondoRescue for trunk/mindi


Ignore:
Timestamp:
Jun 3, 2006, 12:16:18 AM (18 years ago)
Author:
bcornec
Message:

merge -r 591:617 $SVN_M/branches/stable

Location:
trunk/mindi
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/mindi/ChangeLog

    r588 r618  
    33MINDI CHANGES
    44
    5 1.0.8 (2006-05-25)
     51.0.8-2 (2006-06-02)
     6- Fix bugs in the swap+LABEL code found on rhel4
     7  (Peter Naber/Bruno Cornec)
     8- PXE mode now supports change of NIC for redeployment
     9  (Bruno Cornec)
     10
     111.0.8-1 (2006-05-25)
    612- new build process (Bruno Cornec)
    713- Fix a bug when a disk less than 2.8 MB can be built, to
  • trunk/mindi/README.pxe

    r588 r618  
     1$Id$
     2
    13README for mondo/mindi usage with PXE
    24
     
    911label mondo
    1012        kernel vmlinuz-mondo
    11         append initrd=initrd-mondo load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=36864 rw root=/dev/ram iso_mode acpi=off apm=off devfs=nomount exec-shield=0 pxe [prefix="machine"] [ipconf=(ipadr:netmask:broadcast:gateway|dhcp)] [ping=#] ...
     13        append initrd=initrd-mondo load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=36864 rw root=/dev/ram iso_mode acpi=off apm=off devfs=nomount exec-shield=0 pxe [prefix="machine"] [ipconf=(ipdev:ipadr:netmask:broadcast:gateway|ipdev:dhcp)] [ping=#] ...
     14
     15ipdev is the device name (e.g. eth2)
     16ipadr is the IP Address (e.g. 192.168.1.1)
     17netmask is the Netmask (e.g. 255.255.255.0)
     18broadcast is the Network broadcast (e.g. 192.168.1.255)
     19gateway is the default gateway (e.g. 192.168.1.254)
     20dhcp is a keyword. Using it will provide all the previous 4 values to activate the LAN interface.
    1221
    1322The initrd and kernel file come rom the first bootable media
     
    2534Without prefix keyword, the name of the images used during archiving with the -p option will be used (they may differ). If -p wasn't used then the name mondorescue-1.iso, ... will be used.
    2635
    27 During boot mondorestore will start your NFS configuration and mount mondo's content from the network rather than from a physical media. You may alter the IP configuration stored from the original machine by passing the ipconf option describing respectively the IP address, netmask, broadcast and default gateway you want to setup for the machine, separated by ':'. Or alternatively, you may specify the dhcp keyword so that a DhCP request is made to get those information. On some configurations, you may also want to increase the number of ping queries made before the NFS mount, which is of 3 by default, using the ping option and give the number you want.
     36During boot mondorestore will start your NFS configuration and mount mondo's content from the network rather than from a physical media. You may alter the IP configuration stored from the original machine by passing the ipconf option describing respectively the IP address, netmask, broadcast and default gateway you want to setup for the machine, separated by ':'. Or alternatively, you may specify the dhcp keyword so that a DHCP request is made to get those information. In the 2 cases, you have to mention on which physical interface those parameters should apply. On some configurations, you may also want to increase the number of ping queries made before the NFS mount, which is of 3 by default, using the ping option and give the number you want.
    2837
    2938Please report any problem around that tool to bruno@mondorescue.org
    3039
     402006-06-02 ipdev added to allow redeployment on another interface
    31412005-12-18 new ipconf and ping option
    32422005-12-14 detailed explanations on where to find initrd and kernel
  • trunk/mindi/mindi

    r588 r618  
    13661366   
    13671367    if [ -d "/proc/lvm" ] || [ -d "/dev/mapper" ]; then
    1368     echo -en "\rAnalyzing LVM...\r"
    1369     all_partitions=`$MINDI_LIB/analyze-my-lvm | fgrep ">>>" | cut -d' ' -f2-32`
     1368        echo -en "\rAnalyzing LVM...\r"
     1369        all_partitions=`$MINDI_LIB/analyze-my-lvm | fgrep ">>>" | cut -d' ' -f2-32`
    13701370    fi
    13711371    all_partitions="$all_partitions `ListAllPartitions 2> /dev/null`"
     
    13781378    for c_p in $all_partitions ; do
    13791379#        echo "c_p = $c_p" > /dev/stderr
    1380     [ "`echo "/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" | fgrep "$c_p"`" != "" ] || [ "`echo "$c_p" | fgrep "/dev/scd"`" != "" ] || [ "`echo "$c_p" | fgrep "/dev/ram"`" != "" ] || [ "`echo "$c_p" | grep ":"`" != "" ] || [ "`echo "$c_p" | fgrep ":/"`" != "" ] && continue
     1380        [ "`echo "/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" | fgrep "$c_p"`" != "" ] || [ "`echo "$c_p" | fgrep "/dev/scd"`" != "" ] || [ "`echo "$c_p" | fgrep "/dev/ram"`" != "" ] || [ "`echo "$c_p" | grep ":"`" != "" ] || [ "`echo "$c_p" | fgrep ":/"`" != "" ] && continue
    13811381        [ "`echo "/dev/scd0 /dev/scd1 /dev/sr0 /dev/sr1 /dev/cdrom /dev/cdrom1" | fgrep "$c_p"`" ] && continue
    1382     [ "`echo "$c_p" | grep -x "/dev/cdroms.*"`" ] && continue
    1383     if [ -h "$c_p" ] && [ "`echo "$c_p" | fgrep "/dev/hd"`" = "" ] && [ "`echo "$c_p" | fgrep "/dev/sd"`" = "" ] && [ "`echo "$c_p" | fgrep "/dev/md"`" = "" ] ; then
    1384         current_partition=`ResolveSoftlink $c_p`
    1385         [ "`echo "$current_partition" | fgrep "/dev/mapper"`" != "" ] && current_partition="$c_p"
    1386         [ "`echo "/dev/scd0 /dev/scd1 /dev/sr0 /dev/sr1 /dev/cdrom /dev/cdrom1" | fgrep "$current_partition"`" ] && continue
    1387     else
    1388         current_partition="$c_p"
    1389     fi
    1390     [ "$c_p" = "none" ] && continue
    1391     absolute_partition=`ResolveSoftlink $c_p`
    1392     partition_mountpt=`tr -s '\t' ' ' < $MY_FSTAB | /bin/grep -w "$current_partition" | /bin/grep -vx " *#.*" | $AWK '{print $2}' | head -n1`
    1393 
    1394     # This part tries to retrieve the correct device from a LABEL line in /etc/fstab
    1395     # current_partition contains only first column of /etc/fstab
    1396     if [ "`echo "$current_partition" | /bin/grep -f -i "LABEL="`" != "" ] ; then
    1397         str_to_find_fmt_with=$current_partition
    1398         redhat_label=`echo "$current_partition" | /bin/cut -d'=' -f2`
    1399         actual_dev=""
    1400 
     1382        [ "`echo "$c_p" | grep -x "/dev/cdroms.*"`" ] && continue
     1383        if [ -h "$c_p" ] && [ "`echo "$c_p" | fgrep "/dev/hd"`" = "" ] && [ "`echo "$c_p" | fgrep "/dev/sd"`" = "" ] && [ "`echo "$c_p" | fgrep "/dev/md"`" = "" ] ; then
     1384            current_partition=`ResolveSoftlink $c_p`
     1385            [ "`echo "$current_partition" | fgrep "/dev/mapper"`" != "" ] && current_partition="$c_p"
     1386            [ "`echo "/dev/scd0 /dev/scd1 /dev/sr0 /dev/sr1 /dev/cdrom /dev/cdrom1" | fgrep "$current_partition"`" ] && continue
     1387        else
     1388            current_partition="$c_p"
     1389        fi
     1390        [ "$c_p" = "none" ] && continue
     1391        absolute_partition=`ResolveSoftlink $c_p`
     1392        partition_mountpt=`tr -s '\t' ' ' < $MY_FSTAB | /bin/grep -w "$current_partition" | /bin/grep -vx " *#.*" | $AWK '{print $2}' | head -n1`
     1393
     1394        # This part tries to retrieve the correct device from a LABEL line in /etc/fstab
     1395        # current_partition contains only first column of /etc/fstab
     1396        if [ "`echo "$current_partition" | /bin/grep -i "LABEL="`" != "" ]; then
     1397            str_to_find_fmt_with=$current_partition
     1398            redhat_label=`echo "$current_partition" | /bin/cut -d'=' -f2`
     1399            actual_dev=""
     1400   
    14011401        # 1st try : blkid, the good way
    1402         if [ -x "/sbin/blkid" ] ; then
     1402        if [ -x "/sbin/blkid" ]; then
    14031403            actual_dev=`/sbin/blkid | /bin/grep "$current_partition" | /bin/cut -d':' -f1`
    14041404        fi
    14051405
    14061406        # 2nd try, which works on a standard partition (ext2/3), but not on swap
    1407         if [ "x$actual_dev" = "x" ] ; then
    1408             actual_dev=`/bin/mount -l | /bin/grep " [$redhat_label]" | /bin/cut -d' ' -f1`
     1407        if [ "x$actual_dev" = "x" ]; then
     1408            actual_dev=`/bin/mount -l | /bin/grep "\[$redhat_label\]" | /bin/cut -d' ' -f1`
    14091409        fi
    14101410
    14111411        # 3rd try, with vol_id (which works with swap)
    1412         if [ "x$actual_dev" = "x" -a -x "/sbin/vol_id" ] ; then
     1412        if [ "x$actual_dev" = "x" -a -x "/sbin/vol_id" ]; then
    14131413                list_swaps=`cat /proc/swaps | /bin/grep "/dev/" | /bin/awk '{ print $1 }' `
    14141414                for dev_swap in $list_swaps ; do
    14151415                    dev_exists=`/sbin/vol_id $dev_swap | /bin/grep "$redhat_label"`
    1416                     if [ "x$dev_exists" != "x" ] ; then
     1416                    if [ "x$dev_exists" != "x" ]; then
    14171417                        actual_dev=$dev_swap
    14181418                        break;
     
    14221422
    14231423        # 4th try : pre-formated LABEL. Format is : LABEL=SWAP-mydevice. e.g. : LABEL=SWAP-hda5
    1424         if [ "x$actual_dev" = "x" -a  "`echo "$current_partition" | /bin/grep -i "LABEL=SWAP"`" != ""] ; then
     1424        if [ "x$actual_dev" = "x" -a  _"`echo $current_partition | /bin/grep -i 'LABEL=SWAP'`" != _"" ]; then
    14251425                try_dev="`echo "$redhat_label" | /bin/cut -d '-' -f2`"
    14261426                present_dev="`/bin/cat /proc/swaps | /bin/grep -w /dev/$try_dev`"
     
    14311431
    14321432        # Check if one of all those tries has known success
    1433         if [ "x$actual_dev" != "x" ] ; then
     1433        if [ "x$actual_dev" != "x" ]; then
    14341434                current_partition=$actual_dev
    14351435        else
     
    14411441
    14421442    partition_format=`$AWK '$1 == "'"$str_to_find_fmt_with"'" {print $3}' $MY_FSTAB`
    1443     if [ -d "/proc/lvm" ] && [ "`lvdisplay $current_partition 2> /dev/null`" ] ; then
     1443    if [ -d "/proc/lvm" ] && [ "`lvdisplay $current_partition 2> /dev/null`" ]; then
    14441444        partition_size="lvm"
    1445     elif [ -d "/dev/mapper" ] && [ "`lvm lvdisplay $current_partition 2> /dev/null`" ] ; then
     1445    elif [ -d "/dev/mapper" ] && [ "`lvm lvdisplay $current_partition 2> /dev/null`" ]; then
    14461446        partition_size="lvm"
    14471447    else
Note: See TracChangeset for help on using the changeset viewer.