From b957a855f944f1dd62622679d16ff98cf84e99eb Mon Sep 17 00:00:00 2001 From: Anthony Young Date: Thu, 27 Oct 2011 13:07:37 -0700 Subject: [PATCH] fix for #109 - set the hostname to GUEST_NAME --- tools/build_kvm.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/build_kvm.sh b/tools/build_kvm.sh index 36457d5..e6cb3e3 100755 --- a/tools/build_kvm.sh +++ b/tools/build_kvm.sh @@ -341,7 +341,14 @@ chroot $ROOTFS chown -R stack $DEST # Change boot params so that we get a console log sudo sed -e "s/quiet splash/splash console=ttyS0 console=ttyS1,19200n8/g" -i $ROOTFS/boot/grub/menu.lst sudo sed -e "s/^hiddenmenu//g" -i $ROOTFS/boot/grub/menu.lst -#chroot $ROOTFS grub-install /dev/vda + +# Set the hostname +echo $GUEST_NAME > $ROOTFS/etc/hostname + +# We need the hostname to resolve for rabbit to launch +if ! grep -q $GUEST_NAME $ROOTFS/etc/hosts; then + echo "$GUEST_IP $GUEST_NAME" >> $ROOTFS/etc/hosts +fi # Unmount umount $ROOTFS || echo 'ok'