From f144938c0b0a4d2219758ba829a769359b02349e Mon Sep 17 00:00:00 2001 From: Saqib Khan Date: Wed, 13 Sep 2017 14:05:31 -0500 Subject: Check if the BMC version already exists in /media before mounting. - When a system is first flashed, it has 2 rofs-0 mounts, since both chips have the same version. - This change would help prevent the 2nd mount since the BMC version is already mounted. Resolves openbmc/openbmc#2307 Change-Id: I50c7df3deb953b411aa6ff9929907f3879c6e130 Signed-off-by: Saqib Khan --- .../flash/phosphor-software-manager/obmc-flash-bmc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'meta-phosphor/common/recipes-phosphor/flash') diff --git a/meta-phosphor/common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc b/meta-phosphor/common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc index 116b486de..d0dca1c40 100644 --- a/meta-phosphor/common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc +++ b/meta-phosphor/common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc @@ -196,9 +196,12 @@ remount_ubi() { if [[ ${name} == rofs-* ]]; then mountdir="/media/${name}" - mkdir -p "${mountdir}" - ubiblock --create /dev/ubi${mtd}_${element} &> /dev/null - mount -t squashfs -o ro "/dev/ubiblock${mtd}_${element}" "${mountdir}" + + if [ ! -d ${mountdir} ]; then + mkdir -p "${mountdir}" + ubiblock --create /dev/ubi${mtd}_${element} &> /dev/null + mount -t squashfs -o ro "/dev/ubiblock${mtd}_${element}" "${mountdir}" + fi fi done done -- cgit v1.2.1