Jump to content

rEFInd for uefi/gpt boot

Recommended Posts

Recently my newer machines have UEFI bios and I have started using refind as the bootloader/manager instead of grub or lilo and the like .  I really like it!  Its simple and flexible and highly automated and aesthetically pleasing.  I have one machine with apparently broken bios that I can't get uefi boot to work so that one has grub2.  


My question is with respect to boot-update.  any thought about supporting uefi/refind with boot-update? In the part where boot.conf says "generate grub" it could say "generate refind" optionally and then the output would be the refind.conf in /boot.


Right now I don't really use boot-update, I just edit grub.cfg directly on my one machine with broken uefi since it seems like a layer of abstraction that doesn't buy me anything at all (I have no need for grub-legacy) and seems directly in competition with grub-mkconfig (itself a layer I am dubious about).  But, if a single tool like boot-update could generate boot loader configs for either my uefi (refind) or non-uefi (grub2) systems then its less syntax I have to learn to cover both bases - an abstraction that does give me something.  


Anyway even if refind isn't in the cards for boot-update I am curious if anyone else in funtoo land uses it for uefi boot.  I found no info about it anywhere except arch forums and the refind site itself, and its not in portage.



Link to post
Share on other sites
  • 5 weeks later...

Anyway, rEFInd is a nice alternative to grub/boot-update for bootmenu, and I am surprised more people don't use it.  I  think that boot-update and indeed grub2's own conf files in etc are confusing abstractions that are not easier to use than just hand configuring /boot/grub/grub.cfg.  rEFInd is even easier because it searches the boot partition and automatically generates a boot menu on the fly based on all the kernels and initramfs files it finds. So if you update your kernel you have no need to update any bootloader configs, it just adds the new kernel/initramfs to the list.

Link to post
Share on other sites
  • 5 months later...

I like efibootmgr. Simple.

No loaders, just efi stubs.

If you use a generic name for your kernel stub, whenever you update the kernel, cp it to the same name. No need to update the efiboot command

If you use a initramfs, add it to the -u line, and copy it to the EF00 partition, use a generic name also.


Something like and done.


efibootmgr -c -d /dev/sda -p 1 -L "funtoo" -l "\linux.efi" -u "root=PARTUUID=***** rootfstype=ext4 consoleblank=0"


-c = create

-d = dev with the EF00 partition on it

-p = partition number for your GPT EF00 partition

-L = entry name

-l = efistub !!! the "\" is needed because the EF00 partition is fat formatted and UEFI looks for the fs0 / EF00 partition.

-u = kernel boot options.  Use PARTUUID, I never got UUID to work.

Link to post
Share on other sites
  • 2 weeks later...

I use rEFInd, but I never used boot-update or similar abstractions.


I think that rEFInd will and should never be in portage, because by its nature it's something that you need to install manually: it goes on the ESP partition, not in the usual system partition(s) (/, /usr, ?), and it's independent from the installed OSes so why should Funtoo manage it?  It could lead to problems more than solutions.


@Chris, not everybody uses the same color theme here: your example is unreadable on my white background until I select it.

Link to post
Share on other sites

Update about using efibootmgr.

I just figured out, and I'm not sure why, but if your using a initramfs, you need to pass root=UUID, not root=PARTUUID.

I was running a monolithic kernel, and UUID would not work.


And the correct efibootmgr command when using a initramfs

-u "initrd=initramfs-whatever root=UUID=<place string here> rootfstype=<whatever>"


and the initramfs needs to be in the EF00 partition.

Link to post
Share on other sites


Sorry about the colouring, I general use Xcode to write my scripts, that was a direct cut/paste from Xcode.....


# Monolithic Kernel

efibootmgr -c -d /dev/sda -p 1 -L "funtoo" -l "\linux.efi" -u "root=PARTUUID=***** rootfstype=ext4 consoleblank=0"

# Initramfs Kernel
efibootmgr -c -d /dev/sda -p 1 -L "funtoo" -l "\linux.efi" -u "initrd=initramfs-whatever root=UUID=***** rootfstype=ext4 consoleblank=0"
Also as a general note, the default sys-kernel/gentoo-sources config doesn't have the efi stub enabled.
If this is not set the efibootmgr won't boot the entry. 
Link to post
Share on other sites
  • 2 weeks later...

Yeah I don't know that refind could go into portage any more than the kernel or genkernel does.  You know its there, maybe you can flag some patches or symlinks to be in or out but basically portage just downloads it and then you have to go modify the kernel with make menuconfig and friends.  There would always be a certain amount of manual labor, and I don't know that I need to update to latest and greatest version once its working.  More than requesting that it be added though I was just curious why there isn't a wiki how too page or something like arch has here


and I was surprised that I found no discussions in the forums.  Perhaps its just that Funtoo is really wedded to boot-update and refind doesn't fit easily there.  Refind is just so much prettier than grub, and its also more convenient because it just automatically finds new kernels and initramfs's that I save to boot as long as the names follow the pattern.  So I only set it up once.


efibootmgr - I find I have to use it as part of my install, I need it to insert refind into the bios (like you have to do if you use grub with EFI) but then refind becomes an intermediate launch pad between the EFI bios and the kernels or windows or indeed even grub.  Again, once I have refind installed I don't have to modify it but I think every time I make a new kernel with EFI extensions I'd have to go through the efibootmgr command to insert it in the bios, and I think there are a limited number of slots in the bios.  refind can point to as many kernels as you dump into boot.

Link to post
Share on other sites
  • 3 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...