1
0
mirror of synced 2026-01-21 01:48:09 +00:00

2006-06-09 16:53:26 by steve

Create the image + customise it by calling out to the xt-* scripts.

  Almost done now.  We just need to make xt-install-image work and
 we've got it made.
This commit is contained in:
steve 2006-06-09 16:53:26 +00:00
parent 3818d58158
commit a0e6cef836

View File

@ -31,7 +31,7 @@ xen-create-image - Create a new Xen instance
--
http://www.steve.org.uk/
$Id: xen-create-image,v 1.7 2006-06-09 16:42:53 steve Exp $
$Id: xen-create-image,v 1.8 2006-06-09 16:53:26 steve Exp $
=cut
@ -148,17 +148,27 @@ mountImage();
#
# Call xt-install-image to do the install.
#
installSystem();
#
# If that worked call xt-customise-image to setup networking, and
# run distro-specific hooks.
#
my $customize = "xt-customize-image --dist=$CONFIG{'dist'} --location=$MOUNT_POINT";
if ( $CONFIG{'verbose'} )
{
$customize .= " --verbose";
}
print "\nRunning hooks\n";
runCommand( $customize );
print "Done\n";
#
# Unmount the disk image, and remove the temporary directory.
#
# skipped: this is handled in END
#
@ -169,7 +179,7 @@ mountImage();
#
# Report success.
#
print "All done\n";
@ -322,7 +332,7 @@ sub parseCommandLineArguments
if ( $VERSION )
{
my $REVISION = '$Revision: 1.7 $';
my $REVISION = '$Revision: 1.8 $';
if ( $REVISION =~ /1.([0-9.]+) / )
{
@ -695,6 +705,55 @@ sub mountImage
=head2 installSystem
Install the system, by invoking the xt-install-system script.
The script will be given the appropriate arguments from our environment.
=cut
sub installSystem
{
#
# Basic command
#
my $cmd = "/usr/bin/xt-install-image --location=$MOUNT_POINT --dist=$CONFIG{'dist'}";
#
# Installation method
#
if ( $CONFIG{'copy'} )
{
$cmd .= " --copy=$CONFIG{'copy'}";
}
if ( $CONFIG{'debootstrap'} )
{
$cmd .= " --debootstrap=$CONFIG{'debootstrap'}";
}
if ( $CONFIG{'rpmstrap'} )
{
$cmd .= " --rpmstrap=$CONFIG{'rpmstrap'}";
}
if ( $CONFIG{'tar'} )
{
$cmd .= " --tar=$CONFIG{'tar'}";
}
#
# Propogate --verbose
#
if ( $CONFIG{'verbose'} )
{
$cmd .= " --verbose";
}
runCommand( $cmd );
}
=head2 runCommand
A utility method to run a system command. We will capture the return