Add encrypt hook to initrd if needed.
This commit is contained in:
parent
f5f73fbd4d
commit
0bc33645fa
@ -88,6 +88,7 @@ def modify_mkinitcpio_conf(partitions, root_mount_point):
|
|||||||
btrfs = ""
|
btrfs = ""
|
||||||
hooks = ["base", "udev", "autodetect", "modconf", "block", "keyboard", "keymap"]
|
hooks = ["base", "udev", "autodetect", "modconf", "block", "keyboard", "keymap"]
|
||||||
modules = []
|
modules = []
|
||||||
|
encrypt_hook = False
|
||||||
|
|
||||||
# It is important that the plymouth hook comes before any encrypt hook
|
# It is important that the plymouth hook comes before any encrypt hook
|
||||||
plymouth_bin = os.path.join(root_mount_point, "usr/bin/plymouth")
|
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":
|
if partition["fs"] == "btrfs":
|
||||||
btrfs = "yes"
|
btrfs = "yes"
|
||||||
|
|
||||||
|
if partition["mountPoint"] == "/" and partition["luksMapperName"]:
|
||||||
|
encrypt_hook = True
|
||||||
|
|
||||||
|
if encrypt_hook:
|
||||||
|
hooks.append("encrypt")
|
||||||
|
|
||||||
if swap_uuid is not "":
|
if swap_uuid is not "":
|
||||||
hooks.extend(["resume", "filesystems"])
|
hooks.extend(["resume", "filesystems"])
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user