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

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