Browse Source

resume: Fix failure when invalid device passed via 'resume='

This commit allows the waiting for a device to be cancelled.
When the resume partition does not exist, it becomes quite hard
to work out what to do (you have to either create the
/dev/resume symlink manually, or remove the 'finished' job
that is waiting for it). Additionally dracut incorrectly
displays a message about not being able to find the root
device, which is bogus and misleading.

This commit should just bail on the whole resume thing
if the device cannot be found and proceed with a normal boot.
master
Colin Guthrie 13 years ago committed by Harald Hoyer
parent
commit
f65b874bda
  1. 3
      modules.d/95resume/resume-genrules.sh
  2. 8
      modules.d/99base/dracut-lib.sh

3
modules.d/95resume/resume-genrules.sh

@ -35,6 +35,9 @@ if [ -n "$resume" ]; then @@ -35,6 +35,9 @@ if [ -n "$resume" ]; then
printf '[ -e "%s" ] && { ln -s "%s" /dev/resume; rm "$job"; }\n' \
"$resume" "$resume" >> $hookdir/initqueue/settled/resume.sh

printf 'warn "Cancelling resume operation. Device not found."; cancel_wait_for_dev /dev/resume; rm "$job" "%s/initqueue/settled/resume.sh";' \
"$hookdir" >> $hookdir/initqueue/timeout/resume.sh

wait_for_dev "/dev/resume"

elif ! getarg noresume; then

8
modules.d/99base/dracut-lib.sh

@ -717,6 +717,14 @@ wait_for_dev() @@ -717,6 +717,14 @@ wait_for_dev()
} >> "$hookdir/emergency/80-${_name}.sh"
}

cancel_wait_for_dev()
{
local _name
_name="$(str_replace "$1" '/' '\\x2f')"
rm -f "$hookdir/initqueue/finished/devexists-${_name}.sh"
rm -f "$hookdir/emergency/80-${_name}.sh"
}

killproc() {
local _exe="$(command -v $1)"
local _sig=$2

Loading…
Cancel
Save