Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/qbee-agent: new package
@ 2023-11-09  8:09 Jon Henrik Bjørnstad via buildroot
  2023-11-09 10:25 ` Thomas Petazzoni via buildroot
  0 siblings, 1 reply; 16+ messages in thread
From: Jon Henrik Bjørnstad via buildroot @ 2023-11-09  8:09 UTC (permalink / raw)
  To: buildroot; +Cc: Jon Henrik Bjørnstad, Thomas Petazzoni

This patch add qbee-agent, an open source device management software
for Linux devices.

Signed-off-by: Jon Henrik Bjørnstad <jonhenrik@qbee.io>
---
 package/Config.in                  |  1 +
 package/qbee-agent/Config.in       | 16 +++++++++++
 package/qbee-agent/qbee-agent.hash |  3 ++
 package/qbee-agent/qbee-agent.mk   | 45 ++++++++++++++++++++++++++++++
 4 files changed, 65 insertions(+)
 create mode 100644 package/qbee-agent/Config.in
 create mode 100644 package/qbee-agent/qbee-agent.hash
 create mode 100644 package/qbee-agent/qbee-agent.mk

diff --git a/package/Config.in b/package/Config.in
index ce46d30fed..1fef365c35 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -2741,6 +2741,7 @@ menu "System tools"
 	source "package/procs/Config.in"
 	source "package/psmisc/Config.in"
 	source "package/pwgen/Config.in"
+  source "package/qbee-agent/Config.in"
 	source "package/quota/Config.in"
 	source "package/quotatool/Config.in"
 	source "package/rauc/Config.in"
diff --git a/package/qbee-agent/Config.in b/package/qbee-agent/Config.in
new file mode 100644
index 0000000000..9cc7f5c88f
--- /dev/null
+++ b/package/qbee-agent/Config.in
@@ -0,0 +1,16 @@
+config BR2_PACKAGE_QBEE_AGENT
+	bool "qbee-agent"
+	select BR2_PACKAGE_OPENSSH if !BR2_PACKAGE_DROPBEAR_CLIENT  # runtime
+	select BR2_PACKAGE_IPTABLES  # runtime
+	select BR2_PACKAGE_BUSYBOX_SHOW_OTHERS  # runtime
+	select BR2_PACKAGE_SHADOW  # runtime
+	select BR2_PACKAGE_BASH  # runtime
+	help
+	  Qbee is a device management platform that comprise
+	  of an open-source agent and a hosted SaaS backend.
+	  This config installs pre-built static binaries made
+	  with the official public signing key for qbee.io. The
+	  binaries will work seamlessly with the qbee.io device
+	  management backend.
+	  https://github.com/qbee-io/qbee-agent
+	  https://qbee.io
diff --git a/package/qbee-agent/qbee-agent.hash b/package/qbee-agent/qbee-agent.hash
new file mode 100644
index 0000000000..e3a81298e0
--- /dev/null
+++ b/package/qbee-agent/qbee-agent.hash
@@ -0,0 +1,3 @@
+md5  6e4dc7323b99d8c5a981b7b2c5da4f66  qbee-agent-2023.44.tar.gz
+sha1  a0d02c1180fd97228f23859a8dea91fe81a31626  qbee-agent-2023.44.tar.gz
+sha256  edcf319c4ce17e9844df598fa796aa87303a1bf238299dbeeb41c94ff5de5e1d  qbee-agent-2023.44.tar.gz
diff --git a/package/qbee-agent/qbee-agent.mk b/package/qbee-agent/qbee-agent.mk
new file mode 100644
index 0000000000..4e261d6bf4
--- /dev/null
+++ b/package/qbee-agent/qbee-agent.mk
@@ -0,0 +1,45 @@
+################################################################################
+#
+# qbee-agent package
+#
+################################################################################
+
+QBEE_AGENT_VERSION = 2023.44
+#QBEE_AGENT_SOURCE = qbee-agent-$(QBEE_AGENT_VERSION).tar.gz
+QBEE_AGENT_SITE = https://cdn.qbee.io/software/qbee-agent/$(QBEE_AGENT_VERSION)/binaries
+QBEE_AGENT_LICENSE = Apache-2.0
+
+ifeq ($(BR2_arm),y)
+QBEE_AGENT_GOARCH = arm
+else ifeq ($(BR2_aarch64),y)
+QBEE_AGENT_GOARCH = arm64
+else ifeq ($(BR2_i386),y)
+QBEE_AGENT_GOARCH = 386
+else ifeq ($(BR2_x86_64),y)
+QBEE_AGENT_GOARCH = amd64
+endif
+
+define QBEE_AGENT_BUILD_CMDS
+endef
+
+define QBEE_AGENT_INSTALL_TARGET_CMDS
+	$(INSTALL) -m 0755 $(@D)/qbee-agent-$(QBEE_AGENT_VERSION)/qbee-agent-$(QBEE_AGENT_GOARCH) $(TARGET_DIR)/usr/bin/qbee-agent
+	$(INSTALL) -d -m 0700 $(TARGET_DIR)/etc/qbee/ppkeys
+	$(INSTALL) -m 0600 $(@D)/qbee-agent-$(QBEE_AGENT_VERSION)/share/ssl/ca.cert $(TARGET_DIR)/etc/qbee/ppkeys/ca.cert
+endef
+
+define QBEE_AGENT_INSTALL_INIT_SYSTEMD
+	$(INSTALL) -D -m 0644 $(@D)/qbee-agent-$(QBEE_AGENT_VERSION)/init-scripts/systemd/qbee-agent.service \
+	  $(TARGET_DIR)/usr/lib/systemd/system/qbee-agent.service
+endef
+
+define QBEE_AGENT_INSTALL_INIT_SYSV
+	$(INSTALL) -D -m 755 $(@D)/qbee-agent-$(QBEE_AGENT_VERSION)/init-scripts/sysvinit/qbee-agent \
+	  $(TARGET_DIR)/etc/init.d/S99qbee-agent
+endef
+
+define QBEE_AGENT_LINUX_CONFIG_FIXUPS
+	$(call KCONFIG_ENABLE_OPT,CONFIG_TUN)
+endef
+
+$(eval $(generic-package))
-- 
2.25.1

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

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

* Re: [Buildroot] [PATCH 1/1] package/qbee-agent: new package
  2023-11-09  8:09 [Buildroot] [PATCH 1/1] package/qbee-agent: new package Jon Henrik Bjørnstad via buildroot
@ 2023-11-09 10:25 ` Thomas Petazzoni via buildroot
  2023-11-10 18:56   ` Arnout Vandecappelle via buildroot
  0 siblings, 1 reply; 16+ messages in thread
From: Thomas Petazzoni via buildroot @ 2023-11-09 10:25 UTC (permalink / raw)
  To: Jon Henrik Bjørnstad via buildroot; +Cc: Jon Henrik Bjørnstad

Hello Jon,

Thanks a lot for this contribution. See below a small number of
comments/questions.

On Thu,  9 Nov 2023 09:09:19 +0100
Jon Henrik Bjørnstad via buildroot <buildroot@buildroot.org> wrote:

> This patch add qbee-agent, an open source device management software
> for Linux devices.
> 
> Signed-off-by: Jon Henrik Bjørnstad <jonhenrik@qbee.io>
> ---
>  package/Config.in                  |  1 +
>  package/qbee-agent/Config.in       | 16 +++++++++++
>  package/qbee-agent/qbee-agent.hash |  3 ++
>  package/qbee-agent/qbee-agent.mk   | 45 ++++++++++++++++++++++++++++++
>  4 files changed, 65 insertions(+)

Could you add an entry in the DEVELOPERS file for this package, that
associates your name/e-mail with the package, so that we can notify you
when there are build failures, or needed security updates?

> diff --git a/package/Config.in b/package/Config.in
> index ce46d30fed..1fef365c35 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -2741,6 +2741,7 @@ menu "System tools"
>  	source "package/procs/Config.in"
>  	source "package/psmisc/Config.in"
>  	source "package/pwgen/Config.in"
> +  source "package/qbee-agent/Config.in"

The indentation is not correct here.

>  	source "package/quota/Config.in"
>  	source "package/quotatool/Config.in"
>  	source "package/rauc/Config.in"
> diff --git a/package/qbee-agent/Config.in b/package/qbee-agent/Config.in
> new file mode 100644
> index 0000000000..9cc7f5c88f
> --- /dev/null
> +++ b/package/qbee-agent/Config.in
> @@ -0,0 +1,16 @@
> +config BR2_PACKAGE_QBEE_AGENT
> +	bool "qbee-agent"
> +	select BR2_PACKAGE_OPENSSH if !BR2_PACKAGE_DROPBEAR_CLIENT  # runtime
> +	select BR2_PACKAGE_IPTABLES  # runtime
> +	select BR2_PACKAGE_BUSYBOX_SHOW_OTHERS  # runtime
> +	select BR2_PACKAGE_SHADOW  # runtime
> +	select BR2_PACKAGE_BASH  # runtime

Minor nit: only one space before the "# runtime" comment.

> +	help
> +	  Qbee is a device management platform that comprise
> +	  of an open-source agent and a hosted SaaS backend.
> +	  This config installs pre-built static binaries made
> +	  with the official public signing key for qbee.io. The
> +	  binaries will work seamlessly with the qbee.io device
> +	  management backend.

Please put one empty line betwen the help text and the upstream URL.

But the bigger question is why do we package a pre-built static binary,
rather than building from source?

Also, if this package is provided with pre-built binaries, then most
likely it is only supported for a specific subset of CPU architectures,
so you need some "depends on". If you however decide to build if from
source, it should have:

	depends on BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS

> +	  https://github.com/qbee-io/qbee-agent
> +	  https://qbee.io
> diff --git a/package/qbee-agent/qbee-agent.hash b/package/qbee-agent/qbee-agent.hash
> new file mode 100644
> index 0000000000..e3a81298e0
> --- /dev/null
> +++ b/package/qbee-agent/qbee-agent.hash
> @@ -0,0 +1,3 @@

Please add a comment that says where the hash comes from. If it's just
calculated locally by you, then:

# Locally calculated

> +md5  6e4dc7323b99d8c5a981b7b2c5da4f66  qbee-agent-2023.44.tar.gz
> +sha1  a0d02c1180fd97228f23859a8dea91fe81a31626  qbee-agent-2023.44.tar.gz
> +sha256  edcf319c4ce17e9844df598fa796aa87303a1bf238299dbeeb41c94ff5de5e1d  qbee-agent-2023.44.tar.gz

The sha256 hash is sufficient.

> diff --git a/package/qbee-agent/qbee-agent.mk b/package/qbee-agent/qbee-agent.mk
> new file mode 100644
> index 0000000000..4e261d6bf4
> --- /dev/null
> +++ b/package/qbee-agent/qbee-agent.mk
> @@ -0,0 +1,45 @@
> +################################################################################
> +#
> +# qbee-agent package
> +#
> +################################################################################
> +
> +QBEE_AGENT_VERSION = 2023.44
> +#QBEE_AGENT_SOURCE = qbee-agent-$(QBEE_AGENT_VERSION).tar.gz
> +QBEE_AGENT_SITE = https://cdn.qbee.io/software/qbee-agent/$(QBEE_AGENT_VERSION)/binaries
> +QBEE_AGENT_LICENSE = Apache-2.0

Is there are license file?

> +
> +ifeq ($(BR2_arm),y)
> +QBEE_AGENT_GOARCH = arm
> +else ifeq ($(BR2_aarch64),y)
> +QBEE_AGENT_GOARCH = arm64
> +else ifeq ($(BR2_i386),y)
> +QBEE_AGENT_GOARCH = 386
> +else ifeq ($(BR2_x86_64),y)
> +QBEE_AGENT_GOARCH = amd64
> +endif

Perhaps you can directly use $(GO_GOARCH) ?

> +define QBEE_AGENT_BUILD_CMDS
> +endef

Just don't define build commands in this case.

> +define QBEE_AGENT_INSTALL_TARGET_CMDS
> +	$(INSTALL) -m 0755 $(@D)/qbee-agent-$(QBEE_AGENT_VERSION)/qbee-agent-$(QBEE_AGENT_GOARCH) $(TARGET_DIR)/usr/bin/qbee-agent

It's a bit surprising, why do you have a
qbee-agent-$(QBEE_AGENT_VERSION) ? It looks like your tarball has one
too many path embedded maybe? If so, you can do:

QBEE_AGENT_STRIP_COMPONENTS = 2

this will simplify the paths.

> +	$(INSTALL) -d -m 0700 $(TARGET_DIR)/etc/qbee/ppkeys

No need to do this...

> +	$(INSTALL) -m 0600 $(@D)/qbee-agent-$(QBEE_AGENT_VERSION)/share/ssl/ca.cert $(TARGET_DIR)/etc/qbee/ppkeys/ca.cert

... just add -D as an option here, which will create all needed
destination directories.

> +endef
> +
> +define QBEE_AGENT_INSTALL_INIT_SYSTEMD
> +	$(INSTALL) -D -m 0644 $(@D)/qbee-agent-$(QBEE_AGENT_VERSION)/init-scripts/systemd/qbee-agent.service \
> +	  $(TARGET_DIR)/usr/lib/systemd/system/qbee-agent.service

Tab for the indentation.

> +endef
> +
> +define QBEE_AGENT_INSTALL_INIT_SYSV
> +	$(INSTALL) -D -m 755 $(@D)/qbee-agent-$(QBEE_AGENT_VERSION)/init-scripts/sysvinit/qbee-agent \
> +	  $(TARGET_DIR)/etc/init.d/S99qbee-agent

Likewise.

Thanks a lot!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* [Buildroot] [PATCH 1/1] package/qbee-agent: new package
  2023-11-09 14:20 [Buildroot] [PATCH 0/1] Regarding review of qbee-agent patch Jon Henrik Bjørnstad via buildroot
@ 2023-11-09 14:20 ` Jon Henrik Bjørnstad via buildroot
  2023-11-09 16:03   ` yann.morin
  0 siblings, 1 reply; 16+ messages in thread
From: Jon Henrik Bjørnstad via buildroot @ 2023-11-09 14:20 UTC (permalink / raw)
  To: buildroot; +Cc: Thomas Petazzoni, Jon Henrik Bjørnstad

This patch add qbee-agent, an open source device management software
for Linux devices.

Signed-off-by: Jon Henrik Bjørnstad <jonhenrik@qbee.io>
---
 DEVELOPERS                         |  3 +++
 package/Config.in                  |  1 +
 package/qbee-agent/Config.in       | 17 ++++++++++++
 package/qbee-agent/qbee-agent.hash |  2 ++
 package/qbee-agent/qbee-agent.mk   | 42 ++++++++++++++++++++++++++++++
 5 files changed, 65 insertions(+)
 create mode 100644 package/qbee-agent/Config.in
 create mode 100644 package/qbee-agent/qbee-agent.hash
 create mode 100644 package/qbee-agent/qbee-agent.mk

diff --git a/DEVELOPERS b/DEVELOPERS
index 12257fae8c..88d4aa205a 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1615,6 +1615,9 @@ F:	package/sdbusplus/
 N:	Jon Ringle <jringle@gridpoint.com>
 F:	package/mbpoll/
 
+N:	Jon Henrik Bjørnstad <jonhenrik@qbee.io>
+F:	package/qbee-agent/
+
 N:	Jonathan Ben Avraham <yba@tkos.co.il>
 F:	arch/Config.in.xtensa
 F:	package/autofs/
diff --git a/package/Config.in b/package/Config.in
index ce46d30fed..f146c96464 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -2741,6 +2741,7 @@ menu "System tools"
 	source "package/procs/Config.in"
 	source "package/psmisc/Config.in"
 	source "package/pwgen/Config.in"
+	source "package/qbee-agent/Config.in"
 	source "package/quota/Config.in"
 	source "package/quotatool/Config.in"
 	source "package/rauc/Config.in"
diff --git a/package/qbee-agent/Config.in b/package/qbee-agent/Config.in
new file mode 100644
index 0000000000..08f6038c7a
--- /dev/null
+++ b/package/qbee-agent/Config.in
@@ -0,0 +1,17 @@
+config BR2_PACKAGE_QBEE_AGENT
+	bool "qbee-agent"
+	select BR2_PACKAGE_OPENSSH if !BR2_PACKAGE_DROPBEAR_CLIENT # runtime
+	select BR2_PACKAGE_IPTABLES # runtime
+	select BR2_PACKAGE_BUSYBOX_SHOW_OTHERS # runtime
+	select BR2_PACKAGE_SHADOW # runtime
+	select BR2_PACKAGE_BASH # runtime
+	help
+	  Qbee is a device management platform that comprise
+	  of an open-source agent and a hosted SaaS backend.
+	  This config installs pre-built static binaries made
+	  with the official public signing key for qbee.io. The
+	  binaries will work seamlessly with the qbee.io device
+	  management backend.
+
+	  https://github.com/qbee-io/qbee-agent
+	  https://qbee.io
diff --git a/package/qbee-agent/qbee-agent.hash b/package/qbee-agent/qbee-agent.hash
new file mode 100644
index 0000000000..b7e311405f
--- /dev/null
+++ b/package/qbee-agent/qbee-agent.hash
@@ -0,0 +1,2 @@
+# Locally calculated
+sha256  edcf319c4ce17e9844df598fa796aa87303a1bf238299dbeeb41c94ff5de5e1d  qbee-agent-2023.44.tar.gz
diff --git a/package/qbee-agent/qbee-agent.mk b/package/qbee-agent/qbee-agent.mk
new file mode 100644
index 0000000000..aded6b72f4
--- /dev/null
+++ b/package/qbee-agent/qbee-agent.mk
@@ -0,0 +1,42 @@
+################################################################################
+#
+# qbee-agent package
+#
+################################################################################
+
+QBEE_AGENT_VERSION = 2023.44
+QBEE_AGENT_SITE = https://cdn.qbee.io/software/qbee-agent/$(QBEE_AGENT_VERSION)/binaries
+QBEE_AGENT_LICENSE = Apache-2.0
+
+ifeq ($(BR2_arm),y)
+QBEE_AGENT_GOARCH = arm
+else ifeq ($(BR2_aarch64),y)
+QBEE_AGENT_GOARCH = arm64
+else ifeq ($(BR2_i386),y)
+QBEE_AGENT_GOARCH = 386
+else ifeq ($(BR2_x86_64),y)
+QBEE_AGENT_GOARCH = amd64
+endif
+
+QBEE_AGENT_STRIP_COMPONENTS = 2
+
+define QBEE_AGENT_INSTALL_TARGET_CMDS
+	$(INSTALL) -m 0755 $(@D)/qbee-agent-$(QBEE_AGENT_GOARCH) $(TARGET_DIR)/usr/bin/qbee-agent
+	$(INSTALL) -D -m 0600 $(@D)/share/ssl/ca.cert $(TARGET_DIR)/etc/qbee/ppkeys/ca.cert
+endef
+
+define QBEE_AGENT_INSTALL_INIT_SYSTEMD
+	$(INSTALL) -D -m 0644 $(@D)/init-scripts/systemd/qbee-agent.service \
+		$(TARGET_DIR)/usr/lib/systemd/system/qbee-agent.service
+endef
+
+define QBEE_AGENT_INSTALL_INIT_SYSV
+	$(INSTALL) -D -m 755 $(@D)/init-scripts/sysvinit/qbee-agent \
+		$(TARGET_DIR)/etc/init.d/S99qbee-agent
+endef
+
+define QBEE_AGENT_LINUX_CONFIG_FIXUPS
+	$(call KCONFIG_ENABLE_OPT,CONFIG_TUN)
+endef
+
+$(eval $(generic-package))
-- 
2.25.1

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

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

* Re: [Buildroot] [PATCH 1/1] package/qbee-agent: new package
  2023-11-09 14:20 ` [Buildroot] [PATCH 1/1] package/qbee-agent: new package Jon Henrik Bjørnstad via buildroot
