[initcpiocfg] add 'lvm2' hook as needed

This commit is contained in:
Philip 2017-12-30 02:48:00 -05:00
parent 6e27e9af2b
commit 5cb0cc4f66

View File

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