diff options
author | Saqib Khan <khansa@us.ibm.com> | 2017-09-13 14:05:31 -0500 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2017-09-15 21:09:14 +0000 |
commit | f144938c0b0a4d2219758ba829a769359b02349e (patch) | |
tree | 70a3ccb5c167aae10cc8008c57073ff715a758b3 /meta-phosphor/common/recipes-phosphor/flash | |
parent | 2a284a012d902bfa399bc14309337c3c1fe1a8ff (diff) | |
download | talos-openbmc-f144938c0b0a4d2219758ba829a769359b02349e.tar.gz talos-openbmc-f144938c0b0a4d2219758ba829a769359b02349e.zip |
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 <khansa@us.ibm.com>
Diffstat (limited to 'meta-phosphor/common/recipes-phosphor/flash')
-rw-r--r-- | meta-phosphor/common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc | 9 |
1 files changed, 6 insertions, 3 deletions
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 |