From b2e10ff6eabbca32f0fc01472e8e72d8906fc42b Mon Sep 17 00:00:00 2001 From: hilschernetpi Date: Wed, 18 Sep 2019 20:58:52 +0200 Subject: [PATCH] use fix tag 1.20180417 of userland tools --- Dockerfile | 5 ++--- init.d/entrypoint.sh | 21 +++++++++++++++++++-- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 12bbfaa..2ba7c90 100644 --- a/Dockerfile +++ b/Dockerfile @@ -50,7 +50,7 @@ LABEL org.label-schema.build-date=$BUILD_DATE \ RUN [ "cross-build-start" ] #version -ENV HILSCHERNETPI_BLUEZ_VERSION 1.3.0 +ENV HILSCHERNETPI_BLUEZ_VERSION 1.3.1 #labeling LABEL maintainer="netpi@hilscher.com" \ @@ -74,7 +74,7 @@ RUN apt-get update && apt-get install -y \ '/usr/share/man/man1' '/usr/share/man/man8' '/usr/lib/pkgconfig' '/usr/lib/bluetooth/plugins' \ '/lib/udev/rules.d' '/lib/systemd/system' '/usr/lib/systemd/user' '/lib/udev' \ #install userland raspberry pi tools - && git clone --depth 1 https://github.com/raspberrypi/firmware /tmp/firmware \ + && git clone -b "1.20180417" --single-branch --depth 1 https://github.com/raspberrypi/firmware /tmp/firmware \ && mv /tmp/firmware/hardfp/opt/vc /opt \ && echo "/opt/vc/lib" >/etc/ld.so.conf.d/00-vmcs.conf \ && /sbin/ldconfig \ @@ -92,7 +92,6 @@ COPY --from=builder /usr/bin/bluetoothctl /usr/bin/btmon /usr/bin/rctest /usr/bi /usr/bin/bccmd /usr/bin/bluemoon /usr/bin/hex2hcd /usr/bin/mpris-proxy /usr/bin/btattach \ /usr/bin/hciattach /usr/bin/hciconfig /usr/bin/hcitool /usr/bin/hcidump /usr/bin/rfcomm \ /usr/bin/sdptool /usr/bin/ciptool /usr/bin/ -COPY --from=builder /usr/bin/ciptool /usr/bin/ COPY --from=builder /usr/libexec/bluetooth/bluetoothd /usr/libexec/bluetooth/obexd /usr/libexec/bluetooth/ COPY --from=builder /usr/lib/cups/backend/bluetooth /usr/lib/cups/backend/ COPY --from=builder /etc/dbus-1/system.d/bluetooth.conf /etc/dbus-1/system.d/ diff --git a/init.d/entrypoint.sh b/init.d/entrypoint.sh index 38027c7..3d4f4e8 100755 --- a/init.d/entrypoint.sh +++ b/init.d/entrypoint.sh @@ -1,6 +1,23 @@ #!/bin/bash +e # catch signals as PID 1 in a container +#check if container is running in host mode +if [[ -z `grep "docker0" /proc/net/dev` ]]; then + echo "Container not running in host mode. Sure you configured host network mode? Container stopped." + exit 143 +fi + +#check if container is running in privileged mode +ip link delete dummy0 >/dev/null 2>&1 +ip link add dummy0 type dummy >/dev/null 2>&1 +if [[ $? -eq 0 ]]; then + # clean the dummy0 link + ip link delete dummy0 >/dev/null 2>&1 +else + echo "Container not running in privileged mode. Sure you configured privileged mode? Container stopped." + exit 143 +fi + pid=0 # SIGNAL-handler @@ -36,9 +53,9 @@ echo "starting dbus ..." /etc/init.d/dbus start #reset BCM chip (making sure get access even after container restart) -/opt/vc/bin/vcmailbox 0x38041 8 8 128 0 +/opt/vc/bin/vcmailbox 0x38041 8 8 128 0 > /dev/null sleep 1 -/opt/vc/bin/vcmailbox 0x38041 8 8 128 1 +/opt/vc/bin/vcmailbox 0x38041 8 8 128 1 > /dev/null sleep 1 #load firmware to BCM chip and attach to hci0