From 446aacb9b6ae4dce8c021c8d1a4b09efefebabdb Mon Sep 17 00:00:00 2001 From: downtownallday Date: Tue, 3 Sep 2024 11:06:58 -0400 Subject: [PATCH] Don't exit on missing kernel module during non-interactive scenario --- ehdd/ehdd_funcs.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/ehdd/ehdd_funcs.sh b/ehdd/ehdd_funcs.sh index ea605c1d..cee07cbc 100644 --- a/ehdd/ehdd_funcs.sh +++ b/ehdd/ehdd_funcs.sh @@ -25,8 +25,17 @@ EHDD_LUKS_NAME="c1" assert_kernel_modules() { local check="$(lsmod | awk '$1=="dm_crypt" {print "yes"}')" if [ "$check" != "yes" ]; then - echo "Required kernel modules for encryption-at-rest are not loaded. Cannot continue" - exit 1 + if [ ! -z "$EHDD_KEYFILE" ]; then + echo "WARNING: Required kernel modules for encryption-at-rest are not loaded." + # probably testing / virutalization + echo "OUTPUT from lsmod:" + echo "------------------------------------------------------" + lsmod + echo "------------------------------------------------------" + else + echo "Required kernel modules for encryption-at-rest are not loaded. Cannot continue." + exit 1 + fi fi }