[Fai-commit] r3419 - trunk/lib
fai-repository at svn.debian.org
fai-repository at svn.debian.org
Tue Apr 18 13:42:48 UTC 2006
Author: lange
Date: 2006-04-18 13:42:47 +0000 (Tue, 18 Apr 2006)
New Revision: 3419
Added:
trunk/lib/mkrw
Modified:
trunk/lib/subroutines-linux
Log:
move mkrw() and mkrwsize() to external script
Added: trunk/lib/mkrw
===================================================================
--- trunk/lib/mkrw 2006-04-18 13:37:56 UTC (rev 3418)
+++ trunk/lib/mkrw 2006-04-18 13:42:47 UTC (rev 3419)
@@ -0,0 +1,42 @@
+#! /bin/bash
+
+#*********************************************************************
+#
+# This script is part of FAI (Fully Automatic Installation)
+# (c) 2003-2006 by Thomas Lange, lange at informatik.uni-koeln.de
+# Universitaet zu Koeln
+#
+#*********************************************************************
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+mkrwsize() {
+
+ # save all dirs and files under directory $2
+ # mount tmpfs on top of dir $2
+ # extrace dirs and files into tmpfs
+
+ if [ ! -d "$2" ]; then
+ echo "WARNING: $2 is not a directory. Cannot make it writeable."
+ return
+ fi
+
+ local tmp1=$(mktemp) || exit 12
+ tar -C $2 -cf $tmp1 .
+ mount -o size=$1 -t tmpfs tmpfs $2
+ tar -C $2 -xf $tmp1
+ rm -f $tmp1
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+size=10m # default size
+
+while getopts s: opt ; do
+ case "$opt" in
+ s) size="$OPTARG" ;;
+ esac
+done
+shift $(($OPTIND - 1))
+
+for f in "$@"; do
+ mkrwsize $size $f
+done
Modified: trunk/lib/subroutines-linux
===================================================================
--- trunk/lib/subroutines-linux 2006-04-18 13:37:56 UTC (rev 3418)
+++ trunk/lib/subroutines-linux 2006-04-18 13:42:47 UTC (rev 3419)
@@ -212,31 +212,3 @@
return $?
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-mkrwsize() {
-
- # save all dirs and files under directory $2
- # mount tmpfs on top of dir $2
- # extrace dirs and files into tmpfs
-
- if [ ! -d "$2" ]; then
- echo "WARNING: $2 is not a directory. Cannot make it writeable."
- return
- fi
-
- local tmp1=$(mktemp) || exit 12
- tar -C $2 -cf $tmp1 .
- mount -o size=$1 -t tmpfs tmpfs $2
- tar -C $2 -xf $tmp1
- rm -f $tmp1
-}
-# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-mkrw() {
-
- # make a list of directories writeable
- local size=10m # default size
-
- for f in "$@"; do
- mkrwsize $size $f
- done
-}
-# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
More information about the Fai-commit
mailing list