I'm booting from EFI using the awesome rEFInd bootloader. I've so far had to configure boot myself by manually copying over my EFI-compatible linux boot image to my EFI partition and writing a configuration file to define a rEFInd menu entry and link to the specific kernel image on the EFI volume.

GRUB, on the other hand, adds new kernel versions as they're installed and I always boot into the new kernel on next boot. It accomplishes this via the update-grub script, I believe.

Is there another script I can call into to automatically deploy new kernel images to my EFI partition and ensure they're available on next boot? I'd like to automate this process as much as possible so I'm always getting the latest kernel security updates.

  • I don't know this bootloader but you could have a look at wiki.archlinux.org/index.php/EFISTUB I guess the principle is the same (copying kernel to efi partition,...)
    – UnX
    Mar 31, 2014 at 23:38
  • Is there something special about your filesystem? rEFInd can boot directly from /boot on most. I dont use it though - i just bind mount my kernel location on my efi system partition over /boot. In fact, i wrote the section on how to do so sometime last year in the wiki the linjed in the comment above. Either way - it's fairly easy.
    – mikeserv
    Apr 1, 2014 at 2:23
  • Boot filesystem is btrfs, so yes, there's something special about my filesystem, so I have a separate partition in FAT for booting Windows and Linux. Apr 1, 2014 at 2:26
  • Refind can do btrfs - its not that special. I know how the esp setup works for the most part. Look in your refind installation directory for "drivers" find find the btrfs driver, and enabled it in refinds config. Might be a good idea look into how well it handles subvolumes - that one im not certain about. I never bothered because i keep my kernels on the esp and bind mouny their location over boot. Its very easy - all you need is /etc/fstab.
    – mikeserv
    Apr 1, 2014 at 4:18
  • Oh, wow. Last time I checked, rEFInd didn't support btrfs, closest thing was ext4. Also, I hardly think that my system's EFI boot will be able to read a btrfs boot drive. Can you supply your configuration/setup in an answer? It's not clear exactly what you're doing. Apr 1, 2014 at 18:24

2 Answers 2


This takes in-distro support to be done properly (I've introduced UEFI support into ALT Linux); one can workaround that by using symlinks and refind's filesystem drivers or piggyback some custom script into /etc/grub.d of course...

FWIW the most developed PE-COFF binary handling infrastructure I've seen so far has been done within PLD Linux.


If you're using kernel .deb packages (i.e. either using your distribution's standard kernels, or compiling your own The Debian Way), then the kernel package installation process will run any scripts located in the appropriate sub-directories of /etc/kernel/. In particular, the /etc/kernel/postinst.d/ directory would be a good place for a script that places the new kernel within reach of rEFInd.

Note also that reasonably recent versions of rEFInd can auto-detect Linux kernels, and use a refind_linux.conf file to define sets of kernel boot options in a generic way: rEFInd will by default offer the most recent kernel file detected, and use the first set of boot options with it. By pressing F2 (I think) you can get a sub-menu with the older kernel versions and the other boot option sets. Using this feature might allow you to get away with a simpler script.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.