init: Set and export PATH before running any external commands

busybox sh and klibc dash have different default values for $PATH
which could affect which could affect which commands we run later.

klibc dash also does not export $PATH, and this means we fail to
run fsck - it is executed indirectly through logsave, and logsave
cannot find it.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
This commit is contained in:
Ben Hutchings 2014-10-04 16:15:13 +01:00
parent 6ae39ebef1
commit 67e53ea38f

4
init
View File

@ -2,6 +2,10 @@
echo "Loading, please wait..."
# Default PATH differs between shells, and is not automatically exported
# by klibc dash. Make it consistent.
export PATH=/sbin:/usr/sbin:/bin:/usr/bin
[ -d /dev ] || mkdir -m 0755 /dev
[ -d /root ] || mkdir -m 0700 /root
[ -d /sys ] || mkdir /sys