Skip to content

Commit 64a3a51

Browse files
authored
add/adapt python comments of resume_swapfile.py
1 parent 7711a44 commit 64a3a51

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/ugrd/fs/resume_swapfile.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33

44
def handle_resume_swapfile(self) -> None:
5-
"""Returns a shell script handling resume from hibernation.
6-
Checks that /sys/power/resume is writable, resume= is set, and noresume is not set, if so,
7-
checks if UUID= or PARTUUID= or LABEL= is in the resume var,
5+
"""Returns a shell script handling resume from hibernation with a swapfile.
6+
Checks that /sys/power/resume is writable, resume_offset= is sane, resume= is set, and noresume is not set,
7+
if so, checks if UUID= or PARTUUID= or LABEL= is in the resume var,
88
and tries to use blkid to find the resume device.
99
If the specified device exists, writes resume device to /sys/power/resume.
1010
In the event of failure, it prints an error message, a list of block devuices, then runs rd_fail.
@@ -26,7 +26,7 @@ def handle_resume_swapfile(self) -> None:
2626
" else",
2727
" resume=$resumeval",
2828
" fi",
29-
' if [ ! -n "$offset" ] || [ "$offset" -le 0 ]; then',
29+
' if [ ! -n "$offset" ] || [ "$offset" -le 0 ]; then', # check for sane offset value, i.e. not empty and greater than 0
3030
' ewarn "resume_offset not set, resume from swapfile likely to fail"',
3131
" fi",
3232
' if [ -e "$resume" ]; then', # Check if the resume device exists

0 commit comments

Comments
 (0)