commit | 3ab09ac56ff622f6987ad8d75ed9689981aa3a2d | [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 | 566749adaf2e5e02f55930d4df24cec648c37f52 | |
parent | 61c7cd4165df88e23dcc9885aa127749a0c730df [diff] |
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/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios b/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios index 19878d4..0cdf74e 100644 --- a/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios +++ b/meta-openbmc-machines/meta-openpower/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