Added cmdline option for specifying target architecture
authorUlrich Dangel <uli@spamt.net>
Thu, 10 Sep 2009 13:22:51 +0000 (15:22 +0200)
committerMichael Prokop <mika@grml.org>
Thu, 10 Sep 2009 13:57:39 +0000 (15:57 +0200)
Allow to specify target architecture to install correct kernel inside
the chroot and not kernel for host architecture

cmdlineopts.clp
grml-debootstrap

index ea04eeb..39f7e68 100644 (file)
@@ -13,7 +13,7 @@
 ################################################################################
 
 _opt_temp=`getopt --name grml-debootstrap -o +m:i:r:t:p:c:d:vhV --long \
 ################################################################################
 
 _opt_temp=`getopt --name grml-debootstrap -o +m:i:r:t:p:c:d:vhV --long \
-    mirror:,iso:,release:,target:,mntpoint:,debopt:,interactive,nodebootstrap,config:,confdir:,packages::,chroot-scripts::,scripts::,debconf::,keep_src_list,hostname:,password:,bootappend:,groot:,grub:,verbose,help,version \
+    mirror:,iso:,release:,target:,mntpoint:,debopt:,interactive,nodebootstrap,config:,confdir:,packages::,chroot-scripts::,scripts::,debconf::,keep_src_list,hostname:,password:,bootappend:,groot:,grub:,arch:,verbose,help,version \
   -- "$@"`
 if [ $? != 0 ]; then
   eerror "Try 'grml-debootstrap --help' for more information."; eend 1; exit 1
   -- "$@"`
 if [ $? != 0 ]; then
   eerror "Try 'grml-debootstrap --help' for more information."; eend 1; exit 1
@@ -48,6 +48,9 @@ while :; do
   --nodebootstrap)     # Skip debootstrap, only do configuration to the target
     _opt_nodebootstrap=T
     ;;
   --nodebootstrap)     # Skip debootstrap, only do configuration to the target
     _opt_nodebootstrap=T
     ;;
+  --arch)              # Target architecutre
+    shift; _opt_arch="$1"
+    ;;
   #
 
   # == Configuration options
   #
 
   # == Configuration options
index 5295be1..b693666 100755 (executable)
@@ -51,6 +51,8 @@ Bootstrap options:
                            \$TARGET in grub syntax, like hd0,0 for /dev/sda1.
       --grub <device>    Target for grub installation. Use grub syntax for
                            specifying, like hd0 for /dev/sda.
                            \$TARGET in grub syntax, like hd0,0 for /dev/sda1.
       --grub <device>    Target for grub installation. Use grub syntax for
                            specifying, like hd0 for /dev/sda.
+      --arch <arch>      Architecture to use. Currently only i386 and amd64
+                           are supported.
 
 Configuration options:
 
 
 Configuration options:
 
@@ -149,6 +151,7 @@ fi
 [ "$_opt_bootappend" ]          && BOOT_APPEND=$_opt_bootappend
 [ "$_opt_groot" ]               && GROOT=$_opt_groot
 [ "$_opt_grub" ]                && GRUB=$_opt_grub
 [ "$_opt_bootappend" ]          && BOOT_APPEND=$_opt_bootappend
 [ "$_opt_groot" ]               && GROOT=$_opt_groot
 [ "$_opt_grub" ]                && GRUB=$_opt_grub
+[ "$_opt_arch" ]                && ARCH=$_opt_arch
 [ "$_opt_verbose" ]             && VERBOSE="-v"
 
 [ "$_opt_help" ] && {
 [ "$_opt_verbose" ]             && VERBOSE="-v"
 
 [ "$_opt_help" ] && {