From 90afd7025c041cfa3f689e8c0af58c72a4100d4b Mon Sep 17 00:00:00 2001 From: Gabriel Valcazar Date: Wed, 20 Dec 2023 13:44:08 +0100 Subject: [PATCH] recovery-initramfs: fix multi-MTD detection when formatting NAND partitions Commit 7e81e706a19a9f7e222bbde2431f22275c83476c modified the logic used to determine if a NAND is using multi-MTD or single-MTD, but single quotes were used in the grep pattern, which prevents the variable inside from expanding. This makes the script always enter the single-MTD code path, even in multi-MTD systems, which breaks partition formatting in these cases. Replace the single quotes with double quotes so the variable can expand and the condition can be properly checked. https://onedigi.atlassian.net/browse/DEL-8773 Signed-off-by: Gabriel Valcazar --- .../recovery/recovery-initramfs/recovery-initramfs-init | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init b/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init index 59d0e995d..0e64cf8c5 100644 --- a/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init +++ b/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init @@ -233,7 +233,7 @@ format_ubi_volume() { # If the system is a multi-MTD, there must be an MTD partition by the # same name as the UBI volume - result="$(grep '\"${1}\"$' /proc/mtd)" + result="$(grep "\"${1}\"$" /proc/mtd)" if [ -n "${result}" ]; then # Find the MTD partition. local mtd_num="$(sed -ne "s/mtd\([0-9]\+\):.*\<${1}\>.*/\1/g;T;p" /proc/mtd 2>/dev/null)"