obmc-initfs: shutdown: use absolute paths
In shutdown, cd to / like init and update, but do not switch
paths to assume this. Instead switch a few more paths to be
absolute. This will clarify the expcted execution environment
and the location of files being tested. It also provides
consistency when calling /update and creating and testing
the /image- symlinks.
Signed-off-by: Milton Miller <miltonm@us.ibm.com>
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 d29db26..c550e06 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
@@ -5,10 +5,11 @@
export PS1=shutdown-sh#\
# exec bin/sh
+cd /
if [ ! -e /proc/mounts ]
then
mkdir -p /proc
- mount proc proc -tproc
+ mount proc /proc -tproc
umount_proc=1
else
umount_proc=
@@ -30,7 +31,7 @@
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