Changeset 690 in MondoRescue
- Timestamp:
- Jul 21, 2006, 2:49:52 AM (18 years ago)
- Location:
- branches/stable
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mindi/mindi
r682 r690 1337 1337 [ "$IMAGE_DEVS" != "" ] && all_partitions="`echo "$all_partitions $IMAGE_DEVS" | tr ' ' '\n' | sort -u | tr '\n ' ' '`" 1338 1338 printf " %-15s %-15s %-15s %-15s\n" DEVICE MOUNTPOINT FORMAT "SIZE (MB)" 1339 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" 1339 1340 for c_p in $all_partitions ; do 1340 1341 # echo "c_p = $c_p" > /dev/stderr 1341 [ "`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 1342 [ "`echo "/dev/scd0 /dev/scd1 /dev/sr0 /dev/sr1 /dev/cdrom /dev/cdrom1" | grep -F "$c_p"`" ] && continue 1342 [ "`echo "$useless_dev" | grep -F "$c_p"`" != "" ] || [ "`echo "$c_p" | grep ":"`" != "" ] && continue 1343 1343 [ "`echo "$c_p" | grep -x "/dev/cdroms.*"`" ] && continue 1344 1344 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 1345 1345 current_partition=`ResolveSoftlink $c_p` 1346 1346 [ "`echo "$current_partition" | grep -F "/dev/mapper"`" != "" ] && current_partition="$c_p" 1347 [ "`echo " /dev/scd0 /dev/scd1 /dev/sr0 /dev/sr1 /dev/cdrom /dev/cdrom1" | grep -F "$current_partition"`" ] && continue1347 [ "`echo "$useless_dev" | grep -F "$current_partition"`" ] && continue 1348 1348 else 1349 1349 current_partition="$c_p" 1350 1350 fi 1351 1351 [ "$c_p" = "none" ] && continue 1352 redhat_label="" 1352 1353 absolute_partition=`ResolveSoftlink $c_p` 1353 1354 partition_mountpt=`tr -s '\t' ' ' < $MY_FSTAB | /bin/grep -w "$current_partition" | /bin/grep -vx " *#.*" | $AWK '{print $2}' | head -n1` … … 1360 1361 actual_dev="" 1361 1362 1362 # 1st try : blkid, the good way1363 if [ -x "/sbin/blkid" ]; then1364 actual_dev=`/sbin/blkid | /bin/grep "$current_partition" | /bin/cut -d':' -f1`1365 fi1366 1367 # 2nd try, which works on a standard partition (ext2/3), but not on swap1368 if [ "x$actual_dev" = "x" ]; then1369 actual_dev=`/bin/mount -l | /bin/grep "\[$redhat_label\]" | /bin/cut -d' ' -f1`1370 fi1371 1372 # 3rd try, with vol_id (which works with swap)1373 if [ "x$actual_dev" = "x" -a -x "/sbin/vol_id" ]; then1363 # 1st try : blkid, the good way 1364 if [ -x "/sbin/blkid" ]; then 1365 actual_dev=`/sbin/blkid | /bin/grep "$current_partition" | /bin/cut -d':' -f1` 1366 fi 1367 1368 # 2nd try, which works on a standard partition (ext2/3), but not on swap 1369 if [ "x$actual_dev" = "x" ]; then 1370 actual_dev=`/bin/mount -l | /bin/grep "\[$redhat_label\]" | /bin/cut -d' ' -f1` 1371 fi 1372 1373 # 3rd try, with vol_id (which works with swap) 1374 if [ "x$actual_dev" = "x" -a -x "/sbin/vol_id" ]; then 1374 1375 list_swaps=`cat /proc/swaps | /bin/grep "/dev/" | /bin/awk '{ print $1 }' ` 1375 1376 for dev_swap in $list_swaps ; do … … 1380 1381 fi 1381 1382 done 1382 fi1383 1384 # 4th try : pre-formated LABEL. Format is : LABEL=SWAP-mydevice. e.g. : LABEL=SWAP-hda51385 if [ "x$actual_dev" = "x" -a _"`echo $current_partition | /bin/grep -i 'LABEL=SWAP'`" != _"" ]; then1383 fi 1384 1385 # 4th try : pre-formated LABEL. Format is : LABEL=SWAP-mydevice. e.g. : LABEL=SWAP-hda5 1386 if [ "x$actual_dev" = "x" -a _"`echo $current_partition | /bin/grep -i 'LABEL=SWAP'`" != _"" ]; then 1386 1387 try_dev="`echo "$redhat_label" | /bin/cut -d '-' -f2`" 1387 1388 present_dev="`/bin/cat /proc/swaps | /bin/grep -w /dev/$try_dev`" … … 1389 1390 actual_dev="/dev/$try_dev" 1390 1391 fi 1391 fi1392 1393 # Check if one of all those tries has known success1394 if [ "x$actual_dev" != "x" ]; then1392 fi 1393 1394 # Check if one of all those tries has known success 1395 if [ "x$actual_dev" != "x" ]; then 1395 1396 current_partition=$actual_dev 1397 else 1398 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" 1399 fi 1396 1400 else 1397 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" 1398 fi 1399 else 1400 str_to_find_fmt_with=$current_partition 1401 fi 1401 str_to_find_fmt_with=$current_partition 1402 fi 1402 1403 1403 1404 partition_format=`$AWK '$1 == "'"$str_to_find_fmt_with"'" {print $3}' $MY_FSTAB` -
branches/stable/tools/build2pkg
r659 r690 85 85 cat $log 86 86 status=-1 87 else 88 egrep '^Wrote:' $log 89 rpmlint `egrep '^Wrote:' $log | cut -d: -f2` 87 90 fi 88 egrep '^Wrote:' $log89 91 rm -rf ${TOPBUILDDIR}/BUILD/* 90 92 cd ..
Note:
See TracChangeset
for help on using the changeset viewer.