[projects/geninitrd] Handle deleted device files for swap.
arekm
arekm at pld-linux.org
Sun Sep 3 02:15:25 CEST 2023
commit 1cbd636ee1a3b037462447cfac882b80d922df33
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Sun Sep 3 00:16:02 2023 +0200
Handle deleted device files for swap.
Handle swaps like:
$ cat /proc/swaps
Filename Type Size Used Priority
/dev/sda2\040(deleted) partition 4194300 571016 -2
mod-swsusp.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/mod-swsusp.sh b/mod-swsusp.sh
index 9b1a1f3..6867a4d 100644
--- a/mod-swsusp.sh
+++ b/mod-swsusp.sh
@@ -13,7 +13,7 @@ setup_mod_swsusp() {
return
fi
- swap_dev="$(awk '/^\/dev\// { print $1 }' /proc/swaps | grep -v /dev/zram | head -1)"
+ swap_dev="$(awk '/^\/dev\// { dev=$1; gsub("\\\\040.*", "", dev); print dev }' /proc/swaps | grep -v /dev/zram | head -1)"
if [ -z "$swap_dev" ]; then
warn "Cannot determine swap device. You may try add specific device to kernel command line. Disabling swsusp support."
USE_SWSUSP=no
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/projects/geninitrd.git/commitdiff/1cbd636ee1a3b037462447cfac882b80d922df33
More information about the pld-cvs-commit
mailing list