Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bluez: linkkeys are not persisted across reboots #1503

Closed
PolarSolvent opened this issue Jun 29, 2015 · 2 comments
Closed

bluez: linkkeys are not persisted across reboots #1503

PolarSolvent opened this issue Jun 29, 2015 · 2 comments

Comments

@PolarSolvent
Copy link

When you pair a device with bluez / bluetoothd running on openwrt, the keys are written in /var/lib/bluetooth/ which disappears when the tmpfs is cleared. This makes it impractical to use bluetooth. It would be better to package it with a bind mount or /var/lib/bluetooth symlinked to another persistent directory?

@PolarSolvent
Copy link
Author

Something like this, but perhaps better if only root can read /etc/bluetooth/persist?

diff --git a/utils/bluez/Makefile b/utils/bluez/Makefile
index 363bf2c..c3410fc 100644
--- a/utils/bluez/Makefile
+++ b/utils/bluez/Makefile
@@ -144,6 +144,7 @@ define Package/bluez-daemon/install
        $(INSTALL_DIR) $(1)/etc/dbus-1/system.d/
        $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/bluetooth.conf $(1)/etc/dbus-1/system.d/bluetooth.conf
        $(INSTALL_DIR) $(1)/etc/bluetooth
+       $(INSTALL_DIR) $(1)/etc/bluetooth/persist
        $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/main.conf $(1)/etc/bluetooth/main.conf
        $(INSTALL_DATA) $(PKG_BUILD_DIR)/profiles/network/network.conf $(1)/etc/bluetooth/network.conf
        $(INSTALL_DATA) $(PKG_BUILD_DIR)/profiles/input/input.conf $(1)/etc/bluetooth/input.conf
diff --git a/utils/bluez/files/bluetoothd.init b/utils/bluez/files/bluetoothd.init
index 75f4d96..e8614f2 100644
--- a/utils/bluez/files/bluetoothd.init
+++ b/utils/bluez/files/bluetoothd.init
@@ -7,6 +7,7 @@ USE_PROCD=1
 PROG=/usr/bin/bluetoothd

 start_service() {
+       ln -snf /etc/bluetooth/persist/ /var/lib/bluetooth
        procd_open_instance
        procd_set_param command "$PROG" -n
        procd_close_instance

diizzyy added a commit to diizzyy/packages that referenced this issue Apr 30, 2018
Update bluez to 5.49
Fix issue openwrt#1497
Fix issue openwrt#1503
Cherry pick patches from Alpine Linux repo
Apply --gc-sections, saves about 500kbyte

Based on patch provided by Jack Vogel
openwrt#5937

Source:
https://git.alpinelinux.org/cgit/aports/commit/main/bluez/fix-endianness.patch?id=1c6991b32a22be2c905cc1709be1376c4e79e451
https://git.alpinelinux.org/cgit/aports/commit/main/bluez/bluez-5.40-obexd_without_systemd-1.patch?id=980b2d04ae4339594701b33cf9460757c989c94c

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
diizzyy added a commit to diizzyy/packages that referenced this issue Apr 30, 2018
Update bluez to 5.49
Fix issue openwrt#1497
Fix issue openwrt#1503
Cherry pick patches from Alpine Linux repo
Apply --gc-sections, saves about 500kbyte

Based on patch provided by Jack Vogel
openwrt#5937

Source:
https://git.alpinelinux.org/cgit/aports/commit/main/bluez/fix-endianness.patch?id=1c6991b32a22be2c905cc1709be1376c4e79e451
https://git.alpinelinux.org/cgit/aports/commit/main/bluez/bluez-5.40-obexd_without_systemd-1.patch?id=980b2d04ae4339594701b33cf9460757c989c94c

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
diizzyy added a commit to diizzyy/packages that referenced this issue Apr 30, 2018
Update bluez to 5.49
Fix issue openwrt#1497
Fix issue openwrt#1503
Cherry pick patches from Alpine Linux repo
Apply --gc-sections, saves about 500kbyte

Based on patch provided by Johnny Vogels
openwrt#5937

Source:
https://git.alpinelinux.org/cgit/aports/commit/main/bluez/fix-endianness.patch?id=1c6991b32a22be2c905cc1709be1376c4e79e451
https://git.alpinelinux.org/cgit/aports/commit/main/bluez/bluez-5.40-obexd_without_systemd-1.patch?id=980b2d04ae4339594701b33cf9460757c989c94c

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
diizzyy added a commit to diizzyy/packages that referenced this issue May 5, 2018
Update bluez to 5.49
Fix issue openwrt#1497
Fix issue openwrt#1503
Cherry pick patches from Alpine Linux repo
Apply --gc-sections, saves about 500kbyte
Drop audio.conf (not needed and deprecated)
Remove bluetooth.dbus as upstream supplies a working copy

Based on patch provided by Johnny Vogels
openwrt#5937

Source:
https://git.alpinelinux.org/cgit/aports/commit/main/bluez/fix-endianness.patch?id=1c6991b32a22be2c905cc1709be1376c4e79e451
https://git.alpinelinux.org/cgit/aports/commit/main/bluez/bluez-5.40-obexd_without_systemd-1.patch?id=980b2d04ae4339594701b33cf9460757c989c94c

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
@diizzyy
Copy link
Contributor

diizzyy commented Jun 9, 2018

@hnyman @champtar @thess
Close this

@hnyman hnyman closed this as completed Jun 10, 2018
lynxis pushed a commit to lynxis/packages that referenced this issue Jan 3, 2019
Update bluez to 5.49
Fix issue openwrt#1497
Fix issue openwrt#1503
Cherry pick patches from Alpine Linux repo
Apply --gc-sections, saves about 500kbyte
Drop audio.conf (not needed and deprecated)
Remove bluetooth.dbus as upstream supplies a working copy

Based on patch provided by Johnny Vogels
openwrt#5937

Source:
https://git.alpinelinux.org/cgit/aports/commit/main/bluez/fix-endianness.patch?id=1c6991b32a22be2c905cc1709be1376c4e79e451
https://git.alpinelinux.org/cgit/aports/commit/main/bluez/bluez-5.40-obexd_without_systemd-1.patch?id=980b2d04ae4339594701b33cf9460757c989c94c

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants