This commit is contained in:
Marc Beninca 2024-11-12 23:32:14 +01:00
parent 7bce373af6
commit 5e800b713d
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

View file

@ -83,18 +83,23 @@ luks_format() {
local label="${3}" local label="${3}"
local uuid="${4}" local uuid="${4}"
if [ -b "${device}" ]; then if [ -b "${device}" ]; then
set -- \
--batch-mode \
--cipher "aes-xts-plain64" \
--hash "sha512" \
--iter-time 4096 \
--key-size 512 \
--pbkdf "argon2id" \
--type "luks2" \
--use-random \
--verbose
if [ -n "${label}" ]; then
set -- "${@}" --label "${label}"
fi
if [ -n "${uuid}" ]; then
set -- "${@}" --label "${uuid}"
fi
echo "${passphrase}" | echo "${passphrase}" |
cryptsetup \ cryptsetup "${@}" luksFormat "${device}"
--batch-mode \
--cipher "aes-xts-plain64" \
--hash "sha512" \
--iter-time 4096 \
--key-size 512 \
--pbkdf "argon2id" \
--type "luks2" \
--use-random \
--verbose \
luksFormat \
"${device}"
fi fi
} }