args
This commit is contained in:
parent
7bce373af6
commit
5e800b713d
1 changed files with 17 additions and 12 deletions
15
bash/fs.sh
15
bash/fs.sh
|
@ -83,8 +83,7 @@ luks_format() {
|
||||||
local label="${3}"
|
local label="${3}"
|
||||||
local uuid="${4}"
|
local uuid="${4}"
|
||||||
if [ -b "${device}" ]; then
|
if [ -b "${device}" ]; then
|
||||||
echo "${passphrase}" |
|
set -- \
|
||||||
cryptsetup \
|
|
||||||
--batch-mode \
|
--batch-mode \
|
||||||
--cipher "aes-xts-plain64" \
|
--cipher "aes-xts-plain64" \
|
||||||
--hash "sha512" \
|
--hash "sha512" \
|
||||||
|
@ -93,8 +92,14 @@ luks_format() {
|
||||||
--pbkdf "argon2id" \
|
--pbkdf "argon2id" \
|
||||||
--type "luks2" \
|
--type "luks2" \
|
||||||
--use-random \
|
--use-random \
|
||||||
--verbose \
|
--verbose
|
||||||
luksFormat \
|
if [ -n "${label}" ]; then
|
||||||
"${device}"
|
set -- "${@}" --label "${label}"
|
||||||
|
fi
|
||||||
|
if [ -n "${uuid}" ]; then
|
||||||
|
set -- "${@}" --label "${uuid}"
|
||||||
|
fi
|
||||||
|
echo "${passphrase}" |
|
||||||
|
cryptsetup "${@}" luksFormat "${device}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue