base/init: fix for /sbin/init being an absolute softlink
authorHarald Hoyer <harald@redhat.com>
Thu, 28 Oct 2010 10:46:17 +0000 (12:46 +0200)
committerHarald Hoyer <harald@redhat.com>
Thu, 28 Oct 2010 15:11:34 +0000 (17:11 +0200)
modules.d/99base/init

index d4cb60c..e9a049d 100755 (executable)
@@ -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" ] || {