diff --git a/scriptmodules/supplementary/raspbiantools.sh b/scriptmodules/supplementary/raspbiantools.sh index d89d0e3282..5ded79532e 100644 --- a/scriptmodules/supplementary/raspbiantools.sh +++ b/scriptmodules/supplementary/raspbiantools.sh @@ -43,24 +43,29 @@ function disable_blanker_raspbiantools() { } function kernel_bt_fix_raspbiantools() { - # install a newer kernel/firmware for stretch to resolve sony bt issues - if isPlatform "rpi" && [[ "$__os_debian_ver" -eq 9 ]] && hasPackage raspberrypi-kernel 1.20190620+1-1 lt; then - install_firmware_raspbiantools 1.20190620+1-1 + local ver="1.20190401-1" + # install an older kernel/firmware for stretch to resolve sony bt and overscan issues + if isPlatform "rpi" && [[ "$__os_debian_ver" -eq 9 ]] && hasPackage raspberrypi-kernel "$ver" ne; then + install_firmware_raspbiantools "$ver" hold fi } function install_firmware_raspbiantools() { local ver="$1" + local state="$2" [[ -z "$ver" ]] && return 1 local url="http://archive.raspberrypi.org/debian/pool/main/r/raspberrypi-firmware" mkdir -p "$md_build" pushd "$md_build" >/dev/null local pkg + local deb for pkg in raspberrypi-bootloader libraspberrypi0 libraspberrypi-doc libraspberrypi-dev libraspberrypi-bin raspberrypi-kernel-headers raspberrypi-kernel; do - wget -O"${pkg}_${ver}_armhf.deb" "$url/${pkg}_${ver}_armhf.deb" + deb="${pkg}_${ver}_armhf.deb" + wget -O"$deb" "$url/$deb" + dpkg -i "$deb" + [[ -n "$state" ]] && apt-mark "$state" "$pkg" + rm "$deb" done - dpkg -i *.deb - rm *.deb popd >/dev/null rm -rf "$md_build" }