Skip to contentSkip to conversation

package/mosquitto: add target mosquitto_passwd

PATCH In review Sebastien Laveze 2 participants 3 messages May 29, 2024 – Jun 2, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/mosquitto: add target mosquitto_passwd

The mosquitto_passwd utility is useful on target if user accounts need to be created runtime.

---
 package/mosquitto/Config.in    | 7 +++++++
 package/mosquitto/mosquitto.mk | 4 ++++
 2 files changed, 11 insertions(+)
package/mosquitto/Config.in +7 -0
index 8bedf2ad21..fe722108da 100644
@@ -29,6 +29,13 @@ config BR2_PACKAGE_MOSQUITTO_BROKER
 	help
 	  Build and install the mosquitto broker onto target.
 
+config BR2_PACKAGE_MOSQUITTO_PASSWORD
+	bool "install the target mosquitto password utility"
+	default n
+	depends on BR2_PACKAGE_MOSQUITTO
+	help
+	  Build and install the target mosquitto password utility.
+
 comment "mosquitto broker needs a toolchain w/ dynamic library"
 	depends on BR2_USE_MMU
 	depends on BR2_STATIC_LIBS
package/mosquitto/mosquitto.mk +4 -0
index b847e56fec..9226d3d7f1 100644
@@ -94,6 +94,10 @@ ifeq ($(BR2_PACKAGE_MOSQUITTO_BROKER),y)
 MOSQUITTO_MAKE_DIRS += src
 endif
 
+ifeq ($(BR2_PACKAGE_MOSQUITTO_PASSWORD),y)
+MOSQUITTO_MAKE_DIRS += apps/mosquitto_passwd
+endif
+
 define MOSQUITTO_BUILD_CMDS
 	$(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS) DIRS="$(MOSQUITTO_MAKE_DIRS)" \
 		$(MOSQUITTO_MAKE_OPTS)
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw
Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Sebastien" == Sebastien Laveze <[email protected]> writes:

The mosquitto_passwd utility is useful on target if user accounts need to be created runtime.

Looking at the build logic for mosquitto_passwd (and mosquitto_ctrl) I see they need openssl (and cjson for mosquitto_ctrl). They don't make a lot of sense without the broker and they are really tiny compared to the libraries and the broker, so I have changed the patch to automatically build them if the broker is enabled and the needed libraries.

ls -lahS target/usr/sbin/mosquitto target/usr/bin/mosquitto_* target/usr/lib/libssl.so.3 target/usr/lib/libcrypto.so.3 target/usr/lib/libcjson.so.1.7.18

-rwxr-xr-x 1 peko peko 4.8M Jun  1 00:42 target/usr/lib/libcrypto.so.3
-rwxr-xr-x 1 peko peko 968K Jun  1 00:42 target/usr/lib/libssl.so.3
-rwxr-xr-x 1 peko peko 266K Jun  1 00:42 target/usr/sbin/mosquitto
-rwxr-xr-x 1 peko peko  58K Jun  1 00:42 target/usr/bin/mosquitto_rr
-rwxr-xr-x 1 peko peko  58K Jun  1 00:42 target/usr/bin/mosquitto_sub
-rwxr-xr-x 1 peko peko  54K Jun  1 00:42 target/usr/bin/mosquitto_ctrl
-rwxr-xr-x 1 peko peko  50K Jun  1 00:42 target/usr/bin/mosquitto_pub
-rwxr-xr-x 1 peko peko  34K Jun  1 00:42 target/usr/lib/libcjson.so.1.7.18
-rwxr-xr-x 1 peko peko  26K Jun  1 00:42 target/usr/bin/mosquitto_passwd

And committed to next, thanks.

Signature · 5 lines
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot