[Fai-commit] r3474 - in people/mugwump/vserver: . lib

fai-commit at lists.alioth.debian.org fai-commit at lists.alioth.debian.org
Thu Jun 8 15:07:19 UTC 2006


Author: samv-guest
Date: 2006-05-02 20:56:55 +0000 (Tue, 02 May 2006)
New Revision: 3474

Modified:
   people/mugwump/vserver/
   people/mugwump/vserver/lib/mkrw
Log:
Support -n to not update /etc/mtab



Property changes on: people/mugwump/vserver
___________________________________________________________________
Name: svk:merge
   - d29f7b36-84ff-0310-85ce-ba787dbd31ca:/local/fai/people/mugwump/vserver:8122
   + d29f7b36-84ff-0310-85ce-ba787dbd31ca:/local/fai/people/mugwump/vserver:8123

Modified: people/mugwump/vserver/lib/mkrw
===================================================================
--- people/mugwump/vserver/lib/mkrw	2006-05-02 20:53:20 UTC (rev 3473)
+++ people/mugwump/vserver/lib/mkrw	2006-05-02 20:56:55 UTC (rev 3474)
@@ -28,13 +28,20 @@
 	rm $temp && return
     fi
 
+    if [ -n "$3" ]
+    then
+        n="-n";
+    else
+        n="";
+    fi
+
     local tmp1=$(mktemp) || exit 12
     tar -C $2 -cf $tmp1 .
-    mount -o size=$1 -t tmpfs tmpfs $2 2>/dev/null || (
+    mount $n -o size=$1 -t tmpfs tmpfs $2 2>/dev/null || (
 	dirname="`echo $2 | sed 's/\//_/g'`"
 	mkdir /tmp/$dirname
 	echo "Making $2 writable with a bind mount from /tmp/$dirname"
-	mount --bind /tmp/$dirname $2
+	mount $n --bind /tmp/$dirname $2
     )
     tar -C $2 -xf $tmp1
     rm -f $tmp1
@@ -43,13 +50,14 @@
 
 size=10m # default size
 
-while getopts s: opt ; do
+while getopts s:n opt ; do
     case "$opt" in
         s) size="$OPTARG" ;;
+        n) no_mount=1 ;;
         esac
 done
 shift $(($OPTIND - 1))
 
 for f in "$@"; do
-    mkrwsize $size $f
+    mkrwsize $size $f $no_mount
 done




More information about the Fai-commit mailing list