changeset 1217:1a24dc2bb3cb

Make sure PATH and CONSOLE are properly exported even when kernel command line doesn't provide the right data.
author Rob Landley <rob@landley.net>
date Sat, 21 Aug 2010 01:33:02 -0500
parents 45889d1397c1
children fd67d5a442c9
files sources/root-filesystem/sbin/init.sh
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/sources/root-filesystem/sbin/init.sh	Fri Aug 20 18:42:02 2010 -0500
+++ b/sources/root-filesystem/sbin/init.sh	Sat Aug 21 01:33:02 2010 -0500
@@ -17,6 +17,11 @@
 [ -z "$CPUS" ] && export CPUS=1
 export PS1='($HOST:$CPUS) \w \$ '
 
+# Make sure $PATH is exported, even if not set on kernel command line.
+# (The shell gives us a default, but it's local, not exported.)
+
+export PATH
+
 # If we're running under qemu, do some more setup
 if [ $$ -eq 1 ]
 then
@@ -53,8 +58,9 @@
     mount -o ro $MNTDEV /mnt
   fi
 
-  CONSOLE="$(sed -n 's@.* console=\(/dev/\)*\([^ ]*\).*@\2@p' /proc/cmdline)"
-  [ -z "$CONSOLE" ] && CONSOLE=/dev/console
+  [ -z "$CONSOLE" ] &&
+    CONSOLE="$(sed -n 's@.* console=\(/dev/\)*\([^ ]*\).*@\2@p' /proc/cmdline)"
+  [ -z "$CONSOLE" ] && CONSOLE=console
 
   if [ -z "$DISTCC_HOSTS" ]
   then