diff --git a/README.rst b/README.rst index 7b305db0..733ad42b 100644 --- a/README.rst +++ b/README.rst @@ -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" diff --git a/recipes-core/rauc/files/system.conf b/recipes-core/rauc/files/system.conf index a89a21fc..35c940c5 100644 --- a/recipes-core/rauc/files/system.conf +++ b/recipes-core/rauc/files/system.conf @@ -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 diff --git a/recipes-core/rauc/rauc-target.inc b/recipes-core/rauc/rauc-target.inc index 0bde7be5..379f966c 100644 --- a/recipes-core/rauc/rauc-target.inc +++ b/recipes-core/rauc/rauc-target.inc @@ -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" @@ -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/ @@ -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