add an cmd line option for choosing compile with compatible kernel; clean up more when uninstalling
This commit is contained in:
parent
b83519eb82
commit
901b451bd5
1 changed files with 13 additions and 1 deletions
14
install.sh
14
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
|
||||
|
||||
|
|
Loading…
Reference in a new issue