diff options
Diffstat (limited to 'backend/modules/bootloader')
-rw-r--r-- | backend/modules/bootloader | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/backend/modules/bootloader b/backend/modules/bootloader index 629f9b5..4fd4df9 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 @@ -170,13 +199,9 @@ cat << EOT > $TARGET/etc/kernel-img.conf # Kernel image management overrides # See kernel-img.conf(5) for details do_symlinks = yes -relative_links = yes do_bootloader = no -do_bootfloppy = no do_initrd = yes link_in_boot = no -postinst_hook = update-$cfg_bootloader -postrm_hook = update-$cfg_bootloader EOT } |