summaryrefslogtreecommitdiffstats
path: root/core/modules
diff options
context:
space:
mode:
authorJonathan Bauer2019-10-24 12:45:48 +0200
committerJonathan Bauer2019-10-24 12:45:48 +0200
commit164b9d56d2e85f2194379c9cd1a7b953119387be (patch)
treeda025826f761e97cb4ec46b53fcf4ca7d045bf64 /core/modules
parentsetup_target: formatting (diff)
parent[vmware-common] Remove any existing usb autoconnect entries (diff)
downloadmltk-164b9d56d2e85f2194379c9cd1a7b953119387be.tar.gz
mltk-164b9d56d2e85f2194379c9cd1a7b953119387be.tar.xz
mltk-164b9d56d2e85f2194379c9cd1a7b953119387be.zip
Merge branch 'master' into installer
Diffstat (limited to 'core/modules')
-rw-r--r--core/modules/cups/module.conf.ubuntu.1810
-rwxr-xr-xcore/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats8
-rw-r--r--core/modules/idleaction/data/etc/systemd/logind.conf.d/00-bwlp-default.conf3
-rwxr-xr-xcore/modules/idleaction/data/opt/openslx/scripts/idle-daemon-launcher3
-rw-r--r--core/modules/lightdm/data/etc/pam.d/lightdm-greeter1
-rwxr-xr-xcore/modules/vbox-src/data/opt/openslx/vmchooser/plugins/virtualbox/includes/create_vbox_config.inc8
-rwxr-xr-xcore/modules/vbox-src/data/opt/openslx/vmchooser/plugins/virtualbox/includes/finalize_machine_config.inc33
-rwxr-xr-xcore/modules/vbox-src/data/opt/openslx/vmchooser/plugins/virtualbox/includes/init_core.inc1
-rwxr-xr-xcore/modules/vbox-src/data/opt/openslx/vmchooser/plugins/virtualbox/includes/prepare_snapshot.inc125
-rwxr-xr-xcore/modules/vbox-src/data/opt/openslx/vmchooser/plugins/virtualbox/run-virt.include6
-rw-r--r--core/modules/vbox-src/data/opt/openslx/vmchooser/plugins/virtualbox/snapshot.vdi.gz (renamed from core/modules/vbox-src/data/opt/openslx/vmchooser/plugins/virtualbox/empty-diff.vdi.gz)bin285 -> 285 bytes
-rwxr-xr-xcore/modules/vmchooser2/data/opt/openslx/vmchooser/sessionstart6
-rw-r--r--core/modules/vmware-common/data/opt/openslx/vmchooser/plugins/vmware/includes/write_final_vmx.inc2
-rwxr-xr-xcore/modules/vmware-version-check/data/opt/openslx/bin/vmware-get-supported-version56
-rw-r--r--core/modules/vmware15/module.build8
-rw-r--r--core/modules/vmware15/module.conf4
16 files changed, 177 insertions, 97 deletions
diff --git a/core/modules/cups/module.conf.ubuntu.18 b/core/modules/cups/module.conf.ubuntu.18
index 2c394fad..2aa8b5ed 100644
--- a/core/modules/cups/module.conf.ubuntu.18
+++ b/core/modules/cups/module.conf.ubuntu.18
@@ -1,13 +1,4 @@
#!/bin/bash
-REQUIRED_INSTALLED_PACKAGES="
- cups
- cups-daemon
- cups-filters
- cups-core-drivers
- cups-filters-core-drivers
- ghostscript
- libgs9-common
-"
REQUIRED_CONTENT_PACKAGES="
cups
cups-daemon
@@ -15,6 +6,7 @@ REQUIRED_CONTENT_PACKAGES="
cups-core-drivers
cups-filters-core-drivers
ghostscript
+ hplip
libgs9-common
"
REQUIRED_DIRECTORIES+="
diff --git a/core/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats b/core/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats
index a7afb2d6..694c0707 100755
--- a/core/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats
+++ b/core/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats
@@ -155,14 +155,14 @@ echo "$VIRTTYPE is $VT"
# 8) ID44 partition size
ID44=0
-if ! slx-tools fs_path_isvolatile "/tmp" ; then
- ID44_SPACE=($(slx-tools fs_path_space "/tmp"))
+if ! slx-tools fs_path_isvolatile "/tmp/virt" ; then
+ ID44_SPACE=($(slx-tools fs_path_space "/tmp/virt"))
[ -n "${ID44_SPACE[1]}" ] && ID44="$(( ${ID44_SPACE[1]} / 1024 ))"
if [ "$ID44" -eq 0 ]; then
# Fallback to old way to detect it
# Try df first, make sure device starts with /dev
- read -r df_dev df_size df_used df_avail df_usepercent df_mountpoint df_crap < <(df -P /tmp | grep ' /tmp$')
+ read -r df_dev df_size df_used df_avail df_usepercent df_mountpoint df_crap < <(df -P /tmp/virt | grep ' /tmp/virt$')
if [ -n "${df_size}" ] && [ "${df_dev:0:5}" = "/dev/" ]; then
# df reports kbytes, convert to MB
ID44=$(( df_size / 1024 ))
@@ -179,7 +179,7 @@ if ! slx-tools fs_path_isvolatile "/tmp" ; then
fi
fi
fi
-echo "Temp partition: $ID44 MB"
+echo "Scratch space: $ID44 MB"
# 9) check smart values
FDISK=$(mktemp)
diff --git a/core/modules/idleaction/data/etc/systemd/logind.conf.d/00-bwlp-default.conf b/core/modules/idleaction/data/etc/systemd/logind.conf.d/00-bwlp-default.conf
index 2f8aed56..f3e4800a 100644
--- a/core/modules/idleaction/data/etc/systemd/logind.conf.d/00-bwlp-default.conf
+++ b/core/modules/idleaction/data/etc/systemd/logind.conf.d/00-bwlp-default.conf
@@ -1,6 +1,5 @@
[Login]
-KillUserProcesses=yes
-KillExcludeUsers=root
+KillUserProcesses=no
IdleAction=ignore
HandleLidSwitch=ignore
HandleLidSwitchDocked=ignore
diff --git a/core/modules/idleaction/data/opt/openslx/scripts/idle-daemon-launcher b/core/modules/idleaction/data/opt/openslx/scripts/idle-daemon-launcher
index 3f20ca5e..24b52679 100755
--- a/core/modules/idleaction/data/opt/openslx/scripts/idle-daemon-launcher
+++ b/core/modules/idleaction/data/opt/openslx/scripts/idle-daemon-launcher
@@ -32,5 +32,8 @@ for t in $SLX_SHUTDOWN_SCHEDULE; do
CMD="$CMD --poweroff $t"
done
+if [ "$SLX_ALLOW_USER_BGTASK" != "yes" ]; then
+ CMD="$CMD --kill-user-processes"
+fi
exec /opt/openslx/sbin/idle-daemon $CMD
diff --git a/core/modules/lightdm/data/etc/pam.d/lightdm-greeter b/core/modules/lightdm/data/etc/pam.d/lightdm-greeter
index 40efa81a..ab77b67f 100644
--- a/core/modules/lightdm/data/etc/pam.d/lightdm-greeter
+++ b/core/modules/lightdm/data/etc/pam.d/lightdm-greeter
@@ -3,7 +3,6 @@
#
auth required pam_permit.so
account include common-account
-session include common-session
session required pam_limits.so
session required pam_env.so readenv=1
session required pam_env.so readenv=1 envfile=/etc/default/locale
diff --git a/core/modules/vbox-src/data/opt/openslx/vmchooser/plugins/virtualbox/includes/create_vbox_config.inc b/core/modules/vbox-src/data/opt/openslx/vmchooser/plugins/virtualbox/includes/create_vbox_config.inc
index e432472f..75ec5ec3 100755
--- a/core/modules/vbox-src/data/opt/openslx/vmchooser/plugins/virtualbox/includes/create_vbox_config.inc
+++ b/core/modules/vbox-src/data/opt/openslx/vmchooser/plugins/virtualbox/includes/create_vbox_config.inc
@@ -7,7 +7,7 @@ create_vbox_config() {
declare -rg SLX_FLOPPY_UUID="$(gen_uuid)"
cat <<EOF > "${VBOX_ROOT}/VirtualBox.xml"
-<VirtualBox xmlns="http://www.innotek.de/VirtualBox-settings" version="1.12-linux">
+<VirtualBox xmlns="http://www.virtualbox.org/" version="1.12-linux">
<Global>
<ExtraData>
<ExtraDataItem name="GUI/Input/AutoCapture" value="true"/>
@@ -26,11 +26,7 @@ create_vbox_config() {
<MachineEntry uuid="{${MACHINE_UUID}}" src="Machines/${VM_CLEANNAME}/${VM_CLEANNAME}.xml"/>
</MachineRegistry>
<MediaRegistry>
- <HardDisks>
- <HardDisk uuid="{${HDD_UUID}}" location="${VBOX_HDD_LINK}" format="${VBOX_HDD_FORMAT}" type="${VBOX_HDD_TYPE}">
- <HardDisk uuid="{${SNAPSHOT_UUID}}" location="${VBOX_SNAPSHOT_DIR}/{${SNAPSHOT_UUID}}.vdi" format="VDI" autoReset="true"/>
- </HardDisk>
- </HardDisks>
+ <HardDisks/>
<FloppyImages>
<Image uuid="{${SLX_FLOPPY_UUID}}" location="${SLX_FLOPPY_IMG}"/>
</FloppyImages>
diff --git a/core/modules/vbox-src/data/opt/openslx/vmchooser/plugins/virtualbox/includes/finalize_machine_config.inc b/core/modules/vbox-src/data/opt/openslx/vmchooser/plugins/virtualbox/includes/finalize_machine_config.inc
index 86264e7e..a0cb8960 100755
--- a/core/modules/vbox-src/data/opt/openslx/vmchooser/plugins/virtualbox/includes/finalize_machine_config.inc
+++ b/core/modules/vbox-src/data/opt/openslx/vmchooser/plugins/virtualbox/includes/finalize_machine_config.inc
@@ -3,7 +3,7 @@
################################################################################
setup_disk_image() {
- # set read-only image path and uuid
+ # set disk image path and uuid
set_attr \
"/VirtualBox/Machine/MediaRegistry/HardDisks/HardDisk" \
"location" "${VBOX_HDD_LINK}"
@@ -11,25 +11,24 @@ setup_disk_image() {
"/VirtualBox/Machine/MediaRegistry/HardDisks/HardDisk" \
"uuid" "{${HDD_UUID}}"
+ if isset SNAPSHOT_UUID; then
+ # read-only mode, add snapshot to main disk
+ add_node \
+ "/VirtualBox/Machine/MediaRegistry/HardDisks/HardDisk" "HardDisk" \
+ "uuid={${SNAPSHOT_UUID}}" \
+ "location=$VBOX_SNAPSHOT_DIR/{${SNAPSHOT_UUID}}.vdi" \
+ "format=VDI" \
+ "type=Normal"
+
+ # set snapshot dir
+ set_attr "/VirtualBox/Machine" "snapshotFolder" "${VBOX_SNAPSHOT_DIR}"
+ fi
- # add a HardDisk node for the snapshot
- add_node \
- "/VirtualBox/Machine/MediaRegistry/HardDisks/HardDisk" "HardDisk" \
- "uuid={${SNAPSHOT_UUID}}" \
- "location=$VBOX_SNAPSHOT_DIR/{${SNAPSHOT_UUID}}.vdi" \
- "format=VDI" \
- "type=Normal"
-
- # set snapshot dir
- set_attr "/VirtualBox/Machine" "snapshotFolder" "${VBOX_SNAPSHOT_DIR}"
-
- # set snapshot uuid
- # there should only be exactly one <AttachedDevice> node from the xml
- # retrieved from the server
-
+ # "attach" VBOX_HDD_UUID (either the snapshot's or the disk's)
+ # NOTE: exactly one <AttachedDevice> node should be present in the downloaded xml
set_attr \
"/VirtualBox/Machine/StorageControllers/StorageController/AttachedDevice/Image" \
- "uuid" "{${SNAPSHOT_UUID}}"
+ "uuid" "{${VBOX_HDD_UUID}}"
}
setup_floppies() {
diff --git a/core/modules/vbox-src/data/opt/openslx/vmchooser/plugins/virtualbox/includes/init_core.inc b/core/modules/vbox-src/data/opt/openslx/vmchooser/plugins/virtualbox/includes/init_core.inc
index 2ff95bbf..9f451cf9 100755
--- a/core/modules/vbox-src/data/opt/openslx/vmchooser/plugins/virtualbox/includes/init_core.inc
+++ b/core/modules/vbox-src/data/opt/openslx/vmchooser/plugins/virtualbox/includes/init_core.inc
@@ -228,7 +228,6 @@ Ihren Satelliten scheint VirtualBox nicht zu unterstützen." cleanexit 1
writelog "Failed to create '${VBOX_HDD_DIR}'."
cleanexit 1
fi
- declare -rg VBOX_HDD_LINK="${VM_DISKFILE_RO}"
# Virtualbox configuration dir instead of $HOME/.VirtualBox
export VBOX_USER_HOME="${VBOX_ROOT}"
diff --git a/core/modules/vbox-src/data/opt/openslx/vmchooser/plugins/virtualbox/includes/prepare_snapshot.inc b/core/modules/vbox-src/data/opt/openslx/vmchooser/plugins/virtualbox/includes/prepare_snapshot.inc
index dcbff969..39a20bcd 100755
--- a/core/modules/vbox-src/data/opt/openslx/vmchooser/plugins/virtualbox/includes/prepare_snapshot.inc
+++ b/core/modules/vbox-src/data/opt/openslx/vmchooser/plugins/virtualbox/includes/prepare_snapshot.inc
@@ -1,43 +1,104 @@
+# Extracts the uuid of the given vdi.
+# For VBox VDI Version 1.1, the 16-byte uuid is at offset 392
+# See: https://forums.virtualbox.org/viewtopic.php?p=29267#p29267
+extract_vdi_uuid() {
+ [ -z "$1" ] && return
+ od -An -t x1 -j 392 -N 16 "$1" | \
+ awk '{print $4$3$2$1"-"$6$5"-"$8$7"-"$9$10"-"$11$12$13$14$15$16}'
+}
+
+# Cleanup hook when the session stops
delete_snapshot() {
rm -f "${VBOX_SNAPSHOT_DIR}/{${SNAPSHOT_UUID}}.vdi" || \
writelog "Could not cleanup snapshot file: ${VBOX_SNAPSHOT_DIR}/{${SNAPSHOT_UUID}}.vdi"
}
-prepare_snapshot() {
- declare -rg SNAPSHOT_UUID="34f617be-192a-46b3-a8ae-bce1029e093f" # snapshot UUID is static
-
- # get UUID of disk image using od to get 16 bytes (starting at 392) and
- # order them according to the VDI UUID format with awk
- HDD_UUID="$(od -An -t x1 -j 392 -N 16 ${VBOX_HDD_LINK} | awk '{print $4$3$2$1"-"$6$5"-"$8$7"-"$9$10"-"$11$12$13$14$15$16}')"
+# TODO support snapshot for RW mode that are uploaded/on an NFS.
+prepare_disk_image_rw() {
+ # more of a placeholder function at this point :)
+ declare -rg VBOX_HDD_UUID="$HDD_UUID"
+}
+
+prepare_disk_image_ro() {
+ # extract the uuid of the snapshot...
+ local snapshot_path="${VBOX_PLUGIN_DIR}/snapshot.vdi"
+ local snapshot_tmp="${VBOX_SNAPSHOT_DIR}/${snapshot_path##*/}"
+ if [ -f "${snapshot_path}.gz" ]; then
+ gunzip -c "${snapshot_path}.gz" > "$snapshot_tmp"
+ elif [ -f "$snapshot_path" ]; then
+ cp -f -- "$snapshot_path" "$snapshot_tmp"
+ else
+ writelog "Could not find pre-generated snapshot file '$snapshot_path(|.gz)'."
+ # TODO fallback on creating a snapshot for this vbox image
+ # Note that this needs to be done after VBoxManage is aware of this VM...
+ fi
+ if [ -f "$snapshot_tmp" ]; then
+ declare -rg SNAPSHOT_UUID="$(extract_vdi_uuid "$snapshot_tmp")"
+ fi
+
+ # use temp disk as snapshot to get CoW
+ declare -rg VBOX_HDD_UUID="${SNAPSHOT_UUID}"
+
+ cp -f -- "$snapshot_tmp" "${VBOX_SNAPSHOT_DIR}/{${SNAPSHOT_UUID}}.vdi"
+
+ # TODO Use VBoxManage to determine the UUID of the disk image (making sure
+ # it is a VDI image) and patch it into the prepared snapshot VDI.
+ dd of="${VBOX_SNAPSHOT_DIR}/{${SNAPSHOT_UUID}}.vdi" \
+ seek=424 bs=1 count=16 conv=notrunc <<< "$HDD_UUID" || \
+ writelog "Could not patch snapshot file"
+
+ # TODO handle other formats...
+ # finally "register" the snapshot in the MediaRegistry
+ xmlstarlet ed -L -N x="http://www.virtualbox.org/" \
+ -s "//x:VirtualBox/x:Global/x:MediaRegistry/x:HardDisks/x:HardDisk[@uuid='{${HDD_UUID}}']" \
+ -t elem -n "HardDisk" --var newnode '$prev' \
+ -i '$newnode' -t attr -n "uuid" -v "{${SNAPSHOT_UUID}}" \
+ -i '$newnode' -t attr -n "location" -v "${VBOX_SNAPSHOT_DIR}/{${SNAPSHOT_UUID}}.vdi" \
+ -i '$newnode' -t attr -n "format" -v "VDI" \
+ -i '$newnode' -t attr -n "autoReset" -v "true" \
+ "${VBOX_ROOT}/VirtualBox.xml"
+
+ add_cleanup delete_snapshot
+}
+
+# Prepares the disk image specified as VM_DISKFILE_R[OW]
+# by run-virt's generic setup-image-access.inc
+# * RO -> use a CoW snapshot using VBox internals
+# * RW -> use it as is
+prepare_disk_image() {
+
+ # NOTE: either one is garanteed to be set by setup_image_access.inc
+ local handler
+ if [ -n "$VM_DISKFILE_RO" ]; then
+ declare -rg VBOX_HDD_LINK="$VM_DISKFILE_RO"
+ declare -rg VBOX_HDD_TYPE="Immutable"
+ handler="prepare_disk_image_ro"
+ elif [ -n "$VM_DISKFILE_RW" ]; then
+ declare -rg VBOX_HDD_LINK="$VM_DISKFILE_RW"
+ declare -rg VBOX_HDD_TYPE="Normal"
+ handler="prepare_disk_image_rw"
+ fi
+
+ # TODO Determine HDD storage format using VBoxManage
+ declare -rg VBOX_HDD_FORMAT="VDI"
+ declare -rg HDD_UUID="$(extract_vdi_uuid ${VBOX_HDD_LINK})"
if isempty HDD_UUID; then
writelog "Failed to extract VDI UUID of '${VBOX_HDD_LINK}'"
EXIT_TYPE="internal" EXIT_REASON="Konnte UUID der virtuellen Festplatte nicht extrahieren." cleanexit 1
fi
- VBOX_HDD_FORMAT="VDI"
-
- if isset VM_DISKFILE_RO; then
- # use temp disk as snapshot to get CoW
- VBOX_HDD_TYPE="Immutable" # make disk immutable
- VBOX_HDD_UUID=${SNAPSHOT_UUID}
- < "${VBOX_PLUGIN_DIR}/empty-diff.vdi.gz" gunzip > "${VBOX_SNAPSHOT_DIR}/{${SNAPSHOT_UUID}}.vdi"
- # patch the disk file uuid into the snapshot vdi file:
- # We read from offset 424 in the source HDD and write the 16 bytes long UUID
- # starting at offset 392 in the snapshot.
- # TODO: This requires the image to be a vdi/vdh; Afaik, vbox supports vmdk,
- # so this code would break in that case. Can we use the diskuuid we got via
- # VBoxManage, convert to binary, and patch it
- dd if=${VBOX_HDD_LINK} of="${VBOX_SNAPSHOT_DIR}/{${SNAPSHOT_UUID}}.vdi" seek=424 \
- skip=392 bs=1 count=16 conv=notrunc || \
- writelog "Could not patch snapshot file"
- add_cleanup delete_snapshot
- elif isset VM_DISKFILE_RW; then
- # Image is already RW - easy
- VBOX_HDD_TYPE="Normal"
- VBOX_HDD_UUID=${HDD_UUID}
- else
- writelog "Neither VM_DISKFILE_RO nor VM_DISKFILE_RW defined!"
- cleanexit 1
- fi
+ # add the hard disk element to the "global" VirtualBox.xml
+ xmlstarlet ed -L -N x="http://www.virtualbox.org/" \
+ -s "//x:VirtualBox/x:Global/x:MediaRegistry/x:HardDisks" \
+ -t elem -n "HardDisk" --var newnode '$prev' \
+ -i '$newnode' -t attr -n "uuid" -v "{${HDD_UUID}}" \
+ -i '$newnode' -t attr -n "location" -v "$VBOX_HDD_LINK" \
+ -i '$newnode' -t attr -n "format" -v "$VBOX_HDD_FORMAT" \
+ -i '$newnode' -t attr -n "type" -v "$VBOX_HDD_TYPE" \
+ "${VBOX_ROOT}/VirtualBox.xml"
+
+ # now handle either RW or RO images
+ isset handler && "$handler"
+ return 0
}
-call_post_source prepare_snapshot
+call_post_source prepare_disk_image
diff --git a/core/modules/vbox-src/data/opt/openslx/vmchooser/plugins/virtualbox/run-virt.include b/core/modules/vbox-src/data/opt/openslx/vmchooser/plugins/virtualbox/run-virt.include
index bca5c250..3ad81df5 100755
--- a/core/modules/vbox-src/data/opt/openslx/vmchooser/plugins/virtualbox/run-virt.include
+++ b/core/modules/vbox-src/data/opt/openslx/vmchooser/plugins/virtualbox/run-virt.include
@@ -28,12 +28,12 @@ run_plugin() {
# determine hardware limits based on guest OD
$(safesource "${VBOX_INCLUDE_DIR}/guest_hardware_limits.inc")
- # prepare volatile rw layer for the disk image using a snapshot
- $(safesource "${VBOX_INCLUDE_DIR}/prepare_snapshot.inc")
-
# create main virtualbox configuration
$(safesource "${VBOX_INCLUDE_DIR}/create_vbox_config.inc")
+ # prepare volatile rw layer for the disk image using a snapshot
+ $(safesource "${VBOX_INCLUDE_DIR}/prepare_snapshot.inc")
+
# finalize machine configuration
$(safesource "${VBOX_INCLUDE_DIR}/finalize_machine_config.inc")
diff --git a/core/modules/vbox-src/data/opt/openslx/vmchooser/plugins/virtualbox/empty-diff.vdi.gz b/core/modules/vbox-src/data/opt/openslx/vmchooser/plugins/virtualbox/snapshot.vdi.gz
index c6abbd57..c6abbd57 100644
--- a/core/modules/vbox-src/data/opt/openslx/vmchooser/plugins/virtualbox/empty-diff.vdi.gz
+++ b/core/modules/vbox-src/data/opt/openslx/vmchooser/plugins/virtualbox/snapshot.vdi.gz
Binary files differ
diff --git a/core/modules/vmchooser2/data/opt/openslx/vmchooser/sessionstart b/core/modules/vmchooser2/data/opt/openslx/vmchooser/sessionstart
index 1cc7eb5f..215077e3 100755
--- a/core/modules/vmchooser2/data/opt/openslx/vmchooser/sessionstart
+++ b/core/modules/vmchooser2/data/opt/openslx/vmchooser/sessionstart
@@ -1,5 +1,11 @@
#!/bin/ash
+# Give it some time, in case starting the session fails.
+# In that case, vmchooser will send us a SIGTERM, which will
+# hopefully happen within one second, so we wont't execute
+# all the sessionstart hooks.
+sleep 1
+
SOURCEPATH="/opt/openslx/vmchooser/sessionstart.d"
if [ -d "$SOURCEPATH" ]; then
diff --git a/core/modules/vmware-common/data/opt/openslx/vmchooser/plugins/vmware/includes/write_final_vmx.inc b/core/modules/vmware-common/data/opt/openslx/vmchooser/plugins/vmware/includes/write_final_vmx.inc
index b0343e8d..f64e8ddf 100644
--- a/core/modules/vmware-common/data/opt/openslx/vmchooser/plugins/vmware/includes/write_final_vmx.inc
+++ b/core/modules/vmware-common/data/opt/openslx/vmchooser/plugins/vmware/includes/write_final_vmx.inc
@@ -140,6 +140,8 @@ setup_usb() {
sed -i '/^usb\.generic\.autoconnect/Id' "${TMPCONFIG}"
echo 'usb.generic.autoconnect = "TRUE"' >> "${TMPCONFIG}"
echo 'usb.mangleUsb3Speed = "TRUE"' >> "${TMPCONFIG}"
+ # Remove stray autoconnect entries
+ sed -i '/^usb\.autoConnect\.device/Id' "${TMPCONFIG}"
# Workaround for old VMs
if grep -q -i '^ehci\.present.*TRUE' "${TMPCONFIG}" \
diff --git a/core/modules/vmware-version-check/data/opt/openslx/bin/vmware-get-supported-version b/core/modules/vmware-version-check/data/opt/openslx/bin/vmware-get-supported-version
index 12767e23..06c9572c 100755
--- a/core/modules/vmware-version-check/data/opt/openslx/bin/vmware-get-supported-version
+++ b/core/modules/vmware-version-check/data/opt/openslx/bin/vmware-get-supported-version
@@ -6,24 +6,42 @@
# It can be called inside a dracut context and tries to do
# chroot magic to call/load the required tools.
-get_supported_version() {
- local vendor="$( awk '$1 == "vendor_id" {print $NF;exit}' /proc/cpuinfo )"
- local version=12
- if [ "$vendor" = "GenuineIntel" ]; then
- local rdmsr_cmd="rdmsr"
- if [ -n "$NEWROOT" ]; then
- modprobe -d "$NEWROOT" msr
- rdmsr_cmd="${NEWROOT}/$(chroot $NEWROOT /bin/bash -c 'type -p rdmsr')"
- else
- modprobe msr
- fi
- flag="$( $rdmsr_cmd --bitfield 5:5 0x485 )"
- [ "$flag" = 1 ] && version=15
- elif [ "$vendor" = "AuthenticAMD" ]; then
- family="$( awk '$1$2 == "cpufamily" {print $NF;exit}' /proc/cpuinfo )"
- [ "$family" -ge 21 ] && version=15
+VIRTTYPE=$(grep -m1 '^flags\s*:' /proc/cpuinfo | grep -wo -e svm -e vmx)
+
+if [ -z "$VIRTTYPE" ]; then
+ echo 12
+ exit 0
+fi
+
+modprobe msr
+
+VT=
+if [ "$VIRTTYPE" = "vmx" ]; then # intel
+ BIT1=$(rdmsr --bitfield 0:0 0x3a 2>/dev/null || echo "fail")
+ BIT2=$(rdmsr --bitfield 2:2 0x3a 2>/dev/null || echo "fail")
+ if [ "$BIT1" = "0" ] || [ "$BIT2" = "1" ]; then
+ VT="ENABLED"
+ fi
+elif [ "$VIRTTYPE" = "svm" ]; then # amd
+ BIT=$(rdmsr --bitfield 4:4 0xc0010114 2>/dev/null || echo "fail")
+ if [ "$BIT" = "0" ]; then
+ VT="ENABLED"
fi
- echo "$version"
-}
+fi
+
+if [ "$VT" != "ENABLED" ]; then
+ echo 12
+ exit 0
+fi
+
+version=12
+if [ "$VIRTTYPE" = "vmx" ]; then
+ flag="$( rdmsr --bitfield 5:5 0x485 )"
+ [ "$flag" = "1" ] && version=15
+elif [ "$VIRTTYPE" = "svm" ]; then
+ family="$( awk '$1$2 == "cpufamily" {print $NF;exit}' /proc/cpuinfo )"
+ [ "$family" -ge 21 ] && version=15
+fi
+
+echo "$version"
-get_supported_version
diff --git a/core/modules/vmware15/module.build b/core/modules/vmware15/module.build
index 0e34181d..8b51f5c2 100644
--- a/core/modules/vmware15/module.build
+++ b/core/modules/vmware15/module.build
@@ -139,7 +139,15 @@ build() {
installerDefaults.autoSoftwareUpdateEnabled = "no"
installerDefaults.componentDownloadEnabled = "no"
installerDefaults.dataCollectionEnabled = "no"
+ acceptEULA = "yes"
+ acceptOVFEULA = "yes"
HEREDOC
+ # XXX: If the previous lines are missing, i.e. if vmware wants you to accept the EULAs first, it
+ # will try to read these files:
+ # /usr/share/doc/vmware-player/EULA
+ # /usr/lib/vmware-ovftool/vmware.eula
+ # If it cannot open these files (as we deleted them) it will crash with a SIGABRT (signal 6)
+ # coming from an uncaught exeception in libglibmm's file_get_contents
}
post_copy() {
diff --git a/core/modules/vmware15/module.conf b/core/modules/vmware15/module.conf
index e41850b1..67030d67 100644
--- a/core/modules/vmware15/module.conf
+++ b/core/modules/vmware15/module.conf
@@ -1,12 +1,11 @@
#!/bin/bash
-REQUIRED_VERSION="15.1.0"
+REQUIRED_VERSION="15.5.0"
REQUIRED_TYPE="workstation"
REQUIRED_MODULES="kernel vmware-common"
REQUIRED_DIRECTORIES="
/etc/vmware
/usr/sbin
/usr/lib/vmware/bin
- /usr/lib/vmware/hostd
/usr/lib/vmware/icu
/usr/lib/vmware/lib
/usr/lib/vmware/libconf
@@ -19,7 +18,6 @@ REQUIRED_DIRECTORIES="
"
REQUIRED_FILES="
/usr/lib/vmware/config
- /usr/bin/vmware-usbarbitrator
/opt/openslx/vmchooser/plugins/vmware/vmware.conf
"
REQUIRED_BINARIES="