#!/usr/bin/env bash # Runs INSIDE arch-chroot. systemd-boot + mkinitcpio with STATIC loader entries. # mkinitcpio already built /boot/initramfs-linux*.img during pacstrap, and its # pacman hooks rebuild them on every kernel update — nothing to regenerate here # or later. The kernel cmdline lives in the loader entry's `options` line. set -euo pipefail bootctl install # ESP is mounted at /boot ROOT_UUID="$(findmnt -no UUID /)" # microcode image matching this CPU (both packages are installed) case "$(grep -m1 -oE 'Intel|AMD' /proc/cpuinfo)" in Intel) UCODE="initrd /intel-ucode.img" ;; AMD) UCODE="initrd /amd-ucode.img" ;; *) UCODE="" ;; esac mkdir -p /boot/loader/entries cat > /boot/loader/loader.conf < /boot/loader/entries/arch.conf < /boot/loader/entries/arch-fallback.conf <