Skip to content

Commit 6eab997

Browse files
authored
Merge pull request #3830 from cmitu/bluez-buster-pinning
raspbiantools: pin Bluez to the RPI repos for Buster
2 parents c110428 + ab3c3f2 commit 6eab997

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

scriptmodules/supplementary/raspbiantools.sh

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,11 @@ function apt_upgrade_raspbiantools() {
1818
# install an older kernel/firmware for stretch to resolve newer kernel issues or unhold if updating to a newer release
1919
stretch_fix_raspbiantools
2020

21+
# on Buster, always install the Bluez package from the RPI repos
22+
buster_bluez_pin_raspbiantools
23+
2124
aptUpdate
22-
apt-get -y dist-upgrade
25+
apt-get -y dist-upgrade --allow-downgrades
2326
}
2427

2528
function lxde_raspbiantools() {
@@ -73,6 +76,19 @@ function stretch_fix_raspbiantools() {
7376
fi
7477
}
7578

79+
function buster_bluez_pin_raspbiantools() {
80+
# pin the 'bluez' package to the RPI repos to prevent any Debian updates overwriting it
81+
# use Priority 1001 to force the the installation even when the Debian package is installed
82+
local pin_file="/etc/apt/preferences.d/01-bluez-pin"
83+
if isPlatform "rpi" && [[ "$__os_debian_ver" -eq 10 && ! -f "$pin_file" ]] ; then
84+
cat << PIN_EOF > "$pin_file"
85+
Package: bluez
86+
Pin: origin archive.raspberrypi.org
87+
Pin-Priority: 1001
88+
PIN_EOF
89+
fi
90+
}
91+
7692
function install_firmware_raspbiantools() {
7793
local ver="$1"
7894
local state="$2"

0 commit comments

Comments
 (0)