Skip to content
Snippets Groups Projects
Commit 0bc33645 authored by Teo Mrnjavac's avatar Teo Mrnjavac
Browse files

Add encrypt hook to initrd if needed.

parent f5f73fbd
No related branches found
No related tags found
No related merge requests found
......@@ -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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment