-
Notifications
You must be signed in to change notification settings - Fork 0
/
base_install.sh
executable file
·275 lines (231 loc) · 6.68 KB
/
base_install.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
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
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
#!/usr/bin/env bash
RED='\033[0;31m' # Red color
BLUE='\033[0;36m' # Cyan color
GREEN='\033[0;32m' # Green color
NC='\033[0m' # No color
func_install() {
if pacman -Qi $1 &> /dev/null; then
echo -e "${RED}################## The package "$1" is already installed ##################${NC}"
else
pacman -S --noconfirm $1
fi
}
echo "################## Setting the english locale ##################"
ln -sf /usr/share/zoneinfo/US/Pacific /etc/localtime
hwclock --systohc
sed -i 's/#en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/g' /etc/locale.gen
cat /etc/locale.gen | grep en_US
echo -e "${BLUE}There should be an uncommented line: 'en_US.UTF-8 UTF-8'. If not, please fix /etc/locale.gen${NC}."
echo -e "${BLUE}Sleeping for 20 seconds while you read this${NC}."
sleep 20
locale-gen
if [[ -f "/etc/locale.conf" ]]; then
echo "LANG=en_US.UTF-8" >> /etc/locale.conf
else
touch /etc/locale.conf
echo "LANG=en_US.UTF-8" >> /etc/locale.conf
fi
echo "################## Installing Software ##################"
list=(
adapta-gtk-theme
# alacritty
alsa-lib
# archlinux-wallpaper
avahi
awesome-terminal-fonts
base-devel
bash
bat
# blueberry
# bluez
# bluez-libs
# bluez-utils
bridge-utils
# btrfs-progs
cmake
ctags
dialog
dnsmasq
# dosfstools
dunst
ebtables
ecryptfs-utils
edk2-ovmf
efibootmgr
# efm-langserver
fd
ffmpeg
flameshot
go
grub
# grub-btrfs
gvfs-smb
htop
imagemagick
# intel-ucode
jgmenu
kitty
libreoffice-fresh
libvirt
# linux-lts-headers
linux-headers
lolcat
lsd
lxappearance
lxsession
lua
lynx
man-db
mlocate
mpv
mtools
netctl
networkmanager
nitrogen
nodejs
npm
nss-mdns
nvidia
nvidia-dkms
# nvidia-lts
nvidia-settings
nvidia-utils
openbsd-netcat
opendoas
openssh
# os-prober
pacman-contrib
pandoc
pass
pavucontrol
pcmanfm
picom
pkgfile
postgresql
powerline-fonts
pulseaudio
pulseaudio-alsa
# pulseaudio-bluetooth
python3
python-pillow
python-pip
python-pynvim
qemu
qtile
qutebrowser
r
# ranger
redshift
reflector
rofi
rsync
signal-desktop
# simplescreenrecorder
sxiv
systemd-manager
tlp
transmission-cli
ufw
unzip
vde2
# vim
virt-manager
wget
wireless_tools
wpa_supplicant
xorg-server
xorg-xinit
xorg-xkill
xorg-xrandr
xorg-xrdb
xorg-xprop
youtube-dl
zathura
zathura-pdf-mupdf
zsh
zsh-autosuggestions
zsh-syntax-highlighting
)
count=0
for name in "${list[@]}" ; do
count=$[count+1]
echo -e "${BLUE}Installing package number "$count" of ${#list[@]}${NC}" $name;
func_install $name
done
echo "################## Setting hostname to 'archybangbang' ##################"
if [[ -f "/etc/hostname" ]]; then
hostnamectl set-hostname archybangbang
echo "archybangbang" >> /etc/hostname
else
touch /etc/hostname
hostnamectl set-hostname archybangbang
echo "archybangbang" >> /etc/hostname
fi
echo "################## Setting up wifi ##################"
if [[ -f "/etc/hosts" ]]; then
echo -e "127.0.0.1 localhost\n::1 localhost ip6-localhost ip6-loopback\n127.0.1.1 archybangbang\nff02::1 ip6-allnodes\nff02::2 ip6-allrouters" >> /etc/hosts
else
touch /etc/hosts
echo -e "127.0.0.1 localhost\n::1 localhost ip6-localhost ip6-loopback\n127.0.1.1 archybangbang\nff02::1 ip6-allnodes\nff02::2 ip6-allrouters" >> /etc/hosts
fi
cat /etc/hosts
echo -e "${BLUE}The above file should contain the following:\n\n# Static table lookup for hostnames.\n# See hosts(5) for details.\n127.0.0.1 localhost\n::1 localhost ip6-localhost ip6-loopback\n127.0.1.1 archybangbang\nff02::1 ip6-allnodes\nff02::2 ip6-allrouters\n\nIf not, please come back to edit /etc/hosts${NC}."
echo -e "${BLUE}Sleeping for 30 seconds while you read this${NC}."
sleep 30
echo "################## Editing /etc/libvirt/libvirtd.conf ##################"
sed -i 's/#unix_sock_group = "libvirt"/unix_sock_group = "libvirt"/g' /etc/libvirt/libvirtd.conf
sed -i 's/#unix_sock_rw_perms = "0770"/unix_sock_rw_perms = "0770"/g' /etc/libvirt/libvirtd.conf
cat /etc/libvirt/libvirtd.conf | grep unix_sock_group
echo -e "${BLUE}The above line should be: unix_sock_group = 'libvirt'${NC}"
cat /etc/libvirt/libvirtd.conf | grep unix_sock_rw_perms
echo -e "${BLUE}The above line should be: unix_sock_rw_perms = '0770'${NC}"
echo -e "${BLUE}If either of those are wrong, please come back to edit /etc/libvirt/libvirtd.conf${NC}."
echo -e "${BLUE}Sleeping for 20 seconds while you read this${NC}."
sleep 20
echo "################## Editing /etc/pacman.conf ##################"
sed -i 's/#Color/Color/g' /etc/pacman.conf
cat /etc/pacman.conf | grep Color
echo -e "${BLUE}The above line should be 'Color'. If it is not, please come back to edit /etc/pacman.conf${NC}."
echo -e "${BLUE}Sleeping for 20 seconds while you read this${NC}."
sleep 20
echo "################## Enabling systemctl ##################"
systemctl enable sshd
systemctl enable NetworkManager
systemctl enable tlp
# systemctl enable bluetooth
echo "################## Editing mkinitcpio.conf ##################"
# sed -i 's/MODULES=.*/MODULES=(btrfs nvidia)/g' /etc/mkinitcpio.conf
sed -i 's/MODULES=.*/MODULES=(nvidia)/g' /etc/mkinitcpio.conf
cat /etc/mkinitcpio.conf | grep MODULES
# echo -e "${BLUE}The above line should be 'MODULES=(btrfs nvidia)'. If it is not, please come back to edit /etc/mkinitcpio.conf${NC}."
echo -e "${BLUE}The above line should be 'MODULES=(nvidia)'. If it is not, please come back to edit /etc/mkinitcpio.conf${NC}."
echo -e "${BLUE}Sleeping for 20 seconds while you read this${NC}."
sleep 20
mkinitcpio -p linux
echo "################## Setting users and passwords ##################"
echo -e "${BLUE}Create a password for the root user${NC}."
passwd
echo -e "${BLUE}Enter a username for the normal user${NC}."
echo "Username:"
read user
groupadd libvirtd
groupadd wheel
groupadd users
useradd -m -g users -G wheel,libvirt $user
echo "Add a password for $user."
passwd $user
echo "################## Installing grub ##################"
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=GRUB
echo "################## Making grub ##################"
grub-mkconfig -o /boot/grub/grub.cfg
echo "################## Editing sudoers config file ##################"
sed -i 's/# %wheel ALL=(ALL) ALL/%wheel ALL=(ALL) ALL/g' /etc/sudoers
cat /etc/sudoers | grep %wheel
echo -e "${BLUE}The above line should be '%wheel ALL=(ALL) ALL'. If it is not, please fix${NC}."
echo -e "${BLUE}Sleeping for 20 seconds while you read this${NC}."
sleep 20
echo "################## Moving install script to users home directory ##################"
mv -v arch_install/ /home/$user/
echo "################## Inserting echo command into bashrc for next steps ##################"
echo "echo 'command for next script(to be run with su NOT sudo): ./arch_install/system_setup.sh'" >> /home/$user/.bashrc
echo -e "${GREEN}Finished! Please type 'exit', then 'umount -R /mnt', and reboot${NC}."