From 94551f0c4d95805294b46b174e98922e0eeafd3c Mon Sep 17 00:00:00 2001 From: Gabriel Valcazar Date: Tue, 1 Jun 2021 09:41:18 +0200 Subject: [PATCH] recovery-initramfs: correctly set environment variables containing spaces In the libubootenv implementation of fw_setenv, multiple variables can be set in one call. When setting a variable with a space-separated list, the app interprets the list as new variable/value tuples, for example: fw_setenv myvar value1 value2 value3 Results in: myvar=value1 value2=value3 This was causing the encrypted eMMC partition mechanism to break, because the list of encrypted partitions is stored as a space-separated list in an environment variable. Avoid this by enclosing the variable argument of set_uboot_var() with double quotes. 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 ca43f83cb..53bb02e08 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 @@ -110,7 +110,7 @@ read_uboot_var() { # @param ${2} - Value to set. #------------------------------------------------------------------------------ set_uboot_var() { - fw_setenv ${1} ${2} 2>/dev/null + fw_setenv ${1} "${2}" 2>/dev/null } #------------------------------------------------------------------------------