openpower-software-manager: Create ubi volume for pnor patches
Create a ubi volume to store pnor patches and mount it under
/usr/local/share/pnor/.
Resolves openbmc/openbmc#1333
Change-Id: Id62549e5e0dc0e5373510a59193736fcf87bb18a
Signed-off-by: Adriana Kobylak <anoo@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 bfd9592..19878d4 100644
--- a/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios
+++ b/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios
@@ -85,7 +85,12 @@
pnormtd="$(findmtd pnor)"
pnor="${pnormtd#mtd}"
ubidev="/dev/ubi${pnor}"
- mountdir="/media/${name}"
+
+ if [[ "${name}" == "pnor-patch" ]]; then
+ mountdir="/usr/local/share/pnor"
+ else
+ mountdir="/media/${name}"
+ fi
if [[ "${name}" == "pnor-prsv" ]]; then
size="2MiB"
@@ -94,7 +99,7 @@
fi
if [ ! -d "${mountdir}" ]; then
- mkdir "${mountdir}"
+ mkdir -p "${mountdir}"
fi
vol="$(findubi "${name}")"