@ 2023-11-09 16:03   ` yann.morin
  2023-11-10  8:43     ` Jon Henrik Bjørnstad via buildroot
  0 siblings, 1 reply; 16+ messages in thread
From: yann.morin @ 2023-11-09 16:03 UTC (permalink / raw)
  To: Jon Henrik Bjørnstad; +Cc: Thomas Petazzoni, buildroot

Jon, All,

On 2023-11-09 15:20 +0100, Jon Henrik Bjørnstad via buildroot spake thusly:
> This patch add qbee-agent, an open source device management software
> for Linux devices.
[--SNIP--]
> diff --git a/package/qbee-agent/qbee-agent.hash b/package/qbee-agent/qbee-agent.hash
> new file mode 100644
> index 0000000000..b7e311405f
> --- /dev/null
> +++ b/package/qbee-agent/qbee-agent.hash
> @@ -0,0 +1,2 @@
> +# Locally calculated
> +sha256  edcf319c4ce17e9844df598fa796aa87303a1bf238299dbeeb41c94ff5de5e1d  qbee-agent-2023.44.tar.gz
> diff --git a/package/qbee-agent/qbee-agent.mk b/package/qbee-agent/qbee-agent.mk
> new file mode 100644
> index 0000000000..aded6b72f4
> --- /dev/null
> +++ b/package/qbee-agent/qbee-agent.mk
> @@ -0,0 +1,42 @@
> +################################################################################
> +#
> +# qbee-agent package
> +#
> +################################################################################
> +
> +QBEE_AGENT_VERSION = 2023.44
> +QBEE_AGENT_SITE = https://cdn.qbee.io/software/qbee-agent/$(QBEE_AGENT_VERSION)/binaries
> +QBEE_AGENT_LICENSE = Apache-2.0

