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
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 \
# 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
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