-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinside_system.sh
executable file
·142 lines (114 loc) · 4 KB
/
inside_system.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
#! /bin/bash
# Set the time zone
ln -sf /usr/share/zoneinfo/America/New_York /etc/localtime
# Set hardware clock
hwclock --systohc
# Put locale in /etc/locale.gen and generate locales
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
locale-gen
# Set lanuguage
touch /etc/locale.conf
echo "LANG=en_US.UTF-8" >> /etc/locale.conf
# Set hostname and save to /etc/hostname
clear
read -p "Enter the hostname for this computer: " HOST
echo "${HOST}" >> /etc/hostname
# Create hosts file
touch /etc/hosts
echo "127.0.0.1 localhost" >> /etc/hosts
echo "::1 localhost" >> /etc/hosts
echo "127.0.1.1 ${HOST}.localdomain ${HOST}" >> /etc/hosts
# Set up root password
echo ""
echo "Set up root password..."
passwd
# Set up user
echo ""
echo ""
echo "Set up user..."
read -p "Enter your username: " USERNAME
useradd -m ${USERNAME}
echo "Enter the password for ${USERNAME}":
passwd ${USERNAME}
usermod -aG wheel,audio,video,optical,storage ${USERNAME}
# Install sudo
pacman -S sudo --noconfirm
sed -i "/# %wheel ALL=(ALL:ALL) ALL/c\%wheel ALL=(ALL:ALL) ALL" /etc/sudoers
# Install grub
pacman -S grub efibootmgr dosfstools os-prober mtools --noconfirm
mkdir /boot/EFI
#read -p "Enter the EFI partition: " EFI
mount $1 /boot/EFI
grub-install --target=x86_64-efi --bootloader-id=grub_uefi --recheck
grub-mkconfig -o /boot/grub/grub.cfg
# Update
pacman -Syu --noconfirm
# Install and enable network manager and iwd
pacman -S networkmanager iwd --noconfirm
systemctl enable NetworkManager
systemctl enable iwd
# Download pacman.conf (enables mirrors)
curl -L https://raw.githubusercontent.com/Zombant/InstallArch/master/pacman.conf > /etc/pacman.conf
# Download makepkg.conf (use all CPU cores)
curl -L https://raw.githubusercontent.com/Zombant/InstallArch/master/makepkg.conf > /etc/makepkg.conf
# Download 30-touchpad.conf
curl -L https://raw.githubusercontent.com/Zombant/InstallArch/master/30-touchpad.conf > /etc/X11/xorg.conf.d/30-touchpad.conf
# Download journald.conf (Only store 100M of journalctl data)
curl -L https://raw.githubusercontent.com/Zombant/InstallArch/master/journald.conf > /etc/systemd/journald.conf
# Update
pacman -Syu --noconfirm
# For pacman mirror updates
pacman -S reflector --noconfirm
curl -L https://raw.githubusercontent.com/Zombant/InstallArch/master/reflector.conf > /etc/xdg/reflector/reflector.conf
systemctl enable reflector.service
# Set up changemac service
# TODO: Provide yes or no prompt for enabling changemac on each network device
pacman -S macchanger --noconfirm
curl -L https://raw.githubusercontent.com/Zombant/InstallArch/master/changemac@.service > /etc/systemd/system/changemac@.service
devices=( $(ip link show | awk '{if ($1 ~ "[0-9]:") print substr($2, 1, length($2)-1) }') )
for device in "${devices[@]}"
do
case $device in
"e"*)
echo "Enabling changemac service for "$device
systemctl enable changemac@"$device"
echo ""
;;
"w"*)
echo "Enabling changemac service for "$device
#nmcli radio wifi off
systemctl enable changemac@"$device"
#nmcli radio wifi on
echo ""
;;
esac
done
# Install and set up other necessities for a base install
pacman -S git vim openssh htop --noconfirm
# Copy github setup script into home directory
curl -L https://raw.githubusercontent.com/Zombant/InstallArch/master/github_setup.sh > /home/$USERNAME/github_setup.sh
chown $USERNAME /home/$USERNAME/github_setup.sh
# Copy configs setup script into home directory
curl -L https://raw.githubusercontent.com/Zombant/InstallArch/master/configs_setup.sh > /home/$USERNAME/configs_setup.sh
chown $USERNAME /home/$USERNAME/configs_setup.sh
# Install DE and other packages
clear
read -n1 -p "Base install finished. Install other packages? [y/n]" OTHER
case $OTHER in
y|Y)
echo ""
echo "Installing Packages"
chmod +x other_packages.sh
./other_packages.sh $USERNAME
;;
n|N)
echo ""
;;
*)
echo "Installing Packages"
chmod +x /mnt/other_packages.sh
./other_packages.sh $USERNAME
;;
esac
# Exit chroot
exit