diff options
author | xengineering <mail2xengineering@protonmail.com> | 2020-01-08 22:06:38 +0100 |
---|---|---|
committer | xengineering <mail2xengineering@protonmail.com> | 2020-01-08 22:06:38 +0100 |
commit | e218e91ad0ec6b660ca9ae7f3c45d5cde5a36fdf (patch) | |
tree | a6f32a0158d7ce4267c62cbc8e548f9ec3d682b8 /util/install_bootloader.sh | |
parent | 9f5e38930ffdaf2b4a1b544d183b98bc482ba13d (diff) | |
download | archinstall-e218e91ad0ec6b660ca9ae7f3c45d5cde5a36fdf.tar archinstall-e218e91ad0ec6b660ca9ae7f3c45d5cde5a36fdf.tar.zst archinstall-e218e91ad0ec6b660ca9ae7f3c45d5cde5a36fdf.zip |
First version of luks encrypted archinstall.
Diffstat (limited to 'util/install_bootloader.sh')
-rw-r--r-- | util/install_bootloader.sh | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/util/install_bootloader.sh b/util/install_bootloader.sh index cf6c374..4d3e9b9 100644 --- a/util/install_bootloader.sh +++ b/util/install_bootloader.sh @@ -19,11 +19,32 @@ efi_partition_path=$1 +system_encryption=$2 + + +############ Add encryption setting in /etc/default/grub before calling grub-mkconfig +## to generate /boot/grub/grub.cfg + +## See: https://wiki.archlinux.org/index.php/Dm-crypt/System_configuration#Boot_loader mount $efi_partition_path /mnt grub-install --target=x86_64-efi --efi-directory=/mnt --bootloader-id=GRUB \ --removable + +if [ $system_encryption == "yes" ];then + + cryptdevice_uuid=$(lsblk --fs | grep $main_partition_path | awk '{print $3}') + echo "cryptdevice_uuid: $cryptdevice_uuid" + old_kernel_param_line=$(cat /etc/default/grub | grep "GRUB_CMDLINE_LINUX_DEFAULT") + echo "old_kernel_param_line: $old_kernel_param_line" + new_kernal_param_line="GRUB_CMDLINE_LINUX_DEFAULT=\"loglevel=3 quiet cryptdevice=UUID=${cryptdevice_uuid}:main root=/dev/mapper/main\"" + echo "new_kernel_param_line: $new_kernal_param_line" + echo "Adding kernel parameters to /etc/default/grub" + sed -i "s|$old_kernel_param_line|$new_kernal_param_line|" /etc/default/grub + +fi + grub-mkconfig -o /boot/grub/grub.cfg umount $efi_partition_path |