Ignore ubipatch service if device not formatted as UBI
- If the device is not formatted as UBI then an attempt to
create a ubi volume for pnor patches will fail.
- Added a check to return if device not formatted as UBI.
Change-Id: I21ee263d63229fff09c69c602f40224f7723e5ad
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 befd086..fdc7e3c 100644
--- a/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios
+++ b/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios
@@ -110,8 +110,12 @@
pnormtd="$(findmtd pnor)"
pnor="${pnormtd#mtd}"
ubidev="/dev/ubi${pnor}"
+ pnordev="/dev/mtd${pnor}"
if [[ "${name}" == "pnor-patch" ]]; then
+ if [[ ! "$(hexdump -C -n 3 ${pnordev})" =~ "UBI" ]]; then
+ return 0
+ fi
mountdir="/usr/local/share/pnor"
else
mountdir="/media/${name}"