diff options
author | Michael Tritz <mtritz@us.ibm.com> | 2017-12-16 00:35:14 +0300 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-01-16 23:22:38 +0300 |
commit | cadef15028c480151a0997b604655bce29673c05 (patch) | |
tree | 41bf47ce92a2fe16bc8ab3e182c4901abb1171d1 | |
parent | e0a76388f8a4127cbb1008941ad5a314021587de (diff) | |
download | openbmc-cadef15028c480151a0997b604655bce29673c05.tar.xz |
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 <mtritz@us.ibm.com>
-rw-r--r-- | meta-phosphor/common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc | 6 |
1 files changed, 6 insertions, 0 deletions
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 } |