[initcpiocfg] add 'lvm2' hook as needed
This commit is contained in:
parent
6e27e9af2b
commit
5cb0cc4f66
@ -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"].lower() == "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"])
|
||||
|
Loading…
Reference in New Issue
Block a user