There is the go source code on:
    https://github.com/qbee-io/qbee-agent

So, why do you download a prebuilt pacakge?
Why can't you use the buidlroot go pacakge infrastructure?

See:
    https://buildroot.org/downloads/manual/manual.html#_infrastructure_for_go_packages

Basically, that would look like (omitting licensing and stuff):

    QBEE_AGENT_VERSION = 2023.44
    QBEE_AGENT_SITE = $(call github,qbee-io,qbee-agent,$(QBEE_AGENT_VERSION))

    $(eval $(golang-pacakge))

Then, maybe you need to specify a few other variables, see the manual:
    QBEE_AGENT_GOMOD
    QBEE_AGENT_BUILD_TARGETS
    QBEE_AGENT_INSTALL_BINS

Regards,
Yann E. MORIN.

> +ifeq ($(BR2_arm),y)
> +QBEE_AGENT_GOARCH = arm
> +else ifeq ($(BR2_aarch64),y)
> +QBEE_AGENT_GOARCH = arm64
> +else ifeq ($(BR2_i386),y)
> +QBEE_AGENT_GOARCH = 386
> +else ifeq ($(BR2_x86_64),y)
> +QBEE_AGENT_GOARCH = amd64
> +endif
> +
> +QBEE_AGENT_STRIP_COMPONENTS = 2
> +
> +define QBEE_AGENT_INSTALL_TARGET_CMDS
> +	$(INSTALL) -m 0755 $(@D)/qbee-agent-$(QBEE_AGENT_GOARCH) $(TARGET_DIR)/usr/bin/qbee-agent
> +	$(INSTALL) -D -m 0600 $(@D)/share/ssl/ca.cert $(TARGET_DIR)/etc/qbee/ppkeys/ca.cert
> +endef
> +
> +define QBEE_AGENT_INSTALL_INIT_SYSTEMD
> +	$(INSTALL) -D -m 0644 $(@D)/init-scripts/systemd/qbee-agent.service \
> +		$(TARGET_DIR)/usr/lib/systemd/system/qbee-agent.service
> +endef
> +
> +define QBEE_AGENT_INSTALL_INIT_SYSV
> +	$(INSTALL) -D -m 755 $(@D)/init-scripts/sysvinit/qbee-agent \
> +		$(TARGET_DIR)/etc/init.d/S99qbee-agent
> +endef
> +
> +define QBEE_AGENT_LINUX_CONFIG_FIXUPS
> +	$(call KCONFIG_ENABLE_OPT,CONFIG_TUN)
> +endef
> +
> +$(eval $(generic-package))
> -- 
> 2.25.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
                                        ____________
.-----------------.--------------------:       _    :------------------.
|  Yann E. MORIN  | Real-Time Embedded |    __/ )   | /"\ ASCII RIBBON |
|                 | Software  Designer |  _/ - /'   | \ / CAMPAIGN     |
| +33 638.411.245 '--------------------: (_    `--, |  X  AGAINST      |
| yann.morin (at) orange.com           |_="    ,--' | / \ HTML MAIL    |
'--------------------------------------:______/_____:------------------'

____________________________________________________________________________________________________________
Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc
pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler
a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration,
Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.

This message and its attachments may contain confidential or privileged information that may be protected by law;
they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete this message and its attachments.
As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified.
Thank you.
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH 1/1] package/qbee-agent: new package
  2023-11-09 16:03   ` yann.morin
@ 2023-11-10  8:43     ` Jon Henrik Bjørnstad via buildroot
  2023-11-10  9:39       ` yann.morin
  0 siblings, 1 reply; 16+ messages in thread
From: Jon Henrik Bjørnstad via buildroot @ 2023-11-10  8:43 UTC (permalink / raw)
  To: yann.morin; +Cc: Thomas Petazzoni, buildroot


[-- Attachment #1.1: Type: text/plain, Size: 5438 bytes --]

Hi Yann,

Thanks for your feedback.

I wrote a cover letter based in an initial review of the patch that
attempted to explain why the choice to install pre-compiled static binaries
was made (Subject: [PATCH 0/1] Regarding review of qbee-agent patch)

However, it seems the approach I've chosen is not the optimal one. I'll
attempt to redo the patch with your feedback in mind.

I'm fairly new to the buildroot community and I'm still learning the ropes
:)

Thanks again!

With best regards,

Jon Henrik Bjørnstad

On Thu, Nov 9, 2023 at 5:03 PM <yann.morin@orange.com> wrote:

> Jon, All,
>
> On 2023-11-09 15:20 +0100, Jon Henrik Bjørnstad via buildroot spake thusly:
> > This patch add qbee-agent, an open source device management software
> > for Linux devices.
> [--SNIP--]
> > diff --git a/package/qbee-agent/qbee-agent.hash
> b/package/qbee-agent/qbee-agent.hash
> > new file mode 100644
> > index 0000000000..b7e311405f
> > --- /dev/null
> > +++ b/package/qbee-agent/qbee-agent.hash
> > @@ -0,0 +1,2 @@
> > +# Locally calculated
> > +sha256
> edcf319c4ce17e9844df598fa796aa87303a1bf238299dbeeb41c94ff5de5e1d
> qbee-agent-2023.44.tar.gz
> > diff --git a/package/qbee-agent/qbee-agent.mk b/package/qbee-agent/
> qbee-agent.mk
> > new file mode 100644
> > index 0000000000..aded6b72f4
> > --- /dev/null
> > +++ b/package/qbee-agent/qbee-agent.mk
> > @@ -0,0 +1,42 @@
> >
> +################################################################################
> > +#
> > +# qbee-agent package
> > +#
> >
> +################################################################################
> > +
> > +QBEE_AGENT_VERSION = 2023.44
> > +QBEE_AGENT_SITE =
> https://cdn.qbee.io/software/qbee-agent/$(QBEE_AGENT_VERSION)/binaries
> > +QBEE_AGENT_LICENSE = Apache-2.0
>
> There is the go source code on:
>     https://github.com/qbee-io/qbee-agent
>
> So, why do you download a prebuilt pacakge?
> Why can't you use the buidlroot go pacakge infrastructure?
>
> See:
>
> https://buildroot.org/downloads/manual/manual.html#_infrastructure_for_go_packages
>
> Basically, that would look like (omitting licensing and stuff):
>
>     QBEE_AGENT_VERSION = 2023.44
>     QBEE_AGENT_SITE = $(call
> github,qbee-io,qbee-agent,$(QBEE_AGENT_VERSION))
>
>     $(eval $(golang-pacakge))
>
> Then, maybe you need to specify a few other variables, see the manual:
>     QBEE_AGENT_GOMOD
>     QBEE_AGENT_BUILD_TARGETS
>     QBEE_AGENT_INSTALL_BINS
>
> Regards,
> Yann E. MORIN.
>
> > +ifeq ($(BR2_arm),y)
> > +QBEE_AGENT_GOARCH = arm
> > +else ifeq ($(BR2_aarch64),y)
> > +QBEE_AGENT_GOARCH = arm64
> > +else ifeq ($(BR2_i386),y)
> > +QBEE_AGENT_GOARCH = 386
> > +else ifeq ($(BR2_x86_64),y)
> > +QBEE_AGENT_GOARCH = amd64
> > +endif
> > +
> > +QBEE_AGENT_STRIP_COMPONENTS = 2
> > +
> > +define QBEE_AGENT_INSTALL_TARGET_CMDS
> > +     $(INSTALL) -m 0755 $(@D)/qbee-agent-$(QBEE_AGENT_GOARCH)
> $(TARGET_DIR)/usr/bin/qbee-agent
> > +     $(INSTALL) -D -m 0600 $(@D)/share/ssl/ca.cert
> $(TARGET_DIR)/etc/qbee/ppkeys/ca.cert
> > +endef
> > +
> > +define QBEE_AGENT_INSTALL_INIT_SYSTEMD
> > +     $(INSTALL) -D -m 0644
> $(@D)/init-scripts/systemd/qbee-agent.service \
> > +             $(TARGET_DIR)/usr/lib/systemd/system/qbee-agent.service
> > +endef
> > +
> > +define QBEE_AGENT_INSTALL_INIT_SYSV
> > +     $(INSTALL) -D -m 755 $(@D)/init-scripts/sysvinit/qbee-agent \
> > +             $(TARGET_DIR)/etc/init.d/S99qbee-agent
> > +endef
> > +
> > +define QBEE_AGENT_LINUX_CONFIG_FIXUPS
> > +     $(call KCONFIG_ENABLE_OPT,CONFIG_TUN)
> > +endef
> > +
> > +$(eval $(generic-package))
> > --
> > 2.25.1
> >
> > _______________________________________________
> > buildroot mailing list
> > buildroot@buildroot.org
> > https://lists.buildroot.org/mailman/listinfo/buildroot
>
> --
>                                         ____________
> .-----------------.--------------------:       _    :------------------.
> |  Yann E. MORIN  | Real-Time Embedded |    __/ )   | /"\ ASCII RIBBON |
> |                 | Software  Designer |  _/ - /'   | \ / CAMPAIGN     |
> | +33 638.411.245 '--------------------: (_    `--, |  X  AGAINST      |
> | yann.morin (at) orange.com           |_="    ,--' | / \ HTML MAIL    |
> '--------------------------------------:______/_____:------------------'
>
>
> ____________________________________________________________________________________________________________
> Ce message et ses pieces jointes peuvent contenir des informations
> confidentielles ou privilegiees et ne doivent donc
> pas etre diffuses, exploites ou copies sans autorisation. Si vous avez
> recu ce message par erreur, veuillez le signaler
> a l'expediteur et le detruire ainsi que les pieces jointes. Les messages
> electroniques etant susceptibles d'alteration,
> Orange decline toute responsabilite si ce message a ete altere, deforme ou
> falsifie. Merci.
>
> This message and its attachments may contain confidential or privileged
> information that may be protected by law;
> they should not be distributed, used or copied without authorisation.
> If you have received this email in error, please notify the sender and
> delete this message and its attachments.
> As emails may be altered, Orange is not liable for messages that have been
> modified, changed or falsified.
> Thank you.
>

