summaryrefslogtreecommitdiffstats
path: root/meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-update.sh
diff options
context:
space:
mode:
Diffstat (limited to 'meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-update.sh')
-rwxr-xr-xmeta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-update.sh16
1 files changed, 12 insertions, 4 deletions
diff --git a/meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-update.sh b/meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-update.sh
index e58056109..6f265502a 100755
--- a/meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-update.sh
+++ b/meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-update.sh
@@ -59,6 +59,7 @@ rwdir=/run/initramfs/rw
upper=$rwdir/cow
save=/run/save/${upper##*/}
+mounted=
doclean=
dosave=y
dorestore=y
@@ -93,10 +94,14 @@ do
esac
done
-if test "x$dosave" = xy -a -n "$rwfs"
+if test "x$dosave" = xy
then
- mkdir -p $rwdir
- mount $rwdev $rwdir -t $(probe_fs_type $rwdev) -o $rorwopts
+ if test ! -d $upper -a -n "$rwfs"
+ then
+ mkdir -p $rwdir
+ mount $rwdev $rwdir -t $(probe_fs_type $rwdev) -o $rorwopts
+ mounted=$rwdir
+ fi
while read f
do
@@ -109,7 +114,10 @@ then
cp -rp $upper/$f "${d%/*}/"
done < $whitelist
- umount $rwdir
+ if test -n "$mounted"
+ then
+ umount $mounted
+ fi
fi
for f in $image*
OpenPOWER on IntegriCloud