added --arch to force arhitecture to bootstrap
authorDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 15 Mar 2010 23:09:38 +0000 (23:09 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 15 Mar 2010 23:09:38 +0000 (23:09 +0000)
git-svn-id: svn://svn.rot13.org/sysadmin-cookbook@176 191e9f34-6774-4a6d-acfc-7664dacd4a2a

recepies/lxc/lxc-debian

index 2b4f262..23da719 100755 (executable)
@@ -95,6 +95,8 @@ EOF
     chroot $rootfs /usr/sbin/update-rc.d -f hwclockfirst.sh remove
 }
 
+arch=$(arch)
+
 download_debian()
 {
     packages=\
@@ -109,7 +111,6 @@ iproute,\
 openssh-server
 
     cache=$1
-    arch=$2
 
     # check the mini debian was not already downloaded
     mkdir -p "$cache/partial-$arch"
@@ -137,7 +138,6 @@ openssh-server
 copy_debian()
 {
     cache=$1
-    arch=$2
     rootfs=$3
 
     # make a local copy of the minidebian
@@ -158,7 +158,6 @@ install_debian()
            return 1
        fi
 
-       arch=$(arch)
        if [ "$arch" == "x86_64" ]; then
            arch=amd64
        fi
@@ -251,12 +250,12 @@ clean()
 usage()
 {
     cat <<EOF
-$1 -h|--help -p|--path=<path> --clean
+$1 -h|--help -p|--path=<path> -a|--arch=stable --clean
 EOF
     return 0
 }
 
-options=$(getopt -o hp:n:c -l help,path:,name:,clean -- "$@")
+options=$(getopt -o hp:n:ca: -l help,path:,name:,clean,arch: -- "$@")
 if [ $? -ne 0 ]; then
         usage $(basename $0)
        exit 1
@@ -268,8 +267,9 @@ do
     case "$1" in
         -h|--help)      usage $0 && exit 0;;
         -p|--path)      path=$2; shift 2;;
-       -n|--name)      name=$2; shift 2;;
-       -c|--clean)     clean=$2; shift 2;;
+               -n|--name)      name=$2; shift 2;;
+               -c|--clean)     clean=$2; shift 2;;
+               -a|--arch)              arch=$2; shift 2;;
         --)             shift 1; break ;;
         *)              break ;;
     esac