-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·123 lines (105 loc) · 4.64 KB
/
install.sh
File metadata and controls
executable file
·123 lines (105 loc) · 4.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#!/usr/bin/env bash
set -euo pipefail
# Script directory for sourcing modules
SCRIPT_DIR="$(dirname "${BASH_SOURCE[0]}")"
# Source essential modules only
source "${SCRIPT_DIR}/utils/colors.sh"
source "${SCRIPT_DIR}/utils/logging.sh"
source "${SCRIPT_DIR}/settings/env.sh"
source "${SCRIPT_DIR}/settings/tasks.sh"
source "${SCRIPT_DIR}/utils/task-handler.sh"
source "${SCRIPT_DIR}/utils/inputs.sh"
source "${SCRIPT_DIR}/utils/cleanup.sh"
# Main installation function
main() {
# Setup logging first
setup_logging
# Initialize the task system
init_tasks
# Show initial task list
display_task_list
echo -e "${BOLD}${CYAN}Starting Arch Linux Installation...${NC}"
echo -e "${CYAN}This will install Arch Linux with LUKS encryption and LVM${NC}"
echo
sleep 1
# Execute tasks with visual progress
if ! execute_task "check_prerequisites" "task_check_prerequisites"; then
handle_task_failure "Prerequisites check failed. Exiting."
fi
if ! execute_task "collect_user_inputs" "task_collect_user_inputs"; then
handle_task_failure "User input collection failed. Exiting."
fi
# These tasks must run sequentially
if ! execute_task "update_system_clock" "task_update_system_clock"; then
handle_task_failure "System clock update failed. Exiting."
fi
if ! execute_task "detect_timezone" "task_detect_timezone"; then
handle_task_failure "Timezone detection failed. Exiting."
fi
if ! execute_task "create_partitions" "task_create_partitions"; then
handle_task_failure "Partition creation failed. Exiting."
fi
if ! execute_task "setup_encryption" "task_setup_encryption"; then
handle_task_failure "Disk encryption setup failed. Exiting."
fi
if ! execute_task "setup_lvm" "task_setup_lvm"; then
handle_task_failure "LVM setup failed. Exiting."
fi
if ! execute_task "format_filesystems" "task_format_filesystems"; then
handle_task_failure "Filesystem formatting failed. Exiting."
fi
if ! execute_task "mount_filesystems" "task_mount_filesystems"; then
handle_task_failure "Filesystem mounting failed. Exiting."
fi
if ! execute_task "install_base_system" "task_install_base_system"; then
handle_task_failure "Base system installation failed. Exiting."
fi
if ! execute_task "configure_system" "task_configure_system"; then
handle_task_failure "System configuration failed. Exiting."
fi
if ! execute_task "setup_bootloader" "task_setup_bootloader"; then
handle_task_failure "Bootloader setup failed. Exiting."
fi
if ! execute_task "create_user" "task_create_user"; then
handle_task_failure "User creation failed. Exiting."
fi
if ! execute_task "setup_secondary_luks" "task_setup_secondary_luks"; then
handle_task_failure "Secondary LUKS setup failed. Exiting."
fi
if ! execute_task "install_official_packages" "task_install_official_packages"; then
handle_task_failure "Official package installation failed. Exiting."
fi
if ! execute_task "install_aur_packages" "task_install_aur_packages"; then
handle_task_failure "AUR package installation failed. Exiting."
fi
if ! execute_task "install_dev_packages" "task_install_dev_packages"; then
handle_task_failure "Development package installation failed. Exiting."
fi
if ! execute_task "install_nvidia_drivers" "task_install_nvidia_drivers"; then
handle_task_failure "NVIDIA driver installation failed. Exiting."
fi
if ! execute_task "configure_mirrors" "task_configure_mirrors"; then
handle_task_failure "Mirror configuration failed. Exiting."
fi
if ! execute_task "configure_system_post_install" "task_configure_system_post_install"; then
handle_task_failure "System post-installation configuration failed. Exiting."
fi
# Final status
echo
if [[ ${FAILED_TASKS} -eq 0 ]]; then
echo -e "${BOLD}${GREEN}🎉 Arch Linux installation completed successfully!${NC}"
echo -e "${GREEN}All tasks completed without errors.${NC}"
echo
echo -e "${CYAN}Your encrypted Arch Linux system is ready!${NC}"
echo -e "${CYAN}Please reboot and enter your LUKS password when prompted.${NC}"
cleanup 0 true # Force cleanup on successful exit
exit 0 # Explicitly exit with 0 on success
else
echo -e "${BOLD}${RED}❌ Installation failed with ${FAILED_TASKS} error(s).${NC}"
display_error_summary
echo -e "${RED}Please resolve the issues above before attempting to boot the system.${NC}"
exit 1
fi
}
# Run main function
main "$@"