Browse code

Cleanups for NBD and GRUB2

Dean Troyer authored on 2011/11/01 10:30:04
Showing 1 changed files
... ...
@@ -243,8 +243,7 @@ qemu-img create -f qcow2 -b $VM_IMAGE disk
243 243
 modprobe nbd max_part=63
244 244
 
245 245
 # Set up nbd
246
-modprobe nbd max_part=63
247
-for i in `seq 1 15`; do
246
+for i in `seq 0 15`; do
248 247
     if [ ! -e /sys/block/nbd$i/pid ]; then
249 248
         NBD=/dev/nbd$i
250 249
         # Connect to nbd and wait till it is ready
... ...
@@ -353,9 +352,6 @@ echo "export PS1='${debian_chroot:+($debian_chroot)}\\u@\\H:\\w\\$ '" >> $ROOTFS
353 353
 # Give stack ownership over $DEST so it may do the work needed
354 354
 chroot $ROOTFS chown -R stack $DEST
355 355
 
356
-# GRUB 2 wants to see /dev
357
-mount -o bind /dev $ROOTFS/dev
358
-
359 356
 # Set the hostname
360 357
 echo $GUEST_NAME > $ROOTFS/etc/hostname
361 358
 
... ...
@@ -364,6 +360,9 @@ if ! grep -q $GUEST_NAME $ROOTFS/etc/hosts; then
364 364
     echo "$GUEST_IP $GUEST_NAME" >> $ROOTFS/etc/hosts
365 365
 fi
366 366
 
367
+# GRUB 2 wants to see /dev
368
+mount -o bind /dev $ROOTFS/dev
369
+
367 370
 # Change boot params so that we get a console log
368 371
 G_DEV_UUID=`blkid -t LABEL=cloudimg-rootfs -s UUID -o value | head -1`
369 372
 sed -e "s/GRUB_TIMEOUT=.*$/GRUB_TIMEOUT=3/" -i $ROOTFS/etc/default/grub