aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'defaults/initrd.scripts')
-rw-r--r--defaults/initrd.scripts10
1 files changed, 10 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=