[-- Attachment #1.2: Type: text/html, Size: 7213 bytes --]

[-- Attachment #2: Type: text/plain, Size: 150 bytes --]

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

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

* Re: [Buildroot] [PATCH 1/1] package/qbee-agent: new package
  2023-11-10  8:43     ` Jon Henrik Bjørnstad via buildroot
@ 2023-11-10  9:39       ` yann.morin
  0 siblings, 0 replies; 16+ messages in thread
From: yann.morin @ 2023-11-10  9:39 UTC (permalink / raw)
  To: Jon Henrik Bjørnstad; +Cc: Thomas Petazzoni, buildroot

Jon, All,

On 2023-11-10 09:43 +0100, Jon Henrik Bjørnstad via buildroot spake thusly:
> Hi Yann,
> Thanks for your feedback.
> I wrote a cover letter based in an initial review of the patch that attempted to explain why the choice to install pre-compiled
> static binaries was made (Subject: [PATCH 0/1] Regarding review of qbee-agent patch)

Damn, I missed reading the cover-letter, because it's tittled was
hinting at comments on the previous review.

Now that I read it, most of it should have been part, in some form, of
the commit log of this patch.

If the public key is, well, public, I guess it is a common, generic key.
I can see two options:

  * single key, ever:
      - in qbee-agent.mk:
        QBEE_AGENT_EXTRA_DOWNLOADS = https://url/of/key.pub
        define QBEE_AGENT_COPY_KEY
            $(INSTALL) -d -m 0644 $(QBEE_AGENT_DL_DIR)/key.pub $(@D]/key.pub
        endef
        QBEE_AGENT_POST_EXTRACT_HOOKS += QBEE_AGENT_COPY_KEY
        QBEE_AGENT_LDFLAGS = -X PUBKEY_options_blabla...

      - in qbee-agent.hash
        sha256  <shash>  key.pub

  * user can define the key they want to use:
      - in Config.in:
        config BR2_PACKAGE_QBEE_AGENT_KEY_URL
            string "URL of the public key to use"
      - basically, the same as above, except the hash:
        QBEE_AGENT_KEY_URL = $(call qstrip,$(BR2_PACKAGE_QBEE_AGENT_KEY_URL))
        QBEE_AGENT_EXTRA_DOWNLOADS = $(QBEE_AGENT_KEY_URL)
        BR2_NO_CHECK_HASH_FOR += $(notdir $(QBEE_AGENT_KEY_URL))
        define QBEE_AGENT_COPY_KEY
            $(INSTALL) -d -m 0644 $(QBEE_AGENT_DL_DIR)/$(notdir $(QBEE_AGENT_KEY_URL)) $(@D]/key.pub

And of course, there is the third option; user can choose to use the
generic, public key, or use their own.

That's just the skeleton of it, you'll probably need to adapt that,
especiaally if we want to be able to point BR2_PACKAGE_QBEE_AGENT_KEY_URL
to a local file, and the user would be responsible for making that
available before the build is started, potentially using
BR2_ROOTFS_PRE_BUILD_SCRIPT, or having it part of the secretes of their
CI, and so on...

I'll reply to the cover letter with other comments, now... Sorry for
missing it...

Regards,
Yann E. MORIN.

> However, it seems the approach I've chosen is not the optimal one. I'll attempt to redo the patch with your feedback in mind.
> I'm fairly new to the buildroot community and I'm still learning the ropes :)
> Thanks again!
> With best regards,
> Jon Henrik Bjørnstad
> On Thu, Nov 9, 2023 at 5:03 PM < [1]yann.morin@orange.com> wrote:
> 
>   Jon, All,
> 
>   On 2023-11-09 15:20 +0100, Jon Henrik Bjørnstad via buildroot spake thusly:
>   > This patch add qbee-agent, an open source device management software
>   > for Linux devices.
>   [--SNIP--]
>   > diff --git a/package/qbee-agent/qbee-agent.hash b/package/qbee-agent/qbee-agent.hash
>   > new file mode 100644
>   > index 0000000000..b7e311405f
>   > --- /dev/null
>   > +++ b/package/qbee-agent/qbee-agent.hash
>   > @@ -0,0 +1,2 @@
>   > +# Locally calculated
>   > +sha256  edcf319c4ce17e9844df598fa796aa87303a1bf238299dbeeb41c94ff5de5e1d  qbee-agent-2023.44.tar.gz
>   > diff --git a/package/qbee-agent/ [2]qbee-agent.mk b/package/qbee-agent/ [3]qbee-agent.mk
>   > new file mode 100644
>   > index 0000000000..aded6b72f4
>   > --- /dev/null
>   > +++ b/package/qbee-agent/ [4]qbee-agent.mk
>   > @@ -0,0 +1,42 @@
>   > +################################################################################
>   > +#
>   > +# qbee-agent package
>   > +#
>   > +################################################################################
>   > +
>   > +QBEE_AGENT_VERSION = 2023.44
>   > +QBEE_AGENT_SITE = [5]https://cdn.qbee.io/software/qbee-agent/$(QBEE_AGENT_VERSION)/binaries
>   > +QBEE_AGENT_LICENSE = Apache-2.0
> 
>   There is the go source code on:
>       [6]https://github.com/qbee-io/qbee-agent
> 
>   So, why do you download a prebuilt pacakge?
>   Why can't you use the buidlroot go pacakge infrastructure?
> 
>   See:
>       [7]https://buildroot.org/downloads/manual/manual.html#_infrastructure_for_go_packages
> 
>   Basically, that would look like (omitting licensing and stuff):
> 
>       QBEE_AGENT_VERSION = 2023.44
>       QBEE_AGENT_SITE = $(call github,qbee-io,qbee-agent,$(QBEE_AGENT_VERSION))
> 
>       $(eval $(golang-pacakge))
> 
>   Then, maybe you need to specify a few other variables, see the manual:
>       QBEE_AGENT_GOMOD
>       QBEE_AGENT_BUILD_TARGETS
>       QBEE_AGENT_INSTALL_BINS
> 
>   Regards,
>   Yann E. MORIN.
> 
>   > +ifeq ($(BR2_arm),y)
>   > +QBEE_AGENT_GOARCH = arm
>   > +else ifeq ($(BR2_aarch64),y)
>   > +QBEE_AGENT_GOARCH = arm64
>   > +else ifeq ($(BR2_i386),y)
>   > +QBEE_AGENT_GOARCH = 386
>   > +else ifeq ($(BR2_x86_64),y)
>   > +QBEE_AGENT_GOARCH = amd64
>   > +endif
>   > +
>   > +QBEE_AGENT_STRIP_COMPONENTS = 2
>   > +
>   > +define QBEE_AGENT_INSTALL_TARGET_CMDS
>   > +     $(INSTALL) -m 0755 $(@D)/qbee-agent-$(QBEE_AGENT_GOARCH) $(TARGET_DIR)/usr/bin/qbee-agent
>   > +     $(INSTALL) -D -m 0600 $(@D)/share/ssl/ca.cert $(TARGET_DIR)/etc/qbee/ppkeys/ca.cert
>   > +endef
>   > +
>   > +define QBEE_AGENT_INSTALL_INIT_SYSTEMD
>   > +     $(INSTALL) -D -m 0644 $(@D)/init-scripts/systemd/qbee-agent.service \
>   > +             $(TARGET_DIR)/usr/lib/systemd/system/qbee-agent.service
>   > +endef
>   > +
>   > +define QBEE_AGENT_INSTALL_INIT_SYSV
>   > +     $(INSTALL) -D -m 755 $(@D)/init-scripts/sysvinit/qbee-agent \
>   > +             $(TARGET_DIR)/etc/init.d/S99qbee-agent
>   > +endef
>   > +
>   > +define QBEE_AGENT_LINUX_CONFIG_FIXUPS
>   > +     $(call KCONFIG_ENABLE_OPT,CONFIG_TUN)
>   > +endef
>   > +
>   > +$(eval $(generic-package))
>   > --
>   > 2.25.1
>   >
>   > _______________________________________________
>   > buildroot mailing list
>   > [8]buildroot@buildroot.org
>   > [9]https://lists.buildroot.org/mailman/listinfo/buildroot
> 
>   --
>                                           ____________
>   .-----------------.--------------------:       _    :------------------.
>   |  Yann E. MORIN  | Real-Time Embedded |    __/ )   | /"\ ASCII RIBBON |
>   |                 | Software  Designer |  _/ - /'   | \ / CAMPAIGN     |
>   | +33 638.411.245 '--------------------: (_    `--, |  X  AGAINST      |
>   | yann.morin (at) [10]orange.com           |_="    ,--' | / \ HTML MAIL    |
>   '--------------------------------------:______/_____:------------------'
> 
>   ____________________________________________________________________________________________________________
>   Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc
>   pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler
>   a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration,
>   Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.
> 
>   This message and its attachments may contain confidential or privileged information that may be protected by law;
>   they should not be distributed, used or copied without authorisation.
>   If you have received this email in error, please notify the sender and delete this message and its attachments.
>   As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified.
>   Thank you.
> 
> Links:
> 1. mailto:yann.morin@orange.com
> 2. http://qbee-agent.mk
> 3. http://qbee-agent.mk
> 4. http://qbee-agent.mk
> 5. https://cdn.qbee.io/software/qbee-agent/$(QBEE_AGENT_VERSION)/binaries
> 6. https://github.com/qbee-io/qbee-agent
> 7. https://buildroot.org/downloads/manual/manual.html#_infrastructure_for_go_packages
> 8. mailto:buildroot@buildroot.org
> 9. https://lists.buildroot.org/mailman/listinfo/buildroot
> 10. http://orange.com

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


-- 
                                        ____________
.-----------------.--------------------:       _    :------------------.
|  Yann E. MORIN  | Real-Time Embedded |    __/ )   | /"\ ASCII RIBBON |
|                 | Software  Designer |  _/ - /'   | \ / CAMPAIGN     |
| +33 638.411.245 '--------------------: (_    `--, |  X  AGAINST      |
| yann.morin (at) orange.com           |_="    ,--' | / \ HTML MAIL    |
'--------------------------------------:______/_____:------------------'

____________________________________________________________________________________________________________
Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc
pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler
a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration,
Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.

