Changeset 764 in MondoRescue for trunk/mindi/mindi
- Timestamp:
- Aug 8, 2006, 12:34:37 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/mindi/mindi
r729 r764 284 284 [ "$KBDEPTH" -gt "128" ] && Die "Edit $MINDI_SBIN/mindi and disable FindAndAddUserKeyboardMappingFile (line 2160, approx.)" 285 285 if [ -e "$bigdir/$mappath" ] ; then 286 echo "$mappath already added" >> $LOGFILE287 return286 echo "$mappath already added" >> $LOGFILE 287 return 288 288 elif [ -d "$bigdir/$mappath" ] ; then 289 289 echo "Cannot add $mappath: it's a directory. Sorry." … … 298 298 fi 299 299 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 '#' '.' 301 301 fi 302 302 … … 610 610 [ ! -e "$KEYDIR" ] && KEYDIR=/usr/share 611 611 if [ ! -e "$KEYDIR" ] ; then 612 LogIt "Keyboard mapping directory not found. I shall use default map at boot-time.\n"613 return 0612 LogIt "Keyboard mapping directory not found. I shall use default map at boot-time.\n" 613 return 0 614 614 fi 615 615 if [ -e "/etc/sysconfig/keyboard" ] ; then 616 echo "Red Hat-style config detected." >> $LOGFILE617 keyfile=/etc/sysconfig/keyboard616 echo "Red Hat-style config detected." >> $LOGFILE 617 keyfile=/etc/sysconfig/keyboard 618 618 elif [ -e "/etc/rc.d/rc.keymap" ] ; then 619 echo "Slackware-style config detected." >> $LOGFILE620 keyfile=/etc/rc.d/rc.keymap619 echo "Slackware-style config detected." >> $LOGFILE 620 keyfile=/etc/rc.d/rc.keymap 621 621 elif [ -e "/etc/rc.config" ] ; then 622 622 echo "Debian-style config detected." >> $LOGFILE 623 keyfile=/etc/rc.config623 keyfile=/etc/rc.config 624 624 elif [ -e "/etc/console/boottime.kmap.gz" ] ; then 625 625 echo "Debian-style config detected." >> $LOGFILE 626 echo -en "Adding the following keyboard mapping tables: "627 mkdir -p $bigdir/tmp628 echo "/etc/console/boottime.kmap.gz" > $bigdir/tmp/KEYMAP-LIVES-HERE629 KBDEPTH=0630 mkdir -p $bigdir/etc/console631 cp /etc/console/boottime.kmap.gz $bigdir/etc/console632 echo -e "$DONE"633 return 0634 else 635 echo -en "Searching for rc.config ..."636 keyfile=`find /etc -name rc.config | head -n1`637 if [ "$keyfile" = "" ] || [ ! -e "$keyfile" ] ; then638 LogIt "Unknown config detected. Default keyboard map will be used.\n"639 return640 else641 echo "Found $keyfile" >> $LOGFILE642 fi626 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 643 643 fi 644 644 if [ ! -e "$KEYDIR/keymaps" ] ; then … … 650 650 [ ! "$locale" ] && locale=`grep '.map$' "$keyfile" | sed 's/^.* //'` # Slackware 651 651 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 " *#.*"` 653 653 [ ! "$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 654 660 for i in $mp ; do 655 661 mappath=$i … … 661 667 echo "mappath = $mappath" >> $LOGFILE 662 668 if [ ! -e "$mappath" ] || [ -d "$mappath" ] ; then 663 LogIt "Keyboard mapping file not found. Default keyboard map will be used.\n"664 return669 LogIt "Keyboard mapping file not found. Default keyboard map will be used.\n" 670 return 665 671 fi 666 672 echo -en "Adding the following keyboard mapping tables: " … … 926 932 fi 927 933 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" ] ; then934 if [ -e "$MONDO_TMP/NFS-DEV" ] ; then 929 935 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 934 939 done 935 940 fi … … 1122 1127 1123 1128 1124 1125 1129 #ListKernelModules() { 1126 1130 #local output q … … 1140 1144 if [ ! -e "$fname" ] ; then 1141 1145 echo "Warning - $fname does not exist; cannot be LDD'd." >> $LOGFILE 1142 if echo $fname | grep lvm &> /dev/null ; then1143 echo "This warning only affects you if you are using LVM." >> $LOGFILE1144 if lsmod | grep lvm &> /dev/null ; then1145 echo "I think you are, so please take heed!" >> $LOGFILE1146 # LogIt "Where is liblvm? You need it."1147 else1148 echo "I don't think you are, so don't worry about it." >> $LOGFILE1149 fi1150 fi1146 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 1151 1155 elif [ -h "$fname" ] && [ -x "$fname" ] ; then 1152 echo "$fname is softlink" >> $LOGFILE1156 echo "$fname is softlink" >> $LOGFILE 1153 1157 # echo "$fname will not be LDD'd. It is a softlink to `WhatSoftlinkPointsTo $fname`, which should already be in queue to be analyzed." >> $LOGFILE 1154 1158 # echo "$fname" … … 1377 1381 all_partitions="" 1378 1382 1379 if [ -d "/proc/lvm" ] || [ -d "/dev/mapper" ]; then1383 if [ $LVM != "false" ]; then 1380 1384 echo -en "\rAnalyzing LVM...\r" 1381 1385 all_partitions=`$MINDI_LIB/analyze-my-lvm | grep -F ">>>" | cut -d' ' -f2-32` … … 1387 1391 done 1388 1392 [ "$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 1390 1394 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" 1391 1395 for c_p in $all_partitions ; do … … 1418 1422 actual_dev="" 1419 1423 1420 # 1st try : blkid, the good way 1424 # 1st try : blkid, the good way for all LABEL 1421 1425 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 1423 1440 fi 1424 1441 1425 1442 # 2nd try, which works on a standard partition (ext2/3), but not on swap 1443 # For LVM gives a /dev/mapper entry 1426 1444 if [ "x$actual_dev" = "x" ]; then 1427 1445 actual_dev=`/bin/mount -l | /bin/grep "\[$redhat_label\]" | /bin/cut -d' ' -f1` 1428 1446 fi 1429 1447 1430 # 3rd try, with vol_id (which works with swap) 1448 # 3rd try, with vol_id 1449 # SWAP only 1431 1450 if [ "x$actual_dev" = "x" -a -x "/sbin/vol_id" ]; then 1432 1451 list_swaps=`cat /proc/swaps | /bin/grep "/dev/" | /bin/awk '{ print $1 }' ` … … 1441 1460 1442 1461 # 4th try : pre-formated LABEL. Format is : LABEL=SWAP-mydevice. e.g. : LABEL=SWAP-hda5 1462 # SWAP only 1443 1463 if [ "x$actual_dev" = "x" -a _"`echo $current_partition | /bin/grep -i 'LABEL=SWAP'`" != _"" ]; then 1444 1464 try_dev="`echo "$redhat_label" | /bin/cut -d '-' -f2`" … … 1453 1473 current_partition=$actual_dev 1454 1474 else 1455 Die "Your system uses a labelled swap partition, but you lack the tool to support it.\nPlease replace swaplabels 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" 1456 1476 fi 1457 1477 else … … 1459 1479 fi 1460 1480 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 fstab1463 # for LVM partitions but use /dev/mapper/<VG>-<LV> instead. Fortunately,1464 # the former is then a link to the latter, so we test whether1465 # $current_partition is actually such a link or not and set1466 # $current_lvolume accordingly. Note that $current_lvolume may well be an1467 # ordinary device. It is just to make sure that we feed the right value1468 # into any of the LVM tools if possible.1469 if [ -d "/dev/mapper" ] && [ -z "`lvm lvdisplay $current_partition 2> /dev/null`" ]; then1470 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 fi1473 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 1474 1494 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" 1488 1516 [ "$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 1509 1600 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" 1563 1606 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 1581 1608 done 1582 1609 } … … 1611 1638 rm -f $1.tmp 1612 1639 if [ "$CDRECOVERY" != "yes" ] ; then 1613 if [ -e "$MONDO_TMP/ start-nfs" ] ; then1640 if [ -e "$MONDO_TMP/NFS-DEV" ] ; then 1614 1641 echo -en "Press <enter> to continue.\n" >> $1 1615 1642 elif [ ! "$MONDO_TMP" ] ; then … … 1694 1721 cd $TMP_ROOT/iso/isolinux 1695 1722 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" ] ; then1697 mv isolinux.cfg isolinux.cfg.old1698 sed s/interactive/iso/ isolinux.cfg.old > isolinux.cfg1723 if [ -e "$MONDO_TMP/NFS-DEV" ] ; then 1724 mv isolinux.cfg isolinux.cfg.old 1725 sed s/interactive/iso/ isolinux.cfg.old > isolinux.cfg 1699 1726 fi 1700 1727 if [ "$ARCH" != "ia64" ] ; then 1701 1728 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 ../ 1703 1730 fi 1704 1731 cd $TMP_ROOT/iso … … 1708 1735 [ "$MONDO_SHARE" ] && cp -f $MONDO_SHARE/autorun . 1709 1736 if [ -d "/home/MondoCD" ] ; then 1710 cp -pRdu /home/MondoCD/* .1737 cp -pRdu /home/MondoCD/* . 1711 1738 fi 1712 1739 if [ "$ARCH" != "ia64" ] ; then … … 1748 1775 if [ "`DidMondoCallMe`" ] ; then 1749 1776 if [ "$CDRECOVERY" != "yes" ] ; then 1750 if [ -e "$MONDO_TMP/ start-nfs" ] ; then1777 if [ -e "$MONDO_TMP/NFS-DEV" ] ; then 1751 1778 echo -en "Press <enter> to continue.\n" 1752 1779 elif [ ! "$MONDO_TMP" ] ; then … … 1856 1883 echo -en "default=RESTORE\n" 1857 1884 elif [ "$disksize" -gt "2880" ] && [ "`DidMondoCallMe`" ] ; then 1858 if [ -e "$MONDO_TMP/ start-nfs" ] ; then1885 if [ -e "$MONDO_TMP/NFS-DEV" ] ; then 1859 1886 echo -en "default=iso\n" 1860 1887 else … … 1877 1904 elif [ "$disksize" -gt "2880" ] ; then 1878 1905 if [ "`DidMondoCallMe`" ] ; then 1879 if [ -e "$MONDO_TMP/ start-nfs" ] ; then1906 if [ -e "$MONDO_TMP/NFS-DEV" ] ; then 1880 1907 options="iso" 1881 1908 else … … 2103 2130 # tar -zxf $MINDI_LIB/dev.tgz || LogIt "Cannot untar dev.tgz\n" <--- present for LILO; is it nec. for SYSLINUX too? 2104 2131 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" ] ; then2132 if [ -e "$MONDO_TMP/NFS-DEV" ] ; then 2106 2133 mv syslinux.cfg syslinux.cfg.orig 2107 2134 sed s/interactive/iso/ syslinux.cfg.orig > syslinux.cfg … … 2292 2319 cp -f $TMP_ROOT/mountlist.txt $CACHE_LOC 2293 2320 [ "`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 2296 2322 cat $minidir_root/$noof_disks/tmp/mountlist.txt >> $LOGFILE 2297 2323 ZipMinidirsIntoTarballs $minidir_root $tardir $noof_disks … … 2840 2866 list_of_groovy_mods="$CDROM_MODS `WhichOfTheseModulesAreLoaded "$SCSI_MODS"`" 2841 2867 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 2844 2869 # For PXE boot 2845 2870 list_of_groovy_mods="$list_of_groovy_mods $NET_MODS" … … 3044 3069 mkdir -p $MONDO_ROOT 3045 3070 3071 if [ -d "/proc/lvm" ]; then 3072 # LVM v1 3073 LVMCMD="" 3074 LVM="v1" 3075 elif [ -d "/dev/mapper" ]; then 3076 # LVM v2 3077 LVMCMD="lvm" 3078 LVM="v2" 3079 else 3080 LVM="false" 3081 fi 3082 3046 3083 if [ "$#" -ge "2" ] ; then 3047 3084 if [ "$1" = "--max-compressed-size" ] ; then
Note:
See TracChangeset
for help on using the changeset viewer.