From a02d48dc789584eedc9ab733dbf61625cf54353f Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Tue, 21 Oct 2025 17:53:07 +0200 Subject: [PATCH] libubootenv: adjust postinstall script and fix inherit usage * Replace the hard-coded '/etc' with ${sysconfdir} * Extend the mmcblk check to prevent updating the environment configuration when booting from the EMMC (even though the kernel command line root passed is in the form of /dev/mmcblk). * Switch the conditional inherit to inherit_defer as it depends on IMAGE_FEATURES to avoid parse-time ordering issues. https://onedigi.atlassian.net/browse/DEL-9768 Signed-off-by: Javier Viguera --- .../recipes-bsp/libubootenv/libubootenv_%.bbappend | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/meta-digi-arm/recipes-bsp/libubootenv/libubootenv_%.bbappend b/meta-digi-arm/recipes-bsp/libubootenv/libubootenv_%.bbappend index 8f69db3de..6914711fa 100644 --- a/meta-digi-arm/recipes-bsp/libubootenv/libubootenv_%.bbappend +++ b/meta-digi-arm/recipes-bsp/libubootenv/libubootenv_%.bbappend @@ -41,9 +41,9 @@ UBOOT_ENV_PARTITION = "environment" UBOOT_ENV_PARTITION:ccmp1 = "UBI" pkg_postinst_ontarget:${PN}() { - CONFIG_FILE="/etc/fw_env.config" + CONFIG_FILE="${sysconfdir}/fw_env.config" MMCDEV="$(sed -ne 's,.*root=/dev/mmcblk\([0-9]\)p.*,\1,g;T;p' /proc/cmdline)" - if [ -n "${MMCDEV}" ]; then + if [ -n "${MMCDEV}" ] && ! [ -b "/dev/mmcblk${MMCDEV}boot0" ]; then sed -i -e "s,^/dev/mmcblk[^[:blank:]]\+,/dev/mmcblk${MMCDEV},g" ${CONFIG_FILE} fi @@ -90,4 +90,4 @@ pkg_postinst_ontarget:${PN}() { sync ${CONFIG_FILE} } -inherit ${@bb.utils.contains("IMAGE_FEATURES", "read-only-rootfs", "remove-pkg-postinst-ontarget", "", d)} +inherit_defer ${@bb.utils.contains("IMAGE_FEATURES", "read-only-rootfs", "remove-pkg-postinst-ontarget", "", d)}