2006-08-24 12:43:06 by steve
Applied patch from Eric Lemoine to perform better binary detection for /bin/dd, rpmstrap, cp, debootstrap, etc.
This commit is contained in:
5
AUTHORS
5
AUTHORS
@@ -20,6 +20,9 @@ Contributions
|
||||
Sven Hertge <sven [at] de.svenhartge>
|
||||
- Bugfix for Debian/Gentoo package installation.
|
||||
|
||||
Eric Lemoine <<eric.lemoine [at] com.gmail>
|
||||
- Improved binary detection and good suggestions.
|
||||
|
||||
Radu Spineanu <radu [at] org.debian>
|
||||
- Supplied many small tweaks, bugfixes, and suggestions.
|
||||
- Radu is also the Debian package maintainer and has CVS commit access.
|
||||
@@ -28,4 +31,4 @@ Contributions
|
||||
- Many suggestions and useful Debian bug reports.
|
||||
|
||||
Gergely Tamas <dice [at] hu.kfki.mfa>
|
||||
- Added patch to make initrd setup optional.
|
||||
- Added patch to make initrd setup optional.
|
||||
|
||||
@@ -446,7 +446,7 @@ Install an X11 server, using VNC and XDM
|
||||
--
|
||||
http://www.steve.org.uk/
|
||||
|
||||
$Id: xen-create-image,v 1.84 2006-08-22 20:06:42 steve Exp $
|
||||
$Id: xen-create-image,v 1.85 2006-08-24 12:43:06 steve Exp $
|
||||
|
||||
=cut
|
||||
|
||||
@@ -952,7 +952,7 @@ sub parseCommandLineArguments
|
||||
|
||||
if ( $VERSION )
|
||||
{
|
||||
my $REVISION = '$Revision: 1.84 $';
|
||||
my $REVISION = '$Revision: 1.85 $';
|
||||
if ( $REVISION =~ /1.([0-9.]+) / )
|
||||
{
|
||||
$REVISION = $1;
|
||||
@@ -1228,10 +1228,11 @@ E_O_ERROR
|
||||
|
||||
sub checkBinariesPresent
|
||||
{
|
||||
|
||||
#
|
||||
# Files we demand are present in all cases.
|
||||
#
|
||||
my @required = qw ( /usr/sbin/debootstrap /bin/cp /bin/dd /bin/mount /sbin/mkswap );
|
||||
my @required = qw ( /bin/mount /sbin/mkswap );
|
||||
|
||||
foreach my $file ( @required )
|
||||
{
|
||||
@@ -1239,15 +1240,27 @@ sub checkBinariesPresent
|
||||
{
|
||||
logprint( "The following binary is required to run this tool\n" );
|
||||
logprint( "\t$file\n");
|
||||
exit;
|
||||
exit 1;
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# LVM specific binaries
|
||||
# Image type specific binaries
|
||||
#
|
||||
if ( $CONFIG{'lvm'} )
|
||||
if ( defined( $CONFIG{'dir'} ) )
|
||||
{
|
||||
# loopback image
|
||||
if ( ! -x '/bin/dd' )
|
||||
{
|
||||
logprint( "The following binary is required to run this tool\n" );
|
||||
logprint( "\t/bin/dd\n");
|
||||
logprint( "(This only required for loopback images, which you've selected)\n" );
|
||||
exit 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
# lvm image
|
||||
my @lvm = qw ( /sbin/lvcreate /sbin/lvremove );
|
||||
|
||||
foreach my $file ( @lvm )
|
||||
|
||||
@@ -80,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.32 2006-08-22 20:06:42 steve Exp $
|
||||
$Id: xt-install-image,v 1.33 2006-08-24 12:43:06 steve Exp $
|
||||
|
||||
=cut
|
||||
|
||||
@@ -134,6 +134,15 @@ checkArguments();
|
||||
#
|
||||
if ( $CONFIG{'copy'} )
|
||||
{
|
||||
#
|
||||
# Make sure we have the cp binary present.
|
||||
#
|
||||
if ( ! -x '/bin/cp' )
|
||||
{
|
||||
print "You've chosen to use the copy method, but /bin/cp is not installed.\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
#
|
||||
# Run a command to copy an installed system into the new root.
|
||||
#
|
||||
@@ -141,6 +150,15 @@ if ( $CONFIG{'copy'} )
|
||||
}
|
||||
elsif ( $CONFIG{'tar'} )
|
||||
{
|
||||
#
|
||||
# Make sure we have the tar binary present.
|
||||
#
|
||||
if ( ! -x '/bin/tar' )
|
||||
{
|
||||
print "You've chosen to use the tar method, but /bin/tar is not installed.\n";
|
||||
exit 1;
|
||||
}
|
||||
|
||||
#
|
||||
# Run a command to copy an installed system into the new root.
|
||||
#
|
||||
@@ -148,10 +166,28 @@ elsif ( $CONFIG{'tar'} )
|
||||
}
|
||||
elsif ( $CONFIG{'debootstrap'} )
|
||||
{
|
||||
#
|
||||
# Make sure we have the debootstrap binary present.
|
||||
#
|
||||
if ( ! -x '/usr/sbin/debootstrap' )
|
||||
{
|
||||
print "You've chosen to use the debootstrap program, but it isn't installed.\n";
|
||||
exit 1;
|
||||
}
|
||||
|
||||
installDebootstrapImage();
|
||||
}
|
||||
elsif ( $CONFIG{'rpmstrap'} )
|
||||
{
|
||||
#
|
||||
# Make sure we have the rpmstrap binary present.
|
||||
#
|
||||
if ( ! -x '/usr/bin/rpmstrap' )
|
||||
{
|
||||
print "You've chosen to use the rpmstrap program, but it isn't installed.\n";
|
||||
exit 1;
|
||||
}
|
||||
|
||||
installRPMStrapImage();
|
||||
}
|
||||
else
|
||||
@@ -239,7 +275,7 @@ sub parseCommandLineArguments
|
||||
|
||||
if ( $VERSION )
|
||||
{
|
||||
my $REVISION = '$Revision: 1.32 $';
|
||||
my $REVISION = '$Revision: 1.33 $';
|
||||
if ( $REVISION =~ /1.([0-9.]+) / )
|
||||
{
|
||||
$REVISION = $1;
|
||||
@@ -452,15 +488,6 @@ sub installDebootstrapImage
|
||||
sub installRPMStrapImage
|
||||
{
|
||||
|
||||
#
|
||||
# Make sure we have the rpmstrap binary present.
|
||||
#
|
||||
if ( ! -x '/usr/bin/rpmstrap' )
|
||||
{
|
||||
print "You've chosen to use the rpmstrap program, but it isn't installed.\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
#
|
||||
# Propogate the verbosity setting.
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user