From 901b451bd53734419f0ae2641f7f21d6401b3cbf Mon Sep 17 00:00:00 2001 From: KillingJacky Date: Mon, 27 Apr 2020 07:58:47 +0100 Subject: [PATCH] add an cmd line option for choosing compile with compatible kernel; clean up more when uninstalling --- install.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index ba309ca..71685a1 100755 --- a/install.sh +++ b/install.sh @@ -1,6 +1,6 @@ #!/bin/bash -FORCE_KERNEL="1.20190925+1-1" +FORCE_KERNEL="1.20200819-1" if [[ $EUID -ne 0 ]]; then echo "This script must be run as root (use sudo)" 1>&2 @@ -115,6 +115,14 @@ function download_install_debpkg() { return $r } +option_pattern="compat-kernel" +if [[ $1 =~ ${option_pattern} ]]; then + echo "will compile with a compatible kernel..." +else + FORCE_KERNEL="" + echo "will compile with the latest kernel..." +fi + function install_kernel() { local _url _prefix @@ -181,6 +189,10 @@ function install_module { for _i in $kernels; do dkms build -k $_i -m $mod -v $ver && { dkms install --force -k $_i -m $mod -v $ver + } || { + echo "Can't compile with this kernel, aborting" + echo "Please try to compile with the option --compat-kernel" + exit 1 } done