-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbasic.sh
More file actions
executable file
·76 lines (59 loc) · 1.85 KB
/
basic.sh
File metadata and controls
executable file
·76 lines (59 loc) · 1.85 KB
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
#!/bin/bash
### variables ###
USERNAME=sloth
HOST=Arch
# pacman configuration
sed -i "33s/.//; 37cParallelDownloads = 20\nILoveCandy" /etc/pacman.conf
echo 'Server = http://ftp.kaist.ac.kr/ArchLinux/$repo/os/$arch' >/etc/pacman.d/mirrorlist
# install packages
pacman -Syu --needed --noconfirm intel-ucode nvidia nvidia-utils nvidia-settings base-devel doas man-db man-pages openssh reflector xdg-utils zsh git github-cli bat ripgrep lsd tealdeer noto-fonts-emoji
# refresh mirrorlist
echo "refresh mirrorlist ..."
reflector -c KR -f 4 >>/etc/pacman.d/mirrorlist
# timezone
ln -sf /usr/share/zoneinfo/Asia/Seoul /etc/localtime
hwclock -w
# locale
sed -i '177s/.//; 313s/.//' /etc/locale.gen
locale-gen
echo "LANG=en_US.UTF-8" >/etc/locale.conf
# hostname, hosts
echo $HOST >/etc/hostname
{
echo "127.0.0.1 localhost"
echo "::1 localhost"
echo "127.0.1.1 $HOST.localdomain $HOST"
} >>/etc/hosts
### bootloader (systemd-boot)
#
bootctl install
echo "default arch.conf
console-mode max
editor no" >/boot/loader/loader.conf
ROOT=$(mount | grep "/ " | cut -d ' ' -f 1)
PARTUUID=$(blkid -s PARTUUID -o value "$ROOT")
echo "title Arch Linux
linux /vmlinuz-linux
initrd /intel-ucode.img
initrd /initramfs-linux.img
options root=PARTUUID=$PARTUUID rw" >/boot/loader/entries/arch.conf
echo "title Arch Linux (fallback initramfs)
linux /vmlinuz-linux
initrd /intel-ucode.img
initrd /initramfs-linux-fallback.img
options root=PARTUUID=$PARTUUID rw" >/boot/loader/entries/arch-fallback.conf
#
###
# add user
useradd -m -s /usr/bin/zsh $USERNAME
# password
echo root:7107 | chpasswd
echo $USERNAME:7107 | chpasswd
# doas
echo "permit nopass keepenv $USERNAME" >/etc/doas.conf
chown root:root /etc/doas.conf
chmod 0400 /etc/doas.conf
# enable services
systemctl enable systemd-networkd
cp 20-wired.network /etc/systemd/network/20-wired.network
echo "Reboot after umount."