aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'defaults')
-rw-r--r--defaults/initrd.scripts10
-rw-r--r--defaults/unlock-luks.sh1
2 files changed, 11 insertions, 0 deletions
diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts
index f7e6c3d..d005e0d 100644
--- a/defaults/initrd.scripts
+++ b/defaults/initrd.scripts
@@ -1103,6 +1103,15 @@ test_success() {
fi
}
+trim() {
+ local var="$*"
+
+ var="${var#"${var%%[![:space:]]*}"}" # remove leading whitespace characters
+ var="${var%"${var##*[![:space:]]}"}" # remove trailing whitespace characters
+
+ printf "%s" "${var}"
+}
+
log_msg() {
is_log_enabled || return
@@ -1779,6 +1788,7 @@ openLUKS() {
eval local LUKS_KEYDEV='"${CRYPT_'${TYPE}'_KEYDEV}"'
eval local LUKS_KEYDEV_FSTYPE='"${CRYPT_'${TYPE}'_KEYDEV_FSTYPE}"'
eval local cryptsetup_options='"${CRYPT_'${TYPE}'_OPTIONS}"'
+ cryptsetup_options="$(trim "${cryptsetup_options}")"
eval local OPENED_LOCKFILE='"${CRYPT_'${TYPE}'_OPENED_LOCKFILE}"'
local DEV_ERROR=0 KEY_ERROR=0 KEYDEV_ERROR=0
local mntkey="/mnt/key/" crypt_filter_ret=
diff --git a/defaults/unlock-luks.sh b/defaults/unlock-luks.sh
index 4c99a1f..9ef54e0 100644
--- a/defaults/unlock-luks.sh
+++ b/defaults/unlock-luks.sh
@@ -47,6 +47,7 @@ main() {
eval local LUKS_DEVICE='"${CRYPT_'${TYPE}'}"'
eval local LUKS_KEY='"${CRYPT_'${TYPE}'_KEYFILE}"'
eval local cryptsetup_options='"${CRYPT_'${TYPE}'_OPTIONS}"'
+ cryptsetup_options="$(trim "${cryptsetup_options}")"
eval local OPENED_LOCKFILE='"${CRYPT_'${TYPE}'_OPENED_LOCKFILE}"'
if [ -z "${LUKS_DEVICE}" ]