update: Make cow directory before restoring saved files.
This will ensure the cp command always writes to an existing
directory but will also make any future component directories if
the upper directory is later moved from the root of the filesystem.
Signed-off-by: Milton Miller <miltonm@us.ibm.com>
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 cab33e9..1a11953 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
@@ -138,6 +138,7 @@
mkdir -p $rwdir
mount $rwdev $rwdir -t $(probe_fs_type $rwdev) -o $rwopts
+ mkdir -p $upper
cp -rp $save/. $upper/
umount $rwdir
rmdir $rwdir