]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
fix(resume): correct call to block_is_netdevice function
authorAntonio Alvarez Feijoo <antonio.feijoo@suse.com>
Fri, 1 Apr 2022 08:04:30 +0000 (10:04 +0200)
committerJóhann B. Guðmundsson <johannbg@gmail.com>
Sat, 9 Apr 2022 08:11:46 +0000 (08:11 +0000)
The block_is_netdevice function requires the device in <maj:min>
format, but the swap_devs array is populated with the content of
/proc/swaps, which prints the devices using their paths from /dev.

This causes the check method to never detect if swap is mounted on a
network device.

modules.d/95resume/module-setup.sh

index 7e6294359057f8e64bfcab3c925b4634c6bf2f92..5e8910489a25adff52002e308d0e014a60eb9a0b 100755 (executable)
@@ -5,7 +5,7 @@ check() {
     swap_on_netdevice() {
         local _dev
         for _dev in "${swap_devs[@]}"; do
-            block_is_netdevice "$_dev" && return 0
+            block_is_netdevice "$(get_maj_min "$_dev")" && return 0
         done
         return 1
     }