Skip to content

Commit

Permalink
FIX: grub install for UEFI
Browse files Browse the repository at this point in the history
  • Loading branch information
alealexpro100 committed Jan 31, 2023
1 parent 9c52eff commit 300d619
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 3 additions & 1 deletion lib/common/rootfs_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@ function setup_sudo() {

function grub_config() {
if [[ $bootloader_type = uefi ]]; then
removable_add=""
[[ $removable_add != "1" ]] || removable_add="--removable"
[[ -f /usr/lib/grub/i386-efi/modinfo.sh ]] && grub-install --target=i386-efi --efi-directory=/boot --removable $grub_param
grub-install --target=x86_64-efi --efi-directory=/boot --removable $grub_param
grub-install --target=x86_64-efi --efi-directory=/boot $removable_add $grub_param
else
grub-install --target=i386-pc --force $grub_param $bootloader_bios_place
fi
Expand Down
2 changes: 1 addition & 1 deletion lib/distr/alpine/rootfs_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ msg_print note "Packages are installed."
case "$bootloader_name" in
grub2)
to_install="grub"
[[ $bootloader_type = uefi ]] && to_install="$to_install grub-efi"
[[ $bootloader_type = uefi ]] && to_install="$to_install grub-efi efibootmgr"
[[ $bootloader_type = bios ]] && to_install="$to_install grub-bios"
if [[ "$bootloader_bios_place" == *loop* ]]; then
msg_print warning "$distr can not install GRUB loader to virtual disk. Installation will fail."
Expand Down
5 changes: 2 additions & 3 deletions lib/distr/debian/rootfs_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,8 @@ msg_print note "Packages are installed."

case "$bootloader_name" in
grub2)
to_install="grub2"
[[ $bootloader_type = uefi ]] && to_install="$to_install grub-efi"
[[ $bootloader_type = bios ]] && to_install="$to_install grub-pc"
[[ $bootloader_type = uefi ]] && to_install="grub-efi"
[[ $bootloader_type = bios ]] && to_install="grub-pc"
$apt_install $to_install
if [[ $removable_disk == "0" ]]; then
apt -y remove os-prober;
Expand Down

0 comments on commit 300d619

Please sign in to comment.