Fix auto-installer hanging at zenity confirmation dialog

- Zenity dialog was hanging in terminal environment without proper GUI context
- Replaced unreliable GUI dialogs (zenity/dialog) with terminal confirmation
- Added clear warning display with colored output for visibility
- Simplified confirmation logic with case statement for multiple valid inputs
- Auto-installer now continues reliably without GUI dialog dependencies

Terminal confirmation is more reliable in live CD terminal environments.
parent a6181d5c
...@@ -262,35 +262,30 @@ confirm_installation() { ...@@ -262,35 +262,30 @@ confirm_installation() {
print_warning "All existing partitions and data will be permanently destroyed!" print_warning "All existing partitions and data will be permanently destroyed!"
print_status "" print_status ""
# Use graphical confirmation if available # Use terminal confirmation for reliable operation
if command -v zenity >/dev/null 2>&1; then # GUI dialogs can hang in some terminal environments
zenity --question \ print_status "Using terminal confirmation for reliable operation..."
--title="Installation Confirmation" \ echo ""
--text="Ready to install MBetter to $TARGET_DISK\n\nWARNING: This will COMPLETELY ERASE all data on $TARGET_DISK!\n\nTarget disk: $TARGET_DISK ($size_gb GB)\nModel: $model\n\nContinue with installation?" \ echo -e "${RED}==================== INSTALLATION WARNING ====================${NC}"
--width=400 \ echo -e "${RED}This will COMPLETELY ERASE all data on $TARGET_DISK!${NC}"
--height=200 echo -e "${RED}All existing partitions and data will be permanently destroyed!${NC}"
return $? echo -e "${RED}=============================================================${NC}"
elif command -v dialog >/dev/null 2>&1; then echo ""
dialog --title "Installation Confirmation" \ echo "Target disk: $TARGET_DISK ($size_gb GB)"
--yesno "Ready to install MBetter to $TARGET_DISK\n\nWARNING: This will COMPLETELY ERASE all data on $TARGET_DISK!\n\nTarget disk: $TARGET_DISK ($size_gb GB)\nModel: $model\n\nContinue with installation?" \ echo "Model: $model"
15 70 echo ""
return $? echo -e "${YELLOW}Ready to begin installation?${NC}"
else echo -n "Continue with installation? (type 'YES' to confirm): "
# Terminal confirmation as fallback read -r confirmation
echo ""
echo -e "${RED}WARNING: This will COMPLETELY ERASE all data on $TARGET_DISK!${NC}" case "$confirmation" in
echo "Target disk: $TARGET_DISK ($size_gb GB)" YES|yes|Y|y)
echo "Model: $model"
echo ""
echo -n "Continue with installation? (type 'yes' to confirm): "
read -r confirmation
if [ "$confirmation" = "yes" ] || [ "$confirmation" = "YES" ]; then
return 0 return 0
else ;;
*)
return 1 return 1
fi ;;
fi esac
} }
# Partition disk automatically # Partition disk automatically
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment