Skip to content

Commit

Permalink
bluez5: Persist storage directory over reboots
Browse files Browse the repository at this point in the history
Currently, bluez's storage data is set to /var/lib/bluetooth which
in turn is a tmpfs location. We want this location persistent so we can
save paired devices over reboot. We do that by adding the corresponding
bind mount to the state partition and setting bluez to depend on this
mount unit.

Fixes #1544

Change-type: minor
Changelog-entry: Persist bluetooth storage data over reboots
Signed-off-by: Andrei Gherzan <andrei@balena.io>
  • Loading branch information
Andrei Gherzan committed Jun 13, 2019
1 parent 41acd1b commit 3815e42
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
12 changes: 9 additions & 3 deletions meta-balena-common/recipes-connectivity/bluez5/bluez5_%.bbappend
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
FILESEXTRAPATHS_append := ":${THISDIR}/files"

SRC_URI += " \
file://10-local-bt-hci-up.rules \
file://run-bluetoothd-with-experimental-flag.patch \
"
file://10-local-bt-hci-up.rules \
file://bluetooth.conf.systemd \
file://run-bluetoothd-with-experimental-flag.patch \
"

do_install_append() {
install -D -m 0755 ${WORKDIR}/10-local-bt-hci-up.rules ${D}/lib/udev/rules.d/10-local-bt-hci-up.rules

install -d ${D}${sysconfdir}/systemd/system/bluetooth.service.d
install -m 0644 ${WORKDIR}/bluetooth.conf.systemd ${D}${sysconfdir}/systemd/system/bluetooth.service.d/bluetooth.conf

install -d ${D}/var/lib/bluetooth
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[Unit]
Requires=bind-var-lib-bluetooth.service
After=bind-var-lib-bluetooth.service
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ BINDMOUNTS += " \
/etc/NetworkManager/system-connections \
/etc/udev/rules.d \
/home/root/.rnd \
/var/lib/bluetooth \
/var/lib/NetworkManager \
/home/root/.ssh \
"
Expand Down

0 comments on commit 3815e42

Please sign in to comment.