Skip to content

Commit 2b6c69d

Browse files
author
riban
committed
Consolidate zynaudio8x build into kernel postinst script.
1 parent 050c76d commit 2b6c69d

File tree

3 files changed

+41
-9
lines changed

3 files changed

+41
-9
lines changed

etc/kernel/postinst.d/kernel-headers

-6
This file was deleted.

etc/kernel/postinst.d/zynthian

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/bin/bash
2+
3+
# Script to install kernel headers after kernel is updated and build and install zynaudio8x
4+
# Expects argument: kernel_ver
5+
# Place in /etc/kernel/postinst.d
6+
7+
# Check if RBPI_VERSION_NUMBER is set
8+
if [ -z "$RBPI_VERSION_NUMBER" ]
9+
then
10+
echo "Error: RBPI_VERSION_NUMBER is not set."
11+
exit 0
12+
fi
13+
14+
# Check if RBPI_VERSION_NUMBER equals 5
15+
if [ "$RBPI_VERSION_NUMBER" -ne 5 ]
16+
then
17+
echo "Not installing zynaudio8x for < RPi5"
18+
exit 0
19+
fi
20+
21+
SRC_DIR=/zynthian/zynthian-sw/audio8x
22+
23+
if [ "$#" -lt 1 ]
24+
then
25+
echo "Requires kernel name to be passed as command line argument"
26+
exit 1
27+
fi
28+
29+
echo "Installing zynaudio8x"
30+
31+
apt-get -y install linux-headers-$1
32+
33+
if [ ! -d $SRC_DIR ]
34+
then
35+
git clone https://github.com/riban-bw/zynaudiox8.git $SRC_DIR
36+
fi
37+
cd $SRC_DIR
38+
git pull
39+
make KERNEL=$1 && make install

scripts/update_zynthian_recipes.sh

+2-3
Original file line numberDiff line numberDiff line change
@@ -555,11 +555,10 @@ if [[ "$current_patchlevel" < "$patchlevel" ]]; then
555555
pip3 install pyalsaaudio
556556
fi
557557

558-
patchlevel="20241204.1"
558+
patchlevel="20241206.1"
559559
if [[ "$current_patchlevel" < "$patchlevel" ]]; then
560-
# One-time install of current headers. Subsequent kernel updates are handled by /etc/kernel/postinst.d/kernel-headers
561560
echo "Applying patch $patchlevel...
562-
aptpkgs="$aptpkgs "linux-headers-$(uname -r)"
561+
dpkg-reconfigure linux-image-`uname -r`
563562
fi
564563
565564
# -----------------------------------------------------------------------------

0 commit comments

Comments
 (0)