Skip to contentSkip to conversation

Slimming BlueZ defaults

PATCH In review Michael Nosthoff via buildroot 2 participants 12 messages Jul 31, 2021 – Aug 2, 2021

lore
Share & tools
lore
#0 lore raw

cover Slimming BlueZ defaults

As discussed in the follow-up of the previous patches to the BlueZ Package I did the following:

* Make the build of the tools optional
* remove the 'default y' line from the new options
* skim threw the packages and see which ones would require the now optional plugins

None of the modified packages failed to build with the new defaults. But looking at what these packages do at runtime I suppose they require either the audio or the HID plugins.

If anyone knows one (or more) of those altered packages in detail I would be happy to get feedback on the changes.

What I left out for now is how to communicate these changes to the user on upgrade.

Regards,
Michael

Michael Nosthoff (10):
package/bluez5_utils: make tools optional package/bluez5_utils: drop default y package/cwiid: select BlueZ HID plugin package/bluez-alsa: select BlueZ audio plugins package/brltty: enable bluez HID plugin package/gstreamer1/gst1-plugins-bad: enable BlueZ Audio package/pulseaudio: enable BlueZ Audio Plugins package/pipewire: enable BlueZ Audio Plugins package/supertuxkart: enable BlueZ HID Plugin package/kodi: enable BlueZ Audio and HID plugins

 package/bluez-alsa/Config.in                  |  1 +
 package/bluez5_utils/Config.in                | 22 +++++++++++++------
 package/bluez5_utils/bluez5_utils.mk          | 13 +++++++++--
 package/brltty/Config.in                      |  1 +
 package/cwiid/Config.in                       |  1 +
 package/gstreamer1/gst1-plugins-bad/Config.in |  1 +
 package/kodi/Config.in                        |  2 ++
 package/pipewire/Config.in                    |  1 +
 package/pulseaudio/Config.in                  |  1 +
 package/supertuxkart/Config.in                |  1 +
 10 files changed, 35 insertions(+), 9 deletions(-)
Signature · 6 lines
2.32.0

_______________________________________________
buildroot mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/buildroot
#1 lore raw

PATCH 1/10 package/bluez5_utils: make tools optional

The tools are currently always build and installed. In many cases those tools are not needed in a production system. So make this step optional. This saves up to 2MB on the target.

Further tweak the deprecated option. It has effects when the --enable-tools is set as well as when --enable-client is set. So explain this in the options description and update the install step for gatttool to only be added when client is enabled.

---
 package/bluez5_utils/Config.in       | 16 +++++++++++++---
 package/bluez5_utils/bluez5_utils.mk | 13 +++++++++++--
 2 files changed, 24 insertions(+), 5 deletions(-)
package/bluez5_utils/Config.in +13 -3
index 40973e13cd..30e70fa03f 100644
@@ -43,13 +43,23 @@ config BR2_PACKAGE_BLUEZ5_UTILS_MONITOR
 	help
 	  Build monitor utility btmon.
 
+config BR2_PACKAGE_BLUEZ5_UTILS_TOOLS
+	bool "build tools"
+	help
+	  Build tools like bluemoon, btattach, hex2hcd, l2test,
+	  l2ping, mpris-proxy, rctest.
+
 config BR2_PACKAGE_BLUEZ5_UTILS_DEPRECATED
 	bool "install deprecated tools"
-	depends on BR2_PACKAGE_BLUEZ5_UTILS_CLIENT
+	depends on BR2_PACKAGE_BLUEZ5_UTILS_CLIENT || BR2_PACKAGE_BLUEZ5_UTILS_TOOLS
 	help
-	  Build deprecated tools. These currently include:
+	  Build deprecated tools.
+
+	  When "build tools" is selected these tools are installed:
 	  hciattach, hciconfig, hcitool, hcidump, rfcomm, sdptool,
-	  ciptool, gatttool.
+	  ciptool.
+
+	  When CLI client is enabled "gatttool" is installed.
 
 config BR2_PACKAGE_BLUEZ5_UTILS_EXPERIMENTAL
 	bool "build experimental tools"
