Initial updates.
authorRichard W.M. Jones <rjones@redhat.com>
Thu, 3 Jul 2014 14:13:37 +0000 (15:13 +0100)
committerRichard W.M. Jones <rjones@redhat.com>
Thu, 3 Jul 2014 15:10:22 +0000 (16:10 +0100)
.gitignore
build-supernested.sh.in
init.in
run-supernested.sh.in

index f0866b6..0aec8f5 100644 (file)
@@ -17,3 +17,5 @@ Makefile
 /missing
 /run-supernested.sh
 /supernested-*-*.qcow2
+/tmp-appliance.d
+/tmp-supermin.d
index e875fca..bd006ae 100644 (file)
@@ -76,4 +76,5 @@ EOF
 mv tmp-appliance.d/kernel .
 mv tmp-appliance.d/initrd .
 qemu-img convert -f raw tmp-appliance.d/root -O qcow2 "$output"
-rm -rf tmp-supermin.d tmp-appliance.d
+
+#rm -rf tmp-supermin.d tmp-appliance.d
diff --git a/init.in b/init.in
index 32295a8..fb9bf09 100644 (file)
--- a/init.in
+++ b/init.in
@@ -58,7 +58,15 @@ kmod static-nodes --format=tmpfiles --output=/run/tmpfiles.d/kmod.conf
 # Set up tmpfiles (must run after kmod.conf is created above).
 systemd-tmpfiles --prefix=/dev --create
 
+# libiscsi puts itself in a non-standard directory.
+/sbin/ldconfig
+
 # Print some information about the system.
+echo "/proc/cpuinfo ------------------------------"
+cat /proc/cpuinfo
+echo "--------------------------------------------"
+echo
+
 echo -n "cmdline: "
 cat /proc/cmdline
 
@@ -68,16 +76,18 @@ cat /sys/devices/system/clocksource/clocksource0/current_clocksource
 echo -n "kernel: "
 uname -r
 
-echo "/proc/cpuinfo ------------------------------"
-cat /proc/cpuinfo
-echo "--------------------------------------------"
-
 # ls -lR /dev
 # cat /proc/mounts
 # lsmod
 
+level="$(
+    grep -Eo 'supernested.level=[[:digit:]]+' /proc/cmdline |
+    grep -Eo '[[:digit:]]+'
+    )"
+echo "*** This is the L$level hypervisor ***"
+
 # Run the nested guest.
-/run-supernested.sh
+/run-supernested.sh --nested
 
 # Exit and reboot.
 # qemu has the -no-reboot flag, so issuing a reboot here actually
index 50cd47b..51d84da 100644 (file)
@@ -27,7 +27,8 @@ initrd=initrd
 append="panic=1 console=ttyS0 udevtimeout=6000 no_timer_check printk.time=1 root=/dev/sda selinux=0"
 
 TEMP=`getopt \
-        --long nested \
+        -o '' \
+        --longoptions 'help,nested' \
         -n run-supernested.sh -- "$@"`
 if [ $? != 0 ]; then
     echo "$0: problem parsing the command line arguments"
@@ -48,10 +49,11 @@ while true ; do
             ;;
         --help)
             echo "$0: read the README file for information about this script"
-            shift
+           exit 1
             ;;
         --)
             shift
+           break
             ;;
         *)
             echo "internal error ($1)"
@@ -85,6 +87,17 @@ level="$(
 if [ -z "$level" ]; then level=0; fi
 append="$append supernested.level=$((level+1))"
 
+echo "Running"
+echo "    qemu = $qemu"
+echo "    memory = $memory"
+echo "    kernel = $kernel"
+echo "    initrd = $initrd"
+echo "    disk = $image"
+echo "    append = $append"
+
+# Since this could crash the machine, better to sync ...
+sync
+
 exec \
 "$qemu" \
     -cpu host \