mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH 0/2] Add basic support for RAUC update tool
@ 2016-11-24 11:37 Enrico Jorns
  2016-11-24 11:37 ` [ptxdist] [PATCH 1/2] rauc: new package Enrico Jorns
  2016-11-24 11:37 ` [ptxdist] [PATCH 2/2] rauc-image: " Enrico Jorns
  0 siblings, 2 replies; 4+ messages in thread
From: Enrico Jorns @ 2016-11-24 11:37 UTC (permalink / raw)
  To: ptxdist; +Cc: Enrico Jorns

These patches add recipes for the rauc update tool as well as a recipe for
creating basic update bundles using rauc and genimage.

Michael Olbrich (2):
  rauc: new package
  rauc-image: new package

 config/images/rauc.config                          | 15 ++++
 patches/rauc-2016-11-22-g513172c60272/autogen.sh   | 18 +++++
 platforms/image-rauc.in                            |  9 +++
 .../lib/systemd/system/rauc-mark-good.service      | 11 +++
 rules/host-rauc.in                                 |  8 ++
 rules/host-rauc.make                               | 32 ++++++++
 rules/image-rauc.make                              | 39 ++++++++++
 rules/rauc.in                                      | 24 ++++++
 rules/rauc.make                                    | 88 ++++++++++++++++++++++
 9 files changed, 244 insertions(+)
 create mode 100644 config/images/rauc.config
 create mode 100755 patches/rauc-2016-11-22-g513172c60272/autogen.sh
 create mode 100644 platforms/image-rauc.in
 create mode 100644 projectroot/lib/systemd/system/rauc-mark-good.service
 create mode 100644 rules/host-rauc.in
 create mode 100644 rules/host-rauc.make
 create mode 100644 rules/image-rauc.make
 create mode 100644 rules/rauc.in
 create mode 100644 rules/rauc.make

-- 
2.10.2


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ptxdist] [PATCH 1/2] rauc: new package
  2016-11-24 11:37 [ptxdist] [PATCH 0/2] Add basic support for RAUC update tool Enrico Jorns
@ 2016-11-24 11:37 ` Enrico Jorns
  2016-11-24 11:37 ` [ptxdist] [PATCH 2/2] rauc-image: " Enrico Jorns
  1 sibling, 0 replies; 4+ messages in thread
From: Enrico Jorns @ 2016-11-24 11:37 UTC (permalink / raw)
  To: ptxdist; +Cc: Michael Olbrich

From: Michael Olbrich <m.olbrich@pengutronix.de>

This adds recipes for building the RAUC update tool both as a host
tool as well as a target update tool and service.

The package will install a rauc.service that starts rauc with `rauc
service` during boot.
It will also install a rauc-mark-good.service by default that is used to
notify the underlying bootloader implementation about having booted
successfully vi `rauc status mark-good`.

For integrating rauc with your platform, you need to have a system
configuration file /etc/rauc/system.conf in your platforms projectroot
dir. This defines all relevant slots and provides information and
configuration rauc requires to properly handle the platform it is
running on.

You should als set `RAUC_BUNDLE_COMPATIBLE` to a compatible string
rauc should use to identify your platform and sufficiently distinguish
from others.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
---
 patches/rauc-2016-11-22-g513172c60272/autogen.sh   | 18 +++++
 .../lib/systemd/system/rauc-mark-good.service      | 11 +++
 rules/host-rauc.in                                 |  8 ++
 rules/host-rauc.make                               | 32 ++++++++
 rules/rauc.in                                      | 24 ++++++
 rules/rauc.make                                    | 88 ++++++++++++++++++++++
 6 files changed, 181 insertions(+)
 create mode 100755 patches/rauc-2016-11-22-g513172c60272/autogen.sh
 create mode 100644 projectroot/lib/systemd/system/rauc-mark-good.service
 create mode 100644 rules/host-rauc.in
 create mode 100644 rules/host-rauc.make
 create mode 100644 rules/rauc.in
 create mode 100644 rules/rauc.make

