~alexdavid/dotfiles

ref: ec258e597464b4340b1781e7d30cd6c33fd9c363 dotfiles/archlinux/setup/chroot -rw-r--r-- 942 bytes
ec258e59 — Alex David Update i3block order 1 year, 9 days ago
                                                                                
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
#!/usr/bin/env bash

function section {
  echo
  echo
  echo
  echo "################################################################"
  echo "==> $1"
  echo
}

function ask {
  printf "%s: " "$2"
  read $1
}


section "SETTING LOCALE"
echo "en_US.UTF-8 UTF-8" > /etc/locale.gen
locale-gen
echo "LANG=en_US.UTF-8" > /etc/locale.conf
export LANG=en_US.UTF-8
ln -f -s /usr/share/zoneinfo/America/Los_Angeles /etc/localtime
ask HOSTNAME "Hostname"
echo "$HOSTNAME" > /etc/hostname


section "SETTING ROOT PASSWORD"
passwd


section "CREATING MAIN USER"
ask USERNAME "Username"
useradd -m -g users -G wheel "$USERNAME"
passwd "$USERNAME"


section "INSTALLING GRUB"
pacman -S grub efibootmgr
grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=grub
grub-mkconfig -o /boot/grub/grub.cfg


section "SETTING UP SIMPLE FIREWALL"
cp /etc/iptables/simple_firewall.rules /etc/iptables/iptables.rules
systemctl enable iptables.service