From d1b426877b64331672a372db3be5fd1934cc0cb2 Mon Sep 17 00:00:00 2001 From: jlkDE Date: Sun, 5 Feb 2023 16:32:45 +0100 Subject: [PATCH 1/2] Use custom KVER and KARCH from env if set --- install-driver.sh | 8 ++++++-- remove-driver.sh | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/install-driver.sh b/install-driver.sh index 8d33010..b083713 100755 --- a/install-driver.sh +++ b/install-driver.sh @@ -32,8 +32,12 @@ SCRIPT_VERSION="20230628" MODULE_NAME="88x2bu" DRV_VERSION="5.13.1" -KARCH="$(uname -m)" -KVER="$(uname -r)" +if [ -z "${KARCH+1}" ]; then + KARCH="$(uname -m)" +fi +if [ -z "${KVER+1}" ]; then + KVER="$(uname -r)" +fi MODDESTDIR="/lib/modules/${KVER}/kernel/drivers/net/wireless/" DRV_NAME="rtl${MODULE_NAME}" diff --git a/remove-driver.sh b/remove-driver.sh index 275ee7d..e81a90c 100755 --- a/remove-driver.sh +++ b/remove-driver.sh @@ -32,8 +32,12 @@ SCRIPT_VERSION="20230226" MODULE_NAME="88x2bu" DRV_VERSION="5.13.1" -KARCH="$(uname -m)" -KVER="$(uname -r)" +if [ -z "${KARCH+1}" ]; then + KARCH="$(uname -m)" +fi +if [ -z "${KVER+1}" ]; then + KVER="$(uname -r)" +fi MODDESTDIR="/lib/modules/${KVER}/kernel/drivers/net/wireless/" DRV_NAME="rtl${MODULE_NAME}" From 3c4f722bcc9a863471cd69f98fa6795a8a51dda4 Mon Sep 17 00:00:00 2001 From: jlkDE Date: Sun, 5 Feb 2023 16:35:54 +0100 Subject: [PATCH 2/2] Explicitly supply KVER and KARCH to dkms builds --- install-driver.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install-driver.sh b/install-driver.sh index b083713..f29ede5 100755 --- a/install-driver.sh +++ b/install-driver.sh @@ -353,9 +353,9 @@ else fi if command -v /usr/bin/time >/dev/null 2>&1; then - /usr/bin/time -f "Compile time: %U seconds" dkms build -m ${DRV_NAME} -v ${DRV_VERSION} + /usr/bin/time -f "Compile time: %U seconds" dkms build -m ${DRV_NAME} -v ${DRV_VERSION} -k "${KVER}/${KARCH}" else - dkms build -m ${DRV_NAME} -v ${DRV_VERSION} + dkms build -m ${DRV_NAME} -v ${DRV_VERSION} -k "${KVER}/${KARCH}" fi RESULT=$?