From 65eb839a6d8d68a439056473a0d3728dfd39d2c4 Mon Sep 17 00:00:00 2001
From: srs5694
Date: Sun, 20 May 2012 22:37:37 -0400
Subject: [PATCH] Version 0.4.0 release.
---
BUILDING.txt | 36 +-
CREDITS.txt | 4 +-
NEWS.txt | 14 +-
docs/refind/bootmode.html | 2 +-
docs/refind/configfile.html | 2 +-
docs/refind/drivers.html | 90 +++-
docs/refind/features.html | 8 +-
docs/refind/getting.html | 50 +-
docs/refind/index.html | 2 +-
docs/refind/installing.html | 29 +-
docs/refind/linux.html | 4 +-
docs/refind/revisions.html | 4 +-
docs/refind/themes.html | 2 +-
docs/refind/todo.html | 314 +++++++-----
docs/refind/using.html | 2 +-
filesystems/Make.common | 25 +-
filesystems/Makefile | 4 +-
filesystems/fsw_efi.c | 2 +-
filesystems/test/.svn/all-wcprops | 41 --
filesystems/test/.svn/entries | 232 ---------
.../test/.svn/text-base/README.svn-base | 2 -
.../test/.svn/text-base/fsw_posix.c.svn-base | 479 ------------------
.../test/.svn/text-base/fsw_posix.h.svn-base | 98 ----
.../.svn/text-base/fsw_posix_base.h.svn-base | 89 ----
.../test/.svn/text-base/lslr.c.svn-base | 136 -----
.../test/.svn/text-base/lsroot.c.svn-base | 79 ---
mkcdimage | 10 +-
mkdistrib | 14 +-
refind/main.c | 22 +-
29 files changed, 408 insertions(+), 1388 deletions(-)
delete mode 100644 filesystems/test/.svn/all-wcprops
delete mode 100644 filesystems/test/.svn/entries
delete mode 100644 filesystems/test/.svn/text-base/README.svn-base
delete mode 100644 filesystems/test/.svn/text-base/fsw_posix.c.svn-base
delete mode 100644 filesystems/test/.svn/text-base/fsw_posix.h.svn-base
delete mode 100644 filesystems/test/.svn/text-base/fsw_posix_base.h.svn-base
delete mode 100644 filesystems/test/.svn/text-base/lslr.c.svn-base
delete mode 100644 filesystems/test/.svn/text-base/lsroot.c.svn-base
diff --git a/BUILDING.txt b/BUILDING.txt
index 924ee8e..7d5fbd2 100644
--- a/BUILDING.txt
+++ b/BUILDING.txt
@@ -165,21 +165,22 @@ The EFI filesystem drivers in the filesystems subdirectory require the
TianoCore UDK2010.SR1 toolkit. The drivers might compile with another
version of the TianoCore toolkit, but I've not tested them with anything
else. (My attempts to use GNU-EFI have failed; at best, I've gotten drivers
-that load but hang the system.)
+that load but hang the computer.)
Unfortunately, the TianoCore toolkit is bulky and weird by Linux
programming standards. I don't know of any Linux distribution packages for
it in RPM, Debian package file, or other format; you MUST install the kit
from source code using its own unusual compilation procedure. The
-installation documentation also omits a few steps. Here's how I installed
-the toolkit:
+installation documentation also omits at least one step and is a bit
+unclear about others. Here's how I installed the toolkit:
1) Download UDK2010.SR1 from
https://sourceforge.net/apps/mediawiki/tianocore/index.php?title=UDK2010.
2) Type "mkdir /usr/local/UDK2010". You can use another directory, but the
Makefile for rEFInd's EFI drivers assumes this location. You'll need to
- edit the EDK2BASE line in the Makefile if you install somewhere else.
+ edit the EDK2BASE line in the Make.common file if you install somewhere
+ else.
3) Type "cd /usr/local/UDK2010".
@@ -211,7 +212,10 @@ the toolkit:
type "gcc -v" to learn your GCC version number)
The Makefile for the drivers reads some of these variables from this
file and uses them when accessing directories, so be sure to type these
- entries in the case specified.
+ entries in the case specified. Note that the documentation refers to
+ editing Conf/tools_def.txt in addition to Conf/target.txt, but doesn't
+ specify what to change in Conf/tools_def.txt. I haven't found it
+ necessary to make any changes in Conf/tools_def.txt.
11) Type "make -C /usr/local/UDK2010/MyWorkSpace/BaseTools/Source/C".
(This step is not documented on the EDK Web page.)
@@ -221,11 +225,25 @@ the toolkit:
Once the toolkit is installed, you can build the filesystem drivers. If you
installed in a location other than the one I've specified, you must edit
-the Makefile's EDK2BASE variable. You can then type "make" to build all the
-drivers, or specify a filesystem type to build just it.
+the EDK2BASE variable in the filesystems/Make.common file in the rEFInd
+source package.. You can then type "make" in the "filesystems" directory,
+or "make fs" in the main source directory, to build all the drivers. If you
+want to build just one driver, you can change into the "filesystems"
+directory and type "make {fsname}", where {fsname} is a filesystem name --
+"ext2", "reiserfs", "iso9660", or "hfs". The drivers will appear in the
+"filesystems" directory, and also be copied to the "drivers" directory.
+
+To install drivers, you can type "make install" in the "filesystems"
+directory. This copies all the drivers to the
+"/boot/efi/EFI/refind/drivers" directory. Alternatively, you can copy the
+files you want manually.
+
+*CAUTION:* Install drivers for your system's architecture *ONLY*.
+Installing drivers for the wrong architecture causes some systems to hang
+at boot time.
The drivers all rely on filesystem wrapper code created by rEFIt's author,
Christoph Phisterer. Most of the drivers seem to have passed through
Oracle's VirtualBox project ((https://www.virtualbox.org) and the Clover
-boot loader project (https://sourceforge.net/projects/cloverefiboot/). Most
-of the drivers are based on code from the Linux kernel.
+boot loader project (https://sourceforge.net/projects/cloverefiboot/),
+which I used as the source for this build.
diff --git a/CREDITS.txt b/CREDITS.txt
index ad7f478..b3e85af 100644
--- a/CREDITS.txt
+++ b/CREDITS.txt
@@ -20,8 +20,8 @@ I've incorporated into the current version. Specifically:
wrapper created by Christoph Phisterer. They then passed through Oracle's
VirtualBox (https://www.virtualbox.org) and the Clover boot loader
project (https://sourceforge.net/projects/cloverefiboot/). The
- filesystem-specific code comes from various sources, including Apple and
- the Linux kernel.
+ filesystem-specific code comes from various sources, including Apple,
+ the Linux kernel, and Christoph Phisterer.
* I replaced many of the original rEFIt icons with icons taken from the
Oxygen Icons project, either from the Oxygen Refit package on its page
diff --git a/NEWS.txt b/NEWS.txt
index 84e1371..82cd1be 100644
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -1,6 +1,18 @@
-0.3.6 (?/??/2012):
+0.3.6 (5/20/2012):
------------------
+- Inclusion of drivers for ISO-9660, HFS+, ReiserFS, and ext2fs. Most of
+ these drivers originated with rEFIt, although the HFS+ driver seems to
+ have come from Oracle's VirtualBox, with some files from Apple. I hadn't
+ included these drivers previously because the build process proved
+ challenging. As it is, they don't work on my Mac Mini, I suspect because
+ the build process with the UDK2010 development kit may not work with the
+ EFI 1.x that Apple uses.
+
+- Addition of support for drivers in the "drivers_{arch}" subdirectory of
+ the main rEFInd binary directory (e.g., "drivers_x64" or "drivers_ia32").
+ Drivers may continue to be placed in the "drivers" subdirectory.
+
- Added new feature to eject CDs (and other removable media): Press F12 to
eject all such media. This function works only on some Macs, though (it
relies on an Apple-specific EFI extension, and this extension isn't even
diff --git a/docs/refind/bootmode.html b/docs/refind/bootmode.html
index 7ddb3da..7082ca8 100644
--- a/docs/refind/bootmode.html
+++ b/docs/refind/bootmode.html
@@ -15,7 +15,7 @@
href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com
Originally written: 3/14/2012; last Web page update:
-5/15/2012, referencing rEFInd 0.3.5
+5/20/2012, referencing rEFInd 0.4.0
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!
diff --git a/docs/refind/configfile.html b/docs/refind/configfile.html
index 994a70c..ca6b444 100644
--- a/docs/refind/configfile.html
+++ b/docs/refind/configfile.html
@@ -15,7 +15,7 @@
href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com
Originally written: 3/14/2012; last Web page update:
-5/15/2012, referencing rEFInd 0.3.5
+5/20/2012, referencing rEFInd 0.4.0
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!
diff --git a/docs/refind/drivers.html b/docs/refind/drivers.html
index a4447a0..579ddac 100644
--- a/docs/refind/drivers.html
+++ b/docs/refind/drivers.html
@@ -15,7 +15,7 @@
href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com
Originally written: 4/19/2012; last Web page update:
-5/15/2012, referencing rEFInd 0.3.5
+5/20/2012, referencing rEFInd 0.4.0
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!
@@ -90,7 +90,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com
-Beginning with version 0.2.7, rEFInd has been able to load EFI drivers. Although EFI implementations should be able to do this 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, where you can go to find them, and provides tips on a few specific drivers.
+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?
@@ -112,43 +112,95 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com
To the best of my knowledge, the best reason to want EFI driver support in rEFInd is to provide access to filesystems. Although EFI filesystem driver choices are currently limited, those that are available can help to improve your installation and configuration options, particularly if you've found yourself "boxed in" by awkward installation or bugs, such as the dinky ESP that Ubuntu creates by default or the bug that prevents a Linux kernel with EFI stub loader support from booting from the ESP of at least some Macs.
-As a side note, using an ISO-9660 driver can theoretically help you keep the size of a custom Linux boot CD/DVD down to a reasonable value. This is because EFI systems normally boot from optical discs by reading a FAT image file in El Torito format and treating that file as an ESP. If you need to store the kernel both in that file and directly in the ISO-9660 filesystem (to maintain bootability on BIOS systems), that can represent an unwanted extra space requirement. Placing rEFInd and an ISO-9660 driver in the FAT image file should enable you to store the kernel on the disc only once. Unfortunately, my attempts to get this to work have failed to date. When the ISO-9660 driver is loaded from the El Torito image, my test systems seem to allow only one of the two filesystems (the El Torito image's FAT filesystem or the optical disc's ISO-9660 filesystem) to be active; load one and the other goes away. Also, some EFI implementations include ISO-9660 drivers, so you might not need a separate ISO-9660 driver if you're building a disc for a particular computer.
+As a side note, using an ISO-9660 driver can theoretically help you keep the size of a custom Linux boot CD/DVD down to a reasonable value. This is because EFI systems normally boot from optical discs by reading a FAT image file in El Torito format and treating that file as an ESP. If you need to store the kernel both in that file and directly in the ISO-9660 filesystem (to maintain bootability on BIOS systems), that can represent an unwanted extra space requirement. Placing rEFInd and an ISO-9660 driver in the FAT image file should enable you to store the kernel on the disc only once. Unfortunately, this doesn't work in practice. When the ISO-9660 driver is loaded from the El Torito image, the driver discovers that the optical disc is in use and refuses to access it. It's possible to use EFI shell commands to give the ISO-9660 driver access to the shell device, but this causes the El Torito access to go away, which means that anything loaded from the El Torito image (such as rEFInd) is likely to malfunction. Also, some EFI implementations include ISO-9660 drivers, so you might not need a separate ISO-9660 driver if you're building a disc for a particular computer.
-Finding and Installing EFI Drivers
+Using rEFInd's 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:
+
+
+Since version 0.4.0, rEFInd has shipped with a small collection of read-only EFI filesystem drivers. These are:
+
+
+
+- ReiserFS—This driver originated with rEFIt. It's useful
+ for reading Linux kernels from a separate /boot partition, or
+ even from a root (/) filesystem, if you use ReiserFS on
+ it.
+
+- Ext2fs—This driver also originated with rEFIt. It can be
+ used in the same way as the ReiserFS driver. Although it's called an
+ "ext2fs" driver, it also works with ext3fs.
+
+- ISO-9660—This driver originated with rEFIt's author, but
+ he never released a final version. Its code was improved by Oracle for
+ use in its VirtualBox product, and then further modified by the authors
+ of the Clover boot
+ loader. If your firmware doesn't provide its own ISO-9660 driver, this
+ one can be helpful; however, you may need to install it on your hard
+ disk before you can read an optical disc.
+
+- HFS+—Oracle seems to have written this driver, apparently
+ with some code taken from open source Apple examples. It was then
+ further modified by the Clover authors. I expect this driver to have
+ limited appeal most rEFInd users. Macs don't need it, since Apple's EFI
+ implementation provides its own HFS+ driver, and HFS+ isn't normally
+ used on UEFI-based PCs. Some CDs are mastered with both ISO-9660 and
+ HFS+, or even with HFS+ alone, and it's conceivable that an HFS+ driver
+ would be useful when accessing such discs. I'm providing the driver
+ mainly because it compiled cleanly with no extra work, aside from
+ providing a Makefile entry for it.
+
+
+
+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.
+
+
+
+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.
+
+
+
+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: 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:
- rEFIt's ext2fs and ReiserFS drivers—You can gain read-only access to ext2fs, ext3fs, and ReiserFS volumes with these drivers. You can use the binaries in the refit-bin-0.14/efi/tools/drivers directory of the binary package directly on a Mac. On a UEFI-based PC, though, you'll need to break the Mac-style "fat" binary into its 32- and 64-bit components. You can use my thin program for this job.
-- Clover EFI's ISO-9660, ext2fs, and HFS+ drivers—This project is an offshoot of TianoCore, the main UEFI project. It's primarily a Hackintosh boot loader, but it includes drivers for ISO-9660, ext2fs, and HFS+; however, building them requires a fair amount of expertise. You can find a compile script for the ISO-9660 driver here, and a compiled ISO-9660 binary here. The compiled binary has worked in a brief test; however, it didn't give access to the ISO-9660 filesystem when it was loaded from an El Torito image the ISO-9660 filesystem held.
+- Clover EFI's ISO-9660, ext2fs, and HFS+ drivers—This project is an offshoot of TianoCore, the main UEFI project. It's primarily a Hackintosh boot loader, but it includes drivers for ISO-9660, ext2fs, and HFS+; however, building them requires a fair amount of expertise. These drivers served as a starting point for rEFInd's drivers.
-- Clover's EFI Tools package—This osx86.net thread includes links to a package called EFI_Tools_Clover_v2_r384_EFI_x32_x64_EN.zip, which holds an OS X application (a directory with a .app extension, as seen from other platforms) with a number of drivers in the Contents/Resources/EFI/drivers64 directory (and an equivalent for 32-bit binaries). Some of these, such as keyboard drivers, are unlikely to be useful unless your system is badly broken as delivered. Three that caught my eye, however, are VBoxExt2-64.efi, NTFS-64.efi, and VBoxIso9600-64.efi.
+- Clover's EFI Tools package—This osx86.net thread includes links to a package called EFI_Tools_Clover_v2_r447_EFI_x32_x64_EN.zip, which holds an OS X application (a directory with a .app extension, as seen from other platforms) with a number of drivers in the Contents/Resources/EFI/drivers64 directory (and an equivalent for 32-bit binaries). Some of these, such as keyboard drivers, are unlikely to be useful unless your system is badly broken as delivered. Three that caught my eye, however, are VBoxExt2-64.efi, NTFS-64.efi, and VBoxIso9600-64.efi.
- 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.
-Most of these cross-project drivers appear to be related. For instance, the ISO-9660 drivers are both based on code written by Christoph Phisterer for rEFIt (although he doesn't seem to have finished and released it in binary form himself).
-
-As you can see, pickings are rather slim. Nonetheless, the drivers that exist are useful for certain purposes. The options could increase in the future, too. 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.
+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.)
-
+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.
-Once you've obtained an EFI driver or two, you can install it in rEFInd by creating a subdirectory of the rEFInd directory called drivers—for instance, EFI/refind/drivers, if you've installed rEFInd to EFI/refind on the ESP. Alternatively, you can create a directory of any other name and use the scan_driver_dirs option in refind.conf to tell rEFInd where to look for drivers. Either way, rEFInd attempts to load all the EFI drivers from these directories, so placing your files there and rebooting will do the trick.
-
-rEFInd is likely to take slightly longer to start up when you use drivers, but the effect is likely to be small. On my systems, it's usually just a second or so. This effect could be greater with some drivers or on some systems, though.
+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.
+
Notes on Specific Drivers
+
-I've tested the original rEFIt drivers on a handful of systems. First let me re-emphasize one point: To use rEFIt's ext2fs and ReiserFS drivers on a UEFI-based PC, you must separate the x86 and x86-64 binaries from the "fat" binary format that come in the binary package. You can do this with my thin program.
-
-The rEFIt ext2fs driver 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 rEFIt 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 rEFIt 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.
+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 worse. 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 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 were also reasonable, although I didn't record precise values. 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.)
+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.
-The Clover EFI Tools ext2fs driver performs much like the rEFIt ext2fs driver, but it doesn't deliver a filesystem label, which makes it less desirable. The NTFS driver from this 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.
+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.)
diff --git a/docs/refind/features.html b/docs/refind/features.html
index d1291ac..0fdd59b 100644
--- a/docs/refind/features.html
+++ b/docs/refind/features.html
@@ -15,7 +15,7 @@
href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com
Originally written: 3/14/2012; last Web page update:
-5/15/2012, referencing rEFInd 0.3.5
+5/20/2012, referencing rEFInd 0.4.0
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!
@@ -107,6 +107,10 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com
Load EFI drivers for filesystems or hardware devices not supported natively by your firmware. (This feature is absent in some builds of rEFIt and in rEFInd prior to version 0.2.7.)
+Inclusion of drivers for the Linux ReiserFS and ext2 filesystems in the
+ main package. (These drivers are absent from rEFInd prior to version
+ 0.4.0; and the rEFInd versions don't work on at least some Macs.)
+
I've used rEFIt on a couple of computers for over a year, but I've found that it has some frustrating limitations. It tends to flood the screen with non-functional BIOS boot options, for instance; and it has a number of bugs on UEFI-based systems. I therefore expanded on rEFIt, giving rEFInd features that improve on or go beyond those of rEFIt, such as:
@@ -149,6 +153,8 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com
An "exit" option (disabled by default), so that you can return to whatever shell or boot manager you used to launch rEFInd, should this ability be desirable. (This feature first appeared in rEFInd 0.2.4.)
+Drivers for ISO-9660 and HFS+, which are not included in rEFIt. (The ISO-9660 driver is based on code from the rEFIt project, but was never completed by its original author. It was completed by Oracle for VirtualBox.)
+
On the flip side, at least for Mac users, rEFInd comes with less sophisticated Mac installation tools than does rEFIt, in favor of more OS-agnostic packaging.
diff --git a/docs/refind/getting.html b/docs/refind/getting.html
index d38c619..1a43a2f 100644
--- a/docs/refind/getting.html
+++ b/docs/refind/getting.html
@@ -15,7 +15,7 @@
href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com
Originally written: 3/14/2012; last Web page update:
-5/15/2012, referencing rEFInd 0.3.5
+5/20/2012, referencing rEFInd 0.4.0
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!
@@ -97,40 +97,40 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com
-- A
+
- A
source code zip file—This is useful if you want to
compile the software locally. Note that I use Linux with the GNU-EFI development
- tools. rEFIt used an Intel/Microsoft toolchain. Backporting rEFInd to
- that toolchain is theoretically possible, but I've not attempted
- it.
+ tools to build the main rEFInd binary, and Linux with the TianoCore
+ development kit for the drivers. rEFIt used an Intel/Microsoft
+ toolchain. Backporting rEFInd to that toolchain is theoretically
+ possible, but I've not attempted it.
- A
+ href="http://sourceforge.net/projects/refind/files/0.4.0/refind-bin-0.4.0.zip/download">A
binary zip file—Download this if you want to install
- rEFInd on an x86 or x86-64 computer and have no need to
- test rEFInd first by booting it on an optical disc. This zip file
- package includes both x86 (aka IA32) and x86-64 (aka
- x64, AMD64, or EM64T) versions of rEFInd. Which you install
- depends on your architecture, as described on the x86 or x86-64
+ computer and have no need to test rEFInd first by booting it on an
+ optical disc. This zip file package includes both x86 (aka IA32)
+ and x86-64 (aka x64, AMD64, or EM64T) versions of rEFInd.
+ Which you install depends on your architecture, as described on the Installing rEFInd page.
- A
+ href="http://sourceforge.net/projects/refind/files/0.4.0/refind-cd-0.4.0.zip/download">A
CD-R image file—This download contains the same files as
- the zip file, but you can burn it to a CD-R to test rEFInd without
- installing it first. (It boots on UEFI PCs, but fails on some older
- Macs.) If you like it, you can then copy the files from the CD-R to
- your hard disk. The files are named in such a way that the disc should
- boot on either 64-bit (x86-64) or 32-bit (x86) EFI
- computers. Note that there's a bug that causes rEFInd to complain about
- invalid parameters while scanning various directories. You can safely
- ignore this message, but you'll need to press a key to dismiss it. I've
- included an open source EFI shell program on this disc that's not
- included in the binary zip file, so that you can access an EFI shell
- from a bootable disc even if you don't have an EFI shell available from
- your regular hard disk. This can be an extremely valuable diagnostic
- tool if you know about about using an EFI shell.
+ the zip file, but you can burn it to a CD-R to test rEFInd (and its
+ filesystem drivers) without installing it first. (It boots on UEFI PCs,
+ but fails on some older Macs.) If you like it, you can then copy the
+ files from the CD-R to your hard disk. The files are named in such a
+ way that the disc should boot on either 64-bit (x86-64) or
+ 32-bit (x86) EFI computers. I've included an open source EFI
+ shell program on this disc that's not included in the binary zip file,
+ so that you can access an EFI shell from a bootable disc even if you
+ don't have an EFI shell available from your regular hard disk. This can
+ be an extremely valuable diagnostic tool if you know how to use an EFI
+ shell.
- Source code via
git—If you want to peruse the source code in your Web
diff --git a/docs/refind/index.html b/docs/refind/index.html
index f57dae9..7e79b57 100644
--- a/docs/refind/index.html
+++ b/docs/refind/index.html
@@ -15,7 +15,7 @@
href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com
Originally written: 3/14/2012; last Web page update:
-5/15/2012, referencing rEFInd 0.3.5
+5/20/2012, referencing rEFInd 0.4.0
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!
diff --git a/docs/refind/installing.html b/docs/refind/installing.html
index c68268f..0b28864 100644
--- a/docs/refind/installing.html
+++ b/docs/refind/installing.html
@@ -15,7 +15,7 @@
href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com
Originally written: 3/14/2012; last Web page update:
-5/15/2012, referencing rEFInd 0.3.5
+5/20/2012, referencing rEFInd 0.4.0
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!
@@ -92,7 +92,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com
-Once you've uncompressed a rEFInd binary zip file, you must install it to your computer's ESP (or conceivably to some other location). The details of how you do this depend on your OS and your computer (UEFI-based PC vs. Macintosh). The upcoming sections provide details. For Linux and Mac OS X, you can use the installation script, install.sh, which provides easy one-command installation on most systems. Occasionally this script will fail, though, so I also provide explicit instructions for Linux and Mac OS X. Installation under Windows also must be done manually. In some cases, you'll have to deviate from the default naming conventions, as described in a section on this topic. If you're upgrading rEFInd, see the section on upgrading. Finally, I describe how to install some additional components you might find useful.
+Once you've uncompressed a rEFInd binary zip file, you must install it to your computer's ESP (or conceivably to some other location). The details of how you do this depend on your OS and your computer (UEFI-based PC vs. Macintosh). The upcoming sections provide details. For Linux and Mac OS X, you can use the installation script, install.sh, which provides easy one-command installation on most systems. Occasionally this script will fail, though, so I also provide explicit instructions for Linux and Mac OS X. Installation under Windows also must be done manually. In some cases, you'll have to deviate from the default naming conventions, as described in a section on this topic. If you're upgrading rEFInd, see the section on upgrading. Finally, I describe how to install some additional components you might find useful. Note that this page describes installing the main rEFInd program; if you want to use the EFI filesystem drivers included with rEFInd, you should consult the page on using drivers with rEFInd.
Installing rEFInd Using install.sh under Linux or Mac OS X
@@ -198,12 +198,14 @@ Filesystem 1K-blocks Used Available Use% Mounted on
-- Type cp -r refind /boot/efi/EFI/ from the refind-version directory in which the refind directory exists. This copies all the files that rEFInd needs to work.
+- Type cp -r refind /boot/efi/EFI/ from the refind-version directory in which the refind directory exists. This copies all the files that rEFInd needs to work. Note that this includes all of rEFInd's drivers.
- Type cd /boot/efi/EFI/refind to change into rEFInd's new directory on the ESP.
- Type rm refind_ia32.efi to remove the IA32 binary if you're using an x86-64 (64-bit) system; or type rm refind_x64.efi to remove the x86-64 binary if you're using an x86 (32-bit) system. You can optionally rename the binary you keep as refind.efi, but this isn't required. (Note that you must keep the version that's the correct bit width for your EFI; if you've installed a 32-bit Linux on a 64-bit PC with a 64-bit EFI, you'd keep refind_x64.efi.
+- Optionally, type rm -r drivers_ia32 to remove the x86 drivers from an x86-64 system, or rm -r drivers_x64 to remove the x86-64 drivers from a 32-bit x86 system. You may also want to remove some or all of the drivers for the architecture you are using; if you don't need them, they'll slow down the start process. See the page on drivers for more on this topic.
+
- Rename the configuration file by typing mv refind.conf-sample refind.conf. Consult the Editing the rEFInd Configuration File page for information on how to adjust your options.
@@ -268,6 +270,15 @@ $ ioreg -l -p IODeviceTree | grep firmware-abi
64-bit EFI or sudo rm /efi/refind/refind_x64.efi on a
Mac with a 32-bit EFI.
+- Optionally, remove the drivers directory for the architecture you're
+ not using—/efi/refind/drivers_ia32 or
+ /efi/refind/drivers_x64, as appropriate. You may also want to
+ remove some or all of the drivers for the architecture you are using;
+ if you don't need them, they'll slow down the start process. See the page on drivers for more on this topic. Note
+ that Apple's firmware includes its own HFS+ driver, so the HFS+ driver
+ provided with rEFInd is useless on Macs.
+
- If this is your first installation, type sudo mv
/efi/refind/refind.conf-sample /efi/refind/refind.conf
(adjusting the path as necessary) to rename the sample configuration
@@ -322,6 +333,8 @@ $ ioreg -l -p IODeviceTree | grep firmware-abi
- Type del refind_ia32.efi to delete the unused 32-bit version of rEFInd. (Windows only supports EFI boots on 64-bit EFI implementations and in 64-bit versions of Windows.)
+- Optionally type rd /s drivers_ia32 to delete the drivers_ia32 directory and its contents. You may also want to selectively delete some of the drivers in the drivers_x64 directory, depending on your needs. Unnecessary drivers may slow the rEFInd start process. See the page on drivers for more on this topic.
+
- Type rename refind.conf-sample refind.conf to rename rEFInd's configuration file.
- Type bcdedit /set {bootmgr} path \EFI\refind\refind_x64.efi to set rEFInd as the default EFI boot program. Note that {bootmgr} is entered as such; that's not a notation for a variable.
@@ -428,10 +441,12 @@ $ ioreg -l -p IODeviceTree | grep firmware-abi
href="http://refit.sourceforge.net">original rEFIt package.
- Drivers—You can install drivers to extend the capabilities
- of the EFI. Most notably, filesystem drivers for ext2fs and ReiserFS
- are available. These can enable you to boot a Linux kernel with EFI
- stub support from an ext2fs, ext3fs, or ReiserFS partition. See the Using EFI Drivers page for more on this
+ of the EFI. rEFInd ships with filesystem drivers for ext2fs and
+ ReiserFS, which can enable you to boot a Linux kernel with EFI stub
+ support from an ext2fs, ext3fs, or ReiserFS partition. (rEFInd also
+ provides ISO-9660 and HFS+ drivers.) You can find additional drivers
+ from other sources, although they're still on the scarce side. See the
+ Using EFI Drivers page for more on this
topic.
diff --git a/docs/refind/linux.html b/docs/refind/linux.html
index f1b901d..d9b47d1 100644
--- a/docs/refind/linux.html
+++ b/docs/refind/linux.html
@@ -15,7 +15,7 @@
href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com
Originally written: 3/19/2012; last Web page update:
-5/15/2012, referencing rEFInd 0.3.5
+5/20/2012, referencing rEFInd 0.4.0
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!
@@ -133,7 +133,7 @@ another possibility.
will also scan for kernels without a .efi filename
extension. This option is not the default, though, because it can pick
up old kernels that lack EFI stub loader support and even non-kernel
- files, such as icon files named to give a kernel a unique icon.
+ files.
diff --git a/docs/refind/revisions.html b/docs/refind/revisions.html
index a72657c..8bac805 100644
--- a/docs/refind/revisions.html
+++ b/docs/refind/revisions.html
@@ -14,7 +14,7 @@
by Roderick W. Smith, rodsmith@rodsbooks.com
-Last Web page update: 5/15/2012
+Last Web page update: 5/20/2012
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!
@@ -93,6 +93,8 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com
+- 0.4.0 (5/20/2012)—I've bumped up this version number more than usual to reflect the addition of four filesystem drivers (for ext2fs, ReiserFS, HFS+, and ISO-9660) to the rEFInd package. These drivers originate with the original rEFIt, VirtualBox, and Clover boot loader projects. You can learn more on the drivers page. To facilitate inclusion of drivers on the CD image, rEFInd also now supports reading drivers from architecture-specific subdirectories—drivers_x64 and drivers_ia32 for x86-64 and x86 systems, respectively. This version also adds the ability to eject removable media on some Macs (this won't work on UEFI-based PCs, unfortunately). Finally, this version fixes a problem that could cause GRUB 2 to be unable to read its configuration file in some settings when launched from rEFInd.
+
- 0.3.5 (5/15/2012)—This version's biggest new feature is the ability to re-scan for boot loaders after launching the program. This is done by pressing the Esc key, which causes rEFInd to re-read its configuration file, to tell the EFI to reconnect all disks, and to do a fresh scan of all disks for loaders. This is useful if you insert a removable disk after starting the computer, if rEFInd starts before a disk has fully settled, if you make a change to the configuration file, or if you manually load a driver. This version also fixes a minor bug that could cause the scroll-right arrow to be replaced with a left-pointing arrow under some circumstances; and I've removed the scan for a BIOS Boot Partition that I added in 0.3.2, since I'm told it isn't launching correctly. (BIOS-mode GRUB 2 can still be launched on Macs from its boot code in the MBR.)
- 0.3.4 (5/9/2012)—The biggest change to this version is the addition of the icons_dir configuration file token, which enables you to specify a directory that holds icons that override those in the default icons subdirectory. See the Theming rEFInd and Configuring the Boot Manager pages for details. This version also reduces flicker when moving your selection around the screen and modifies the install.sh script so that it can be used directly after building rEFInd from source code. Related to this, building from source now creates a binary that includes an architecture code—refind_ia32.efi or refind_x64.efi rather than refind.efi.
diff --git a/docs/refind/themes.html b/docs/refind/themes.html
index ef18fb6..9daac49 100644
--- a/docs/refind/themes.html
+++ b/docs/refind/themes.html
@@ -15,7 +15,7 @@
href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com
Originally written: 4/19/2012; last Web page update:
-5/15/2012, referencing rEFInd 0.3.5
+5/20/2012, referencing rEFInd 0.4.0
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!
diff --git a/docs/refind/todo.html b/docs/refind/todo.html
index 61510f3..03bac98 100644
--- a/docs/refind/todo.html
+++ b/docs/refind/todo.html
@@ -15,7 +15,7 @@
href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com
Originally written: 3/14/2012; last Web page update:
-5/15/2012, referencing rEFInd 0.3.5
+5/20/2012, referencing rEFInd 0.4.0
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!
@@ -94,132 +94,198 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com
This page exists to document some of rEFInd's known bugs and limitations, as well as features I hope to add in the future. Some of the items on this list are things that you may be able to help with, so if you'd like to contribute, feel free to drop me a line!
-Without further ado, then, and in no particular order:
+The following list groups things that need to be done into broad categories. In some cases, there's some ambiguity about how an item might best be classified. Without further ado, then:
-- Testing! rEFIt was complex enough that changes such as the ones I've
- made have the potential to disrupt the program's operation in
- unexpected ways. Since the initial 0.2.0 release, I've continued to add
- features to rEFInd, and every new feature is another way for bugs to
- get into the program. I can only test on a handful of systems with a
- limited number of configurations. Therefore, if you try rEFInd and run
- into bugs, please report them to me!
-
-- Currently, rEFInd can detect whether it's compiled for x86 or
- x86-64 systems and displays this information in its "About"
- screen (AboutrEFInd() in main.c). I'd like to add detection for Itanium
- and ARM systems, but I have no way to test such changes.
-
-- I have little talent with graphics manipulation programs, so rEFInd's
- boot logo, such as it is, is pretty weak. If you have artistic talent
- and would like to create a rEFInd logo, please feel free to send it to
- me. I won't make any final decision about changes until at least June
- 30 of 2012.
-
-- rEFIt's original design, and hence rEFInd's design, enables easy
- theming by replacing icon files. If you'd like to design a new theme
- for rEFInd, feel free to submit it. I might or might not replace the
- icons it uses now (most of which come from the Oxygen Icons package),
- but I may provide links to themes on this Web site (or even host them
- on the project's Sourceforge page). For more information on designing
- themes for rEFInd, see the Theming rEFInd
- page.
-
-- The code could be more flexible in its handling of the sizes of various
- graphical elements, and particularly drawn text. Prior to version
- 0.2.2, submenu text was invisible on UEFI-based PCs with 800x600 and
- smaller displays because of an inability to properly crop the graphics
- fields that hold the text. With version 0.2.2, I've put a band-aid on
- this problem by reducing the field size so that it now works on 800x600
- displays, but smaller displays still suffer from this problem. This is
- just an example of the inflexibility of certain layout issues within
- rEFInd.
-
-- Although the ICNS file format used by rEFInd supports multiple image
- sizes, if a size that rEFInd needs isn't present in the file, rEFInd
- can't use the icon. The ability to scale images to the desired size
- would be useful.
-
-- EFI supports network boots. rEFInd doesn't, but it would be nice if it
- would.
-
-- I would like to be able to specify the volume on which a boot loader
- resides using a partition GUID value, but extracting a GUID from the
- partition data is harder than extracting the volume's label or counting
- up the filesystem numbers.
-
-- It would be useful to be able to specify paths to boot loaders and/or
- initial RAM disks relative to the rEFInd directory (or the boot
- loader's directory, in the case of initrds).
-
-- There's currently no way to create a manual boot stanza for a
- BIOS-booted OS. This isn't a big priority for me personally, but I can
- see how it could be for some people.
-
-- I'd like to find a way to get rEFInd to launch BIOS boot loaders on
- UEFI-based systems. This option currently works only on Macs—or
- at least, I've not gotten it to work on any of my UEFI-based PCs. (I've
- done some experiments to try to get this to work, but so far without
- success. If you'd like to help on this, e-mail me for my
- thoughts.)
-
-- The Gigabyte Hybrid
- EFI has a bug that causes the allegedly case-insensitive
- StriCmp() function to perform a case-sensitive comparison.
- This causes any number of bugs in file matching. For instance: Changing
- the case of icon filename extensions (or various other parts of icon
- filenames) causes icons to be replaced by ugly "generic" ones; and
- rEFInd sometimes appears in its own menu (the firmware sometimes
- returns an all-caps version of the filename, but other times returns
- the filename with the correct case, causing a mismatch if the path
- includes lowercase elements). Some of these problems can be overcome by
- converting both strings to be compared to one case before doing the
- comparison, but others aren't so easy, since I think StriCmp()
- is being called internally to the EFI. In any event, it'd be nice to
- fix some of these problems. OTOH, this is a workaround for a bug on
- just one EFI implementation, and a dismal one at that, so I'm inclined
- to just let it go.
-
-- I've received queries about rEFInd's ability to work with Apple's
- whole-disk encryption scheme that's new with OS X 10.7. Unfortunately,
- I lack the hardware to test this, but my understanding is that it will
- work correctly if rEFInd is installed in the ESP rather than on
- the Mac OS X root partition. See this
- forum thread for more information.
-
-- The Shutdown option works correctly on Macs, but not on UEFI-based PCs.
- On such systems, Shutdown reboots the computer. This should be
- fixed.
-
-- I'd like to find a way to enable users to enter customizations for boot
- options and then save them to the refind.conf file.
-
-- It should be possible to override specific auto-detected boot loader
- settings—say, to disable one specific boot loader or change its
- icon.
-
-- A way to read boot options set via efibootmgr, bless,
- or similar options from NVRAM to add to the boot set would be
- useful.
-
-- A way to examine and change the NVRAM settings could be useful. This
- would enable a CD-based boot of rEFInd to fix a broken disk boot.
- Perhaps this could be done via a separate tool that could be launched
- much like the shell or gptsync.
-
-- The media-ejection feature (F12) should be extended to work on
- UEFI-based PCs and early Macs. At the moment, it relies on an
- Apple-specific EFI extension, and I know of no standard EFI way to do
- it.
-
-- I'd like to give the user the ability to set custom options on a
- single-boot basis, similar to what's possible in GRUB.
-
-- The code is in need of review to search for memory leaks and similar
- problems.
+
- Tasks with which non-programmers can help:
+
+
+
+ - Testing! rEFIt was complex enough that changes such as the ones
+ I've made have the potential to disrupt the program's operation in
+ unexpected ways. Since the initial 0.2.0 release, I've continued to
+ add features to rEFInd, and every new feature is another way for
+ bugs to get into the program. I can only test on a handful of
+ systems with a limited number of configurations. Therefore, if you
+ try rEFInd and run into bugs, please report them to me!
+
+ - I have little talent with graphics manipulation programs, so
+ rEFInd's boot logo, such as it is, is pretty weak. If you have
+ artistic talent and would like to create a rEFInd logo, please feel
+ free to send it to me. I won't make any final decision about
+ changes until at least June 30 of 2012.
+
+ - rEFIt's original design, and hence rEFInd's design, enables easy
+ theming by replacing icon files. If you'd like to design a new
+ theme for rEFInd, feel free to submit it. I might or might not
+ replace the icons it uses now (most of which come from the Oxygen
+ Icons package), but I may provide links to themes on this Web site
+ (or even host them on the project's Sourceforge page). For more
+ information on designing themes for rEFInd, see the Theming rEFInd page.
+
+
+
+- Improvements to existing features:
+
+
+
+ - Currently, rEFInd can detect whether it's compiled for x86
+ or x86-64 systems and displays this information in its
+ "About" screen (AboutrEFInd() in main.c). I'd
+ like to add detection for Itanium and ARM systems, but I have no
+ way to test such changes.
+
+ - The code could be more flexible in its handling of the sizes of
+ various graphical elements, and particularly drawn text. Prior to
+ version 0.2.2, submenu text was invisible on UEFI-based PCs with
+ 800x600 and smaller displays because of an inability to properly
+ crop the graphics fields that hold the text. With version 0.2.2,
+ I've put a band-aid on this problem by reducing the field size so
+ that it now works on 800x600 displays, but smaller displays still
+ suffer from this problem. This is just an example of the
+ inflexibility of certain layout issues within rEFInd.
+
+ - Although the ICNS file format used by rEFInd supports multiple
+ image sizes, if a size that rEFInd needs isn't present in the file,
+ rEFInd can't use the icon. The ability to scale images to the
+ desired size would be useful.
+
+ - I would like to be able to specify the volume on which a boot
+ loader resides using a partition GUID value, but extracting a GUID
+ from the partition data is harder than extracting the volume's
+ label or counting up the filesystem numbers.
+
+ - It would be useful to be able to specify paths to boot loaders
+ and/or initial RAM disks relative to the rEFInd directory (or the
+ boot loader's directory, in the case of initrds).
+
+
+
+- Known bugs that need squashing:
+
+
+
+ - I'd like to find a way to get rEFInd to launch BIOS boot loaders on
+ UEFI-based systems. This option currently works only on
+ Macs—or at least, I've not gotten it to work on any of my
+ UEFI-based PCs. (I've done some experiments to try to get this to
+ work, but so far without success. If you'd like to help on this, e-mail me for my
+ thoughts.)
+
+ - The Gigabyte
+ Hybrid EFI has a bug that causes the allegedly case-insensitive
+ StriCmp() function to perform a case-sensitive comparison.
+ This causes any number of bugs in file matching. For instance:
+ Changing the case of icon filename extensions (or various other
+ parts of icon filenames) causes icons to be replaced by ugly
+ "generic" ones; and rEFInd sometimes appears in its own menu (the
+ firmware sometimes returns an all-caps version of the filename, but
+ other times returns the filename with the correct case, causing a
+ mismatch if the path includes lowercase elements). Some of these
+ problems can be overcome by converting both strings to be compared
+ to one case before doing the comparison, but others aren't so easy,
+ since I think StriCmp() is being called internally to the
+ EFI. In any event, it'd be nice to fix some of these problems.
+ OTOH, this is a workaround for a bug on just one EFI
+ implementation, and a dismal one at that, so I'm inclined to just
+ let it go.
+
+ - The Shutdown option works correctly on Macs, but not on UEFI-based PCs.
+ On such systems, Shutdown reboots the computer. This should be
+ fixed.
+
+ - The media-ejection feature (F12) should be extended to work on
+ UEFI-based PCs and early Macs. At the moment, it relies on an
+ Apple-specific EFI extension, and I know of no standard EFI way to
+ do it.
+
+ - The code is in need of review to search for memory leaks and
+ similar problems.
+
+
+
+- New features I'd like to add:
+
+
+
+ - EFI supports network boots. rEFInd doesn't, but it would be nice if
+ it would.
+
+ - There's currently no way to create a manual boot stanza for a
+ BIOS-booted OS. This isn't a big priority for me personally, but I
+ can see how it could be for some people.
+
+ - I've received queries about rEFInd's ability to work with Apple's
+ whole-disk encryption scheme that's new with OS X 10.7.
+ Unfortunately, I lack the hardware to test this, but my
+ understanding is that it will work correctly if rEFInd is
+ installed in the ESP rather than on the Mac OS X root partition.
+ See this
+ forum thread for more information.
+
+ - I'd like to find a way to enable users to enter customizations for
+ boot options and then save them to the refind.conf
+ file.
+
+ - It should be possible to override specific auto-detected boot
+ loader settings—say, to disable one specific boot loader or
+ change its icon.
+
+ - A way to read boot options set via efibootmgr,
+ bless, or similar options from NVRAM to add to the boot
+ set would be useful.
+
+ - A way to examine and change the NVRAM settings could be useful.
+ This would enable a CD-based boot of rEFInd to fix a broken disk
+ boot. Perhaps this could be done via a separate tool that could be
+ launched much like the shell or gptsync.
+
+ - I'd like to give the user the ability to set custom options on a
+ single-boot basis, similar to what's possible in GRUB.
+
+
+
+ - Improvements to the EFI drivers:
+
+
+
+ - The drivers I've built fail to load on a 32-bit Mac Mini; I get an
+ "incompatible version" error message at an EFI shell, or an error
+ code of 80000019 when rEFInd tries to load them. (These two
+ messages are equivalent.) I suspect the problem is related to the
+ EFI version 1.x used on the Mac, as opposed to UEFI
+ 2.x used on PCs. I'm looking into the problem. In the
+ meantime, if you have this problem, I recommend tracking down
+ equivalent drivers from other sources. (See the drivers page for some pointers.) I'd
+ appreciate hearing from
+ you if you have problems along these lines. Please tell me what
+ type of computer you're using, and especially the firmware version
+ data (from rEFInd's "about" screen). This may help me narrow down
+ the cause.
+
+ - Drivers for additional filesystems are required. Given the recent
+ shift to ext4fs, that should be the priority; however, other Linux
+ filesystems, UDF, and perhaps others would all be welcome
+ additions. Also along these lines, adding drivers for Linux LVM and
+ RAID setups would be useful, too.
+
+ - As detailed on the drivers page, there
+ are performance issues with the drivers on some systems. I suspect
+ that most "real" computers aren't greatly affected (in my tests,
+ the problem is worst with VirtualBox, and the next worst is a
+ system that uses DUET). Nonetheless,
+ I'd like to track down the cause and fix it.
+
+
- The driver installation procedure could be improved, perhaps by
+ adding support for drivers to the install.sh script.
+
+
diff --git a/docs/refind/using.html b/docs/refind/using.html
index b1bc47f..4d62aa1 100644
--- a/docs/refind/using.html
+++ b/docs/refind/using.html
@@ -15,7 +15,7 @@
href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com
Originally written: 3/14/2012; last Web page update:
-5/15/2012, referencing rEFInd 0.3.5
+5/20/2012, referencing rEFInd 0.4.0
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!
diff --git a/filesystems/Make.common b/filesystems/Make.common
index 99b165a..f636bad 100644
--- a/filesystems/Make.common
+++ b/filesystems/Make.common
@@ -23,7 +23,7 @@ endif
EDK2BASE = /usr/local/UDK2010/MyWorkSpace
-# Below file defines TARGET (RELEASE or DEBUG), TARGET_ARCH (X64 or IA32), and TOOL_CHAIN_TAG (GCC45, GCC46, or GCC47)
+# Below file defines TARGET (RELEASE or DEBUG), TARGET_ARCH (X64 or IA32), and TOOL_CHAIN_TAG (GCC44, GCC45, GCC46, or GCC47)
include $(EDK2BASE)/Conf/target.txt
EFIINC = $(EDK2BASE)/MdePkg/Include/
@@ -101,9 +101,6 @@ LIBS = $(shell $(CC) $(ARCH3264) -print-libgcc-file-name)
%.o: %.c
$(CC) $(CPPFLAGS) $(ARCH_C_FLAGS) $(CFLAGS) $(INCLUDE_DIRS) -DFSTYPE=$(DRIVERNAME) -c $< -o $@
-FORMAT = efi-bsdrv-$(ARCH)
-
-
ifneq (,$(filter %.efi,$(BUILDME)))
SHLIB_TARGET = $(subst .efi,.lib,$(BUILDME))
@@ -118,24 +115,10 @@ $(BUILDME): $(DLL_TARGET)
$(OBJCOPY) --strip-unneeded $(DLL_TARGET)
$(OBJCOPY) $(DLL_TARGET)
$(GENFW) -e UEFI_DRIVER -o $(BUILDME) $(DLL_TARGET)
- mkdir -p ../fs-drivers
- cp $(BUILDME) ../fs-drivers
+ mkdir -p ../drivers
+ cp $(BUILDME) ../drivers
# $(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic -j .dynsym -j .rel \
-# -j .rela -j .reloc --target=$(FORMAT) $< $@
-
-endif
-
-# rules for libraries
-
-ifneq (,$(filter %.a,$(BUILDME)))
+# -j .rela -j .reloc --target=efi-bsdrv-$(ARCH) $< $@
endif
-# utility rules
-
-clean:
- rm -f $(BUILDME) *~ *.so $(OBJS) *.efi *.lib *.dll
-
-
-
-# EOF
diff --git a/filesystems/Makefile b/filesystems/Makefile
index d4f0b6c..de697bf 100644
--- a/filesystems/Makefile
+++ b/filesystems/Makefile
@@ -8,9 +8,9 @@
INSTALL_DIR = /boot/efi/EFI/refind/drivers
-all: ext2fs reiserfs iso9660 hfs
+all: ext2 reiserfs iso9660 hfs
-ext2fs:
+ext2:
rm -f fsw_efi.o
make DRIVERNAME=ext2 -f Make.common
diff --git a/filesystems/fsw_efi.c b/filesystems/fsw_efi.c
index e7d2400..2f5a4c6 100644
--- a/filesystems/fsw_efi.c
+++ b/filesystems/fsw_efi.c
@@ -77,7 +77,7 @@
/** Helper macro for stringification. */
#define FSW_EFI_STRINGIFY(x) #x
/** Expands to the EFI driver name given the file system type name. */
-#define FSW_EFI_DRIVER_NAME(t) L"Fsw " FSW_EFI_STRINGIFY(t) L" File System Driver"
+#define FSW_EFI_DRIVER_NAME(t) L"rEFInd 0.4.0 " FSW_EFI_STRINGIFY(t) L" File System Driver"
// function prototypes
diff --git a/filesystems/test/.svn/all-wcprops b/filesystems/test/.svn/all-wcprops
deleted file mode 100644
index 1c8e48f..0000000
--- a/filesystems/test/.svn/all-wcprops
+++ /dev/null
@@ -1,41 +0,0 @@
-K 25
-svn:wc:ra_dav:version-url
-V 48
-/svnroot/cloverefiboot/!svn/ver/1/VBoxFsDxe/test
-END
-fsw_posix_base.h
-K 25
-svn:wc:ra_dav:version-url
-V 65
-/svnroot/cloverefiboot/!svn/ver/1/VBoxFsDxe/test/fsw_posix_base.h
-END
-fsw_posix.c
-K 25
-svn:wc:ra_dav:version-url
-V 60
-/svnroot/cloverefiboot/!svn/ver/1/VBoxFsDxe/test/fsw_posix.c
-END
-lsroot.c
-K 25
-svn:wc:ra_dav:version-url
-V 57
-/svnroot/cloverefiboot/!svn/ver/1/VBoxFsDxe/test/lsroot.c
-END
-fsw_posix.h
-K 25
-svn:wc:ra_dav:version-url
-V 60
-/svnroot/cloverefiboot/!svn/ver/1/VBoxFsDxe/test/fsw_posix.h
-END
-README
-K 25
-svn:wc:ra_dav:version-url
-V 55
-/svnroot/cloverefiboot/!svn/ver/1/VBoxFsDxe/test/README
-END
-lslr.c
-K 25
-svn:wc:ra_dav:version-url
-V 55
-/svnroot/cloverefiboot/!svn/ver/1/VBoxFsDxe/test/lslr.c
-END
diff --git a/filesystems/test/.svn/entries b/filesystems/test/.svn/entries
deleted file mode 100644
index f594e04..0000000
--- a/filesystems/test/.svn/entries
+++ /dev/null
@@ -1,232 +0,0 @@
-10
-
-dir
-432
-https://cloverefiboot.svn.sourceforge.net/svnroot/cloverefiboot/VBoxFsDxe/test
-https://cloverefiboot.svn.sourceforge.net/svnroot/cloverefiboot
-
-
-
-2011-04-04T13:39:25.410063Z
-1
-slice2009
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-0f885799-303c-4bf3-9050-968124707f2f
-
-fsw_posix_base.h
-file
-
-
-
-
-2012-05-15T01:06:34.000000Z
-17516f05bd8d1ca74803cd8e1bc8b20f
-2011-04-04T13:39:25.410063Z
-1
-slice2009
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-2920
-
-fsw_posix.c
-file
-
-
-
-
-2012-05-15T01:06:34.000000Z
-c847b0b03df254cb7f31e25315063957
-2011-04-04T13:39:25.410063Z
-1
-slice2009
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-13763
-
-lsroot.c
-file
-
-
-
-
-2012-05-15T01:06:34.000000Z
-55a5a9b6c4ec0b2f6ee39d14ec82b276
-2011-04-04T13:39:25.410063Z
-1
-slice2009
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-2807
-
-fsw_posix.h
-file
-
-
-
-
-2012-05-15T01:06:34.000000Z
-cbfe2e553a18fcb978b5ebfd3a06def1
-2011-04-04T13:39:25.410063Z
-1
-slice2009
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-3297
-
-README
-file
-
-
-
-
-2012-05-15T01:06:34.000000Z
-9fbd16e1fb2413b7e0780f603f26de91
-2011-04-04T13:39:25.410063Z
-1
-slice2009
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-134
-
-lslr.c
-file
-
-
-
-
-2012-05-15T01:06:34.000000Z
-a26b88236b0a0e7bfbb2adaa5d4836f4
-2011-04-04T13:39:25.410063Z
-1
-slice2009
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-4059
-
diff --git a/filesystems/test/.svn/text-base/README.svn-base b/filesystems/test/.svn/text-base/README.svn-base
deleted file mode 100644
index c7c34e4..0000000
--- a/filesystems/test/.svn/text-base/README.svn-base
+++ /dev/null
@@ -1,2 +0,0 @@
-This folder contains tests for VBoxFsDxe module, allowing up
-and test filesystems without EFI environment and launching whole VBox.
diff --git a/filesystems/test/.svn/text-base/fsw_posix.c.svn-base b/filesystems/test/.svn/text-base/fsw_posix.c.svn-base
deleted file mode 100644
index eee8c5f..0000000
--- a/filesystems/test/.svn/text-base/fsw_posix.c.svn-base
+++ /dev/null
@@ -1,479 +0,0 @@
-/**
- * \file fsw_posix.c
- * POSIX user space host environment code.
- */
-
-/*-
- * Copyright (c) 2006 Christoph Pfisterer
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the
- * distribution.
- *
- * * Neither the name of Christoph Pfisterer nor the names of the
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "fsw_posix.h"
-
-
-#ifndef FSTYPE
-/** The file system type name to use. */
-#define FSTYPE ext2
-#endif
-
-
-// function prototypes
-
-fsw_status_t fsw_posix_open_dno(struct fsw_posix_volume *pvol, const char *path, int required_type,
- struct fsw_shandle *shand);
-
-void fsw_posix_change_blocksize(struct fsw_volume *vol,
- fsw_u32 old_phys_blocksize, fsw_u32 old_log_blocksize,
- fsw_u32 new_phys_blocksize, fsw_u32 new_log_blocksize);
-fsw_status_t fsw_posix_read_block(struct fsw_volume *vol, fsw_u32 phys_bno, void *buffer);
-
-/**
- * Dispatch table for our FSW host driver.
- */
-
-struct fsw_host_table fsw_posix_host_table = {
- FSW_STRING_TYPE_ISO88591,
-
- fsw_posix_change_blocksize,
- fsw_posix_read_block
-};
-
-extern struct fsw_fstype_table FSW_FSTYPE_TABLE_NAME(FSTYPE);
-
-
-/**
- * Mount function.
- */
-
-struct fsw_posix_volume * fsw_posix_mount(const char *path, struct fsw_fstype_table *fstype_table)
-{
- fsw_status_t status;
- struct fsw_posix_volume *pvol;
-
- // allocate volume structure
- status = fsw_alloc_zero(sizeof(struct fsw_posix_volume), (void **)&pvol);
- if (status)
- return NULL;
- pvol->fd = -1;
-
- // open underlying file/device
- pvol->fd = open(path, O_RDONLY, 0);
- if (pvol->fd < 0) {
- fprintf(stderr, "fsw_posix_mount: %s: %s\n", path, strerror(errno));
- fsw_free(pvol);
- return NULL;
- }
-
- // mount the filesystem
- if (fstype_table == NULL)
- fstype_table = &FSW_FSTYPE_TABLE_NAME(FSTYPE);
- status = fsw_mount(pvol, &fsw_posix_host_table, fstype_table, &pvol->vol);
- if (status) {
- fprintf(stderr, "fsw_posix_mount: fsw_mount returned %d\n", status);
- fsw_free(pvol);
- return NULL;
- }
-
- return pvol;
-}
-
-/**
- * Unmount function.
- */
-
-int fsw_posix_unmount(struct fsw_posix_volume *pvol)
-{
- if (pvol->vol != NULL)
- fsw_unmount(pvol->vol);
- fsw_free(pvol);
- return 0;
-}
-
-/**
- * Open a named regular file.
- */
-
-struct fsw_posix_file * fsw_posix_open(struct fsw_posix_volume *pvol, const char *path, int flags, mode_t mode)
-{
- fsw_status_t status;
- struct fsw_posix_file *file;
-
- // TODO: check flags for unwanted values
-
- // allocate file structure
- status = fsw_alloc(sizeof(struct fsw_posix_file), &file);
- if (status)
- return NULL;
- file->pvol = pvol;
-
- // open the file
- status = fsw_posix_open_dno(pvol, path, FSW_DNODE_TYPE_FILE, &file->shand);
- if (status) {
- fprintf(stderr, "fsw_posix_open: open_dno returned %d\n", status);
- fsw_free(file);
- return NULL;
- }
-
- return file;
-}
-
-/**
- * Read data from a regular file.
- */
-
-ssize_t fsw_posix_read(struct fsw_posix_file *file, void *buf, size_t nbytes)
-{
- fsw_status_t status;
- fsw_u32 buffer_size;
-
- buffer_size = nbytes;
- status = fsw_shandle_read(&file->shand, &buffer_size, buf);
- if (status)
- return -1;
- return buffer_size;
-}
-
-/**
- * Change position within a regular file.
- */
-
-off_t fsw_posix_lseek(struct fsw_posix_file *file, off_t offset, int whence)
-{
- fsw_u64 base_offset = 0;
-
- // get base offset
- base_offset = 0;
- if (whence == SEEK_CUR)
- base_offset = file->shand.pos;
- else if (whence == SEEK_END)
- base_offset = file->shand.dnode->size;
-
- // calculate new offset, prevent seeks before the start of the file
- if (offset < 0 && -offset > base_offset)
- file->shand.pos = 0;
- else
- file->shand.pos = base_offset + offset;
-
- return file->shand.pos;
-}
-
-/**
- * Close a regular file.
- */
-
-int fsw_posix_close(struct fsw_posix_file *file)
-{
- fsw_shandle_close(&file->shand);
- fsw_free(file);
- return 0;
-}
-
-/**
- * Open a directory for iteration.
- */
-
-struct fsw_posix_dir * fsw_posix_opendir(struct fsw_posix_volume *pvol, const char *path)
-{
- fsw_status_t status;
- struct fsw_posix_dir *dir;
-
- // allocate file structure
- status = fsw_alloc(sizeof(struct fsw_posix_dir), &dir);
- if (status)
- return NULL;
- dir->pvol = pvol;
-
- // open the directory
- status = fsw_posix_open_dno(pvol, path, FSW_DNODE_TYPE_DIR, &dir->shand);
- if (status) {
- fprintf(stderr, "fsw_posix_opendir: open_dno returned %d\n", status);
- fsw_free(dir);
- return NULL;
- }
-
- return dir;
-}
-
-/**
- * Read the next entry from a directory.
- */
-
-struct dirent * fsw_posix_readdir(struct fsw_posix_dir *dir)
-{
- fsw_status_t status;
- struct fsw_dnode *dno;
- static struct dirent dent;
-
- // get next entry from file system
- status = fsw_dnode_dir_read(&dir->shand, &dno);
- if (status) {
- if (status != 4)
- fprintf(stderr, "fsw_posix_readdir: fsw_dnode_dir_read returned %d\n", status);
- return NULL;
- }
- status = fsw_dnode_fill(dno);
- if (status) {
- fprintf(stderr, "fsw_posix_readdir: fsw_dnode_fill returned %d\n", status);
- fsw_dnode_release(dno);
- return NULL;
- }
-
- // fill dirent structure
- dent.d_fileno = dno->dnode_id;
- dent.d_reclen = 8 + dno->name.size + 1;
- switch (dno->type) {
- case FSW_DNODE_TYPE_FILE:
- dent.d_type = DT_REG;
- break;
- case FSW_DNODE_TYPE_DIR:
- dent.d_type = DT_DIR;
- break;
- case FSW_DNODE_TYPE_SYMLINK:
- dent.d_type = DT_LNK;
- break;
- default:
- dent.d_type = DT_UNKNOWN;
- break;
- }
-#if 0
- dent.d_namlen = dno->name.size;
-#endif
- memcpy(dent.d_name, dno->name.data, dno->name.size);
- dent.d_name[dno->name.size] = 0;
-
- return &dent;
-}
-
-/**
- * Rewind a directory to the start.
- */
-
-void fsw_posix_rewinddir(struct fsw_posix_dir *dir)
-{
- dir->shand.pos = 0;
-}
-
-/**
- * Close a directory.
- */
-
-int fsw_posix_closedir(struct fsw_posix_dir *dir)
-{
- fsw_shandle_close(&dir->shand);
- fsw_free(dir);
- return 0;
-}
-
-/**
- * Open a shand of a required type by path.
- */
-
-fsw_status_t fsw_posix_open_dno(struct fsw_posix_volume *pvol, const char *path, int required_type, struct fsw_shandle *shand)
-{
- fsw_status_t status;
- struct fsw_dnode *dno;
- struct fsw_dnode *target_dno;
- struct fsw_string lookup_path;
-
- lookup_path.type = FSW_STRING_TYPE_ISO88591;
- lookup_path.len = strlen(path);
- lookup_path.size = lookup_path.len;
- lookup_path.data = (void *)path;
-
- // resolve the path (symlinks along the way are automatically resolved)
- status = fsw_dnode_lookup_path(pvol->vol->root, &lookup_path, '/', &dno);
- if (status) {
- fprintf(stderr, "fsw_posix_open_dno: fsw_dnode_lookup_path returned %d\n", status);
- return status;
- }
-
- // if the final node is a symlink, also resolve it
- status = fsw_dnode_resolve(dno, &target_dno);
- fsw_dnode_release(dno);
- if (status) {
- fprintf(stderr, "fsw_posix_open_dno: fsw_dnode_resolve returned %d\n", status);
- return status;
- }
- dno = target_dno;
-
- // check that it is a regular file
- status = fsw_dnode_fill(dno);
- if (status) {
- fprintf(stderr, "fsw_posix_open_dno: fsw_dnode_fill returned %d\n", status);
- fsw_dnode_release(dno);
- return status;
- }
- if (dno->type != required_type) {
- fprintf(stderr, "fsw_posix_open_dno: dnode is not of the requested type\n");
- fsw_dnode_release(dno);
- return FSW_UNSUPPORTED;
- }
-
- // open shandle
- status = fsw_shandle_open(dno, shand);
- if (status) {
- fprintf(stderr, "fsw_posix_open_dno: fsw_shandle_open returned %d\n", status);
- }
- fsw_dnode_release(dno);
- return status;
-}
-
-/**
- * FSW interface function for block size changes. This function is called by the FSW core
- * when the file system driver changes the block sizes for the volume.
- */
-
-void fsw_posix_change_blocksize(struct fsw_volume *vol,
- fsw_u32 old_phys_blocksize, fsw_u32 old_log_blocksize,
- fsw_u32 new_phys_blocksize, fsw_u32 new_log_blocksize)
-{
- // nothing to do
-}
-
-/**
- * FSW interface function to read data blocks. This function is called by the FSW core
- * to read a block of data from the device. The buffer is allocated by the core code.
- */
-
-fsw_status_t fsw_posix_read_block(struct fsw_volume *vol, fsw_u32 phys_bno, void *buffer)
-{
- struct fsw_posix_volume *pvol = (struct fsw_posix_volume *)vol->host_data;
- off_t block_offset, seek_result;
- ssize_t read_result;
-
- FSW_MSG_DEBUGV((FSW_MSGSTR("fsw_posix_read_block: %d (%d)\n"), phys_bno, vol->phys_blocksize));
-
- // read from disk
- block_offset = (off_t)phys_bno * vol->phys_blocksize;
- seek_result = lseek(pvol->fd, block_offset, SEEK_SET);
- if (seek_result != block_offset)
- return FSW_IO_ERROR;
- read_result = read(pvol->fd, buffer, vol->phys_blocksize);
- if (read_result != vol->phys_blocksize)
- return FSW_IO_ERROR;
-
- return FSW_SUCCESS;
-}
-
-
-/**
- * Time mapping callback for the fsw_dnode_stat call. This function converts
- * a Posix style timestamp into an EFI_TIME structure and writes it to the
- * appropriate member of the EFI_FILE_INFO structure that we're filling.
- */
-
-/*
-static void fsw_posix_store_time_posix(struct fsw_dnode_stat *sb, int which, fsw_u32 posix_time)
-{
- EFI_FILE_INFO *FileInfo = (EFI_FILE_INFO *)sb->host_data;
-
- if (which == FSW_DNODE_STAT_CTIME)
- fsw_posix_decode_time(&FileInfo->CreateTime, posix_time);
- else if (which == FSW_DNODE_STAT_MTIME)
- fsw_posix_decode_time(&FileInfo->ModificationTime, posix_time);
- else if (which == FSW_DNODE_STAT_ATIME)
- fsw_posix_decode_time(&FileInfo->LastAccessTime, posix_time);
-}
-*/
-
-/**
- * Mode mapping callback for the fsw_dnode_stat call. This function looks at
- * the Posix mode passed by the file system driver and makes appropriate
- * adjustments to the EFI_FILE_INFO structure that we're filling.
- */
-
-/*
-static void fsw_posix_store_attr_posix(struct fsw_dnode_stat *sb, fsw_u16 posix_mode)
-{
- EFI_FILE_INFO *FileInfo = (EFI_FILE_INFO *)sb->host_data;
-
- if ((posix_mode & S_IWUSR) == 0)
- FileInfo->Attribute |= EFI_FILE_READ_ONLY;
-}
-*/
-
-/**
- * Common function to fill an EFI_FILE_INFO with information about a dnode.
- */
-
-/*
-EFI_STATUS fsw_posix_dnode_fill_FileInfo(IN FSW_VOLUME_DATA *Volume,
- IN struct fsw_dnode *dno,
- IN OUT UINTN *BufferSize,
- OUT VOID *Buffer)
-{
- EFI_STATUS Status;
- EFI_FILE_INFO *FileInfo;
- UINTN RequiredSize;
- struct fsw_dnode_stat sb;
-
- // make sure the dnode has complete info
- Status = fsw_posix_map_status(fsw_dnode_fill(dno), Volume);
- if (EFI_ERROR(Status))
- return Status;
-
- // TODO: check/assert that the dno's name is in UTF16
-
- // check buffer size
- RequiredSize = SIZE_OF_EFI_FILE_INFO + fsw_posix_strsize(&dno->name);
- if (*BufferSize < RequiredSize) {
- // TODO: wind back the directory in this case
-
- *BufferSize = RequiredSize;
- return EFI_BUFFER_TOO_SMALL;
- }
-
- // fill structure
- ZeroMem(Buffer, RequiredSize);
- FileInfo = (EFI_FILE_INFO *)Buffer;
- FileInfo->Size = RequiredSize;
- FileInfo->FileSize = dno->size;
- FileInfo->Attribute = 0;
- if (dno->type == FSW_DNODE_TYPE_DIR)
- FileInfo->Attribute |= EFI_FILE_DIRECTORY;
- fsw_posix_strcpy(FileInfo->FileName, &dno->name);
-
- // get the missing info from the fs driver
- ZeroMem(&sb, sizeof(struct fsw_dnode_stat));
- sb.store_time_posix = fsw_posix_store_time_posix;
- sb.store_attr_posix = fsw_posix_store_attr_posix;
- sb.host_data = FileInfo;
- Status = fsw_posix_map_status(fsw_dnode_stat(dno, &sb), Volume);
- if (EFI_ERROR(Status))
- return Status;
- FileInfo->PhysicalSize = sb.used_bytes;
-
- // prepare for return
- *BufferSize = RequiredSize;
- return EFI_SUCCESS;
-}
-*/
-
-// EOF
diff --git a/filesystems/test/.svn/text-base/fsw_posix.h.svn-base b/filesystems/test/.svn/text-base/fsw_posix.h.svn-base
deleted file mode 100644
index 8ab72f5..0000000
--- a/filesystems/test/.svn/text-base/fsw_posix.h.svn-base
+++ /dev/null
@@ -1,98 +0,0 @@
-/**
- * \file fsw_posix.h
- * POSIX user space host environment header.
- */
-
-/*-
- * Copyright (c) 2006 Christoph Pfisterer
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the
- * distribution.
- *
- * * Neither the name of Christoph Pfisterer nor the names of the
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _FSW_POSIX_H_
-#define _FSW_POSIX_H_
-
-#include "fsw_core.h"
-
-#include
-#include
-#include
-
-
-/**
- * POSIX Host: Private per-volume structure.
- */
-
-struct fsw_posix_volume {
- struct fsw_volume *vol; //!< FSW volume structure
-
- int fd; //!< System file descriptor for data access
-
-};
-
-/**
- * POSIX Host: Private structure for an open file.
- */
-
-struct fsw_posix_file {
- struct fsw_posix_volume *pvol; //!< POSIX host volume structure
-
- struct fsw_shandle shand; //!< FSW handle for this file
-
-};
-
-/**
- * POSIX Host: Private structure for an open directory.
- */
-
-struct fsw_posix_dir {
- struct fsw_posix_volume *pvol; //!< POSIX host volume structure
-
- struct fsw_shandle shand; //!< FSW handle for this file
-
-};
-
-
-/* functions */
-
-struct fsw_posix_volume * fsw_posix_mount(const char *path, struct fsw_fstype_table *fstype_table);
-int fsw_posix_unmount(struct fsw_posix_volume *pvol);
-
-struct fsw_posix_file * fsw_posix_open(struct fsw_posix_volume *pvol, const char *path, int flags, mode_t mode);
-ssize_t fsw_posix_read(struct fsw_posix_file *file, void *buf, size_t nbytes);
-off_t fsw_posix_lseek(struct fsw_posix_file *file, off_t offset, int whence);
-int fsw_posix_close(struct fsw_posix_file *file);
-
-struct fsw_posix_dir * fsw_posix_opendir(struct fsw_posix_volume *pvol, const char *path);
-struct dirent * fsw_posix_readdir(struct fsw_posix_dir *dir);
-void fsw_posix_rewinddir(struct fsw_posix_dir *dir);
-int fsw_posix_closedir(struct fsw_posix_dir *dir);
-
-
-#endif
diff --git a/filesystems/test/.svn/text-base/fsw_posix_base.h.svn-base b/filesystems/test/.svn/text-base/fsw_posix_base.h.svn-base
deleted file mode 100644
index ee1d96c..0000000
--- a/filesystems/test/.svn/text-base/fsw_posix_base.h.svn-base
+++ /dev/null
@@ -1,89 +0,0 @@
-/**
- * \file fsw_posix_base.h
- * Base definitions for the POSIX user space host environment.
- */
-
-/*-
- * Copyright (c) 2006 Christoph Pfisterer
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the
- * distribution.
- *
- * * Neither the name of Christoph Pfisterer nor the names of the
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _FSW_POSIX_BASE_H_
-#define _FSW_POSIX_BASE_H_
-
-
-#include
-#include
-#include
-#include
-#include
-
-#define FSW_LITTLE_ENDIAN (1)
-// TODO: use info from the headers to define FSW_LITTLE_ENDIAN or FSW_BIG_ENDIAN
-
-
-// types
-
-typedef signed char fsw_s8;
-typedef unsigned char fsw_u8;
-typedef short fsw_s16;
-typedef unsigned short fsw_u16;
-typedef long fsw_s32;
-typedef unsigned long fsw_u32;
-typedef long long fsw_s64;
-typedef unsigned long long fsw_u64;
-
-
-// allocation functions
-
-#define fsw_alloc(size, ptrptr) (((*(ptrptr) = malloc(size)) == NULL) ? FSW_OUT_OF_MEMORY : FSW_SUCCESS)
-#define fsw_free(ptr) free(ptr)
-
-// memory functions
-
-#define fsw_memzero(dest,size) memset(dest,0,size)
-#define fsw_memcpy(dest,src,size) memcpy(dest,src,size)
-#define fsw_memeq(p1,p2,size) (memcmp(p1,p2,size) == 0)
-
-// message printing
-
-#define FSW_MSGSTR(s) s
-#define FSW_MSGFUNC printf
-
-// 64-bit hooks
-
-#define FSW_U64_SHR(val,shiftbits) ((val) >> (shiftbits))
-#define FSW_U64_DIV(val,divisor) ((val) / (divisor))
-#define DEBUG(x)
-
-#define RShiftU64(val, shift) ((val) >> (shift))
-#define LShiftU64(val, shift) ((val) << (shift))
-
-#endif
diff --git a/filesystems/test/.svn/text-base/lslr.c.svn-base b/filesystems/test/.svn/text-base/lslr.c.svn-base
deleted file mode 100644
index d3e4e3c..0000000
--- a/filesystems/test/.svn/text-base/lslr.c.svn-base
+++ /dev/null
@@ -1,136 +0,0 @@
-/**
- * \file lslr.c
- * Test program for the POSIX user space environment.
- */
-
-/*-
- * Copyright (c) 2006 Christoph Pfisterer
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the
- * distribution.
- *
- * * Neither the name of Christoph Pfisterer nor the names of the
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "fsw_posix.h"
-
-
-//extern struct fsw_fstype_table FSW_FSTYPE_TABLE_NAME(ext2);
-//extern struct fsw_fstype_table FSW_FSTYPE_TABLE_NAME(reiserfs);
-extern struct fsw_fstype_table FSW_FSTYPE_TABLE_NAME(FSTYPE);
-
-static struct fsw_fstype_table *fstypes[] = {
- //&FSW_FSTYPE_TABLE_NAME(ext2),
- //&FSW_FSTYPE_TABLE_NAME(reiserfs),
- &FSW_FSTYPE_TABLE_NAME(FSTYPE ),
- NULL
-};
-
-static int listdir(struct fsw_posix_volume *vol, char *path, int level)
-{
- struct fsw_posix_dir *dir;
- struct dirent *dent;
- int i;
- char subpath[4096];
-
- dir = fsw_posix_opendir(vol, path);
- if (dir == NULL) {
- printf("opendir(%s) call failed.\n", path);
- return 1;
- }
- while ((dent = fsw_posix_readdir(dir)) != NULL) {
- for (i = 0; i < level*2; i++)
- fputc(' ', stdout);
- printf("%d %s\n", dent->d_type, dent->d_name);
-
- if (dent->d_type == DT_DIR) {
- snprintf(subpath, 4095, "%s%s/", path, dent->d_name);
- listdir(vol, subpath, level + 1);
- }
- }
- fsw_posix_closedir(dir);
-
- return 0;
-}
-
-static int catfile(struct fsw_posix_volume *vol, char *path)
-{
- struct fsw_posix_file *file;
- int r;
- char buf[256];
-
- file = fsw_posix_open(vol, path, 0, 0);
- if (file == NULL) {
- printf("open(%s) call failed.\n", path);
- return 1;
- }
- while ((r=fsw_posix_read(file, buf, sizeof(buf))) > 0)
- {
- int i;
- for (i=0; i\n");
- return 1;
- }
-
- for (i = 0; fstypes[i]; i++) {
- vol = fsw_posix_mount(argv[1], fstypes[i]);
- if (vol != NULL) {
- printf("Mounted as '%s'.\n", fstypes[i]->name.data);
- break;
- }
- }
- if (vol == NULL) {
- printf("Mounting failed.\n");
- return 1;
- }
-
- //listdir(vol, "/System/Library/Extensions/udf.kext/", 0);
- //listdir(vol, "/System/Library/Extensions/AppleACPIPlatform.kext/", 0);
- //listdir(vol, "/System/Library/Extensions/", 0);
- catfile(vol, "/System/Library/Extensions/AppleHPET.kext/Contents/Info.plist");
- //listdir(vol, "/", 0);
-
- fsw_posix_unmount(vol);
-
- return 0;
-}
-
-// EOF
diff --git a/filesystems/test/.svn/text-base/lsroot.c.svn-base b/filesystems/test/.svn/text-base/lsroot.c.svn-base
deleted file mode 100644
index bb2cba0..0000000
--- a/filesystems/test/.svn/text-base/lsroot.c.svn-base
+++ /dev/null
@@ -1,79 +0,0 @@
-/**
- * \file lsroot.c
- * Example program for the POSIX user space environment.
- */
-
-/*-
- * Copyright (c) 2006 Christoph Pfisterer
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the
- * distribution.
- *
- * * Neither the name of Christoph Pfisterer nor the names of the
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "fsw_posix.h"
-
-
-extern struct fsw_fstype_table FSW_FSTYPE_TABLE_NAME(ext2);
-extern struct fsw_fstype_table FSW_FSTYPE_TABLE_NAME(reiserfs);
-extern struct fsw_fstype_table FSW_FSTYPE_TABLE_NAME(iso9660);
-extern struct fsw_fstype_table FSW_FSTYPE_TABLE_NAME(hfs);
-
-int main(int argc, char **argv)
-{
- struct fsw_posix_volume *vol;
- struct fsw_posix_dir *dir;
- struct dirent *dent;
-
- if (argc != 2) {
- printf("Usage: lsroot \n");
- return 1;
- }
-
- //vol = fsw_posix_mount(argv[1], &FSW_FSTYPE_TABLE_NAME(ext2));
- //vol = fsw_posix_mount(argv[1], &FSW_FSTYPE_TABLE_NAME(reiserfs));
- vol = fsw_posix_mount(argv[1], &FSW_FSTYPE_TABLE_NAME(FSTYPE));
- if (vol == NULL) {
- printf("Mounting failed.\n");
- return 1;
- }
- //dir = fsw_posix_opendir(vol, "/drivers/net/");
- dir = fsw_posix_opendir(vol, "/");
- if (dir == NULL) {
- printf("opendir call failed.\n");
- return 1;
- }
- while ((dent = fsw_posix_readdir(dir)) != NULL) {
- printf("- %s\n", dent->d_name);
- }
- fsw_posix_closedir(dir);
- fsw_posix_unmount(vol);
-
- return 0;
-}
-
-// EOF
diff --git a/mkcdimage b/mkcdimage
index a132ee6..648da71 100755
--- a/mkcdimage
+++ b/mkcdimage
@@ -39,6 +39,14 @@ ln ../../refind/refind.conf-sample ./refind.conf
mkdir icons
cd icons
ln ../../../refind/icons/* ./
+cd ../
+mkdir drivers_x64
+cd drivers_x64
+ln ../../../refind/drivers_x64/* ./
+cd ..
+mkdir drivers_ia32
+cd drivers_ia32
+ln ../../../refind/drivers_x64/* ./
cd ../../..
# Get the size of the binaries to go in the El Torito image in kB
@@ -53,7 +61,7 @@ mv EFI/boot/shell*.efi ./
# Prepare a FAT filesystem image and populate it with the
# EFI boot files....
dd if=/dev/zero of=refind-bin-$Version.img bs=1024 count=$ToritoSize
-mkdosfs -n "rEFInd.ET" refind-bin-$Version.img
+mkdosfs -n "ElTorito" refind-bin-$Version.img
mcopy -irefind-bin-$Version.img -s EFI shell*.efi ::/
# Make the ISO-9660 image file....
diff --git a/mkdistrib b/mkdistrib
index 30c9825..bc44a2d 100755
--- a/mkdistrib
+++ b/mkdistrib
@@ -16,20 +16,26 @@ make clean
# Prepare a place and copy files there....
mkdir -p ../snapshots/$1/refind-$1/icons
cp --preserve=timestamps icons/*icns ../snapshots/$1/refind-$1/icons/
-cp -a docs images include libeg refind install.sh CREDITS.txt NEWS.txt BUILDING.txt COPYING.txt LICENSE.txt README.txt Make.common Makefile refind.conf-sample ../snapshots/$1/refind-$1
+cp -a docs images include libeg refind filesystems install.sh CREDITS.txt NEWS.txt BUILDING.txt COPYING.txt LICENSE.txt README.txt Make.common Makefile refind.conf-sample ../snapshots/$1/refind-$1
-# Go there are prepare a souce code zip file....
+# Go there and prepare a souce code zip file....
cd ../snapshots/$1/
zip -9r refind-src-$1.zip refind-$1
-# Build the source code into a binary
+# Build the source code into binaries
cd refind-$1
make
-mkdir -p refind-bin-$1/refind
+make fs
+mkdir -p refind-bin-$1/refind/drivers_x64
+mkdir -p refind-bin-$1/refind/drivers_ia32
cp -a icons refind-bin-$1/refind/
+cp --preserve=timestamps drivers/*_x64.efi refind-bin-$1/refind/drivers_x64/
+cp --preserve=timestamps filesystems/LICENSE*txt refind-bin-$1/refind/drivers_x64/
+cp --preserve=timestamps filesystems/LICENSE*txt refind-bin-$1/refind/drivers_ia32/
cp --preserve=timestamps refind.conf-sample refind-bin-$1/refind/
cp refind/refind_x64.efi refind-bin-$1/refind/refind_x64.efi
cp $StartDir/refind_ia32.efi refind-bin-$1/refind/
+cp $StartDir/drivers/*_ia32.efi refind-bin-$1/refind/drivers_ia32/
cp -a COPYING.txt LICENSE.txt README.txt docs CREDITS.txt install.sh refind-bin-$1
zip -9r ../refind-bin-$1.zip refind-bin-$1
cd ..
diff --git a/refind/main.c b/refind/main.c
index f619bec..8dd041e 100644
--- a/refind/main.c
+++ b/refind/main.c
@@ -58,8 +58,10 @@
#define MACOSX_LOADER_PATH L"System\\Library\\CoreServices\\boot.efi"
#if defined (EFIX64)
#define SHELL_NAMES L"\\EFI\\tools\\shell.efi,\\shellx64.efi"
+#define DRIVER_DIRS L"drivers,drivers_x64"
#elif defined (EFI32)
#define SHELL_NAMES L"\\EFI\\tools\\shell.efi,\\shellia32.efi"
+#define DRIVER_DIRS L"drivers,drivers_ia32"
#else
#define SHELL_NAMES L"\\EFI\\tools\\shell.efi"
#endif
@@ -104,7 +106,7 @@ static VOID AboutrEFInd(VOID)
{
if (AboutMenu.EntryCount == 0) {
AboutMenu.TitleImage = BuiltinIcon(BUILTIN_ICON_FUNC_ABOUT);
- AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.3.5.1");
+ AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.4.0");
AddMenuInfoLine(&AboutMenu, L"");
AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2006-2010 Christoph Pfisterer");
AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2012 Roderick W. Smith");
@@ -1372,16 +1374,22 @@ Done:
// file line.
static VOID LoadDrivers(VOID)
{
- CHAR16 *Directory;
+ CHAR16 *Directory, *SelfDirectory;
UINTN i = 0, Length, NumFound = 0;
- // load drivers from the "drivers" subdirectory of rEFInd's home directory
- Directory = StrDuplicate(SelfDirPath);
- CleanUpPathNameSlashes(Directory);
- MergeStrings(&Directory, L"drivers", L'\\');
- NumFound += ScanDriverDir(Directory);
+ // load drivers from the subdirectories of rEFInd's home directory specified
+ // in the DRIVER_DIRS constant.
+ while ((Directory = FindCommaDelimited(DRIVER_DIRS, i++)) != NULL) {
+ SelfDirectory = StrDuplicate(SelfDirPath);
+ CleanUpPathNameSlashes(SelfDirectory);
+ MergeStrings(&SelfDirectory, Directory, L'\\');
+ NumFound += ScanDriverDir(SelfDirectory);
+ FreePool(Directory);
+ FreePool(SelfDirectory);
+ }
// Scan additional user-specified driver directories....
+ i = 0;
while ((Directory = FindCommaDelimited(GlobalConfig.DriverDirs, i++)) != NULL) {
CleanUpPathNameSlashes(Directory);
Length = StrLen(Directory);
--
2.39.2