Blame 0009-resume-remove-resume-genrules.sh.patch

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