From f9eaa06e198b23f2e6023beb5160f61b3ce461be Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Tue, 19 May 2020 08:52:05 +0200 Subject: [PATCH] u-boot: fix uuu install firmware script The function that parsed the output for a U-Boot variable value was receiving a multi-line output, with blank lines that were not being properly processed. Simplify the parsing by using 'sed' command. Signed-off-by: Hector Palacios https://jira.digi.com/browse/DUB-951 --- .../u-boot-dey/ccimx8mn-dvk/install_linux_fw_uuu.sh | 10 +--------- .../u-boot-dey/ccimx8x-sbc-pro/install_linux_fw_uuu.sh | 10 +--------- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8mn-dvk/install_linux_fw_uuu.sh b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8mn-dvk/install_linux_fw_uuu.sh index 063121223..6ef574712 100755 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8mn-dvk/install_linux_fw_uuu.sh +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8mn-dvk/install_linux_fw_uuu.sh @@ -19,15 +19,7 @@ clear # Parse uuu cmd output function getenv() { - while read line; do - if echo "${line}" | grep -i "$1"; then - # Get the U-boot variable content - echo "${line}" | sed -e 's,'${1}=',,g' - else - # Delete the line to return nothing - sed -e 'd' - fi - done < <(uuu -v fb: ucmd printenv ${1}) + uuu -v fb: ucmd printenv "${1}" | sed -ne "s,^${1}=,,g;T;p" } # diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x-sbc-pro/install_linux_fw_uuu.sh b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x-sbc-pro/install_linux_fw_uuu.sh index 99b703b39..a6f91ebd7 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x-sbc-pro/install_linux_fw_uuu.sh +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x-sbc-pro/install_linux_fw_uuu.sh @@ -19,15 +19,7 @@ clear # Parse uuu cmd output function getenv() { - while read line; do - if echo "${line}" | grep -i "$1"; then - # Get the U-boot variable content - echo "${line}" | sed -e 's,'${1}=',,g' - else - # Delete the line to return nothing - sed -e 'd' - fi - done < <(uuu -v fb: ucmd printenv ${1}) + uuu -v fb: ucmd printenv "${1}" | sed -ne "s,^${1}=,,g;T;p" } #