- Timestamp:
- Aug 4, 2006, 11:54:47 AM (19 years ago)
- Location:
- branches/stable/mindi
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mindi/mindi
r735 r739 1445 1445 items=0 1446 1446 for i in `tr -s ' ' '\t' < /proc/swaps | grep -Fv "Filename" | cut -f3` ; do 1447 totalsize=$(($totalsize+$i))1448 items=$(($items+1))1447 totalsize=$(($totalsize+$i)) 1448 items=$(($items+1)) 1449 1449 done 1450 1450 [ "$items" -gt "0" ] && partition_size=$(($totalsize/$items)) || partition_size=0 1451 1451 [ "$partition_size" -lt "125000" ] && partition_size=125000 1452 1452 echo "I'm guessing $c_p is $(($partition_size/1024))MB" >> $LOGFILE … … 1458 1458 if [ "$partition_mountpt" = "" ] ; then 1459 1459 if [ "`pvdisplay $current_lvolume 2> /dev/null`" != "" ] || [ "`lvm pvdisplay $current_lvolume 2> /dev/null`" != "" ] ; then 1460 if [ "`grep -F device /etc/raidtab 2> /dev/null | grep -w $current_partition`" ] ; then1461 partition_mountpt="raid"1462 partition_format="raid"1463 else1464 # lvm_dev="`pvdisplay $current_lvolume | grep -i "VG N" | head -n1 | tr -s ' ' ' ' | cut -d' ' -f3`"1465 partition_mountpt="lvm"1466 partition_format="lvm"1467 fi1460 if [ "`grep -F device /etc/raidtab 2> /dev/null | grep -w $current_partition`" ] ; then 1461 partition_mountpt="raid" 1462 partition_format="raid" 1463 else 1464 # lvm_dev="`pvdisplay $current_lvolume | grep -i "VG N" | head -n1 | tr -s ' ' ' ' | cut -d' ' -f3`" 1465 partition_mountpt="lvm" 1466 partition_format="lvm" 1467 fi 1468 1468 fi 1469 1469 fi … … 1473 1473 if [ "`echo " $IMAGE_DEVS " | grep -F " $current_partition "`" != "" ] ; then 1474 1474 partition_mountpt="image" 1475 1475 old_partition_fmt=$partition_format 1476 1476 # partition_format="`$FDISK -l 2>> $LOGFILE | tr -s '\t' ' ' | grep -w "$absolute_partition" | $AWK 'x=$(NF-1}'`" 1477 1477 partition_format="`$FDISK -l 2>> $LOGFILE | tr '*' ' ' | tr '+' ' ' | tr -s ' ' '\t' | grep -w "$absolute_partition" | cut -f5`" 1478 1479 1480 1478 echo "------- $FDISK -l log ------------" >> $LOGFILE 1479 cat $FDISKLOG >> $LOGFILE 1480 echo "------- $FDISK log end ------------" >> $LOGFILE 1481 1481 partition_size=$(($partition_size+1)); # just in case 1482 1483 1484 1485 1486 1487 fi 1488 1489 1490 1491 1492 1482 if [ "$partition_format" = "Linux" ] ; then 1483 echo "Are you imaging a mounted swap partition? Silly..." >> $LOGFILE 1484 echo "Reverting format from $old_partition_fmt to $partition_format" >> $LOGFILE 1485 partition_format=$old_partition_fmt 1486 fi 1487 fi 1488 if [ "$EXCLUDE_DEVS" ] && [ "`echo " $EXCLUDE_DEVS " | grep -F " $current_partition "`" ] || [ "`echo " $EXCLUDE_DEVS " | grep " $current_partition "`" ] ; then 1489 echo "Excluding $current_partition from mountlist" >> $LOGFILE 1490 continue 1491 fi 1492 if [ ! "$partition_mountpt" ] ; then 1493 1493 for qq in "" `find /dev/ida/c*d* ! -name '*p*'` ; do 1494 partition_format=`$FDISK -l $qq 2>> $LOGFILE | grep -w "$c_p" | sed 's/12/|/' | tr -s '\t' ' ' | cut -d'|' -f2 | cut -d' ' -f2-9`1495 1496 1497 1498 [ "$partition_format" ] && break1494 partition_format=`$FDISK -l $qq 2>> $LOGFILE | grep -w "$c_p" | sed 's/12/|/' | tr -s '\t' ' ' | cut -d'|' -f2 | cut -d' ' -f2-9` 1495 echo "------- $FDISK -l $qq log ------------" >> $LOGFILE 1496 cat $FDISKLOG >> $LOGFILE 1497 echo "------- $FDISK log end ------------" >> $LOGFILE 1498 [ "$partition_format" ] && break 1499 1499 done 1500 1500 if [ "$partition_format" = "Compaq diagnostics" ] ; then 1501 partition_format="compaq"1501 partition_format="compaq" 1502 1502 elif [ ! "`grep -F device /etc/raidtab 2> /dev/null | grep -w $current_partition`" ] ; then 1503 LogIt "Unable to find mountpoint of $current_partition - ignoring\n"1504 continue1503 LogIt "Unable to find mountpoint of $current_partition - ignoring\n" 1504 continue 1505 1505 fi 1506 1506 fi … … 1519 1519 echo "Unknown mountpoint (outstring = $unofficial_outstring)" >> $LOGFILE 1520 1520 fi 1521 1521 elif [ "$partition_format" = "" ] ; then 1522 1522 echo "Unknown format (outstring = $unofficial_outstring)" >> $LOGFILE 1523 1523 elif [ "$partition_size" = "" ] ; then … … 1526 1526 continue 1527 1527 else 1528 1529 1530 1531 1528 if [ "$partition_format" = "dos" ] || [ "$partition_format" = "msdos" ] ; then 1529 echo "Stupid bastard..." >> $LOGFILE 1530 partition_format="vfat" 1531 fi 1532 1532 printf "\t%-15s %-15s %-15s %7s %-15s\n" $current_partition $partition_mountpt $partition_format $psz "$redhat_label" 1533 1533 printf "%s %s %s %s %s\n" $current_partition $partition_mountpt $partition_format $partition_size "$redhat_label" >> $mountlist -
branches/stable/mindi/rootfs/sbin/init
r737 r739 287 287 if [ -e "/tmp/i-want-my-lvm" ] ; then 288 288 LogIt "Scanning LVM's..." 1 289 if which lvm ; then290 MyInsmod dm-mod291 MyInsmod dm_mod292 lvm vgscan --mknodes293 else294 vgscan295 fi289 if which lvm ; then 290 MyInsmod dm-mod 291 MyInsmod dm_mod 292 lvm vgscan --mknodes 293 else 294 vgscan 295 fi 296 296 grep -E "^#.*vgchange" /tmp/i-want-my-lvm | sed "s/^#[ ]*//" > /tmp/start-lvm 297 297 chmod +x /tmp/start-lvm … … 484 484 nfsmount=`grep nfs-server-mount /tmp/mondo-restore.cfg | cut -d' ' -f2-` 485 485 imgname=`grep iso-prefix /tmp/mondo-restore.cfg | cut -d' ' -f2-` 486 if [ " $imgname" = "" ]; then486 if [ "\$imgname" = "" ]; then 487 487 imgname="mondorescue" 488 488 fi 489 489 dirimg=`grep nfs-server-path /tmp/mondo-restore.cfg | cut -d' ' -f2-` 490 if [ " $dirimg" = "" ]; then490 if [ "\$dirimg" = "" ]; then 491 491 dirimg="/" 492 492 fi … … 494 494 # info from cmdline are predominent 495 495 for i in `cat /proc/cmdline` ; do 496 echo $i | grep -qi ping= && ipcount=`echo$i | cut -d= -f2`497 echo $i | grep -qi ipconf= && ipconf=`echo$i | cut -d= -f2`498 echo $i | grep -qi nfsmount= && nfsmount=`echo$i | cut -d= -f2`499 echo $i | grep -qi prefix= && imgname=`echo$i | cut -d= -f2`496 echo \$i | grep -qi ping= && ipcount=`echo \$i | cut -d= -f2` 497 echo \$i | grep -qi ipconf= && ipconf=`echo \$i | cut -d= -f2` 498 echo \$i | grep -qi nfsmount= && nfsmount=`echo \$i | cut -d= -f2` 499 echo \$i | grep -qi prefix= && imgname=`echo \$i | cut -d= -f2` 500 500 done 501 501 502 if [ $ipdev = "" ] && [$ipconf = "" ]; then502 if [ \$ipdev = "" ] && [ \$ipconf = "" ]; then 503 503 # No network configuration neither stored during archive 504 504 # nor on cmdline so no network wanted => exiting … … 511 511 ifconfig lo 127.0.0.1 512 512 513 echo " $ipconf" | grep -q "dhcp"514 if [ $? -eq 0 ]; then515 ipdev=`echo $ipconf | cut -d: -f1`516 echo "Making DHCP request on $ipdev"517 udhcpc -i $ipdev513 echo "\$ipconf" | grep -q "dhcp" 514 if [ \$? -eq 0 ]; then 515 ipdev=`echo \$ipconf | cut -d: -f1` 516 echo "Making DHCP request on \$ipdev" 517 udhcpc -i \$ipdev 518 518 else 519 if [ " $ipconf" != "" ]; then520 ipdev=`echo $ipconf | cut -d: -f1`521 ipaddress=`echo $ipconf | cut -d: -f2`522 ipnetmask=`echo $ipconf | cut -d: -f3`523 ipbroadcast=`echo $ipconf | cut -d: -f4`524 ipgateway=`echo $ipconf | cut -d: -f5`519 if [ "\$ipconf" != "" ]; then 520 ipdev=`echo \$ipconf | cut -d: -f1` 521 ipaddress=`echo \$ipconf | cut -d: -f2` 522 ipnetmask=`echo \$ipconf | cut -d: -f3` 523 ipbroadcast=`echo \$ipconf | cut -d: -f4` 524 ipgateway=`echo \$ipconf | cut -d: -f5` 525 525 fi 526 echo "Configuring $ipdev statically ($ipaddress/$ipnetmask)"527 ifconfig $ipdev $ipaddress netmask $ipnetmask broadcast$ipbroadcast528 route add default gw $ipgateway526 echo "Configuring \$ipdev statically (\$ipaddress/\$ipnetmask)" 527 ifconfig \$ipdev \$ipaddress netmask \$ipnetmask broadcast \$ipbroadcast 528 route add default gw \$ipgateway 529 529 fi 530 530 531 531 # ping server helps waking interface up 532 532 LogIt "Pinging NFS server..." 533 nfs_server_ipaddr=`echo $nfsmount | cut -d: -f1`534 ping -c $ipcount$nfs_server_ipaddr533 nfs_server_ipaddr=`echo \$nfsmount | cut -d: -f1` 534 ping -c \$ipcount \$nfs_server_ipaddr 535 535 536 536 # Finally mounts the NFS share 537 LogIt "Mounting NFS share ( $nfsmount) on /tmp/isodir..."538 mount -t nfs -o nolock $nfsmount /tmp/isodir539 540 LogIt "Mounting NFS image $imgname-1.iso in$dirimg on /mnt/cdrom in loopback"541 losetup /dev/loop7 /tmp/isodir/ $dirimg/$imgname-1.iso537 LogIt "Mounting NFS share (\$nfsmount) on /tmp/isodir..." 538 mount -t nfs -o nolock \$nfsmount /tmp/isodir 539 540 LogIt "Mounting NFS image \$imgname-1.iso in \$dirimg on /mnt/cdrom in loopback" 541 losetup /dev/loop7 /tmp/isodir/\$dirimg/\$imgname-1.iso 542 542 mount -o ro -t iso9660 /dev/loop7 /mnt/cdrom 543 543 EOF -
branches/stable/mindi/rootfs/sbin/post-init
r273 r739 72 72 else 73 73 if [ "$iso$nuke$compare$interactive" != "" ] ; then 74 LogIt "FYI, this CD was made by Mindi, not Mondo." 1 75 exit 0 76 74 LogIt "FYI, this CD was made by Mindi, not Mondo." 1 75 exit 0 77 76 else 78 LogIt "Mindi-Linux has finished booting."77 LogIt "Mindi-Linux has finished booting." 79 78 fi 80 79 fi
Note:
See TracChangeset
for help on using the changeset viewer.