-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQuickArch.sh
More file actions
191 lines (145 loc) · 7.13 KB
/
QuickArch.sh
File metadata and controls
191 lines (145 loc) · 7.13 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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
#!/bin/sh
#######################################################################################
# ▄████████ ▄████████ ███▄▄▄▄ ████████▄ ▄▄▄▄███▄▄▄▄ ▄████████ ███▄▄▄▄ #
# ███ ███ ███ ███ ███▀▀▀██▄ ███ ▀███ ▄██▀▀▀███▀▀▀██▄ ███ ███ ███▀▀▀██▄#
# ███ █▀ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███#
# ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███#
#▀███████████ ▀███████████ ███ ███ ███ ███ ███ ███ ███ ▀███████████ ███ ███#
# ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███#
# ▄█ ███ ███ ███ ███ ███ ███ ▄███ ███ ███ ███ ███ ███ ███ ███#
# ▄████████▀ ███ █▀ ▀█ █▀ ████████▀ ▀█ ███ █▀ ███ █▀ ▀█ █▀ #
#######################################################################################
echo "-------------------------------------------------"
echo " _____ _ _ _____ _ "
echo " | |_ _|_|___| |_| _ |___ ___| |_ "
echo " | | | | | | _| '_| | _| _| | "
echo " |__ _|___|_|___|_,_|__|__|_| |___|_|_| "
echo " |__| "
echo " "
echo " --A fast way to install Arch-- "
echo " --For more information go to the Arch wiki-- "
echo "-------------------------------------------------"
echo " "
echo "-------------------------------------------------"
echo "| -- WARNINGS! -- |"
echo "| This code may not suite your needs, so make |"
echo "| your own versions of it! You need a basic |"
echo "| understanding of how to install arch. |"
echo "-------------------------------------------------"
echo " "
echo " "
echo " "
echo "-------------------------------------------------"
echo "-- Update the system clock and pick mirrors --"
echo "-------------------------------------------------"
#install nano
pacman -Sy nano --noconfirm
#update sytem clock
timedatectl set-ntp true
echo "-- pick your mirrors --"
#open the mirrorlist to pick mirrors
nano /etc/pacman.d/mirrorlist
#refresh mirrors
pacman -Sy --noconfirm
echo "------------------------------------------------"
echo "-- Partitioning --"
echo "------------------------------------------------"
#show list of disks
lsblk
#ask for disk name
echo "Please enter disk: (example /dev/sda)"
read DISK
#instructions
echo "-- Partition your hardrive --"
#open cfdisk
cfdisk ${DISK}
#select root partition
echo "Please enter root partition: (example /dev/sda1)"
read ROOT
echo "------------------------------------------------"
echo "-- Warning all data will be lost! --"
echo "------------------------------------------------"
#format root partition
mkfs.ext4 ${ROOT}
#mount root partition
mount ${ROOT} /mnt
#ask if you made a swap partition
echo "Do you have a swap partition: (yes,no)"
read YESNO
if [ ${YESNO} == "yes" ]
then
#select swap partition
echo "Please enter swap partition: (example /dev/sda1)"
read SWAP
#format swap partition
mkswap ${SWAP}
swapon ${SWAP}
fi
#ask for an existing home partition
echo "Did you have a seperate Home partition set up before the install: (yes, no)"
read YNHOME
if [ ${YNHOME} == "yes" ]
then
#ask for the existing home partition
echo "Please enter home partition: (example /dev/sda1)"
read HOME
#mount home partition
mkdir /mnt/home
mount ${HOME} /mnt/home
else
#ask for a new home partition if you didn't have an existing one
echo "Did you make a new Home partition: (yes, no)"
read YESNOHOME
if [ ${YESNOHOME} == "yes" ]
then
#ask for new home partition
echo "Please enter home partition: (example /dev/sda1)"
read NEWHOME
#format new home partition
mkfs.ext4 ${NEWHOME}
#mount new home parition
mount ${NEWHOME} /mnt/home
fi
fi
echo "------------------------------------------------"
echo "-- Arch Install on Main Drive --"
echo "------------------------------------------------"
#install arch with some other packages
pacstrap /mnt base base-devel linux linux-firmware nano sudo git --noconfirm --needed
echo "------------------------------------------------"
echo "-- Configure the system --"
echo "------------------------------------------------"
#generate fstab
genfstab -U /mnt >> /mnt/etc/fstab
#change root into the new system
arch-chroot /mnt /bin/bash -c 'echo "Please enter time zone: (example Canada)"; read ZONE; echo "Please enter time subzone: (example Eastern)"; read SUBZONE; timedatectl set-timezone ${ZONE}/${SUBZONE}; ln -sf /usr/share/zoneinfo/${ZONE}/${SUBZONE} /etc/localtime; echo "-- pick locale --"; nano /etc/locale.gen; locale-gen; echo "Please enter hostname:"; read HOSTNAME; echo ${HOSTNAME} > /etc/hostname; pacman -S networkmanager dhclient --noconfirm --needed; systemctl enable NetworkManager.service; passwd; pacman -S grub-bios --noconfirm --needed; echo "Please enter disk: (example /dev/sda)"; read DISK; grub-install --target=i386-pc ${DISK}; grub-mkconfig -o /boot/grub/grub.cfg'
##ask for time zone
#echo "Please enter time zone: (example Canada)"
#read ZONE
#echo "Please enter time subzone: (example Eastern)"
#read SUBZONE
##set the time zone
#timedatectl set-timezone ${Zone}/${SubZone}
#ln -sf /usr/share/zoneinfo/${ZONE}/${SUBZONE} /etc/localtime
#echo "-- pick locale --"
##edit /etc/locale.gen
#nano /etc/locale.gen
#generate locales
#locale-gen
##generate hostname
#echo "Please enter hostname:"
#read HOSTNAME
#echo ${HOSTNAME} > /etc/hostname
##install network manager
#pacman -S networkmanager dhclient --noconfirm --needed
#systemctl enable NetworkManager.service
##set the root password
#passwd
##install grub
#pacman -S grub-bios --noconfirm --needed
#grub-install --target=i386-pc ${DISK}
##create grub config file
#grub-mkconfig -o /boot/grub/grub.cfg
echo "------------------------------------------------"
echo "-- You may now reboot --"
echo "------------------------------------------------"