From 0bc33645fafc36d7d2cd1f840ff3f3bb540f235c Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Tue, 3 May 2016 13:43:15 +0200 Subject: [PATCH] Add encrypt hook to initrd if needed. --- src/modules/initcpiocfg/main.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/modules/initcpiocfg/main.py b/src/modules/initcpiocfg/main.py index 5d4c704f0..14c9431c2 100644 --- a/src/modules/initcpiocfg/main.py +++ b/src/modules/initcpiocfg/main.py @@ -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: