aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Lutomirski <luto@kernel.org>2015-04-01 15:00:40 -0700
committerAndy Lutomirski <luto@kernel.org>2015-04-01 15:00:40 -0700
commit4014908055e1bc119c05a1486a90675251c037e6 (patch)
treeb0d629b7d0e1de601d5e4675cea29ebab51a316c
parent6f11b1102fbb5b336e536dfb5bd99f70b48bfe07 (diff)
downloadvirtme-4014908055e1bc119c05a1486a90675251c037e6.tar.gz
virtme-init: Don't openvt a bunch of vts when we're using a text console
Signed-off-by: Andy Lutomirski <luto@kernel.org>
-rwxr-xr-xvirtme/guest/virtme-init15
1 files changed, 9 insertions, 6 deletions
diff --git a/virtme/guest/virtme-init b/virtme/guest/virtme-init
index 5e2d396..a6cd211 100755
--- a/virtme/guest/virtme-init
+++ b/virtme/guest/virtme-init
@@ -125,21 +125,24 @@ if [[ -x /run/virtme/data/script ]]; then
exit 1
fi
-# Create some VTs
-deallocvt
-openvt -c 2 -- /bin/bash
-openvt -c 3 -- /bin/bash
-openvt -c 4 -- /bin/bash
-
# Figure out what the main console is
consdev="`grep ' ... (.C' /proc/consoles |cut -d' ' -f1`"
if [[ -z "$consdev" ]]; then
log "can't deduce console device"
exec bash --login # At least try to be helpful
fi
+
+deallocvt
+
if [[ "$consdev" == "tty0" ]]; then
+ # Create some VTs
+ openvt -c 2 -- /bin/bash
+ openvt -c 3 -- /bin/bash
+ openvt -c 4 -- /bin/bash
+
consdev=tty1 # sigh
fi
+
if [[ ! -e "/dev/$consdev" ]]; then
log "/dev/$consdev doesn't exist."
exec bash --login