From: Iustin Pop Date: Mon, 29 Oct 2012 16:12:47 +0000 (+0100) Subject: Add support for components override X-Git-Tag: v0.12~2 X-Git-Url: http://git.equinoxoli.org/?p=ext%2Finstance-debootstrap.git;a=commitdiff_plain;h=1cfb9189a50eb02753d6e8ae965a09cb211ffac7 Add support for components override This fixes issue 254. I've took a slightly different approach (never pass --components if the variable is empty, to not override builtin debootstrap default). Signed-off-by: Iustin Pop Reviewed-by: Bernardo Dal Seno --- diff --git a/NEWS b/NEWS index a7b9046..aa8695d 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,9 @@ A few small bugfixes: - the defaults file is now installed automatically; even though all settings are commented out, this allows for easier configuration +- it is now possible to override the "components" argument to + debootstrap, to be able to install more packages (e.g. from contrib, + or from universe) (fixes issue 254) - all existing hooks are now distributed in the archive and also installed via `make install' (fixes issue 283) - the console activation for xen-pvm hypervisor has been corrected; diff --git a/README b/README index 893804f..3fe7dfb 100644 --- a/README +++ b/README @@ -58,6 +58,9 @@ named 'defaults' in the source distribution for more details): - EXTRAPKGS: most OSes will need some extra packages installed to make them work nicely under Xen; the example file containts a few suggestions +- COMPONENTS: if defined, overrides the default debootstrap components + ("main"); this can be helpful e.g. by using "main,contrib,nonfree" for + Debian, or "main,universe" for Ubuntu - CUSTOMIZE_DIR: a directory containing customization script for the instance. (by default $sysconfdir/ganeti/instance-debootstrap/hooks) See "Customization of the instance" below. diff --git a/common.sh.in b/common.sh.in index 04d339f..fd1b448 100644 --- a/common.sh.in +++ b/common.sh.in @@ -145,6 +145,7 @@ fi : ${SUITE:="squeeze"} : ${ARCH:=""} : ${EXTRA_PKGS:=""} +: ${COMPONENTS:=""} : ${CUSTOMIZE_DIR:="@sysconfdir@/ganeti/instance-debootstrap/hooks"} : ${VARIANTS_DIR:="@sysconfdir@/ganeti/instance-debootstrap/variants"} : ${GENERATE_CACHE:="yes"} diff --git a/create b/create index ff54976..d07c274 100755 --- a/create +++ b/create @@ -80,9 +80,11 @@ else # INCLUDE will be empty if EXTRA_PKGS is null/empty, otherwise we # build the full parameter format from it INCLUDE=${EXTRA_PKGS:+"--include=$EXTRA_PKGS"} + COMP=${COMPONENTS:+"--components=$COMPONENTS"} debootstrap \ --arch "$DPKG_ARCH" \ $INCLUDE \ + $COMP \ "$SUITE" $TMPDIR $MIRROR # remove the downloaded debs, as they are no longer needed diff --git a/defaults b/defaults index 19df420..fdf28e5 100644 --- a/defaults +++ b/defaults @@ -39,7 +39,15 @@ # EXTRA_PKGS="acpi-support-base,console-tools,udev,linux-image-686" # KVM, for squeeze/wheezy amd64: # EXTRA_PKGS="acpi-support-base,console-tools,udev,linux-image-amd64" -# + +# COMPONENTS: if defined, overrides the default debootstrap components +# ("main"); when not defined, it will not passed to debootstrap +# Debian example: +# COMPONENTS="main,contrib,non-free" +# Ubuntu example: +# COMPONENTS="main,universe" +# Default: +# COMPONENTS="" # CUSTOMIZE_DIR: a directory containing scripts to customize the installation. # The scripts are executed using run-parts