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:
@@ -841,7 +841,7 @@ confirm_form_factor() {
|
||||
if [[ $rc -eq 0 ]]; then
|
||||
FORM_FACTOR="$default"
|
||||
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)
|
||||
fi
|
||||
success "Form factor: $FORM_FACTOR"
|
||||
@@ -875,7 +875,8 @@ configure_impermanence() {
|
||||
ENABLE_IMPERMANENCE="true"
|
||||
success "Impermanence enabled"
|
||||
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)"
|
||||
fi
|
||||
save_state
|
||||
@@ -1093,7 +1094,7 @@ run_disko_with_retry() {
|
||||
while true; do
|
||||
local rc=0
|
||||
set +e
|
||||
disko --mode disko \
|
||||
disko --mode destroy,format,mount \
|
||||
--argstr mainDrive "$main_drive" \
|
||||
--arg extraDrives "$extras_nix" \
|
||||
"$disko_file" 2>&1 | tee "$log"
|
||||
|
||||
Reference in New Issue
Block a user