package/bluez5_utils/bluez5_utils.mk +11 -2
index 3551b14a69..5f5a7f44c9 100644
@@ -20,7 +20,6 @@ BLUEZ5_UTILS_DEPENDENCIES = \
 	libglib2
 
 BLUEZ5_UTILS_CONF_OPTS = \
-	--enable-tools \
 	--enable-library \
 	--disable-cups \
 	--disable-manpages \
@@ -46,6 +45,12 @@ else
 BLUEZ5_UTILS_CONF_OPTS += --disable-monitor
 endif
 
+ifeq ($(BR2_PACKAGE_BLUEZ5_UTILS_TOOLS),y)
+BLUEZ5_UTILS_CONF_OPTS += --enable-tools
+else
+BLUEZ5_UTILS_CONF_OPTS += --disable-tools
+endif
+
 # experimental plugins
 ifeq ($(BR2_PACKAGE_BLUEZ5_UTILS_EXPERIMENTAL),y)
 BLUEZ5_UTILS_CONF_OPTS += --enable-experimental
@@ -125,12 +130,16 @@ else
 BLUEZ5_UTILS_CONF_OPTS += --disable-sixaxis
 endif
 
-# install gatttool (For some reason upstream choose not to do it by default)
 ifeq ($(BR2_PACKAGE_BLUEZ5_UTILS_DEPRECATED),y)
+# install gatttool (For some reason upstream choose not to do it by default)
+# gattool depends on the client for readline
+ifeq ($(BR2_PACKAGE_BLUEZ5_UTILS_CLIENT),y)
 define BLUEZ5_UTILS_INSTALL_GATTTOOL
 	$(INSTALL) -D -m 0755 $(@D)/attrib/gatttool $(TARGET_DIR)/usr/bin/gatttool
 endef
 BLUEZ5_UTILS_POST_INSTALL_TARGET_HOOKS += BLUEZ5_UTILS_INSTALL_GATTTOOL
+endif
+
 # hciattach_bcm43xx defines default firmware path in `/etc/firmware`, but
 # Broadcom firmware blobs are usually located in `/lib/firmware`.
 BLUEZ5_UTILS_CONF_ENV += \
Signature · 6 lines
2.32.0

_______________________________________________
buildroot mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/buildroot
#2 lore raw

PATCH 2/10 package/bluez5_utils: drop default y

In reply to Michael Nosthoff via buildroot

as discussed on the mailinglist this drops the default y entry for the now optional plugins and tools.
This might break backward compatibility but gives new users a smaller initial footprint.

further add a select for the options that required the HID plugin at runtime.

---
 package/bluez5_utils/Config.in | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
package/bluez5_utils/Config.in +2 -4
index 30e70fa03f..a8232279bd 100644
@@ -39,7 +39,6 @@ config BR2_PACKAGE_BLUEZ5_UTILS_CLIENT
 
 config BR2_PACKAGE_BLUEZ5_UTILS_MONITOR
 	bool "build monitor utility"
-	default y
 	help
 	  Build monitor utility btmon.
 
@@ -70,7 +69,6 @@ config BR2_PACKAGE_BLUEZ5_UTILS_EXPERIMENTAL
 
 config BR2_PACKAGE_BLUEZ5_UTILS_PLUGINS_AUDIO
 	bool "build audio plugins (a2dp and avrcp)"
-	default y
 	help
 	  Build plugins for audio profiles (for A2DP and AVRCP).
 
@@ -81,14 +79,12 @@ config BR2_PACKAGE_BLUEZ5_UTILS_PLUGINS_HEALTH
 
 config BR2_PACKAGE_BLUEZ5_UTILS_PLUGINS_HID
 	bool "build hid plugin"
