Add encrypt hook to initrd if needed.

This commit is contained in:
Teo Mrnjavac 2016-05-03 13:43:15 +02:00
parent f5f73fbd4d
commit 0bc33645fa

View File

@ -88,6 +88,7 @@ def modify_mkinitcpio_conf(partitions, root_mount_point):
btrfs = ""
hooks = ["base", "udev", "autodetect", "modconf", "block", "keyboard", "keymap"]
modules = []
encrypt_hook = False
# It is important that the plymouth hook comes before any encrypt hook
plymouth_bin = os.path.join(root_mount_point, "usr/bin/plymouth")
@ -101,6 +102,12 @@ def modify_mkinitcpio_conf(partitions, root_mount_point):
if partition["fs"] == "btrfs":
btrfs = "yes"
if partition["mountPoint"] == "/" and partition["luksMapperName"]:
encrypt_hook = True
if encrypt_hook:
hooks.append("encrypt")
if swap_uuid is not "":
hooks.extend(["resume", "filesystems"])
else: