[Buildroot] [PATCH 1/1] package/qbee-agent: new package

yann.morin at orange.com yann.morin at orange.com
Fri Nov 10 09:39:50 UTC 2023


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 at 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 at 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 at 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 at buildroot.org
> 9. https://lists.buildroot.org/mailman/listinfo/buildroot
> 10. http://orange.com

> _______________________________________________
> buildroot mailing list
> buildroot at 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.


More information about the buildroot mailing list