-	default y
 	select BR2_PACKAGE_BLUEZ5_UTILS_PLUGINS_HOG
 	help
 	  Build plugin for HID (input) profiles.
 
 config BR2_PACKAGE_BLUEZ5_UTILS_PLUGINS_HOG
 	bool "build hog plugin"
-	default y
 	help
 	  Build plugin for HoG (input) profiles.
 
@@ -130,6 +126,7 @@ config BR2_PACKAGE_BLUEZ5_UTILS_PLUGINS_SAP
 config BR2_PACKAGE_BLUEZ5_UTILS_PLUGINS_SIXAXIS
 	bool "build sixaxis plugin"
 	depends on BR2_PACKAGE_HAS_UDEV
+	select BR2_PACKAGE_BLUEZ5_UTILS_PLUGINS_HID # runtime
 	help
 	  Build sixaxis plugin (support Sony Dualshock
 	  controller)
@@ -145,6 +142,7 @@ config BR2_PACKAGE_BLUEZ5_UTILS_TEST
 config BR2_PACKAGE_BLUEZ5_UTILS_TOOLS_HID2HCI
 	bool "build hid2hci tool"
 	depends on BR2_PACKAGE_HAS_UDEV
+	select BR2_PACKAGE_BLUEZ5_UTILS_PLUGINS_HID # runtime
 	help
 	  Build hid2hci tool
 
Signature · 6 lines
2.32.0

_______________________________________________
buildroot mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/buildroot
#3 lore raw

PATCH 3/10 package/cwiid: select BlueZ HID plugin

In reply to Michael Nosthoff via buildroot

the HID plugin now needs to be explictly enabled.

---
 package/cwiid/Config.in | 1 +
 1 file changed, 1 insertion(+)
package/cwiid/Config.in +1 -0
index 374a91ffd6..e03248c722 100644
@@ -7,6 +7,7 @@ config BR2_PACKAGE_CWIID
 	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_4 # bluez5_utils
 	depends on BR2_TOOLCHAIN_HAS_SYNC_4 # bluez5_utils
 	select BR2_PACKAGE_BLUEZ5_UTILS
+	select BR2_PACKAGE_BLUEZ5_UTILS_PLUGINS_HID # runtime
 	help
 	  A collection of Linux tools written in C for interfacing to
 	  the Nintendo Wiimote.
Signature · 6 lines
2.32.0

_______________________________________________
buildroot mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/buildroot
#4 lore raw

PATCH 4/10 package/bluez-alsa: select BlueZ audio plugins

In reply to Michael Nosthoff via buildroot

The A2DP/AVCRP plugins now have to be explicitly selected.

---
 package/bluez-alsa/Config.in | 1 +
 1 file changed, 1 insertion(+)
package/bluez-alsa/Config.in +1 -0
index a31d125d9d..42bb9133bf 100644
@@ -9,6 +9,7 @@ config BR2_PACKAGE_BLUEZ_ALSA
 	depends on BR2_USE_WCHAR # libglib2
 	select BR2_PACKAGE_ALSA_LIB
 	select BR2_PACKAGE_BLUEZ5_UTILS
+	select BR2_PACKAGE_BLUEZ5_UTILS_PLUGINS_AUDIO
 	select BR2_PACKAGE_LIBGLIB2
 	select BR2_PACKAGE_SBC
 	help
Signature · 6 lines
2.32.0

_______________________________________________
buildroot mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/buildroot
#5 lore raw

PATCH 5/10 package/brltty: enable bluez HID plugin

In reply to Michael Nosthoff via buildroot

brltty builds with bluetooth support when bluez is enabled. Ensure the HID Plugin is enabled.

---
 package/brltty/Config.in | 1 +
 1 file changed, 1 insertion(+)
package/brltty/Config.in +1 -0
index de11af3bbe..c728cb7e20 100644
@@ -4,6 +4,7 @@ config BR2_PACKAGE_BRLTTY
 	depends on BR2_TOOLCHAIN_HAS_THREADS
 	depends on !BR2_STATIC_LIBS
 	depends on BR2_USE_MMU # fork()
