feat: bootctl instead of grub to handle crypt
This commit is contained in:
parent
9f8df2d558
commit
6ea927e3b9
36
base.sh
36
base.sh
@ -20,7 +20,16 @@ echo "LANG=$lang.UTF-8" > /etc/locale.conf
|
|||||||
echo "$hostname" > /etc/hostname
|
echo "$hostname" > /etc/hostname
|
||||||
|
|
||||||
# Packages
|
# Packages
|
||||||
$PACMAN "${pkg[@]}"
|
case "$(lscpu | grep Vendor)" in
|
||||||
|
*AuthenticAMD*)
|
||||||
|
cpu=amd
|
||||||
|
;;
|
||||||
|
*GenuineIntel*)
|
||||||
|
cpu=intel
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
$PACMAN "${pkg[@]}" "$cpu-ucode"
|
||||||
systemctl enable \
|
systemctl enable \
|
||||||
NetworkManager \
|
NetworkManager \
|
||||||
docker.socket \
|
docker.socket \
|
||||||
@ -42,26 +51,23 @@ sed -i '/^# %wheel\s\+ALL=(ALL:ALL)\s\+ALL/s/^#\s*//' /etc/sudoers
|
|||||||
# drivers
|
# drivers
|
||||||
sed -i '/^HOOKS=(/s/filesystems/encrypt filesystems/' /etc/mkinitcpio.conf
|
sed -i '/^HOOKS=(/s/filesystems/encrypt filesystems/' /etc/mkinitcpio.conf
|
||||||
|
|
||||||
case "$(lscpu | grep Vendor)" in
|
|
||||||
*AuthenticAMD*)
|
|
||||||
$PACMAN amd-ucode
|
|
||||||
;;
|
|
||||||
*GenuineIntel*)
|
|
||||||
$PACMAN intel-ucode
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
./gpu.sh
|
./gpu.sh
|
||||||
|
|
||||||
# Bootloader
|
# Bootloader
|
||||||
sed -i '/GRUB_DISABLE_OS_PROBER=/s/.*/GRUB_DISABLE_OS_PROBER=false/' /etc/default/grub
|
bootctl install
|
||||||
|
|
||||||
if [ -n "$grub_timeout" ]; then
|
root="$(findmnt -nr -o source /)"
|
||||||
sed -i "/GRUB_TIMEOUT=/s/.*/GRUB_TIMEOUT=$grub_timeout/" /etc/default/grub
|
cryptdev="$(cryptsetup status "$root" | grep device | awk '{print $2}' || true)"
|
||||||
|
if "$cryptdev"; then
|
||||||
|
uuid="$(blkid | grep /dev/nvme0n1p2 | awk '{print $2}')"
|
||||||
|
options="cryptdevice=$uuid:$(basename "$root") "
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mkdir -p /boot/efi/
|
options="${options}root=$root"
|
||||||
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=GRUB
|
|
||||||
grub-mkconfig -o /boot/grub/grub.cfg
|
find /boot/loader/entries/ | while read -r e; do
|
||||||
|
echo "options $options rw" >> "$e"
|
||||||
|
done
|
||||||
|
|
||||||
echo -e "${BOLD}${GREEN}DONE. You can install a desktop environment \
|
echo -e "${BOLD}${GREEN}DONE. You can install a desktop environment \
|
||||||
(see README.md). Then, you can Ctrl+D, umount -R /mnt and reboot${NORMAL}"
|
(see README.md). Then, you can Ctrl+D, umount -R /mnt and reboot${NORMAL}"
|
||||||
|
4
rootfs/boot/loader/entries/arch-fallback.conf
Executable file
4
rootfs/boot/loader/entries/arch-fallback.conf
Executable file
@ -0,0 +1,4 @@
|
|||||||
|
title Arch Linux (fallback)
|
||||||
|
linux /vmlinuz-linux
|
||||||
|
initrd /initramfs-linux-fallback.img
|
||||||
|
initrd /$cpu-ucode.img
|
4
rootfs/boot/loader/entries/arch.conf
Executable file
4
rootfs/boot/loader/entries/arch.conf
Executable file
@ -0,0 +1,4 @@
|
|||||||
|
title Arch Linux
|
||||||
|
linux /vmlinuz-linux
|
||||||
|
initrd /initramfs-linux.img
|
||||||
|
initrd /$cpu-ucode.img
|
1
rootfs/boot/loader/loader.conf
Executable file
1
rootfs/boot/loader/loader.conf
Executable file
@ -0,0 +1 @@
|
|||||||
|
default arch
|
Loading…
Reference in New Issue
Block a user