- Timestamp:
- Aug 4, 2006, 12:02:27 PM (19 years ago)
- Location:
- branches/stable/mindi/rootfs/sbin
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mindi/rootfs/sbin/init
r739 r740 464 464 LogIt "Warning - /tmp/mondo-restore.cfg not found" 465 465 fi 466 467 #468 # Create NFS configuration469 #470 cat > /sbin/start-nfs << EOF471 #!/bin/sh472 #473 # number of ping474 #475 ipcount=3476 477 # Get info from config file478 ipdev=`grep nfs-dev /tmp/mondo-restore.cfg | cut -d' ' -f2-`479 ipaddress=`grep nfs-client-ipaddr /tmp/mondo-restore.cfg | cut -d' ' -f2-`480 ipnetmask=`grep nfs-client-netmask /tmp/mondo-restore.cfg | cut -d' ' -f2-`481 ipbroadcast=`grep nfs-client-broadcast /tmp/mondo-restore.cfg | cut -d' ' -f2-`482 ipgateway=`grep nfs-client-defgw /tmp/mondo-restore.cfg | cut -d' ' -f2-`483 ipconf=""484 nfsmount=`grep nfs-server-mount /tmp/mondo-restore.cfg | cut -d' ' -f2-`485 imgname=`grep iso-prefix /tmp/mondo-restore.cfg | cut -d' ' -f2-`486 if [ "\$imgname" = "" ]; then487 imgname="mondorescue"488 fi489 dirimg=`grep nfs-server-path /tmp/mondo-restore.cfg | cut -d' ' -f2-`490 if [ "\$dirimg" = "" ]; then491 dirimg="/"492 fi493 494 # info from cmdline are predominent495 for i in `cat /proc/cmdline` ; do496 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 done501 502 if [ \$ipdev = "" ] && [ \$ipconf = "" ]; then503 # No network configuration neither stored during archive504 # nor on cmdline so no network wanted => exiting505 exit 0506 else507 LogIt "Starting Network..."508 fi509 510 # Activate loobback511 ifconfig lo 127.0.0.1512 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 \$ipdev518 else519 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`525 fi526 echo "Configuring \$ipdev statically (\$ipaddress/\$ipnetmask)"527 ifconfig \$ipdev \$ipaddress netmask \$ipnetmask broadcast \$ipbroadcast528 route add default gw \$ipgateway529 fi530 531 # ping server helps waking interface up532 LogIt "Pinging NFS server..."533 nfs_server_ipaddr=`echo \$nfsmount | cut -d: -f1`534 ping -c \$ipcount \$nfs_server_ipaddr535 536 # Finally mounts the NFS share537 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.iso542 mount -o ro -t iso9660 /dev/loop7 /mnt/cdrom543 EOF544 chmod 755 /sbin/start-nfs545 466 546 467 if [ "`grep -i 'tape ' /tmp/mondo-restore.cfg`" ] || [ "`grep -i udev /tmp/mondo-restore.cfg`" ] ; then
Note:
See TracChangeset
for help on using the changeset viewer.