+	select BR2_PACKAGE_BLUEZ5_UTILS_PLUGINS_HID if BR2_PACKAGE_BLUEZ5_UTILS # runtime
 	help
 	  A daemon providing access to the Linux console for a blind
 	  person using a refreshable braille display.
Signature · 6 lines
2.32.0

_______________________________________________
buildroot mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/buildroot
#6 lore raw

PATCH 6/10 package/gstreamer1/gst1-plugins-bad: enable BlueZ Audio

In reply to Michael Nosthoff via buildroot

When enabling the BlueZ plugin select the BlueZ Audio Plugins.

---
 package/gstreamer1/gst1-plugins-bad/Config.in | 1 +
 1 file changed, 1 insertion(+)
package/gstreamer1/gst1-plugins-bad/Config.in +1 -0
index 628a9df42c..ba20da7a2d 100644
@@ -345,6 +345,7 @@ config BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_BLUEZ
 	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_4 # bluez5_utils
 	depends on BR2_TOOLCHAIN_HAS_SYNC_4 # bluez5_utils
 	select BR2_PACKAGE_BLUEZ5_UTILS
+	select BR2_PACKAGE_BLUEZ5_UTILS_PLUGINS_AUDIO # runtime
 	help
 	  Bluetooth audio A2DP/AVDTP sink, AVDTP source plugin
 
Signature · 6 lines
2.32.0

_______________________________________________
buildroot mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/buildroot
#7 lore raw

PATCH 7/10 package/pulseaudio: enable BlueZ Audio Plugins

In reply to Michael Nosthoff via buildroot

When BlueZ is enabled ensure to select the BlueZ Audio Plugins.

---
 package/pulseaudio/Config.in | 1 +
 1 file changed, 1 insertion(+)
package/pulseaudio/Config.in +1 -0
index 6600006a60..dcc88f3841 100644
@@ -14,6 +14,7 @@ config BR2_PACKAGE_PULSEAUDIO
 	depends on BR2_TOOLCHAIN_HAS_THREADS
 	depends on !BR2_STATIC_LIBS
 	depends on BR2_USE_MMU # fork()
+	select BR2_PACKAGE_BLUEZ5_UTILS_PLUGINS_AUDIO if BR2_PACKAGE_BLUEZ5_UTILS # runtime
 	select BR2_PACKAGE_LIBTOOL
 	select BR2_PACKAGE_LIBSNDFILE
 	select BR2_PACKAGE_PULSEAUDIO_ENABLE_ATOMIC
Signature · 6 lines
2.32.0

_______________________________________________
buildroot mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/buildroot
#8 lore raw

PATCH 8/10 package/pipewire: enable BlueZ Audio Plugins

In reply to Michael Nosthoff via buildroot

When BlueZ is enabled ensure to select the BlueZ Audio Plugins.

---
 package/pipewire/Config.in | 1 +
 1 file changed, 1 insertion(+)
package/pipewire/Config.in +1 -0
index b6809c228e..6c61dd2021 100644
@@ -4,6 +4,7 @@ config BR2_PACKAGE_PIPEWIRE
 	depends on BR2_TOOLCHAIN_HAS_THREADS # dbus
 	depends on BR2_USE_MMU # dbus
 	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_5
+	select BR2_PACKAGE_BLUEZ5_UTILS_PLUGINS_AUDIO if BR2_PACKAGE_BLUEZ5_UTILS # runtime
 	select BR2_PACKAGE_DBUS
 	help
 	  PipeWire is a server and user space API to deal with
Signature · 6 lines
2.32.0

_______________________________________________
buildroot mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/buildroot
#9 lore raw

PATCH 9/10 package/supertuxkart: enable BlueZ HID Plugin

In reply to Michael Nosthoff via buildroot

When BlueZ is enabled ensure to select the BlueZ HID Plugin for wiimote support.

---
 package/supertuxkart/Config.in | 1 +
 1 file changed, 1 insertion(+)
