|
Harald Hoyer |
89b080 |
From 450b5f336d1f433d333b78979388aa2477bc487e Mon Sep 17 00:00:00 2001
|
|
Harald Hoyer |
89b080 |
From: Harald Hoyer <harald@redhat.com>
|
|
Harald Hoyer |
89b080 |
Date: Mon, 9 Jul 2012 17:06:51 +0200
|
|
Harald Hoyer |
89b080 |
Subject: [PATCH] resume: move resume process to initqueue
|
|
Harald Hoyer |
89b080 |
|
|
Harald Hoyer |
89b080 |
---
|
|
Harald Hoyer |
89b080 |
modules.d/95resume/parse-resume.sh | 2 ++
|
|
Harald Hoyer |
89b080 |
modules.d/95resume/resume-genrules.sh | 14 +++++++-------
|
|
Harald Hoyer |
89b080 |
2 files changed, 9 insertions(+), 7 deletions(-)
|
|
Harald Hoyer |
89b080 |
|
|
Harald Hoyer |
89b080 |
diff --git a/modules.d/95resume/parse-resume.sh b/modules.d/95resume/parse-resume.sh
|
|
Harald Hoyer |
89b080 |
index 32680c3..b460a16 100755
|
|
Harald Hoyer |
89b080 |
--- a/modules.d/95resume/parse-resume.sh
|
|
Harald Hoyer |
89b080 |
+++ b/modules.d/95resume/parse-resume.sh
|
|
Harald Hoyer |
89b080 |
@@ -15,6 +15,8 @@ case "$resume" in
|
|
Harald Hoyer |
89b080 |
resume="/dev/disk/by-label/${resume#LABEL=}" ;;
|
|
Harald Hoyer |
89b080 |
UUID=*) \
|
|
Harald Hoyer |
89b080 |
resume="/dev/disk/by-uuid/${resume#UUID=}" ;;
|
|
Harald Hoyer |
89b080 |
+ PARTUUID=*) \
|
|
Harald Hoyer |
89b080 |
+ resume="/dev/disk/by-partuuid/${resume#PARTUUID=}" ;;
|
|
Harald Hoyer |
89b080 |
esac
|
|
Harald Hoyer |
89b080 |
|
|
Harald Hoyer |
89b080 |
if splash=$(getarg splash=); then
|
|
Harald Hoyer |
89b080 |
diff --git a/modules.d/95resume/resume-genrules.sh b/modules.d/95resume/resume-genrules.sh
|
|
Harald Hoyer |
89b080 |
index ee4eacb..34511d7 100755
|
|
Harald Hoyer |
89b080 |
--- a/modules.d/95resume/resume-genrules.sh
|
|
Harald Hoyer |
89b080 |
+++ b/modules.d/95resume/resume-genrules.sh
|
|
Harald Hoyer |
89b080 |
@@ -21,18 +21,18 @@ if [ -n "$resume" ]; then
|
|
Harald Hoyer |
89b080 |
|
|
Harald Hoyer |
89b080 |
{
|
|
Harald Hoyer |
89b080 |
if [ -x /usr/sbin/resume ]; then
|
|
Harald Hoyer |
89b080 |
- printf "KERNEL==\"%s\", ACTION==\"add|change\", ENV{ID_FS_TYPE}==\"suspend|swsuspend|swsupend\", RUN+=\"/usr/sbin/resume %s '%s'\"\n" \
|
|
Harald Hoyer |
89b080 |
+ printf "KERNEL==\"%s\", ACTION==\"add|change\", ENV{ID_FS_TYPE}==\"suspend|swsuspend|swsupend\", RUN+=\"/sbin/initqueue /usr/sbin/resume %s '%s'\"\n" \
|
|
Harald Hoyer |
89b080 |
${resume#/dev/} "$a_splash" "$resume";
|
|
Harald Hoyer |
89b080 |
- printf "SYMLINK==\"%s\", ACTION==\"add|change\", ENV{ID_FS_TYPE}==\"suspend|swsuspend|swsupend\", RUN+=\"/usr/sbin/resume %s '%s'\"\n" \
|
|
Harald Hoyer |
89b080 |
+ printf "SYMLINK==\"%s\", ACTION==\"add|change\", ENV{ID_FS_TYPE}==\"suspend|swsuspend|swsupend\", RUN+=\"/sbin/initqueue /usr/sbin/resume %s '%s'\"\n" \
|
|
Harald Hoyer |
89b080 |
${resume#/dev/} "$a_splash" "$resume";
|
|
Harald Hoyer |
89b080 |
fi
|
|
Harald Hoyer |
89b080 |
- printf "KERNEL==\"%s\", ACTION==\"add|change\", ENV{ID_FS_TYPE}==\"suspend|swsuspend|swsupend\", RUN+=\"/bin/sh -c 'echo %%M:%%m > /sys/power/resume'\"\n" \
|
|
Harald Hoyer |
89b080 |
+ 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" \
|
|
Harald Hoyer |
89b080 |
${resume#/dev/};
|
|
Harald Hoyer |
89b080 |
- printf "SYMLINK==\"%s\", ACTION==\"add|change\", ENV{ID_FS_TYPE}==\"suspend|swsuspend|swsupend\", RUN+=\"/bin/sh -c 'echo %%M:%%m > /sys/power/resume'\"\n" \
|
|
Harald Hoyer |
89b080 |
+ 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" \
|
|
Harald Hoyer |
89b080 |
${resume#/dev/};
|
|
Harald Hoyer |
89b080 |
} >> /etc/udev/rules.d/99-resume.rules
|
|
Harald Hoyer |
89b080 |
|
|
Harald Hoyer |
89b080 |
- printf '[ -e "%s" ] && { ln -s "%s" /dev/resume; rm "$job"; }\n' \
|
|
Harald Hoyer |
89b080 |
+ printf '[ -e "%s" ] && { ln -s "%s" /dev/resume; rm "$job"; udevadm settle; }\n' \
|
|
Harald Hoyer |
89b080 |
"$resume" "$resume" >> $hookdir/initqueue/settled/resume.sh
|
|
Harald Hoyer |
89b080 |
|
|
Harald Hoyer |
89b080 |
printf 'warn "Cancelling resume operation. Device not found."; cancel_wait_for_dev /dev/resume; rm "$job" "%s/initqueue/settled/resume.sh";' \
|
|
Harald Hoyer |
89b080 |
@@ -43,9 +43,9 @@ if [ -n "$resume" ]; then
|
|
Harald Hoyer |
89b080 |
elif ! getarg noresume; then
|
|
Harald Hoyer |
89b080 |
{
|
|
Harald Hoyer |
89b080 |
if [ -x /usr/sbin/resume ]; then
|
|
Harald Hoyer |
89b080 |
- printf "SUBSYSTEM==\"block\", ACTION==\"add|change\", ENV{ID_FS_TYPE}==\"suspend|swsuspend|swsupend\", RUN+=\"/usr/sbin/resume %s '\$tempnode'\"\n" "$a_splash"
|
|
Harald Hoyer |
89b080 |
+ printf "SUBSYSTEM==\"block\", ACTION==\"add|change\", ENV{ID_FS_TYPE}==\"suspend|swsuspend|swsupend\", RUN+=\"/sbin/initqueue /usr/sbin/resume %s '\$tempnode'\"\n" "$a_splash"
|
|
Harald Hoyer |
89b080 |
fi
|
|
Harald Hoyer |
89b080 |
echo "SUBSYSTEM==\"block\", ACTION==\"add|change\", ENV{ID_FS_TYPE}==\"suspend|swsuspend|swsupend\"," \
|
|
Harald Hoyer |
89b080 |
- " RUN+=\"/bin/sh -c 'echo %M:%m > /sys/power/resume'\"";
|
|
Harald Hoyer |
89b080 |
+ " RUN+=\"/sbin/initqueue /bin/sh -c 'echo %M:%m > /sys/power/resume'\"";
|
|
Harald Hoyer |
89b080 |
} >> /etc/udev/rules.d/99-resume.rules
|
|
Harald Hoyer |
89b080 |
fi
|