base/init: fix for /sbin/init being an absolute softlink

master
Harald Hoyer 2010-10-28 12:46:17 +02:00
parent fa7ada31d0
commit 2c1f37d45c
1 changed files with 2 additions and 1 deletions

View File

@ -255,7 +255,8 @@ source_all pre-pivot
# by the time we get here, the root filesystem should be mounted.
# Try to find init.
for i in "$(getarg init=)" /sbin/init /etc/init /init /bin/sh; do
[ -f "$NEWROOT$i" -a -x "$NEWROOT$i" ] && { INIT="$i"; break; }
[ -n "$i" ] || continue
[ -d "$NEWROOT$i" ] || [ -L "$NEWROOT$i" -o -x "$NEWROOT$i" ] && { INIT="$i"; break; }
done

[ "$INIT" ] || {