diff --git a/bin/xen-create-image b/bin/xen-create-image index 6dbaef7..9389724 100755 --- a/bin/xen-create-image +++ b/bin/xen-create-image @@ -65,6 +65,11 @@ xen-create-image - Easily create new Xen instances with networking and OpenSSH. Installation options: + + --arch Pass the given architecture to debootstrap or rpm strap. + This argument is ignored if you install with a different + installation type. + --copy Install the new image by copying a previously installed system. This is much faster than installing from scratch. @@ -435,7 +440,7 @@ Install an X11 server, using VNC and XDM -- http://www.steve.org.uk/ - $Id: xen-create-image,v 1.64 2006-08-15 21:11:31 steve Exp $ + $Id: xen-create-image,v 1.65 2006-08-15 21:17:28 steve Exp $ =cut @@ -695,6 +700,7 @@ sub setupDefaultOptions # Misc. options. # $CONFIG{'mirror'} = 'http://ftp.us.debian.org/debian'; + $CONFIG{'arch'} = ''; $CONFIG{'dist'} = 'sarge'; $CONFIG{'fs'} = 'ext3'; $CONFIG{'force'} = 0; @@ -859,6 +865,7 @@ sub parseCommandLineArguments # Misc. options "accounts", \$CONFIG{'accounts'}, + "arch=s", \$CONFIG{'arch'}, "fs", \$CONFIG{'fs'}, "boot", \$CONFIG{'boot'}, "cache=s", \$CONFIG{'cache'}, @@ -882,7 +889,7 @@ sub parseCommandLineArguments if ( $VERSION ) { - my $REVISION = '$Revision: 1.64 $'; + my $REVISION = '$Revision: 1.65 $'; if ( $REVISION =~ /1.([0-9.]+) / ) { @@ -1074,7 +1081,7 @@ E_OR # The kernel + initrd images should exist. # if ( defined( $CONFIG{'kernel'} ) && - length( $CONFIG{'kernel'} ) && + length( $CONFIG{'kernel'} ) && ! -e $CONFIG{'kernel'} ) { print "The kernel image we're trying to use does not exist.\n"; @@ -1084,7 +1091,7 @@ E_OR } if ( defined( $CONFIG{'initrd'} ) && - length( $CONFIG{'initrd'} ) && + length( $CONFIG{'initrd'} ) && ! -e $CONFIG{'initrd'} ) { print "The initial ramdisk we're trying to use does not exist.\n"; diff --git a/bin/xt-install-image b/bin/xt-install-image index a38993d..5f45502 100755 --- a/bin/xt-install-image +++ b/bin/xt-install-image @@ -11,19 +11,20 @@ xt-install-image - Install a fresh copy of GNU/Linux into a directory xt-install-image [options] Help Options: - --help Show this scripts help information. - --manual Read this scripts manual. - --version Show the version number and exit. + --help Show this scripts help information. + --manual Read this scripts manual. + --version Show the version number and exit. Debugging Options: - --verbose Be verbose in our execution. + --verbose Be verbose in our execution. Mandatory Options: - --location The location to use for the new installation - --dist The name of the distribution which has been installed. + --location The location to use for the new installation + --dist The name of the distribution which has been installed. Misc Options: - --mirror The mirror to use when installing with 'debootstrap'. + --arch Pass the given arch setting to debootstrap or rpmstrap. + --mirror The mirror to use when installing with 'debootstrap'. Installation Options: --tar Untar the given file. @@ -79,7 +80,7 @@ Install the distribution specified by the B<--dist> argument using the debootstr -- http://www.steve.org.uk/ - $Id: xt-install-image,v 1.21 2006-08-15 17:34:23 steve Exp $ + $Id: xt-install-image,v 1.22 2006-08-15 21:17:28 steve Exp $ =cut @@ -198,9 +199,9 @@ exit 0; sub parseCommandLineArguments { - my $HELP = 0; - my $MANUAL = 0; - my $VERSION = 0; + my $HELP = 0; + my $MANUAL = 0; + my $VERSION = 0; # # Parse options. @@ -217,8 +218,9 @@ sub parseCommandLineArguments "debootstrap", \$CONFIG{'debootstrap'}, # Misc - "mirror=s", \$CONFIG{'mirror'}, + "arch=s", \$CONFIG{'arch'}, "cache=s", \$CONFIG{'cache'}, + "mirror=s", \$CONFIG{'mirror'}, # Help. "verbose", \$CONFIG{'verbose'}, @@ -233,7 +235,7 @@ sub parseCommandLineArguments if ( $VERSION ) { - my $REVISION = '$Revision: 1.21 $'; + my $REVISION = '$Revision: 1.22 $'; if ( $REVISION =~ /1.([0-9.]+) / ) { @@ -390,16 +392,25 @@ sub installDebootstrapImage # # Propogate --verbose appropriately. # - my $VERBOSE = ''; + my $EXTRA = ''; if ( $CONFIG{'verbose'} ) { - $VERBOSE = '--verbose'; + $EXTRA = ' --verbose'; } + # + # Propogate the --arch argument + # + if ( $CONFIG{'arch'} ) + { + $EXTRA .= " --arch $CONFIG{'arch'}" + } + + # # This is the command we'll run # - my $command = "/usr/sbin/debootstrap --keep-debootstrap-dir $VERBOSE $CONFIG{'dist'} $CONFIG{'location'} $CONFIG{'mirror'}"; + my $command = "/usr/sbin/debootstrap --keep-debootstrap-dir $ARCH $CONFIG{'dist'} $CONFIG{'location'} $CONFIG{'mirror'}"; # # Run the command. @@ -457,16 +468,23 @@ sub installRPMStrapImage # # Propogate the verbosity setting. # - my $VERBOSE=''; + my $EXTRA=''; if ( $CONFIG{'verbose'} ) { - $VERBOSE .= "--verbose"; + $EXTRA .= " --verbose"; } + # + # Propogate any arch setting we might have. + # + if ( $CONFIG{'arch'} ) + { + $EXTRA .= " --arch $CONFIG{'arch'}"; + } # # The command we're going to run. # - my $command = "rpmstrap $VERBOSE $CONFIG{'dist'} $CONFIG{'location'}"; + my $command = "rpmstrap $EXTRA $CONFIG{'dist'} $CONFIG{'location'}"; runCommand( $command ); } diff --git a/debian/changelog b/debian/changelog index 0741258..2495e45 100644 --- a/debian/changelog +++ b/debian/changelog @@ -12,6 +12,8 @@ xen-tools (2.3-0) unstable; urgency=low - Allow command line installation method or installation type (dir/lvm) to override the configuration file options. (Closes: #383033) + - Allow "arch" to be specified and passed to rpmstrap/debootstrap. + (Closes: #383041) -- Steve Kemp Mon, 14 Aug 2006 22:34:59 +0000