diff --git a/bin/xen-create-image b/bin/xen-create-image index aaa24ff..7f1928a 100755 --- a/bin/xen-create-image +++ b/bin/xen-create-image @@ -498,7 +498,7 @@ Install an X11 server, using VNC and XDM -- http://www.steve.org.uk/ - $Id: xen-create-image,v 1.129 2007-02-23 22:45:17 steve Exp $ + $Id: xen-create-image,v 1.130 2007-02-25 12:45:13 steve Exp $ =cut @@ -1111,7 +1111,7 @@ sub parseCommandLineArguments if ( $VERSION ) { - my $REVISION = '$Revision: 1.129 $'; + my $REVISION = '$Revision: 1.130 $'; if ( $REVISION =~ /1.([0-9.]+) / ) { $REVISION = $1; @@ -1272,31 +1272,22 @@ E_OR my $valid = 0; if ( defined( $CONFIG{'install-method'} ) ) { - foreach my $recognised ( qw/ copy debootstrap rpmstrap tar / ) + foreach my $recognised ( qw/ copy debootstrap image-server rpmstrap tar / ) { $valid = 1 if ( lc($CONFIG{'install-method'}) eq lc($recognised) ); } # - # If we have "copy" or "tar" make sure we have a source. + # If we have "copy", "image-server", or "tar" method + # then make sure we have a source. # - if ( lc($CONFIG{'install-method'}) eq "copy" ) + if ( ( lc($CONFIG{'install-method'}) eq "copy" ) || + ( lc($CONFIG{'install-method'}) eq "image-server" ) || + ( lc($CONFIG{'install-method'}) eq "tar" ) ) { # not defined. $valid = 0 if (!defined( $CONFIG{'install-source'} ) ); - # defined but not a directory. - $valid = 0 if (defined( $CONFIG{'install-source'} ) && - (! -d $CONFIG{'install-source'} ) ) - } - if ( lc($CONFIG{'install-method'}) eq "tar" ) - { - # not defined. - $valid = 0 if (!defined( $CONFIG{'install-source'} ) ); - - # defined but not a file. - $valid = 0 if (defined( $CONFIG{'install-source'} ) && - (! -e $CONFIG{'install-source'} ) ) } } else @@ -1307,7 +1298,8 @@ E_OR if ( !$valid ) { print < \&do_debootstrap, needBinary => "/usr/sbin/debootstrap", }, + "image-server" => + { + sub => \&do_image_server, + needURL => 1, + }, "rpmstrap" => { sub => \&do_rpmstrap, @@ -244,6 +249,16 @@ if ( defined( $CONFIG{'install-method'} ) && exit 1; } + # Do we need an URL specified as the installation source? + if ( ( $installer->{'needURL'} ) && + ( ! $CONFIG{'install-source'} || + ( $CONFIG{'install-source'} !~ /^http/i ) ) ) + { + print "Please specify the image server URL with --install-source\n"; + exit 1; + } + + # # Now we can call the appropriate handler. @@ -399,7 +414,7 @@ sub parseCommandLineArguments if ( $VERSION ) { - my $REVISION = '$Revision: 1.48 $'; + my $REVISION = '$Revision: 1.49 $'; if ( $REVISION =~ /1.([0-9.]+) / ) { $REVISION = $1; @@ -720,6 +735,24 @@ sub do_debootstrap +=begin doc + + Install a system using the image-server. + + Note: NON-Advertised .... + +=end doc + +=cut + +sub do_image_server +{ + die 'Not @work.'; +} + + + + =begin doc Install a new distribution of GNU/Linux using the rpmstrap tool. diff --git a/misc/xen-tools b/misc/xen-tools index 06843fe..3fad7f7 100644 --- a/misc/xen-tools +++ b/misc/xen-tools @@ -18,7 +18,7 @@ # -- # http://www.steve.org.uk # -# $Id: xen-tools,v 1.42 2007-02-23 22:05:19 steve Exp $ +# $Id: xen-tools,v 1.43 2007-02-25 12:45:13 steve Exp $ # @@ -110,7 +110,7 @@ _xen_create_image() return 0 ;; --install-method) - COMPREPLY=( $( compgen -W 'copy debootstrap rpmstrap tar' -- "${COMP_WORDS[COMP_CWORD]}" ) ) + COMPREPLY=( $( compgen -W 'copy debootstrap image-server rpmstrap tar' -- "${COMP_WORDS[COMP_CWORD]}" ) ) return 0 ;; --ip)