1
0
mirror of synced 2026-02-07 00:07:12 +00:00

2007-02-25 12:45:13 by steve

--install-source=image-server has now got stub support.
  TODO: Finish.
This commit is contained in:
steve
2007-02-25 12:45:13 +00:00
parent ca5fc8c978
commit 5ba1eb00e9
3 changed files with 47 additions and 22 deletions

View File

@@ -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 <<EOF;
Please specify the installation method to use.
Please specify the installation method to use, along with a source
if that is required.
For example:

View File

@@ -80,7 +80,7 @@ Untar a .tar file into the new installation location. This tarfile is assumed t
--
http://www.steve.org.uk/
$Id: xt-install-image,v 1.48 2007-02-23 18:58:26 steve Exp $
$Id: xt-install-image,v 1.49 2007-02-25 12:45:13 steve Exp $
=cut
@@ -139,6 +139,11 @@ my %dispatch =
sub => \&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.

View File

@@ -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)