]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
95resume: simplyfy rules and also recognize blkid typo
authorHarald Hoyer <harald@redhat.com>
Tue, 15 Sep 2009 06:56:30 +0000 (08:56 +0200)
committerHarald Hoyer <harald@redhat.com>
Tue, 15 Sep 2009 09:17:27 +0000 (11:17 +0200)
modules.d/95resume/resume-genrules.sh

index 023434b8e40c1e0c16d9d19c354d3e1fea2a6cfd..a00a3629be2daf3dd65790de4c437c44f38145ac 100644 (file)
@@ -1,8 +1,12 @@
 if [ -n "$resume" ]; then
     {
-    printf "KERNEL==\"%s\", RUN+=\"/bin/sh -c 'echo %%M:%%m > /sys/power/resume'\"\n" \
+    printf "KERNEL==\"%s\", ACTION==\"add|change\", ENV{ID_FS_TYPE}==\"suspend|swsuspend|swsupend\", RUN+=\"/bin/sh -c 'echo %%M:%%m > /sys/power/resume'\"\n" \
                ${resume#/dev/};
-    printf "SYMLINK==\"%s\", RUN+=\"/bin/sh -c 'echo %%M:%%m > /sys/power/resume'\"\n" \
+    printf "SYMLINK==\"%s\", ACTION==\"add|change\", ENV{ID_FS_TYPE}==\"suspend|swsuspend|swsupend\", RUN+=\"/bin/sh -c 'echo %%M:%%m > /sys/power/resume'\"\n" \
+               ${resume#/dev/};
+    printf "KERNEL==\"%s\", ACTION==\"add|change\", SYMLINK+=\"/dev/resume\"\n" \
+               ${resume#/dev/};
+    printf "SYMLINK==\"%s\", ACTION==\"add|change\", SYMLINK+=\"/dev/resume\"\n" \
                ${resume#/dev/};
     } >> /etc/udev/rules.d/99-resume.rules
 
@@ -13,9 +17,7 @@ if [ -n "$resume" ]; then
 
 elif  ! getarg noresume; then
     {
-    echo "SUBSYSTEM==\"block\", ACTION==\"add\", ENV{ID_FS_TYPE}==\"suspend\"," \
-         " RUN+=\"/bin/sh -c 'echo %M:%m > /sys/power/resume'\"";
-    echo "SUBSYSTEM==\"block\", ACTION==\"add\", ENV{ID_FS_TYPE}==\"swsuspend\"," \
+    echo "SUBSYSTEM==\"block\", ACTION==\"add|change\", ENV{ID_FS_TYPE}==\"suspend|swsuspend|swsupend\"," \
          " RUN+=\"/bin/sh -c 'echo %M:%m > /sys/power/resume'\"";
     } >> /etc/udev/rules.d/99-resume.rules
 fi