89 lines
2.4 KiB
Diff
89 lines
2.4 KiB
Diff
|
From 4d518aec8614cafe96f585458f97e43d80fe3aa5 Mon Sep 17 00:00:00 2001
|
||
|
From: Harald Hoyer <harald@redhat.com>
|
||
|
Date: Fri, 2 Mar 2012 15:08:25 +0100
|
||
|
Subject: [PATCH] move wait_for_loginit() to dracut-lib.sh
|
||
|
|
||
|
---
|
||
|
modules.d/99base/dracut-lib.sh | 28 ++++++++++++++++++++++++++++
|
||
|
modules.d/99base/init.sh | 28 ----------------------------
|
||
|
2 files changed, 28 insertions(+), 28 deletions(-)
|
||
|
|
||
|
diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
|
||
|
index c31854e..80e093b 100755
|
||
|
--- a/modules.d/99base/dracut-lib.sh
|
||
|
+++ b/modules.d/99base/dracut-lib.sh
|
||
|
@@ -754,6 +754,34 @@ need_shutdown() {
|
||
|
>/run/initramfs/.need_shutdown
|
||
|
}
|
||
|
|
||
|
+wait_for_loginit()
|
||
|
+{
|
||
|
+ set +x
|
||
|
+ [ "$RD_DEBUG" = "yes" ] || return
|
||
|
+ [ -e /run/initramfs/loginit.pipe ] || return
|
||
|
+ echo "DRACUT_LOG_END"
|
||
|
+ exec 0<>/dev/console 1<>/dev/console 2<>/dev/console
|
||
|
+ # wait for loginit
|
||
|
+ i=0
|
||
|
+ while [ $i -lt 10 ]; do
|
||
|
+ if [ ! -e /run/initramfs/loginit.pipe ]; then
|
||
|
+ j=$(jobs)
|
||
|
+ [ -z "$j" ] && break
|
||
|
+ [ -z "${j##*Running*}" ] || break
|
||
|
+ fi
|
||
|
+ sleep 0.1
|
||
|
+ i=$(($i+1))
|
||
|
+ done
|
||
|
+
|
||
|
+ if [ $i -eq 10 ]; then
|
||
|
+ kill %1 >/dev/null 2>&1
|
||
|
+ kill $(while read line;do echo $line;done</run/initramfs/loginit.pid)
|
||
|
+ fi
|
||
|
+
|
||
|
+ set -x
|
||
|
+ rm -f /run/initramfs/loginit.pipe /run/initramfs/loginit.pid
|
||
|
+}
|
||
|
+
|
||
|
emergency_shell()
|
||
|
{
|
||
|
local _ctty
|
||
|
diff --git a/modules.d/99base/init.sh b/modules.d/99base/init.sh
|
||
|
index f6e4027..5d51c9d 100755
|
||
|
--- a/modules.d/99base/init.sh
|
||
|
+++ b/modules.d/99base/init.sh
|
||
|
@@ -10,34 +10,6 @@
|
||
|
|
||
|
export -p > /tmp/export.orig
|
||
|
|
||
|
-wait_for_loginit()
|
||
|
-{
|
||
|
- set +x
|
||
|
- [ "$RD_DEBUG" = "yes" ] || return
|
||
|
- [ -e /run/initramfs/loginit.pipe ] || return
|
||
|
- echo "DRACUT_LOG_END"
|
||
|
- exec 0<>/dev/console 1<>/dev/console 2<>/dev/console
|
||
|
- # wait for loginit
|
||
|
- i=0
|
||
|
- while [ $i -lt 10 ]; do
|
||
|
- if [ ! -e /run/initramfs/loginit.pipe ]; then
|
||
|
- j=$(jobs)
|
||
|
- [ -z "$j" ] && break
|
||
|
- [ -z "${j##*Running*}" ] || break
|
||
|
- fi
|
||
|
- sleep 0.1
|
||
|
- i=$(($i+1))
|
||
|
- done
|
||
|
-
|
||
|
- if [ $i -eq 10 ]; then
|
||
|
- kill %1 >/dev/null 2>&1
|
||
|
- kill $(while read line;do echo $line;done</run/initramfs/loginit.pid)
|
||
|
- fi
|
||
|
-
|
||
|
- set -x
|
||
|
- rm -f /run/initramfs/loginit.pipe /run/initramfs/loginit.pid
|
||
|
-}
|
||
|
-
|
||
|
NEWROOT="/sysroot"
|
||
|
[ -d $NEWROOT ] || mkdir -p -m 0755 $NEWROOT
|
||
|
|