summaryrefslogtreecommitdiffstats
path: root/core/modules/run-virt/data
diff options
context:
space:
mode:
authorJonathan Bauer2017-03-30 16:11:41 +0200
committerJonathan Bauer2017-03-30 16:11:41 +0200
commit0079a89c3ee794098503f02e8f61fdb37083d805 (patch)
tree055f423289f88836c2a2f0f431d2b8fe3979b1d2 /core/modules/run-virt/data
parent[vmware] Update to 12.5.5 (diff)
downloadmltk-0079a89c3ee794098503f02e8f61fdb37083d805.tar.gz
mltk-0079a89c3ee794098503f02e8f61fdb37083d805.tar.xz
mltk-0079a89c3ee794098503f02e8f61fdb37083d805.zip
[run-virt/vmware] reintroduce lost feature
detection and passthrough of serial and parallel port
Diffstat (limited to 'core/modules/run-virt/data')
-rwxr-xr-xcore/modules/run-virt/data/opt/openslx/scripts/systemd-run_virt_env5
-rw-r--r--core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/set_runvirt_hardware_variables.inc23
2 files changed, 28 insertions, 0 deletions
diff --git a/core/modules/run-virt/data/opt/openslx/scripts/systemd-run_virt_env b/core/modules/run-virt/data/opt/openslx/scripts/systemd-run_virt_env
index 6a30acf4..ddffa4e9 100755
--- a/core/modules/run-virt/data/opt/openslx/scripts/systemd-run_virt_env
+++ b/core/modules/run-virt/data/opt/openslx/scripts/systemd-run_virt_env
@@ -143,6 +143,11 @@ for FLOPPY in $(dmesg|grep -i "Floppy drive"|sed "s,.*(s): ,,;s, is .*,,"); do
j=$(expr $j + 1)
done
+# Serial ports
+echo "SERIAL_PORTS='$(dmesg | grep -Eo 'ttyS[0-9]+' | sed 's,^,/dev/,' | tr '\n' ' ')'" >> "${VMCHOOSER_VIRT_CONF}"
+# Parallel ports
+modprobe parport_pc
+
################################################################################
### Setup VM networking
################################################################################
diff --git a/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/set_runvirt_hardware_variables.inc b/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/set_runvirt_hardware_variables.inc
index e4a1353f..a2eb18f0 100644
--- a/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/set_runvirt_hardware_variables.inc
+++ b/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/set_runvirt_hardware_variables.inc
@@ -105,11 +105,34 @@ check_optical_drives() {
readonly FLOPPY0 CDROM0 CDROM1
}
+# Dynamically detect serial ports here instead of at boot time
+# (virtualization.conf), since USB serial ports get quite common
+# and might not be plugged in at boot time yet
+set_serial_ports() {
+ declare -g SERIAL0=
+ #for port in $(awk '{ if ($1 ~ /^[0-9]+:/ && $2 != "uart:unknown") print "/dev/ttyS" sub(/:\$/, "", $1) }' /proc/tty/driver/serial); do
+ for PORT in $SERIAL_PORTS /dev/ttyUSB*; do
+ [ -c "$PORT" ] || continue
+ SERIAL0="$PORT"
+ break
+ done
+
+ declare -g PARALLEL0=
+ for PORT in /dev/parport*; do
+ [ -c "$PORT" ] || continue
+ PARALLEL0="$PORT"
+ break
+ done
+
+ readonly SERIAL0 PARALLEL0
+}
+
## MAIN ##
call_post_source \
set_virt_cpu \
set_virt_memory \
set_virt_mac \
set_virt_hostname \
+ set_serial_ports \
check_optical_drives