[Fai-commit] r6008 - in branches/stable/3.4: debian lib

Michael Prokop mika at alioth.debian.org
Tue Aug 17 12:56:11 UTC 2010


Author: mika
Date: 2010-08-17 12:56:09 +0000 (Tue, 17 Aug 2010)
New Revision: 6008

Modified:
   branches/stable/3.4/debian/changelog
   branches/stable/3.4/lib/mkramdisk
   branches/stable/3.4/lib/subroutines
Log:
* mkramdisks: add option -a, remove use of FAI_NORAMDISK, use FAI_RAMDISKS * subroutines: adjust to new option of mkramdisks


Signed-off-by: Michael Prokop <mika at grml.org>

Modified: branches/stable/3.4/debian/changelog
===================================================================
--- branches/stable/3.4/debian/changelog	2010-08-17 12:56:06 UTC (rev 6007)
+++ branches/stable/3.4/debian/changelog	2010-08-17 12:56:09 UTC (rev 6008)
@@ -62,6 +62,9 @@
   * make-fai-nfsroot: remove variable $FAI_BOOT
   * fcopy: do not copy file if preinst script fails (closes: #573044)
     thanks to Andreas Schuldei for the patch
+  * mkramdisks: add option -a, remove use of FAI_NORAMDISK,
+    use FAI_RAMDISKS
+  * subroutines: adjust to new option of mkramdisks
   
   [ Michael Tautschnig ]
   * control: Move setup-storage to its own package (fai-setup-storage). Thanks

Modified: branches/stable/3.4/lib/mkramdisk
===================================================================
--- branches/stable/3.4/lib/mkramdisk	2010-08-17 12:56:06 UTC (rev 6007)
+++ branches/stable/3.4/lib/mkramdisk	2010-08-17 12:56:09 UTC (rev 6008)
@@ -64,20 +64,35 @@
 
 size= # no default size
 umount=0
+useall=0
 
-while getopts ns:u opt ; do
+# mkramdisk
+
+
+
+while getopts ans:u opt ; do
     case "$opt" in
-        u) umount=1 ;;
-        s) size="-o size=$OPTARG" ;;
-        n) mtab="-n" ;;
+    # -a: mount all dirs listed in FAI_RAMDISKS instead of dirs given as arguments
+        a) useall=1 ;;
+        u) umount=1 ;;       # umount instead of mount
+        s) size="-o size=$OPTARG" ;; # give size of ramdisk
+        n) mtab="-n" ;;      # do not wirte to /etc/mtab
         esac
 done
 shift $(($OPTIND - 1))
 
-# do not use the ramdisk if FAI_NORAMDISK is set to 1
-[ X$FAI_NORAMDISK = X1 ] && exit 0
+if [ -n "$FAI_NORAMDISK" ]; then
+    echo "The use of \$FAI_NORAMDISK is now deprecated. Please use \$FAI_RAMDISKS instead."
+    exit 99
+fi
 
-for d in "$@"; do
+# set default dirs if FAI_RAMDISKS not already set
+: ${FAI_RAMDISKS:="$target/var/lib/dpkg"}
+
+# use arguments $@ unless -a was specified
+[ $useall -eq 0 ] && FAI_RAMDISKS=$@
+
+for d in $FAI_RAMDISKS; do
     if [ $umount -eq 1 ]; then
 	umount_ramdisk $d
     else

Modified: branches/stable/3.4/lib/subroutines
===================================================================
--- branches/stable/3.4/lib/subroutines	2010-08-17 12:56:06 UTC (rev 6007)
+++ branches/stable/3.4/lib/subroutines	2010-08-17 12:56:09 UTC (rev 6008)
@@ -544,7 +544,7 @@
 	# list if dhelp.postinst is starting an index process in the
 	# bg which did not finished until the installation was finished. 
 	[ -f /etc/init.d/udev ] && umount $FAI_ROOT/dev
-	mkramdisk -u $target/var/lib/dpkg 2>/dev/null
+	mkramdisk -au 2>/dev/null
     }
     trap 'clean_exit' INT QUIT EXIT
 
@@ -805,7 +805,7 @@
     # copy crypttab, if setup-storage created one
     [ -f $LOGDIR/crypttab ] && cp -p $LOGDIR/crypttab $FAI_ROOT/etc/crypttab
     # make /var/lib/dpkg a ramdisk
-    mkramdisk $target/var/lib/dpkg
+    mkramdisk -a
 }
 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 ### BEGIN SUBROUTINE INFO
@@ -920,7 +920,7 @@
 	swapoff -a
     fi
 
-    mkramdisk -u $target/var/lib/dpkg # umount ramdisk
+    mkramdisk -au # umount ramdisk
     # undo fake of all programs made by fai
     fai-divert -R
     rm -f $FAI_ROOT/etc/apt/apt.conf.d/{10,90}fai




More information about the Fai-commit mailing list