~alexdavid/dotfiles

ref: 89c70ae6ebad36af8202122e2caa465716812f76 dotfiles/archlinux/setup/chroot -rw-r--r-- 1.0 KiB
89c70ae6 — Alex David Add calendar & battery mako icons 7 months 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
47
48
49
50
51
52
#!/usr/bin/env bash

set -e

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

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

section "INSTALLING PACKAGES NEEDED AFTER REBOOT"
ask WIFI "Install wifi-menu? (yes/no)"
[ "$WIFI" == "yes" ] && pacman -S dialog wpa_supplicant
pacman -S \
  dhcpcd \
  netctl \
  sudo \
  vi \
  ;

section "ADDING ENCRYPT TO MKINITCPIO"
vi /etc/mkinitcpio.conf
mkinitcpio -p linux

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 "SETTING UP SIMPLE FIREWALL"
cp /etc/iptables/simple_firewall.rules /etc/iptables/iptables.rules
systemctl enable iptables.service