X-Git-Url: https://code.delx.au/refind/blobdiff_plain/775c835c500538b43f65469afadc2af7b61cf65b..480ba418c97ece5557ac0efc5dc189ff19fb8b8f:/docs/refind/drivers.html diff --git a/docs/refind/drivers.html b/docs/refind/drivers.html index 579ddac..5b24292 100644 --- a/docs/refind/drivers.html +++ b/docs/refind/drivers.html @@ -8,6 +8,8 @@ + +

The rEFInd Boot Manager:
Using EFI Drivers

@@ -15,10 +17,10 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com

Originally written: 4/19/2012; last Web page update: -5/20/2012, referencing rEFInd 0.4.0

+12/12/2015, referencing rEFInd 0.10.1

-

I'm a technical writer and consultant specializing in Linux technologies. This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!

+

This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!

@@ -26,49 +28,82 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com

+ - - - - + + -
Donate $2.50 Donate $5.00 Donate $10.00Donate $20.00 Donate another value
- + +
+ + - + + - + + + -
- + +
+ + - + + - + + + -
- + + +
+ + - + + - + + + -
- + +
+ + - + + - + + + + +
+ + + + + + + + + +
@@ -78,11 +113,10 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com

- -Donate with PayPal +
+
@@ -90,15 +124,42 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com


+
+

Beginning with version 0.2.7, rEFInd has been able to load EFI drivers, and as of version 0.4.0, it has shipped with some EFI filesystem drivers. Although EFI implementations should be able to load drivers prior to rEFInd's launch, in my experience, most EFI implementations offer such poor control over EFI driver loading that they can't be counted on to do this. Thus, if you want to use EFI drivers, rEFInd's ability to do so can be useful. This page tells you why you might want to use drivers, how you can install and use rEFInd's own drivers, where you can go to find other drivers, and provides tips on a few specific drivers.

+
+ + + +
+

Why Should You Use EFI Drivers?

+

EFI supports drivers, which can activate hardware or filesystems in the pre-boot environment. At the moment, EFI drivers are few and far between; but you can or might want to use them for various reasons:

-

All of these drivers rely on filesystem wrapper code written by rEFIt's author, Christoph Phisterer. They all suffer from speed problems on some systems, as described later in "Notes on Specific Drivers;" however, these problems are very minor on most systems.

+

All of these drivers rely on filesystem wrapper code written by rEFIt's author, Christoph Phisterer.

- + -

If you want to use one or more of these drivers, you can install them from the rEFInd binary package from the refind/drivers_arch directory, where arch is a CPU architecture code—x64 or ia32. The files are named after the filesystems they handle, such as ext2_x64.efi for the 64-bit ext2fs driver. You should copy the files for the filesystems you want to use to the drivers or drivers_arch subdirectory of the main rEFInd installation directory. (You may need to create this subdirectory.) Be careful to install drivers only for your own architecture. Attempting to load drivers for the wrong CPU type will cause a small delay at best, or may cause the computer to crash at worst. I've placed rEFInd's drivers in directories that are named to minimize this risk, but you should exercise care when copying driver files.

+

If you want to use one or more of these drivers, you can install them from the rEFInd binary package from the refind/drivers_arch directory, where arch is a CPU architecture code—x64 or ia32. The files are named after the filesystems they handle, such as ext4_x64.efi for the 64-bit ext4fs driver. You should copy the files for the filesystems you want to use to the drivers or drivers_arch subdirectory of the main rEFInd installation directory. (You may need to create this subdirectory.) Be careful to install drivers only for your own architecture. Attempting to load drivers for the wrong CPU type will cause a small delay at best, or may cause the computer to crash at worst. I've placed rEFInd's drivers in directories that are named to minimize this risk, but you should exercise care when copying driver files.

When you reboot after installing drivers, rEFInd should automatically detect and use the drivers you install. There's likely to be an extra delay, typically from one to five seconds, as rEFInd loads the drivers and tells the EFI to detect the filesystems they handle. For this reason, and because of the possibility of drivers harboring bugs, I recommend installing only those drivers that you need. If you like, you can install drivers you don't plan on using to some other directory, such as /drivers on the ESP's root. You can then load these drivers manually with the EFI shell's load command if the need arises in the future. You can then tell the shell to re-assign drive identifiers with map -r:

-fs0: load reiserfs_x64.efi
+fs0: load btrfs_x64.efi
 fs0: map -r
 
-

If you build rEFInd from source, you should be aware that the drivers rely on TianoCore's development kit, whereas rEFInd itself uses GNU-EFI. Thus, to compile both, you'll need to install both development kits. Unfortunately, the TianoCore kit is a bit unusual from a Linux developer's perspective, and you'll probably have to build it from source code. Consult the BUILDING.txt file in the source package for more information. None of this is important if you use a binary build of rEFInd, unless you've obtained it from a third party who hasn't built the drivers. If that's the case, you'll have to download rEFInd from Sourceforge (see the Getting rEFInd page for details) or use drivers from another source.

