diff --git a/0029-Fixed-the-dracut-shutdown.service.patch b/0029-Fixed-the-dracut-shutdown.service.patch new file mode 100644 index 0000000..123a1eb --- /dev/null +++ b/0029-Fixed-the-dracut-shutdown.service.patch @@ -0,0 +1,49 @@ +From 25b987fed6bd5926a5c1d4027ec91a3c56d3aa85 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Mon, 8 Dec 2014 10:43:54 +0100 +Subject: [PATCH] Fixed the dracut-shutdown.service + +Make the service a oneshot service, which remains after exit. This +ensures, that the ExecStop is executed later on, if a shutdown occurs. +--- + dracut-initramfs-restore.sh | 4 ++++ + modules.d/98systemd/dracut-shutdown.service | 7 ++++--- + 2 files changed, 8 insertions(+), 3 deletions(-) + +diff --git a/dracut-initramfs-restore.sh b/dracut-initramfs-restore.sh +index 8b30af1..8b9b80f 100644 +--- a/dracut-initramfs-restore.sh ++++ b/dracut-initramfs-restore.sh +@@ -2,6 +2,10 @@ + + set -e + ++# do some sanity checks first ++[ -e /run/initramfs/bin/sh ] && exit 0 ++[ -e /run/initramfs/.need_shutdown ] || exit 0 ++ + KERNEL_VERSION="$(uname -r)" + + [[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut +diff --git a/modules.d/98systemd/dracut-shutdown.service b/modules.d/98systemd/dracut-shutdown.service +index a4a08ca..21c9d29 100644 +--- a/modules.d/98systemd/dracut-shutdown.service ++++ b/modules.d/98systemd/dracut-shutdown.service +@@ -8,13 +8,14 @@ + [Unit] + Description=Restore /run/initramfs on shutdown + Documentation=man:dracut-shutdown.service(8) +-After=local-fs.target ++After=local-fs.target boot.mount boot.automount + Wants=local-fs.target +-Before=systemd-reboot.service shutdown.target ++Conflicts=shutdown.target umount.target + DefaultDependencies=no +-ConditionPathExists=/run/initramfs/.need_shutdown + ConditionPathExists=!/run/initramfs/bin/sh + + [Service] ++RemainAfterExit=yes ++Type=oneshot + ExecStart=/bin/true + ExecStop=/usr/lib/dracut/dracut-initramfs-restore diff --git a/dracut.spec b/dracut.spec index a60ff77..f4b4ac6 100644 --- a/dracut.spec +++ b/dracut.spec @@ -11,7 +11,7 @@ Name: dracut Version: 040 -Release: 29.git20141204%{?dist} +Release: 30.git20141208%{?dist} Summary: Initramfs generator using udev %if 0%{?fedora} || 0%{?rhel} @@ -58,6 +58,7 @@ Patch25: 0025-cms-cms-write-ifcfg.sh-turn-SUBCHANNELS-into-lowerca.patch Patch26: 0026-40network-Fix-the-syntax-to-correct-the-judgment-sen.patch Patch27: 0027-initrd-release-move-from-etc-to-usr-lib.patch Patch28: 0028-dracut.conf.d-fedora.conf.example-turn-on-early_micr.patch +Patch29: 0029-Fixed-the-dracut-shutdown.service.patch Source1: https://www.gnu.org/licenses/lgpl-2.1.txt @@ -506,6 +507,9 @@ rm -rf -- $RPM_BUILD_ROOT %endif %changelog +* Mon Dec 08 2014 Harald Hoyer 040-30.git20141208 +- fixed dracut-shutdown + * Thu Dec 04 2014 Harald Hoyer 040-29.git20141204 - git snapshot