summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEnrico Jorns <ejo@pengutronix.de>2017-03-20 12:36:26 +0100
committerMichael Olbrich <m.olbrich@pengutronix.de>2017-03-24 15:06:29 +0100
commitf571b354ee5c256d032265e9da5c9bd34a5935bb (patch)
tree24f1f05b1f2e5a78fc1ca78865a1bb24ce2da49a
parent184021c6255d080579543bda7a515b28c682710d (diff)
downloadptxdist-f571b354ee5c256d032265e9da5c9bd34a5935bb.tar.gz
ptxdist-f571b354ee5c256d032265e9da5c9bd34a5935bb.tar.xz
image-rauc: new package
This adds a default image recipe for building a RAUC update Bundle out of the systems rootfs. In order to sign your update (mandatory) you need to place a valid certificate and key file in your BSP. Their location is default they are currently expected to be located at: $(PTXDIST_PLATFORMCONFIGDIR)/config/rauc/rauc.key.pem (key) $(PTXDIST_PLATFORMCONFIGDIR)/config/rauc/rauc.cert.pem (cert) PTXdist will then create the bundle during a run of `ptxdist images`. Signed-off-by: Enrico Jorns <ejo@pengutronix.de> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rw-r--r--config/images/rauc.config17
-rw-r--r--platforms/image-rauc.in28
-rw-r--r--rules/image-rauc.make69
3 files changed, 114 insertions, 0 deletions
diff --git a/config/images/rauc.config b/config/images/rauc.config
new file mode 100644
index 000000000..fb43c7efb
--- /dev/null
+++ b/config/images/rauc.config
@@ -0,0 +1,17 @@
+image update.raucb {
+ rauc {
+ file root.tar.gz { image = "root.tgz" }
+ manifest = "
+ [update]
+ compatible=@RAUC_BUNDLE_COMPATIBLE@
+ version=@RAUC_BUNDLE_VERSION@
+ build=@RAUC_BUNDLE_BUILD@
+ description=@RAUC_BUNDLE_DESCRIPTION@
+
+ [image.rootfs]
+ filename=root.tar.gz
+ "
+ cert = "@RAUC_CERT@"
+ key = "@RAUC_KEY@"
+ }
+}
diff --git a/platforms/image-rauc.in b/platforms/image-rauc.in
new file mode 100644
index 000000000..71c6898ba
--- /dev/null
+++ b/platforms/image-rauc.in
@@ -0,0 +1,28 @@
+## SECTION=image2
+
+menuconfig IMAGE_RAUC
+ tristate
+ prompt "Generate RAUC Update Bundle"
+ select HOST_GENIMAGE
+ select HOST_RAUC
+ select IMAGE_ROOT_TGZ
+ help
+ This generates a RAUC update Bundle for the selected platform using
+ genimage.
+
+ By default, this will create a simple Bundle for updating a 'rootfs'
+ slot with the content from PTXdist's root file system .tgz image.
+
+ To customize the bundle, copy and adapt the genimage configuration
+ file rauc.config.
+
+if IMAGE_RAUC
+
+config IMAGE_RAUC_DESCRIPTION
+ prompt "RAUC Bundle Description"
+ string
+ default ""
+ help
+ Optional description that will be placed in the Bundles metadata.
+
+endif
diff --git a/rules/image-rauc.make b/rules/image-rauc.make
new file mode 100644
index 000000000..5f34909de
--- /dev/null
+++ b/rules/image-rauc.make
@@ -0,0 +1,69 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2017 by Enrico Joerns <e.joerns@pengutronix.de>
+# Copyright (C) 2016 by Michael Olbrich <m.olbrich@pengutronix.de>
+#
+# See CREDITS for details about who has contributed to this project.
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+IMAGE_PACKAGES-$(PTXCONF_IMAGE_RAUC) += image-rauc
+
+#
+# Paths and names
+#
+IMAGE_RAUC := image-rauc
+IMAGE_RAUC_DIR := $(BUILDDIR)/$(IMAGE_RAUC)
+IMAGE_RAUC_IMAGE := $(IMAGEDIR)/update.raucb
+IMAGE_RAUC_CONFIG := rauc.config
+
+# ----------------------------------------------------------------------------
+# Image
+# ----------------------------------------------------------------------------
+
+IMAGE_RAUC_KEY = $(PTXDIST_PLATFORMCONFIGDIR)/config/rauc/rauc.key.pem
+IMAGE_RAUC_CERT = $(PTXDIST_PLATFORMCONFIGDIR)/config/rauc/rauc.cert.pem
+
+IMAGE_RAUC_ENV := \
+ RAUC_BUNDLE_COMPATIBLE=$(PTXCONF_RAUC_COMPATIBLE) \
+ RAUC_BUNDLE_VERSION=$(PTXDIST_BSP_AUTOVERSION) \
+ RAUC_BUNDLE_BUILD=$(shell date +%FT%T%z) \
+ RAUC_BUNDLE_DESCRIPTION=$(PTXCONF_IMAGE_RAUC_DESCRIPTION) \
+ RAUC_KEY=$(IMAGE_RAUC_KEY) \
+ RAUC_CERT=$(IMAGE_RAUC_CERT)
+
+$(IMAGE_RAUC_IMAGE): $(IMAGE_RAUC_KEY) $(IMAGE_RAUC_CERT)
+ @$(call targetinfo)
+ @$(call image/genimage, IMAGE_RAUC)
+ @$(call finish)
+
+$(IMAGE_RAUC_KEY):
+ @echo
+ @echo "****************************************************************************"
+ @echo "******** Please place your signing key in config/rauc/rauc.key.pem. ********"
+ @echo "* *"
+ @echo "* Note: For test-purpose you can create one by running rauc-gen-certs.sh *"
+ @echo "* from the scripts/ folder of your PTXdist installation *"
+ @echo "****************************************************************************"
+ @echo
+ @echo
+ @exit 1
+
+$(IMAGE_RAUC_CERT):
+ @echo
+ @echo "****************************************************************************"
+ @echo "**** Please place your signing certificate in config/rauc/rauc.cert.pem. ***"
+ @echo "* *"
+ @echo "* Note: For test-purpose you can create one by running rauc-gen-certs.sh *"
+ @echo "* from the scripts/ folder of your PTXdist installation *"
+ @echo "****************************************************************************"
+ @echo
+ @echo
+ @exit 1
+
+# vim: syntax=make