summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdriana Kobylak <anoo@us.ibm.com>2018-03-02 23:16:43 +0300
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2018-03-06 17:15:31 +0300
commit8845adcfae1e7f9703a264c0988443885560cd63 (patch)
treebbd10dbeee4a5b7c1bea0a48fdd6ac7a82591df0
parent07b6b271136b745aece1a1d6b7e8629e191b656e (diff)
downloadopenbmc-8845adcfae1e7f9703a264c0988443885560cd63.tar.xz
obmc-flash-bmc: Ignore fw_printenv return code
If an environment variable doesn't exist, fw_printenv returns 1 (error). With the addition of "set -eo pipefail" to the obmc-flash-bmc script, this error causes the service that sets the priorities to fail: witherspoon systemd[1]: Starting Set U-Boot environment variable... witherspoon obmc-flash-bmc[3883]: ## Error: "66089bab" not defined witherspoon systemd[1]: obmc-flash-bmc-setenv@66089bab\x3d0.service: Main process exited, code=exited, status=1/FAILURE witherspoon systemd[1]: Failed to start Set U-Boot environment variable. Ignore the return code instead, the variable will be empty if fw_printenv doesn't return a value. Change-Id: I78b559e0ccb74ae52c73f1cc37b06a139a0d0e14 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
-rw-r--r--meta-phosphor/common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc2
1 files changed, 1 insertions, 1 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 d04651611..d570e83e1 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
@@ -306,7 +306,7 @@ ubi_setenv() {
varName="${variable%=*}"
value="${variable##*=}"
# Write only if var is not set already to the requested value
- currentValue="$(fw_printenv -n "${varName}")"
+ currentValue="$(fw_printenv -n "${varName}" 2>/dev/null)" || true
if [[ "${currenValue}" != "${value}" ]]; then
fw_setenv "$varName" "$value"
fw_setenv "$varName" "$value"