fix: address review comments

This commit is contained in:
thiblizz 2023-10-21 16:36:28 +02:00 committed by GitHub
parent e5b0fe6313
commit 647da12b43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 23 deletions

2
configure vendored
View File

@ -1168,7 +1168,7 @@ function PARTITIONING_DEVICES_label() {
if [[ "$invalid" -gt 0 ]]; then
echo " └ (${#PARTITIONING_DEVICES[@]} devices, \Z1$invalid invalid\Zn)"
elif [[ "${#PARTITIONING_DEVICES[@]}" -eq 1 && "$PARTITIONING_SCHEME" == "raid0_luks" || "$PARTITIONING_SCHEME" == "raid1_luks" ]]; then
elif [[ "${#PARTITIONING_DEVICES[@]}" -eq 1 && ("$PARTITIONING_SCHEME" == "raid0_luks" || "$PARTITIONING_SCHEME" == "raid1_luks") ]]; then
echo " └ (${#PARTITIONING_DEVICES[@]} devices, \Z1need at least 2\Zn)"
elif [[ "${#PARTITIONING_DEVICES[@]}" -eq 0 ]]; then
echo " └ (${#PARTITIONING_DEVICES[@]} devices, \Z1need at least 1\Zn)"

View File

@ -276,6 +276,7 @@ function disk_create_raid() {
local devices_desc=""
local devices=()
local extra_args=()
local id
local dev
# Splitting is intentional here
@ -291,31 +292,24 @@ function disk_create_raid() {
local mddevice="/dev/md/$name"
local uuid="${DISK_ID_TO_UUID[$new_id]}"
extra_args=()
if [[ ${level} == 1 ]]; then
einfo "Creating raid$level ($new_id) on $devices_desc"
mdadm \
--create "$mddevice" \
--verbose \
--homehost="$HOSTNAME" \
--metadata=1.0 \
--raid-devices="${#devices[@]}" \
--uuid="$uuid" \
--level="$level" \
"${devices[@]}" \
|| die "Could not create raid$level array '$mddevice' ($new_id) on $devices_desc"
extra_args+=("--metadata=1.0")
else
extra_args+=("--metadata=1.2")
fi
einfo "Creating raid$level ($new_id) on $devices_desc"
mdadm \
--create "$mddevice" \
--verbose \
--homehost="$HOSTNAME" \
--metadata=1.2 \
"${extra_args[@]}" \
--raid-devices="${#devices[@]}" \
--uuid="$uuid" \
--level="$level" \
"${devices[@]}" \
|| die "Could not create raid$level array '$mddevice' ($new_id) on $devices_desc"
fi
}
function disk_create_luks() {