Add support for specifying a debootstrap script.
authorDaniel Hokka Zakrisson <daniel@hozac.com>
Tue, 12 Sep 2006 11:21:38 +0000 (11:21 +0000)
committerDaniel Hokka Zakrisson <daniel@hozac.com>
Tue, 12 Sep 2006 11:21:38 +0000 (11:21 +0000)
git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@2298 94cd875c-1c1d-0410-91d2-eb244daf1a30

scripts/vserver-build
scripts/vserver-build.debootstrap

index b3f59c2..41fe0b7 100755 (executable)
@@ -64,7 +64,7 @@ Possible methods are:
     skeleton ... -- [<cmd> <args>*]
                 ...  installs a minimal skeleton filesystem, creates the
                     configuration file and calls an optional command then
-    debootstrap ... -- -d <distribution> [-m <mirror>] [-- <debootstrap-options>*]
+    debootstrap ... -- -d <distribution> [-m <mirror>] [-s <script> ] [-- <debootstrap-options>*]
                      bootstraps the vserver with Debian's 'debootstrap' package
 
 Please report bugs to $PACKAGE_BUGREPORT"
index 56575d1..dfbcc56 100644 (file)
@@ -121,7 +121,7 @@ function fixupDebian
 ###   main starts here <---
 
 
-tmp=$(getopt -o '+d:m:' --long debug -n "$0" -- "$@") || exit 1
+tmp=$(getopt -o '+d:m:s:' --long debug -n "$0" -- "$@") || exit 1
 eval set -- "$tmp"
 
 init
@@ -130,6 +130,7 @@ while true; do
     case "$1" in
        (-d)            DISTRIBUTION=$2; shift;;
        (-m)            mirror=$2;       shift;;
+       (-s)            script=$2;       shift;;
        (--debug)       set -x;;
        (--)            shift; break ;;
        (*)             echo "vserver-build.debootstrap: internal error: unrecognized option '$1'" >&2
@@ -151,7 +152,7 @@ findDebootstrap
 
 test -z "$BUILD_INITPRE"  || "$BUILD_INITPRE" "$SETUP_CONFDIR"  "$UTIL_VSERVER_VARS"
 mv "$VDIR"/dev "$VDIR"/dev.X
-"$DEBOOTSTRAP" "$@" "$DISTRIBUTION" "$VDIR" "$mirror" || :     ## HACK: ignore all errors...
+"$DEBOOTSTRAP" "$@" "$DISTRIBUTION" "$VDIR" "$mirror" "$script" || :   ## HACK: ignore all errors...
 fixupDebian "$VDIR"
 test -z "$BUILD_INITPOST" || "$BUILD_INITPOST" "$SETUP_CONFDIR" "$UTIL_VSERVER_VARS"