From 820bb3d1b91ebfaee9344965cf042aeeea3dd3e9 Mon Sep 17 00:00:00 2001 From: Holger Paradies Date: Sun, 12 Nov 2023 12:38:14 +0100 Subject: Add support for refind bootmanager --- backend/modules/bootloader | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/backend/modules/bootloader b/backend/modules/bootloader index 629f9b5..460ce17 100644 --- a/backend/modules/bootloader +++ b/backend/modules/bootloader @@ -54,6 +54,11 @@ function list_bootloaders() grub) echo "GRUB - GRand Unified Bootloader";; esac done + if [ -d /sys/firmware/efi ]; then + if [ -x /usr/sbin/refind-install ]; then + echo "rEFInd - Refind Bootmanager" + fi + fi } function send_bootloaders() @@ -75,6 +80,9 @@ function install_bootmanager_to_target() burg) install_burg ;; + refind) + install_refind + ;; esac } @@ -163,6 +171,27 @@ function install_burg() return 0 } +function install_refind() +{ + rm -f $TARGET/boot/vmlinuz $TARGET/boot/System.map $TARGET/boot/initrd.img + + apple=0 + dmidecode -s system-manufacturer | grep -q "Apple Inc." && apple=1 + + # install refind + if [ -d /sys/firmware/efi ]; then + if is_removeable "$cfg_bootloader_target" || [ "$apple" = 1 ]; then + refind-install --usedefault "$cfg_bootloader_target" --alldrivers &>/dev/null + else + refind-install --root $TARGET &>/dev/null + fi + fi + + write_kernel_img_conf + + return 0 +} + function write_kernel_img_conf() { rm -f $TARGET/etc/kernel-img.conf -- cgit v1.0