diff options
author | Roland Hieber <rhi@pengutronix.de> | 2023-11-14 23:07:08 +0100 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2023-11-17 19:42:44 +0100 |
commit | ae5c38009cceca58fb793c8de2c717f28dc31861 (patch) | |
tree | bdf44da15533bac60a6c9d16ca5f05938519a516 /rules/image-rauc.make | |
parent | 3755b5c3f2495516ffe9b55cfb28cd26e5b41b39 (diff) | |
download | ptxdist-ae5c38009cceca58fb793c8de2c717f28dc31861.tar.gz ptxdist-ae5c38009cceca58fb793c8de2c717f28dc31861.tar.xz |
image-rauc: pick up hook script if it exists
Introduce a new kconfig option to package a hook script into the RAUC
bundle and reference it in the manifest. Otherwise leave the [hooks]
section in the manifest empty. The hook script is searched
config/images/rauc-hooks.sh in the usual search locations. RAUC will
complain if a hook script is referenced but no hook script is found in
the image (i.e. IMAGE_RAUC_HOOK_SCRIPT is empty).
As hooks that should be called by RAUC need to be mentioned in the
manifest too (in the relevant slot or the [bundle] section), the image
config will still need to be forked by BSPs in order to adapt the
manifest for that use case. However, the mechanism to find the hook
script is then already in place, and can be used as-is.
Signed-off-by: Roland Hieber <rhi@pengutronix.de>
Message-Id: <20231114220708.2816211-1-rhi@pengutronix.de>
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'rules/image-rauc.make')
-rw-r--r-- | rules/image-rauc.make | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/rules/image-rauc.make b/rules/image-rauc.make index 23d8d83b5..e267e78c6 100644 --- a/rules/image-rauc.make +++ b/rules/image-rauc.make @@ -19,6 +19,10 @@ IMAGE_RAUC := image-rauc IMAGE_RAUC_DIR := $(BUILDDIR)/$(IMAGE_RAUC) IMAGE_RAUC_IMAGE := $(IMAGEDIR)/update.raucb IMAGE_RAUC_CONFIG := rauc.config +IMAGE_RAUC_HOOK_FILE := $(call ptx/in-path, PTXDIST_PATH, config/images/rauc-hooks.sh) + +$(call ptx/cfghash, IMAGE_RAUC, $(IMAGE_RAUC_HOOK_FILE)) +$(call ptx/cfghash-file, IMAGE_RAUC, $(IMAGE_RAUC_HOOK_FILE)) # ---------------------------------------------------------------------------- # Image @@ -36,6 +40,16 @@ ifdef PTXCONF_IMAGE_RAUC_BUNDLE_FORMAT_CRYPT IMAGE_RAUC_BUNDLE_FORMAT := "crypt" endif +ifdef PTXCONF_IMAGE_RAUC_HOOK +IMAGE_RAUC_ENV_HOOK = \ + RAUC_HOOK_FILE="file hooks.sh { image = \\"$(IMAGE_RAUC_HOOK_FILE)\\" }" \ + RAUC_HOOK_MANIFEST="filename=hooks.sh" +else +IMAGE_RAUC_ENV_HOOK = \ + RAUC_HOOK_FILE="" \ + RAUC_HOOK_MANIFEST="" +endif + IMAGE_RAUC_ENV = \ $(CODE_SIGNING_ENV) \ RAUC_BUNDLE_COMPATIBLE="$(call remove_quotes,$(PTXCONF_RAUC_COMPATIBLE))" \ @@ -43,6 +57,7 @@ IMAGE_RAUC_ENV = \ RAUC_BUNDLE_VERSION="$(call remove_quotes, $(PTXCONF_RAUC_BUNDLE_VERSION))" \ RAUC_BUNDLE_BUILD=$(call ptx/sh, date +%FT%T%z) \ RAUC_BUNDLE_DESCRIPTION=$(PTXCONF_IMAGE_RAUC_DESCRIPTION) \ + $(IMAGE_RAUC_ENV_HOOK) \ RAUC_KEY="$(shell cs_get_uri update)" \ RAUC_CERT="$(shell cs_get_uri update)" \ RAUC_KEYRING="$(shell cs_get_ca update)" \ |