From 5af25b5f461d2ac8ef52881cc6f7557b5f0624c7 Mon Sep 17 00:00:00 2001 From: Jonathan Brownell Date: Fri, 28 Feb 2014 15:43:42 -0800 Subject: [PATCH] Fix "(None)" seed hostname on Debian The cloud-init package on Debian Linux overwrites the system hostname to "(None)" unless a hostname is specified in one of the /etc/cloud/cloud.cfg.d/* files. This change applies a default hostname of "debian" using cloud-init. Change-Id: I9b411df44cfa05f899e708900f95719c0bcd6267 --- elements/debian/root.d/08-debootstrap | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/elements/debian/root.d/08-debootstrap b/elements/debian/root.d/08-debootstrap index ea9a6e9a7..115c5a022 100755 --- a/elements/debian/root.d/08-debootstrap +++ b/elements/debian/root.d/08-debootstrap @@ -58,6 +58,10 @@ LABEL=cloudimg-rootfs / ext4 errors=remount-ro 0 1 ' > ${TARGET_ROOT}/etc/fstab" sudo sh -c "echo 'blacklist pcspkr' > ${TARGET_ROOT}/etc/modprobe.d/blacklist.conf" sudo sh -c "echo 'debian' > ${TARGET_ROOT}/etc/hostname" + + # specify a hostname so that cloud-init does not default to (None) + echo "hostname: debian" > ${TARGET_ROOT}/etc/cloud/cloud.cfg.d/01_hostname.cfg + echo Caching debootstrap result in $DEBOOTSTRAP_TARBALL sudo tar -C $TARGET_ROOT -zcf $DEBOOTSTRAP_TARBALL . fi