[initcpiocfg] add 'lvm2' hook as needed

This commit is contained in:
Philip 2017-12-30 02:48:00 -05:00
parent 138fd82a8c
commit 7c88deedc8

View File

@ -100,6 +100,7 @@ def modify_mkinitcpio_conf(partitions, root_mount_point):
cpu = cpuinfo()
swap_uuid = ""
btrfs = ""
lvm2 = ""
hooks = ["base", "udev", "autodetect", "modconf", "block", "keyboard",
"keymap"]
modules = []
@ -122,6 +123,9 @@ def modify_mkinitcpio_conf(partitions, root_mount_point):
if partition["fs"] == "btrfs":
btrfs = "yes"
if partition["fs"] == "lvm2 pv":
lvm2 = "yes"
if partition["mountPoint"] == "/" and "luksMapperName" in partition:
encrypt_hook = True
@ -137,6 +141,9 @@ def modify_mkinitcpio_conf(partitions, root_mount_point):
):
files.append("/crypto_keyfile.bin")
if lvm2:
hooks.append("lvm2")
if swap_uuid != "":
if encrypt_hook and openswap_hook:
hooks.extend(["openswap"])