-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
61 lines (49 loc) · 2.7 KB
/
Copy pathDockerfile
File metadata and controls
61 lines (49 loc) · 2.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Build BlueZ 5.82 (from Trixie) for Bookworm, with an extra quilt patch cherry-picked from
# upstream 5.87: `advertising: Fix sending extra bytes with MGMT_OP_ADD_EXT_ADV_DATA` (2a6968b40).
# Required because the Bookworm rpi kernel (6.12.93) enforces a strict length check that older
# bluetoothd violates. See patches/advertising-fix-ext-adv-data-length.patch for details.
FROM debian:bookworm
# Add source repos
RUN echo "deb-src http://deb.debian.org/debian bookworm main" >> /etc/apt/sources.list
RUN apt-get update && \
apt-get install -y --no-install-recommends \
devscripts dpkg-dev wget ca-certificates quilt \
build-essential fakeroot
WORKDIR /buildroot
# Download BlueZ 5.82 Trixie source package (source + debian packaging + patches)
RUN wget http://deb.debian.org/debian/pool/main/b/bluez/bluez_5.82.orig.tar.gz && \
wget http://deb.debian.org/debian/pool/main/b/bluez/bluez_5.82-1.1.debian.tar.xz && \
wget http://deb.debian.org/debian/pool/main/b/bluez/bluez_5.82-1.1.dsc
# Extract source package (also applies all Debian patches from series)
RUN dpkg-source -x bluez_5.82-1.1.dsc
# Copy our local patch(es) into the source tree and register in the quilt series so
# dpkg-source --before-build applies them alongside the Debian patches.
COPY patches/ /buildroot/local-patches/
RUN cp /buildroot/local-patches/*.patch /buildroot/bluez-5.82/debian/patches/ && \
for p in /buildroot/local-patches/*.patch; do \
basename "$p" >> /buildroot/bluez-5.82/debian/patches/series; \
done && \
cd /buildroot/bluez-5.82 && \
QUILT_PATCHES=debian/patches quilt push -a
WORKDIR /buildroot/bluez-5.82
# Bookworm compatibility: systemd-dev does not exist in bookworm
RUN sed -i 's/systemd-dev/systemd/' debian/control
# Version bump: first mark our local revision, then tag as bookworm backport.
# Result: 5.82-1.1+athom1~bpo12+1
RUN DEBEMAIL="backport@local" DEBFULLNAME="Backport" \
dch --local +athom --distribution unstable --force-distribution \
"Cherry-pick upstream 2a6968b40: advertising: Fix sending extra bytes with MGMT_OP_ADD_EXT_ADV_DATA." && \
DEBEMAIL="backport@local" DEBFULLNAME="Backport" \
dch --local ~bpo12+ --distribution bookworm-backports "Backport to bookworm."
# Install build dependencies
RUN apt-get install -y --no-install-recommends \
debhelper \
flex bison libdbus-1-dev libglib2.0-dev libdw-dev libudev-dev \
libreadline-dev libical-dev libasound2-dev libjson-c-dev \
libell-dev python3-docutils python3-pygments udev check systemd \
libebook1.2-dev
# Build the package
RUN dpkg-buildpackage -us -uc -b
# Collect output debs
WORKDIR /buildroot
RUN mkdir -p /output && cp *.deb /output/ 2>/dev/null || true