summaryrefslogtreecommitdiffstats
path: root/meta-phosphor
diff options
context:
space:
mode:
authorMilton Miller <miltonm@us.ibm.com>2016-02-05 11:19:58 -0600
committerMilton D. Miller II <miltonm@us.ibm.com>2016-02-09 10:29:19 -0600
commit36d336c34bc2b6f98fd9421739311926ddf3b831 (patch)
tree91edc610830bd0258bfaa9e4f8d910d9dd1b7e03 /meta-phosphor
parent016e0dfb48c85fceeb258bca3c57b87b9280c535 (diff)
downloadtalos-openbmc-36d336c34bc2b6f98fd9421739311926ddf3b831.tar.gz
talos-openbmc-36d336c34bc2b6f98fd9421739311926ddf3b831.zip
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>
Diffstat (limited to 'meta-phosphor')
-rw-r--r--meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-shutdown.sh7
-rwxr-xr-xmeta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-update.sh12
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 c550e06ad..d530265cd 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 1122e83fa..f83b1ad4f 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
OpenPOWER on IntegriCloud