Skip to content

Instantly share code, notes, and snippets.

@lymieux
Last active March 17, 2022 18:12
Show Gist options
  • Save lymieux/3b02fffc32b114bdacf92f279ccb3479 to your computer and use it in GitHub Desktop.
Save lymieux/3b02fffc32b114bdacf92f279ccb3479 to your computer and use it in GitHub Desktop.
Quick Arch Linux Install Quide for Filesystem with Swap, proper sudoers.d use, conf on KEYMAPS and LOCALE and basic Grub config

The default console keymap is US. Available layouts can be listed with:

ls /usr/share/kbd/keymaps/**/*.map.gz

To modify the layout, append a corresponding file name to loadkeys(1)

# FOO is layout from /usr/share/kbd/keymaps/**/*.map.gz
loadkeys FOO

Available console fonts

ls /usr/share/kbd/consolefonts/

Load with setfont

# FOO is font from /usr/share/kbd/consolefonts/
setfont FOO

Verify the boot mode

ls /sys/firmware/efi/efivars

Ensure your network interface is listed

ip link

Remove softblock on WIFI adapter (rfkill list to check)

rfkill unblock wifi

Connect to internet Ethernet—plug in the cable. Wi-Fi—authenticate to the wireless network using iwctl

iwctl steps for WIFI:

iwctl
[iwd] device list
# This will list devices, replace wnated on with FOO for steps below
[iwd] station FOO scan
[iwd] station FOO get-networks
[iwd] station FOO connect SSID

or:

If SSID and passphrase is known

# PASS = passphrase ; FOO = device ; SSID = ssid
iwctl --passphrase PASS station FOO connect SSID

Verify connection

ping google.com

Ensure the system clock is accurate

timedatectl set-ntp true

Check the service status

timedatectl status

For these 2 sections, Formatting and Filesystem, you can go your own way Ill be formatting with a swap partition and regular mounting

List block devices with

fdisk -l

fdisk to modify partition tables

# FOO = device wanted for format from `fdisk -l`
# Do not include partition e.g. /dev/sda1 ONLY /dev/sda
fdisk /dev/FOO
```g

List to create 3 partitions, efi; swap; linux
```bash
o
p
n
p
1
[enter]
+512M
t
c
n
p
2
[enter]
+1024M
t
2
82
n
p
3
[enter]
[enter]
w

Create an Ext4 file system on /dev/root_partition (linux filesystem)

mkfs.ext4 /dev/root_partition

For partition for swap, initialize it with mkswap ([swap] filesystem)

mkswap /dev/swap_partition

For EFI system partition, format it to FAT32 using mkfs.fat (FAT32 filesystem)

mkfs.fat -F 32 /dev/efi_system_partition

Mount the root volume to /mnt (linux filesystem)

mount /dev/root_partition /mnt

Create any remaining mount points (such as /mnt/efi) using mkdir

Mount the EFI system partition (FAT32 filesystem)

mount /dev/efi_system_partition /mnt/boot

Created a swap volume, enable it with swapon ([swap] filesystem)

swapon /dev/swap_partition

Use the pacstrap script to install essentials

pacstrap /mnt base linux linux-headers linux-firmware nano man-db man-pages iproute2 iwd git base-devel intel-ucode grub efibootmgr os-prober mtools dhcpcd iw

Make sure to also install a root user command, such as doas or sudo

Generate an fstab file

genfstab -U /mnt >> /mnt/etc/fstab

Check the resulting /mnt/etc/fstab file

Change root into the new system

arch-chroot /mnt

Set the time zone

ln -sf /usr/share/zoneinfo/FOO/FOO /etc/localtime

Run to generate /etc/adjtime

hwclock --systohc

Edit /etc/locale.gen and uncomment en_US.UTF-8 UTF-8 and other needed locales

Load

locale-gen

Create the locale.conf(5) file, and set the LANG variable Edit /etc/locale.conf

LANG=en_US.UTF-8

If you set the console keyboard layout (refer back to top set) Edit /etc/vconsole.conf

KEYMAP=FOO

Create the hostname filesudo Edit /etc/hostname

FOO

Rerun network configuration step again

iwctl --passphrase PASS station FOO connect SSID

Make and mount /boot/efi

mkdir /boot/efi
mount /dev/sda1 /boot/efi

Install grub for x86

grub-install --target=x86_64-efi --bootloader-id=grub_uefi

Configure grub

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

Reset password for root

passwd

Add new wheel user

useradd -G wheel,video,audio -m FOO

Sudo: Edit /etc/sudoers.d/exceptions to add user FOO as sudoer

FOO ALL=(ALL) ALL

:odus

Doas: Edit /etc/doas.conf and add: (replacing GROUP with the group you want to permit the use of doas)

permit :GROUP

(make sure you have a newline at the end of the file) Change viewing and editing permissions

chown -c root:root /etc/doas.conf
chmod -c 0400 /etc/doas.conf

:saod

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment