loginit: use /run/initramfs/init.log.end as end marker
authorHarald Hoyer <harald@redhat.com>
Fri, 25 Mar 2011 12:34:37 +0000 (13:34 +0100)
committerHarald Hoyer <harald@redhat.com>
Fri, 25 Mar 2011 15:10:47 +0000 (16:10 +0100)
modules.d/99base/init
modules.d/99base/loginit

index 2b8cfd9..4e30e0e 100755 (executable)
@@ -17,9 +17,11 @@ wait_for_loginit()
         # wait for loginit
         i=0
         while [ $i -lt 10 ]; do 
-            j=$(jobs)
-            [ -z "$j" ] && break
-            [ -z "${j##*Running*}" ] || break
+            if [ -e /run/initramfs/init.log.end ]; then
+                j=$(jobs)
+                [ -z "$j" ] && break
+                [ -z "${j##*Running*}" ] || break
+            fi
             sleep 0.1
             i=$(($i+1))
         done    
@@ -33,7 +35,7 @@ wait_for_loginit()
         done
         set -x
     fi
-    rm -f /run/initramfs/initlog.pipe
+    rm -f /run/initramfs/initlog.pipe /run/initramfs/init.log.end
 }
 
 emergency_shell()
index 3ceaede..5436b6b 100755 (executable)
@@ -11,7 +11,10 @@ QUIET=$1
 exec 6>/init.log
 
 while read line; do 
-    [ "$line" = "DRACUT_LOG_END" ] && exit 0
+    if [ "$line" = "DRACUT_LOG_END" ]; then
+        > /run/initramfs/init.log.end
+        exit 0
+    fi
     echo "<7>dracut: $line" >&5
     # if "quiet" is specified we output to /dev/console
     [ -n "$QUIET" ] && echo "dracut: $line"