openpower-software-manager: Create a mount dir for ubi volumes.
After a BMC Code update the directories under /media/ are
deleted. Therefore the obmc-flash-bios-ubiremount.service
fails to mount the PNOR ubi volumes as mount point is no
longer exist.
Add a check to create the mountdir before mounting the ubi
volumes on /media dir.
Resolves openbmc/openbmc#2062
Change-Id: I4f148fb376795102bd630e87fc8045e422e796ff
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 0896569..bfd9592 100644
--- a/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios
+++ b/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios
@@ -160,6 +160,10 @@
if [[ ${name} == pnor-prsv ]] || [[ ${name} == pnor-rw* ]] || [[ ${name} == pnor-ro* ]]; then
mountdir="/media/${name}"
+ if [ ! -d "${mountdir}" ]; then
+ mkdir -p "${mountdir}"
+ fi
+
if [[ ${name} == pnor-ro* ]]
then
ubiblock --create /dev/ubi${pnor}_${element}