From 24e1955db0b36f158db2f9413c006741a1423bd4 Mon Sep 17 00:00:00 2001 From: morrownr Date: Sun, 11 Dec 2022 19:38:42 -0600 Subject: [PATCH] trying to check if header files are installed --- README.md | 6 +++--- install-driver.sh | 30 +++++++++++++++++------------- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index e983101..52da45b 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ confirm that this is the correct driver for your adapter. - x86, i686 - x86-64, amd64 -- armv7l (arm) +- armv7l, armv6l (arm) - aarch64 (arm64) ### Compatible Kernels @@ -52,7 +52,7 @@ confirm that this is the correct driver for your adapter. ### Tested Compilers -- gcc 9, 11 and 12 +- gcc 9, 10, 11 and 12 ### Tested Linux Distributions @@ -88,7 +88,7 @@ the installation steps can be improved. Note: Red Hat Enterprise Linux (RHEL) and distros based on RHEL are not supported due to the way kernel patches are handled. I will support knowledgable RHEL developers if they want to merge the required -support and keep it current. +support and keep it current. Note: Android is not supported due to the tremendous amount of changes that Google has made to the mainline Linux kernel. I will support diff --git a/install-driver.sh b/install-driver.sh index 422794b..d14c661 100755 --- a/install-driver.sh +++ b/install-driver.sh @@ -50,15 +50,6 @@ then exit 1 fi -# check to ensure iw is installed -if ! command -v iw >/dev/null 2>&1 -then - echo "A required package appears to not be installed." - echo "Please install the following package: iw" - echo "Once the package is installed, please run \"sudo ./${SCRIPT_NAME}\"" - exit 1 -fi - # check to ensure make is installed if ! command -v make >/dev/null 2>&1 then @@ -68,6 +59,23 @@ then exit 1 fi +# check to see if header files are installed +if [ ! -d "/lib/modules/$(uname -r)/build" ]; then + echo "Your kernel headers aren't properly installed." + echo "Please consult your distro documentation." + echo "Once the header files are installed, please run \"sudo ./${SCRIPT_NAME}\"" + exit 1 +fi + +# check to ensure iw is installed +if ! command -v iw >/dev/null 2>&1 +then + echo "A required package appears to not be installed." + echo "Please install the following package: iw" + echo "Once the package is installed, please run \"sudo ./${SCRIPT_NAME}\"" + exit 1 +fi + # check to ensure rfkill is installed if ! command -v rfkill >/dev/null 2>&1 then @@ -145,10 +153,6 @@ then mokutil --sb-state fi -# header files are normally stored in ? -# how can we determine: -# if the correct header files are installed? - # blacklist the in-kernel module (driver) so that there is no conflict echo "Installing ${BLACKLIST_FILE} to: /etc/modprobe.d" cp -f ${BLACKLIST_FILE} /etc/modprobe.d