Fix use of SUPERMIN and QEMU environment variables, and document.
[supernested.git] / init.in
diff --git a/init.in b/init.in
index 32295a8..84f11fa 100644 (file)
--- a/init.in
+++ b/init.in
@@ -23,7 +23,7 @@ echo "*** /init script starting up ***"
 
 export PATH=/sbin:/usr/sbin:/bin:/usr/bin
 
-# Create /proc, /sys, /run, /dev, /tmp
+# Create /proc, /sys, /run, /dev, /tmp, /var/tmp
 if [ ! -d /proc ]; then rm -f /proc; fi
 mkdir -p /proc
 mount -t proc /proc /proc
@@ -37,6 +37,8 @@ ln -s ../run/lock /var/lock
 mount -t devtmpfs /dev /dev
 mkdir -p /tmp
 mount -t tmpfs tmpfs /tmp
+mkdir -p /var/tmp
+mount -t tmpfs tmpfs /var/tmp
 
 # Find and start udev.
 for f in /sbin/udevd /lib/udev/udevd \
@@ -58,7 +60,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 +78,20 @@ 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
+
+echo "*** the L$level hypervisor is exiting ***"
 
 # Exit and reboot.
 # qemu has the -no-reboot flag, so issuing a reboot here actually