Changeset 687 in MondoRescue for trunk/mindi
- Timestamp:
- Jul 17, 2006, 3:39:42 PM (19 years ago)
- Location:
- trunk/mindi
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/mindi/ChangeLog
r672 r687 3 3 MINDI CHANGES 4 4 5 1.0. 8-4 (2006-06-10)5 1.0.9 (2006-06-26) 6 6 - nfsmount option added to allow redeployment from another NFS server (Bruno Cornec) 7 - Replaced all occurrences of egrep with 'grep -E' and of fgrep with 'grep -F' (Andree Leidenfrost) 8 - Fix a bug in analyze-my-lvm for RHEL3 where vgdisplay prints an additional 9 field sometimes (#) (severine.lombardo_at_acoss.fr/Bruno Cornec) 10 - Deal properly with LVM tool lvmiopversion and with lvmcreate_initrd and pvdata - fixes Debian bug #351687 (Andree Leidenfrost) 11 - Handle the format /dev/mapper/<VG>-<LV> for LVM devices - fix for Debian bug #362926 (Andree Leidenfrost) 7 12 8 13 1.0.8-3 (2006-06-07) -
trunk/mindi/README.pxe
r672 r687 22 22 mountpoint is the mount point on the NFS server to use (should be in /etc/exports of the NFS server) 23 23 24 The initrd and kernel file come rom the first bootable media24 The initrd and kernel file come from the first bootable media 25 25 created by mondoarchive. To get them, please issue: 26 26 -
trunk/mindi/analyze-my-lvm
r350 r687 1 #!/bin/ sh1 #!/bin/bash 2 2 # 3 3 # $Id$ … … 169 169 170 170 ListLvmDrivesAndPartitions() { 171 $LVMCMD vgdisplay -v |grep "PV Name" | awk '{print $3}'171 $LVMCMD vgdisplay -v |grep "PV Name" | sed 's/(#)//' | awk '{print $3}' 172 172 } 173 173 -
trunk/mindi/mindi
r618 r687 206 206 207 207 AbortIfMkfsVfatMissing() { 208 #if fgrep"vfat" /etc/fstab &> /dev/null ; then208 #if grep -F "vfat" /etc/fstab &> /dev/null ; then 209 209 if ! which mkfs.vfat &> /dev/null ; then 210 210 Die "mkfs.vfat missing from your filesystem - please install your dosfstools RPM or DEB package. Perhaps your PATH environmental variable is broken, too?" … … 303 303 mkdir -p $bigdir/etc 304 304 cp --parents -pRdf $mappath $bigdir || LogIt "AKMF -- Could not copy $mappath to $bigdir\n" 305 if [ "`echo $mappath | fgrep".gz"`" ] ; then306 included_list=`gzip -dc $mappath | fgrep -i include | sed s/'"'// | sed s/'"'// | cut -d' ' -f2`307 else 308 included_list=` fgrep -i include $mappath | sed s/'"'// | sed s/'"'// | cut -d' ' -f2`305 if [ "`echo $mappath | grep -F ".gz"`" ] ; then 306 included_list=`gzip -dc $mappath | grep -Fi include | sed s/'"'// | sed s/'"'// | cut -d' ' -f2` 307 else 308 included_list=`grep -Fi include $mappath | sed s/'"'// | sed s/'"'// | cut -d' ' -f2` 309 309 fi 310 310 for included_item in $included_list ; do 311 311 if [ ! -e "$included_item" ] ; then 312 sss=`find $KEYDIR/keymaps | fgrep"${included_item}.inc"`313 [ "$sss" = "" ] && sss=`find $KEYDIR/keymaps | fgrep"$included_item"`312 sss=`find $KEYDIR/keymaps | grep -F "${included_item}.inc"` 313 [ "$sss" = "" ] && sss=`find $KEYDIR/keymaps | grep -F "$included_item"` 314 314 for ii in $sss ; do 315 315 [ -e "$ii" ] && AddKeyboardMappingFile $ii … … 340 340 scratchfile=$TMP_ROOT/blah.$$.dat 341 341 cp -f $filename $scratchfile || Die "CUACF -- cannot copy $filename to $scratchfile - did you run out of disk space?" 342 [ "`head $scratchfile -n1 | fgrep"bin/sh"`" != "" ] && StripComments $scratchfile "-$filename-"343 [ "`echo "$filename" | fgrep"etc/termcap"`" != "" ] && StripComments $scratchfile "-$filename-"344 if [ "`echo "$filename" | fgrep"lib/modules/" | grep "\.*o\.gz"`" != "" ] ; then342 [ "`head $scratchfile -n1 | grep -F "bin/sh"`" != "" ] && StripComments $scratchfile "-$filename-" 343 [ "`echo "$filename" | grep -F "etc/termcap"`" != "" ] && StripComments $scratchfile "-$filename-" 344 if [ "`echo "$filename" | grep -F "lib/modules/" | grep "\.*o\.gz"`" != "" ] ; then 345 345 mv $scratchfile $scratchfile.gz 346 346 gunzip -f $scratchfile || LogIt "Cannot gunzip $scratchfile.gz\n" … … 523 523 524 524 res=0 525 [ "`ps ax | fgrep"mondoarchive" | grep -v "grep"`" ] && res=$(($res+1))525 [ "`ps ax | grep -F "mondoarchive" | grep -v "grep"`" ] && res=$(($res+1)) 526 526 [ -f "/var/run/monitas-mondo.pid" ] && res=$(($res+1)) 527 527 [ "$res" -gt "1" ] && echo "yes" … … 542 542 cd / 543 543 544 my_partitions=`mount | fgrep$$ | cut -f1 -d' '`544 my_partitions=`mount | grep -F $$ | cut -f1 -d' '` 545 545 [ "$my_partitions" != "" ] && umount $my_partitions 546 546 # BCO : Too Dangerous !!! … … 589 589 ln -sf $vanilla_lib_name $outdir$optimized_lib_name 590 590 echo "Excluding $optimized_lib_name" >> $LOGFILE 591 fgrep -vx "$optimized_lib_name $filelist" > $filelist.tmp591 grep -Fvx "$optimized_lib_name $filelist" > $filelist.tmp 592 592 echo "Replacing it with $vanilla_lib_name" >> $LOGFILE 593 593 echo "$vanilla_lib_name" >> $filelist.tmp … … 647 647 fi 648 648 echo "keyfile=$keyfile" >> $LOGFILE 649 locale=` fgrepKEYTABLE "$keyfile" | tr -d '"' |cut -d'=' -f2`649 locale=`grep -F KEYTABLE "$keyfile" | tr -d '"' |cut -d'=' -f2` 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" | fgrep"${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 654 for i in $mp ; do … … 711 711 LILO_EXE=lilo 712 712 fi 713 $LILO_EXE -V | fgrep"21.6" > /dev/null && Die "Please upgrade LILO. Your verison has a serious bug. If you're not _using_ LILO, fine, uninstall it. :)"713 $LILO_EXE -V | grep -F "21.6" > /dev/null && Die "Please upgrade LILO. Your verison has a serious bug. If you're not _using_ LILO, fine, uninstall it. :)" 714 714 else 715 715 LILO_EXE=`which false` … … 832 832 for tool in $filelist ; do 833 833 lvmresolved=`ResolveSoftlink $tool` 834 if echo "$lvmresolved" | grep "lvmiopversion" &> /dev/null ; then 834 if [ "$tool" == "$lvmresolved" ]; then 835 echo "$tool" >> $tempfile 836 elif echo "$lvmresolved" | grep "lvmiopversion" &> /dev/null ; then 835 837 if [ "$lvmversion" = "" ] ; then 836 838 lvmversion=`$lvmresolved` … … 838 840 fi 839 841 toolstripped=`echo $tool | $AWK -F / '{print $NF;}'` 842 if [ "$lvmversion" == "200" ]; then 843 # pvdata and lvmcreate_initrd don't exist in LVM2 844 case "$toolstripped" in 845 "pvdata") 846 continue 847 ;; 848 "lvmcreate_initrd") 849 continue 850 ;; 851 esac 852 fi 840 853 toolpath="/sbin/lvm-"$lvmversion"/"$toolstripped 841 854 if [ -e "$toolpath" ] ; then … … 923 936 fi 924 937 fi 925 tr ' ' '\n' < $outfile.pre | tr -s '/' '/' | fgrep -vx "" | sort -u | egrep -v "/libX11|/libXext|/libXi|/libgtk|/libgdk" > $outfile938 tr ' ' '\n' < $outfile.pre | tr -s '/' '/' | grep -Fvx "" | sort -u | grep -Ev "/libX11|/libXext|/libXi|/libgtk|/libgdk" > $outfile 926 939 rm -f $tempfile $outfile.pre 927 940 [ "$res" -eq "0" ] && echo -e "\r\t\t\t\t\t\t\t\t$DONE" || echo "\nFailed." … … 1020 1033 > $outfile 1021 1034 partlist=$(mount | cut -d' ' -f1,3,5 \ 1022 | egrep -v "((none|/tmp|/ISOs|/proc|/dev/root) )|/mnt/" \1035 | grep -Ev "((none|/tmp|/ISOs|/proc|/dev/root) )|/mnt/" \ 1023 1036 | tr ' ' '|') 1024 1037 … … 1074 1087 path=$1 1075 1088 echo -en "In the directory '$path' you will find the images:-\n" 1076 for fname in `ls $path | fgrepmindi-` ; do1089 for fname in `ls $path | grep -F mindi-` ; do 1077 1090 printf "%19s " $fname 1078 1091 done … … 1103 1116 echo "module $module --> $r" >> $LOGFILE 1104 1117 [ "$r" ] && echo "$r" 1105 [ -f "$oss" ] && find $oss | fgrep$module1118 [ -f "$oss" ] && find $oss | grep -F $module 1106 1119 done 1107 1120 find /lib/modules/$kern/modules.* -type f 2> /dev/null … … 1177 1190 location=`echo "$path/$fname_to_find" | tr -s '/' '/'` 1178 1191 if echo "$location" | grep "lib/lib" 2> /dev/null ; then 1179 loclist=`find $path -maxdepth 1 | fgrep"$fname_to_find"`1192 loclist=`find $path -maxdepth 1 | grep -F "$fname_to_find"` 1180 1193 else 1181 1194 loclist=$location … … 1191 1204 done 1192 1205 # resolved=`file $location | $AWK '{print $NF;}'` 1193 # if [ "`echo "$resolved" | fgrep"/"`" = "" ] ; then1206 # if [ "`echo "$resolved" | grep -F "/"`" = "" ] ; then 1194 1207 # stub=`dirname $location` 1195 1208 # output="/$stub/$resolved $output" … … 1343 1356 partition_size partition_format outstring partition_number \ 1344 1357 partition_mountpt c_p lwm_info psz lvm_dev unofficial_outstring \ 1345 absolute_partition old_partition_fmt 1358 absolute_partition old_partition_fmt current_lvolume 1346 1359 1347 1360 echo "Your raw fstab file looks like this:-" >> $LOGFILE … … 1367 1380 if [ -d "/proc/lvm" ] || [ -d "/dev/mapper" ]; then 1368 1381 echo -en "\rAnalyzing LVM...\r" 1369 all_partitions=`$MINDI_LIB/analyze-my-lvm | fgrep">>>" | cut -d' ' -f2-32`1382 all_partitions=`$MINDI_LIB/analyze-my-lvm | grep -F ">>>" | cut -d' ' -f2-32` 1370 1383 fi 1371 1384 all_partitions="$all_partitions `ListAllPartitions 2> /dev/null`" 1372 1385 # echo "all partitions = $all_partitions" > /dev/stderr 1373 1386 for i in $IMAGE_DEVS ; do 1374 mount | fgrep"$i " > /dev/null 2> /dev/null && Die "Sorry, $i is already mounted! CANNOT DO IMAGEDEV on it if it's mounted."1387 mount | grep -F "$i " > /dev/null 2> /dev/null && Die "Sorry, $i is already mounted! CANNOT DO IMAGEDEV on it if it's mounted." 1375 1388 done 1376 1389 [ "$IMAGE_DEVS" != "" ] && all_partitions="`echo "$all_partitions $IMAGE_DEVS" | tr ' ' '\n' | sort -u | tr '\n ' ' '`" … … 1378 1391 for c_p in $all_partitions ; do 1379 1392 # 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":/"`" != "" ] && continue1381 [ "`echo "/dev/scd0 /dev/scd1 /dev/sr0 /dev/sr1 /dev/cdrom /dev/cdrom1" | fgrep"$c_p"`" ] && continue1393 [ "`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 1382 1395 [ "`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"`" = "" ] ; then1396 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 1384 1397 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"`" ] && continue1398 [ "`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"`" ] && continue 1387 1400 else 1388 1401 current_partition="$c_p" … … 1441 1454 1442 1455 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 1456 # Some distributions such as Debian do not put /dev/<VG>/<LV> in fstab 1457 # for LVM partitions but use /dev/mapper/<VG>-<LV> instead. Fortunately, 1458 # the former is then a link to the latter, so we test whether 1459 # $current_partition is actually such a link or not and set 1460 # $current_lvolume accordingly. Note that $current_lvolume may well be an 1461 # ordinary device. It is just to make sure that we feed the right value 1462 # into any of the LVM tools if possible. 1463 if [ -d "/dev/mapper" ] && [ -z "`lvm lvdisplay $current_partition 2> /dev/null`" ]; then 1464 partition_stub="`echo "$current_partition" | sed "s|^/dev/mapper/|/dev/|" | cut -d"-" -f1`" 1465 current_lvolume="`find /dev -lname "$current_partition" | grep "^$partition_stub"`" 1466 fi 1467 if [ -z "$current_lvolume" ]; then 1468 current_lvolume="$current_partition" 1469 fi 1470 # End of LVM device style variation code (other than $current_lvolume). 1471 if [ -d "/proc/lvm" ] && [ "`lvdisplay $current_lvolume 2> /dev/null`" ]; then 1444 1472 partition_size="lvm" 1445 elif [ -d "/dev/mapper" ] && [ "`lvm lvdisplay $current_ partition2> /dev/null`" ]; then1473 elif [ -d "/dev/mapper" ] && [ "`lvm lvdisplay $current_lvolume 2> /dev/null`" ]; then 1446 1474 partition_size="lvm" 1447 1475 else … … 1450 1478 [ "`echo "$current_partition" | grep -c "^/"`" -ne "1" ] && continue 1451 1479 if [ "$partition_format" = "swap" ] || [ "$partition_mountpt" = "swap" ] ; then 1452 partition_size=` fgrep -v "Priority" /proc/swaps | tr -s '\t' ' ' | fgrep"$current_partition" | $AWK '{print $3}'`1480 partition_size=`grep -Fv "Priority" /proc/swaps | tr -s '\t' ' ' | grep -F "$current_partition" | $AWK '{print $3}'` 1453 1481 [ "$partition_mountpt" != "swap" ] && partition_mountpt="swap" 1454 1482 [ "$partition_format" != "swap" ] && partition_format="swap" … … 1456 1484 totalsize=0 1457 1485 items=0 1458 for i in `tr -s ' ' '\t' < /proc/swaps | fgrep -v "Filename" | cut -f3` ; do1486 for i in `tr -s ' ' '\t' < /proc/swaps | grep -Fv "Filename" | cut -f3` ; do 1459 1487 totalsize=$(($totalsize+$i)) 1460 1488 items=$(($items+1)) … … 1469 1497 [ "$partition_format" = "swap" ] && partition_mountpt="swap" 1470 1498 if [ "$partition_mountpt" = "" ] ; then 1471 if [ "`pvdisplay $current_ partition 2> /dev/null`" != "" ] || [ "`lvm pvdisplay $current_partition2> /dev/null`" != "" ] ; then1472 if [ "` fgrepdevice /etc/raidtab 2> /dev/null | grep -w $current_partition`" ] ; then1499 if [ "`pvdisplay $current_lvolume 2> /dev/null`" != "" ] || [ "`lvm pvdisplay $current_lvolume 2> /dev/null`" != "" ] ; then 1500 if [ "`grep -F device /etc/raidtab 2> /dev/null | grep -w $current_partition`" ] ; then 1473 1501 partition_mountpt="raid" 1474 1502 partition_format="raid" 1475 1503 else 1476 # lvm_dev="`pvdisplay $current_ partition| grep -i "VG N" | head -n1 | tr -s ' ' ' ' | cut -d' ' -f3`"1504 # lvm_dev="`pvdisplay $current_lvolume | grep -i "VG N" | head -n1 | tr -s ' ' ' ' | cut -d' ' -f3`" 1477 1505 partition_mountpt="lvm" 1478 1506 partition_format="lvm" … … 1483 1511 echo "Examining $current_partition (mount=$partition_mountpt fmt=$partition_format psz=$psz)" >> $LOGFILE 1484 1512 [ "$psz" != "lvm" ] && psz=$(($psz/1024)) 1485 if [ "`echo " $IMAGE_DEVS " | fgrep" $current_partition "`" != "" ] ; then1513 if [ "`echo " $IMAGE_DEVS " | grep -F " $current_partition "`" != "" ] ; then 1486 1514 partition_mountpt="image" 1487 1515 old_partition_fmt=$partition_format … … 1498 1526 fi 1499 1527 fi 1500 if [ "$EXCLUDE_DEVS" ] && [ "`echo " $EXCLUDE_DEVS " | fgrep" $current_partition "`" ] || [ "`echo " $EXCLUDE_DEVS " | grep " $current_partition "`" ] ; then1528 if [ "$EXCLUDE_DEVS" ] && [ "`echo " $EXCLUDE_DEVS " | grep -F " $current_partition "`" ] || [ "`echo " $EXCLUDE_DEVS " | grep " $current_partition "`" ] ; then 1501 1529 echo "Excluding $current_partition from mountlist" >> $LOGFILE 1502 1530 continue … … 1512 1540 if [ "$partition_format" = "Compaq diagnostics" ] ; then 1513 1541 partition_format="compaq" 1514 elif [ ! "` fgrepdevice /etc/raidtab 2> /dev/null | grep -w $current_partition`" ] ; then1542 elif [ ! "`grep -F device /etc/raidtab 2> /dev/null | grep -w $current_partition`" ] ; then 1515 1543 LogIt "Unable to find mountpoint of $current_partition - ignoring\n" 1516 1544 continue … … 1523 1551 echo "Unknown partition (outstring = $unofficial_outstring)" >> $LOGFILE 1524 1552 elif [ "$partition_mountpt" = "" ] && [ -f "/etc/raidtab" ] ; then 1525 if [ "` fgrep device /etc/raidtab 2>/dev/null | fgrep$current_partition`" ] ; then1553 if [ "`grep -F device /etc/raidtab 2>/dev/null | grep -F $current_partition`" ] ; then 1526 1554 partition_mountpt=raid 1527 1555 partition_format=raid … … 1569 1597 rmdir $1 1570 1598 echo -en " " > $1 1571 if [ "` fgrep -i "debian" /etc/issue.net 2> /dev/null`" ] ; then1599 if [ "`grep -Fi "debian" /etc/issue.net 2> /dev/null`" ] ; then 1572 1600 sed s/ZZZZZ/$MINDI_VERSION/ $MINDI_LIB/msg-txt | sed s/YYYYY/"Mondo Rescue"/ | sed s/XXXXX/"a cousin of"/ | sed s%DDDDD%"Debian GNU\/`uname -s` `cut -d ' ' -f 3 /etc/issue.net` `hostname`"% | sed s/KKKKK/"Kernel `uname -r` on a `uname -m`"/ | sed s/TTTTT/"`LC_TIME=C date`"/ >> $1.tmp 1573 1601 else … … 1623 1651 return 1 1624 1652 } 1625 1626 1627 1628 1653 1629 1654 … … 1709 1734 local disksize 1710 1735 disksize=$1 1711 if [ "` fgrep -i "debian" /etc/issue.net 2> /dev/null`" ] ; then1736 if [ "`grep -Fi "debian" /etc/issue.net 2> /dev/null`" ] ; then 1712 1737 sed s/ZZZZZ/$MINDI_VERSION/ $MINDI_LIB/msg-txt | sed s/YYYYY/"Mondo Rescue"/ | sed s/XXXXX/"a cousin of"/ | sed s%DDDDD%"Debian GNU\/`uname -s` `cut -d ' ' -f 3 /etc/issue.net` `hostname`"% | sed s/KKKKK/"Kernel `uname -r` on a `uname -m`"/ | sed s/TTTTT/"`LC_TIME=C date`"/ 1713 1738 else … … 2000 2025 fi 2001 2026 if [ $? -ne "0" ] ; then 2002 if [ "` fgrep"/tmp/dev.0" $LOGFILE`" ] ; then2027 if [ "`grep -F "/tmp/dev.0" $LOGFILE`" ] ; then 2003 2028 LogIt "The '/tmp/dev.0' error is NOT Mindi's fault. It is LILO's.\n" 2004 2029 LogIt "Please reboot your PC as a workaround.\n" … … 2454 2479 local devpath drive res stub 2455 2480 device=$1 2456 if [ "`echo "$device" | fgrep"/dev/md"`" != "" ] ; then2481 if [ "`echo "$device" | grep -F "/dev/md"`" != "" ] ; then 2457 2482 res=`SizeOfRaidPartition $device` 2458 2483 [ "$res" = "" ] && Die "Cannot find $device's size - is your /etc/raidtab sane?" … … 2467 2492 echo "------- $FDISK log end ------------" >> $LOGFILE 2468 2493 # end patch 2469 [ "$res" = "" ] && res=`df -k -P -x supermount | tr -s '\t' ' ' | fgrep"$device " | cut -d' ' -f2`2494 [ "$res" = "" ] && res=`df -k -P -x supermount | tr -s '\t' ' ' | grep -F "$device " | cut -d' ' -f2` 2470 2495 [ "$res" = "" ] && res="-1" 2471 2496 echo $res … … 2579 2604 root="/" 2580 2605 fi 2581 for fname in `find $root -maxdepth 2 -type f | fgrep lin | egrep -v '^/proc/|^/net/'` ; do2606 for fname in `find $root -maxdepth 2 -type f | grep -F lin | grep -Ev '^/proc/|^/net/'` ; do 2582 2607 [ ! -e "$fname" ] && continue 2583 2608 [ "$fname" = "/boot/vmlinuz.shipped" ] && [ -f "/boot/vmlinuz" ] && continue; # ignore SuSE's extra kernel … … 2591 2616 [ "$fkern_ver" = "" ] && continue 2592 2617 # echo "$fname --> $fkern_ver (but we want $we_want_version)" >> /dev/stderr 2593 [ "`echo "$fkern_ver" | fgrep"$we_want_version "`" = "" ] && continue2618 [ "`echo "$fkern_ver" |grep -F "$we_want_version "`" = "" ] && continue 2594 2619 [ -f "$fname" ] || continue 2595 2620 [ -h "$fname" ] && continue … … 2598 2623 if [ "$?" -eq "0" ] ; then 2599 2624 # Used by ia64 2600 if [ "`gzip -cd $fname | strings 2> /dev/null | fgrep"$kdate"`" = "" ] ; then2625 if [ "`gzip -cd $fname | strings 2> /dev/null | grep -F "$kdate"`" = "" ] ; then 2601 2626 LogIt "Have you recompiled your kernel \"$fname\" w/o rebooting? Naughty but I'll allow it...\n" 2602 2627 duff_kernels="$fname $duff_kernels" 2603 2628 else 2604 [ "`echo "$fname" | fgrep"vmlinux"`" ] && continue2629 [ "`echo "$fname" | grep -F "vmlinux"`" ] && continue 2605 2630 possible_kernels="$fname $possible_kernels" 2606 2631 fi 2607 2632 else 2608 if [ "`strings $fname 2> /dev/null | fgrep"$kdate"`" = "" ] ; then2633 if [ "`strings $fname 2> /dev/null | grep -F "$kdate"`" = "" ] ; then 2609 2634 LogIt "Have you recompiled your kernel \"$fname\" w/o rebooting?\n Naughty but I'll allow it...\n" 2610 2635 duff_kernels="$fname $duff_kernels" 2611 2636 else 2612 [ "`echo "$fname" | fgrep"vmlinux"`" ] && continue2637 [ "`echo "$fname" | grep -F "vmlinux"`" ] && continue 2613 2638 possible_kernels="$fname $possible_kernels" 2614 2639 fi … … 2651 2676 fi 2652 2677 done 2653 if echo " $possible_kernels " | fgrep"/boot/vmlinuz " &> /dev/null ; then2678 if echo " $possible_kernels " | grep -F "/boot/vmlinuz " &> /dev/null ; then 2654 2679 output=/boot/vmlinuz 2655 2680 echo "Schlomo, this one's for you." >> $LOGFILE … … 2680 2705 old_pwd=`pwd` 2681 2706 cd $bigdir 2682 list_of_files=`GetFileSizeList . | sort -nr | cut -f2 | fgrep -v "/dev/"`2707 list_of_files=`GetFileSizeList . | sort -nr | cut -f2 | grep -Fv "/dev/"` 2683 2708 progress=0 2684 2709 total_files=`CountItemsIn "$list_of_files"` … … 2827 2852 echo "Adding $i ($s KB) to the rootfs" >> $LOGFILE 2828 2853 cp -df $i $mountpoint/ || LogIt "Unable to copy $i to $mountpoint\n" 2829 [ "`echo "$i" | fgrep".gz"`" ] && gunzip -f $mountpoint/`basename $i`2854 [ "`echo "$i" | grep -F ".gz"`" ] && gunzip -f $mountpoint/`basename $i` 2830 2855 done 2831 2856 # if [ -e "/dev/.devfsd" ] ; then … … 2877 2902 WhichOfTheseModulesAreLoaded() { 2878 2903 local modname loaded_modules 2879 loaded_modules=" `lsmod | tr -s ' ' '\t' | cut -f1 | fgrep -vx "Modules" | tr '\n' ' '` "2904 loaded_modules=" `lsmod | tr -s ' ' '\t' | cut -f1 | grep -Fvx "Modules" | tr '\n' ' '` " 2880 2905 for modname in $1 ; do 2881 [ "`echo "$loaded_modules" | fgrep" $modname "`" ] && echo "$modname"2906 [ "`echo "$loaded_modules" | grep -F " $modname "`" ] && echo "$modname" 2882 2907 done 2883 2908 } … … 2991 3016 fi 2992 3017 FixPathIfBroken 2993 [ -f "$MINDI_LIB/vmlinuz" ] && FAILSAFE_KVER=`strings $MINDI_LIB/vmlinuz 2> /dev/null | egrep"2\.[46]" | cut -d' ' -f1`3018 [ -f "$MINDI_LIB/vmlinuz" ] && FAILSAFE_KVER=`strings $MINDI_LIB/vmlinuz 2> /dev/null | grep -E "2\.[46]" | cut -d' ' -f1` 2994 3019 AbortIfMkfsVfatMissing 2995 3020 ### BCO … … 3001 3026 FindLiloBinary 3002 3027 fi 3003 fgrep " $TMP_ROOT " /proc/mounts | fgreptmpfs > /dev/null 2> /dev/null && TMP_ROOT=/home && LogIt "Changing TMP_ROOT to $TMP_ROOT because you're using tmpfs for /tmp\n" ; # tmpfs doesn't like Mindi and /tmp, for some reason3028 grep -F " $TMP_ROOT " /proc/mounts | grep -F tmpfs > /dev/null 2> /dev/null && TMP_ROOT=/home && LogIt "Changing TMP_ROOT to $TMP_ROOT because you're using tmpfs for /tmp\n" ; # tmpfs doesn't like Mindi and /tmp, for some reason 3004 3029 rm -f /tmp/mindi_lo 3005 3030 trap "Aborted" SIGTERM
Note:
See TracChangeset
for help on using the changeset viewer.