Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/bluez5_utils: fix bluetoothd daemon not starting
@ 2024-09-13 15:44 Nicolas Cavallari
  2024-12-29 22:37 ` Thomas Petazzoni via buildroot
  0 siblings, 1 reply; 2+ messages in thread
From: Nicolas Cavallari @ 2024-09-13 15:44 UTC (permalink / raw)
  To: buildroot; +Cc: Fabrice Fontaine, Marcin Bis

bluetoothd does not start since commit 1a8676aa6e4b
("package/bluez5_utils: disable datafiles"):

bluetoothd[4242]: Bluetooth daemon 5.75
bluetoothd[4242]: src/main.c:main() Unable to get on D-Bus

This because --disable-datafiles also disables installing the D-Bus
policy file /etc/dbus-1/system.d/bluetooth.conf that allows bluetoothd
to own the "org.bluez" service name.

The underlying issue that the commit tried to fix is that this package
now installs /etc/bluetooth with mode 555, which causes problems when
buildroot need to remove or patch files.

To fix this, fix the permissions in target/ and staging/ after
installation, but still make sure that the permissions on the rootfs are
555.

There could still be permissions issues if make install fails, because
the fixups will not be applied.

Signed-off-by: Nicolas Cavallari <nicolas.cavallari@green-communications.fr>
---
 package/bluez5_utils/bluez5_utils.mk | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/package/bluez5_utils/bluez5_utils.mk b/package/bluez5_utils/bluez5_utils.mk
index b1caef5cc5..f5c556a3db 100644
--- a/package/bluez5_utils/bluez5_utils.mk
+++ b/package/bluez5_utils/bluez5_utils.mk
@@ -22,7 +22,6 @@ BLUEZ5_UTILS_DEPENDENCIES = \
 BLUEZ5_UTILS_CONF_OPTS = \
 	--enable-library \
 	--disable-cups \
-	--disable-datafiles \
 	--disable-manpages \
 	--disable-asan \
 	--disable-lsan \
@@ -194,6 +193,23 @@ else
 BLUEZ5_UTILS_CONF_OPTS += --disable-systemd
 endif
 
+# bluez installs /etc/bluetooth with mode 555 which causes issues
+define BLUEZ5_UTILS_FIX_PERMISSIONS_STAGING
+	chmod 755 $(STAGING_DIR)/etc/bluetooth/
+endef
+BLUEZ5_UTILS_POST_INSTALL_STAGING_HOOKS += \
+	BLUEZ5_UTILS_FIX_PERMISSIONS_STAGING
+
+define BLUEZ5_UTILS_FIX_PERMISSIONS_TARGET
+	chmod 755 $(TARGET_DIR)/etc/bluetooth/
+endef
+BLUEZ5_UTILS_POST_INSTALL_TARGET_HOOKS += \
+	BLUEZ5_UTILS_FIX_PERMISSIONS_TARGET
+
+define BLUEZ5_UTILS_PERMISSIONS
+	/etc/bluetooth/ d 555 0 0 - - - - -
+endef
+
 define BLUEZ5_UTILS_INSTALL_INIT_SYSV
 	$(INSTALL) -m 0755 -D package/bluez5_utils/S40bluetoothd \
 		$(TARGET_DIR)/etc/init.d/S40bluetoothd
-- 
2.45.2

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-12-29 22:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-13 15:44 [Buildroot] [PATCH 1/1] package/bluez5_utils: fix bluetoothd daemon not starting Nicolas Cavallari
2024-12-29 22:37 ` Thomas Petazzoni via buildroot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox