From 17fb5251eb912cda2ade4e0d2fa3d93b7aa19bab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ke=C3=9Fler?= Date: Fri, 29 Jul 2022 14:00:06 +0200 Subject: [PATCH] improve install script --- installer/install-arch | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/installer/install-arch b/installer/install-arch index f76f06f..ca2b9bc 100755 --- a/installer/install-arch +++ b/installer/install-arch @@ -67,6 +67,11 @@ exec 2> >(tee "stderr.log") timedatectl set-ntp true +# Set up custom repo signing key +pacman-key --init +pacman-key --add /opt/mkessler/signing-key/signing_key +pacman-key --lsign-key B419CDA93D7544F8214B3216A23D90C2433DAFBC + ### update mirrors echo "Running reflector to update mirrors" reflector @@ -163,21 +168,29 @@ sed -i 's/^\#\s%wheel\sALL=(ALL:ALL)\sNOPASSWD:\sALL$/%wheel ALL=(ALL:ALL) NOPAS echo "${user}:${user_password}" | chpasswd --root /mnt echo "root:${user_password}" | chpasswd --root /mnt -echo "Installing grub bootloader" -# install grub (but not main configuration file) -arch-chroot /mnt grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB echo 'Configuring HOOKS in /etc/mkinitcpio.conf and regenerating initramfs' sed -i 's/^HOOKS=(base .* fsck)$/HOOKS=(base udev autodetect keyboard keymap consolefont modconf block encrypt lvm2 filesystems resume fsck)/' /mnt/etc/mkinitcpio.conf arch-chroot /mnt mkinitcpio -P +echo "Installing grub bootloader" +arch-chroot /mnt grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB + +# Getting UUIDs of relevant devices +grub_resume="resume=UUID=$(lsblk -dno UUID ${part_swap})" +grub_cryptdevice="cryptdevice=UUID=$(lsblk -dno UUID ${part_luks}):${cryptlvm}" +grub_root="root=UUID=$(lsblk -dno UUID ${part_root})" + +# Set boot parameters in grub configfor device mapping and resume hook +sed -i "s/^GRUB_CMDLINE_LINUX=\"\"$/GRUB_CMDLINE_LINUX=\"${grub_cryptdevice} ${grub_root} ${grub_resume}\"/" /mnt/etc/default/grub + +echo "Generating main GRUB configuration file" +arch-chroot /mnt grub-mkconfig -o /boot/grub/grub.cfg + cat <