-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tex
514 lines (465 loc) · 25.3 KB
/
main.tex
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
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
\documentclass[12pt,A4]{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{xcolor}
\definecolor{ArchCode}{HTML}{EBF1F5}
\definecolor{ArchLink}{HTML}{0077BB}
\definecolor{ArchGreen}{HTML}{DDFFDD}
\usepackage{tcolorbox}
\usepackage[colorlinks = true,
linkcolor =ArchLink,
urlcolor = ArchLink,
citecolor =ArchLink,
anchorcolor = ArchLink
]{hyperref}
\usepackage{minted}
%% se https://www.overleaf.com/learn/latex/Code_Highlighting_with_minted#Reference_guide for other styles
\usemintedstyle{pastie}
\usepackage{geometry}
\geometry{a4paper,portrait,margin=2cm}
%\usepackage{fontspec}
%\setmonofont{IBM Plex Mono}%[SizeFeatures={Size=9}]
\title{Arch install for DELL XPS 9570}
\author{Simone Ruffini }
\date{March 2020}
\newcommand{\linecode}[1]{ \mint[fontsize=\small,bgcolor=ArchCode,frame=single]{bash}|#1|}
\begin{document}
\maketitle
Read everitying while keeping an eye to \href{https://wiki.archlinux.org/index.php/Installation_guide}{\textbf{Arch installation Guide}} and \href{https://www.gloriouseggroll.tv/arch-linux-efi-install-guide/}{GloriusEggroll}
\section{Pre-Installation}
\subsection{Create Bootable Media}
Create a bootable device with RUFUS with dd method () or by using dd.
\begin{itemize}
\item Windows: RUFUS with dd
\item *nix:
\end{itemize}
\begin{minted}[fontsize=\footnotesize,bgcolor=ArchCode,frame=single]{bash}
sudo dd bs=4M if=<path/to/input>.iso of=/dev/sd<?> conv=fdatasync status=progress
\end{minted}
\noindent Boot in arch linux. Remember to disable Secure Boot and RAID intel otherwise nvme devices wont be shown.
\subsection{Verify the boot mode}
If \href{https://wiki.archlinux.org/index.php/UEFI}{UEFI} mode is enabled on an \href{https://wiki.archlinux.org/index.php/UEFI}{UEFI} motherboard, Archiso will \href{https://wiki.archlinux.org/index.php/Boot}{boot} Arch Linux accordingly via \href{https://wiki.archlinux.org/index.php/Systemd-boot}{systemd-boot}. To verify this, list the efivars directory:
\begin{minted}[fontsize=\small,bgcolor=ArchCode,frame=single]{bash}
ls /sys/firmware/efi/efivars
\end{minted}
\subsection{Connect to the internet}
To set up a network connection, go through the following steps:
\newline
Ensure your \href{https://wiki.archlinux.org/index.php/Network_interface}{network} interface is listed and enabled, for example with \href{https://jlk.fjfi.cvut.cz/arch/manpages/man/ip-link.8}{ip-link(8)}:
\begin{minted}[fontsize=\small,bgcolor=ArchCode,frame=single]{bash}
ip link
\end{minted}
\href{https://wiki.archlinux.org/index.php/Wireless_network_configurationc}{Connect to the wireless LAN}.
Try with wifi-menu of \href{https://wiki.archlinux.org/index.php/Netctl}{netctl} package:
\begin{minted}[fontsize=\small,bgcolor=ArchCode,frame=single]{bash}
wifi-menu
\end{minted}
\begin{tcolorbox}[colback=ArchGreen,sharp corners,boxrule=0.2mm]
If somethig goes wrong you can modify the network profile with \\ \texttt{vim /etc/netctl/<profile\_name>}
\end{tcolorbox}
The connection may be verified with \href{https://en.wikipedia.org/wiki/ping}{ping}:
\begin{minted}[fontsize=\small,bgcolor=ArchCode,frame=single]{bash}
ping archlinux.org
\end{minted}
\subsection{Update the system clock}
Use \href{https://jlk.fjfi.cvut.cz/arch/manpages/man/timedatectl.1}{timedatectl(1)} to ensure the system clock is accurate:
\begin{minted}[fontsize=\small,bgcolor=ArchCode,frame=single]{bash}
timedatectl set-ntp true
\end{minted}
\subsection{Partition the disks}
When recognized by the live system, disks are assigned to a \href{https://wiki.archlinux.org/index.php/Device_file#Block_devices}{block device} such as \texttt{/dev/sda }or \texttt{/dev/nvme0n1}. To identify these devices, use \href{https://wiki.archlinux.org/index.php/Lsblk}{lsblk} or \href{https://wiki.archlinux.org/index.php/Fdisk}{fdisk}.
\begin{minted}[fontsize=\small,bgcolor=ArchCode,frame=single]{bash}
lsblk
\end{minted}
Results ending in \texttt{rom}, \texttt{loop} or \texttt{airoot} may be ignored.
The following \href{https://wiki.archlinux.org/index.php/Partition}{partitions} are \textbf{required} for a chosen device:
\begin{itemize}
\item One partition for the root directory /.
\item If \href{https://wiki.archlinux.org/index.php/UEFI}{UEFI} is enabled, an \href{https://wiki.archlinux.org/index.php/EFI_system_partition}{EFI system partition}.
\end{itemize}
Using \href{https://wiki.archlinux.org/index.php/LVM}{LVM} and with
a graphical interface to partiton disk use \href{https://jlk.fjfi.cvut.cz/arch/manpages/man/cfdisk.8}{cfdisk}.
\begin{minted}[fontsize=\small,bgcolor=ArchCode,frame=single]{bash}
cfdisk /dev/<device>
\end{minted}
Inside cfdisk:
\begin{enumerate}
\item Make a GPT partition table if not already exisiting
\item New 512M partition for EFI, change partition type with \texttt{EFI System}
\item Remaining of disk size (no option) with default type \texttt{Linux filesystem}
\item write and quit
\end{enumerate}
\subsubsection{LVM partitions}
Visit \href{https://wiki.archlinux.org/index.php/LVM_(Italiano)}{LVM ita}. \textbf{In this section the storage device will be sda}!
\begin{enumerate}
\item Create physical volume and check with \texttt{pvdisplay}
\begin{minted}[fontsize=\small,bgcolor=ArchCode,frame=single]{bash}
pvcreate /dev/sda2
\end{minted}
\item Create Volume Group and check with \texttt{vgdisplay}
\begin{minted}[fontsize=\small,bgcolor=ArchCode,frame=single]{bash}
vgcreate VolGrp0 /dev/sda2
\end{minted}
\item Create Logical Volumes and check with \texttt{lvldisplay}
\begin{minted}[fontsize=\small,bgcolor=ArchCode,frame=single]{bash}
lvcreate -L 20G VolGrp0 -n root
lvcreate -C y -L 8G VolGrp0 -n swap
lvcreate -l 100%FREE VolGrp0 -n home
\end{minted}
\end{enumerate}
\subsection{Format the partitions}
Once the partitions have been created, each must be formatted with an appropriate \href{https://wiki.archlinux.org/index.php/File_system}{file system}.
\begin{minted}[fontsize=\small,bgcolor=ArchCode,frame=single]{bash}
mkfs.fat -F 32 /dev/<boot_partition>
mkfs.f2fs -l root /dev/VolGrp00/root
mkfs.f2fs -l home /dev/VolGrp0/home
\end{minted}
Initialize the swap
\begin{minted}[fontsize=\small,bgcolor=ArchCode,frame=single]{bash}
mkswap /dev/VolGrp0/swap
swapon /dev/VolGrp0/swap
\end{minted}
\begin{tcolorbox}[boxrule=0.2mm]
The partitioning scheme and mount point of the EFI Sytem Partition (ESB) are tided to the type of booloader used. In this guide \href{https://wiki.archlinux.org/index.php/Systemd-boot}{systemd-boot} will be used (look at installation section).
The mount point of the ESB partition in Systemd-boot needs to contain kernel and initramfs files. So boot is effectively the ESP.
\end{tcolorbox}
\subsection{Mount the file systems}
Non existen directories must be created first
\begin{minted}[fontsize=\small,bgcolor=ArchCode,frame=single]{bash}
mount /dev/VolGrp0/root /mnt
mkdir /mnt/home
mkdir /mnt/boot
mount /dev/VolGrp0/home /mnt/home
mount /dev/<boot_partition> /mnt/boot
\end{minted}
\section{Installation}
\subsection{Select mirrors}
Packages to be installed must be downloaded from \href{https://wiki.archlinux.org/index.php/Mirrors}{mirror servers}, which are defined in \\ \texttt{/etc/pacman.d/mirrorlist}. The higher a mirror is placed in the list, the more priority it is given when downloading a package. This file will later be copied to the new system by pacstrap, so it is worth getting right.\\
Make a backup of the mirror list:
\begin{minted}[fontsize=\small,bgcolor=ArchCode,frame=single]{bash}
cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup
\end{minted}
Install \href{https://git.archlinux.org/pacman-contrib.git/about/}{pacman-contrib} package containing the \texttt{rankmirrors} script.
\begin{minted}[fontsize=\small,bgcolor=ArchCode,frame=single]{bash}
pacman -Sy
pacman -S pacman-contrib
\end{minted}
\begin{tcolorbox}[colback=ArchGreen,sharp corners,boxrule=0.2mm]
If pacman is not working then probably all servers in the mirror list are commented. Uncomment one by modyfing \texttt{mirrorlist} and after the install recomment it.
\end{tcolorbox}
\noindent To be shure that all servers are availble for ranking run tht command to uncomment all the lines in \texttt{mirrorlist}:
\mint[fontsize=\small,bgcolor=ArchCode,frame=single]{html}|sed -i 's/^#Server/Server/' /etc/pacman.d/mirrorlist.backup|
Now we will run \texttt{mirrors}, it can take a wile and no output is made in the process so just wait and monitor on another tty with \texttt{top}. The script will rank the first 6 best mirrors delting the other ones.
\begin{minted}[fontsize=\small,bgcolor=ArchCode,frame=single]{bash}
rankmirrors -n 6 /etc/pacman.d/mirrorlist.backup > /etc/pacman.d/mirrorlist
\end{minted}
Copy the remaining mirrors in the file.
\subsection{Install essential packages}
Use the \href{https://projects.archlinux.org/arch-install-scripts.git/tree/pacstrap.in}{pacstrap} script to install the \href{https://www.archlinux.org/packages/?name=base}{base} package, Linux \href{https://wiki.archlinux.org/index.php/Kernel}{kernel} and firmware for common hardware.
The \href{https://www.archlinux.org/packages/?name=base}{base} package does not include all tools from the live installation, so installing other packages may be necessary for a fully functional base system. In particular, consider installing:
\begin{itemize}
\item userspace utilities for the management of \href{https://wiki.archlinux.org/index.php/File_systems}{file systems} that will be used on the system,
\item utilities for accessing \href{https://wiki.archlinux.org/index.php/RAID}{RAID} or \href{https://wiki.archlinux.org/index.php/LVM}{LVM} partitions,
\item specific firmware for other devices not included in \href{https://www.archlinux.org/packages/?name=linux-firmware}{linux-firmware},
\item software necessary for \href{https://wiki.archlinux.org/index.php/Networking}{networking},
\item a \href{https://wiki.archlinux.org/index.php/Text_editor}{text editor},
\item packages for accessing documentation in \href{https://wiki.archlinux.org/index.php/Man}{man} and \href{https://wiki.archlinux.org/index.php/Info}{info} pages: \href{https://www.archlinux.org/packages/?name=man-db}{man-db}, \href{https://www.archlinux.org/packages/?name=man-pages}{man-pages} and \href{https://www.archlinux.org/packages/?name=texinfo}{texinfo}.
\end{itemize}
\noindent To \href{https://wiki.archlinux.org/index.php/Install}{install} other packages or package groups, append the names to the pacstrap command above (space separated) or use \href{https://wiki.archlinux.org/index.php/Pacman}{pacman} while \href{https://wiki.archlinux.org/index.php/Installation_guide#Chroot}{chrooted into the new system}. For comparison, packages available in the live system can be found in \href{https://projects.archlinux.org/archiso.git/tree/configs/releng/packages.x86_64}{packages.x86\_64}.
\begin{minted}[fontsize=\small,bgcolor=ArchCode,frame=single]{bash}
pacstrap /mnt base base-devel linux linux-firmware vim man-db man-pages lvm2
\end{minted}
\section{Configure the system}
\subsection{Generate Fstab}
\begin{minted}[fontsize=\small,bgcolor=ArchCode,frame=single]{bash}
genfstab -U -p /mnt >> /mnt/etc/fstab
\end{minted}
Check if there is a entry for every partition and the one for swap too with \texttt{vim}.
\subsection{Chroot}
Now we are going to \href{https://wiki.archlinux.org/index.php/Change_root}{chroot} into our newly installed system and begin to configure its booting, time, and language:
\begin{minted}[fontsize=\small,bgcolor=ArchCode,frame=single]{bash}
arch-chroot /mnt
\end{minted}
\subsection{Time zone}
Set the \href{https://wiki.archlinux.org/index.php/Time_zone}{time zone}:
\begin{minted}[fontsize=\small,bgcolor=ArchCode,frame=single]{bash}
ln -sf /usr/share/zoneinfo/Europe/Rome /etc/localtime
\end{minted}
Run \href{https://jlk.fjfi.cvut.cz/arch/manpages/man/hwclock.8}{hwclock(8)} to generate \texttt{/etc/adjtime}:
\begin{minted}[fontsize=\small,bgcolor=ArchCode,frame=single]{bash}
hwclock --systohc --utc
\end{minted}
\subsection{Localization}
Uncomment \texttt{en\_US.UTF-8 UTF-8} and other needed \href{https://wiki.archlinux.org/index.php/Locale}{locale} in \texttt{/etc/locale.gen}, and generate them with:
\begin{minted}[fontsize=\small,bgcolor=ArchCode,frame=single]{bash}
locale-gen
\end{minted}
Create the \href{https://jlk.fjfi.cvut.cz/arch/manpages/man/locale.conf.5}{locale.conf(5)} file, set the \texttt{LANG} \href{https://wiki.archlinux.org/index.php/Variable}{variable} as your language:
\begin{minted}[fontsize=\small,bgcolor=ArchCode,frame=single]{bash}
echo LANG=en_US.UTF-8 > /etc/locale.conf
export LANG=en_US.UTF-8
\end{minted}
\subsection{Network configuration}
\subsubsection{Hostname}
Create the \href{https://wiki.archlinux.org/index.php/Hostname}{hostname} file:
\begin{minted}[fontsize=\small,bgcolor=ArchCode,frame=single]{bash}
echo DellXPS > /etc/hostname
\end{minted}
Add matching entries to \href{https://jlk.fjfi.cvut.cz/arch/manpages/man/hosts.5}{hosts(5)}:
\begin{minted}[fontsize=\small,bgcolor=ArchCode,frame=single]{bash}
vim /etc/hosts
----------------------------------------------------------------------------------
127.0.0.1 localhost
::1 localhost
127.0.1.1 DellXPS.localdomain DellXPS
\end{minted}
\subsubsection{Network Manager}
Install \href{https://wiki.archlinux.org/index.php/NetworkManager}{NetworkManager} as our network manager. NetworkMangaer has and internal dhcp service, so if DHCPCD is installed remove berforehand. \\
Install \href{https://wiki.archlinux.org/index.php/NetworkManager}{networkmanager} and enable it as service:
\begin{minted}[fontsize=\small,bgcolor=ArchCode,frame=single]{bash}
pacman -S NetworkManager
systemctl enable NetworkManager.service
\end{minted}
\subsection{Enable trim support}
For safe, weekly \href{https://wiki.archlinux.org/index.php/Solid_state_drive#TRIM}{TRIM} service on \href{https://wiki.archlinux.org/index.php/Solid_state_drive}{SSDs} and all other devices that enable \href{https://wiki.archlinux.org/index.php/Solid_state_drive#TRIM}{TRIM} support:
\begin{minted}[fontsize=\small,bgcolor=ArchCode,frame=single]{bash}
systemctl enable fstrim.timer
\end{minted}
\subsection{Enabling multilib and Arch AUR}
If you are running a 64bit system then you need to enable the \href{https://wiki.archlinux.org/index.php/Official_repositories#multilib}{multilib repository}.\\
Uncomment in \texttt{/etc/pacman.conf}:
\begin{minted}[fontsize=\small,bgcolor=ArchCode,frame=single]{bash}
[multilib]
Include = /etc/pacman.d/mirrorlist
\end{minted}
Update the sistem with pacman.
\subsection{Boot loader}
Install \href{https://wiki.archlinux.org/index.php/Systemd-boot}{systemd-boot} \href{https://wiki.archlinux.org/index.php/Boot_loader}{bootloader}
Recheck if the EFI variables are mounted
\begin{minted}[fontsize=\small,bgcolor=ArchCode,frame=single]{bash}
mount -t efivarfs efivarfs /sys/firmware/efi/efivars
\end{minted}
With the ESP mounted to \texttt{/boot}, use \href{https://jlk.fjfi.cvut.cz/arch/manpages/man/bootctl.1}{bootctl(1)} to install systemd-boot into the EFI system partition by running:
\begin{minted}[fontsize=\small,bgcolor=ArchCode,frame=single]{bash}
bootctl --path=/boot install
\end{minted}
This will copy the systemd-boot boot loader to the EFI partition, it will then set systemd-boot as the default EFI application (default boot entry) loaded by the EFI Boot Manager.\\
Create configuration file to add an entry for Arch Linux:
\begin{minted}[fontsize=\small,bgcolor=ArchCode,frame=single]{bash}
vim /boot/loader/entries/arch.conf
----------------------------------------------------------------------------------
title Arch Linux
linux /vmlinuz-linux
initrd /initramfs-linux.img
options root=/dev/mapper/VolGrp0-root rw
\end{minted}
The \href{https://wiki.archlinux.org/index.php/Systemd-boot#Adding_loaders}{\texttt{option}} tag is the command line options to pass to the EFI program or \href{https://wiki.archlinux.org/index.php/Kernel_parameters}{kernel parameters}. The parameter \href{https://wiki.archlinux.org/index.php/Kernel_parameters#Parameter_list}{\texttt{root}} tells ther kernel where the root file system partition is to be found. \texttt{root} accepts \href{https://wiki.archlinux.org/index.php/Persistent_block_device_naming}{persistent block device naming} but in our case since we are using LVM, all device blocks are persitent.
\begin{tcolorbox}[boxrule=0.2mm]
If \texttt{root} is not set properly the kernel will load but not finding the root partition it will create a temporary one and put you in an emergency shell.
\end{tcolorbox}
If at reboot the bootloader is not shown you can either press \texttt{space} at boot or change the \texttt{boot/loader/loader.conf} file adding \texttt{timeout 3}.
\subsubsection{Add pacamn Hook to update the boot manager}
Whenever there is a new version of systemd-boot, the boot manager can be optionally reinstalled by the user. The update can be automatically triggered using pacman hooks.\newline
\begin{minted}[fontsize=\small,bgcolor=ArchCode,frame=single]{bash}
sudo vim /etc/pacman.d/hooks/systemd-boot.hook
----------------------------------------------------------------------------------
[Trigger]
Type = Package
Operation = Upgrade
Target = systemd
[Action]
Description = Updating systemd-boot
When = PostTransaction
Exec = /usr/bin/bootctl update
\end{minted}
\subsection{Add Intel microcode}
Install \href{https://wiki.archlinux.org/index.php/Microcode}{microcode}:
\begin{minted}[fontsize=\small,bgcolor=ArchCode,frame=single]{bash}
pacman -S intel-ucode
\end{minted}
Update the arch systemd-boot loader file to load microcode:
\begin{minted}[fontsize=\small,bgcolor=ArchCode,frame=single]{bash}
vim /boot/loader/entries/arch.conf
----------------------------------------------------------------------------------
...
initrd /intel-ucode.img
initrd /initramfs-linux.img
...
\end{minted}
\subsection{Root password}
Set the root \href{https://wiki.archlinux.org/index.php/Password}{password}:
\begin{minted}[fontsize=\small,bgcolor=ArchCode,frame=single]{bash}
passwd
\end{minted}
\subsection{User setup}
Add a default \href{https://wiki.archlinux.org/index.php/Users_and_groups}{user} with:
\begin{minted}[fontsize=\small,bgcolor=ArchCode,frame=single]{bash}
useradd -m -g users -G wheel,storage,power -s /bin/bash simone
\end{minted}
set a \href{https://wiki.archlinux.org/index.php/Password}{password} for that user:
\begin{minted}[fontsize=\small,bgcolor=ArchCode,frame=single]{bash}
passwd simone
\end{minted}
\subsection{Setting up sudoers}
Edit the sudoers file to give this user \href{https://wiki.archlinux.org/index.php/Sudo#Configuration}{sudo} privileges.
The configuration file for sudo is in \texttt{/etc/sudoers}. It should always be edited with the \href{https://jlk.fjfi.cvut.cz/arch/manpages/man/visudo.8}{visudo(8)} command. \texttt{visudo} locks the \texttt{sudoers} file, saves edits to a temporary file, and checks that file's grammar before copying it to \texttt{/etc/sudoers}.\\
Uncomment:
\begin{minted}[fontsize=\small,bgcolor=ArchCode,frame=single]{bash}
visudo
----------------------------------------------------------------------------------
#%wheel ALL=(ALL) ALL
\end{minted}
\noindent Make sudoers require typing the root password instead of their own password by adding:
\begin{minted}[fontsize=\small,bgcolor=ArchCode,frame=single]{bash}
visudo
----------------------------------------------------------------------------------
Defaults rootpw
\end{minted}
\subsection{LVM checks}
Create \texttt{lvm2}, \texttt{udev} hooks and enable \texttt{dm\_mod} module in \href{https://wiki.archlinux.org/index.php/Mkinitcpio}{mkinitcpio}:
\begin{minted}[fontsize=\small,bgcolor=ArchCode,frame=single]{bash}
vim /etc/mkinitcpio.conf
----------------------------------------------------------------------------------
HOOKS="base udev ... lvm2 filesystems"
...
MODULES="dm_mod..."
\end{minted}
This is needed otherwise the kernel is unable to find the lvm partitions. Pay attention to the order in HOOKS, this is ther order in which the kernel loads the modules so any wrong changes could dtop the loading of the kernel.\\
If changes to the file are made, \texttt{initramfs} has to be \href{https://wiki.archlinux.org/index.php/Mkinitcpio#Installation}{rebuilt} with:
\begin{minted}[fontsize=\small,bgcolor=ArchCode,frame=single]{bash}
mkminitcpio -p linux
\end{minted}
\subsection{Instatiante Xdg-Users dir}
\href{https://wiki.archlinux.org/index.php/XDG_user_directories}{Xdg-users-dir} s a tool to help manage "well known" user directories like the desktop folder and the music folder. It also handles localization (i.e. translation) of the filenames.
\begin{minted}[fontsize=\small,bgcolor=ArchCode,frame=single]{bash}
pacman -Sy xdg-users-dir
#then run the package
xdg-user-dirs-update
\end{minted}
The user service \texttt{xdg-user-dirs-update.service} will also be installed and enabled by default.
\subsection{Install additional Packages}
\begin{minted}[fontsize=\small,bgcolor=ArchCode,frame=single]{bash}
pacman -S bash-completion vi neovim
\end{minted}
\section{Install the Window Manager}
\begin{minted}[fontsize=\small,bgcolor=ArchCode,frame=single]{bash}
sudo pacman sway
\end{minted}
If video drivers are requested use \texttt{Mesa} since nvidia is not supported.
To run sway just type it in terminal
\subsection{Apply scaling}
Get information about the current display and copy the display name.
\begin{minted}[fontsize=\small,bgcolor=ArchCode,frame=single]{bash}
swaymsg -t get_outputs
----------------------------------------------------------------------------------
Output eDP-1 'Sharp Corporation 0x148D 0x00000000' (focused)
Current mode: 3840x2160 @ 59.997002 Hz
Position: 0,0
Scale factor: 2.000000
Scale filter: nearest
Subpixel hinting: unknown
Transform: normal
Workspace: 1
Max render time: off
Available modes:
3840x2160 @ 59.997002 Hz
...
\end{minted}
Here the display name is \texttt{eDP-1}, so now this value will be used in the config file of sway. If there is no config file/\texttt{.config} folder run:
\begin{minted}[fontsize=\small,bgcolor=ArchCode,frame=single]{bash}
mkdir ~/.config
mkdir ~/.config/sway
cp /etc/sway/config ~/.config/sway/config
\end{minted}
Then add the following line to add scaling
\begin{minted}[fontsize=\small,bgcolor=ArchCode,frame=single]{bash}
.config/sway/config
----------------------------------------------------------------------------------
...
output eDP-1 scale 2
...
\end{minted}
\begin{tcolorbox}[colback=ArchGreen,sharp corners,boxrule=0.2mm]
From now on \texttt{.config} aka dotfiles will be available on github so just copy the entire folder and keep it under version controll
\end{tcolorbox}
\section{Install other usefull packages}
\subsection{Install yay}
\href{https://github.com/Jguer/yay}{yay} is an AUR helper.
Before beeing able to download yay we need to add another repository to pacman that allows us to download it:
\begin{minted}[fontsize=\small,bgcolor=ArchCode,frame=single]{bash}
sudo vim /etc/pacman.conf
----------------------------------------------------------------------------------
...
[archlinuxcn]
Server = http://repo.archlinuxcn.org/$arch
## or install archlinuxcn-mirrorlist-git and use the mirrorlist
#Include = /etc/pacman.d/archlinuxcn-mirrorlist
...
\end{minted}
Now we can update pacman repos and install a keyring that will let us use them. After that we can simply install \href{https://github.com/Jguer/yay}{yay} via pacman.
\begin{minted}[fontsize=\small,bgcolor=ArchCode,frame=single]{bash}
pacman -Syu
sudo pacman -S archlinuxcn-keyring
sudo pacman -S yay
\end{minted}
\subsection{Install a menu to launch applications from sway}
The normal choiche is to use \href{https://wiki.archlinux.org/index.php/Dmenu}{dmenu} but it uses X-Wayland and so I preferred to install \href{https://github.com/Cloudef/bemenu}{bemenu} that uses natively wayland.
\begin{minted}[fontsize=\small,bgcolor=ArchCode,frame=single]{bash}
yay bemenu bemeneu-wlroots
\end{minted}
After that we need to assign bemenu as the default menu to sway and pipe its output to sway so that it can execute the selected application.
\begin{minted}[fontsize=\small,bgcolor=ArchCode,frame=single]{bash}
vim .config/sway/config
----------------------------------------------------------------------------------
...
set $menu bemenu-run -b -l 10 --scrollbar=always -H 25 -m all | xargs
swaymsg exec --
...
\end{minted}
The default key-binding to execute this line is \texttt{[super]+D} you can change it by searching for \texttt{\$menu}.
The paramenters passed to \texttt{bemenu-run} all visible through \texttt{man bemenu}.
\subsection{Install X-Wayalnd for Xorg app support}
\href{https://wayland.freedesktop.org/xserver.html}{X-Wayland} lets run X.org apps in emulated mod thorugh wayland compositor.
\begin{minted}[fontsize=\small,bgcolor=ArchCode,frame=single]{bash}
yay xorg-server-xwayland
\end{minted}
\section{TODO}
%%install kanshi and wdisplays
%%to use kanshi go to https://github.com/emersion/kanshi
%%
%%//install zsh
%%yay zsh
%%//add pacman hook
%%vim /etc/pacman.d/hook/zsh.hook
%%------------------------------------
%%
%%[Trigger]
%%Operation = Install
%%Operation = Upgrade
%%Operation = Remove
%%Type = Path
%%Target = usr/bin/*
%%[Action]
%%Depends = zsh
%%When = PostTransaction
%%Exec = /usr/bin/install -Dm644 /dev/null /var/cache/zsh/pacman
%%
%%------------------------------------
%%//font config
%%yay fontconfig
%%
%%//font
%%install IBM Plex
%%//emoji and japanese and exrta font support
%%install noto-fonts-*
%%//install iosevka
%%yay ttf-iosevka ttf-iosevka-term-ss08 ttf-iosevka-ss08
%%
%%//run
%%fc-cache -v
%%
%%//install unrar
%%
%%bluetooth
%%https://wiki.archlinux.org/index.php/Bluetooth
\end{document}