From 8497972d652808288cf452f740ba2b1315f6bf72 Mon Sep 17 00:00:00 2001 From: Hin-Tak Leung Date: Mon, 16 Mar 2020 18:34:24 +0000 Subject: [PATCH] Don't force kernel downgrade Revert "Fix: try to use a specific version kernel & headers" This reverts commit ae32476755bf458cdd8883d6975082a244eb9d87. Conflicts: install.sh --- install.sh | 35 +---------------------------------- seeed-voicecard | 2 -- 2 files changed, 1 insertion(+), 36 deletions(-) diff --git a/install.sh b/install.sh index 8ca241b..1252048 100755 --- a/install.sh +++ b/install.sh @@ -1,7 +1,5 @@ #!/bin/bash -FORCE_KERNEL="1.20190925+1-1" - if [[ $EUID -ne 0 ]]; then echo "This script must be run as root (use sudo)" 1>&2 exit 1 @@ -92,43 +90,12 @@ function check_kernel_headers() { apt-get -y --reinstall install raspberrypi-kernel } -function download_install_debpkg() { - local prefix name r - prefix=$1 - name=$2 - - for (( i = 0; i < 3; i++ )); do - wget $prefix$name -O /tmp/$name && break - done - dpkg -i /tmp/$name; r=$? - rm -f /tmp/$name - return $r -} - -function install_kernel() { - local _url _prefix - - # Instead of retriving the lastest kernel & headers - [ "X$FORCE_KERNEL" == "X" ] && { - apt-get -y --force-yes install raspberrypi-kernel-headers raspberrypi-kernel - } || { - # We would like to a fixed version - KERN_NAME=raspberrypi-kernel_${FORCE_KERNEL}_armhf.deb - HDR_NAME=raspberrypi-kernel-headers_${FORCE_KERNEL}_armhf.deb - _url=$(apt-get download --print-uris raspberrypi-kernel | sed -nre "s/'([^']+)'.*$/\1/g;p") - _prefix=$(echo $_url | sed -nre 's/^(.*)raspberrypi-kernel_.*$/\1/g;p') - - download_install_debpkg "$_prefix" "$KERN_NAME" - download_install_debpkg "$_prefix" "$HDR_NAME" - } -} - # update and install required packages which apt &>/dev/null if [[ $? -eq 0 ]]; then apt update -y + apt-get -y install raspberrypi-kernel-headers raspberrypi-kernel apt-get -y install dkms git i2c-tools libasound2-plugins - install_kernel # rpi-update checker check_kernel_headers fi diff --git a/seeed-voicecard b/seeed-voicecard index f1367a9..421f8c5 100755 --- a/seeed-voicecard +++ b/seeed-voicecard @@ -115,7 +115,6 @@ if [ "$overlay" ]; then rm /etc/asound.conf rm /var/lib/alsa/asound.state -: <<\EOF kernel_ver=$(get_kernel_version) # echo kernel_ver=$kernel_ver @@ -131,7 +130,6 @@ if [ "$overlay" ]; then fi done fi -EOF #make sure the driver loads correctly dtoverlay $overlay || true