summaryrefslogtreecommitdiff
path: root/public/artix-install.md
blob: a45782e60b7624f652d6344c415fcc1378ad6b12 (plain)
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
# wifi wireless connection

ip a
ip link set wlan0 up
rfkill unblock wifi
ip link set wlan0 up
connmanctl
scan wifi
services
agent on
connect wifi_181dea9eaba1_66...
quit

# UEFI vs legacy

ls /sys/firmware/efi/efivars

# partition

lsblk
fdisk /dev/sdX

# create 2 partition (boot, root) or 3 partition (efi, boot, root)

# or add a swap partition for each case

dd if=/dev/urandom of=/dev/sdX2 bs=1M status=progress
cryptsetup luksFormat /dev/sdX2
cryptsetup open /dev/sdX2 luks

# lvm: with volumes

pvcreate /dev/mapper/luks
vgcreate vg /dev/mapper/luks

# Create a volume for your swap space. A good size for this is your RAM size + 2GB.

lvcreate -L 1T vg -n root
lvcreate -L 18G vg -n swap
lvcreate -l 100%FREE vg -n home

# lvm: check volume

vgdisplay
lvdisplay

# lvm: format and mount logical volumes

modprobe dm_mod
vgscan
vgchange -ay

# lvm: file system

mkfs.btrfs /dev/vg/root
mkfs.btrfs /dev/vg/home
mkswap /dev/vg/swap

# file system

# mkfs.btrfs /dev/sdX1

# mkfs.ext4 /dev/sdX1

# mkfs.exfat /dev/sdX1

# mkswap /dev/sdX1

# mount

mount /dev/vg/root /mnt
mkdir /mnt/home
mount /dev/vg/home /mnt/home
mkfs.fat -F32 /dev/sdX1
mkdir /mnt/boot
mount /dev/sdX1 /mnt/boot # UEFI: mkdir /mnt/boot/efi && mount /dev/sdX1 /mnt/boot/efi
swapon /dev/vg/swap
swapon -a

# lvm: without volumes

mkfs.btrfs /dev/mapper/luks
mount /dev/mapper/luks /mnt
mkfs.fat -F32 /dev/sdX1
mkdir /mnt/boot && mount /dev/sdX1 /mnt/boot # UEFI: mkdir /mnt/boot/efi && mount /dev/sdX1 /mnt/boot/efi

# mirrolist

vi /etc/pacman.d/mirrowlist

# programs

basestrap -i /mnt base base-devel runit elogind-runit linux linux-firmware grub networkmanager networkmanager-runit cryptsetup lvm2 lvm2-runit neovim vim os-prober

# UEFI: efibootmgr

# installation

artix-chroot /mnt bash

# Timezone & Location

ln -s /usr/share/zoneinfo/Continent/TimeZone /etc/localtime
hwclock --systohc
vim /etc/locale.conf
export LANG="en_US.UTF-8"
export LC_COLLATE="C"
vim /etc/locale.gen
#en_US.UTF-8
#ko_KR.UTF-8
locale-gen

# Host

vim /etc/hostname
vim /etc/hosts
127.0.0.1 localhost
::1 localhost
127.0.1.1 hostname.localdomin hostname

# Networkmanager

ln -s /etc/runit/sv/Networkmanager /etc/runit/runsvdir/current

# Password and Users

passwd
useradd -G(-g) wheel -m username
passwd username

# (Optional) auto-login

vim /etc/runit/sv/agetty-tty1/conf
--autologin username

# Hook

vim /etc/mkinitcpio.conf
HOOKS=(base udev autodetect modconf kms keyboard keymap consolefont block 'encrypt' 'lvm2' filesystems fsck)
mkinitcpio -p linux

# Decryption and Boot

exit
lsblk -f >> /mnt/etc/default/grub
fstabgen -U /mnt >> /mnt/etc/fstab
artix-chroot /mnt bash
vim /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="... cryptdevice=UUID=/dev/sdX2's UUID:luks root=/dev/mapper/luks"

# Grub Installation

grub-install /dev/sdX

# UEFI: grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=grub

grub-mkconfig -o /boot/grub/grub.cfg

# (Optional) Check root UUID

vim /boot/grub/grub.cfg

# Search 'root=UUID'

# Finish

exit
reboot
detach booting USB

=====================

# List nearby Wi-Fi networks:

nmcli device wifi list

# Connect to a Wi-Fi network:

nmcli device wifi connect SSID_or_BSSID password password

# Connect to a hidden Wi-Fi network:

nmcli device wifi connect SSID_or_BSSID password password hidden yes

# Connect to a Wi-Fi on the wlan1 interface:

nmcli device wifi connect SSID_or_BSSID password password ifname wlan1 profile_name

# Disconnect an interface:

nmcli device disconnect ifname eth0

# Get a list of connections with their names, UUIDs, types and backing devices:

nmcli connection show

# Activate a connection (i.e. connect to a network with an existing profile):

nmcli connection up name_or_uuid

# Delete a connection:

nmcli connection delete name_or_uuid

# See a list of network devices and their state:

nmcli device

# Turn off Wi-Fi:

nmcli radio wifi off