[PATCH openbmc 2/7] obmc-initfs: look for images in /run/initramfs/image-
OpenBMC Patches
openbmc-patches at stwcx.xyz
Sat Feb 6 11:20:24 AEDT 2016
From: Milton Miller <miltonm at us.ibm.com>
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 aparent that while at systemd shutdown /run/initramfs/
is mounted at /, it is not the case during init. Use variable
image to hold this pathname.
Signed-off-by: Milton Miller <miltonm at us.ibm.com>
---
.../obmc-phosphor-initfs/files/obmc-shutdown.sh | 7 ++++---
.../obmc-phosphor-initfs/files/obmc-update.sh | 12 ++++++------
2 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-shutdown.sh b/meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-shutdown.sh
index c550e06..d530265 100644
--- a/meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-shutdown.sh
+++ b/meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-shutdown.sh
@@ -25,13 +25,14 @@ do
done
set +x
-if test -s /run/fw_env -a -c /run/mtd:u-boot-env -a ! -e /image-u-boot-env &&
+image=/run/initramfs/image-
+if test -s /run/fw_env -a -c /run/mtd:u-boot-env -a ! -e ${image}u-boot-env &&
! cmp /run/mtd:u-boot-env /run/fw_env
then
- ln -sn /run/fw_env /image-u-boot-env
+ ln -sn /run/fw_env ${image}u-boot-env
fi
-if test -x /update && ls /image-* > /dev/null 2>&1
+if test -x /update && ls $image* > /dev/null 2>&1
then
exec /update ${1+"$@"}
fi
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 @@ then
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 @@ do
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
--
2.6.4
More information about the openbmc
mailing list