Change var noted with {{ VAR }}
notation to your setup and taste.
# set italian keyboard layout
loadkeys it
Check if you have an ip address
ip a
If you're running an Archlinux live
iwctl
device list
station {{ DEVICE }} scan
station {{ DEVICE }} get-networks
station {{ DEVICE }} connect {{ SSID }}
quit
ip a
If you're running an Artix Linux live follow the 20.2 Runit-Connman chapter
On the remote (target) machine
passwd
Now check that PermitRootLogin yes
is present (and uncommented) in /etc/ssh/sshd_config
.
systemctl start sshd
# Example of devices: sda, vda, nvme0n1
fdisk -l
fdisk /dev/{{ DEVICE }}
- Create a partition of type GPT with
g
- Create a 300Mb partition EFI type with
n
, press Enter for 0 as first/starting sector then select+300M
as last/ending sector - Set the type for this partition as EFI with
t
then1
for selecting the EFI type - Create another partition for the file system with
n
, this time press Enter two times (we need every remaining space as storage) - The type of this partition should be already set as Linux or Linux filesystem*
- Create a partition of type DOS with
o
- Create a new partition for the file system with
n
, then press Enter two times (we need every remaining space as storage) - The type of this partition should be already set as Linux or Linux filesystem*
- Make the partition bootable by press
a
* If not the case, press t
to select the partition type menu, press L
to list all types then insert the number corrisponding to Linux filesystem
FROM NOW ON MAKE SURE TO SKIP UNREQUIRED STEPS FOR YOUR PARTITION SCHEME
# Examples of EFI partition: sda1, vda1, nvme0n1p1
mkfs.vfat -F 32 /dev/{{ EFI_PARTITION }}
# Examples of root partition: sda2 vda2 nvme0n1p2
cryptsetup -y -v luksFormat /dev/{{ ROOT_PARTITION }}
cryptsetup open /dev/{{ ROOT_PARTITION }} cryptroot
# WITH encryption
mkfs.ext4 /dev/mapper/cryptroot
# WITHOUT encryption
mkfs.ext4 /dev/{{ ROOT_PARTITION }}
# WITH encryption
mount /dev/mapper/cryptroot /mnt
# WITHOUT encryption
mount /dev/{{ ROOT_PARTITION }} /mnt
mkdir /mnt/boot
mount /dev/{{ EFI_PARTITION }} /mnt/boot
Change neovim with your editor of choice (vim, nano, vi, micro)
# Archlinux
pacman -Sy archlinux-keyring
pacstrap /mnt base base-devel linux linux-firmware wpa_supplicant git neovim
# Artix Linux
basestrap /mnt base base-devel linux linux-firmware runit elogind-runit connman connman-runit wpa_supplicant git neovim
# Archlinux
genfstab -U -p /mnt >> /mnt/etc/fstab
# Artix linux
fstabgen -U /mnt >> /mnt/etc/fstab
# Archlinux
arch-chroot /mnt
# Artix linux
artix-chroot /mnt
nvim /etc/mkinitcpio.conf
# WITH encryption
HOOKS=(base systemd autodetect microcode keyboard sd-vconsole modconf kms block sd-encrypt filesystems fsck)
# WITHOUT encryption
HOOKS=(base systemd autodetect microcode modconf kms keyboard sd-vconsole block filesystems fsck)
ln -sf /usr/share/zoneinfo/Europe/Rome /etc/localtime
#timedatectl set-ntp true # TODO: need to move to Ansible
hwclock --systohc
nvim /etc/locale.gen
locale-gen
echo "LANG=en_US.UTF-8" > /etc/locale.conf
echo "KEYMAP=it" > /etc/vconsole.conf
Choose hostname
nvim /etc/hostname
Edit the /etc/hosts file
127.0.0.1 localhost
::1 localhost
127.0.1.1 {{ HOSTNAME }}.local {{ HOSTNAME }}
mkinitcpio -p linux
passwd
bootctl install
echo "editor no" >> /boot/loader/loader.conf
nvim /boot/loader/entries/arch.conf
This is the content of arch.conf file
# /boot/loader/entries/arch.conf
title Archlinux
linux /vmlinuz-linux
initrd /initramfs-linux.img
# WITH encryption
options rw rd.luks.name={{ device-UUID }}=cryptroot root=/dev/mapper/cryptroot
# WITHOUT encryption
options rw root=UUID={{ device-UUID }}
Override {{ device-UUID }} with output command of :r !blkid
corrisponding to your dev/{{ ROOT_PARTITION }}
UUID (sda2 or nvme0n1p2 for ex... even when encrypted!)
bootctl update
bootctl list
syslinux-install_update -i -m -a
Edit the /boot/syslinux/syslinux.cfg
file checking the root partition matches with your /dev/{{ ROOT_PARTITION }}
pacman -S refind
refind-install
# Check the configuration file and eventually setup the root partition
nvim /boot/refind_linux.conf
If dual boot is needed try to use separate drives for the installations.
It's advisable to set the Windows installation first than the Linux one, as Windows tends to overwrite boot priority or mess your disk.
First follow 10.1.1 then mount Windows EFI partition and copy the Microsoft folder inside your EFI folder at /boot
, here is an example
# use the MOUNTPOINT you prefer
mount /dev/sdb1 /{{ MOUNTPOINT }}
cp -ax /{{ MOUNTPOINT }}/EFI/Microsoft /boot/EFI/
If the other Linux installation is on the same hard drive just add a second entry like you did in 10.1.1 and you're done.
In case you have a dedicated linux install (bootloader + root) on another hard drive just follow the Arch wiki
TL;DR
pacman -S edk2-shell
cp /usr/share/edk2-shell/x64/Shell.efi /boot/shellx64.efi
Then create a new loader like this
# /boot/loader/entries/mySecondLinux.conf
title MySecondLinux
efi /shellx64.efi
options -nointerrupt -nomap -noversion {{ EFI_HD_MAP }}:{{ EFI_PATH }}
Where the EFI_HD_MAP
variable points to the result of the map
command from the UEFI Shell provided by the edk2-shell package installation (ex: HD0b, FS1 or BLK1) and the EFI_PATH
is the path for the second linux bootloader, you can find that using the efibootmgr
command.
useradd -m -g users -G wheel {{ USERNAME }}
passwd {{ USERNAME }}
EDITOR=nvim visudo
change the count number as you wish (default 4G)
dd if=/dev/zero of=/swapfile bs=1G count=4 status=progress
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
echo "/swapfile none swap defaults 0 0" >> /etc/fstab
Create these files
# /etc/systemd/network/en.network
[Match]
Name=en*
[Network]
DHCP=yes
[DHCP]
RouteMetric=10
# /etc/systemd/network/wl.network
[Match]
Name=wl*
[Network]
DHCP=yes
[DHCP]
RouteMetric=20
Setup Wi-Fi connection
Get a wifi interface name with
ip a
Create this file
# /etc/wpa_supplicant/wpa_supplicant-{{ WIFIINTERFACE }}.conf
ctrl_interface=/run/wpa_supplicant
ctrl_interface_group=wheel
update_config=1
ap_scan=1
# Begin network section
Then use this command to connect
wpa_passphrase {{ SSID }} >> /etc/wpa_supplicant-{{ WIFIINTERFACE }}.conf
When you need to connect to a WPA-ENTERPRISE or others add this block to the conf file
WIFI
# /etc/wpa_supplicant/wpa_supplicant-{{ WIFIINTERFACE }}.conf
network={
ssid="{{ SSID }}"
key_mgmt=WPA-EAP
eap=PEAP
identity="{{ USERNAME }}"
password="{{ PASSWORD }}"
phase2="autheap=GTC"
}
WIRED
# /etc/wpa_supplicant/wpa_supplicant-wired-{{ ETHINTERFACE }}.conf
network={
ssid="{{ SSID }}"
key_mgmt=WPA-EAP
eap=PEAP
identity="{{ USERNAME }}"
password="{{ PASSWORD }}"
phase2="autheap=GTC"
}
Enable services
systemctl enable systemd-networkd
systemctl enable systemd-resolved
systemctl enable wpa_supplicant@{{ WIFIINTERFACE }}
Connman out of the box already setup wired connection. The only thing remain is to enable the service after the reboot
# run this after the reboot!
ln -s /etc/runit/sv/connmand /run/runit/service/
# If your network card doesn't turn on after booting...
connmanctl enable wifi
Basics steps for connecting to a wifi with connman
# make sure your wifi card is on
connmanctl
scan wifi
services
agent on
connect {{ LONG_WIFI_ID }}
Visit the arch wiki for support on connecting to wifi Connman
exit
# Ignore the error if appears
umount -R /mnt
reboot
After reboot todo list:
- Enable and start network service (systemd-networkd or connman)
- Start some display server, install a DE or a WM... or you can continue below
Follow the instruction on the repo Ansible
I've created my fork of LARBS
git clone https://github.com/dixiedream/LARBS.git
cd LARBS
sh larbs.sh