From 60a1f9a3682fc8892149cd6d51d51533cf44051a Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 20 Jul 2012 14:54:30 +0200 Subject: [PATCH] dracut-022-2.git20120720 - fixed some race condition for resume from hibernation --- ...esume-in-the-initqueue-finished-hook.patch | 45 +++++++++++++++++++ dracut.spec | 6 ++- 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 0001-resume-move-resume-in-the-initqueue-finished-hook.patch diff --git a/0001-resume-move-resume-in-the-initqueue-finished-hook.patch b/0001-resume-move-resume-in-the-initqueue-finished-hook.patch new file mode 100644 index 0000000..79df308 --- /dev/null +++ b/0001-resume-move-resume-in-the-initqueue-finished-hook.patch @@ -0,0 +1,45 @@ +From 24450a5ab74db0f4ecaeee5dedaa8aff6e04ca5c Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Fri, 20 Jul 2012 14:44:12 +0200 +Subject: [PATCH] resume: move resume in the initqueue/finished hook + +this ensures, that resume is called as soon as possible +--- + modules.d/95resume/resume-genrules.sh | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/modules.d/95resume/resume-genrules.sh b/modules.d/95resume/resume-genrules.sh +index 34511d7..f16df8c 100755 +--- a/modules.d/95resume/resume-genrules.sh ++++ b/modules.d/95resume/resume-genrules.sh +@@ -21,14 +21,14 @@ if [ -n "$resume" ]; then + + { + if [ -x /usr/sbin/resume ]; then +- printf "KERNEL==\"%s\", ACTION==\"add|change\", ENV{ID_FS_TYPE}==\"suspend|swsuspend|swsupend\", RUN+=\"/sbin/initqueue /usr/sbin/resume %s '%s'\"\n" \ ++ printf "KERNEL==\"%s\", ACTION==\"add|change\", ENV{ID_FS_TYPE}==\"suspend|swsuspend|swsupend\", RUN+=\"/sbin/initqueue --finished --unique --name 00resume /usr/sbin/resume %s \'%s\'\"\n" \ + ${resume#/dev/} "$a_splash" "$resume"; +- printf "SYMLINK==\"%s\", ACTION==\"add|change\", ENV{ID_FS_TYPE}==\"suspend|swsuspend|swsupend\", RUN+=\"/sbin/initqueue /usr/sbin/resume %s '%s'\"\n" \ ++ printf "SYMLINK==\"%s\", ACTION==\"add|change\", ENV{ID_FS_TYPE}==\"suspend|swsuspend|swsupend\", RUN+=\"/sbin/initqueue --finished --unique --name 00resume /usr/sbin/resume %s \'%s\'\"\n" \ + ${resume#/dev/} "$a_splash" "$resume"; + fi +- printf "KERNEL==\"%s\", ACTION==\"add|change\", ENV{ID_FS_TYPE}==\"suspend|swsuspend|swsupend\", RUN+=\"/sbin/initqueue /bin/sh -c 'echo %%M:%%m > /sys/power/resume'\"\n" \ ++ printf "KERNEL==\"%s\", ACTION==\"add|change\", ENV{ID_FS_TYPE}==\"suspend|swsuspend|swsupend\", RUN+=\"/sbin/initqueue --finished --unique --name 00resume echo %%M:%%m > /sys/power/resume\"\n" \ + ${resume#/dev/}; +- printf "SYMLINK==\"%s\", ACTION==\"add|change\", ENV{ID_FS_TYPE}==\"suspend|swsuspend|swsupend\", RUN+=\"/sbin/initqueue /bin/sh -c 'echo %%M:%%m > /sys/power/resume'\"\n" \ ++ printf "SYMLINK==\"%s\", ACTION==\"add|change\", ENV{ID_FS_TYPE}==\"suspend|swsuspend|swsupend\", RUN+=\"/sbin/initqueue --finished --unique --name 00resume echo %%M:%%m > /sys/power/resume\"\n" \ + ${resume#/dev/}; + } >> /etc/udev/rules.d/99-resume.rules + +@@ -43,9 +43,9 @@ if [ -n "$resume" ]; then + elif ! getarg noresume; then + { + if [ -x /usr/sbin/resume ]; then +- printf "SUBSYSTEM==\"block\", ACTION==\"add|change\", ENV{ID_FS_TYPE}==\"suspend|swsuspend|swsupend\", RUN+=\"/sbin/initqueue /usr/sbin/resume %s '\$tempnode'\"\n" "$a_splash" ++ printf "SUBSYSTEM==\"block\", ACTION==\"add|change\", ENV{ID_FS_TYPE}==\"suspend|swsuspend|swsupend\", RUN+=\"/sbin/initqueue --finished --unique --name 00resume /usr/sbin/resume %s \$tempnode\"\n" "$a_splash" + fi + echo "SUBSYSTEM==\"block\", ACTION==\"add|change\", ENV{ID_FS_TYPE}==\"suspend|swsuspend|swsupend\"," \ +- " RUN+=\"/sbin/initqueue /bin/sh -c 'echo %M:%m > /sys/power/resume'\""; ++ " RUN+=\"/sbin/initqueue --finished --unique --name 00resume echo %M:%m > /sys/power/resume\""; + } >> /etc/udev/rules.d/99-resume.rules + fi diff --git a/dracut.spec b/dracut.spec index d081318..47dea65 100644 --- a/dracut.spec +++ b/dracut.spec @@ -10,7 +10,7 @@ Name: dracut Version: 022 -Release: 1%{?dist} +Release: 2.git20120720%{?dist} Summary: Initramfs generator using udev %if 0%{?fedora} || 0%{?rhel} @@ -29,6 +29,7 @@ URL: https://dracut.wiki.kernel.org/ # Source can be generated by # http://git.kernel.org/?p=boot/dracut/dracut.git;a=snapshot;h=%{version};sf=tgz Source0: http://www.kernel.org/pub/linux/utils/boot/dracut/dracut-%{version}.tar.bz2 +Patch1: 0001-resume-move-resume-in-the-initqueue-finished-hook.patch BuildRequires: dash bash git @@ -357,6 +358,9 @@ rm -rf $RPM_BUILD_ROOT %dir /var/lib/dracut/overlay %changelog +* Fri Jul 20 2012 Harald Hoyer 022-2.git20120720 +- fixed some race condition for resume from hibernation + * Fri Jul 20 2012 Harald Hoyer 022-1 - version 022 - host-only kernel modules fix