From 4ce573c582737b91136dd41db67b931605de4b50 Mon Sep 17 00:00:00 2001 From: Clint Byrum Date: Mon, 13 Jan 2014 12:51:28 -0800 Subject: [PATCH] Allow adding packages to debootstrap Also allows setting the "distro name" so that things that change the debootstrap signature will have a different tarball. This is being done in advance of a debian-upstart element to allow experimenting with debian and upstart. Change-Id: I1a558fdaf5924c65f1cced9f9bf29d73643c30af --- elements/debian/root.d/08-debootstrap | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/elements/debian/root.d/08-debootstrap b/elements/debian/root.d/08-debootstrap index 72e32130..5e56d6cb 100755 --- a/elements/debian/root.d/08-debootstrap +++ b/elements/debian/root.d/08-debootstrap @@ -1,7 +1,12 @@ #!/bin/sh set -eu +if [ -f ${TARGET_ROOT}/.distro-name ] ; then + DISTRO_NAME=$(cat ${TARGET_ROOT}/.distro-name) +else + DISTRO_NAME=debian +fi DIB_RELEASE=${DIB_RELEASE:-unstable} -DEBOOTSTRAP_TARBALL=$DIB_IMAGE_CACHE/debootstrap-${DIB_RELEASE}-${ARCH}.tar.gz +DEBOOTSTRAP_TARBALL=$DIB_IMAGE_CACHE/debootstrap-${DISTRO_NAME}-${DIB_RELEASE}-${ARCH}.tar.gz DIB_DEBIAN_MIRROR=${DIB_DEBIAN_MIRROR:-http://http.debian.net/debian} http_proxy=${http_proxy:-} @@ -12,6 +17,9 @@ if [ -n "$DIB_OFFLINE" ] && [ -f $DEBOOTSTRAP_TARBALL ] ; then else echo Building new tarball for Debian $DIB_RELEASE ARCH=$ARCH ADD_PACKAGES=cloud-init,cloud-utils,cloud-initramfs-growroot,sudo,adduser,locales,openssh-server,file,less,kbd,curl,bash-completion,linux-image-amd64 + if [ -f ${TARGET_ROOT}/.extra-packages ] ; then + ADD_PACKAGES=${ADD_PACKAGES},$(cat ${TARGET_ROOT}/.extra-packages) + fi sudo sh -c "http_proxy=$http_proxy debootstrap --verbose \ --arch=${ARCH} \ --include=${ADD_PACKAGES} \