This message and its attachments may contain confidential or privileged information that may be protected by law;
they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete this message and its attachments.
As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified.
Thank you.
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* [Buildroot] [PATCH 1/1] package/qbee-agent: new package
@ 2023-11-10 10:45 Jon Henrik Bjørnstad via buildroot
  2023-11-10 14:35 ` yann.morin
  2023-11-10 17:14 ` Christian Stewart via buildroot
  0 siblings, 2 replies; 16+ messages in thread
From: Jon Henrik Bjørnstad via buildroot @ 2023-11-10 10:45 UTC (permalink / raw)
  To: buildroot; +Cc: Christian Stewart, Jon Henrik Bjørnstad, Anisse Astier

This patch add qbee-agent, an open source device management software
for Linux devices.

Signed-off-by: Jon Henrik Bjørnstad <jonhenrik@qbee.io>
---
 DEVELOPERS                         |  3 +++
 package/Config.in                  |  1 +
 package/qbee-agent/Config.in       | 18 ++++++++++++++
 package/qbee-agent/qbee-agent.hash |  3 +++
 package/qbee-agent/qbee-agent.mk   | 39 ++++++++++++++++++++++++++++++
 5 files changed, 64 insertions(+)
 create mode 100644 package/qbee-agent/Config.in
 create mode 100644 package/qbee-agent/qbee-agent.hash
 create mode 100644 package/qbee-agent/qbee-agent.mk

diff --git a/DEVELOPERS b/DEVELOPERS
index d80931e84a..5f6e83179f 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1616,6 +1616,9 @@ F:	package/sdbusplus/
 N:	Jon Ringle <jringle@gridpoint.com>
 F:	package/mbpoll/
 
+N:	Jon Henrik Bjørnstad <jonhenrik@qbee.io>
+F:	package/qbee-agent/
+
 N:	Jonathan Ben Avraham <yba@tkos.co.il>
 F:	arch/Config.in.xtensa
 F:	package/autofs/
diff --git a/package/Config.in b/package/Config.in
index dac5058bbe..cb30906a4f 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -2741,6 +2741,7 @@ menu "System tools"
 	source "package/procs/Config.in"
 	source "package/psmisc/Config.in"
 	source "package/pwgen/Config.in"
+	source "package/qbee-agent/Config.in"
 	source "package/quota/Config.in"
 	source "package/quotatool/Config.in"
 	source "package/rauc/Config.in"
diff --git a/package/qbee-agent/Config.in b/package/qbee-agent/Config.in
new file mode 100644
index 0000000000..c35eabff91
--- /dev/null
+++ b/package/qbee-agent/Config.in
@@ -0,0 +1,18 @@
+config BR2_PACKAGE_QBEE_AGENT
+	bool "qbee-agent"
+	depends on BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
+	select BR2_PACKAGE_OPENSSH if !BR2_PACKAGE_DROPBEAR_CLIENT # runtime
+	select BR2_PACKAGE_IPTABLES # runtime
+	select BR2_PACKAGE_BUSYBOX_SHOW_OTHERS # runtime
+	select BR2_PACKAGE_SHADOW # runtime
+	select BR2_PACKAGE_BASH # runtime
+	help
+	  Qbee is a device management platform that comprise
+	  of an open-source agent and a hosted SaaS backend.
+	  This config installs pre-built static binaries made
+	  with the official public signing key for qbee.io. The
+	  binaries will work seamlessly with the qbee.io device
+	  management backend.
+
+	  https://github.com/qbee-io/qbee-agent
+	  https://qbee.io
diff --git a/package/qbee-agent/qbee-agent.hash b/package/qbee-agent/qbee-agent.hash
new file mode 100644
index 0000000000..918763c583
--- /dev/null
+++ b/package/qbee-agent/qbee-agent.hash
@@ -0,0 +1,3 @@
+# Locally calculated
+sha256  37b92b32890b2e95884fb13e392e8c93d963b8e9b868dff178ab7db58e815ee6  qbee-agent-2023.44.tar.gz
+sha256  02d07d96be99eb042b01ba650079a440ce26a78c5e0e1e8060c33a8c9e200404  LICENSE
diff --git a/package/qbee-agent/qbee-agent.mk b/package/qbee-agent/qbee-agent.mk
new file mode 100644
index 0000000000..f568372e01
--- /dev/null
+++ b/package/qbee-agent/qbee-agent.mk
@@ -0,0 +1,39 @@
+################################################################################
+#
+# qbee-agent package
+#
+################################################################################
+
+QBEE_AGENT_VERSION = 2023.44
+QBEE_AGENT_SITE = $(call github,qbee-io,qbee-agent,$(QBEE_AGENT_VERSION))
+QBEE_AGENT_LICENSE = Apache-2.0
+QBEE_AGENT_LICENSE_FILES = LICENSE
+
+QBEE_AGENT_COMMIT_ID = 582900356222860bfc40567ea359941c9d34f499
+QBEE_AGENT_PUBLIC_SIGNING_KEY = z5mUFaW-3t3WRIjkUr2dVOzPgGw3oyR-tzBlInGfz44.EJExLiJex1X7nT7p6XTxO8kjmGkv6ik60XMzvMe-87g
+
+QBEE_AGENT_LDFLAGS = -s -w \
+	-X github.com/qbee-io/qbee-agent/app.Version=$(QBEE_AGENT_VERSION) \
+	-X github.com/qbee-io/qbee-agent/app.Commit=$(QBEE_AGENT_COMMIT_ID) \
+	-X github.com/qbee-io/qbee-agent/app/binary.PublicSigningKey=$(QBEE_AGENT_PUBLIC_SIGNING_KEY)
+
+define QBEE_AGENT_INSTALL_TARGET_CMDS
+	$(INSTALL) -m 0755 $(@D)/bin/qbee-agent $(TARGET_DIR)/usr/bin/qbee-agent
+	$(INSTALL) -D -m 0600 $(@D)/package/share/ssl/ca.cert $(TARGET_DIR)/etc/qbee/ppkeys/ca.cert
+endef
+
+define QBEE_AGENT_INSTALL_INIT_SYSTEMD
+	$(INSTALL) -D -m 0644 $(@D)/package/init-scripts/systemd/qbee-agent.service \
+		$(TARGET_DIR)/usr/lib/systemd/system/qbee-agent.service
+endef
+
+define QBEE_AGENT_INSTALL_INIT_SYSV
+	$(INSTALL) -D -m 755 $(@D)/package/init-scripts/sysvinit/qbee-agent \
+		$(TARGET_DIR)/etc/init.d/S99qbee-agent
+endef
+
+define QBEE_AGENT_LINUX_CONFIG_FIXUPS
+	$(call KCONFIG_ENABLE_OPT,CONFIG_TUN)
+endef
+
+$(eval $(golang-package))
-- 
2.25.1

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

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

* Re: [Buildroot] [PATCH 1/1] package/qbee-agent: new package
  2023-11-10 10:45 Jon Henrik Bjørnstad via buildroot
@ 2023-11-10 14:35 ` yann.morin
  2023-11-10 17:14 ` Christian Stewart via buildroot
  1 sibling, 0 replies; 16+ messages in thread
From: yann.morin @ 2023-11-10 14:35 UTC (permalink / raw)
  To: Jon Henrik Bjørnstad; +Cc: Anisse Astier, Christian Stewart, buildroot

Jon, All,

On 2023-11-10 11:45 +0100, Jon Henrik Bjørnstad via buildroot spake thusly:
> This patch add qbee-agent, an open source device management software
> for Linux devices.
> 
> Signed-off-by: Jon Henrik Bjørnstad <jonhenrik@qbee.io>
> ---
[--SNIP--]
> diff --git a/package/qbee-agent/Config.in b/package/qbee-agent/Config.in
> new file mode 100644
> index 0000000000..c35eabff91
> --- /dev/null
> +++ b/package/qbee-agent/Config.in
> @@ -0,0 +1,18 @@
> +config BR2_PACKAGE_QBEE_AGENT
> +	bool "qbee-agent"
> +	depends on BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
> +	select BR2_PACKAGE_OPENSSH if !BR2_PACKAGE_DROPBEAR_CLIENT # runtime
> +	select BR2_PACKAGE_IPTABLES # runtime
> +	select BR2_PACKAGE_BUSYBOX_SHOW_OTHERS # runtime
> +	select BR2_PACKAGE_SHADOW # runtime
> +	select BR2_PACKAGE_BASH # runtime
> +	help
> +	  Qbee is a device management platform that comprise
> +	  of an open-source agent and a hosted SaaS backend.

Is there a public implementation for that backend?

> +	  This config installs pre-built static binaries made

That is no longer the case. ;-)

> +	  with the official public signing key for qbee.io. The
> +	  binaries will work seamlessly with the qbee.io device
> +	  management backend.

See below for that key...

[--SNIP--]
> diff --git a/package/qbee-agent/qbee-agent.mk b/package/qbee-agent/qbee-agent.mk
> new file mode 100644
> index 0000000000..f568372e01
> --- /dev/null
> +++ b/package/qbee-agent/qbee-agent.mk
> @@ -0,0 +1,39 @@
> +################################################################################
> +#
> +# qbee-agent package
> +#
> +################################################################################
> +
> +QBEE_AGENT_VERSION = 2023.44
> +QBEE_AGENT_SITE = $(call github,qbee-io,qbee-agent,$(QBEE_AGENT_VERSION))
> +QBEE_AGENT_LICENSE = Apache-2.0
> +QBEE_AGENT_LICENSE_FILES = LICENSE
> +
> +QBEE_AGENT_COMMIT_ID = 582900356222860bfc40567ea359941c9d34f499

Why is the commit hash important? How can we ensure that, in a future
version bump in QBEE_AGENT_VERSION, we ensure the commit hash is
updated? Can we use the _VERSION instead of the hash?

As far as I can see, it is only used to set app.Commit, which in turn is
only used to display that to the user, in addition to the version
string. So, that does not seem very important, and re-using _VERSION
looks like it would be OK, as it is a tag.

> +QBEE_AGENT_PUBLIC_SIGNING_KEY = z5mUFaW-3t3WRIjkUr2dVOzPgGw3oyR-tzBlInGfz44.EJExLiJex1X7nT7p6XTxO8kjmGkv6ik60XMzvMe-87g

What is this key valid for?

I can see that it is different from the one on github:

    https://github.com/qbee-io/qbee-agent/blob/main/Makefile#L10

    PUBLIC_SIGNING_KEY=xSHbUBG7LTuNfXd3zod4EX8_Es8FTCINgrjvx1WXFE4.plCHzlDAeb3IWW1wK6P6paMRYO4f8qceV3lrNCqNpWo

