From 2514b822d27a7c16ee4fe9074b4e52cca6b7f180 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gon=C3=A9ri=20Le=20Bouder?= Date: Sun, 23 Mar 2014 00:39:49 +0100 Subject: [PATCH] debian: install cloud-init on Wheezy cloud-init packages are not available in the Debian Wheezy repository. However, they are available in wheezy-backports. With this change, the cloud-init packages are installed from wheezy-backports if DIB_RELEASE is wheezy. Change-Id: I3daa3b0ba185ba3f7c1bf6b8f9b1f8c167fcb340 --- elements/debian/root.d/08-debootstrap | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/elements/debian/root.d/08-debootstrap b/elements/debian/root.d/08-debootstrap index 670fa2e61..7fe12c2cb 100755 --- a/elements/debian/root.d/08-debootstrap +++ b/elements/debian/root.d/08-debootstrap @@ -37,7 +37,7 @@ if [ -n "$DIB_OFFLINE" ] && [ -f $DEBOOTSTRAP_TARBALL ] ; then sudo tar -C $TARGET_ROOT --numeric-owner -xzf $DEBOOTSTRAP_TARBALL 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,rsync,bash-completion,linux-image-amd64 + 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) fi @@ -48,6 +48,16 @@ else $TARGET_ROOT \ $DIB_DISTRIBUTION_MIRROR" echo "Customizing result for cloud use" + + CLOUD_INIT_PACKAGES="cloud-init cloud-utils cloud-initramfs-growroot" + if [ "$DIB_RELEASE" = "wheezy" ]; then + sudo sh -c "echo deb $DIB_DISTRIBUTION_MIRROR wheezy-backports main >> ${TARGET_ROOT}/etc/apt/sources.list" + sudo chroot ${TARGET_ROOT} apt-get update + sudo chroot ${TARGET_ROOT} apt-get install -y -t wheezy-backports $CLOUD_INIT_PACKAGES + else # unstable + sudo chroot ${TARGET_ROOT} apt-get install -y $CLOUD_INIT_PACKAGES + fi + sudo sed -i "s/PermitRootLogin yes/PermitRootLogin without-password/" $TARGET_ROOT/etc/ssh/sshd_config sudo chroot ${TARGET_ROOT} adduser --gecos Debian-cloud-init-user --disabled-password --quiet debian sudo install -d -m 0755 -o root -g root ${TARGET_ROOT}/etc/sudoers.d