Merge "debian: simplify the way debian element is called"
This commit is contained in:
commit
35a006cfa6
@ -1,4 +1,5 @@
|
||||
#!/bin/bash
|
||||
set -eux
|
||||
echo upstart >> ${TARGET_ROOT}/.extra-packages
|
||||
echo debian-upstart >> ${TARGET_ROOT}/.distro-name
|
||||
cat > ${TARGET_ROOT}/.extra_settings << EOF
|
||||
DIB_DEBIAN_ALT_INIT_PACKAGE=upstart
|
||||
EOF
|
||||
|
@ -16,13 +16,13 @@
|
||||
# under the License.
|
||||
#
|
||||
set -eu
|
||||
if [ -f ${TARGET_ROOT}/.distro-name ] ; then
|
||||
DISTRO_NAME=$(cat ${TARGET_ROOT}/.distro-name)
|
||||
else
|
||||
DISTRO_NAME=debian
|
||||
if [ -f ${TARGET_ROOT}/.extra_settings ] ; then
|
||||
. ${TARGET_ROOT}/.extra_settings
|
||||
fi
|
||||
DISTRO_NAME=${DISTRO_NAME:-debian}
|
||||
DIB_RELEASE=${DIB_RELEASE:-unstable}
|
||||
DEBOOTSTRAP_TARBALL=$DIB_IMAGE_CACHE/debootstrap-${DISTRO_NAME}-${DIB_RELEASE}-${ARCH}.tar.gz
|
||||
DIB_DEBIAN_ALT_INIT_PACKAGE=${DIB_DEBIAN_ALT_INIT_PACKAGE:-sysvinit}
|
||||
DEBOOTSTRAP_TARBALL=$DIB_IMAGE_CACHE/debootstrap-${DISTRO_NAME}-${DIB_DEBIAN_ALT_INIT_PACKAGE}-${DIB_RELEASE}-${ARCH}.tar.gz
|
||||
if [ -n "${DIB_DEBIAN_MIRROR:-}" ]; then
|
||||
echo "Use of DIB_DEBIAN_MIRROR environment variable to configure mirror is deprecated."
|
||||
echo "Please use DIB_DISTRIBUTION_MIRROR instead."
|
||||
@ -38,9 +38,10 @@ 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
|
||||
if [ -f ${TARGET_ROOT}/.extra-packages ] ; then
|
||||
ADD_PACKAGES=${ADD_PACKAGES},$(cat ${TARGET_ROOT}/.extra-packages)
|
||||
if [ "$DIB_DEBIAN_ALT_INIT_PACKAGE" != "sysvinit" ]; then
|
||||
ADD_PACKAGES=${ADD_PACKAGES},${DIB_DEBIAN_ALT_INIT_PACKAGE}
|
||||
fi
|
||||
|
||||
sudo sh -c "http_proxy=$http_proxy debootstrap --verbose \
|
||||
--arch=${ARCH} \
|
||||
--include=${ADD_PACKAGES} \
|
||||
@ -75,3 +76,5 @@ LABEL=cloudimg-rootfs / ext4 errors=remount-ro 0 1
|
||||
echo Caching debootstrap result in $DEBOOTSTRAP_TARBALL
|
||||
sudo tar -C $TARGET_ROOT -zcf $DEBOOTSTRAP_TARBALL .
|
||||
fi
|
||||
|
||||
sudo rm -f ${TARGET_ROOT}/.extra_settings
|
||||
|
Loading…
Reference in New Issue
Block a user