fix(installer): resolve disko evaluation crash and infinite loops
- Fix disko-config.nix signature by adding '...' to handle unexpected CLI arguments. - Update disko mode to 'destroy,format,mount' for the modern API and to avoid deprecation warnings. - Fix infinite loops in 'configure_impermanence' and 'confirm_form_factor' caused by misinterpreting 'No' (rc=1) as an abort.
This commit is contained in:
@@ -19,6 +19,7 @@
|
|||||||
# function arguments are the right shape.
|
# function arguments are the right shape.
|
||||||
{ mainDrive
|
{ mainDrive
|
||||||
, extraDrives ? []
|
, extraDrives ? []
|
||||||
|
, ...
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|||||||
@@ -841,7 +841,7 @@ confirm_form_factor() {
|
|||||||
if [[ $rc -eq 0 ]]; then
|
if [[ $rc -eq 0 ]]; then
|
||||||
FORM_FACTOR="$default"
|
FORM_FACTOR="$default"
|
||||||
else
|
else
|
||||||
if [[ $rc -eq 130 || $rc -eq 1 ]]; then return 130; fi
|
if [[ $rc -eq 130 ]]; then return 130; fi
|
||||||
FORM_FACTOR=$([[ "$default" == "laptop" ]] && echo desktop || echo laptop)
|
FORM_FACTOR=$([[ "$default" == "laptop" ]] && echo desktop || echo laptop)
|
||||||
fi
|
fi
|
||||||
success "Form factor: $FORM_FACTOR"
|
success "Form factor: $FORM_FACTOR"
|
||||||
@@ -875,7 +875,8 @@ configure_impermanence() {
|
|||||||
ENABLE_IMPERMANENCE="true"
|
ENABLE_IMPERMANENCE="true"
|
||||||
success "Impermanence enabled"
|
success "Impermanence enabled"
|
||||||
else
|
else
|
||||||
if [[ $rc -eq 130 || $rc -eq 1 ]]; then return 130; fi
|
if [[ $rc -eq 130 ]]; then return 130; fi
|
||||||
|
ENABLE_IMPERMANENCE="false"
|
||||||
info "Impermanence disabled (traditional persistent root)"
|
info "Impermanence disabled (traditional persistent root)"
|
||||||
fi
|
fi
|
||||||
save_state
|
save_state
|
||||||
@@ -1093,7 +1094,7 @@ run_disko_with_retry() {
|
|||||||
while true; do
|
while true; do
|
||||||
local rc=0
|
local rc=0
|
||||||
set +e
|
set +e
|
||||||
disko --mode disko \
|
disko --mode destroy,format,mount \
|
||||||
--argstr mainDrive "$main_drive" \
|
--argstr mainDrive "$main_drive" \
|
||||||
--arg extraDrives "$extras_nix" \
|
--arg extraDrives "$extras_nix" \
|
||||||
"$disko_file" 2>&1 | tee "$log"
|
"$disko_file" 2>&1 | tee "$log"
|
||||||
|
|||||||
Reference in New Issue
Block a user