Can we extract the key from the Makefile rather than have our own here?

Also, the comment just above that key states "For production release, it
must be replaced with the correct public key". How can this be achieved
in the context of Buildroot? Or is the one you provided the actual
production public key?

My previous suggestion was to give the user the option to provide their
own key. Why can't we do that?

> +QBEE_AGENT_LDFLAGS = -s -w \
> +	-X github.com/qbee-io/qbee-agent/app.Version=$(QBEE_AGENT_VERSION) \
> +	-X github.com/qbee-io/qbee-agent/app.Commit=$(QBEE_AGENT_COMMIT_ID) \
> +	-X github.com/qbee-io/qbee-agent/app/binary.PublicSigningKey=$(QBEE_AGENT_PUBLIC_SIGNING_KEY)
> +
> +define QBEE_AGENT_INSTALL_TARGET_CMDS
> +	$(INSTALL) -m 0755 $(@D)/bin/qbee-agent $(TARGET_DIR)/usr/bin/qbee-agent

That part shoud not be necessary, as this is the default of the
golang-package infra [0]; you just need to install the .cert as a
post-install hook:

    define QBEE_AGENT_INSTALL_CERT
        $(INSTALL) -D -m 0600 $(@D)/package/share/ssl/ca.cert $(TARGET_DIR)/etc/qbee/ppkeys/ca.cert
    endef
    QBEE_AGENT_POST_TARGET_INSTALL_HOOKS += QBEE_AGENT_INSTALL_CERT

[0] https://buildroot.org/downloads/manual/manual.html#_infrastructure_for_go_packages

> +	$(INSTALL) -D -m 0600 $(@D)/package/share/ssl/ca.cert $(TARGET_DIR)/etc/qbee/ppkeys/ca.cert
> +endef
> +
> +define QBEE_AGENT_INSTALL_INIT_SYSTEMD
> +	$(INSTALL) -D -m 0644 $(@D)/package/init-scripts/systemd/qbee-agent.service \
> +		$(TARGET_DIR)/usr/lib/systemd/system/qbee-agent.service
> +endef
> +
> +define QBEE_AGENT_INSTALL_INIT_SYSV
> +	$(INSTALL) -D -m 755 $(@D)/package/init-scripts/sysvinit/qbee-agent \
> +		$(TARGET_DIR)/etc/init.d/S99qbee-agent
> +endef
> +
> +define QBEE_AGENT_LINUX_CONFIG_FIXUPS
> +	$(call KCONFIG_ENABLE_OPT,CONFIG_TUN)
> +endef

Why is TUN needed inthe kernel?

Do not hesitate to explain things in the commit log, even if they look
trivial to you ; even just a little sentence is OK (e.g. totally made-up
justification: "TUN is needed beacuse qbee-agent creates a vpn-like
tunnel to the server and routes all the communications through that
tunnel").

So, now I think the package is quite OK as per the Buildroot coding
rules 👍, with only vert minor thins (comment in Config.in, dropping
_COMMIT_HASH, commit log with a bit more explanations).

The rest of the questions mostly revolve around the key, and how we can
manage that.

Regards,
Yann E. MORIN.

> +$(eval $(golang-package))
> -- 
> 2.25.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
                                        ____________
.-----------------.--------------------:       _    :------------------.
|  Yann E. MORIN  | Real-Time Embedded |    __/ )   | /"\ ASCII RIBBON |
|                 | Software  Designer |  _/ - /'   | \ / CAMPAIGN     |
| +33 638.411.245 '--------------------: (_    `--, |  X  AGAINST      |
| yann.morin (at) orange.com           |_="    ,--' | / \ HTML MAIL    |
'--------------------------------------:______/_____:------------------'

____________________________________________________________________________________________________________
Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc
pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler
a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration,
Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.

This message and its attachments may contain confidential or privileged information that may be protected by law;
they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete this message and its attachments.
As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified.
Thank you.
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH 1/1] package/qbee-agent: new package
  2023-11-10 10:45 Jon Henrik Bjørnstad via buildroot
  2023-11-10 14:35 ` yann.morin
@ 2023-11-10 17:14 ` Christian Stewart via buildroot
  2023-11-10 19:28   ` Arnout Vandecappelle via buildroot
  1 sibling, 1 reply; 16+ messages in thread
From: Christian Stewart via buildroot @ 2023-11-10 17:14 UTC (permalink / raw)
  To: Jon Henrik Bjørnstad; +Cc: Anisse Astier, Buildroot Mailing List


[-- Attachment #1.1: Type: text/plain, Size: 1066 bytes --]

Hi all,


On Fri, Nov 10, 2023, 2:45 AM Jon Henrik Bjørnstad <jonhenrik@qbee.io>
wrote:

> This patch add qbee-agent, an open source device management software
> for Linux devices.
>

Are there any buildroot users today who would want to install this package
with it's proprietary backend independently of using the proprietary
backend?

Who holds the private key for that public key and what can they then do
with my device if I chose to install this package?

This seems like a case where, if I was adding this package for a
proprietary service, I would instead opt to use a Buildroot External
Package for the reasons stated above:

https://buildroot.org/downloads/manual/customize-outside-br.txt

Indeed: there are many cases like this one where I'll maintain an external
buildroot extensions tree because the packages are not fully open source
(backend and frontend) and therefore probably not of interest to the main
buildroot user base.

For a counter example to this see Mender and Balena Engine.

Thanks,
Christian Stewart

[-- Attachment #1.2: Type: text/html, Size: 1760 bytes --]

[-- Attachment #2: Type: text/plain, Size: 150 bytes --]

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

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

* Re: [Buildroot] [PATCH 1/1] package/qbee-agent: new package
  2023-11-09 10:25 ` Thomas Petazzoni via buildroot
@ 2023-11-10 18:56   ` Arnout Vandecappelle via buildroot
  2023-11-13  9:06     ` Thomas Petazzoni via buildroot
  0 siblings, 1 reply; 16+ messages in thread
From: Arnout Vandecappelle via buildroot @ 2023-11-10 18:56 UTC (permalink / raw)
  To: Thomas Petazzoni, Jon Henrik Bjørnstad via buildroot
  Cc: Jon Henrik Bjørnstad



On 09/11/2023 11:25, Thomas Petazzoni via buildroot wrote:
>> +	$(INSTALL) -d -m 0700 $(TARGET_DIR)/etc/qbee/ppkeys
> No need to do this...
> 
>> +	$(INSTALL) -m 0600 $(@D)/qbee-agent-$(QBEE_AGENT_VERSION)/share/ssl/ca.cert $(TARGET_DIR)/etc/qbee/ppkeys/ca.cert
> ... just add -D as an option here, which will create all needed
> destination directories.

  No, with -D, the mode of the directory will be 0755 instead of 0700, so you 
