Commit 4ed79df0 authored by TotallyNotElite's avatar TotallyNotElite

dont install configs with priority 0

parent d61b10c0
From 3705e3f8f8a40ed9b28e364c54f159eca93f346b Mon Sep 17 00:00:00 2001
From: TotallyNotElite <[email protected]>
Date: Tue, 7 Jan 2020 12:16:30 +0100
Subject: [PATCH] Don't install configs with priority 0
---
src/Mhwd.cpp | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/Mhwd.cpp b/src/Mhwd.cpp
index 2ff7f72..2dcca04 100644
--- a/src/Mhwd.cpp
+++ b/src/Mhwd.cpp
@@ -1107,6 +1107,9 @@ int Mhwd::launch(int argc, char *argv[])
for (auto&& availableConfig : device->availableConfigs_)
{
+ // Never autoinstall drivers with priority 0 (vesa)
+ if (availableConfig->priority_ == 0)
+ continue;
if (autoConfigureNonFreeDriver || availableConfig->freedriver_)
{
config = availableConfig;
--
2.24.1
This diff is collapsed.
diff --git a/pci/graphic_drivers/video-virtualmachine/MHWDCONFIG b/pci/graphic_drivers/video-virtualmachine/MHWDCONFIG
new file mode 100644
index 0000000..7dc4d4d
--- /dev/null
+++ b/pci/graphic_drivers/video-virtualmachine/MHWDCONFIG
@@ -0,0 +1,73 @@
+# mhwd Driver Config
+
+NAME="video-virtualmachine"
+INFO="X.org vmware video driver and open-vm-tools/virtualbox tools"
+VERSION="2018.11.25"
+FREEDRIVER="true"
+PRIORITY="1"
+
+CLASSIDS="0300"
+# Virtualbox version 6.0 uses VMSVGA on Linux guests by default, which has VMWare's VENDORID.
+VENDORIDS="80ee 15AD"
+DEVICEIDS="*"
+
+# Dependencies, gtkmm3 is needed to enable copy/paste support with vmware
+DEPENDS="virtualbox-guest-utils xf86-video-vmware open-vm-tools xf86-input-vmmouse gtkmm3"
+DEPKMOD="virtualbox-guest-modules"
+
+XDGAUTOSTARTFILE="/etc/xdg/autostart/mhwd-vmsvga-alert.desktop"
+
+autostart()
+{
+ cat <<EOF > "${XDGAUTOSTARTFILE}"
+[Desktop Entry]
+Type=Application
+Exec=bash -c "[[ '\$(lspci -nn | grep 'VMware')' != '' ]] && [[ '\$(systemd-detect-virt)' == 'oracle' ]] && notify-send -u critical -a MHWD 'Set your Virtualbox Graphics Controller to VBoxSVGA to enable window resizing'"
+X-GNOME-Autostart-enabled=true
+X-KDE-autostart-after=panel
+EOF
+ # Has to be added separately because MHWD thinks this is the config name
+ echo Name=MHWD VMSVGA detection >> "${XDGAUTOSTARTFILE}"
+}
+
+post_install()
+{
+ if [[ "$(systemd-detect-virt)" == "oracle" ]]; then
+ # Virtualbox detected
+
+ # Automatically check if Virtualbox is set to VMSVGA mode and tell the user to switch away
+ autostart
+
+ if [[ ! -d /run/openrc ]]; then
+ # Load kernel modules and sync clock
+ systemctl enable --now vboxservice.service
+ fi
+ # We have to make /dev/vboxuser read-write, otherwise VBoxClient won't be able to connect. This is not done automatically until the next reboot.
+ chmod 666 /dev/vboxuser
+ elif [[ "$(systemd-detect-virt)" == "vmware" ]]; then
+ # Vmware detected
+
+ if [[ ! -d /run/openrc ]]; then
+ systemctl enable --now vmtoolsd.service
+ fi
+ fi
+}
+
+post_remove()
+{
+ rm -f "${XDGAUTOSTARTFILE}"
+
+ if [[ "$(systemd-detect-virt)" == "oracle" ]]; then
+ # Virtualbox detected
+
+ if [[ ! -d /run/openrc ]]; then
+ systemctl disable --now vboxservice.service
+ fi
+ elif [[ "$(systemd-detect-virt)" == "vmware" ]]; then
+ # Vmware detected
+
+ if [[ ! -d /run/openrc ]]; then
+ systemctl disable --now vmtoolsd.service
+ fi
+ fi
+}
diff --git a/pci/graphic_drivers/virtualbox/MHWDCONFIG b/pci/graphic_drivers/virtualbox/MHWDCONFIG
deleted file mode 100644
index 1ad8c06..0000000
--- a/pci/graphic_drivers/virtualbox/MHWDCONFIG
+++ /dev/null
@@ -1,25 +0,0 @@
-# mhwd Driver Config
-
-NAME="video-virtualbox"
-INFO="X.org virtualbox video driver. Standard driver for use in a virtualbox emulation."
-VERSION="2018.11.25"
-FREEDRIVER="true"
-PRIORITY="1"
-
-CLASSIDS="0300"
-VENDORIDS="80ee"
-DEVICEIDS="*"
-
-# Dependencies
-DEPENDS="virtualbox-guest-utils"
-DEPKMOD="virtualbox-guest-modules"
-
-VBOXSCRIPT="/etc/profile.d/VBoxClient.sh"
-
-post_install()
-{
- echo "#!/bin/bash" > "${VBOXSCRIPT}"
- echo "" >> "${VBOXSCRIPT}"
- echo "/usr/bin/VBoxClient-all > /dev/null" >> "${VBOXSCRIPT}"
- chmod a+x "${VBOXSCRIPT}"
-}
diff --git a/pci/graphic_drivers/xf86-video-vmware/MHWDCONFIG b/pci/graphic_drivers/xf86-video-vmware/MHWDCONFIG
deleted file mode 100644
index d2c6323..0000000
--- a/pci/graphic_drivers/xf86-video-vmware/MHWDCONFIG
+++ /dev/null
@@ -1,46 +0,0 @@
-# mhwd Driver Config
-
-NAME="video-vmware"
-INFO="X.org vmware video driver."
-VERSION="2017.03.12"
-FREEDRIVER="true"
-PRIORITY="1"
-
-CLASSIDS="0300"
-VENDORIDS="15AD"
-DEVICEIDS="*"
-
-# Dependencies
-DEPENDS="xf86-video-vmware xf86-input-vmmouse open-vm-tools"
-
-XORGFILE="/etc/X11/mhwd.d/vmware.conf"
-
-post_install()
-{
- MHWD_HEADING "${XORGFILE}"
- MHWD_ADD_DEVICE_SECTION_FOR_EACH_BUSID "vmware" "${XORGFILE}" 15AD
- MHWD_ADD_DRI "${XORGFILE}"
- MHWD_ADD_COMPOSITING "${XORGFILE}"
- MHWD_ADD_BACKSPACE "${XORGFILE}"
-
- mhwd-gpu --setxorg "${XORGFILE}"
-
- if [[ ! -d /run/openrc ]];then
- systemctl enable vmtoolsd.service
- systemctl start vmtoolsd.service
- fi
-}
-
-post_remove()
-{
- if [ -e "${XORGFILE}" ]; then
- rm "${XORGFILE}"
- fi
-
- mhwd-gpu --check
-
- if [[ ! -d /run/openrc ]];then
- systemctl disable vmtoolsd.service
- systemctl stop vmtoolsd.service
- fi
-}
diff --git a/scripts/mhwd b/scripts/mhwd
index f6e44a3..2018610 100755
--- a/scripts/mhwd
+++ b/scripts/mhwd
@@ -342,7 +342,7 @@ if [ "${REMOVE}" == "true" ]; then
MHWD_CHECK_PKGS
if [ "${PACKAGES}" != "" ]; then
- ${PACMAN} -Rs ${PACKAGES}
+ ${PACMAN} -Rsu ${PACKAGES}
if [ "$?" -ne "0" ]; then
echo "Error: pacman failed!"
exit 1
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment