Blame SOURCES/0037-resume-remove-resume-genrules.sh.patch

a56a5e
From c35826c0e7623852be8735acf8cc13e6bf829208 Mon Sep 17 00:00:00 2001
90b079
From: Alexander Tsoy <alexander@tsoy.me>
90b079
Date: Wed, 9 Oct 2013 07:02:56 +0400
90b079
Subject: [PATCH] resume: remove resume-genrules.sh
90b079
90b079
parse-resume.sh already contains all the code from resume-genrules.sh.
90b079
Also parse-resume.sh is executed before resume-genrules.sh, so there is
90b079
no point to keep the latter.
90b079
90b079
This fixes the following error messages:
90b079
dracut-initqueue: ln: failed to create symbolic link '/dev/resume': File exists
90b079
dracut-initqueue: rm: cannot remove '/lib/dracut/hooks/initqueue/settled/resume.sh': No such file or directory
90b079
dracut-initqueue: rm: cannot remove '/lib/dracut/hooks/initqueue/timeout/resume.sh': No such file or directory
90b079
---
90b079
 modules.d/95resume/module-setup.sh    |  1 -
49e6a8
 modules.d/95resume/resume-genrules.sh | 51 ---------------------------
90b079
 2 files changed, 52 deletions(-)
90b079
 delete mode 100755 modules.d/95resume/resume-genrules.sh
90b079
90b079
diff --git a/modules.d/95resume/module-setup.sh b/modules.d/95resume/module-setup.sh
1755ca
index a1ddb460..c4e93636 100755
90b079
--- a/modules.d/95resume/module-setup.sh
90b079
+++ b/modules.d/95resume/module-setup.sh
90b079
@@ -30,7 +30,6 @@ install() {
90b079
         inst_hook cmdline 10 "$moddir/parse-resume.sh"
90b079
     else
90b079
         inst_script "$moddir/parse-resume.sh" /lib/dracut/parse-resume.sh
90b079
-        inst_hook pre-udev 30 "$moddir/resume-genrules.sh"
90b079
     fi
90b079
 
90b079
     inst_script  "$moddir/resume.sh" /lib/dracut/resume.sh
90b079
diff --git a/modules.d/95resume/resume-genrules.sh b/modules.d/95resume/resume-genrules.sh
90b079
deleted file mode 100755
1755ca
index c542c715..00000000
90b079
--- a/modules.d/95resume/resume-genrules.sh
90b079
+++ /dev/null
90b079
@@ -1,51 +0,0 @@
90b079
-#!/bin/sh
90b079
-# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
90b079
-# ex: ts=8 sw=4 sts=4 et filetype=sh
90b079
-
90b079
-case "$splash" in
90b079
-    quiet )
90b079
-        a_splash="-P splash=y"
90b079
-    ;;
90b079
-    * )
90b079
-        a_splash="-P splash=n"
90b079
-    ;;
90b079
-esac
90b079
-
90b079
-if [ -n "$resume" ]; then
90b079
-    {
90b079
-        printf "KERNEL==\"%s\", ACTION==\"add|change\", SYMLINK+=\"/dev/resume\"\n" \
90b079
-            ${resume#/dev/};
90b079
-        printf "SYMLINK==\"%s\", ACTION==\"add|change\", SYMLINK+=\"/dev/resume\"\n" \
90b079
-            ${resume#/dev/};
90b079
-    } >> /etc/udev/rules.d/99-resume-link.rules
90b079
-
90b079
-    {
90b079
-        if [ -x /usr/sbin/resume ]; then
90b079
-            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" \
90b079
-                ${resume#/dev/} "$a_splash" "$resume";
90b079
-            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" \
90b079
-                ${resume#/dev/} "$a_splash" "$resume";
90b079
-        fi
90b079
-        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" \
90b079
-            ${resume#/dev/};
90b079
-        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" \
90b079
-            ${resume#/dev/};
90b079
-    } >> /etc/udev/rules.d/99-resume.rules
90b079
-
90b079
-    printf '[ -e "%s" ] && { ln -s "%s" /dev/resume; rm "$job" "%s/initqueue/timeout/resume.sh"; }\n' \
90b079
-        "$resume" "$resume" "$hookdir" >> $hookdir/initqueue/settled/resume.sh
90b079
-
90b079
-    printf 'warn "Cancelling resume operation. Device not found."; cancel_wait_for_dev /dev/resume; rm "$job" "%s/initqueue/settled/resume.sh";' \
90b079
-        "$hookdir" >> $hookdir/initqueue/timeout/resume.sh
90b079
-
90b079
-    wait_for_dev "/dev/resume"
90b079
-
90b079
-elif ! getarg noresume; then
90b079
-    {
90b079
-        if [ -x /usr/sbin/resume ]; then
90b079
-            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"
90b079
-        fi
90b079
-        echo "SUBSYSTEM==\"block\", ACTION==\"add|change\", ENV{ID_FS_TYPE}==\"suspend|swsuspend|swsupend\"," \
90b079
-            " RUN+=\"/sbin/initqueue --finished --unique --name 00resume echo %M:%m > /sys/power/resume\"";
90b079
-    } >> /etc/udev/rules.d/99-resume.rules
90b079
-fi