Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rauc: prepare support for locating the config in /usr or /run #350

Open
wants to merge 1 commit into
base: kirkstone
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,10 @@ you have to follow at least the following steps:
DISTRO_FEATURES += "rauc"

2. Add a ``rauc_%.bbappend`` in your device-specific (BSP) layer
that installs your RAUC system configuration file under
``/etc/rauc/system.conf``. For information on how to write the RAUC
update file, please refer to the RAUC user documentation [1]_::
that installs your RAUC system configuration, so RAUC can find it
(in ``/etc/rauc/`` or ``/usr/lib/rauc/```).
For information on how to write the RAUC update file, please refer to
the RAUC user documentation [1]_::

FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
SRC_URI:append := " file://system.conf"
Expand Down
6 changes: 3 additions & 3 deletions recipes-core/rauc/files/system.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## This is an example RAUC system configuration. This file will be installed
## into /etc/rauc/system.conf on your target and describes your system from the
## perspective of the RAUC update service.
## This is an example RAUC system configuration. This file will be be looked up
## in {/etc,/run,/usr/lib}/rauc/system.conf on your target and describes your
## system from the perspective of the RAUC update service.
##
## Adapt and extend the below configuration to your needs and place it in the
## BSP layer of you project. Create a rauc .bbappend file that adds this file
Expand Down
11 changes: 7 additions & 4 deletions recipes-core/rauc/rauc-target.inc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
RAUC_KEYRING_FILE ??= "ca.cert.pem"
RAUC_KEYRING_URI ??= "file://${RAUC_KEYRING_FILE}"
RAUC_CONF_DIR ??= "${sysconfdir}/rauc"

RRECOMMENDS:${PN} = "squashfs-tools"

Expand Down Expand Up @@ -27,15 +28,15 @@ do_install () {
if ! grep -q "^[^#]" ${WORKDIR}/system.conf; then
bbwarn "Please overwrite example system.conf with a project specific one!"
fi
install -d ${D}${sysconfdir}/rauc
install -m 0644 ${WORKDIR}/system.conf ${D}${sysconfdir}/rauc/system.conf
install -d ${D}${RAUC_CONF_DIR}
install -m 0644 ${WORKDIR}/system.conf ${D}${RAUC_CONF_DIR}/system.conf

# Warn if CA file was not overwritten
if ! grep -q "^[^#]" ${WORKDIR}/${RAUC_KEYRING_FILE}; then
bbwarn "Please overwrite example ca.cert.pem with a project specific one, or set the RAUC_KEYRING_FILE variable with your file!"
fi
install -d ${D}${sysconfdir}/rauc/
install -m 0644 ${WORKDIR}/${RAUC_KEYRING_FILE} ${D}${sysconfdir}/rauc/
install -d ${D}${RAUC_CONF_DIR}/
install -m 0644 ${WORKDIR}/${RAUC_KEYRING_FILE} ${D}${RAUC_CONF_DIR}/

install -d ${D}${systemd_unitdir}/system/
install -m 0644 ${WORKDIR}/rauc-mark-good.service ${D}${systemd_unitdir}/system/
Expand All @@ -45,6 +46,8 @@ do_install () {
install -m 755 "${WORKDIR}/rauc-mark-good.init" "${D}${sysconfdir}/init.d/rauc-mark-good"
}

FILES:${PN} += "${RAUC_CONF_DIR}"

PACKAGES =+ "${PN}-mark-good"

# some magic to get the tool to interact with bootloader storage
Expand Down
Loading