diff --git a/patches/rauc-2016-11-22-g513172c60272/autogen.sh b/patches/rauc-2016-11-22-g513172c60272/autogen.sh
new file mode 100755
index 0000000..df78c38
--- /dev/null
+++ b/patches/rauc-2016-11-22-g513172c60272/autogen.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+set -e
+
+aclocal $ACLOCAL_FLAGS
+
+libtoolize \
+	--force \
+	--copy
+
+autoreconf \
+	--force \
+	--install \
+	--warnings=cross \
+	--warnings=syntax \
+	--warnings=obsolete \
+	--warnings=unsupported
+
diff --git a/projectroot/lib/systemd/system/rauc-mark-good.service b/projectroot/lib/systemd/system/rauc-mark-good.service
new file mode 100644
index 0000000..b462e6a
--- /dev/null
+++ b/projectroot/lib/systemd/system/rauc-mark-good.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Rauc Mark Good
+ConditionKernelCommandLine=bootchooser.active
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=/usr/bin/rauc status mark-good
+
+[Install]
+WantedBy=multi-user.target
diff --git a/rules/host-rauc.in b/rules/host-rauc.in
new file mode 100644
index 0000000..0e02743
--- /dev/null
+++ b/rules/host-rauc.in
@@ -0,0 +1,8 @@
+## SECTION=hosttools_noprompt
+## SECTION=hosttools_platform
+
+config HOST_RAUC
+	tristate
+	select HOST_GLIB
+	select HOST_OPENSSL
+	select HOST_SQUASHFS_TOOLS
diff --git a/rules/host-rauc.make b/rules/host-rauc.make
new file mode 100644
index 0000000..4345ae8
--- /dev/null
+++ b/rules/host-rauc.make
@@ -0,0 +1,32 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2015 by Michael Grzeschik <mgr@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
+#
+HOST_PACKAGES-$(PTXCONF_HOST_RAUC) += host-rauc
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+#
+# autoconf
+#
+HOST_RAUC_CONF_TOOL	:= autoconf
+HOST_RAUC_CONF_OPT	:= \
+	$(HOST_AUTOCONF) \
+	--disable-code-coverage \
+	--disable-valgrind \
+	--disable-service \
+	--disable-network \
+	--disable-json
+
+# vim: syntax=make
diff --git a/rules/rauc.in b/rules/rauc.in
new file mode 100644
index 0000000..acd4be1
--- /dev/null
+++ b/rules/rauc.in
@@ -0,0 +1,24 @@
+## SECTION=applications
+
+menuconfig RAUC
+	tristate
+	prompt "Rauc update tool              "
+	select OPENSSL
+	select GLIB
+	select DT_UTILS		if RUNTIME
+	select LIBCURL		if RAUC_NETWORK
+	select JSON_GLIB	if RAUC_JSON
+	help
+	  Robust Auto-Update Controller. RAUC controls the update process on embedded linux systems.
+
+if RAUC
+
+config RAUC_NETWORK
+	bool
+	prompt "network support"
+
+config RAUC_JSON
+	bool
+	prompt "JSON support"
+
+endif
diff --git a/rules/rauc.make b/rules/rauc.make
new file mode 100644
index 0000000..3013d43
--- /dev/null
+++ b/rules/rauc.make
@@ -0,0 +1,88 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2015 by Enrico Joerns <e.joerns@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
+#
+PACKAGES-$(PTXCONF_RAUC) += rauc
+
+#
+# Paths and names
+#
+RAUC_VERSION	:= 2016-11-22-g513172c60272
+RAUC_MD5	:= 26ea84cf873686153de77df3603a4215
+RAUC		:= rauc-$(RAUC_VERSION)
+RAUC_SUFFIX	:= tar.gz
+RAUC_URL	:= https://github.com/jluebbe/rauc.git;tag=$(RAUC_VERSION)
+RAUC_SOURCE	:= $(SRCDIR)/$(RAUC).$(RAUC_SUFFIX)
+RAUC_DIR	:= $(BUILDDIR)/$(RAUC)
+RAUC_LICENSE	:= GPLv2
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+#RAUC_CONF_ENV	:= $(CROSS_ENV)
+
+#
+# autoconf
+#
+RAUC_CONF_TOOL	:= autoconf
+RAUC_CONF_OPT	:= \
+	$(CROSS_AUTOCONF_USR) \
+	--enable-debug=info \
+	$(GLOBAL_LARGE_FILE_OPTION) \
+	--disable-code-coverage \
+	--disable-valgrind \
+	--enable-service \
+	--$(call ptx/endis,PTXCONF_RAUC_NETWORK)-network \
+	--$(call ptx/endis,PTXCONF_RAUC_JSON)-json \
+	--with-systemdunitdir=/lib/systemd/system \
+	--with-dbuspolicydir=/usr/share/dbus-1/system.d \
+	--with-dbussystemservicedir=/usr/share/dbus-1/system-services
+
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/rauc.targetinstall:
+	@$(call targetinfo)
+
+	@$(call install_init, rauc)
+	@$(call install_fixup, rauc,PRIORITY,optional)
+	@$(call install_fixup, rauc,SECTION,base)
+	@$(call install_fixup, rauc,AUTHOR,"Enrico Joerns <e.joerns@pengutronix.de>")
+	@$(call install_fixup, rauc,DESCRIPTION,missing)
+
+	@$(call install_copy, rauc, 0, 0, 0755, -, /usr/bin/rauc)
+	@$(call install_alternative, rauc, 0, 0, 0644, /etc/rauc/system.conf)
+	@$(call install_replace, rauc, /etc/rauc/system.conf, \
+		@RAUC_BUNDLE_COMPATIBLE@, \
+		$(PTXCONF_PROJECT_VENDOR)\ $(PTXCONF_PROJECT))
+	@$(call install_alternative, rauc, 0, 0, 0644, /etc/rauc/ca.cert.pem)
+
+	@$(call install_copy, rauc, 0, 0, 0644, -, \
+		/usr/share/dbus-1/system-services/de.pengutronix.rauc.service)
+	@$(call install_copy, rauc, 0, 0, 0644, -, \
+		/usr/share/dbus-1/system.d/de.pengutronix.rauc.conf)
+
+	@$(call install_alternative, rauc, 0, 0, 0644, \
+		/lib/systemd/system/rauc.service)
+
+	@$(call install_alternative, rauc, 0, 0, 0644, \
+		/lib/systemd/system/rauc-mark-good.service)
+	@$(call install_link, rauc, ../rauc-mark-good.service, \
+		/lib/systemd/system/multi-user.target.wants/rauc-mark-good.service)
+
+	@$(call install_finish, rauc)
+
+	@$(call touch)
+
+# vim: syntax=make
-- 
2.10.2


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ptxdist] [PATCH 2/2] rauc-image: new package
  2016-11-24 11:37 [ptxdist] [PATCH 0/2] Add basic support for RAUC update tool Enrico Jorns
  2016-11-24 11:37 ` [ptxdist] [PATCH 1/2] rauc: new package Enrico Jorns
@ 2016-11-24 11:37 ` Enrico Jorns
  2016-11-24 13:58   ` Bastian Stender
  1 sibling, 1 reply; 4+ messages in thread
From: Enrico Jorns @ 2016-11-24 11:37 UTC (permalink / raw)
  To: ptxdist; +Cc: Michael Olbrich

From: Michael Olbrich <m.olbrich@pengutronix.de>

This adds a default image recipe for building a rauc bundle out of the
systems rootfs.

You need to place a valid certificate and key file in your BSP. By
default they are currently expected to be located at:

  $(PTXDIST_WORKSPACE)/config/rauc/ca.key.pem (key)
  $(PTXDIST_WORKSPACE)/projectroot/etc/rauc/ca.cert.pem (cert)

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
---
 config/images/rauc.config | 15 +++++++++++++++
 platforms/image-rauc.in   |  9 +++++++++
 rules/image-rauc.make     | 39 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 63 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 0000000..cdb6e39
--- /dev/null
+++ b/config/images/rauc.config
@@ -0,0 +1,15 @@
+image update.raucb {
+	rauc {
+		file root.tar.gz { image = "root.tgz" }
+		manifest = "
+			[update]
+			compatible=@RAUC_BUNDLE_COMPATIBLE@
+			version=@RAUC_BUNDLE_VERSION@
+
+			[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 0000000..15bc8fd
--- /dev/null
+++ b/platforms/image-rauc.in
@@ -0,0 +1,9 @@
+## SECTION=image2
+
+config IMAGE_RAUC
+	tristate
+	prompt "Generate rauc update bundle"
+	select HOST_RAUC
+	select IMAGE_ROOT_TGZ
+	help
+	  FIXME
diff --git a/rules/image-rauc.make b/rules/image-rauc.make
new file mode 100644
index 0000000..428bb29
--- /dev/null
+++ b/rules/image-rauc.make
@@ -0,0 +1,39 @@
+# -*-makefile-*-
+#
+# 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_ENV	:= \
+	RAUC_BUNDLE_COMPATIBLE=$(PTXCONF_PROJECT_VENDOR)\ $(PTXCONF_PROJECT) \
+	RAUC_BUNDLE_VERSION=$(PTXCONF_PROJECT_VERSION) \
+	RAUC_KEY=$(PTXDIST_WORKSPACE)/config/rauc/ca.key.pem \
+	RAUC_CERT=$(PTXDIST_WORKSPACE)/projectroot/etc/rauc/ca.cert.pem
+
+$(IMAGE_RAUC_IMAGE):
+	@$(call targetinfo)
+	@$(call image/genimage, IMAGE_RAUC)
+	@$(call finish)
+
+# vim: syntax=make
-- 
2.10.2


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ptxdist] [PATCH 2/2] rauc-image: new package
  2016-11-24 11:37 ` [ptxdist] [PATCH 2/2] rauc-image: " Enrico Jorns
