public inbox for initramfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Colin Guthrie <colin-odJJhXpcy38dnm+yROfE0A@public.gmane.org>
To: initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: Colin Guthrie <colin-odJJhXpcy38dnm+yROfE0A@public.gmane.org>
Subject: [PATCH 2/2] resume: Ensure we actually wait for the /dev/resume 'device'
Date: Fri, 15 May 2015 14:53:41 +0100	[thread overview]
Message-ID: <1431698021-16626-3-git-send-email-colin@mageia.org> (raw)
In-Reply-To: <1431698021-16626-1-git-send-email-colin-odJJhXpcy38dnm+yROfE0A@public.gmane.org>

Although various bits are in place to cancel waiting for the /dev/resume
device (actually a symlink), we don't actually ever wait for it.

Also as the udev rule may create the symlink, silence any errors from
our manual ln -s call from the settled job.
---
 modules.d/95resume/parse-resume.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/modules.d/95resume/parse-resume.sh b/modules.d/95resume/parse-resume.sh
index 9296429..3b97e51 100755
--- a/modules.d/95resume/parse-resume.sh
+++ b/modules.d/95resume/parse-resume.sh
@@ -37,6 +37,8 @@ esac
 
 if ! getarg noresume; then
     if [ -n "$resume" ]; then
+        wait_for_dev /dev/resume
+
         {
             printf "KERNEL==\"%s\", ACTION==\"add|change\", SYMLINK+=\"resume\"\n" \
                 ${resume#/dev/};
@@ -65,7 +67,7 @@ if ! getarg noresume; then
             printf -- '%s\n' ' RUN+="/sbin/initqueue --finished --unique --name 00resume echo %M:%m  > /sys/power/resume"'
         } >> /etc/udev/rules.d/99-resume.rules
 
-        printf '[ -e "%s" ] && { ln -s "%s" /dev/resume; rm -f -- "$job" "%s/initqueue/timeout/resume.sh"; }\n' \
+        printf '[ -e "%s" ] && { ln -s "%s" /dev/resume 2> /dev/null; rm -f -- "$job" "%s/initqueue/timeout/resume.sh"; }\n' \
             "$resume" "$resume" "$hookdir" >> $hookdir/initqueue/settled/resume.sh
 
         {
-- 
2.3.2

  parent reply	other threads:[~2015-05-15 13:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-15 13:53 dracut: Make host only mode more resilient to missing swaps Colin Guthrie
     [not found] ` <1431698021-16626-1-git-send-email-colin-odJJhXpcy38dnm+yROfE0A@public.gmane.org>
2015-05-15 13:53   ` [PATCH 1/2] base: Don't wait for swap devices in host-only mode Colin Guthrie
2015-05-15 13:53   ` Colin Guthrie [this message]
     [not found]     ` <1431698021-16626-3-git-send-email-colin-odJJhXpcy38dnm+yROfE0A@public.gmane.org>
2015-05-15 14:01       ` [PATCH 2/2] resume: Ensure we actually wait for the /dev/resume 'device' Dracut GitHub Import Bot
2015-06-02 10:26   ` dracut: Make host only mode more resilient to missing swaps Harald Hoyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1431698021-16626-3-git-send-email-colin@mageia.org \
    --to=colin-odjjhxpcy38dnm+yrofe0a@public.gmane.org \
    --cc=initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox