Browse code

fix for #109 - set the hostname to GUEST_NAME

Anthony Young authored on 2011/10/28 05:07:37
Showing 1 changed files
... ...
@@ -341,7 +341,14 @@ chroot $ROOTFS chown -R stack $DEST
341 341
 # Change boot params so that we get a console log
342 342
 sudo sed -e "s/quiet splash/splash console=ttyS0 console=ttyS1,19200n8/g" -i $ROOTFS/boot/grub/menu.lst
343 343
 sudo sed -e "s/^hiddenmenu//g" -i $ROOTFS/boot/grub/menu.lst
344
-#chroot $ROOTFS grub-install /dev/vda
344
+
345
+# Set the hostname
346
+echo $GUEST_NAME > $ROOTFS/etc/hostname
347
+
348
+# We need the hostname to resolve for rabbit to launch
349
+if ! grep -q $GUEST_NAME $ROOTFS/etc/hosts; then
350
+    echo "$GUEST_IP $GUEST_NAME" >> $ROOTFS/etc/hosts
351
+fi
345 352
 
346 353
 # Unmount
347 354
 umount $ROOTFS || echo 'ok'