All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnout Vandecappelle <arnout@mind.be>
To: buildroot@busybox.net
Subject: [Buildroot] [[PATCH v2 13/14] package/mender: add BR2_PACKAGE_MENDER_ARTIFACT_NAME option
Date: Sun, 21 Oct 2018 15:40:01 +0100	[thread overview]
Message-ID: <fd923bfd-85a2-2bf0-6edd-52a046ad1b30@mind.be> (raw)
In-Reply-To: <20180820130914.22377-14-mirza.krak@northern.tech>



On 20/08/2018 14:09, Mirza Krak wrote:
> ARTIFACT_NAME is used to set a unique string of the built artifact/image
> and this will be reported to the Mender managment server as "current
> software running".
> 
> The Mender managment server will skip updating device if the
> ARTIFACT_NAME is the same on the target device as in the Mender artifact
> and hence this name must be unique for every release.

 When a package needs some configuration, we don't usually add configure options
for it, but instead assume the user will create the necessary configuration
files in an overlay.

 In particular in this case, you probably want to generate it with a script that
looks at a git tag or something like that.

 This would be something good to document in the readme.txt that you were going
to write.

 If you want to deliver an out-of-the-box experience, you could create files
with some default values (which would normally get overwritten in the overlay).
But I'm not even sure we really want that.

 So I've marked this patch and the following one as Rejected.

 Regards,
 Arnout

> 
> Signed-off-by: Mirza Krak <mirza.krak@northern.tech>
> ---
>  package/mender/Config.in | 13 +++++++++++++
>  package/mender/mender.mk |  7 +++++++
>  2 files changed, 20 insertions(+)
> 
> diff --git a/package/mender/Config.in b/package/mender/Config.in
> index 853a472ea1..8a6359c906 100644
> --- a/package/mender/Config.in
> +++ b/package/mender/Config.in
> @@ -14,6 +14,19 @@ config BR2_PACKAGE_MENDER
>  
>  	  https://github.com/mendersoftware/mender
>  
> +if BR2_PACKAGE_MENDER
> +
> +config BR2_PACKAGE_MENDER_ARTIFACT_NAME
> +	string "Mender artifact name"
> +	help
> +	  The name of the image or update that will be built. This is
> +	  what the device will report that it is running, and different
> +	  updates must have different names.
> +
> +	  Will be stored in /etc/mender/artifact_info
> +
> +endif
> +
>  comment "mender needs a toolchain w/ threads"
>  	depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
>  	depends on BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS
> diff --git a/package/mender/mender.mk b/package/mender/mender.mk
> index a4b9c6ee85..0d4df3a763 100644
> --- a/package/mender/mender.mk
> +++ b/package/mender/mender.mk
> @@ -34,6 +34,10 @@ MENDER_LICENSE_FILES = \
>  
>  MENDER_LDFLAGS = -X main.Version=$(MENDER_VERSION)
>  
> +ifeq ($(call qstrip,$(BR2_PACKAGE_MENDER_ARTIFACT_NAME)),)
> +$(error Mender device type not set. Check your BR2_PACKAGE_MENDER_ARTIFACT_NAME setting)
> +endif
> +
>  define MENDER_INSTALL_CONFIG_FILES
>  	$(INSTALL) -d -m 755 $(TARGET_DIR)/data/mender
>  	$(INSTALL) -d -m 755 $(TARGET_DIR)/data/uboot
> @@ -55,6 +59,9 @@ define MENDER_INSTALL_CONFIG_FILES
>  	)
>  
>  	ln -sf /data/mender $(TARGET_DIR)/var/lib/mender
> +
> +	echo "artifact_name=$(call qstrip,$(BR2_PACKAGE_MENDER_ARTIFACT_NAME))" > \
> +		$(TARGET_DIR)/etc/mender/artifact_info
>  endef
>  
>  MENDER_POST_INSTALL_TARGET_HOOKS += MENDER_INSTALL_CONFIG_FILES
> 

  reply	other threads:[~2018-10-21 14:40 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-20 13:09 [Buildroot] [[PATCH v2 00/14] various improvements to package/mender Mirza Krak
2018-08-20 13:09 ` [Buildroot] [[PATCH v2 01/14] package/mender: fix install path for identity and inventory scripts Mirza Krak
2018-08-20 14:51   ` Thomas Petazzoni
2018-08-20 13:09 ` [Buildroot] [[PATCH v2 02/14] package/mender: provide sane values in mender.conf Mirza Krak
2018-08-20 14:51   ` Thomas Petazzoni
2018-08-20 13:09 ` [Buildroot] [[PATCH v2 03/14] package/mender: create directory structures required by the Mender client Mirza Krak
2018-08-20 13:15   ` Thomas Petazzoni
2018-08-20 13:35     ` Mirza Krak
2018-08-20 13:43       ` Mirza Krak
2018-08-20 14:31         ` Mirza Krak
2018-10-21 14:27           ` Arnout Vandecappelle
2018-08-20 13:09 ` [Buildroot] [[PATCH v2 04/14] package/mender: create directory containing Mender state script Mirza Krak
2018-08-20 14:51   ` Thomas Petazzoni
2018-08-20 13:09 ` [Buildroot] [[PATCH v2 05/14] package/mender: symlink /var/lib/mender -> /data/mender Mirza Krak
2018-08-20 18:36   ` Mirza Krak
2018-08-20 20:04     ` Thomas Petazzoni
2018-08-20 20:33       ` Mirza Krak
2018-10-21 14:36         ` Arnout Vandecappelle
2018-08-20 13:09 ` [Buildroot] [[PATCH v2 06/14] package/mender: select BR2_PACKAGE_UBOOT_TOOLS_FWPRINTENV Mirza Krak
2018-08-20 14:52   ` Thomas Petazzoni
2018-08-20 13:09 ` [Buildroot] [[PATCH v2 07/14] package/mender: select BR2_PACKAGE_CA_CERTIFICATES Mirza Krak
2018-08-20 14:54   ` Thomas Petazzoni
2018-08-20 18:33     ` Mirza Krak
2018-10-21 14:37       ` Arnout Vandecappelle
2018-08-20 13:09 ` [Buildroot] [[PATCH v2 08/14] package/mender: remove tenant.conf Mirza Krak
2018-08-20 15:15   ` Thomas Petazzoni
2018-08-20 13:09 ` [Buildroot] [[PATCH v2 09/14] package/mender: use inventory and identity script from upstream source Mirza Krak
2018-08-20 15:15   ` Thomas Petazzoni
2018-08-20 13:09 ` [Buildroot] [[PATCH v2 10/14] package/mender: update legal info Mirza Krak
2018-08-20 15:15   ` Thomas Petazzoni
2018-08-20 13:09 ` [Buildroot] [[PATCH v2 11/14] package/mender: set version in go linker Mirza Krak
2018-08-20 15:15   ` Thomas Petazzoni
2018-08-20 13:09 ` [Buildroot] [[PATCH v2 12/14] package/mender: use MENDER_PKGDIR to access local files Mirza Krak
2018-10-21 14:09   ` Thomas Petazzoni
2018-08-20 13:09 ` [Buildroot] [[PATCH v2 13/14] package/mender: add BR2_PACKAGE_MENDER_ARTIFACT_NAME option Mirza Krak
2018-10-21 14:40   ` Arnout Vandecappelle [this message]
2018-08-20 13:09 ` [Buildroot] [[PATCH v2 14/14] package/mender: add BR2_PACKAGE_MENDER_DEVICE_TYPE option Mirza Krak
2018-08-28 18:22 [Buildroot] [[PATCH v2 13/14] package/mender: add BR2_PACKAGE_MENDER_ARTIFACT_NAME option Niall Parker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fd923bfd-85a2-2bf0-6edd-52a046ad1b30@mind.be \
    --to=arnout@mind.be \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.