aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Deutschmann <whissi@gentoo.org>2021-02-07 19:02:29 +0100
committerThomas Deutschmann <whissi@gentoo.org>2021-02-07 19:02:29 +0100
commita0a6d6313874a7567a26c405713aaf610695285d (patch)
treee57c7e63dff1864bd631b79b89f1854094367109 /defaults/unlock-luks.sh
parentgenkernel: make sure GREP_OPTIONS is unset (diff)
downloadgenkernel-a0a6d6313874a7567a26c405713aaf610695285d.tar.gz
genkernel-a0a6d6313874a7567a26c405713aaf610695285d.tar.bz2
genkernel-a0a6d6313874a7567a26c405713aaf610695285d.zip
linuxrc: add kernel command-line argument to allow user to pass additional options to cryptsetup
Cryptsetup supports additional options like "--perf-no_read_workqueue" or "--perf-no_write_workqueue". While it is recommended to use LUKS2 format and make these activiation flags permanent, you can also make use of the new kernel command-line arguments "crypt_root_options" for root device or "crypt_swap_options" for swap device to pass additional options to cryptsetup. These arguments can be specified multiple times or separate multiple options with a comma. Bug: https://bugs.gentoo.org/755587 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
Diffstat (limited to 'defaults/unlock-luks.sh')
-rw-r--r--defaults/unlock-luks.sh8
1 files changed, 3 insertions, 5 deletions
diff --git a/defaults/unlock-luks.sh b/defaults/unlock-luks.sh
index a8ae990..59e086a 100644
--- a/defaults/unlock-luks.sh
+++ b/defaults/unlock-luks.sh
@@ -46,12 +46,11 @@ main() {
local LUKS_NAME="${NAME}"
eval local LUKS_DEVICE='"${CRYPT_'${TYPE}'}"'
eval local LUKS_KEY='"${CRYPT_'${TYPE}'_KEYFILE}"'
- eval local LUKS_TRIM='"${CRYPT_'${TYPE}'_TRIM}"'
+ eval local cryptsetup_options='"${CRYPT_'${TYPE}'_OPTIONS}"'
eval local OPENED_LOCKFILE='"${CRYPT_'${TYPE}'_OPENED_LOCKFILE}"'
while true
do
- local cryptsetup_options=""
local gpg_cmd crypt_filter_ret
if [ -e "${OPENED_LOCKFILE}" ]
@@ -74,10 +73,9 @@ main() {
# able to investigate the problem on its own.
exit 1
else
- if [ "x${LUKS_TRIM}" = "xyes" ]
+ if [ -n "${cryptsetup_options}" ]
then
- good_msg "Enabling TRIM support for ${LUKS_NAME} ..." "${CRYPT_SILENT}"
- cryptsetup_options="${cryptsetup_options} --allow-discards"
+ good_msg "Using the following cryptsetup options for ${LUKS_NAME}: ${cryptsetup_options}" ${CRYPT_SILENT}
fi
# Handle keys