diff options
author | Andy Lutomirski <luto@kernel.org> | 2015-04-01 15:00:40 -0700 |
---|---|---|
committer | Andy Lutomirski <luto@kernel.org> | 2015-04-01 15:00:40 -0700 |
commit | 4014908055e1bc119c05a1486a90675251c037e6 (patch) | |
tree | b0d629b7d0e1de601d5e4675cea29ebab51a316c | |
parent | 6f11b1102fbb5b336e536dfb5bd99f70b48bfe07 (diff) | |
download | virtme-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-x | virtme/guest/virtme-init | 15 |
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 |