summaryrefslogtreecommitdiff
path: root/bin/man/post-install.7
blob: 141c9400f15e43d83dbdeca70ead844a9b582dbf (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
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
.Dd October 1, 2026
.Dt POST-INSTALL 7
.Os
.Sh NAME
.Nm post-install
.Nd from a freshly installed rawnix to a working desktop
.Sh DESCRIPTION
This page picks up where
.Xr installation 7
ends: the system boots, root has a password, and the ports tree is
synced.
What follows is the order that works, and the one place where the order
matters: the graphics driver is chosen before wlroots is built, because
wlroots and everything above it is built against it.
.Pp
Everything here uses
.Xr pkg 8 ,
which resolves dependencies and installs them.
Add
.Fl b
to fetch prebuilt packages instead of building, which is much faster and
needs no compiler:
.Dl # pkg add -b foot
.Sh FIRST STEPS
.Ss A user
root is for administration; log in as a user.
.Bd -literal -offset indent
# useradd -m -G wheel,audio,video,input,plugdev zorz
# passwd zorz
.Ed
.Pp
The groups are the ones a desktop needs:
.Li video
and
.Li input
for the compositor,
.Li audio
for sound,
.Li plugdev
for
.Xr stik 8 ,
and
.Li wheel
for
.Xr doas 1 .
.Ss doas
.Bd -literal -offset indent
# pkg add -b opendoas
# echo 'permit persist :wheel' > /etc/doas.conf
# chmod 640 /etc/doas.conf
.Ed
.Ss The clock and the network
Both are services; see
.Sx SERVICES
below.
.Bd -literal -offset indent
# pkg add -b openntpd dhcpcd
# ln -s /etc/sv/ntpd /service/ntpd
# ln -s /etc/sv/dhcpcd /service/dhcpcd
.Ed
.Pp
A server with a static address configures it in
.Pa /etc/dhcpcd.conf
rather than by hand, so one service owns the interface.
.Ss A firewall
On anything reachable from a network:
.Bd -literal -offset indent
# pkg add -b nftables
# vi /etc/nftables.conf
# ln -s /etc/sv/nftables /service/nftables
.Ed
.Pp
The shipped
.Pa /etc/nftables.conf
drops everything inbound except ssh; open what the machine serves.
With sshd reachable from the internet, add
.Li sshguard .
.Sh GRAPHICS
.Sy Choose the Mesa package before building wlroots.
wlroots, the compositors and everything that draws are built against the
Mesa that is installed, so installing the wrong one means building them
all again.
.Pp
There is one Mesa package per driver, and only one is installed at a
time:
.Bl -tag -width mesa-nouveau
.It Li mesa-amdgpu
AMD, from GCN onwards: Radeon, and the integrated graphics of Ryzen.
.It Li mesa-intel
Intel integrated graphics.
.It Li mesa-nouveau
NVIDIA, with the open driver.
The proprietary driver is not packaged.
.It Li mesa-virtio
A virtual machine: QEMU/KVM with virtio-gpu, and other hypervisors
through the same driver.
.El
.Pp
Which one, if you are not sure:
.Dl $ lspci | grep -i -E 'vga|3d|display'
.Pp
Then, for example:
.Dl # pkg add -b mesa-amdgpu
.Pp
The LLVM target matters here too.
Mesa's AMD driver compiles shaders with LLVM, so llvm has to be built
with
.Li AMDGPU
among its targets; the Intel driver does not, and nouveau uses
.Li NVPTX .
See
.Xr rawnix 7 ,
.Sx Clang and LLVM .
If llvm was built without the target your Mesa needs, rebuild llvm
first, then Mesa.
.Sh KERNEL MODULES
The kernel is monolithic: every driver a machine needs to boot, mount
its disks and reach the network is built in, so nothing has to be loaded
for the system to come up.
Two kinds of driver are the exception and are built as modules, because
which one a machine needs is not known in advance:
.Bl -bullet -compact
.It
wireless, and the firmware that goes with it
.It
graphics
.El
.Pp
These are loaded at boot from
.Pa /etc/rc.modules ,
a shell script run early in
.Pa /etc/runit/1 .
Create it with the modules this machine needs and make it executable:
.Bd -literal -offset indent
#!/bin/sh
modprobe jitterentropy_rng
modprobe iwlmvm
modprobe iwlwifi
modprobe amdgpu
.Ed
.Bd -literal -offset indent
# chmod 755 /etc/rc.modules
.Ed
.Pp
Line by line:
.Bl -tag -width jitterentropy_rng
.It Li jitterentropy_rng
An extra source of entropy for the kernel's random pool, from the timing
jitter of the CPU itself.
Not required, but worth having on a machine with no hardware random
generator, and on a virtual machine, where entropy is scarce early in
the boot.
.It Li iwlmvm , Li iwlwifi
Intel wireless.
Both are needed, and in this order:
.Li iwlwifi
is the driver and
.Li iwlmvm
the operating mode it hands the device to.
Other chips need their own:
.Li ath9k
or
.Li ath11k
for Atheros and Qualcomm,
.Li rtw88_8822be
and the like for Realtek,
.Li mt7921e
for MediaTek.
.It Li amdgpu
Graphics.
Use the one for the card in the machine:
.Li amdgpu
for AMD,
.Li i915
or
.Li xe
for Intel,
.Li nouveau
for NVIDIA,
.Li virtio_gpu
in a virtual machine.
.El
.Pp
What a machine actually has, and what claims it once loaded:
.Bd -literal -offset indent
$ lspci -k | grep -A3 -i -E 'network|vga|3d|display'
$ lsmod
$ dmesg | grep -i -E 'firmware|iwlwifi|amdgpu'
.Ed
.Pp
Wireless also needs its firmware, which is not in the kernel:
.Dl # pkg add -b linux-firmware
Without it the driver loads and the device stays silent, with a line in
.Ic dmesg
about firmware that could not be found.
.Pp
A server needs none of this: no wireless, no graphics.
.Li jitterentropy_rng
alone is still worth the one line.
.Sh A COMPOSITOR
With Mesa in place:
.Bd -literal -offset indent
# pkg add -b seatd
# ln -s /etc/sv/seatd /service/seatd
.Ed
.Pp
.Li seatd
hands the compositor the graphics and input devices, so it needs no
privileges of its own.
Its group is
.Li seatd ;
add the user to it if the compositor refuses to open the display.
.Pp
Then one of the two:
.Bl -tag -width labwc
.It Li sway
Tiling, i3-like, configured in
.Pa ~/.config/sway/config .
.It Li labwc
Stacking, openbox-like, configured in
.Pa ~/.config/labwc/ .
.El
.Pp
Both are wlroots compositors and can be installed side by side; pick one
at login.
.Bd -literal -offset indent
# pkg add -b labwc foot
$ labwc
.Ed
.Pp
.Li foot
is the terminal.
Without one, a compositor starts into an empty screen with no way to
type anything.
.Sh THE REST OF A DESKTOP
None of this is required; it is what most installs end up with.
.Bl -tag -width "wl-clipboard" -compact
.It Li foot
terminal
.It Li wmenu
application launcher
.It Li sfwbar
status bar
.It Li fnott
notifications
.It Li wl-clipboard
clipboard from the shell
.It Li grim , Li slurp
screenshots, with a region selector
.It Li imv
image viewer
.It Li mpv
video and audio
.It Li firefox , Li thunderbird
browser and mail
.It Li font-dejavu , Li font-jetbrains-mono
fonts; without one, everything falls back to something unreadable
.El
.Pp
Sound is
.Li alsa-utils ;
.Ic alsamixer
unmutes what is muted by default.
.Sh SERVICES
A service is enabled by linking it into
.Pa /service ,
and runit starts it within seconds.
.Bd -literal -offset indent
# ln -s /etc/sv/nginx /service/nginx    # enable, starts now
# rm /service/nginx                     # disable, stops now
# sv status /service/*                  # everything
# sv restart nginx                      # one
# sv down nginx ; sv up nginx           # stop, start
.Ed
.Pp
It is
.Pa /service ,
not
.Pa /var/service
and not
.Pa /run/runit/service ;
see
.Xr rawnix 7 .
Logs are under
.Pa /var/log/ Ns Ar service Ns /current ,
written by each service's own
.Pa log/run .
.Pp
A package that ships a service is linked in by
.Xr addpkg 8
at install time, so it is already running when the install finishes.
.Sh KEEPING IT UP TO DATE
.Bd -literal -offset indent
# ports -u                 # fetch the newest recipes
# pkg diff                 # what is older than its port
# pkg sysup -b             # update everything, from prebuilt packages
# revdep                   # anything broken afterwards
.Ed
.Pp
Without
.Fl b
everything is built from source, which needs llvm and the rest of the
development tools.
A server usually wants
.Fl b
and no compiler at all.
.Pp
The kernel is never updated by
.Ic pkg sysup :
it is installed by hand, so that a running machine does not get a new
kernel by surprise.
.Bd -literal -offset indent
# pkg add -b linux-6.12.111
# ls /boot/efi/limine.conf
.Ed
.Pp
Installing a kernel runs
.Ic limine-sync ,
which writes the boot menu from what is in
.Pa /boot .
The previous kernel stays in the menu; keep it until the new one has
booted.
See
.Xr bootloader 7 .
.Pp
.Lk https://audit.rawnix.org/
lists which ports are outdated and which have open CVEs, including the
kernel.
.Sh KEEPING A PORT WHERE IT IS
To stop a package being updated, lock it:
.Bd -literal -offset indent
# pkg lock rust
# pkg locked
.Ed
.Pp
A locked port keeps its own copy of the recipe, so
.Ic ports -u
cannot change it; see
.Xr pkg 8 .
.Sh FILES
.Bl -tag -width Ds -compact
.It Pa /etc/rc.modules
Modules loaded at boot; see
.Sx KERNEL MODULES .
.It Pa /service/
Enabled services, linked from
.Pa /etc/sv/ .
.It Pa /etc/doas.conf
Who may use
.Xr doas 1 .
.El
.Sh SEE ALSO
.Xr doas 1 ,
.Xr bootloader 7 ,
.Xr installation 7 ,
.Xr rawnix 7 ,
.Xr mkpkg 8 ,
.Xr pkg 8 ,
.Xr ports 8 ,
.Xr revdep 8 ,
.Xr stik 8