obmc-initfs: look for images in /run/initramfs/image-
Teach update to look for /run/initramfs/image- not /image-*.
When describing how to recover from a corrupted flash by grabbing
the images and running update from the init debug shell, it
became apparent that while at systemd shutdown /run/initramfs/
is mounted at /, it is not the case during init. Use the
variable image to hold this pathname.
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 1122e83..f83b1ad 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
@@ -61,10 +61,10 @@
umount rw
fi
-
-for f in image-*
+image=/run/initramfs/image-
+for f in $image*
do
- m=$(findmtd ${f#image-})
+ m=$(findmtd ${f#$image})
if test -z "$m"
then
echo 1>&2 "Unable to find mtd partiton for $f"
@@ -72,10 +72,10 @@
fi
done
-for f in image-*
+for f in $image*
do
- m=$(findmtd ${f#image-})
- echo "Updating ${f#image-}"
+ m=$(findmtd ${f#$image})
+ echo "Updating ${f#$image}..."
# flasheraseall /dev/$m && dd if=$f of=/dev/$m
flashcp -v $f /dev/$m
done