Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Swipe650/5d0301b319377dd1d79501c90becdd37 to your computer and use it in GitHub Desktop.
Save Swipe650/5d0301b319377dd1d79501c90becdd37 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Configure systemd-boot
arch-chroot /mnt bootctl --path=/boot install
arch-chroot /mnt bootctl update
# pacman hook
mkdir -p /mnt/etc/pacman.d/hooks
cat > /mnt/etc/pacman.d/hooks/100-systemd-boot.hook << EOF
[Trigger]
Type = Package
Operation = Upgrade
Target = systemd
[Action]
Description = Updating systemd-boot.
When = PostTransaction
Exec = /usr/bin/bootctl update
EOF
# Create systemd-boot config files
cat > /mnt/boot/loader/loader.conf << EOF
default arch
timeout 0
console-mode max
editor no
EOF
cat > /mnt/boot/loader/entries/arch.conf << EOF
title Arch Linux
linux /vmlinuz-linux
initrd /intel-ucode.img
initrd /initramfs-linux.img
options root=PARTUUID=$(blkid -s PARTUUID -o value "${root_partition}") rw quiet
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment