1
0
mirror of synced 2026-02-04 15:13:12 +00:00

2006-03-11 19:53:39 by steve

Moved the xen cfg creation to use the hook to avoid duplication.
  Added support for the '--ide' command line option.
This commit is contained in:
steve
2006-03-11 19:53:39 +00:00
parent df2ee70a60
commit 9fd433d51a

View File

@@ -17,6 +17,7 @@ xen-duplicate-image - Duplicate an existing Xen instance.
--boot Boot the cloned image after creating it.
--dir Specify where the output images should go.
--volume Specify the LVM volume where images are to go.
--ide Use IDE names for virtual devices (hda not sda)
Networking options:
--dhcp Setup the image to get its networking details via DHCP
@@ -52,6 +53,9 @@ Specify the gateway address for the virtual image, only useful if DHCP is not us
=item B<--help>
Show the brief help information.
=item B<--ide>
Use IDE style device names for the virtual devices.
=item B<--ip>
Specify the IP address for the virtual image. Conflicts with B<--dhcp>.
@@ -118,7 +122,7 @@ Specify the LVM volume where images are to go
--
http://www.steve.org.uk/
$Id: xen-duplicate-image,v 1.25 2006-03-10 18:18:59 radu Exp $
$Id: xen-duplicate-image,v 1.26 2006-03-11 19:53:39 steve Exp $
=cut
@@ -167,7 +171,7 @@ my %CONFIG;
#
# Release number.
#
my $RELEASE = '1.1';
my $RELEASE = '1.2';
#
@@ -310,27 +314,11 @@ setupNetworking( $dir );
#
# Finally setup Xen to allow us to create the image.
#
print "Setting up Xen configuration file .. ";
open( XEN, ">", "/etc/xen/$CONFIG{'hostname'}.cfg" );
print XEN<<E_O_XEN;
kernel = "$CONFIG{'kernel'}"
memory = $CONFIG{'memory'}
name = "$CONFIG{'hostname'}"
disk = [ 'file:$image_out,sda1,w','file:$swap_out,sda2,w' ]
root = "/dev/sda1 ro"
vif = ['']
E_O_XEN
if ( $CONFIG{'dhcp'} )
if ( -x "/etc/hook.d/95-create-cfg" )
{
print XEN "dhcp=\"dhcp\"\n";
print "Setting up Xen configuration file .. ";
`/etc/hook.d/95-create-cfg`;
}
else
{
print XEN "#dhcp=\"dhcp\"\n";
}
close( XEN );
print "Done\n";
@@ -443,6 +431,7 @@ sub parseCommandLineArguments
"volume=s", \$CONFIG{'volume'},
"kernel=s", \$CONFIG{'kernel'},
"dhcp", \$CONFIG{'dhcp'},
"ide", \$CONFIG{'ide'},
"help", \$HELP,
"manual", \$MANUAL,
"version", \$VERSION
@@ -454,7 +443,7 @@ sub parseCommandLineArguments
if ( $VERSION )
{
my $REVISION = '$Revision: 1.25 $';
my $REVISION = '$Revision: 1.26 $';
if ( $REVISION =~ /1.([0-9.]+) / )
{