From 65a989d3cd4f5e673d2830e9d89caa536ff5e32d Mon Sep 17 00:00:00 2001 From: Gabriel Craciunescu Date: Wed, 18 Mar 2020 17:12:33 +0100 Subject: [PATCH] [grubcfg] With LUKS, resume from the correct swap name FIXES #1208 --- src/modules/grubcfg/main.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/modules/grubcfg/main.py b/src/modules/grubcfg/main.py index ef77b988c..77a668960 100644 --- a/src/modules/grubcfg/main.py +++ b/src/modules/grubcfg/main.py @@ -110,15 +110,15 @@ def modify_grub_default(partitions, root_mount_point, distributor): if partition["fs"] == "linuxswap" and not has_luks: swap_uuid = partition["uuid"] + if (partition["fs"] == "linuxswap" and has_luks): + swap_outer_mappername = partition["luksMapperName"] + if (partition["mountPoint"] == "/" and has_luks): cryptdevice_params = [ "cryptdevice=UUID={!s}:{!s}".format( partition["luksUuid"], partition["luksMapperName"] ), "root=/dev/mapper/{!s}".format( - partition["luksMapperName"] - ), - "resume=/dev/mapper/{!s}".format( partition["luksMapperName"] ) ] @@ -136,7 +136,7 @@ def modify_grub_default(partitions, root_mount_point, distributor): if have_dracut and swap_outer_uuid: kernel_params.append("rd.luks.uuid={!s}".format(swap_outer_uuid)) - if have_dracut and swap_outer_mappername: + if swap_outer_mappername: kernel_params.append("resume=/dev/mapper/{!s}".format( swap_outer_mappername))