From 6fe687b989f180d5d87fa5ebc6bc9f3a2273f2f5 Mon Sep 17 00:00:00 2001 From: Dean Troyer Date: Mon, 31 Oct 2011 20:30:04 -0500 Subject: [PATCH] Cleanups for NBD and GRUB2 --- tools/build_libvirt.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tools/build_libvirt.sh b/tools/build_libvirt.sh index a7ed411..3eb2ff8 100755 --- a/tools/build_libvirt.sh +++ b/tools/build_libvirt.sh @@ -243,8 +243,7 @@ qemu-img create -f qcow2 -b $VM_IMAGE disk modprobe nbd max_part=63 # Set up nbd -modprobe nbd max_part=63 -for i in `seq 1 15`; do +for i in `seq 0 15`; do if [ ! -e /sys/block/nbd$i/pid ]; then NBD=/dev/nbd$i # Connect to nbd and wait till it is ready @@ -353,9 +352,6 @@ echo "export PS1='${debian_chroot:+($debian_chroot)}\\u@\\H:\\w\\$ '" >> $ROOTFS # Give stack ownership over $DEST so it may do the work needed chroot $ROOTFS chown -R stack $DEST -# GRUB 2 wants to see /dev -mount -o bind /dev $ROOTFS/dev - # Set the hostname echo $GUEST_NAME > $ROOTFS/etc/hostname @@ -364,6 +360,9 @@ if ! grep -q $GUEST_NAME $ROOTFS/etc/hosts; then echo "$GUEST_IP $GUEST_NAME" >> $ROOTFS/etc/hosts fi +# GRUB 2 wants to see /dev +mount -o bind /dev $ROOTFS/dev + # Change boot params so that we get a console log G_DEV_UUID=`blkid -t LABEL=cloudimg-rootfs -s UUID -o value | head -1` sed -e "s/GRUB_TIMEOUT=.*$/GRUB_TIMEOUT=3/" -i $ROOTFS/etc/default/grub