-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrenstrap-system.sh
78 lines (63 loc) · 2.15 KB
/
renstrap-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
#!/bin/bash
function print () {
printf "\e[1;32m $1 \e[0m"
}
# Setup locale
read -p "What is your locale? (e.g en_ZA or en_US) " LOCALE
LOCALE="$LOCALE.UTF-8 UTF-8"
sed -i "s/\#$LOCALE/$LOCALE/" /etc/locale.gen
locale-gen
echo LANG=en_ZA.UTF-8 > /etc/locale.conf
export LANG=en_ZA.UTF-8
# Setup time
ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime
hwclock --systohc
# Setup hostname
clear
read -p "What would you like your computer hostname to be? " HOSTNAME
echo $HOSTNAME > /etc/hostname
# Enable multilib
# WARNING: Sketchy
PACMAN_CONFIG=/etc/pacman.conf
echo "" >> $PACMAN_CONFIG
echo "[multilib]" >> $PACMAN_CONFIG
echo "Include = /etc/pacman.d/mirrorlist" >> $PACMAN_CONFIG
# Download base packages
pacman -Syy --noconfirm networkmanager neovim vim base-devel intel-ucode xdg-utils xdg-user-dirs reflector
# Boot boot loader
mount -t efivarfs efivarfs /sys/firmware/efi/efivars/
bootctl install
BOOT_LOADER_CONFIG_PATH=/boot/loader/entries/default.conf
clear
read -p "What would you like your boot title to be? " BOOT_NAME
echo "title $BOOT_NAME" > $BOOT_LOADER_CONFIG_PATH
echo "linux /vmlinuz-linux" >> $BOOT_LOADER_CONFIG_PATH
echo "initrd /intel-ucode.img" >> $BOOT_LOADER_CONFIG_PATH
echo "initrd /initramfs-linux.img" >> $BOOT_LOADER_CONFIG_PATH
# Secure boot drive
clear
echo " " && lsblk && echo " "
read -p "What partition is your root mounted to (enter sdX)? " ROOT_PARTITION_NAME
echo "options root=PARTUUID=$(blkid -s PARTUUID -o value /dev/$ROOT_PARTITION_NAME) rw" >> $BOOT_LOADER_CONFIG_PATH
clear
echo " " && echo "Please set a root password:"
passwd
# Add base user
clear
read -p "What would you like your main username to be? " USERNAME
useradd -m -g users -G wheel,storage,power -s /bin/bash $USERNAME
echo " " && echo "Please set your main user password: "
passwd $USERNAME
SODOERS_FILE="/etc/sudoers"
sed -i 's/# %wheel ALL=(ALL:ALL) ALL/%wheel ALL=(ALL:ALL) ALL/' $SODOERS_FILE
echo >> $SODOERS_FILE
echo "Defaults rootpw" >> $SODOERS_FILE
# Enable system services
systemctl enable NetworkManager
systemctl enable fstrim.timer
systemctl enable reflector.timer
# Update everything
pacman -Syu --noconfirm
clear
print "Arch base setup done!\n"
exit 1;