From 352cce26f1c729da6ac729a7bab51a2d84464fa5 Mon Sep 17 00:00:00 2001 From: Kai Krakow Date: Mon, 23 Dec 2024 15:28:30 +0100 Subject: [PATCH] xpadneo, installer: Get rid of ERTM work-around by requiring kernel 5.12 Link: https://github.com/atar-axis/xpadneo/issues/198 Signed-off-by: Kai Krakow --- hid-xpadneo/dkms.conf.in | 2 +- hid-xpadneo/dkms.post_install | 22 ++-------------------- hid-xpadneo/dkms.post_remove | 3 +-- install.sh | 6 ++++++ 4 files changed, 10 insertions(+), 23 deletions(-) diff --git a/hid-xpadneo/dkms.conf.in b/hid-xpadneo/dkms.conf.in index d5faaac4..fc1d7d43 100644 --- a/hid-xpadneo/dkms.conf.in +++ b/hid-xpadneo/dkms.conf.in @@ -10,7 +10,7 @@ DEST_MODULE_LOCATION[0]="/kernel/drivers/hid" MAKE[0]="make -C '${kernel_source_dir}' M='${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build/src' VERSION='${PACKAGE_VERSION}' modules" CLEAN="make -C '${kernel_source_dir}' M='${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build/src' clean" -BUILD_EXCLUSIVE_KERNEL_MIN="4.18.0" +BUILD_EXCLUSIVE_KERNEL_MIN="5.12.0" BUILD_EXCLUSIVE_CONFIG="CONFIG_HID CONFIG_INPUT_FF_MEMLESS CONFIG_POWER_SUPPLY" AUTOINSTALL="yes" diff --git a/hid-xpadneo/dkms.post_install b/hid-xpadneo/dkms.post_install index 96a753f2..9e21714d 100755 --- a/hid-xpadneo/dkms.post_install +++ b/hid-xpadneo/dkms.post_install @@ -1,26 +1,8 @@ #!/bin/sh -#TODO Remove ERTM after kernel patch is deployed in the wild +# DKMS now defaults to kernel 5.12 minimum, remove ERTM override ERTM_OVERRIDE="/etc/modprobe.d/99-xpadneo-bluetooth.conf" -DISABLE_ERTM="/sys/module/bluetooth/parameters/disable_ertm" - -if [ "$(uname -r | awk -F. '{ printf "%03d%03d",$1,$2 }')" -ge 005012 ]; then - echo "Not disabling ERTM, kernel version doesn't require it..." -elif [ "$(readlink "${ERTM_OVERRIDE}" 2>/dev/null)" = "/dev/null" ]; then - echo "Not disabling ERTM, local override in place..." -elif [ -L "${ERTM_OVERRIDE}" ]; then - echo >&2 "WARNING: '${ERTM_OVERRIDE}' is an arbitrary symlink, this is not supported." - echo >&2 "Skipping ERTM fixup, you're expected to manage the options on your own..." -else - echo "Disabling ERTM permanently (requires reboot)..." - echo "options bluetooth disable_ertm=y" >"${ERTM_OVERRIDE}" - echo "HINT: If you want to prevent this in the future, run 'ln -snf /dev/null ${ERTM_OVERRIDE}'." - - if [ -w "${DISABLE_ERTM}" ]; then - echo "Disabling ERTM instantly..." - echo "Y" >"${DISABLE_ERTM}" - fi -fi +[ -L "${ERTM_OVERRIDE}" ] || { echo "Forcing removal of ERTM override..."; rm -f "${ERTM_OVERRIDE}"; } echo "Installing modalias database..." install -D -m 0644 -t /etc/modprobe.d etc-modprobe.d/xpadneo.conf diff --git a/hid-xpadneo/dkms.post_remove b/hid-xpadneo/dkms.post_remove index 3a7a17de..f75d85d8 100755 --- a/hid-xpadneo/dkms.post_remove +++ b/hid-xpadneo/dkms.post_remove @@ -1,8 +1,7 @@ #!/bin/sh -#TODO Remove ERTM after kernel patch is deployed in the wild +# DKMS now defaults to kernel 5.12 minimum, remove ERTM override ERTM_OVERRIDE="/etc/modprobe.d/99-xpadneo-bluetooth.conf" - [ -L "${ERTM_OVERRIDE}" ] || { echo "Uninstalling ERTM override..."; rm -f "${ERTM_OVERRIDE}"; } echo "Uninstalling modalias database..." diff --git a/install.sh b/install.sh index ea1ce28e..9354ea25 100755 --- a/install.sh +++ b/install.sh @@ -12,6 +12,12 @@ if [[ ! -d /sys/devices/virtual/misc/uhid ]]; then fi +if [ "$(uname -r | awk -F. '{ printf "%03d%03d",$1,$2 }')" -ge 005012 ]; then + + >&2 echo "WARNING: kernel 5.12 or lower will not be supported due to known ERTM issues" + +fi + echo "* deploying DKMS package" make "${MAKE_OPTS[@]}" VERSION="${VERSION}" install || maybe_already_installed