-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpacstrap.sh
executable file
·92 lines (79 loc) · 3.45 KB
/
pacstrap.sh
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
#!/bin/bash
cat << "EOF"
███████ ██
░██░░░░██ ░██ ██████
░██ ░██ ██████ █████ ██████ ██████ ██████ ██████ ░██░░░██
░███████ ░░░░░░██ ██░░░██ ██░░░░ ░░░██░ ░░██░░█ ░░░░░░██ ░██ ░██
░██░░░░ ███████ ░██ ░░ ░░█████ ░██ ░██ ░ ███████ ░██████
░██ ██░░░░██ ░██ ██ ░░░░░██ ░██ ░██ ██░░░░██ ░██░░░
░██ ░░████████░░█████ ██████ ░░██ ░███ ░░████████░██
░░ ░░░░░░░░ ░░░░░ ░░░░░░ ░░ ░░░ ░░░░░░░░ ░░
EOF
# -----------------------------------------
# Set the packages to install
# -----------------------------------------
pacstrapPackages=(
"base"
"base-devel"
"linux"
"linux-headers"
"linux-firmware"
"intel-ucode"
"nano"
"neovim"
"git"
"grub"
"efibootmgr"
"zsh"
)
# -----------------------------------------
# Retry pacstrap until it's successful
# -----------------------------------------
while true; do
if pacstrap /mnt "${pacstrapPackages[@]}"; then
break # Exit the loop if pacstrap is successful
else
# Pacstrap failed
read -p "Error: pacstrap failed. Do you want to retry? (y/n): " choice
case $choice in
[Yy])
echo "Retrying pacstrap..."
sleep 5 # Wait for 5 seconds before retrying
;;
[Nn])
echo "Exiting script. Please check and resolve the issue."
exit 1
;;
*)
echo "Invalid choice. Please enter 'y' for yes or 'n' for no."
;;
esac
fi
done
# -----------------------------------------
# Generate an fstab file for the new system
# -----------------------------------------
genfstab -U /mnt >> /mnt/etc/fstab
# -----------------------------------------
# Done
# -----------------------------------------
cat << "EOF"
███████
░██░░░░██
░██ ░██ ██████ ███████ █████
░██ ░██ ██░░░░██░░██░░░██ ██░░░██
░██ ░██░██ ░██ ░██ ░██░███████
░██ ██ ░██ ░██ ░██ ░██░██░░░░
░███████ ░░██████ ███ ░██░░██████
░░░░░░░ ░░░░░░ ░░░ ░░ ░░░░░░
EOF
echo "NEXT: basePackages.sh"
# -----------------------------------------
# Change root into the new system
# -----------------------------------------
arch-chroot /mnt
# -----------------------------------------
# Continue the installation inside the chroot environment
# -----------------------------------------
rsync -av /root/arch-easy /mnt/arch-easy
arch-chroot /mnt /bin/bash -c "/arch-easy/installPostChroot.sh"