From: Michael Olbrich <[email protected]> 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 <[email protected]> --- 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 <[email protected]> +# +# 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 <[email protected]> +# +# 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 <[email protected]>") + @$(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 [email protected]