@ 2016-11-24 13:58   ` Bastian Stender
  0 siblings, 0 replies; 4+ messages in thread
From: Bastian Stender @ 2016-11-24 13:58 UTC (permalink / raw)
  To: ptxdist

On 11/24/2016 12:37 PM, Enrico Jorns wrote:
> From: Michael Olbrich <m.olbrich@pengutronix.de>
>
> This adds a default image recipe for building a rauc bundle out of the
> systems rootfs.
>
> You need to place a valid certificate and key file in your BSP. By
> default they are currently expected to be located at:
>
>   $(PTXDIST_WORKSPACE)/config/rauc/ca.key.pem (key)
>   $(PTXDIST_WORKSPACE)/projectroot/etc/rauc/ca.cert.pem (cert)
>
> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
> ---
>  config/images/rauc.config | 15 +++++++++++++++
>  platforms/image-rauc.in   |  9 +++++++++
>  rules/image-rauc.make     | 39 +++++++++++++++++++++++++++++++++++++++
>  3 files changed, 63 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 0000000..cdb6e39
> --- /dev/null
> +++ b/config/images/rauc.config
> @@ -0,0 +1,15 @@
> +image update.raucb {
> +	rauc {
> +		file root.tar.gz { image = "root.tgz" }
> +		manifest = "
> +			[update]
> +			compatible=@RAUC_BUNDLE_COMPATIBLE@
> +			version=@RAUC_BUNDLE_VERSION@
> +
> +			[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 0000000..15bc8fd
> --- /dev/null
> +++ b/platforms/image-rauc.in
> @@ -0,0 +1,9 @@
> +## SECTION=image2
> +
> +config IMAGE_RAUC
> +	tristate
> +	prompt "Generate rauc update bundle"
> +	select HOST_RAUC
> +	select IMAGE_ROOT_TGZ

select HOST_GENIMAGE is missing here.

> +	help
> +	  FIXME
> diff --git a/rules/image-rauc.make b/rules/image-rauc.make
> new file mode 100644
> index 0000000..428bb29
> --- /dev/null
> +++ b/rules/image-rauc.make
> @@ -0,0 +1,39 @@
> +# -*-makefile-*-
> +#
> +# 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_ENV	:= \
> +	RAUC_BUNDLE_COMPATIBLE=$(PTXCONF_PROJECT_VENDOR)\ $(PTXCONF_PROJECT) \
> +	RAUC_BUNDLE_VERSION=$(PTXCONF_PROJECT_VERSION) \
> +	RAUC_KEY=$(PTXDIST_WORKSPACE)/config/rauc/ca.key.pem \
> +	RAUC_CERT=$(PTXDIST_WORKSPACE)/projectroot/etc/rauc/ca.cert.pem
> +
> +$(IMAGE_RAUC_IMAGE):
> +	@$(call targetinfo)
> +	@$(call image/genimage, IMAGE_RAUC)
> +	@$(call finish)
> +
> +# vim: syntax=make
>

Regards,
Bastian Stender

-- 
Pengutronix e.K.
Industrial Linux Solutions
http://www.pengutronix.de/
Peiner Str. 6-8, 31137 Hildesheim, Germany
Amtsgericht Hildesheim, HRA 2686

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-11-24 13:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-24 11:37 [ptxdist] [PATCH 0/2] Add basic support for RAUC update tool Enrico Jorns
2016-11-24 11:37 ` [ptxdist] [PATCH 1/2] rauc: new package Enrico Jorns
2016-11-24 11:37 ` [ptxdist] [PATCH 2/2] rauc-image: " Enrico Jorns
2016-11-24 13:58   ` Bastian Stender

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox