mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Enrico Jorns <ejo@pengutronix.de>
To: ptxdist@pengutronix.de
Cc: Enrico Jorns <ejo@pengutronix.de>, jlu@pengutronix.de
Subject: [ptxdist] [PATCH 2/3] image-rauc: new package
Date: Mon, 20 Mar 2017 12:36:26 +0100	[thread overview]
Message-ID: <20170320113627.25060-3-ejo@pengutronix.de> (raw)
In-Reply-To: <20170320113627.25060-1-ejo@pengutronix.de>

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>
---
 config/images/rauc.config | 17 ++++++++++++
 platforms/image-rauc.in   | 28 +++++++++++++++++++
 rules/image-rauc.make     | 69 +++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 114 insertions(+)
 create mode 100644 config/images/rauc.config
 create mode 100644 platforms/image-rauc.in
 create mode 100644 rules/image-rauc.make

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
-- 
2.11.0


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

  parent reply	other threads:[~2017-03-20 11:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-20 11:36 [ptxdist] [PATCHv2 0/3] Add basic support for the RAUC update tool Enrico Jorns
2017-03-20 11:36 ` [ptxdist] [PATCH 1/3] rauc: new package Enrico Jorns
2017-03-20 11:36 ` Enrico Jorns [this message]
2017-03-20 11:36 ` [ptxdist] [PATCH 3/3] scripts: add script that generates test certificates for RAUC Enrico Jorns
2017-03-24 14:34 ` [ptxdist] [PATCHv2 0/3] Add basic support for the RAUC update tool Michael Olbrich
2017-03-24 19:00   ` Alexander Dahl

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=20170320113627.25060-3-ejo@pengutronix.de \
    --to=ejo@pengutronix.de \
    --cc=jlu@pengutronix.de \
    --cc=ptxdist@pengutronix.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox