forked from xunil-cloud/arch-install-script
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpost_install.sh
62 lines (45 loc) · 1.66 KB
/
post_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
#!/bin/sh
HOSTNAME=PC
disk_to_install_grub=
install_networkmanager=true
wifi=false
other_essential_packages="vim base-devel man-db grub git sudo xdg-user-dirs"
echo -e "\e[1;36m\n------ basic system configuration: system time, locale, hostname ------\n\e[0m"
ln -sf /usr/share/zoneinfo/Asia/Taipei /etc/localtime
hwclock --systohc
sed -i 's/#en_US.UTF-8/en_US.UTF-8/g' /etc/locale.gen
sed -i 's/#zh_TW.UTF-8/zh_TW.UTF-8/g' /etc/locale.gen
locale-gen > /dev/null
echo "LANG=en_US.UTF-8" > /etc/locale.conf
echo $HOSTNAME > /etc/hostname
echo -e "127.0.0.1 localhost\n::1 localhost\n127.0.1.1 ${HOSTNAME}.localdomain ${HOSTNAME}" > /etc/hosts
if [ ${install_networkmanager} == true ]; then
other_essential_packages="${other_essential_packages} networkmanager"
else
other_essential_packages="${other_essential_packages} dhcpcd"
fi
echo -e "\e[1;36m\n------ install other essential packages ------\n\e[0m"
pacman -S ${other_essential_packages} --needed
echo -e "\e[1;36m\n------ user account setup ------\n\e[0m"
echo -e "\e[1;36mset root password: \n\e[0m"
passwd
echo -e "\e[1;36m\ncreate billson user...\n\e[0m"
useradd billson -m -G wheel
echo -e "\e[1;36mset billson password: \n\e[0m"
passwd billson
sudo -u billson xdg-user-dirs-update
echo
read -p $'\e[1;36mEdit sudo config? [Y\\n] \e[0m' ask_sudo
ask_sudo=${ask_sudo:-y}
if [[ $ask_sudo =~ ^[Yy]$ ]]
then
EDITOR=vim visudo
fi
if [ ${install_networkmanager} == true ]; then
systemctl enable NetworkManager > /dev/null
else
systemctl enable dhcpcd > /dev/null
fi
echo -e "\e[1;36m\n------ install grub ------\n\e[0m"
grub-install --target=i386-pc ${disk_to_install_grub}
grub-mkconfig -o /boot/grub/grub.cfg