Advertisement
nobeltnium

mkcpio and bootloader install

Apr 18th, 2025 (edited)
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.05 KB | Food | 0 0
  1. #!/bin/bash
  2. #This script run in a chrooted shell
  3.  
  4. ln -sf /usr/share/zoneinfo/<redacted> /etc/localtime
  5. hwclock --systohc
  6. sed -i 's/#en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen
  7. locale-gen
  8. echo "LANG=en_US.UTF-8" > /etc/locale.conf
  9. read -p "what would ye hostname be? " hstname
  10. echo $hstname > /etc/hostname
  11.  
  12. # create/modify users
  13. echo "create root passwd"
  14. passwd root
  15.  
  16.  
  17. # initramfs
  18. sed -i 's/^HOOKS.*$/HOOKS=(base systemd autodetect microcode modconf kms keyboard block sd-encrypt lvm2 filesystems fsck btrfs)/' /etc/mkinitcpio.conf
  19. mkinitcpio -p linux
  20.  
  21. # boot loader (systemd)
  22. bootctl --path=/boot install
  23.  
  24. echo -e "default arch\ntimeout 3\nconsole-mode max\neditor no" > /boot/loader/loader.conf
  25. echo -e "title\tArch Linux\nlinux\t/vmlinuz-linux\ninitrd\t/initramfs-linux.img" > /boot/loader/entries/arch.conf
  26. diskid=$(blkid | grep crypto_LUKS | awk '{print $4}' |sed 's/PARTUUID=//')
  27. echo "options rd.luks.name=$diskid=cryptlvm root=/dev/arch/root rw rootflags=subvol=@" >> /boot/loader/entries/arch.conf
  28.  
  29. bootctl --path=/boot update
  30.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement