Changeset 2253 in MondoRescue


Ignore:
Timestamp:
Jul 5, 2009, 2:42:33 AM (15 years ago)
Author:
Bruno Cornec
Message:

r3165@localhost: bruno | 2009-07-03 17:08:03 +0200

  • Only mount /mnt/RESTORING if needed for script execution
  • Copy the NFS script under /tmp as it's unmounted before we can use it
Location:
branches/2.2.9/mindi/rootfs/sbin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.9/mindi/rootfs/sbin/init

    r2252 r2253  
    835835        echo $i | grep -qi script= && script=`echo $i | cut -d= -f2`
    836836    done
     837    # start-nfs moved it under /tmp as the NFS share is already unmounted
     838    if [ "`echo $script | grep -E '^/tmp/isodir'`" ]; then
     839        script=`echo $script | sed 's|^/tmp/isodir|/tmp|'`
     840    fi
    837841    if [ -x $script ]; then
    838842        echo "Executing final script $script"
    839843        LogIt "Executing final script $script"
    840         mount-me
     844        if [ "`echo $script | grep -E '^/mnt/RESTORING'`" ]; then
     845            mount-me
     846        fi
    841847        $script
    842         unmount-me
     848        if [ "`echo $script | grep -E '^/mnt/RESTORING'`" ]; then
     849            unmount-me
     850        fi
    843851    fi
    844852fi
  • branches/2.2.9/mindi/rootfs/sbin/start-nfs

    r2191 r2253  
    1717ipgateway=`grep nfs-client-defgw /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-`
    1818ipconf=""
     19script=""
    1920export nfsmount=`grep nfs-server-mount /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-`
    2021export imgname=`grep iso-prefix /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-`
     
    3435    echo $i | grep -qi prefix= && export imgname=`echo $i | cut -d= -f2`
    3536    echo $i | grep -qi nfspath= && export dirimg=`echo $i | cut -d= -f2`
     37    echo $i | grep -qi script= && script=`echo $i | cut -d= -f2`
    3638done
    3739
     
    7476    LogIt "Mounting NFS image ${imgname}-1.iso in $dirimg on /mnt/cdrom in loopback"
    7577    mount -o ro,loop -t iso9660 /tmp/isodir/$dirimg/${imgname}-1.iso /mnt/cdrom
     78
     79    # Save the script on the NFS share locally
     80    if [ echo "$script" | grep -E "^/tmp/isodir" ]; then
     81        cp $script /tmp
     82        LogIt "Copying $script under /tmp"
     83    fi
    7684fi
Note: See TracChangeset for help on using the changeset viewer.