diff --git a/bin/xen-create-image b/bin/xen-create-image index 8df122c..37a079f 100755 --- a/bin/xen-create-image +++ b/bin/xen-create-image @@ -39,8 +39,9 @@ xen-create-image - Easily create new Xen instances with networking and OpenSSH. --copy-cmd NOP: Ignored. --debootstrap-cmd - Specify which debootstrap command is used, either - debootstrap (default) or cdebootstrap. + Specify which debootstrap command is used. Defaults to + debootstrap if both, debootstrap and cdebootstrap are + installed. --force Force overwriting existing images. This will remove existing images or LVM volumes which match those which diff --git a/bin/xt-install-image b/bin/xt-install-image index 599acbf..537ac2b 100755 --- a/bin/xt-install-image +++ b/bin/xt-install-image @@ -31,7 +31,9 @@ xt-install-image - Install a fresh copy of GNU/Linux into a directory Installation Options: --install-method Specify the installation method to use. --install-source Specify the installation source to use. - --debootstrap-cmd Specify which debootstrap command to use. + --debootstrap-cmd Specify which debootstrap command to + use. Defaults to debootstrap if both, debootstrap + and cdebootstrap are installed. All other options from xen-create-image will be passed as environmental variables. @@ -690,8 +692,15 @@ sub do_debootstrap my $cmd = $CONFIG{ 'debootstrap-cmd' }; if ( !$cmd ) { - print "Falling back to default debootstrap command\n"; - $cmd = '/usr/sbin/debootstrap'; + if (-x '/usr/sbin/debootstrap') { + $cmd = '/usr/sbin/debootstrap'; + } elsif (-x '/usr/sbin/cdebootstrap') { + $cmd = '/usr/sbin/cdebootstrap'; + } else { + print STDERR "Found neither debootstrap nor cdebootstrap and no --debootstrap-cmd given\n"; + exit 1; + } + print "Using $cmd as debootstrap command\n"; } diff --git a/debian/changelog b/debian/changelog index d920159..f80388a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -37,8 +37,10 @@ xen-tools (4.2~rc1-1) UNRELEASED; urgency=low - The debootstrap command now also can be configured on the commandline with --debootstrap-cmd in xen-create-image and xt-install-image (Enhances fix for #436480 which added the - debootstrap-cmd config file option; Changed "Depends: debootstrap" - to "Depends: debootstrap | cdebootstrap" in debian/control) + debootstrap-cmd config file option) + - Checks for debootstrap and cdebootstrap, uses debootstrap if both + are installed (Changed "Depends: debootstrap" to "Depends: + debootstrap | cdebootstrap" in debian/control) * Removal of /etc/bash_completion.d/xm from the package since bash-completion ships a more elaborate version of that file. (Closes: #566683, #550590, LP: #538917, #484098)