want to create the directory explicitly here (that is, assuming that 0700 is the 
proper mode for the directory, but for something called "ppkeys" it sounds that 
that would be the case.

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

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

* Re: [Buildroot] [PATCH 1/1] package/qbee-agent: new package
  2023-11-10 17:14 ` Christian Stewart via buildroot
@ 2023-11-10 19:28   ` Arnout Vandecappelle via buildroot
  2023-11-11  8:35     ` Yann E. MORIN
  0 siblings, 1 reply; 16+ messages in thread
From: Arnout Vandecappelle via buildroot @ 2023-11-10 19:28 UTC (permalink / raw)
  To: Christian Stewart, Jon Henrik Bjørnstad
  Cc: Anisse Astier, Buildroot Mailing List



On 10/11/2023 18:14, Christian Stewart via buildroot wrote:
> Hi all,
> 
> 
> On Fri, Nov 10, 2023, 2:45 AM Jon Henrik Bjørnstad <jonhenrik@qbee.io 
> <mailto:jonhenrik@qbee.io>> wrote:
> 
>     This patch add qbee-agent, an open source device management software
>     for Linux devices.
> 
> 
> Are there any buildroot users today who would want to install this package with 
> it's proprietary backend independently of using the proprietary backend?
> 
> Who holds the private key for that public key and what can they then do with my 
> device if I chose to install this package?
> 
> This seems like a case where, if I was adding this package for a proprietary 
> service, I would instead opt to use a Buildroot External Package for the reasons 
> stated above:
> 
> https://buildroot.org/downloads/manual/customize-outside-br.txt 
> <https://buildroot.org/downloads/manual/customize-outside-br.txt>
> 
> Indeed: there are many cases like this one where I'll maintain an external 
> buildroot extensions tree because the packages are not fully open source 
> (backend and frontend) and therefore probably not of interest to the main 
> buildroot user base.

  I don't think "open source agent for a closed-source backend" means that we 
don't want to carry it in buildroot. In fact, we have at least one of those 
already: azure-iot-sdk-c. I'm sure there are others.


  Regards,
  Arnout

> 
> For a counter example to this see Mender and Balena Engine.
> 
> Thanks,
> Christian Stewart
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH 1/1] package/qbee-agent: new package
  2023-11-10 19:28   ` Arnout Vandecappelle via buildroot
@ 2023-11-11  8:35     ` Yann E. MORIN
  0 siblings, 0 replies; 16+ messages in thread
From: Yann E. MORIN @ 2023-11-11  8:35 UTC (permalink / raw)
  To: Arnout Vandecappelle
  Cc: Buildroot Mailing List, Jon Henrik Bjørnstad,
	Christian Stewart, Anisse Astier

Arnout, Christian, Jon, All,

On 2023-11-10 20:28 +0100, Arnout Vandecappelle via buildroot spake thusly:
> On 10/11/2023 18:14, Christian Stewart via buildroot wrote:
> >On Fri, Nov 10, 2023, 2:45 AM Jon Henrik Bjørnstad <jonhenrik@qbee.io
> ><mailto:jonhenrik@qbee.io>> wrote:
> >    This patch add qbee-agent, an open source device management software
> >    for Linux devices.
> >Are there any buildroot users today who would want to install this package
> >with it's proprietary backend independently of using the proprietary
> >backend?
> >
> >Who holds the private key for that public key and what can they then do
> >with my device if I chose to install this package?

Those are valid questions, but they are to the user who builds a rootfs
with qbee-agent to assess. If they _need_ qbee-agent (for whatever
reason, good or bad), then it is available in Buildroot.

As Yann@work pointed out however, is that we need to have a little
explanation on what the key is, and whether users may need to have their
own, and why the key provided in this patch differs from the one in the
github repo, and what the comment in the github repo is about.

> >This seems like a case where, if I was adding this package for a
> >proprietary service, I would instead opt to use a Buildroot External
> >Package for the reasons stated above:
> >https://buildroot.org/downloads/manual/customize-outside-br.txt
> ><https://buildroot.org/downloads/manual/customize-outside-br.txt>

Not really. br2-external trees are made for packages one does not want
to be public, i.e. the packages themselves are internal to one's org.

> >Indeed: there are many cases like this one where I'll maintain an external
> >buildroot extensions tree because the packages are not fully open source
> >(backend and frontend) and therefore probably not of interest to the main
> >buildroot user base.
>  I don't think "open source agent for a closed-source backend" means that we
> don't want to carry it in buildroot. In fact, we have at least one of those
> already: azure-iot-sdk-c. I'm sure there are others.

The point I was about to make.

It would be a bit sad indeed to not have a open source implementation fo
the server side, or that users can't specify an alternate provider (i.e.
choose to run their own), but that's orthogonal to having the client in
Buildroot.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH 1/1] package/qbee-agent: new package
  2023-11-10 18:56   ` Arnout Vandecappelle via buildroot
@ 2023-11-13  9:06     ` Thomas Petazzoni via buildroot
  0 siblings, 0 replies; 16+ messages in thread
From: Thomas Petazzoni via buildroot @ 2023-11-13  9:06 UTC (permalink / raw)
  To: Arnout Vandecappelle
  Cc: Jon Henrik Bjørnstad,
	Jon Henrik Bjørnstad via buildroot

On Fri, 10 Nov 2023 19:56:41 +0100
Arnout Vandecappelle <arnout@mind.be> wrote:

> >> +	$(INSTALL) -m 0600 $(@D)/qbee-agent-$(QBEE_AGENT_VERSION)/share/ssl/ca.cert $(TARGET_DIR)/etc/qbee/ppkeys/ca.cert  
> > ... just add -D as an option here, which will create all needed
> > destination directories.  
> 
>   No, with -D, the mode of the directory will be 0755 instead of 0700, so you 
> want to create the directory explicitly here (that is, assuming that 0700 is the 
> proper mode for the directory, but for something called "ppkeys" it sounds that 
> that would be the case.

Ah, indeed, makes sense!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* [Buildroot] [PATCH 1/1] package/qbee-agent: new package
  2024-03-05  9:38 [Buildroot] [PATCH 0/1] " Jon Henrik Bjørnstad via buildroot
@ 2024-03-05  9:38 ` Jon Henrik Bjørnstad via buildroot
  2024-05-12 10:05   ` Thomas Petazzoni via buildroot
  0 siblings, 1 reply; 16+ messages in thread
From: Jon Henrik Bjørnstad via buildroot @ 2024-03-05  9:38 UTC (permalink / raw)
  To: buildroot; +Cc: Jon Henrik Bjørnstad, Christian Stewart, Anisse Astier

This patch add qbee-agent, an open source device management software
for Linux devices.

Signed-off-by: Jon Henrik Bjørnstad <jonhenrik@qbee.io>
---
 DEVELOPERS                         |  3 +++
 package/Config.in                  |  1 +
 package/qbee-agent/Config.in       | 17 +++++++++++++++
 package/qbee-agent/qbee-agent.hash |  3 +++
 package/qbee-agent/qbee-agent.mk   | 35 ++++++++++++++++++++++++++++++
 5 files changed, 59 insertions(+)
 create mode 100644 package/qbee-agent/Config.in
 create mode 100644 package/qbee-agent/qbee-agent.hash
 create mode 100644 package/qbee-agent/qbee-agent.mk

diff --git a/DEVELOPERS b/DEVELOPERS
index 0bfe91f064..11fb24b78e 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1631,6 +1631,9 @@ F:	package/sdbusplus/
 N:	Jon Ringle <jringle@gridpoint.com>
 F:	package/mbpoll/
 
+N:	Jon Henrik Bjørnstad <jonhenrik@qbee.io>
+F:	package/qbee-agent/
+
 N:	Jonathan Ben Avraham <yba@tkos.co.il>
 F:	arch/Config.in.xtensa
 F:	package/autofs/
diff --git a/package/Config.in b/package/Config.in
index 33039331f7..fc5ffc4dba 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -2780,6 +2780,7 @@ menu "System tools"
 	source "package/procs/Config.in"
 	source "package/psmisc/Config.in"
 	source "package/pwgen/Config.in"
+	source "package/qbee-agent/Config.in"
 	source "package/quota/Config.in"
 	source "package/quotatool/Config.in"
 	source "package/rauc/Config.in"
diff --git a/package/qbee-agent/Config.in b/package/qbee-agent/Config.in
new file mode 100644
index 0000000000..02e35827ef
--- /dev/null
+++ b/package/qbee-agent/Config.in
@@ -0,0 +1,17 @@
+config BR2_PACKAGE_QBEE_AGENT
+	bool "qbee-agent"
+	depends on BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
+	select BR2_PACKAGE_IPTABLES # runtime
+	select BR2_PACKAGE_BUSYBOX_SHOW_OTHERS # runtime
+	select BR2_PACKAGE_SHADOW # runtime
+	select BR2_PACKAGE_BASH # runtime
+	help
+	  Qbee is a device management platform that comprise
+	  of an open-source agent and a hosted SaaS backend.
+	  This config installs pre-built static binaries made
+	  with the official public signing key for qbee.io. The
+	  binaries will work seamlessly with the qbee.io device
+	  management backend.
+
+	  https://github.com/qbee-io/qbee-agent
+	  https://qbee.io
diff --git a/package/qbee-agent/qbee-agent.hash b/package/qbee-agent/qbee-agent.hash
new file mode 100644
index 0000000000..1c6a361ff6
--- /dev/null
+++ b/package/qbee-agent/qbee-agent.hash
@@ -0,0 +1,3 @@
+# Locally calculated
+sha256  b1b5a6d4e18fbd8536d05616c632f10ef309d26036a19c5ce28d0635c45d8cab  qbee-agent-2024.09.tar.gz
+sha256  02d07d96be99eb042b01ba650079a440ce26a78c5e0e1e8060c33a8c9e200404  LICENSE
diff --git a/package/qbee-agent/qbee-agent.mk b/package/qbee-agent/qbee-agent.mk
new file mode 100644
index 0000000000..66037195c1
--- /dev/null
+++ b/package/qbee-agent/qbee-agent.mk
@@ -0,0 +1,35 @@
+################################################################################
+#
+# qbee-agent package
+#
+################################################################################
+
+QBEE_AGENT_VERSION = 2024.09
+QBEE_AGENT_SITE = $(call github,qbee-io,qbee-agent,$(QBEE_AGENT_VERSION))
+QBEE_AGENT_LICENSE = Apache-2.0
+QBEE_AGENT_LICENSE_FILES = LICENSE
+
+QBEE_AGENT_COMMIT_ID = c30d43b8e64cfef960cee9475b58ae083e4ad246
+
+QBEE_AGENT_GOMOD = go.qbee.io/agent
+
+QBEE_AGENT_LDFLAGS = -s -w \
+	-X $(QBEE_AGENT_GOMOD)/app.Version=$(QBEE_AGENT_VERSION) \
+	-X $(QBEE_AGENT_GOMOD)/app.Commit=$(QBEE_AGENT_COMMIT_ID)
+
+define QBEE_AGENT_INSTALL_TARGET_CMDS
+	$(INSTALL) -m 0755 $(@D)/bin/qbee-agent $(TARGET_DIR)/usr/bin/qbee-agent
+	$(INSTALL) -D -m 0600 $(@D)/package/share/ssl/ca.cert $(TARGET_DIR)/etc/qbee/ppkeys/ca.cert
+endef
+
+define QBEE_AGENT_INSTALL_INIT_SYSTEMD
+	$(INSTALL) -D -m 0644 $(@D)/package/init-scripts/systemd/qbee-agent.service \
+		$(TARGET_DIR)/usr/lib/systemd/system/qbee-agent.service
+endef
+
+define QBEE_AGENT_INSTALL_INIT_SYSV
+	$(INSTALL) -D -m 755 $(@D)/package/init-scripts/sysvinit/qbee-agent \
+		$(TARGET_DIR)/etc/init.d/S99qbee-agent
+endef
+
+$(eval $(golang-package))
-- 
2.25.1

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

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

* Re: [Buildroot] [PATCH 1/1] package/qbee-agent: new package
  2024-03-05  9:38 ` [Buildroot] [PATCH 1/1] " Jon Henrik Bjørnstad via buildroot
@ 2024-05-12 10:05   ` Thomas Petazzoni via buildroot
  2024-05-16 11:00     ` Jon Henrik Bjørnstad via buildroot
  0 siblings, 1 reply; 16+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-05-12 10:05 UTC (permalink / raw)
  To: Jon Henrik Bjørnstad via buildroot
  Cc: Christian Stewart, Jon Henrik Bjørnstad, Anisse Astier

Hello Jon,

Thanks for your patch, and sorry for the long delay in getting back to
you. I have applied your patch, with some fixes (see below).

On Tue,  5 Mar 2024 10:38:39 +0100
Jon Henrik Bjørnstad via buildroot <buildroot@buildroot.org> wrote:

> diff --git a/package/qbee-agent/Config.in b/package/qbee-agent/Config.in
> new file mode 100644
> index 0000000000..02e35827ef
> --- /dev/null
> +++ b/package/qbee-agent/Config.in
> @@ -0,0 +1,17 @@
> +config BR2_PACKAGE_QBEE_AGENT
> +	bool "qbee-agent"
> +	depends on BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
> +	select BR2_PACKAGE_IPTABLES # runtime
> +	select BR2_PACKAGE_BUSYBOX_SHOW_OTHERS # runtime
> +	select BR2_PACKAGE_SHADOW # runtime
> +	select BR2_PACKAGE_BASH # runtime

When you select something, you need to replicate the "depends on" of
the thing you are selecting. So here:

+       depends on BR2_USE_MMU # bash
+       depends on !BR2_STATIC_LIBS # shadow
+       depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_14 # shadow

> +	help
> +	  Qbee is a device management platform that comprise
> +	  of an open-source agent and a hosted SaaS backend.
> +	  This config installs pre-built static binaries made
> +	  with the official public signing key for qbee.io. The
> +	  binaries will work seamlessly with the qbee.io device
> +	  management backend.
> +
> +	  https://github.com/qbee-io/qbee-agent
> +	  https://qbee.io

And you need to add a Config.in comment about those dependencies:

+comment "qbee-agent needs a toolchain w/ headers >= 4.14, dynamic library"
+       depends on BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
+       depends on BR2_USE_MMU
+       depends on BR2_STATIC_LIBS || \
+               !BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_14

> diff --git a/package/qbee-agent/qbee-agent.hash b/package/qbee-agent/qbee-agent.hash
> new file mode 100644
> index 0000000000..1c6a361ff6
> --- /dev/null
> +++ b/package/qbee-agent/qbee-agent.hash
> @@ -0,0 +1,3 @@
> +# Locally calculated
> +sha256  b1b5a6d4e18fbd8536d05616c632f10ef309d26036a19c5ce28d0635c45d8cab  qbee-agent-2024.09.tar.gz

I had to update the hash and the filename, due to the recent changes in
the download infrastructure (not your fault, the changes were committed
very recently).

> +sha256  02d07d96be99eb042b01ba650079a440ce26a78c5e0e1e8060c33a8c9e200404  LICENSE
> diff --git a/package/qbee-agent/qbee-agent.mk b/package/qbee-agent/qbee-agent.mk
> new file mode 100644
> index 0000000000..66037195c1
> --- /dev/null
> +++ b/package/qbee-agent/qbee-agent.mk
> @@ -0,0 +1,35 @@
> +################################################################################
> +#
> +# qbee-agent package
> +#
> +################################################################################
> +
> +QBEE_AGENT_VERSION = 2024.09

Added a comment above this line, saying that QBEE_AGENT_COMMIT_ID
should be kept in sync.

> +QBEE_AGENT_SITE = $(call github,qbee-io,qbee-agent,$(QBEE_AGENT_VERSION))
> +QBEE_AGENT_LICENSE = Apache-2.0
> +QBEE_AGENT_LICENSE_FILES = LICENSE
> +
> +QBEE_AGENT_COMMIT_ID = c30d43b8e64cfef960cee9475b58ae083e4ad246
> +
> +QBEE_AGENT_GOMOD = go.qbee.io/agent
> +
> +QBEE_AGENT_LDFLAGS = -s -w \
> +	-X $(QBEE_AGENT_GOMOD)/app.Version=$(QBEE_AGENT_VERSION) \
> +	-X $(QBEE_AGENT_GOMOD)/app.Commit=$(QBEE_AGENT_COMMIT_ID)
> +
> +define QBEE_AGENT_INSTALL_TARGET_CMDS
> +	$(INSTALL) -m 0755 $(@D)/bin/qbee-agent $(TARGET_DIR)/usr/bin/qbee-agent
> +	$(INSTALL) -D -m 0600 $(@D)/package/share/ssl/ca.cert $(TARGET_DIR)/etc/qbee/ppkeys/ca.cert
> +endef

As suggested by Yann E. Morin in a previous iteration, I dropped the
installation of the binary from there, and turned this into a
post-install target hook. Indeed, the golang-package infrastructure
already takes care of installing the binary.

Thanks a lot!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH 1/1] package/qbee-agent: new package
  2024-05-12 10:05   ` Thomas Petazzoni via buildroot
@ 2024-05-16 11:00     ` Jon Henrik Bjørnstad via buildroot
  0 siblings, 0 replies; 16+ messages in thread
