Changeset 729 in MondoRescue for trunk/mindi/mindi
- Timestamp:
- Jul 30, 2006, 4:06:39 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/mindi/mindi
r687 r729 124 124 FLOPPY_MODS="ide-floppy floppy" 125 125 TAPE_MODS="ht st osst ide-tape ide_tape" 126 SCSI_MODS="3w-xxxx 53c7,8xx a100u2w a320raid aacraid advansys aha152x aha1542 aha1740 aic79xx aic79xx_mod aic7xxx aic7xxx_mod aic7xxx_old AM53C974 atp870u BusLogic cciss cpqfc dmx3191d dpt_i2o dtc eata eata_dma eata_pio fdomain gdth g_NCR5380 i de-scsi ieee1394 imm in2000 initio ips iscsi isp megaraid mptbase mptscsih NCR53c406a ncr53c8xx nsp32 pas16 pci2000 pci2220i pcmcia ppa psi240i qla1280 qlogicfas qlogicfc qlogicisp raw1394 scsi_debug scsi_mod sd_mod seagate sg sim710 sr_mod sym53c416 sym53c8xx sym53c8xx_2 t128 tmscsim u14-34f ultrastor wd7000 vmhgfs"126 SCSI_MODS="3w-xxxx 53c7,8xx a100u2w a320raid aacraid advansys aha152x aha1542 aha1740 aic79xx aic79xx_mod aic7xxx aic7xxx_mod aic7xxx_old AM53C974 atp870u BusLogic cciss cpqfc dmx3191d dpt_i2o dtc eata eata_dma eata_pio fdomain gdth g_NCR5380 i2o_block i2o_core ide-scsi ieee1394 imm in2000 initio ips iscsi isp megaraid mptbase mptscsih NCR53c406a ncr53c8xx nsp32 pas16 pci2000 pci2220i pcmcia ppa psi240i qla1280 qla2200 qla2300 qlogicfas qlogicfc qlogicisp raw1394 scsi_debug scsi_mod sd_mod seagate sg sim710 sr_mod sym53c416 sym53c8xx sym53c8xx_2 t128 tmscsim u14-34f ultrastor wd7000 vmhgfs" 127 127 128 128 # ide-probe-mod … … 821 821 done 822 822 if [ "$incoming" = "LVMFILES:" ] ; then 823 incoming=`ReadLine`824 lvmversion=""823 incoming=`ReadLine` 824 lvmversion="" 825 825 while [ "$incoming" != "" ] ; do 826 826 if echo "$incoming" | grep -x " *#.*" &> /dev/null ; then 827 # echo "Skipping '$incoming'" 828 incoming=`ReadLine` 829 continue 827 incoming=`ReadLine` 828 continue 830 829 fi 831 830 filelist=`GenerateListForFile "$incoming"` … … 833 832 lvmresolved=`ResolveSoftlink $tool` 834 833 if [ "$tool" == "$lvmresolved" ]; then 835 echo "$tool" >> $tempfile834 echo "$tool" >> $tempfile 836 835 elif echo "$lvmresolved" | grep "lvmiopversion" &> /dev/null ; then 837 if [ "$lvmversion" = "" ] ; then838 lvmversion=`$lvmresolved`839 echo "$lvmresolved" >> $tempfile840 fi841 toolstripped=`echo $tool | $AWK -F / '{print $NF;}'`842 if [ "$lvmversion" == "200" ]; then843 # pvdata and lvmcreate_initrd don't exist in LVM2844 case "$toolstripped" in845 "pvdata")846 continue847 ;;848 "lvmcreate_initrd")849 continue850 ;;851 esac852 fi853 toolpath="/sbin/lvm-"$lvmversion"/"$toolstripped854 if [ -e "$toolpath" ] ; then855 echo "$toolpath" >> $tempfile856 echo "$tool" >> $tempfile857 else858 toolpath="/lib/lvm-"$lvmversion"/"$toolstripped859 fi860 if [ -e "$toolpath" ] ; then861 echo "$toolpath" >> $tempfile862 echo "$tool" >> $tempfile863 else864 echo "Where are your LVM-Tools? Couldn't find $tool"865 fi866 else867 echo "$tool" >> $tempfile868 fi836 if [ "$lvmversion" = "" ] ; then 837 lvmversion=`$lvmresolved` 838 echo "$lvmresolved" >> $tempfile 839 fi 840 toolstripped=`echo $tool | $AWK -F / '{print $NF;}'` 841 if [ "$lvmversion" == "200" ]; then 842 # pvdata and lvmcreate_initrd don't exist in LVM2 843 case "$toolstripped" in 844 "pvdata") 845 continue 846 ;; 847 "lvmcreate_initrd") 848 continue 849 ;; 850 esac 851 fi 852 toolpath="/sbin/lvm-"$lvmversion"/"$toolstripped 853 if [ -e "$toolpath" ] ; then 854 echo "$toolpath" >> $tempfile 855 echo "$tool" >> $tempfile 856 else 857 toolpath="/lib/lvm-"$lvmversion"/"$toolstripped 858 fi 859 if [ -e "$toolpath" ] ; then 860 echo "$toolpath" >> $tempfile 861 echo "$tool" >> $tempfile 862 else 863 echo "Where are your LVM-Tools? Couldn't find $tool" 864 fi 865 else 866 echo "$tool" >> $tempfile 867 fi 869 868 done 870 869 progress=$(($progress+1)) … … 1389 1388 [ "$IMAGE_DEVS" != "" ] && all_partitions="`echo "$all_partitions $IMAGE_DEVS" | tr ' ' '\n' | sort -u | tr '\n ' ' '`" 1390 1389 printf " %-15s %-15s %-15s %-15s\n" DEVICE MOUNTPOINT FORMAT "SIZE (MB)" 1390 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 1391 for c_p in $all_partitions ; do 1392 1392 # echo "c_p = $c_p" > /dev/stderr 1393 [ "`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" | grep -F "$c_p"`" != "" ] || [ "`echo "$c_p" | grep -F "/dev/scd"`" != "" ] || [ "`echo "$c_p" | grep -F "/dev/ram"`" != "" ] || [ "`echo "$c_p" | grep ":"`" != "" ] || [ "`echo "$c_p" | grep -F ":/"`" != "" ] && continue 1394 [ "`echo "/dev/scd0 /dev/scd1 /dev/sr0 /dev/sr1 /dev/cdrom /dev/cdrom1" | grep -F "$c_p"`" ] && continue 1393 [ "`echo "$useless_dev" | grep -F "$c_p"`" != "" ] || [ "`echo "$c_p" | grep ":"`" != "" ] && continue 1395 1394 [ "`echo "$c_p" | grep -x "/dev/cdroms.*"`" ] && continue 1396 1395 if [ -h "$c_p" ] && [ "`echo "$c_p" | grep -F "/dev/hd"`" = "" ] && [ "`echo "$c_p" | grep -F "/dev/sd"`" = "" ] && [ "`echo "$c_p" | grep -F "/dev/md"`" = "" ] ; then 1397 1396 current_partition=`ResolveSoftlink $c_p` 1398 1397 [ "`echo "$current_partition" | grep -F "/dev/mapper"`" != "" ] && current_partition="$c_p" 1399 [ "`echo " /dev/scd0 /dev/scd1 /dev/sr0 /dev/sr1 /dev/cdrom /dev/cdrom1" | grep -F "$current_partition"`" ] && continue1398 [ "`echo "$useless_dev" | grep -F "$current_partition"`" ] && continue 1400 1399 else 1401 1400 current_partition="$c_p" 1402 1401 fi 1403 1402 [ "$c_p" = "none" ] && continue 1403 redhat_label="" 1404 1404 absolute_partition=`ResolveSoftlink $c_p` 1405 1405 partition_mountpt=`tr -s '\t' ' ' < $MY_FSTAB | /bin/grep -w "$current_partition" | /bin/grep -vx " *#.*" | $AWK '{print $2}' | head -n1` 1406 1407 # Detects noauto partitions not mounted and exclude them 1408 partition_option=`tr -s '\t' ' ' < $MY_FSTAB | /bin/grep -w "$current_partition" | /bin/grep -vx " *#.*" | $AWK '{print $4}' | head -n1` 1409 if [ "`echo "$partition_option" | grep -i noauto`" != "" ] && [ "`mount | grep -w "$partition_mountpt"`" = "" ] ; then 1410 continue 1411 fi 1406 1412 1407 1413 # This part tries to retrieve the correct device from a LABEL line in /etc/fstab … … 1412 1418 actual_dev="" 1413 1419 1414 # 1st try : blkid, the good way1415 if [ -x "/sbin/blkid" ]; then1416 actual_dev=`/sbin/blkid | /bin/grep "$current_partition" | /bin/cut -d':' -f1`1417 fi1418 1419 # 2nd try, which works on a standard partition (ext2/3), but not on swap1420 if [ "x$actual_dev" = "x" ]; then1421 actual_dev=`/bin/mount -l | /bin/grep "\[$redhat_label\]" | /bin/cut -d' ' -f1`1422 fi1423 1424 # 3rd try, with vol_id (which works with swap)1425 if [ "x$actual_dev" = "x" -a -x "/sbin/vol_id" ]; then1420 # 1st try : blkid, the good way 1421 if [ -x "/sbin/blkid" ]; then 1422 actual_dev=`/sbin/blkid | /bin/grep "$current_partition" | /bin/cut -d':' -f1` 1423 fi 1424 1425 # 2nd try, which works on a standard partition (ext2/3), but not on swap 1426 if [ "x$actual_dev" = "x" ]; then 1427 actual_dev=`/bin/mount -l | /bin/grep "\[$redhat_label\]" | /bin/cut -d' ' -f1` 1428 fi 1429 1430 # 3rd try, with vol_id (which works with swap) 1431 if [ "x$actual_dev" = "x" -a -x "/sbin/vol_id" ]; then 1426 1432 list_swaps=`cat /proc/swaps | /bin/grep "/dev/" | /bin/awk '{ print $1 }' ` 1427 1433 for dev_swap in $list_swaps ; do … … 1432 1438 fi 1433 1439 done 1434 fi1435 1436 # 4th try : pre-formated LABEL. Format is : LABEL=SWAP-mydevice. e.g. : LABEL=SWAP-hda51437 if [ "x$actual_dev" = "x" -a _"`echo $current_partition | /bin/grep -i 'LABEL=SWAP'`" != _"" ]; then1440 fi 1441 1442 # 4th try : pre-formated LABEL. Format is : LABEL=SWAP-mydevice. e.g. : LABEL=SWAP-hda5 1443 if [ "x$actual_dev" = "x" -a _"`echo $current_partition | /bin/grep -i 'LABEL=SWAP'`" != _"" ]; then 1438 1444 try_dev="`echo "$redhat_label" | /bin/cut -d '-' -f2`" 1439 1445 present_dev="`/bin/cat /proc/swaps | /bin/grep -w /dev/$try_dev`" … … 1441 1447 actual_dev="/dev/$try_dev" 1442 1448 fi 1443 fi1444 1445 # Check if one of all those tries has known success1446 if [ "x$actual_dev" != "x" ]; then1449 fi 1450 1451 # Check if one of all those tries has known success 1452 if [ "x$actual_dev" != "x" ]; then 1447 1453 current_partition=$actual_dev 1454 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" 1456 fi 1448 1457 else 1449 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\n" 1450 fi 1451 else 1452 str_to_find_fmt_with=$current_partition 1453 fi 1458 str_to_find_fmt_with=$current_partition 1459 fi 1454 1460 1455 1461 partition_format=`$AWK '$1 == "'"$str_to_find_fmt_with"'" {print $3}' $MY_FSTAB` … … 1552 1558 elif [ "$partition_mountpt" = "" ] && [ -f "/etc/raidtab" ] ; then 1553 1559 if [ "`grep -F device /etc/raidtab 2>/dev/null | grep -F $current_partition`" ] ; then 1554 partition_mountpt=raid1555 partition_format=raid1560 partition_mountpt=raid 1561 partition_format=raid 1556 1562 printf "\t%-15s %-15s %-15s %7s %-15s\n" $current_partition $partition_mountpt $partition_format $psz "$redhat_label" 1557 1563 printf "%s %s %s %s %s\n" $current_partition $partition_mountpt $partition_format $partition_size "$redhat_label" >> $mountlist 1558 1564 else 1559 echo "Unknown mountpoint (outstring = $unofficial_outstring)" >> $LOGFILE1565 echo "Unknown mountpoint (outstring = $unofficial_outstring)" >> $LOGFILE 1560 1566 fi 1561 1567 elif [ "$partition_format" = "" ] ; then
Note:
See TracChangeset
for help on using the changeset viewer.