diff options
author | xengineering <mail2xengineering@protonmail.com> | 2020-01-09 10:52:52 +0100 |
---|---|---|
committer | xengineering <mail2xengineering@protonmail.com> | 2020-01-09 10:52:52 +0100 |
commit | 3839b0df19ed779f19defa7bb113c4930e15b745 (patch) | |
tree | 4f5c75dcc52336237fc3f728c332c5f1d52b8904 /util/install_bootloader.sh | |
parent | cd5cf703c4ef5f99787f407b122738e087fbfc36 (diff) | |
parent | 457c01bfcd6346b8a06420d721fa02a216cea9bf (diff) | |
download | archinstall-3839b0df19ed779f19defa7bb113c4930e15b745.tar archinstall-3839b0df19ed779f19defa7bb113c4930e15b745.tar.zst archinstall-3839b0df19ed779f19defa7bb113c4930e15b745.zip |
Merge branch 'feature_luks' into devel
Diffstat (limited to 'util/install_bootloader.sh')
-rw-r--r-- | util/install_bootloader.sh | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/util/install_bootloader.sh b/util/install_bootloader.sh index 29e211f..db6c8bc 100644 --- a/util/install_bootloader.sh +++ b/util/install_bootloader.sh @@ -18,13 +18,35 @@ # along with this program. If not, see <https://www.gnu.org/licenses/>. -boot_partition_path=$1 +efi_partition_path=$1 +system_encryption=$2 +main_partition_path=$3 -mount $boot_partition_path /mnt +############ 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 "$(basename $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 $boot_partition_path +umount $efi_partition_path echo "Installed bootloader - OK" |