From: Harald Hoyer Date: Thu, 28 Oct 2010 10:46:17 +0000 (+0200) Subject: base/init: fix for /sbin/init being an absolute softlink X-Git-Tag: 008~95 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2c1f37d45cd5dc01482e1935c2a9ae29becb5c61;p=thirdparty%2Fdracut.git base/init: fix for /sbin/init being an absolute softlink --- diff --git a/modules.d/99base/init b/modules.d/99base/init index d4cb60c09..e9a049d4b 100755 --- a/modules.d/99base/init +++ b/modules.d/99base/init @@ -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" ] || {