From 2c1f37d45cd5dc01482e1935c2a9ae29becb5c61 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Thu, 28 Oct 2010 12:46:17 +0200 Subject: [PATCH] base/init: fix for /sbin/init being an absolute softlink --- modules.d/99base/init | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules.d/99base/init b/modules.d/99base/init index d4cb60c0..e9a049d4 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" ] || {