- +

Finding Additional EFI Drivers

+

As already noted, I know of no EFI drivers for EFI hardware, aside from those that are built into motherboards' EFI implementations. I do, however, know of a few EFI filesystem drivers, in addition to those provided with rEFInd:

+
  • VirtualBox's HFS+ and ISO-9660 drivers—These drivers are available in source code form, and come with VirtualBox binaries. I've not attempted to compile them myself, but I've seen a report that suggests they may include assumptions that require use of MinGW, a GCC-based compiler for Windows (and cross-compiler to build Windows executables under Linux). I don't know of a source for binaries suitable for use on EFI-based computers; if you want to use them, you'll need to figure out how to compile them yourself. As noted earlier, rEFInd's drivers are closely related to these.
  • -

    Most of these cross-project drivers appear to be related, and most of them have fed into rEFInd's drivers. I used the Clover package, which in turn was based on the VirtualBox drivers, as a starting point. Everybody else has dropped rEFIt's original ReiserFS driver, but I added that back. Of these drivers, only the Clover EFI Tools NTFS driver is missing from rEFInd. Specific versions can have their own quirks, though. For instance, the Clover (and I suspect VirtualBox) drivers don't return volume labels, which causes rEFInd to display loaders on those volumes as being on a disk called Unknown. (I fixed that bug for rEFInd's version, and it wasn't present in the original rEFIt drivers.)

    +
  • Ext2Pkg—This driver, based on bitbucket and with a backup on github, appears to be an ext2fs/ext3fs driver built independently of the driver written by Christoph Pfisterer. The linked-to sites provide access to source code via git but do not provide binaries. When I built binaries, they failed to work. Under VirtualBox, the driver loaded but then hung when I tried to access an ext2 filesystem. On a 32-bit Mac Mini, I got error messages when I tried to access an ext2 filesystem. As I write, the code was last updated in March of 2012. If you check the project and it's been updated more recently, it might be worth trying. Otherwise, I can't recommend this driver. I mention it here only in case it improves in the future.
  • -

    Driver availability could increase in the future. Source code to a wide variety of filesystems is available in GRUB Legacy, GRUB 2, Linux, various BSD kernels, and in other projects. Sooner or later somebody's likely to begin porting those drivers to EFI. If you do so, or if you know of additional EFI drivers, please tell me about it, so I can share the information here. Likewise if you know of a source for other EFI drivers—say, for a video card or disk controller card.

    +
  • Paragon's UFSD—According to this blog post, Paragon Software has ported its Universal File System Drivers (UFSD) to EFI, providing "transparent access to NTFS, HFS+, ExFAT, and ExtFS" (sic). The entry doesn't provide any download links, and it's unclear if the product is (or will be) available for free or on a pay basis. I haven't tried these drivers, so I can't comment on their quality.
  • + + + +

    The rEFIt, Clover, and VirtualBox drivers are related, and all of them +have fed into rEFInd's drivers. Specific versions can have their own +quirks, though. For instance, the Clover (and I suspect VirtualBox) drivers +don't return volume labels, which causes rEFInd to display loaders on those +volumes as being on a disk called Unknown. (I fixed that bug for +rEFInd's version, and it wasn't present in the original rEFIt drivers.) +Most of these drivers also suffer from speed problems on some computers. +This is worst with the ext2fs drivers under VirtualBox; on my main +computer, that combination takes 3 minutes to load a Linux kernel and +initial RAM disk file! Most real computers don't suffer nearly so badly, +but some can take an extra five seconds or so to boot a kernel. I've fixed +the speed problems in rEFInd's drivers as of version 0.7.0.

    + +

    Driver availability could increase in the future. If you know of +additional EFI drivers, please tell +me about them, so I can share the information here. Likewise if you +know of a source for other EFI drivers—say, for a video card or disk +controller card.

    Once you've obtained an EFI driver, you can install it in rEFInd just as you would install rEFInd's own drivers, as described earlier.

    @@ -196,19 +349,35 @@ fs0: map -r

    Notes on Specific Drivers

    -

    I've tested several of the drivers described on this page on a handful of systems. The ext2fs driver (from any source) works on both ext2fs and ext3fs, but not on ext4fs—at least, not in my one test. (There may be options you can use when creating an ext4 filesystem that would enable the ext2fs driver to handle it, but if so I don't know what they are.) The ReiserFS driver is obviously useful only on ReiserFS partitions. (Reiser4 is not supported, as far as I know.) Given that these filesystems are getting a bit on in age by Linux standards, you might do well to use them on a separate Linux /boot partition; however, if you're willing to use ext3fs or ReiserFS on your root (/) filesystem, you can use the EFI drivers to read your kernel from it. Note that this assumes you use conventional partitions; to the best of my knowledge, there's no EFI driver for Linux's Logical Volume Manager (LVM) or Redundant Array of Independent Disks (RAID) configurations, so the EFI can't access filesystems stored in these ways.

    - -

    The ext2fs and ReiserFS drivers work, but they are a bit sluggish—particularly the ext2fs driver. The extent of the problem depends on the computer. In my tests so far, VirtualBox has fared the worst. On it, loading a Linux kernel with EFI stub loader from a FAT partition takes 2 seconds, from the moment of selecting the OS in rEFInd to the moment the kernel messages begin to appear. The equivalent time using ReiserFS or HFS+ is 20 seconds, and with ext2fs it's 200 seconds (that is, 3 minutes and 20 seconds). On a 32-bit Mac Mini, though, the speed problem is much less pronounced—my kernel loads in just 3 seconds from a ReiserFS partition and in 13 seconds from an ext2 filesystem. Times with ext2fs on a UEFI PC with an Intel motherboard are in the 2–4 second range. Nonetheless, if you try the ext2fs driver and it seems to hang, be patient; it may finally boot up. If so, and if the delay is too great for you to accept, you might consider using ReiserFS instead of ext2fs or ext3fs, at least if a change is practical. (For a /boot partition, it almost certainly is practical; you can back it up quite easily, create a fresh filesystem on it, and restore it. You may need to adjust your /etc/fstab entry for a new UUID value, though.) You can even use HFS+ on a Linux /boot partition, although this makes the most sense on a Mac, which has its own EFI HFS+ driver.

    - -

    Since the ext2fs and ReiserFS drivers share a common origin, it should come as no surprise that they perform in much the same way no matter which version (rEFIt, Clover, or rEFInd) you use. One exception is that the Clover EFI Tools drivers don't deliver filesystem labels, which makes them less desirable than the rEFIt or rEFInd drivers. The NTFS driver from the Clover Tools package is nice and speedy, though, so if for some reason you need to place a boot loader on an NTFS volume, this driver might be worth tracking down.

    - -

    Although both ext2fs and ReiserFS are case-sensitive, these drivers treat them in a case-insensitive way. Symbolic links work, which opens up possibilities for configuration, such as using a single kernel binary for multiple Linux distributions, with a link in one subdirectory pointing to a file in another directory. (If you try this, though, be sure to use relative links, as in ../otherdist/bzImage.efi, at least if the partition is not Linux's root filesystem.)

    + + +

    I've tested several of the drivers described on this page on a handful +of systems. The Pfisterer ext2fs driver (from any source) works on both +ext2fs and ext3fs, but not on ext4fs—but Agner's derivative ext4fs +driver handles ext4fs, so that's not a problem. The ReiserFS driver is +obviously useful only on ReiserFS partitions. (Reiser4 is not supported, as +far as I know.) The Btrfs driver is the newest of the Linux filesystem +drivers included with rEFInd, and so I've tested it the least, but it's +worked for me on several test systems. Given that ext2fs, ext3fs, and +ReiserFS are getting a bit on in age by Linux standards, you might do well +to use them on a separate Linux /boot partition; however, if +you're willing to use ext3fs, ext4fs, Btrfs, or ReiserFS on your root +(/) filesystem, you can use the EFI drivers to read your kernel +from it. Note that this assumes you use conventional partitions; to the +best of my knowledge, there's no EFI driver for Linux's Logical Volume +Manager (LVM) or Redundant Array of Independent Disks (RAID) +configurations, so the EFI can't access filesystems stored in these +ways.

    + +

    As noted earlier, rEFInd's drivers prior to version 0.7.0, as well as related drivers from rEFIt, Clover, and VirtualBox, suffer from speed problems. These problems are mostly minor, adding a second or two to boot times; but on some computers, the speed problems can be dramatic, boosting kernel-load times up to as much as three minutes (under VirtualBox). If you run into excessive boot times with such a driver, try switching to the latest rEFInd driver instead. You might also try Pete Batard's efifs drivers.

    + +

    Although ext2fs, ext3fs, ext4fs, and ReiserFS are all case-sensitive, these drivers treat them in a case-insensitive way. Symbolic links work; however, rEFInd 0.6.11 and later ignore symbolic links, since many distributions use them in a way that creates redundant or non-functional entries in the rEFInd menu. You should be able to use hard links if you want to use a single kernel file in multiple ways (say for two distributions).


    -

    copyright © 2012 by Roderick W. Smith

    +

    copyright © 2012–2015 by Roderick W. Smith

    This document is licensed under the terms of the GNU Free Documentation License (FDL), version 1.3.