-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path2.sh
77 lines (66 loc) · 2.56 KB
/
2.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
source /persist-arch/install.conf
pacman -Syyu
pacman-key --populate archlinux
echo "--------------------------------------------------------"
echo " Setup Bahasa, lokal, Hostname & Hosts "
echo "--------------------------------------------------------"
sed -i 's/^#en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen
locale-gen
timedatectl --no-ask-password set-timezone Asia/Jakarta
timedatectl --no-ask-password set-ntp 1
localectl --no-ask-password set-locale LANG="en_US.UTF-8" LC_TIME="en_GB.UTF-8"
#set keymap
localectl --no-ask-password set-keymap us
# Set hostname & hosts
echo ${hstname} >> /etc/hostname
echo "127.0.0.1 localhost" >> /etc/hosts
echo "::1 localhost" >> /etc/hosts
echo "127.0.1.1 ${hstname}.localdomain ${hstname}" >> /etc/hosts
#Add parallel downloading
sed -i 's/^#ParallelDownloads = 5/ParallelDownloads = 2/' /etc/pacman.conf
#Enable multilib
sed -i "/\[multilib\]/,/Include/"'s/^#//' /etc/pacman.conf
pacman -Syyu
echo "--------------------------------------------------------"
echo "->] Input Root Password "
echo "--------------------------------------------------------"
passwd
echo "--------------------------------------------------------"
read -p "->] Input Username :" usrname
echo "--------------------------------------------------------"
echo "->] Input User Password "
echo "--------------------------------------------------------"
useradd -mG wheel ${usrname}
passwd ${usrname}
# Add sudo no password rights
sed -i 's/^# %wheel ALL=(ALL:ALL) NOPASSWD: ALL/%wheel ALL=(ALL:ALL) NOPASSWD: ALL/' /etc/sudoers
# Add sudo rights
sed -i 's/^# %wheel ALL=(ALL:ALL) ALL/%wheel ALL=(ALL:ALL) ALL/' /etc/sudoers
echo "usrname=$usrname" >> /persist-arch/install.conf
cp -rf /persist-arch /home/"${usrname}"
echo 32 > /sys/block/${drive}/queue/iosched/fifo_batch
systemctl enable --now NetworkManager
systemctl enable --now sddm
# Add DNS cloudflare
sed -i 's/^nameserver/#nameserver/' /etc/resolv.conf
echo "nameserver 1.1.1.1" >> /etc/resolv.conf
echo "nameserver 1.0.0.1" >> /etc/resolv.conf
#grub install
case $boot in
1)
pacman -Sy grub os-prober --noconfirm
grub-install --target=i386-pc /dev/"${drive}"
grub-mkconfig -o /boot/grub/grub.cfg
;;
2)
pacman -Sy grub efibootmgr os-prober --noconfirm
grub-install --target=x86_64-efi --efi-directory=/boot
grub-mkconfig -o /boot/grub/grub.cfg
;;
3)
pacman -Sy grub efibootmgr os-prober --noconfirm
grub-install --target=i386-pc --boot-directory=/boot /dev/"${drive}"
grub-install --target=x86_64-efi --efi-directory=/boot --boot-directory=/boot --removable --recheck
grub-mkconfig -o /boot/grub/grub.cfg
;;
esac