From: Jon Henrik Bjørnstad via buildroot @ 2024-05-16 11:00 UTC (permalink / raw)
  To: Thomas Petazzoni
  Cc: Anisse Astier, Christian Stewart,
	Jon Henrik Bjørnstad via buildroot


[-- Attachment #1.1: Type: text/plain, Size: 4638 bytes --]

Hi Thomas,

Thank you very much for the feedback and reviewing my patch. As this patch
was for an older version of the qbee-agent, I have today submitted a patch
to bump the version.

With kind regards,

Jon Henrik Bjørnstad

On Sun, May 12, 2024 at 12:05 PM Thomas Petazzoni <
thomas.petazzoni@bootlin.com> wrote:

> Hello Jon,
>
> Thanks for your patch, and sorry for the long delay in getting back to
> you. I have applied your patch, with some fixes (see below).
>
> On Tue,  5 Mar 2024 10:38:39 +0100
> Jon Henrik Bjørnstad via buildroot <buildroot@buildroot.org> wrote:
>
> > diff --git a/package/qbee-agent/Config.in b/package/qbee-agent/Config.in
> > new file mode 100644
> > index 0000000000..02e35827ef
> > --- /dev/null
> > +++ b/package/qbee-agent/Config.in
> > @@ -0,0 +1,17 @@
> > +config BR2_PACKAGE_QBEE_AGENT
> > +     bool "qbee-agent"
> > +     depends on BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
> > +     select BR2_PACKAGE_IPTABLES # runtime
> > +     select BR2_PACKAGE_BUSYBOX_SHOW_OTHERS # runtime
> > +     select BR2_PACKAGE_SHADOW # runtime
> > +     select BR2_PACKAGE_BASH # runtime
>
> When you select something, you need to replicate the "depends on" of
> the thing you are selecting. So here:
>
> +       depends on BR2_USE_MMU # bash
> +       depends on !BR2_STATIC_LIBS # shadow
> +       depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_14 # shadow
>
> > +     help
> > +       Qbee is a device management platform that comprise
> > +       of an open-source agent and a hosted SaaS backend.
> > +       This config installs pre-built static binaries made
> > +       with the official public signing key for qbee.io. The
> > +       binaries will work seamlessly with the qbee.io device
> > +       management backend.
> > +
> > +       https://github.com/qbee-io/qbee-agent
> > +       https://qbee.io
>
> And you need to add a Config.in comment about those dependencies:
>
> +comment "qbee-agent needs a toolchain w/ headers >= 4.14, dynamic library"
> +       depends on BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
> +       depends on BR2_USE_MMU
> +       depends on BR2_STATIC_LIBS || \
> +               !BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_14
>
> > diff --git a/package/qbee-agent/qbee-agent.hash
> b/package/qbee-agent/qbee-agent.hash
> > new file mode 100644
> > index 0000000000..1c6a361ff6
> > --- /dev/null
> > +++ b/package/qbee-agent/qbee-agent.hash
> > @@ -0,0 +1,3 @@
> > +# Locally calculated
> > +sha256
> b1b5a6d4e18fbd8536d05616c632f10ef309d26036a19c5ce28d0635c45d8cab
> qbee-agent-2024.09.tar.gz
>
> I had to update the hash and the filename, due to the recent changes in
> the download infrastructure (not your fault, the changes were committed
> very recently).
>
> > +sha256
> 02d07d96be99eb042b01ba650079a440ce26a78c5e0e1e8060c33a8c9e200404  LICENSE
> > diff --git a/package/qbee-agent/qbee-agent.mk b/package/qbee-agent/
> qbee-agent.mk
> > new file mode 100644
> > index 0000000000..66037195c1
> > --- /dev/null
> > +++ b/package/qbee-agent/qbee-agent.mk
> > @@ -0,0 +1,35 @@
> >
> +################################################################################
> > +#
> > +# qbee-agent package
> > +#
> >
> +################################################################################
> > +
> > +QBEE_AGENT_VERSION = 2024.09
>
> Added a comment above this line, saying that QBEE_AGENT_COMMIT_ID
> should be kept in sync.
>
> > +QBEE_AGENT_SITE = $(call
> github,qbee-io,qbee-agent,$(QBEE_AGENT_VERSION))
> > +QBEE_AGENT_LICENSE = Apache-2.0
> > +QBEE_AGENT_LICENSE_FILES = LICENSE
> > +
> > +QBEE_AGENT_COMMIT_ID = c30d43b8e64cfef960cee9475b58ae083e4ad246
> > +
> > +QBEE_AGENT_GOMOD = go.qbee.io/agent
> > +
> > +QBEE_AGENT_LDFLAGS = -s -w \
> > +     -X $(QBEE_AGENT_GOMOD)/app.Version=$(QBEE_AGENT_VERSION) \
> > +     -X $(QBEE_AGENT_GOMOD)/app.Commit=$(QBEE_AGENT_COMMIT_ID)
> > +
> > +define QBEE_AGENT_INSTALL_TARGET_CMDS
> > +     $(INSTALL) -m 0755 $(@D)/bin/qbee-agent
> $(TARGET_DIR)/usr/bin/qbee-agent
> > +     $(INSTALL) -D -m 0600 $(@D)/package/share/ssl/ca.cert
> $(TARGET_DIR)/etc/qbee/ppkeys/ca.cert
> > +endef
>
> As suggested by Yann E. Morin in a previous iteration, I dropped the
> installation of the binary from there, and turned this into a
> post-install target hook. Indeed, the golang-package infrastructure
> already takes care of installing the binary.
>
> Thanks a lot!
>
> Thomas
> --
> Thomas Petazzoni, co-owner and CEO, Bootlin
> Embedded Linux and Kernel engineering and training
> https://bootlin.com
>

[-- Attachment #1.2: Type: text/html, Size: 6201 bytes --]

[-- Attachment #2: Type: text/plain, Size: 150 bytes --]

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

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

end of thread, other threads:[~2024-05-16 11:01 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-09  8:09 [Buildroot] [PATCH 1/1] package/qbee-agent: new package Jon Henrik Bjørnstad via buildroot
2023-11-09 10:25 ` Thomas Petazzoni via buildroot
2023-11-10 18:56   ` Arnout Vandecappelle via buildroot
2023-11-13  9:06     ` Thomas Petazzoni via buildroot
  -- strict thread matches above, loose matches on Subject: below --
2023-11-09 14:20 [Buildroot] [PATCH 0/1] Regarding review of qbee-agent patch Jon Henrik Bjørnstad via buildroot
2023-11-09 14:20 ` [Buildroot] [PATCH 1/1] package/qbee-agent: new package Jon Henrik Bjørnstad via buildroot
2023-11-09 16:03   ` yann.morin
2023-11-10  8:43     ` Jon Henrik Bjørnstad via buildroot
2023-11-10  9:39       ` yann.morin
2023-11-10 10:45 Jon Henrik Bjørnstad via buildroot
2023-11-10 14:35 ` yann.morin
2023-11-10 17:14 ` Christian Stewart via buildroot
2023-11-10 19:28   ` Arnout Vandecappelle via buildroot
2023-11-11  8:35     ` Yann E. MORIN
2024-03-05  9:38 [Buildroot] [PATCH 0/1] " Jon Henrik Bjørnstad via buildroot
2024-03-05  9:38 ` [Buildroot] [PATCH 1/1] " Jon Henrik Bjørnstad via buildroot
2024-05-12 10:05   ` Thomas Petazzoni via buildroot
2024-05-16 11:00     ` Jon Henrik Bjørnstad via buildroot

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