Skip to content

Commit

Permalink
Don't exit on missing kernel module during non-interactive scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
downtownallday committed Sep 3, 2024
1 parent c027db8 commit 446aacb
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions ehdd/ehdd_funcs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 446aacb

Please sign in to comment.