summaryrefslogtreecommitdiffstats
path: root/meta-phosphor/common/recipes-phosphor
diff options
context:
space:
mode:
authorMilton Miller <miltonm@us.ibm.com>2016-02-05 11:06:39 -0600
committerMilton D. Miller II <miltonm@us.ibm.com>2016-02-09 10:28:53 -0600
commit016e0dfb48c85fceeb258bca3c57b87b9280c535 (patch)
tree3464c86043351cd8bb9ccee2c27441e3f21a8beb /meta-phosphor/common/recipes-phosphor
parent1c0dd48270552ed14bd9867957044fdbb78fd7ca (diff)
downloadtalos-openbmc-016e0dfb48c85fceeb258bca3c57b87b9280c535.tar.gz
talos-openbmc-016e0dfb48c85fceeb258bca3c57b87b9280c535.zip
obmc-initfs: init: check init is an executable file
In init, check the new init is an executable file with non-zero size in addition to the shell being executable with its shared libraries. Signed-off-by: Milton Miller <miltonm@us.ibm.com>
Diffstat (limited to 'meta-phosphor/common/recipes-phosphor')
-rw-r--r--meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-init.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-init.sh b/meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-init.sh
index 0dc4c35c6..eed8cf53b 100644
--- a/meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-init.sh
+++ b/meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-init.sh
@@ -69,9 +69,10 @@ mkdir -p $work
mount -t overlay -o lowerdir=$rodir,upperdir=$upper,workdir=$work cow /root
-if ! chroot /root /bin/sh -c exit
+if ! chroot /root /bin/sh -c "test -x /sbin/init -a -s /sbin/init"
then
- echo 'chroot test failed; invoking emergency shell.'
+ echo "Unable to confirm /sbin/init is an executable non-empty file."
+ echo "Change Root test failed! Invoking emergency shell."
PS1=rescue#\ sulogin
fi
OpenPOWER on IntegriCloud