add an cmd line option for choosing compile with compatible kernel; clean up more when uninstalling
This commit is contained in:
parent
48463b9a50
commit
ad4d66d3f7
2 changed files with 18 additions and 5 deletions
15
install.sh
15
install.sh
|
@ -1,6 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
FORCE_KERNEL="1.20190925+1-1"
|
#FORCE_KERNEL="1.20190925+1-1"
|
||||||
|
FORCE_KERNEL="1.20200212-1"
|
||||||
|
|
||||||
if [[ $EUID -ne 0 ]]; then
|
if [[ $EUID -ne 0 ]]; then
|
||||||
echo "This script must be run as root (use sudo)" 1>&2
|
echo "This script must be run as root (use sudo)" 1>&2
|
||||||
|
@ -105,6 +106,14 @@ function download_install_debpkg() {
|
||||||
return $r
|
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() {
|
function install_kernel() {
|
||||||
local _url _prefix
|
local _url _prefix
|
||||||
|
|
||||||
|
@ -167,6 +176,10 @@ function install_module {
|
||||||
for _i in $kernels; do
|
for _i in $kernels; do
|
||||||
dkms build -k $_i -m $mod -v $ver && {
|
dkms build -k $_i -m $mod -v $ver && {
|
||||||
dkms install --force -k $_i -m $mod -v $ver
|
dkms install --force -k $_i -m $mod -v $ver
|
||||||
|
} || {
|
||||||
|
echo "can not compile with this kernel, abourt"
|
||||||
|
echo "please try compile with option --compat-kernel"
|
||||||
|
exit 1
|
||||||
}
|
}
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
|
@ -73,9 +73,9 @@ echo "remove dkms"
|
||||||
rm -rf /var/lib/dkms/seeed-voicecard || true
|
rm -rf /var/lib/dkms/seeed-voicecard || true
|
||||||
|
|
||||||
echo "remove kernel modules"
|
echo "remove kernel modules"
|
||||||
rm /lib/modules/${uname_r}/kernel/sound/soc/codecs/snd-soc-wm8960.ko || true
|
rm /lib/modules/*/kernel/sound/soc/codecs/snd-soc-wm8960.ko || true
|
||||||
rm /lib/modules/${uname_r}/kernel/sound/soc/codecs/snd-soc-ac108.ko || true
|
rm /lib/modules/*/kernel/sound/soc/codecs/snd-soc-ac108.ko || true
|
||||||
rm /lib/modules/${uname_r}/kernel/sound/soc/bcm/snd-soc-seeed-voicecard.ko || true
|
rm /lib/modules/*/kernel/sound/soc/bcm/snd-soc-seeed-voicecard.ko || true
|
||||||
|
|
||||||
echo "remove $CONFIG configuration"
|
echo "remove $CONFIG configuration"
|
||||||
for i in $RPI_HATS; do
|
for i in $RPI_HATS; do
|
||||||
|
|
Loading…
Reference in a new issue