2 # supernested Makefile.am
4 # (C) Copyright 2014 Red Hat Inc.
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 # Written by Richard W.M. Jones <rjones@redhat.com>
22 echo "*** /init script starting up ***"
24 export PATH=/sbin:/usr/sbin:/bin:/usr/bin
26 # Create /proc, /sys, /run, /dev, /tmp
27 if [ ! -d /proc ]; then rm -f /proc; fi
29 mount -t proc /proc /proc
30 if [ ! -d /sys ]; then rm -f /sys; fi
32 mount -t sysfs /sys /sys
34 mount -t tmpfs -o "nosuid,size=20%,mode=0755" tmpfs /run
36 ln -s ../run/lock /var/lock
37 mount -t devtmpfs /dev /dev
39 mount -t tmpfs tmpfs /tmp
41 # Find and start udev.
42 for f in /sbin/udevd /lib/udev/udevd \
43 /lib/systemd/systemd-udevd /usr/lib/systemd/systemd-udevd \
44 /usr/lib/udev/udevd; do
45 if [ -x "$f" ]; then UDEVD="$f"; fi
47 if [ -z "$UDEVD" ]; then
48 echo "udev not found! Things will probably not work ..."
52 udevadm settle --timeout=600
54 # Set up kmod static-nodes (RHBZ#1011907).
55 mkdir -p /run/tmpfiles.d
56 kmod static-nodes --format=tmpfiles --output=/run/tmpfiles.d/kmod.conf
58 # Set up tmpfiles (must run after kmod.conf is created above).
59 systemd-tmpfiles --prefix=/dev --create
61 # libiscsi puts itself in a non-standard directory.
64 # Print some information about the system.
65 echo "/proc/cpuinfo ------------------------------"
67 echo "--------------------------------------------"
73 echo -n "clocksource: "
74 cat /sys/devices/system/clocksource/clocksource0/current_clocksource
84 grep -Eo 'supernested.level=[[:digit:]]+' /proc/cmdline |
85 grep -Eo '[[:digit:]]+'
87 echo "*** This is the L$level hypervisor ***"
89 # Run the nested guest.
90 /run-supernested.sh --nested
92 echo "*** the L$level hypervisor is exiting ***"
95 # qemu has the -no-reboot flag, so issuing a reboot here actually
96 # causes qemu to exit gracefully.