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