Debian: Support additional debootstrap arguments

Add support for supplying a custom keyring and debootstrap script
using two new environment variables:

* DIB_DEBIAN_KEYRING - Path to a gpg keyring.
* DIB_DEBIAN_DEBOOTSTRAP_SCRIPT - Path to a alternative debootstrap
  script.

Change-Id: I42e8832b435b8a77b0681b5bc9d9332bbe860cd5
This commit is contained in:
Kiall Mac Innes 2014-04-26 14:21:55 +01:00
parent 5b16eb0c33
commit 1757214196
2 changed files with 14 additions and 1 deletions

View File

@ -7,6 +7,11 @@ not handle changing Packages files well across multiple out of sync
mirrors, it is recommended that you choose a single mirror of debian,
and pass it in via `DIB_DISTRIBUTION_MIRROR`.
If necessary, a custom apt keyring and debootstrap script can be
supplied to the `debootstrap` command via `DIB_DEBIAN_KEYRING` and
`DIB_DEBIAN_DEBOOTSTRAP_SCRIPT` respectively. Both options require the
use of absolute rather than relative paths.
Use of this element will also require the tool 'debootstrap' to be
available on your system. It should be available on Ubuntu, Debian,
and Fedora.

View File

@ -38,12 +38,20 @@ if [ -n "$DIB_OFFLINE" ] && [ -f $DEBOOTSTRAP_TARBALL ] ; then
else
echo Building new tarball for Debian $DIB_RELEASE ARCH=$ARCH
ADD_PACKAGES=sudo,adduser,locales,openssh-server,file,less,kbd,curl,rsync,bash-completion,linux-image-amd64
KEYRING_OPT=
if [ -n "${DIB_DEBIAN_KEYRING:-}" ] ; then
KEYRING_OPT="--keyring=${DIB_DEBIAN_KEYRING}"
fi
sudo sh -c "http_proxy=$http_proxy debootstrap --verbose \
--arch=${ARCH} \
--include=${ADD_PACKAGES} \
$KEYRING_OPT \
$DIB_RELEASE \
$TARGET_ROOT \
$DIB_DISTRIBUTION_MIRROR"
$DIB_DISTRIBUTION_MIRROR \
${DIB_DEBIAN_DEBOOTSTRAP_SCRIPT:-}"
echo "Customizing result for cloud use"
apt_get_bp_extra_opts=