This repository builds BlueZ 5.82 (from Debian Trixie) as a backport for Debian Bookworm (12), with a small set of local patches on top.
Any .patch in patches/ is cherry-picked into the Debian quilt series before build.
advertising-fix-ext-adv-data-length.patch— upstream commit2a6968b40from BlueZ 5.87. Fixes bluetoothd sending 8 extra bytes withMGMT_OP_ADD_EXT_ADV_DATA, which the Bookworm rpi kernel (6.12.93+) rejects withInvalid Parameters (0x0d). Without this patch,LEAdvertisingManager1.RegisterAdvertisementfails on affected kernels. See raspberrypi/linux#7473.
The build runs entirely inside a Docker container based on debian:bookworm. The Dockerfile:
- Sets up a bookworm build environment with
devscripts,dpkg-dev,quilt, andbuild-essential. - Downloads the official BlueZ 5.82-1.1 source package directly from the Debian Trixie archive (
.orig.tar.gz,.debian.tar.xz, and.dsc). - Extracts the source package using
dpkg-source, which applies all Trixie patches automatically. - Copies any
.patchfiles frompatches/intodebian/patches/, appends them to the quilt series, and applies them withquilt push -a. - Patches
debian/controlfor bookworm compatibility (systemd-devdoes not exist in bookworm, so it is replaced withsystemd). - Bumps the version to
5.82-1.1+athom1~bpo12+1via twodchcalls (local revision + backport tag). - Installs all build dependencies and builds the binary packages with
dpkg-buildpackage. - Collects the resulting
.debfiles in/output/.
A GitHub Actions workflow automatically builds arm64 packages on every tag push. The .deb files are published as assets on the corresponding GitHub release.
To create a release:
git tag v5.82-1
git push origin v5.82-1Pre-built packages can be downloaded from the Releases page.
To build locally using Docker:
docker build -t bluez-backport .
docker create --name bluez-build bluez-backport
docker cp bluez-build:/output/ ./output
docker rm bluez-buildThe .deb files will be in ./output/. The build produces packages for the architecture of the Docker host (e.g., arm64 on Apple Silicon / Raspberry Pi, amd64 on x86_64).
Copy the .deb files to your bookworm target and install:
sudo dpkg -i bluez_5.82-*.deb libbluetooth3_5.82-*.deb
sudo apt-get install -f