-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharch.sh
More file actions
223 lines (87 loc) · 3.47 KB
/
arch.sh
File metadata and controls
223 lines (87 loc) · 3.47 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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
#!/usr/bin/env bash
echo "Please enter EFI paritition: (example /dev/sda1 or /dev/nvme0n1p1)"
read EFI
# Prepend /dev/ to the user input if it doesn't already start with it
if [[ ! "$EFI" =~ ^/dev/ ]]; then
EFI="/dev/$EFI"
Fi
echo "Please enter SWAP paritition: (example /dev/sda2)"
read SWAP
L
echo "Please enter Root(/) paritition: (example /dev/sda3)"
read ROOT
echo "Please enter your username"
read USER
echo "Please enter your password"
read PASSWORD
echo "Please choose Your Desktop Environment"
echo "1. GNOME"
echo "2. KDE"
echo "3. XFCE"
echo "4. NoDesktop"
read DESKTOP
# make filesystems
echo -e "\nCreating Filesystems...\n"
mkfs.vfat -F32 -n "EFISYSTEM" "${EFI}"
mkswap "${SWAP}"
swapon "${SWAP}"
mkfs.ext4 -L "ROOT" "${ROOT}"
# mount target
mount -t ext4 "${ROOT}" /mnt
mkdir /mnt/boot
mount -t vfat "${EFI}" /mnt/boot/
echo "--------------------------------------"
echo "-- INSTALLING Arch Linux BASE on Main Drive --"
echo "--------------------------------------"
pacstrap /mnt base base-devel --noconfirm --needed
# kernel
pacstrap /mnt linux linux-firmware --noconfirm --needed
echo "--------------------------------------"
echo "-- Setup Dependencies --"
echo "--------------------------------------"
# pacstrap /mnt networkmanager network-manager-applet wireless_tools bluez bluez-utils --noconfirm --needed
# xdg-utils xdg-user-dir
pacstrap /mnt grub iwd networkmanager network-manager-applet wireless_tools nano intel-ucode blueman git wpa_supplicant dialog os-prober mtools dosfstools base-devel linux-headers bluez bluez-utils cups s openssh blueman git --noconfirm --needed
# fstab
genfstab -U /mnt >> /mnt/etc/fstab
echo "--------------------------------------"
echo "-- Bootloader Installation --"
echo "--------------------------------------"
bootctl install --path /mnt/boot
echo "default arch.conf" >> /mnt/boot/loader/loader.conf
cat <<EOF > /mnt/boot/loader/entries/arch.conf
title Arch Linux
linux /vmlinuz-linux
initrd /initramfs-linux.img
options root=${ROOT} rw
EOF
cat <<REALEND > /mnt/next.sh
useradd -m $USER
usermod -aG wheel,storage,power,audio $USER
echo $USER:$PASSWORD | chpasswd
sed -i 's/^# %wheel ALL=(ALL:ALL) ALL/%wheel ALL=(ALL:ALL) ALL/' /etc/sudoers
echo "-------------------------------------------------"
echo "Setup Language to US and set locale"
echo "-------------------------------------------------"
sed -i 's/^#en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen
locale-gen
echo "LANG=en_US.UTF-8" >> /etc/locale.conf
ln -sf /usr/share/zoneinfo/Asia/Kathmandu /etc/localtime
hwclock --systohc
echo "arch" > /etc/hostname
cat <<EOF > /etc/hosts
127.0.0.1 localhost
::1 localhost
127.0.1.1 arch.localdomain arch
EOF
echo "-------------------------------------------------"
echo "Display and Audio Drivers"
echo "-------------------------------------------------"
pacman -S pulseaudio --noconfirm --needed
systemctl enable NetworkManager bluetooth iwd bluetooth cups ssh
# Systemctl enable NetworkManager && Systemctl enable iwd && Systemctl enable bluetooth Systemctl enable cups && Systemctl enable sshd
echo "-------------------------------------------------"
echo "Install Complete, You can reboot now"
echo "-------------------------------------------------"
REALEND
arch-chroot /mnt sh next.sh