Browse code

working build_kvm

Anthony Young authored on 2011/10/20 12:09:43
Showing 1 changed files
... ...
@@ -175,9 +175,8 @@ cat > $LIBVIRT_XML <<EOF
175 175
     <name>$VM_NAME</name>
176 176
     <memory>1524288</memory>
177 177
     <os>
178
-            <type>hvm</type>
179
-            <boot dev='hd'/>
180
-            <bootmenu enable='yes'/>
178
+        <type>hvm</type>
179
+        <bootmenu enable='yes'/>
181 180
     </os>
182 181
     <features>
183 182
         <acpi/>
... ...
@@ -287,6 +286,7 @@ cd $DEST/devstack && $STACKSH_PARAMS FORCE=yes ./stack.sh > /$DEST/run.sh.log
287 287
 echo >> /$DEST/run.sh.log
288 288
 echo >> /$DEST/run.sh.log
289 289
 echo "All done! Time to start clicking." >> /$DEST/run.sh.log
290
+cat $DEST/run.sh.log
290 291
 EOF
291 292
 chmod 755 $RUN_SH
292 293
 
... ...
@@ -297,13 +297,14 @@ cat > $RC_LOCAL <<EOF
297 297
 # Reboot if this is our first run to enable console log on natty :(
298 298
 if [ ! -e /root/firstlaunch ]; then
299 299
     touch /root/firstlaunch
300
-#    reboot
300
+    reboot -f
301 301
     exit 0
302 302
 fi
303 303
 su -c "$DEST/run.sh" stack
304 304
 EOF
305 305
 chmod +x $RC_LOCAL
306 306
 chroot $ROOTFS sudo update-rc.d local defaults 80
307
+#chroot $ROOTFS update-rc.d local start 80 2 . stop 80 0 1 6
307 308
 
308 309
 # Make our ip address hostnames look nice at the command prompt
309 310
 echo "export PS1='${debian_chroot:+($debian_chroot)}\\u@\\H:\\w\\$ '" >> $ROOTFS/$DEST/.bashrc
... ...
@@ -314,6 +315,8 @@ chroot $ROOTFS chown -R stack $DEST
314 314
 
315 315
 # Change boot params so that we get a console log
316 316
 sudo sed -e "s/quiet splash/splash console=ttyS0 console=ttyS1,19200n8/g" -i $ROOTFS/boot/grub/menu.lst
317
+sudo sed -e "s/^hiddenmenu//g" -i $ROOTFS/boot/grub/menu.lst
318
+#chroot $ROOTFS grub-install /dev/vda
317 319
 
318 320
 # Unmount
319 321
 umount $ROOTFS || echo 'ok'
... ...
@@ -323,7 +326,7 @@ qemu-nbd -d /dev/nbd5
323 323
 cd $VM_DIR && virsh create libvirt.xml
324 324
 
325 325
 # Tail the console log till we are done
326
-WAIT_TILL_LAUNCH=${WAIT_TILL_LAUNCH:-0}
326
+WAIT_TILL_LAUNCH=${WAIT_TILL_LAUNCH:-1}
327 327
 if [ "$WAIT_TILL_LAUNCH" = "1" ]; then
328 328
     # Done creating the container, let's tail the log
329 329
     echo
... ...
@@ -353,7 +356,7 @@ if [ "$WAIT_TILL_LAUNCH" = "1" ]; then
353 353
     trap kill_tail SIGINT
354 354
 
355 355
     echo "Waiting stack.sh to finish..."
356
-    while ! cat $VM_DIR/console.log | grep -q 'stack.sh completed' ; do
356
+    while ! cat $VM_DIR/console.log | grep -q 'All done' ; do
357 357
         sleep 5
358 358
     done
359 359