Changeset 2380 in MondoRescue for branches/2.2.9/mindi/rootfs
- Timestamp:
- Sep 9, 2009, 8:30:47 PM (16 years ago)
- Location:
- branches/2.2.9/mindi/rootfs/sbin
- Files:
-
- 1 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.9/mindi/rootfs/sbin/init
r2353 r2380 719 719 fi 720 720 if [ "`grep -i pxe /proc/cmdline`" ] || [ "`grep -i net /proc/cmdline`" ]; then 721 # We need to get here exported variables from start-n fs722 . /sbin/start-n fs721 # We need to get here exported variables from start-netfs 722 . /sbin/start-netfs 723 723 fi 724 724 … … 732 732 ExtractDataDisksAndLoadModules 733 733 # Fake the conf file to force it to NFS mode, even if we made originally a CD (mandatory for mondorestore to work correctly) 734 sed -i "s/backup-media-type.*/backup-media-type n fs/" /tmp/mondo-restore.cfg734 sed -i "s/backup-media-type.*/backup-media-type netfs/" /tmp/mondo-restore.cfg 735 735 elif [ "`grep -i usb= /proc/cmdline`" ] || [ "`grep -i usb /tmp/mondo-restore.cfg 2>/dev/null | grep media-type`" ]; then 736 736 . /sbin/start-usb … … 743 743 HandleCDROM 744 744 ExtractDataDisksAndLoadModules 745 # We need to get here exported variables from start-n fs746 . /sbin/start-n fs745 # We need to get here exported variables from start-netfs 746 . /sbin/start-netfs 747 747 fi 748 748 res=$? … … 843 843 LogIt "backup-media-type is specified in config file - great." 844 844 LogIt "Calling post-init" 845 # start-n fs moved it under /tmp as the NFS share is already unmounted845 # start-netfs moved it under /tmp as the NFS share is already unmounted 846 846 if [ "`echo $pre | grep -E '^/tmp/isodir'`" ]; then 847 847 post=`echo $pre | sed 's|^/tmp/isodir|/tmp|'` … … 861 861 echo $i | grep -qi post= && post=`echo $i | cut -d= -f2` 862 862 done 863 # start-n fs moved it under /tmp as the NFS share is already unmounted863 # start-netfs moved it under /tmp as the NFS share is already unmounted 864 864 if [ "`echo $post | grep -E '^/tmp/isodir'`" ]; then 865 865 post=`echo $post | sed 's|^/tmp/isodir|/tmp|'` -
branches/2.2.9/mindi/rootfs/sbin/start-netfs
r2377 r2380 3 3 # $Id$ 4 4 # 5 # This script sets up the network + N FS environment if needed.5 # This script sets up the network + Network FS environment if needed. 6 6 # 7 7 … … 11 11 12 12 # Get info from config file 13 ipdev=`grep nfs-dev /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-` 14 ipaddress=`grep nfs-client-ipaddr /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-` 15 ipnetmask=`grep nfs-client-netmask /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-` 16 ipbroadcast=`grep nfs-client-broadcast /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-` 17 ipgateway=`grep nfs-client-defgw /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-` 13 ipdev=`grep netfs-dev /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-` 14 ipaddress=`grep netfs-client-ipaddr /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-` 15 ipnetmask=`grep netfs-client-netmask /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-` 16 ipbroadcast=`grep netfs-client-broadcast /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-` 17 ipgateway=`grep netfs-client-defgw /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-` 18 proto=`grep netfs-proto /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-` 18 19 ipconf="" 19 20 pre="" 20 21 post="" 21 export n fsmount=`grep nfs-server-mount /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-`22 export netfsmount=`grep netfs-server-mount /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-` 22 23 export imgname=`grep iso-prefix /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-` 23 24 if [ "$imgname" = "" ]; then 24 25 export imgname="mondorescue" 25 26 fi 26 export dirimg=`grep n fs-server-path /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-`27 export dirimg=`grep netfs-server-path /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-` 27 28 if [ "$dirimg" = "" ]; then 28 29 export dirimg="/" … … 33 34 echo $i | grep -qi ping= && ipcount=`echo $i | cut -d= -f2` 34 35 echo $i | grep -qi ipconf= && ipconf=`echo $i | cut -d= -f2` 35 echo $i | grep -qi n fsmount= && export nfsmount=`echo $i | cut -d= -f2`36 echo $i | grep -qi netfsmount= && export netfsmount=`echo $i | cut -d= -f2` 36 37 echo $i | grep -qi prefix= && export imgname=`echo $i | cut -d= -f2` 37 echo $i | grep -qi n fspath= && export dirimg=`echo $i | cut -d= -f2`38 echo $i | grep -qi netfspath= && export dirimg=`echo $i | cut -d= -f2` 38 39 echo $i | grep -qi pre= && pre=`echo $i | cut -d= -f2` 39 40 echo $i | grep -qi post= && post=`echo $i | cut -d= -f2` 41 echo $i | grep -qi proto= && proto=`echo $i | cut -d= -f2` 40 42 done 41 43 … … 67 69 68 70 # ping server helps waking interface up 69 LogIt "Pinging NFSserver..."70 n fs_server_ipaddr=`echo $nfsmount | cut -d: -f1`71 ping -c $ipcount $n fs_server_ipaddr71 LogIt "Pinging Remote server..." 72 netfs_server_ipaddr=`echo $netfsmount | cut -d: -f1 | cut -d@ -f2` 73 ping -c $ipcount $netfs_server_ipaddr 72 74 73 # Finally mounts the NFS share 74 LogIt "Mounting NFS share ($nfsmount) on /tmp/isodir..." 75 touch /etc/mtab 76 mount -t nfs -o nolock,ro $nfsmount /tmp/isodir 75 # Which is our protocol for file sharing 76 if [ "$proto" = "" ]; then 77 LogIt "No protocol specified, defaulting to NFS" 78 $proto = "nfs" 79 fi 80 81 if [ "$proto" = "sshfs" ]; then 82 LogIt "Mounting SSHFS share ($netfsmount) on /tmp/isodir..." 83 sshfs -o ro $netfsmount /tmp/isodir 84 elif [ "$proto" != "" ]; then 85 LogIt "Mounting Network share ($netfsmount) on /tmp/isodir..." 86 touch /etc/mtab 87 mount -t $proto -o nolock,ro $netfsmount /tmp/isodir 88 else 89 LogIt "Unknown protocol $proto" 90 fi 77 91 78 LogIt "Mounting NFSimage ${imgname}-1.iso in $dirimg on /mnt/cdrom in loopback"92 LogIt "Mounting Remote image ${imgname}-1.iso in $dirimg on /mnt/cdrom in loopback" 79 93 mount -o ro,loop -t iso9660 /tmp/isodir/$dirimg/${imgname}-1.iso /mnt/cdrom 80 94 81 # Save the scripts on the N FSshare locally95 # Save the scripts on the Network share locally 82 96 if [ "`echo $pre | grep -E '^/tmp/isodir'`" ]; then 83 97 cp $pre /tmp
Note:
See TracChangeset
for help on using the changeset viewer.