dracut-019-57.git20120620

systemd is now the default init in the initramfs
This commit is contained in:
Harald Hoyer 2012-06-21 02:10:56 +02:00
parent d1bf89c255
commit e3ef5716a9
18 changed files with 849 additions and 1 deletions

View File

@ -0,0 +1,36 @@
From 361306c131a31c85d4b7ce40e33d6cbb589cb8b4 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Wed, 20 Jun 2012 18:28:35 +0200
Subject: [PATCH] check for arch before installing drivers/s390
---
modules.d/40network/module-setup.sh | 2 +-
modules.d/90multipath/module-setup.sh | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules.d/40network/module-setup.sh b/modules.d/40network/module-setup.sh
index 4ed8d03..a8efbc5 100755
--- a/modules.d/40network/module-setup.sh
+++ b/modules.d/40network/module-setup.sh
@@ -61,7 +61,7 @@ installkernel() {
return $_ret
}
- { find_kernel_modules_by_path drivers/net; find_kernel_modules_by_path drivers/s390/net; } \
+ { find_kernel_modules_by_path drivers/net; if [ "$_arch" = "s390" -o "$_arch" = "s390x" ]; then find_kernel_modules_by_path drivers/s390/net; fi; } \
| net_module_filter | instmods
instmods =drivers/net/phy
diff --git a/modules.d/90multipath/module-setup.sh b/modules.d/90multipath/module-setup.sh
index bf71fdc..0e8857c 100755
--- a/modules.d/90multipath/module-setup.sh
+++ b/modules.d/90multipath/module-setup.sh
@@ -44,7 +44,7 @@ installkernel() {
done
}
- ( find_kernel_modules_by_path drivers/scsi; find_kernel_modules_by_path drivers/s390/scsi ;
+ ( find_kernel_modules_by_path drivers/scsi; if [ "$_arch" = "s390" -o "$_arch" = "s390x" ]; then find_kernel_modules_by_path drivers/s390/scsi; fi;
find_kernel_modules_by_path drivers/md ) | mp_mod_filter | instmods
_ret=$?
[[ $debug ]] && set -x

View File

@ -0,0 +1,23 @@
From c7896f125183bbae0ef1403fb8aa5e46adf464ac Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Wed, 20 Jun 2012 18:29:42 +0200
Subject: [PATCH] dracut-shutdown.service: fixed ordering to be before
shutdown.target
---
dracut-shutdown.service | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dracut-shutdown.service b/dracut-shutdown.service
index 6756355..f96418b 100644
--- a/dracut-shutdown.service
+++ b/dracut-shutdown.service
@@ -8,7 +8,7 @@
[Unit]
Description=Restore /run/initramfs
After=getty@tty1.service prefdm.service
-Before=reboot.service
+Before=reboot.service shutdown.target
DefaultDependencies=no
ConditionPathExists=/run/initramfs/.need_shutdown
ConditionPathExists=!/run/initramfs/bin/sh

View File

@ -0,0 +1,104 @@
From 9f037266ee5b8da70e04b48bd69d8c2f602bbd4d Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Wed, 20 Jun 2012 18:34:35 +0200
Subject: [PATCH] systemd: output all service output to the journal also
---
modules.d/98systemd/dracut-initqueue.service | 4 ++--
modules.d/98systemd/dracut-pre-pivot.service | 4 ++--
modules.d/98systemd/dracut-pre-trigger.service | 4 ++--
modules.d/98systemd/dracut-pre-udev.service | 4 ++--
modules.d/98systemd/emergency.service | 4 ++--
modules.d/98systemd/rescue.service | 4 ++--
6 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/modules.d/98systemd/dracut-initqueue.service b/modules.d/98systemd/dracut-initqueue.service
index b0c8509..c87e6a0 100644
--- a/modules.d/98systemd/dracut-initqueue.service
+++ b/modules.d/98systemd/dracut-initqueue.service
@@ -17,8 +17,8 @@ Environment=HOME=/
WorkingDirectory=/
ExecStart=-/bin/dracut-initqueue
Type=simple
-StandardInput=tty-force
-StandardOutput=inherit
+StandardInput=tty
+StandardOutput=journal+console
StandardError=inherit
KillMode=process
diff --git a/modules.d/98systemd/dracut-pre-pivot.service b/modules.d/98systemd/dracut-pre-pivot.service
index 410e03e..0e04cb4 100644
--- a/modules.d/98systemd/dracut-pre-pivot.service
+++ b/modules.d/98systemd/dracut-pre-pivot.service
@@ -17,8 +17,8 @@ Environment=HOME=/
WorkingDirectory=/
ExecStart=-/bin/dracut-pre-pivot
Type=oneshot
-StandardInput=tty-force
-StandardOutput=inherit
+StandardInput=tty
+StandardOutput=journal+console
StandardError=inherit
KillMode=process
diff --git a/modules.d/98systemd/dracut-pre-trigger.service b/modules.d/98systemd/dracut-pre-trigger.service
index 080b1f5..18eb8fc 100644
--- a/modules.d/98systemd/dracut-pre-trigger.service
+++ b/modules.d/98systemd/dracut-pre-trigger.service
@@ -18,8 +18,8 @@ Environment=HOME=/
WorkingDirectory=/
ExecStart=-/bin/dracut-pre-trigger
Type=oneshot
-StandardInput=tty-force
-StandardOutput=inherit
+StandardInput=tty
+StandardOutput=journal+console
StandardError=inherit
KillMode=process
diff --git a/modules.d/98systemd/dracut-pre-udev.service b/modules.d/98systemd/dracut-pre-udev.service
index 09a349d..2447fc8 100644
--- a/modules.d/98systemd/dracut-pre-udev.service
+++ b/modules.d/98systemd/dracut-pre-udev.service
@@ -17,8 +17,8 @@ Environment=HOME=/
WorkingDirectory=/
ExecStart=-/bin/dracut-pre-udev
Type=oneshot
-StandardInput=tty-force
-StandardOutput=inherit
+StandardInput=tty
+StandardOutput=journal+console
StandardError=inherit
KillMode=process
diff --git a/modules.d/98systemd/emergency.service b/modules.d/98systemd/emergency.service
index 7c705c4..86fc13f 100644
--- a/modules.d/98systemd/emergency.service
+++ b/modules.d/98systemd/emergency.service
@@ -19,8 +19,8 @@ WorkingDirectory=/
ExecStart=-/bin/sh -i -l
ExecStopPost=-/usr/bin/systemctl --fail --no-block default
Type=idle
-StandardInput=tty-force
-StandardOutput=inherit
+StandardInput=tty
+StandardOutput=journal+console
StandardError=inherit
KillMode=process
IgnoreSIGPIPE=no
diff --git a/modules.d/98systemd/rescue.service b/modules.d/98systemd/rescue.service
index 652308c..afd04f7 100644
--- a/modules.d/98systemd/rescue.service
+++ b/modules.d/98systemd/rescue.service
@@ -21,8 +21,8 @@ ExecStart=-/bin/sh -i -l
#ExecStopPost=-/usr/bin/systemctl --fail --no-block switch-root /sysroot /sbin/init
ExecStopPost=-/usr/bin/systemctl --fail --no-block default
Type=idle
-StandardInput=tty-force
-StandardOutput=inherit
+StandardInput=tty
+StandardOutput=journal+console
StandardError=inherit
KillMode=process

View File

@ -0,0 +1,29 @@
From 529f7bf358d30f5e76cd680bd82fc5d954fa8a33 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Thu, 21 Jun 2012 01:01:07 +0200
Subject: [PATCH] systemd/module-setup.sh: add old udev systemd services
---
modules.d/98systemd/module-setup.sh | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/modules.d/98systemd/module-setup.sh b/modules.d/98systemd/module-setup.sh
index dbb9063..2160eb4 100755
--- a/modules.d/98systemd/module-setup.sh
+++ b/modules.d/98systemd/module-setup.sh
@@ -102,6 +102,15 @@ install() {
$systemdsystemunitdir/initrd-switch-root.target \
$systemdsystemunitdir/initrd-switch-root.service \
$systemdsystemunitdir/umount.target \
+ $systemdsystemunitdir/udev-control.socket \
+ $systemdsystemunitdir/udev-kernel.socket \
+ $systemdsystemunitdir/udev.service \
+ $systemdsystemunitdir/udev-settle.service \
+ $systemdsystemunitdir/udev-trigger.service \
+ $systemdsystemunitdir/basic.target.wants/udev.service \
+ $systemdsystemunitdir/basic.target.wants/udev-trigger.service \
+ $systemdsystemunitdir/sockets.target.wants/udev-control.socket \
+ $systemdsystemunitdir/sockets.target.wants/udev-kernel.socket
for i in /etc/systemd/*.conf; do
dracut_install "$i"

View File

@ -0,0 +1,82 @@
From b47e023767ae6c8dad816d44b3ffd8dcd5048afe Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Thu, 21 Jun 2012 01:01:51 +0200
Subject: [PATCH] systemd: fix emergency.service and rescue.service
---
modules.d/98systemd/emergency.service | 10 +++++-----
modules.d/98systemd/module-setup.sh | 2 +-
modules.d/98systemd/rescue.service | 11 +++++------
3 files changed, 11 insertions(+), 12 deletions(-)
diff --git a/modules.d/98systemd/emergency.service b/modules.d/98systemd/emergency.service
index 86fc13f..431e2b0 100644
--- a/modules.d/98systemd/emergency.service
+++ b/modules.d/98systemd/emergency.service
@@ -10,17 +10,17 @@
[Unit]
Description=Emergency Shell
DefaultDependencies=no
-Conflicts=shutdown.target
-Before=shutdown.target
[Service]
Environment=HOME=/
WorkingDirectory=/
+ExecStartPre=-/bin/plymouth quit
+ExecStartPre=-/bin/echo -e '\n\nEntering emergency mode. Exit the shell to continue.\nType "journalctl" to view system logs.\n'
ExecStart=-/bin/sh -i -l
-ExecStopPost=-/usr/bin/systemctl --fail --no-block default
+ExecStopPost=-/bin/rm -f /.console_lock
Type=idle
-StandardInput=tty
-StandardOutput=journal+console
+StandardInput=tty-force
+StandardOutput=inherit
StandardError=inherit
KillMode=process
IgnoreSIGPIPE=no
diff --git a/modules.d/98systemd/module-setup.sh b/modules.d/98systemd/module-setup.sh
index 2160eb4..91f50af 100755
--- a/modules.d/98systemd/module-setup.sh
+++ b/modules.d/98systemd/module-setup.sh
@@ -116,7 +116,7 @@ install() {
dracut_install "$i"
done
- dracut_install journalctl systemctl
+ dracut_install journalctl systemctl echo
ln -fs $systemdutildir/systemd "$initdir/init"
diff --git a/modules.d/98systemd/rescue.service b/modules.d/98systemd/rescue.service
index afd04f7..b5fb663 100644
--- a/modules.d/98systemd/rescue.service
+++ b/modules.d/98systemd/rescue.service
@@ -10,21 +10,20 @@
[Unit]
Description=Rescue Shell
DefaultDependencies=no
-Conflicts=shutdown.target
-After=basic.target plymouth-start.service
-Before=shutdown.target
[Service]
Environment=HOME=/
WorkingDirectory=/
+ExecStartPre=-/bin/plymouth quit
ExecStart=-/bin/sh -i -l
-#ExecStopPost=-/usr/bin/systemctl --fail --no-block switch-root /sysroot /sbin/init
+ExecStopPost=-/bin/rm -f /.console_lock
ExecStopPost=-/usr/bin/systemctl --fail --no-block default
Type=idle
-StandardInput=tty
-StandardOutput=journal+console
+StandardInput=tty-force
+StandardOutput=inherit
StandardError=inherit
KillMode=process
+IgnoreSIGPIPE=no
# Bash ignores SIGTERM, so we send SIGHUP instead, to ensure that bash
# terminates cleanly.

View File

@ -0,0 +1,74 @@
From f6eb1f1d1f608b9b9983bdfaf4a867143e21b2b7 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Thu, 21 Jun 2012 01:02:48 +0200
Subject: [PATCH] systemd: do not redirect to /dev/console
---
modules.d/98systemd/dracut-cmdline.sh | 2 --
modules.d/98systemd/dracut-initqueue.sh | 1 -
modules.d/98systemd/dracut-pre-pivot.sh | 1 -
modules.d/98systemd/dracut-pre-trigger.sh | 1 -
modules.d/98systemd/dracut-pre-udev.sh | 1 -
5 files changed, 6 deletions(-)
diff --git a/modules.d/98systemd/dracut-cmdline.sh b/modules.d/98systemd/dracut-cmdline.sh
index 26ca9c2..e1a75ea 100755
--- a/modules.d/98systemd/dracut-cmdline.sh
+++ b/modules.d/98systemd/dracut-cmdline.sh
@@ -7,8 +7,6 @@ NEWROOT="/sysroot"
[ -d /run/initramfs ] || mkdir -p -m 0755 /run/initramfs
[ -d /run/lock ] || mkdir -p -m 0755 /run/lock
-exec </dev/console >/dev/console 2>&1
-
if [ -f /dracut-state.sh ]; then
. /dracut-state.sh || :
fi
diff --git a/modules.d/98systemd/dracut-initqueue.sh b/modules.d/98systemd/dracut-initqueue.sh
index 5d51a80..830dbee 100755
--- a/modules.d/98systemd/dracut-initqueue.sh
+++ b/modules.d/98systemd/dracut-initqueue.sh
@@ -1,7 +1,6 @@
#!/bin/sh
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
-exec </dev/console >/dev/console 2>&1
if [ -f /dracut-state.sh ]; then
. /dracut-state.sh || :
diff --git a/modules.d/98systemd/dracut-pre-pivot.sh b/modules.d/98systemd/dracut-pre-pivot.sh
index a8e9fc1..eb7e932 100755
--- a/modules.d/98systemd/dracut-pre-pivot.sh
+++ b/modules.d/98systemd/dracut-pre-pivot.sh
@@ -2,7 +2,6 @@
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
-exec </dev/console >/dev/console 2>&1
if [ -f /dracut-state.sh ]; then
. /dracut-state.sh || :
fi
diff --git a/modules.d/98systemd/dracut-pre-trigger.sh b/modules.d/98systemd/dracut-pre-trigger.sh
index 0539a01..9521eaa 100755
--- a/modules.d/98systemd/dracut-pre-trigger.sh
+++ b/modules.d/98systemd/dracut-pre-trigger.sh
@@ -1,7 +1,6 @@
#!/bin/sh
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
-exec </dev/console >/dev/console 2>&1
if [ -f /dracut-state.sh ]; then
. /dracut-state.sh || :
diff --git a/modules.d/98systemd/dracut-pre-udev.sh b/modules.d/98systemd/dracut-pre-udev.sh
index 5740174..3b5ac37 100755
--- a/modules.d/98systemd/dracut-pre-udev.sh
+++ b/modules.d/98systemd/dracut-pre-udev.sh
@@ -2,7 +2,6 @@
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
-exec </dev/console >/dev/console 2>&1
if [ -f /dracut-state.sh ]; then
. /dracut-state.sh || :
fi

View File

@ -0,0 +1,33 @@
From 3d3ddf082b6b61ae559520ff039f7592a58e88b2 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Thu, 21 Jun 2012 01:03:22 +0200
Subject: [PATCH] systemd: do not flock for console
---
modules.d/98systemd/dracut-initqueue.sh | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/modules.d/98systemd/dracut-initqueue.sh b/modules.d/98systemd/dracut-initqueue.sh
index 830dbee..03f1c9b 100755
--- a/modules.d/98systemd/dracut-initqueue.sh
+++ b/modules.d/98systemd/dracut-initqueue.sh
@@ -59,8 +59,7 @@ while :; do
fi
main_loop=$(($main_loop+1))
- [ $main_loop -gt $RDRETRY ] \
- && { flock -s 9 ; emergency_shell "Could not boot."; } 9>/.console_lock
+ [ $main_loop -gt $RDRETRY ] && emergency_shell "Could not boot."
done
unset job
@@ -95,8 +94,7 @@ while :; do
done
i=$(($i+1))
- [ $i -gt 20 ] \
- && { flock -s 9 ; emergency_shell "Can't mount root filesystem"; } 9>/.console_lock
+ [ $i -gt 20 ] && emergency_shell "Can't mount root filesystem"
done
{

View File

@ -0,0 +1,26 @@
From edcbd379d50218695681e9bb13288f9603da04f6 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Thu, 21 Jun 2012 01:04:15 +0200
Subject: [PATCH] systemd/dracut-pre-pivot.sh: stop old udev services
---
modules.d/98systemd/dracut-pre-pivot.sh | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/modules.d/98systemd/dracut-pre-pivot.sh b/modules.d/98systemd/dracut-pre-pivot.sh
index eb7e932..6685210 100755
--- a/modules.d/98systemd/dracut-pre-pivot.sh
+++ b/modules.d/98systemd/dracut-pre-pivot.sh
@@ -34,7 +34,11 @@ done
echo "NEWROOT=\"$NEWROOT\"" >> /run/initramfs/switch-root.conf
udevadm control --stop-exec-queue
-systemctl stop systemd-udev.service
+
+for i in systemd-udev.service udev.service; do
+ systemctl is-active $i >/dev/null 2>&1 && systemctl stop $i
+done
+
udevadm info --cleanup-db
# remove helper symlink

View File

@ -0,0 +1,66 @@
From f653c8622995fc39d0715a6bed60618c61ed0b5e Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Thu, 21 Jun 2012 01:05:15 +0200
Subject: [PATCH] systemd/dracut-cmdline: make dracut-cmdline a service
convert dracut-cmdline from hook to service after the journal
---
modules.d/98systemd/dracut-cmdline.service | 29 ++++++++++++++++++++++++++++
modules.d/98systemd/module-setup.sh | 7 +++++--
2 files changed, 34 insertions(+), 2 deletions(-)
create mode 100644 modules.d/98systemd/dracut-cmdline.service
diff --git a/modules.d/98systemd/dracut-cmdline.service b/modules.d/98systemd/dracut-cmdline.service
new file mode 100644
index 0000000..938ccbe
--- /dev/null
+++ b/modules.d/98systemd/dracut-cmdline.service
@@ -0,0 +1,29 @@
+# This file is part of systemd.
+#
+# systemd is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or
+# (at your option) any later version.
+
+# See systemd.special(7) for details
+
+[Unit]
+Description=Dracut cmdline hook
+DefaultDependencies=no
+Before=dracut-pre-udev.service
+After=systemd-journald.socket
+Wants=systemd-journald.socket
+
+[Service]
+Environment=HOME=/
+WorkingDirectory=/
+ExecStart=-/bin/dracut-cmdline
+Type=oneshot
+StandardInput=null
+StandardOutput=syslog
+StandardError=syslog+console
+KillMode=process
+
+# Bash ignores SIGTERM, so we send SIGHUP instead, to ensure that bash
+# terminates cleanly.
+KillSignal=SIGHUP
diff --git a/modules.d/98systemd/module-setup.sh b/modules.d/98systemd/module-setup.sh
index 91f50af..adef939 100755
--- a/modules.d/98systemd/module-setup.sh
+++ b/modules.d/98systemd/module-setup.sh
@@ -130,9 +130,12 @@ install() {
inst "$moddir/initrd-switch-root.service" ${systemdsystemunitdir}/initrd-switch-root.service
ln -s basic.target "${initdir}${systemdsystemunitdir}/default.target"
- inst "$moddir/dracut-cmdline.sh" ${systemdsystemunitdir}-generators/dracut-cmdline.sh
-
mkdir -p "${initdir}${systemdsystemunitdir}/basic.target.wants"
+
+ inst "$moddir/dracut-cmdline.sh" /bin/dracut-cmdline
+ inst "$moddir/dracut-cmdline.service" ${systemdsystemunitdir}/dracut-cmdline.service
+ ln -s ../dracut-cmdline.service "${initdir}${systemdsystemunitdir}/basic.target.wants/dracut-cmdline.service"
+
inst "$moddir/dracut-pre-udev.sh" /bin/dracut-pre-udev
inst "$moddir/dracut-pre-udev.service" ${systemdsystemunitdir}/dracut-pre-udev.service
ln -s ../dracut-pre-udev.service "${initdir}${systemdsystemunitdir}/basic.target.wants/dracut-pre-udev.service"

View File

@ -0,0 +1,22 @@
From f82659c552b453f832c84c808e4e721c18be6a24 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Thu, 21 Jun 2012 01:06:30 +0200
Subject: [PATCH] systemd/dracut-pre-pivot.sh: remove trailing space
---
modules.d/98systemd/dracut-pre-pivot.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/98systemd/dracut-pre-pivot.sh b/modules.d/98systemd/dracut-pre-pivot.sh
index 6685210..38e9c3c 100755
--- a/modules.d/98systemd/dracut-pre-pivot.sh
+++ b/modules.d/98systemd/dracut-pre-pivot.sh
@@ -18,7 +18,7 @@ getarg 'rd.break=cleanup' 'rdbreak=cleanup' && emergency_shell -n cleanup "Break
source_hook cleanup
# By the time we get here, the root filesystem should be mounted.
-# Try to find init.
+# Try to find init.
for i in "$(getarg real_init=)" "$(getarg init=)"; do
[ -n "$i" ] || continue

View File

@ -0,0 +1,22 @@
From a51aa0d0e281dc9f72a99141156e88ecbfdf55dd Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Thu, 21 Jun 2012 01:07:08 +0200
Subject: [PATCH] systemd/dracut-pre-udev.service: fixed description
---
modules.d/98systemd/dracut-pre-udev.service | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/98systemd/dracut-pre-udev.service b/modules.d/98systemd/dracut-pre-udev.service
index 2447fc8..9b2d929 100644
--- a/modules.d/98systemd/dracut-pre-udev.service
+++ b/modules.d/98systemd/dracut-pre-udev.service
@@ -8,7 +8,7 @@
# See systemd.special(7) for details
[Unit]
-Description=Dracut pre-trigger hook
+Description=Dracut pre-udev hook
DefaultDependencies=no
Before=systemd-udev.service

View File

@ -0,0 +1,56 @@
From b03e991113f7e33c0fd072e16d4ebd862542e720 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Thu, 21 Jun 2012 01:08:03 +0200
Subject: [PATCH] systemd: fixed ordering of services
---
modules.d/98systemd/dracut-initqueue.service | 3 ++-
modules.d/98systemd/dracut-pre-trigger.service | 5 +++--
modules.d/98systemd/dracut-pre-udev.service | 4 +++-
3 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/modules.d/98systemd/dracut-initqueue.service b/modules.d/98systemd/dracut-initqueue.service
index c87e6a0..89aa304 100644
--- a/modules.d/98systemd/dracut-initqueue.service
+++ b/modules.d/98systemd/dracut-initqueue.service
@@ -10,7 +10,8 @@
[Unit]
Description=Dracut initqueue hook
DefaultDependencies=no
-After=systemd-udev-trigger.service
+After=systemd-udev-trigger.service udev-trigger.service
+Wants=systemd-udev-trigger.service udev-trigger.service
[Service]
Environment=HOME=/
diff --git a/modules.d/98systemd/dracut-pre-trigger.service b/modules.d/98systemd/dracut-pre-trigger.service
index 18eb8fc..1ab07a1 100644
--- a/modules.d/98systemd/dracut-pre-trigger.service
+++ b/modules.d/98systemd/dracut-pre-trigger.service
@@ -10,8 +10,9 @@
[Unit]
Description=Dracut pre-trigger hook
DefaultDependencies=no
-After=systemd-udev.service
-Before=systemd-udev-trigger.service
+Before=systemd-udev-trigger.service udev-trigger.service dracut-initqueue.service
+After=dracut-pre-udev.service systemd-udev.service udev.service
+Wants=dracut-pre-udev.service systemd-udev.service udev.service
[Service]
Environment=HOME=/
diff --git a/modules.d/98systemd/dracut-pre-udev.service b/modules.d/98systemd/dracut-pre-udev.service
index 9b2d929..579316e 100644
--- a/modules.d/98systemd/dracut-pre-udev.service
+++ b/modules.d/98systemd/dracut-pre-udev.service
@@ -10,7 +10,9 @@
[Unit]
Description=Dracut pre-udev hook
DefaultDependencies=no
-Before=systemd-udev.service
+Before=systemd-udev.service udev.service dracut-pre-trigger.service
+After=dracut-cmdline.service
+Wants=dracut-cmdline.service
[Service]
Environment=HOME=/

View File

@ -0,0 +1,80 @@
From e08710a28979575f676be63658310df849b29076 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Thu, 21 Jun 2012 01:08:29 +0200
Subject: [PATCH] systemd: fixed I/O of services
---
modules.d/98systemd/dracut-initqueue.service | 6 +++---
modules.d/98systemd/dracut-pre-pivot.service | 6 +++---
modules.d/98systemd/dracut-pre-trigger.service | 6 +++---
modules.d/98systemd/dracut-pre-udev.service | 6 +++---
4 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/modules.d/98systemd/dracut-initqueue.service b/modules.d/98systemd/dracut-initqueue.service
index 89aa304..4f86eaf 100644
--- a/modules.d/98systemd/dracut-initqueue.service
+++ b/modules.d/98systemd/dracut-initqueue.service
@@ -18,9 +18,9 @@ Environment=HOME=/
WorkingDirectory=/
ExecStart=-/bin/dracut-initqueue
Type=simple
-StandardInput=tty
-StandardOutput=journal+console
-StandardError=inherit
+StandardInput=null
+StandardOutput=syslog
+StandardError=syslog+console
KillMode=process
# Bash ignores SIGTERM, so we send SIGHUP instead, to ensure that bash
diff --git a/modules.d/98systemd/dracut-pre-pivot.service b/modules.d/98systemd/dracut-pre-pivot.service
index 0e04cb4..e61750b 100644
--- a/modules.d/98systemd/dracut-pre-pivot.service
+++ b/modules.d/98systemd/dracut-pre-pivot.service
@@ -17,9 +17,9 @@ Environment=HOME=/
WorkingDirectory=/
ExecStart=-/bin/dracut-pre-pivot
Type=oneshot
-StandardInput=tty
-StandardOutput=journal+console
-StandardError=inherit
+StandardInput=null
+StandardOutput=syslog
+StandardError=syslog+console
KillMode=process
# Bash ignores SIGTERM, so we send SIGHUP instead, to ensure that bash
diff --git a/modules.d/98systemd/dracut-pre-trigger.service b/modules.d/98systemd/dracut-pre-trigger.service
index 1ab07a1..234839c 100644
--- a/modules.d/98systemd/dracut-pre-trigger.service
+++ b/modules.d/98systemd/dracut-pre-trigger.service
@@ -19,9 +19,9 @@ Environment=HOME=/
WorkingDirectory=/
ExecStart=-/bin/dracut-pre-trigger
Type=oneshot
-StandardInput=tty
-StandardOutput=journal+console
-StandardError=inherit
+StandardInput=null
+StandardOutput=syslog
+StandardError=syslog+console
KillMode=process
# Bash ignores SIGTERM, so we send SIGHUP instead, to ensure that bash
diff --git a/modules.d/98systemd/dracut-pre-udev.service b/modules.d/98systemd/dracut-pre-udev.service
index 579316e..11be61b 100644
--- a/modules.d/98systemd/dracut-pre-udev.service
+++ b/modules.d/98systemd/dracut-pre-udev.service
@@ -19,9 +19,9 @@ Environment=HOME=/
WorkingDirectory=/
ExecStart=-/bin/dracut-pre-udev
Type=oneshot
-StandardInput=tty
-StandardOutput=journal+console
-StandardError=inherit
+StandardInput=null
+StandardOutput=syslog
+StandardError=syslog+console
KillMode=process
# Bash ignores SIGTERM, so we send SIGHUP instead, to ensure that bash

View File

@ -0,0 +1,58 @@
From d9087a2d85dd65e1e33c8c2247d4fccfd7fbc5da Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Thu, 21 Jun 2012 01:09:38 +0200
Subject: [PATCH] base/dracut-lib.sh: change output of info() and warn() for
systemd
---
modules.d/99base/dracut-lib.sh | 36 +++++++++++++++++++++++++-----------
1 file changed, 25 insertions(+), 11 deletions(-)
diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
index 8cfd7b3..e0c4c19 100755
--- a/modules.d/99base/dracut-lib.sh
+++ b/modules.d/99base/dracut-lib.sh
@@ -323,18 +323,32 @@ check_quiet() {
fi
}
-warn() {
- check_quiet
- echo "<28>dracut Warning: $@" > /dev/kmsg
- echo "dracut Warning: $@" >&2
-}
+if [ ! -x /lib/systemd/systemd ]; then
-info() {
- check_quiet
- echo "<30>dracut: $@" > /dev/kmsg
- [ "$DRACUT_QUIET" != "yes" ] && \
- echo "dracut: $@"
-}
+ warn() {
+ check_quiet
+ echo "<28>dracut Warning: $@" > /dev/kmsg
+ echo "dracut Warning: $@" >&2
+ }
+
+ info() {
+ check_quiet
+ echo "<30>dracut: $@" > /dev/kmsg
+ [ "$DRACUT_QUIET" != "yes" ] && \
+ echo "dracut: $@"
+ }
+
+else
+
+ warn() {
+ echo "Warning: $@" >&2
+ }
+
+ info() {
+ echo "$@"
+ }
+
+fi
vwarn() {
while read line; do

View File

@ -0,0 +1,74 @@
From 1e570bf8e3010c1cc4cec2f67e0cefd658f90b48 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Thu, 21 Jun 2012 01:10:13 +0200
Subject: [PATCH] base/dracut-lib.sh: for systemd start emergency.service
do not spawn the shell, start the emergency.service for systemd
---
modules.d/99base/dracut-lib.sh | 47 +++++++++++++++++++++++++---------------
1 file changed, 29 insertions(+), 18 deletions(-)
diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
index e0c4c19..5dc3fbd 100755
--- a/modules.d/99base/dracut-lib.sh
+++ b/modules.d/99base/dracut-lib.sh
@@ -825,30 +825,41 @@ emergency_shell()
_rdshell_name=$2; action="Shutdown"; hook="shutdown-emergency"
shift 2
fi
+
echo ; echo
warn $@
source_hook "$hook"
echo
+
if getargbool 1 rd.shell -y rdshell || getarg rd.break rdbreak; then
- echo "Dropping to debug shell."
- echo
- export PS1="$_rdshell_name:\${PWD}# "
- [ -e /.profile ] || >/.profile
-
- _ctty="$(getarg rd.ctty=)" && _ctty="/dev/${_ctty##*/}"
- if [ -z "$_ctty" ]; then
- _ctty=console
- while [ -f /sys/class/tty/$_ctty/active ]; do
- _ctty=$(cat /sys/class/tty/$_ctty/active)
- _ctty=${_ctty##* } # last one in the list
- done
- _ctty=/dev/$_ctty
- fi
- [ -c "$_ctty" ] || _ctty=/dev/tty1
- strstr "$(setsid --help 2>/dev/null)" "ctty" && CTTY="-c"
+ if [ -x /lib/systemd/systemd ]; then
+ > /.console_lock
+ echo "PS1=\"$_rdshell_name:\${PWD}# \"" >/etc/profile
+ systemctl start emergency.service
+ debug_off
+ while [ -e /.console_lock ]; do sleep 1; done
+ debug_on
+ else
+ echo "Dropping to debug shell."
+ echo
+ export PS1="$_rdshell_name:\${PWD}# "
+ [ -e /.profile ] || >/.profile
+
+ _ctty="$(getarg rd.ctty=)" && _ctty="/dev/${_ctty##*/}"
+ if [ -z "$_ctty" ]; then
+ _ctty=console
+ while [ -f /sys/class/tty/$_ctty/active ]; do
+ _ctty=$(cat /sys/class/tty/$_ctty/active)
+ _ctty=${_ctty##* } # last one in the list
+ done
+ _ctty=/dev/$_ctty
+ fi
+ [ -c "$_ctty" ] || _ctty=/dev/tty1
+ strstr "$(setsid --help 2>/dev/null)" "ctty" && CTTY="-c"
# stop watchdog
- echo 'V' > /dev/watchdog
- setsid $CTTY /bin/sh -i -l 0<$_ctty 1>$_ctty 2>&1
+ echo 'V' > /dev/watchdog
+ setsid $CTTY /bin/sh -i -l 0<$_ctty 1>$_ctty 2>&1
+ fi
else
warn "$action has failed. To debug this issue add \"rd.shell\" to the kernel command line."
# cause a kernel panic

View File

@ -0,0 +1,21 @@
From 16c88e493f87aeba449434947a2a1924cf49db43 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Thu, 21 Jun 2012 01:09:02 +0200
Subject: [PATCH] dracut.conf.d/fedora.conf.example: make systemd default
---
dracut.conf.d/fedora.conf.example | 1 +
1 file changed, 1 insertion(+)
diff --git a/dracut.conf.d/fedora.conf.example b/dracut.conf.d/fedora.conf.example
index f3f57f1..25b5cfa 100644
--- a/dracut.conf.d/fedora.conf.example
+++ b/dracut.conf.d/fedora.conf.example
@@ -4,6 +4,7 @@
i18n_vars="/etc/sysconfig/keyboard:KEYTABLE-KEYMAP /etc/sysconfig/i18n:SYSFONT-FONT,FONTACM-FONT_MAP,FONT_UNIMAP"
omit_dracutmodules+=" dash "
omit_drivers+=" .*/fs/ocfs/.* "
+add_dracutmodules+=" systemd "
stdloglvl=3
realinitpath="/usr/lib/systemd/systemd"
install_items+=" vi /etc/virc ps grep cat rm "

View File

@ -0,0 +1,21 @@
From 1e2673fd98d05ae5103f24fbd8fb748c9dfc5a45 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Thu, 21 Jun 2012 01:20:11 +0200
Subject: [PATCH] dracut.spec: require systemd >= 44-15
---
dracut.spec | 1 +
1 file changed, 1 insertion(+)
diff --git a/dracut.spec b/dracut.spec
index 6e8c733..982a66d 100644
--- a/dracut.spec
+++ b/dracut.spec
@@ -80,6 +80,7 @@ Requires: file
Requires: udev > 166
%if 0%{?fedora} || 0%{?rhel} > 6
Requires: util-linux >= 2.21
+Requires: systemd >= 44-15
%else
Requires: util-linux-ng >= 2.21
%endif

View File

@ -10,7 +10,7 @@
Name: dracut Name: dracut
Version: 019 Version: 019
Release: 40.git20120618%{?dist} Release: 57.git20120620%{?dist}
Summary: Initramfs generator using udev Summary: Initramfs generator using udev
%if 0%{?fedora} || 0%{?rhel} %if 0%{?fedora} || 0%{?rhel}
@ -63,6 +63,23 @@ Patch36: 0036-TEST-50-MULTINIC-add-watchdog.patch
Patch37: 0037-TEST-20-NFS-libnss-cleanup.patch Patch37: 0037-TEST-20-NFS-libnss-cleanup.patch
Patch38: 0038-TEST-50-MULTINIC-libnss-cleanup.patch Patch38: 0038-TEST-50-MULTINIC-libnss-cleanup.patch
Patch39: 0039-disable-TEST-16-DMSQUASH-for-now.patch Patch39: 0039-disable-TEST-16-DMSQUASH-for-now.patch
Patch40: 0040-check-for-arch-before-installing-drivers-s390.patch
Patch41: 0041-dracut-shutdown.service-fixed-ordering-to-be-before-.patch
Patch42: 0042-systemd-output-all-service-output-to-the-journal-als.patch
Patch43: 0043-systemd-module-setup.sh-add-old-udev-systemd-service.patch
Patch44: 0044-systemd-fix-emergency.service-and-rescue.service.patch
Patch45: 0045-systemd-do-not-redirect-to-dev-console.patch
Patch46: 0046-systemd-do-not-flock-for-console.patch
Patch47: 0047-systemd-dracut-pre-pivot.sh-stop-old-udev-services.patch
Patch48: 0048-systemd-dracut-cmdline-make-dracut-cmdline-a-service.patch
Patch49: 0049-systemd-dracut-pre-pivot.sh-remove-trailing-space.patch
Patch50: 0050-systemd-dracut-pre-udev.service-fixed-description.patch
Patch51: 0051-systemd-fixed-ordering-of-services.patch
Patch52: 0052-systemd-fixed-I-O-of-services.patch
Patch53: 0053-base-dracut-lib.sh-change-output-of-info-and-warn-fo.patch
Patch54: 0054-base-dracut-lib.sh-for-systemd-start-emergency.servi.patch
Patch55: 0055-dracut.conf.d-fedora.conf.example-make-systemd-defau.patch
Patch56: 0056-dracut.spec-require-systemd-44-15.patch
BuildArch: noarch BuildArch: noarch
@ -120,6 +137,7 @@ Requires: file
Requires: udev > 166 Requires: udev > 166
%if 0%{?fedora} || 0%{?rhel} > 6 %if 0%{?fedora} || 0%{?rhel} > 6
Requires: util-linux >= 2.21 Requires: util-linux >= 2.21
Requires: systemd >= 44-15
%else %else
Requires: util-linux-ng >= 2.21 Requires: util-linux-ng >= 2.21
%endif %endif
@ -383,6 +401,9 @@ rm -rf $RPM_BUILD_ROOT
%dir /var/lib/dracut/overlay %dir /var/lib/dracut/overlay
%changelog %changelog
* Thu Jun 21 2012 Harald Hoyer <harald@redhat.com> 019-57.git20120620
- systemd is now the default init in the initramfs
* Mon Jun 18 2012 Harald Hoyer <harald@redhat.com> 019-40.git20120618 * Mon Jun 18 2012 Harald Hoyer <harald@redhat.com> 019-40.git20120618
- new upstream version - new upstream version