From cadef15028c480151a0997b604655bce29673c05 Mon Sep 17 00:00:00 2001 From: Michael Tritz Date: Fri, 15 Dec 2017 15:35:14 -0600 Subject: obmc-flash-bmc: write variables twice to ensure both banks are correct The U-Boot environment maintains two banks of environment variables. The banks need to be consistent with each other to ensure that these variables can be reliably read from file, as they would be in the context of a C++ program. In order to guarantee that the two banks are both correct, we need to run fw_setenv twice when writing environment variables. This change accompanies a change to phosphor-bmc-code-mgmt for openbmc/openbmc#2666. Change-Id: I72d7fd79faf271d017703464fd9ad0cd20f4e2a0 Signed-off-by: Michael Tritz --- .../recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/meta-phosphor/common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc b/meta-phosphor/common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc index 40ec06824..da62b10da 100644 --- a/meta-phosphor/common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc +++ b/meta-phosphor/common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc @@ -259,13 +259,19 @@ copy_env_var_to_alt() { } ubi_setenv() { + # The U-Boot environment maintains two banks of environment variables. + # The banks need to be consistent with each other to ensure that these + # variables can reliably be read from file. In order to guarantee that the + # banks are both correct, we need to run fw_setenv twice. variable=$1 if [[ "$variable" == *"="* ]]; then varName="${variable%=*}" value="${variable##*=}" fw_setenv "$varName" "$value" + fw_setenv "$varName" "$value" else fw_setenv "$variable" + fw_setenv "$variable" fi } -- cgit v1.2.3