From a7e86e8aff33f769017f4980b8727bed17303533 Mon Sep 17 00:00:00 2001 From: "Eugene San (eugenesan)" Date: Thu, 11 Apr 2024 19:52:38 -0700 Subject: [PATCH] Make sure we do not use missing crypto_keyfile in fstab module Replaces original commit with refactoring Refactoring will have to wait --- src/modules/fstab/main.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/modules/fstab/main.py b/src/modules/fstab/main.py index 78cae6349..bd7ae77c3 100755 --- a/src/modules/fstab/main.py +++ b/src/modules/fstab/main.py @@ -151,8 +151,12 @@ class FstabGenerator(object): if not mapper_name or not luks_uuid: return None - password = "/crypto_keyfile.bin" crypttab_options = self.crypttab_options + # Make sure to not use missing keyfile + if os.path.isfile(os.path.join(self.root_mount_point, "crypto_keyfile.bin")): + password = "/crypto_keyfile.bin" + else: + password = "none" # Set crypttab password for partition to none and remove crypttab options # if root partition was not encrypted