Correct installer

This commit is contained in:
ItaloBorrelli 2025-04-11 13:56:16 -07:00
parent 3e3aa969e3
commit 1c97d33d4e
2 changed files with 42 additions and 18 deletions

View File

@ -1,5 +1,5 @@
# Use `cat` to get file with lines numbered
cat -n install.txt
cat -n 10_install.txt
# Use `eval` from `sed` on lines X-Y
eval "$(sed -n X,Yp install.txt)"
@ -7,18 +7,36 @@ eval "$(sed -n X,Yp install.txt)"
# Ensure ethernet connection is up
ip link
# Partition 512M for efi (code ef00) and rest for luks
part /dev/nvme0n1
# Partition starting at 1MiB to 513MiB for boot per convention, then rest as ext2
parted /dev/nvme0n1
mklabel gpt
mkpart primary 1MiB 513MiB
set 1 boot on
mkpart primary ext2 513MiB 99%
align-check optimal 1
align-check optimal 2
# Change partition types with t
# Part 1 as ef00 for EFI system partition
# Part 2 as 8309 for Linux LUKS
gdisk /dev/nvme0n1p1
mkfs.vfat /dev/nvme0n1p1
# Create LUKS container
cryptsetup luksFormat /dev/nvme0n1p2
cryptsetup luksOpen /dev/nvme0n1p2 cryptoroot
# Partition 4G for swap (code 8200) and the rest for solaris (code bf00)
gpart /dev/mapper/cryptoroot
# Partition starting at 0% to 4GiB for swap and 4GiB to 100% for ZFS
parted /dev/mapper/cryptoroot
mklabel gpt
mkpart ext2 0% 4GiB
mkpart ext2 4GiB 100%
# Change partition types with t
# Part 1 as 8200 for swap
# Part 2 as bf00 for solaris
gdisk /dev/mapper/cryptoroot
# Make swap and swap on
mkswap /dev/mapper/cryptoroot1
@ -76,7 +94,7 @@ mount /dev/nvme0n1p1 /mnt/boot/efi
# Install with pacstrap
pacman -Syy
pacstrap /mnt base dkms git intel-ucode linux linux-firmware linux-headers tmux vim zsh
pacstrap /mnt base dkms git intel-ucode less linux linux-firmware linux-headers tmux vim zsh
# Create fs table and change root into mount
genfstab -U -p /mnt/etc/fstab
@ -87,18 +105,20 @@ vim /etc/fstab
# Add archzfs repository
vim /etc/pacman.conf
-----
----
[archzfs]
SigLevel = Optional TrustAll
Server = https://zxcvfdsa.com/archzfs/$repo/$arch
----
# Update repostories and install zfs-linux
pacman -Syy
pacman -S zfs-linux
#
# Set hooks for startup load order
vim /etc/mkinitcpio.conf
HOOKS=(base udev autodetect modconf block keyboard encrypt load_part resume zfs filesystems)
HOOKS=(base udev autodetect microcode modconf kms keymap consolefont block keyboard encrypt load_part resume zfs filesystems)
# Create loader to probe cryptoroot partition
cat > /etc/initcpio/install/load_part << EOFHOOK
#!/bin/bash
@ -124,24 +144,26 @@ EOFHOOK
mkinitcpio -p linux
# Install packages
pacman -S base-devel dhcpcd efibootmgr grub openssh reflector rsync systemd-networkd terminus-font
pacman -S base-devel bind dhcpcd efibootmgr grub openssh os-prober reflector rsync systemd-networkd terminus-font
# Use blkid /dev/nvme0n1p2 for the uuid of cryptoroot and blkid /dev/mapper/cryptoroot2 for the uuid of the swap space and update the grub file
vim /etc/default/grub
-----
----
GRUB_CMDLINE_LINUX="cryptdevice=/dev/disk/by-uuid/<uuid>:cryptoroot rw resume=UUID=<swap UUID> root=ZFS=zroot/ROOT/default"
GRUB_ENABLE_CRYPTODISK=y
----
# Create grub config
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=ArchLinux
grub-mkconfig -o /boot/grub/grub.cfg
# Enable important systems
systemctl enable systemd-networkd dhcpcd reflector.timer sshd
systemctl enable dhcpcd reflector.timer sshd systemd-networkd systemd-timesyncd
systemctl enable zfs-import-cache zfs-import-scan zfs-mount zfs-share zfs-zed zfs.target
# Setup
ln -sf /usr/share/zoneinfo/Canada/Vancouver /etc/localtime
timedatectl set-timezone America/Vancouver
ln -sf /usr/share/zoneinfo/Canada/Pacific /etc/localtime
hwclock --systohc
# Make passwords
@ -150,23 +172,25 @@ passwd iborrelli
# Make wheel sudoers
visudo
-----
----
%wheel ALL=(ALL) ALL
----
# Backup reflector config and create new one
cd /etc/xdg/reflector
mv reflector.conf.orig
vim reflector.conf
-----
----
--country CA
--protocol https
--latest 5
--sort rate
--save /etc/pacman.d/mirrorlist
----
# Exit chroot and clean up
exit
umount /mnt/boot/efi
umount /mnt/boot
zfs umount -a
zpool export zroot
reboot

View File

@ -25,5 +25,5 @@ curl -fsSL https://raw.githubusercontent.com/zimfw/install/master/install.zsh |
paru -S filezilla firefox flatpak haveged libreoffice-fresh mpv neofetch qbittorrent vlc yt-dlp
# Development
paru -S nodejs-n
paru -S nodejs-n zip