Skip to content

Commit

Permalink
use fix tag 1.20180417 of userland tools
Browse files Browse the repository at this point in the history
  • Loading branch information
hilschernetpi committed Sep 18, 2019
1 parent b248eb4 commit b2e10ff
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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" \
Expand All @@ -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 \
Expand All @@ -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/
Expand Down
21 changes: 19 additions & 2 deletions init.d/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit b2e10ff

Please sign in to comment.