commit | 4f609b84e4815d77ea4beef55f27ccc276f55ba3 | [log] [tgz] |
---|---|---|
author | Saqib Khan <khansa@us.ibm.com> | Wed Aug 02 15:13:26 2017 -0500 |
committer | Patrick Williams <patrick@stwcx.xyz> | Wed Aug 02 21:16:48 2017 +0000 |
tree | 3f91f345e78f4d91374e433cb79d2773a41d0bd9 | |
parent | b383836e9ca044e03ee6a6b099b6f991229f8f7b [diff] [blame] |
PNOR: Check if the pnor mtd is already attached. - In the pnor ubi attach function, check if the pnor is already attached to ubi, since a second attempt may fail. Resolves openbmc/openbmc#2074 Change-Id: Ic07d56c5f656d4a236d85fd77acc9aef214a9c3b Signed-off-by: Saqib Khan <khansa@us.ibm.com>
diff --git a/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios b/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios index 19878d4..0cdf74e 100644 --- a/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios +++ b/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios
@@ -28,6 +28,11 @@ pnor="${pnormtd#mtd}" pnordev="/dev/mtd${pnor}" + if [ -d "/sys/class/ubi/ubi${pnor}" ]; then + # Already attached + return 0 + fi + ubiattach /dev/ubi_ctrl -m "${pnor}" -d "${pnor}" rc=$? if [ ${rc} -ne 0 ]; then