Ich habe mir das Waveshare Soundmodul WM8960 gekauft und es auf meinem Raspberry Pi 4 montiert. Unter Gentoo konnte ich die Treiber installieren, aber bei opensuse komme ich nicht so weit.

Den treiber habe ich hier heruntergeladen: https://github.com/waveshare/WM8960-Audio-HAT

Es gibt da die Datei install.sh, die ich an opensuse angepasst habe:

Code:
#!/bin/bash


if [[ $EUID -ne 0 ]]; then
   echo "This script must be run as root (use sudo)" 1>&2
   exit 1
fi


is_Raspberry=$(cat /proc/device-tree/model | awk  '{print $1}')
if [ "x${is_Raspberry}" != "xRaspberry" ] ; then
  echo "Sorry, this drivers only works on raspberry pi"
  exit 1
fi


ver="1.0"




# we create a dir with this version to ensure that 'dkms remove' won't delete
# the sources during kernel updates
marker="0.0.0"


#apt update
#apt-get -y install raspberrypi-kernel-headers raspberrypi-kernel 
#apt-get -y install  dkms git i2c-tools libasound2-plugins


# locate currently installed kernels (may be different to running kernel if
# it's just been updated)
kernels=$(ls /lib/modules | sed "s/^/-k /")
uname_r=$(uname -r)


function install_module {
  src=$1
  mod=$2


  if [[ -d /var/lib/dkms/$mod/$ver/$marker ]]; then
    rmdir /var/lib/dkms/$mod/$ver/$marker
  fi


  if [[ -e /usr/src/$mod-$ver || -e /var/lib/dkms/$mod/$ver ]]; then
    dkms remove --force -m $mod -v $ver --all
    rm -rf /usr/src/$mod-$ver
  fi
  mkdir -p /usr/src/$mod-$ver
  cp -a $src/* /usr/src/$mod-$ver/
  dkms add -m $mod -v $ver
  dkms build $uname_r -m $mod -v $ver && dkms install --force $uname_r -m $mod -v $ver


  mkdir -p /var/lib/dkms/$mod/$ver/$marker
}


install_module "./" "wm8960-soundcard"


# install dtbos
cp wm8960-soundcard.dtbo /boot/efi/overlays




#set kernel moduels
grep -q "i2c-dev" /etc/modules
  echo "i2c-dev" >> /etc/modules  
grep -q "snd-soc-wm8960" /etc/modules || \
  echo "snd-soc-wm8960" >> /etc/modules  
grep -q "snd-soc-wm8960-soundcard" /etc/modules || \
  echo "snd-soc-wm8960-soundcard" >> /etc/modules  
  
#set dtoverlays
sed -i -e 's:#dtparam=i2c_arm=on:dtparam=i2c_arm=on:g'  /boot/efi/config.txt || true
grep -q "dtoverlay=i2s-mmap" /boot/efi/config.txt || \
  echo "dtoverlay=i2s-mmap" >> /boot/efi/config.txt


grep -q "dtparam=i2s=on" /boot/efi/config.txt || \
  echo "dtparam=i2s=on" >> /boot/efi/config.txt


grep -q "dtoverlay=wm8960-soundcard" /boot/efi/config.txt || \
  echo "dtoverlay=wm8960-soundcard" >> /boot/efi/config.txt
  
#install config files
mkdir /etc/modprobe.d/wm8960-soundcard || true
cp *.conf /etc/modprobe.d/wm8960-soundcard
cp *.state /etc/modprobe.d/wm8960-soundcard


#set service 
cp wm8960-soundcard /usr/bin/
cp wm8960-soundcard.service /usr/lib/systemd/system/
systemctl enable  wm8960-soundcard.service 
systemctl start wm8960-soundcard                                


echo "------------------------------------------------------"
echo "Please reboot your raspberry pi to apply all settings"
echo "Enjoy!"
echo "------------------------------------------------------"
Dann habe ich die benötigten Pakete installiert (siehe install.sh).

Code:
uname -a
Linux localhost.localdomain 5.3.18-lp152.18-default #1 SMP Fri Jun 5 07:06:38 UTC 2020 (32f87b5) aarch64 aarch64 aarch64 GNU/Linux
Code:
/usr/src # ls -l
total 24
lrwxrwxrwx 1 root root 21 Jun 17 18:07 linux -> linux-5.3.18-lp152.19
drwxr-xr-x 3 root root 4096 Jun 17 18:22 linux-5.3.18-lp152.18-obj
drwxr-xr-x 24 root root 4096 Jun 17 18:07 linux-5.3.18-lp152.19
drwxr-xr-x 3 root root 4096 Jun 17 18:08 linux-5.3.18-lp152.19-obj
drwxr-xr-x 3 root root 4096 Jun 17 18:22 linux-obj
drwxr-xr-x 8 root root 4096 Jun 7 07:13 packages
drwxr-xr-x 2 root root 4096 Jun 17 18:39 wm8960-soundcard-1.0
Ich bin dann in den download-ordner des users gewechselt und habe die install.sh ausgeführt
Code:
# ./install.sh
Deleting module version: 1.0
completely from the DKMS tree.
------------------------------
Done.


Creating symlink /var/lib/dkms/wm8960-soundcard/1.0/source ->
/usr/src/wm8960-soundcard-1.0


DKMS: add completed.


Kernel preparation unnecessary for this kernel. Skipping...


Building module:
cleaning build area...(bad exit status: 2)
make -j4 KERNELRELEASE=5.3.18-lp152.18-default -C /lib/modules/5.3.18-lp152.18-default/build M=/var/lib/dkms/wm8960-soundcard/1.0/build...(bad exit status: 2)
Error! Bad return status for module build on kernel: 5.3.18-lp152.18-default (aarch64)
Consult /var/lib/dkms/wm8960-soundcard/1.0/build/make.log for more information.
mkdir: cannot create directory ‘/etc/modprobe.d/wm8960-soundcard’: File exists
------------------------------------------------------
Please reboot your raspberry pi to apply all settings
Enjoy!
DKMS liefert folgende make.log
DKMS make.log for wm8960-soundcard-1.0 for kernel 5.3.18-lp152.18-default (aarch64)
Wed Jun 17 18:36:22 CEST 2020
make: Entering directory '/usr/src/linux-5.3.18-lp152.18-obj/arm64/default'
Makefile:2: ../../../linux-5.3.18-lp152.18/Makefile: No such file or directory
make: *** No rule to make target '../../../linux-5.3.18-lp152.18/Makefile'. Stop.
make: Leaving directory '/usr/src/linux-5.3.18-lp152.18-obj/arm64/default'

Es muss irgendwie am Kernel liegen, der bei opensuse benutzt wird. Wie kann ich jetzt den Treiber kompilieren?

Vielen Dank.