Skip to content
Permalink
Browse files
resume: do not include in hostonly, if no swap is present
  • Loading branch information
haraldh committed Jul 18, 2013
1 parent 951cedf commit 34b56de12aad622d602d6e3bd434e02c840f1cd0
Showing 1 changed file with 12 additions and 0 deletions.
@@ -2,6 +2,18 @@
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh

check() {
# No point trying to support resume, if no swap partition exist
[[ $hostonly ]] || [[ $mount_needs ]] && {
for fs in "${host_fs_types[@]}"; do
[[ $fs = swap ]] && return 0
done
return 255
}

return 0
}

install() {
local _bin
# Optional uswsusp support

6 comments on commit 34b56de

@SukhikhN
Copy link

@SukhikhN SukhikhN commented on 34b56de Aug 8, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If swap file is used instead of swap partition then resume module will not be included. Maybe it would be better to check that swap is enabled?

@haraldh
Copy link
Collaborator Author

@haraldh haraldh commented on 34b56de Aug 8, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SukhikhN , I don't think you should be able to resume from a swap file

@SukhikhN
Copy link

@SukhikhN SukhikhN commented on 34b56de Aug 8, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? Resuming works if I add this module manually.

@haraldh
Copy link
Collaborator Author

@haraldh haraldh commented on 34b56de Aug 9, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SukhikhN what is your kernel command line then?

@haraldh
Copy link
Collaborator Author

@haraldh haraldh commented on 34b56de Aug 9, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See also: https://www.kernel.org/doc/Documentation/power/swsusp.txt

 * If you do resume from initrd after your filesystems are mounted...
 *				...bye bye root partition.

@SukhikhN
Copy link

@SukhikhN SukhikhN commented on 34b56de Aug 9, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using swap file to resume documented here https://www.kernel.org/doc/Documentation/power/swsusp-and-swap-files.txt
Filesystem is not mounted before resuming - kernel finds swap file area using resume_offset parameter.

Please sign in to comment.