Skip to content

Commit

Permalink
Download the respeaker driver for the kernel version in use
Browse files Browse the repository at this point in the history
  • Loading branch information
tannisroot committed May 18, 2024
1 parent 962b2f5 commit 30e9d74
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions etc/install-respeaker-drivers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@

set -eo pipefail

kernel_formatted="$(uname -r | cut -f1,2 -d.)"
driver_url_status="$(curl -ILs https://github.com/HinTak/seeed-voicecard/archive/refs/heads/v$kernel_formatted.tar.gz | tac | grep -o "^HTTP.*" | cut -f 2 -d' ' | head -1)"

if [ ! "$driver_url_status" = 200 ]; then
echo "Could not find driver for kernel $kernel_formatted"
exit 1
fi

apt-get update
apt-get install --no-install-recommends --yes \
curl raspberrypi-kernel-headers dkms i2c-tools libasound2-plugins alsa-utils
Expand All @@ -22,12 +30,11 @@ pushd "${temp_dir}"

# Download source code to temporary directory
# NOTE: There are different branches in the repo for different kernel versions.
# We use v6.1 here.
echo 'Downloading source code'
curl -L -o - 'https://github.com/HinTak/seeed-voicecard/archive/refs/heads/v6.1.tar.gz' | \
curl -L -o - "https://github.com/HinTak/seeed-voicecard/archive/refs/heads/v$kernel_formatted.tar.gz" | \
tar -xzf -

cd seeed-voicecard-6.1/
cd seeed-voicecard-"$kernel_formatted"/

# 1. Build kernel module
echo 'Building kernel module'
Expand Down

0 comments on commit 30e9d74

Please sign in to comment.