package/supertuxkart/Config.in +1 -0
index 99f2310d82..8af006d632 100644
@@ -25,6 +25,7 @@ config BR2_PACKAGE_SUPERTUXKART
 	select BR2_PACKAGE_OPENAL
 	select BR2_PACKAGE_XLIB_LIBXRANDR
 	select BR2_PACKAGE_ZLIB
+	select BR2_PACKAGE_BLUEZ5_UTILS_PLUGINS_HID if BR2_PACKAGE_BLUEZ5_UTILS # runtime
 	help
 	  Karts. Nitro. Action! SuperTuxKart is a free 3D arcade kart
 	  racer with multiple karts, tracks and modes you can play.
Signature · 6 lines
2.32.0

_______________________________________________
buildroot mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/buildroot
#10 lore raw

PATCH 10/10 package/kodi: enable BlueZ Audio and HID plugins

In reply to Michael Nosthoff via buildroot

When Bluetooth support is enabled ensure to enable the Audio and HID plugins.

---
 package/kodi/Config.in | 2 ++
 1 file changed, 2 insertions(+)
package/kodi/Config.in +2 -0
index f702ae841a..074a457d1b 100644
@@ -129,6 +129,8 @@ config BR2_PACKAGE_KODI_BLUEZ
 	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_4 # bluez5_utils
 	depends on BR2_TOOLCHAIN_HAS_SYNC_4 # bluez5_utils
 	select BR2_PACKAGE_BLUEZ5_UTILS
+	select BR2_PACKAGE_BLUEZ5_UTILS_PLUGINS_AUDIO
+	select BR2_PACKAGE_BLUEZ5_UTILS_PLUGINS_HID
 	help
 	    Enable bluetooth support
 
Signature · 6 lines
2.32.0

_______________________________________________
buildroot mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/buildroot
#11 lore raw
In reply to Michael Nosthoff via buildroot
Quoted 6 lines · Michael Nosthoff

As discussed in the follow-up of the previous patches to the BlueZ Package I did the following:

* Make the build of the tools optional
* remove the 'default y' line from the new options
* skim threw the packages and see which ones would require the now optional plugins

Series applied to master, thanks!

Quoted 6 lines

None of the modified packages failed to build with the new defaults. But looking at what these packages do at runtime I suppose they require either the audio or the HID plugins.

If anyone knows one (or more) of those altered packages in detail I would be happy to get feedback on the changes.

I've applied the series to master regardless. If the automatic select bothers
someone, they can send a patch.

Quoted 2 lines

What I left out for now is how to communicate these changes to the user on upgrade.

I'm cooking an RFC patch for that. Stay tuned.

Regards,
Arnout

Quoted 16 lines

Regards,
Michael

Michael Nosthoff (10):
package/bluez5_utils: make tools optional package/bluez5_utils: drop default y package/cwiid: select BlueZ HID plugin package/bluez-alsa: select BlueZ audio plugins package/brltty: enable bluez HID plugin package/gstreamer1/gst1-plugins-bad: enable BlueZ Audio package/pulseaudio: enable BlueZ Audio Plugins package/pipewire: enable BlueZ Audio Plugins package/supertuxkart: enable BlueZ HID Plugin package/kodi: enable BlueZ Audio and HID plugins

Quoted 12 lines
 package/bluez-alsa/Config.in                  |  1 +
 package/bluez5_utils/Config.in                | 22 +++++++++++++------
 package/bluez5_utils/bluez5_utils.mk          | 13 +++++++++--
 package/brltty/Config.in                      |  1 +
 package/cwiid/Config.in                       |  1 +
 package/gstreamer1/gst1-plugins-bad/Config.in |  1 +
 package/kodi/Config.in                        |  2 ++
 package/pipewire/Config.in                    |  1 +
 package/pulseaudio/Config.in                  |  1 +
 package/supertuxkart/Config.in                |  1 +
 10 files changed, 35 insertions(+), 9 deletions(-)

_______________________________________________
buildroot mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/buildroot