-
Notifications
You must be signed in to change notification settings - Fork 0
/
chroot.sh
executable file
·49 lines (38 loc) · 1.48 KB
/
chroot.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
#!/bin/bash
## FUNCTIONS
####
pacman_candy() { \
grep -q "ILoveCandy" /etc/pacman.conf || sed -i "/#VerbosePkgLists/a ILoveCandy" /etc/pacman.conf
sed -Ei "s/^#(ParallelDownloads).*/\1 = 5/;/^#Color$/s/#//" /etc/pacman.conf
}
changerootpasswd() { \
spass1=$(dialog --no-cancel --title "Change root password" --passwordbox "Enter a new root password." 10 60 3>&1 1>&2 2>&3 3>&1)
spass2=$(dialog --no-cancel --title "Change root password" --passwordbox "Retype password." 10 60 3>&1 1>&2 2>&3 3>&1)
while ! [ "$spass1" = "$spass2" ]; do
unset spass2
spass1=$(dialog --no-cancel --passwordbox "Passwords do not match.\\n\\nEnter password again." 10 60 3>&1 1>&2 2>&3 3>&1)
spass2=$(dialog --no-cancel --passwordbox "Retype password." 10 60 3>&1 1>&2 2>&3 3>&1)
done ;}
installpkg() { \
pacman -S --noconfirm "$1" >/dev/null 2>&1
}
## continue from deploy.sh
###
pacman_candy
TZuser=$(<tzfinal.tmp)
ln -sf /usr/share/zoneinfo/$TZuser /etc/localtime
rm tzfinal.tmp
hwclock --systohc
echo "LANG=en_US.UTF-8" > /etc/locale.conf
sed -i '/#en_US.UTF-8 UTF-8/s/^#//g' /etc/locale.gen
sed -i '/#en_US ISO-8859-1/s/^#//g' /etc/locale.gen
locale-gen
pacman -Sy --noconfirm networkmanager
installpkg networkmanager-runit
installpkg network-manager-applet
ln -s /etc/runit/sv/NetworkManager /etc/runit/runsvdir/default
pacman -Sy --noconfirm grub && grub-install --target=i386-pc /dev/sda && grub-mkconfig -o /boot/grub/grub.cfg
installpkg dialog
changerootpasswd
echo -e "$spass1\n$spass1" | passwd
exit