All of lore.kernel.org
 help / color / mirror / Atom feed
From: aduskett at gmail.com <aduskett@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 4/4] package/mender: add support for update modules
Date: Wed, 15 Jul 2020 10:37:07 -0700	[thread overview]
Message-ID: <20200715173707.584226-4-aduskett@gmail.com> (raw)
In-Reply-To: <20200715173707.584226-1-aduskett@gmail.com>

From: Adam Duskett <Aduskett@gmail.com>

Mender has support for performing other types of updates other than just
overwriting the rootfs partition that isn't currently in use on the target.

Some of the default provided modules provide support for:
  - Updating a docker container.
  - Running a script.
  - Installing an RPM.
  - Overwriting a directory.
  - Updating a single-file.

The single-file update module is used by upstream for onboarding a new device
to a server, and this fails with Buildroot devices because the modules are
currently not installed.

Install the directory, script, and single-file modules by default, and
install the docker or rpm script if their respective packages are selected.

Signed-off-by: Adam Duskett <Aduskett@gmail.com>
---
 package/mender/mender.mk | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/package/mender/mender.mk b/package/mender/mender.mk
index 2faf3fe980..7d3fe877ce 100644
--- a/package/mender/mender.mk
+++ b/package/mender/mender.mk
@@ -37,6 +37,9 @@ MENDER_DEPENDENCIES = xz
 
 MENDER_LDFLAGS = -X main.Version=$(MENDER_VERSION)
 
+MENDER_UPDATE_MODULES_FILES = directory script single-file
+MENDER_UPDATE_MODULES_FILES += $(if $(BR2_PACKAGE_DOCKER_CLI),docker)
+MENDER_UPDATE_MODULES_FILES +=  $(if $(BR2_PACKAGE_RPM),rpm)
 define MENDER_INSTALL_CONFIG_FILES
 	$(INSTALL) -d -m 755 $(TARGET_DIR)/etc/mender/scripts
 	echo -n "3" > $(TARGET_DIR)/etc/mender/scripts/version
@@ -61,6 +64,10 @@ define MENDER_INSTALL_CONFIG_FILES
 
 	mkdir -p $(TARGET_DIR)/var/lib
 	ln -snf /var/run/mender $(TARGET_DIR)/var/lib/mender
+	$(foreach f,$(MENDER_UPDATE_MODULES_FILES), \
+		$(INSTALL) -D -m 0755 $(@D)/support/modules/$(notdir $(f)) \
+			$(TARGET_DIR)/usr/share/mender/modules/v3/$(notdir $(f))
+	)
 endef
 
 MENDER_POST_INSTALL_TARGET_HOOKS += MENDER_INSTALL_CONFIG_FILES
-- 
2.26.2

  parent reply	other threads:[~2020-07-15 17:37 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-15 17:37 [Buildroot] [PATCH 1/4] package/mender-artifact: bump version to 3.4.0 aduskett at gmail.com
2020-07-15 17:37 ` [Buildroot] [PATCH 2/4] package/mender: bump version to 2.3.0 aduskett at gmail.com
2020-07-15 17:37 ` [Buildroot] [PATCH 3/4] package/mender: set the default script version to 3 aduskett at gmail.com
2020-07-15 17:37 ` aduskett at gmail.com [this message]
2020-07-15 21:50 ` [Buildroot] [PATCH 1/4] package/mender-artifact: bump version to 3.4.0 Thomas Petazzoni
2020-07-17 12:51 ` Thomas Petazzoni
2020-08-06 10:57   ` Mirza Krak
2020-08-06 12:41     ` Mirza Krak
2020-08-11 21:58 ` Thomas Petazzoni
2020-08-12  2:26   ` Christian Stewart
2020-08-12  8:22     ` Thomas Petazzoni
2020-08-13 18:52       ` Adam Duskett
2020-08-13 19:39         ` Christian Stewart
2020-08-13 20:04           ` Adam Duskett
2020-08-13 20:20             ` Christian Stewart
2020-08-13 21:41             ` Christian Stewart

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=20200715173707.584226-4-aduskett@gmail.com \
    --to=aduskett@gmail.com \
    --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.