]> code.delx.au - refind/commitdiff
Version 0.6.0
authorsrs5694 <srs5694@users.sourceforge.net>
Mon, 17 Dec 2012 03:32:57 +0000 (22:32 -0500)
committersrs5694 <srs5694@users.sourceforge.net>
Mon, 17 Dec 2012 03:32:57 +0000 (22:32 -0500)
27 files changed:
BUILDING.txt
CREDITS.txt
NEWS.txt
docs/refind/bootmode.html
docs/refind/configfile.html
docs/refind/drivers.html
docs/refind/features.html
docs/refind/getting.html
docs/refind/index.html
docs/refind/installing.html
docs/refind/linux.html
docs/refind/revisions.html
docs/refind/secureboot.html
docs/refind/themes.html
docs/refind/todo.html
docs/refind/using.html
filesystems/fsw_efi.c
install.sh
libeg/screen.c
mkdistrib
refind.conf-sample
refind/config.c
refind/global.h
refind/lib.c
refind/lib.h
refind/main.c
refind/menu.c

index a60279a95f5658d08768d267661eee499e03b674..b69df9b3aca72a39f83720bc26f125e4b273ea6e 100644 (file)
@@ -310,7 +310,7 @@ To build all the drivers, you can type "make fs" from the main directory,
 which builds the drivers and places copies in both the filesystems and
 drivers_{arch} subdirectories. 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", "ext4fs", "reiserfs", "iso9660",
+{fsname} is a filesystem name -- "ext2", "ext4", "reiserfs", "iso9660",
 or "hfs".
 
 To install drivers, you can type "make install" in the "filesystems"
index d8efcdedb0fe36449253d6adf78e0b9f05f928a4..469d6630b9887a03af463e19dfc8202c11253998 100644 (file)
@@ -52,3 +52,6 @@ I've incorporated into the current version. Specifically:
 
 * The code for editing boot options (cursor_left(), cursor_right(), and
   line_edit() in screen.c) is taken from gummiboot.
+
+* Stefan Agner (stefan@agner.ch) turned the original ext2fs/ext3fs driver
+  into one that can read ext4fs.
index 6a62e1438f96c0bd8859f4911d2b725e19beb9a2..18712e86b638fd7ad3c2418e262e70e18e78eb83 100644 (file)
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -1,9 +1,19 @@
 0.5.2 (12/??/2012):
 -------------------
 
+- Fixed a memory allocation bug that could cause a program crash when
+  specifying certain values with the "also_scan_dirs", "dont_scan_volumes",
+  "dont_scan_dirs", "dont_scan_files", and "scan_driver_dirs" refind.conf
+  options.
+
+- Modified Linux kernel initrd-finding code so that if an initrd is
+  specified in refind_linux.conf, rEFInd will not add any initrd it finds.
+  This enables an override of the default initrd, and is likely to be
+  particularly helpful to Arch Linux users.
+
 - Added ext4fs driver!
 
-- Made "boot" the default value for "also_scan_dirs.
+- Made "boot" the default value for "also_scan_dirs".
 
 - Added identifying screen header to line editor.
 
   generated by install.sh. This entry boots without the options extracted
   from the /etc/default/grub file.
 
+- Added keys subdirectory to main distribution, to hold public Secure
+  Boot/shim keys from known sources.
+
+- Changed install.sh --drivers option to --alldrivers, added new
+  --nodrivers option, and made the default on Linux to install the one
+  driver that's used on /boot (or the root filesystem if /boot isn't a
+  separate partition). Of course, this won't install a non-existent driver,
+  and it also won't work properly if run from an emergency disk unless you
+  mount a separate /boot partition at that location.
+
 - Fixed bug in install.sh that prevented creation of refind_linux.conf file
   on Linux systems.
 
index 2ff249bcaa411b0f395a42eb265d8816f8e3407b..07fb6ea9404973b3d015f78017ecc741ca2d15cc 100644 (file)
@@ -15,7 +15,7 @@
 href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>\r
 \r
 <p>Originally written: 3/14/2012; last Web page update:\r
-12/11/2012, referencing rEFInd 0.5.1</p>\r
+12/16/2012, referencing rEFInd 0.6.0</p>\r
 \r
 \r
 <p>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!</p>\r
@@ -108,7 +108,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 \r
 <p>A casual reader might easily overlook this option, or misinterpret it to mean that the feature is much less important than it is. In fact, this particular motherboard offers very poor control over its EFI vs. BIOS booting features. (See <a href="http://www.rodsbooks.com/gb-hybrid-efi/">my Web page on this EFI implementation</a> for details.)</p>\r
 \r
-<p>Some manuals omit even mention of EFI, and instead refer to "legacy boot" or some similar term, referring to BIOS-style booting. Such references may imply that the firmware supports EFI booting if the "legacy boot" mode is disabled or restricted in some way.</p>\r
+<p>Some manuals omit even mention of EFI, and instead refer to "legacy boot" or some similar term, referring to BIOS-style booting. The firmware for my ASUS P8H77-I motherboard uses the technical term <i>CSM,</i> which of course will be baffling to the uninitiated. (I referred to it earlier. It's the <i>Compatibility Support Module</i>&mdash;in other words, the BIOS support code.) Such references may imply that the firmware supports EFI booting if the "legacy boot" mode is disabled or restricted in some way.</p>\r
 \r
 <p>Understated EFI features often indicate a slapdash approach to EFI. Such systems sometimes implement EFI as a layer atop a conventional BIOS. More modern EFIs, though, completely replace the BIOS. Some manufacturers, such as ASUS and its sibling ASRock, are now actively promoting their more advanced EFI implementations. Such products often come with flashy new GUIs in their firmware.</p>\r
 \r
index b21e8333c29463aa2304a8a795643e3b1aa37fb7..6b6ce6c0281d8b8ef6feb6069296d793757f173a 100644 (file)
@@ -15,7 +15,7 @@
 href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <p>Originally written: 3/14/2012; last Web page update:
-12/11/2012, referencing rEFInd 0.5.1</p>
+12/16/2012, referencing rEFInd 0.6.0</p>
 
 
 <p>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!</p>
@@ -205,13 +205,18 @@ timeout 20
 </tr>
 <tr>
    <td><tt>scan_delay</tt></td>
-   <td>Numeric (integer) value</td>
+   <td>numeric (integer) value</td>
    <td>Imposes a delay before rEFInd scans for disk devices. Ordinarily this is not necessary, but on some systems, some disks (particularly external drives and optical discs) can take a few seconds to become available. If some of your disks don't appear when rEFInd starts but they <i>do</i> appear when you press the Esc key to re-scan, try uncommenting this option and setting it to a modest value, such as <tt>2</tt>, <tt>5</tt>, or even <tt>10</tt>. The default is <tt>0</tt>.</td>
 </tr>
 <tr>
    <td><tt>also_scan_dirs</tt></td>
    <td>directory path(s)</td>
-   <td>Adds the specified directory or directories to the directory list that rEFInd scans for EFI boot loaders when <tt>scanfor</tt> includes the <tt>internal</tt>, <tt>external</tt>, or <tt>optical</tt> options. Directories are specified relative to the filesystem's root directory. If this option is used, it's applied to <i>all</i> the filesystems that rEFInd scans. If a specified directory doesn't exist, rEFInd ignores it (no error results).</td>
+   <td>Adds the specified directory or directories to the directory list that rEFInd scans for EFI boot loaders when <tt>scanfor</tt> includes the <tt>internal</tt>, <tt>external</tt>, or <tt>optical</tt> options. Directories are specified relative to the filesystem's root directory. If this option is used, it's applied to <i>all</i> the filesystems that rEFInd scans. If a specified directory doesn't exist, rEFInd ignores it (no error results). The default value is <tt>boot</tt>, which is useful for locating Linux kernels when you have an EFI driver for your Linux root (<tt>/</tt>) filesystem.</td>
+</tr>
+<tr>
+   <td><tt>dont_scan_volumes</tt> or <tt>don't_scan_volumes</tt></td>
+   <td>filesystem label(s)</td>
+   <td>Adds the specified volume or volumes to a volume "blacklist"&mdash;these filesystems are <i>not</i> scanned for EFI boot loaders. This may be useful to keep unwanted EFI boot entries, such as for a Macintosh recovery partition, from appearing on the main list of boot loaders.</td>
 </tr>
 <tr>
    <td><tt>dont_scan_dirs</tt> or <tt>don't_scan_dirs</tt></td>
index b94291ce6242f30d1910d50c0b902dca768687d9..a881ff20857da37afdf12566588b1c2d6df8a819 100644 (file)
@@ -15,7 +15,7 @@
 href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <p>Originally written: 4/19/2012; last Web page update:
-12/11/2012, referencing rEFInd 0.5.1</p>
+12/16/2012, referencing rEFInd 0.6.0</p>
 
 
 <p>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!</p>
@@ -138,8 +138,18 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <li><b>Ext4fs</b>&mdash;Stefan Agner modified the rEFIt/rEFInd ext2fs
     driver so that it could handle ext4fs. I'm including this as a separate
-    driver from the ext2fs driver, although the ext4fs version seems to be
-    able to handle ext2fs and ext3fs, too.</li>
+    driver from the ext2fs driver, although the ext4fs version can handle
+    ext2fs and ext3fs, too. (I may eventually retire the original ext2fs
+    driver, but I want to be conservative about this in case there's an
+    undiscovered problem with the new driver.) This driver has some
+    limitations. Most notably, for various reasons it maxes out at 16TiB
+    and won't mount any ext4 filesystem that's larger than this. It also
+    doesn't support the <tt>meta_bg</tt> option flag; if your filesystem
+    uses this flag, this driver refuses to read it. You can learn about
+    your ext2/3/4 filesystem features by typing <tt
+    class="userinput">dumpe2fs <i>/dev/sda2</i> | grep features</tt>,
+    changing <tt class="userinput"><i>/dev/sda2</i></tt> to your
+    filesystem's device.</li>
 
 <li><b>ISO-9660</b>&mdash;This driver originated with rEFIt's author, but
     he never released a final version. Its code was improved by Oracle for
@@ -165,7 +175,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <p>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 <a href="#notes">"Notes on Specific Drivers;"</a> however, these problems are very minor on most systems.</p>
 
-<p class="sidebar"><b>Note:</b> rEFInd's <tt>install.sh</tt> script does not install drivers by default. It does if you pass it the <tt>--drivers</tt> option, though. If you installed manually, you may also have installed rEFInd's drivers. See the <a href="installing.html">Installing rEFInd</a> page for details.</p>
+<p class="sidebar"><b>Note:</b> rEFInd's <tt>install.sh</tt> script does not install drivers by default on OS X, but on Linux, it installs the driver required to read the <tt>/boot</tt> directory, if one is available. The script installs all the available drivers if you pass it the <tt>--drivers</tt> option. See the <a href="installing.html">Installing rEFInd</a> page for details.</p>
 
 <p>If you want to use one or more of these drivers, you can install them from the rEFInd binary package from the <tt>refind/drivers_<tt class="variable">arch</tt></tt> directory, where <tt class="variable">arch</tt> is a CPU architecture code&mdash;<tt>x64</tt> or <tt>ia32</tt>. The files are named after the filesystems they handle, such as <tt>ext2_x64.efi</tt> for the 64-bit ext2fs driver. You should copy the files for the filesystems you want to use to the <tt>drivers</tt> or <tt>drivers_<tt class="variable">arch</tt></tt> 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.</p>
 
@@ -208,7 +218,7 @@ fs0: <tt class="userinput">map -r</tt>
 <h2>Notes on Specific Drivers</h2>
 </a>
 
-<p>I've tested several of the drivers described on this page on a handful of systems. The Pfisterer ext2fs driver (from any source) works on both ext2fs and ext3fs, but not on ext4fs&mdash;but Agner's derivative ext4fs driver handles ext4fs, so that's not a problem. The ReiserFS driver is obviously useful only on ReiserFS partitions. (Reiser4 is not supported, as far as I know.) Given that ext2fs, ext3fs, and ReiserFS are getting a bit on in age by Linux standards, you might do well to use them on a separate Linux <tt>/boot</tt> partition; however, if you're willing to use ext3fs or ReiserFS on your root (<tt>/</tt>) filesystem, you can use the EFI drivers to read your kernel from it. If you use ext4fs on your root (<tt>/</tt>) filesystem, you can use the ext4fs driver rather than a separate <tt>/boot</tt> partition. 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.</p>
+<p>I've tested several of the drivers described on this page on a handful of systems. The Pfisterer ext2fs driver (from any source) works on both ext2fs and ext3fs, but not on ext4fs&mdash;but Agner's derivative ext4fs driver handles ext4fs, so that's not a problem. The ReiserFS driver is obviously useful only on ReiserFS partitions. (Reiser4 is not supported, as far as I know.) Given that ext2fs, ext3fs, and ReiserFS are getting a bit on in age by Linux standards, you might do well to use them on a separate Linux <tt>/boot</tt> partition; however, if you're willing to use ext3fs, ext4fs, or ReiserFS on your root (<tt>/</tt>) 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.</p>
 
 <p>The Pfisterer ReiserFS and ext2fs drivers work, but they are a bit sluggish&mdash;particularly the ext2fs driver. The Agner ext4fs driver, when handling an actual ext4 filesystem, is in-between these two drivers in speed. 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, with ext4fs it's 75 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&mdash;my kernel loads in just 3 seconds from a ReiserFS partition and in 13 seconds from an ext2 filesystem. Speeds were similar with my newest computer, an ASUS P8H77-I board. Times with ext2fs on a UEFI PC with an Intel motherboard are in the 2&ndash;4 second range. 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 ext4fs or ReiserFS instead of ext2fs or ext3fs, at least if a change is practical. (For a <tt>/boot</tt> 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 <tt>/etc/fstab</tt> entry for a new UUID value, though. As noted earlier, be sure to use <tt>notail</tt> as an option in <tt>/etc/fstab</tt> for ReiserFS if you want to read it from EFI.) You can even use HFS+ on a Linux <tt>/boot</tt> partition, although this makes the most sense on a Mac, which has its own EFI HFS+ driver. Of course, you can also create a FAT <tt>/boot</tt> partition and not deal with drivers at all. Mounting your ESP at <tt>/boot</tt> is a practical solution for many users.</p>
 
index 8f12242d367e7a9ebf5a2fa62ff16401663417ad..086c889b238ffc03c2e0cf9fad20dbb89e960b2c 100644 (file)
@@ -15,7 +15,7 @@
 href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <p>Originally written: 3/14/2012; last Web page update:
-12/11/2012, referencing rEFInd 0.5.1</p>
+12/16/2012, referencing rEFInd 0.6.0</p>
 
 <p>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!</p>
 
@@ -111,7 +111,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <li>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.)</li>
+    0.4.0.)</li>
 
 </ul>
 
@@ -143,7 +143,7 @@ lack a usable CSM.</li>
 
 <li>The ability to specify additional directories to scan for boot loaders and drivers (as of version 0.2.7).</li>
 
-<li>The ability to specify directories to <i>not</i> be scanned for boot loaders, even if they would ordinarily be scanned (as of version 0.4.2).</li>
+<li>The ability to specify volumes and directories to <i>not</i> be scanned for boot loaders, even if they would ordinarily be scanned (as of version 0.6.0 for volumes and 0.4.2 for directories).</li>
 
 <li>The ability to re-scan boot loaders, to assist when changing removable media or after making a change to the configuration file with an EFI shell (as of version 0.3.5).</li>
 
@@ -151,7 +151,7 @@ lack a usable CSM.</li>
 
 <li>The ability to specify an additional icon storage directory, to assist in efforts to customize rEFInd's appearance (as of version 0.3.4).</li>
 
-<li>The ability to set the screen's resolution, within limits imposed by the EFI (as of rEFInd 0.3.0).</li>
+<li>The ability to set the screen's graphics resolution, within limits imposed by the EFI (as of rEFInd 0.3.0). Similarly, as of version 0.6.0, you can specify the text-mode resolution.</li>
 
 <li>Proper handling of more OS options than can fit on the screen. (rEFIt displays an empty list in graphical mode when it detects too many OSes.)</li>
 
@@ -167,9 +167,9 @@ lack a usable CSM.</li>
 
 <li>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.)</li>
 
-<li>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.)</li>
+<li>Drivers for ISO-9660, HFS+, and ext4fs, 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. The ext4fs driver is derived from the rEFIt ext2fs driver.)</li>
 
-<li>Beginning with version 0.5.0, the ability to "talk" to the <a href="http://mjg59.dreamwidth.org/20303.html">shim boot loader</a> to validate binaries supported by shim or its machine owner key (MOK) list when booting in EFI mode. As of version 0.5.0, this support is still crude and buggy; it should be considered an alpha-level feature at the moment.</li>
+<li>Beginning with version 0.5.0, the ability to "talk" to the <a href="http://mjg59.dreamwidth.org/20303.html">shim boot loader</a> to validate binaries supported by shim or its machine owner key (MOK) list when booting with Secure Boot active. As of version 0.6.0, this support is still crude and buggy; it should be considered an alpha-level feature at the moment.</li>
 
 </ul>
 
index f7f0742d85ef83d577a76bd140f3c0371699880f..884c8ea2b5f55275b11f1bfe018ac55cd5431e1a 100644 (file)
@@ -15,7 +15,7 @@
 href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <p>Originally written: 3/14/2012; last Web page update:
-12/12/2012, referencing rEFInd 0.5.1.1</p>
+12/16/2012, referencing rEFInd 0.6.0</p>
 
 <p>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!</p>
 
@@ -98,7 +98,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 <ul>
 
 <li><b><a
-    href="http://sourceforge.net/projects/refind/files/0.5.1.1/refind-src-0.5.1.1.zip/download">A
+    href="http://sourceforge.net/projects/refind/files/0.6.0/refind-src-0.6.0.zip/download">A
     source code zip file</a></b>&mdash;This is useful if you want to
     compile the software locally. Note that I use Linux with the <a
     href="https://sourceforge.net/projects/tianocore/">TianoCore EFI
@@ -109,7 +109,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
     possible, but I've not attempted it.</li>
 
 <li><b><a
-    href="http://sourceforge.net/projects/refind/files/0.5.1.1/refind-bin-0.5.1.1.zip/download">A
+    href="http://sourceforge.net/projects/refind/files/0.6.0/refind-bin-0.6.0.zip/download">A
     binary zip file</a></b>&mdash;Download this if you want to install
     rEFInd and/or its filesystem drivers on an <i>x</i>86 or <i>x</i>86-64
     computer and have no need to test rEFInd first by booting it on an
@@ -134,7 +134,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 <p class="sidebar"><b>Tip:</b> If you want a bootable USB flash drive, download the binary zip file or CD-R image file, prepare a USB flash drive with a FAT32 ESP, and then use the <tt>install.sh</tt> program's <tt>--usedefault</tt> option, as in <tt class="userinput">bash install.sh --usedefault /dev/sdd1</tt> to install to the first partition on <tt>/dev/sdd</tt>. This procedure should work even on a BIOS-booted computer.</p>
 
 <li><b><a
-    href="http://sourceforge.net/projects/refind/files/0.5.1.1/refind-cd-0.5.1.1.zip/download">A
+    href="http://sourceforge.net/projects/refind/files/0.6.0/refind-cd-0.6.0.zip/download">A
     CD-R image file</a></b>&mdash;This download contains the same files as
     the binary 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
index 84350472d34288c1d9bec61e456aefa61c361246..bcebfbba76a4e36d678e98c57116a7c65f023bc4 100644 (file)
@@ -15,7 +15,7 @@
 href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <p>Originally written: 3/14/2012; last Web page update:
-12/11/2012, referencing rEFInd 0.5.1</p>
+12/16/2012, referencing rEFInd 0.6.0</p>
 
 
 <p>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!</p>
index 7f2f945b07aeff7948f3ecf7a78dffdcebf5dfb9..03f54ccf308e61dde63e4719d48d93388833518d 100644 (file)
@@ -15,7 +15,7 @@
 href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <p>Originally written: 3/14/2012; last Web page update:
-12/13/2012, referencing rEFInd 0.5.1.2</p>
+12/16/2012, referencing rEFInd 0.6.0</p>
 
 
 <p>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!</p>
@@ -92,7 +92,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <p class="sidebar"><b>Important:</b> A rEFInd zip file, when uncompressed, creates a directory called <tt>refind-<i>version</i></tt>, where <tt><i>version</i></tt> is the version number. This directory includes a subdirectory called <tt>refind</tt> that holds the boot loader, along with another that holds documentation, as well as miscellaneous files in <tt>refind-<i>version</i></tt> itself. When I refer to "the <tt>refind</tt> directory" on this page, I mean the directory with that precise name, not the <tt>refind-<i>version</i></tt> directory that is its parent.</p>
 
-<p>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, <a href="#installsh"><tt>install.sh</tt>,</a> which provides easy one-command installation on most systems. Occasionally this script will fail, though, so I also provide explicit instructions for <a href="#linux">Linux</a> and <a href="#osx">Mac OS X.</a> Installation under <a href="#windows">Windows</a> also must be done manually. In some cases, you'll have to deviate from the default naming conventions, as described in <a href="#naming">a section on this topic.</a> If you're upgrading rEFInd, see the <a href="#upgrading">section on upgrading.</a> Finally, I describe how to install some <a href="#addons">additional components</a> you might find useful.</a> 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 <a href="drivers.html">page on using drivers with rEFInd.</a></p>
+<p>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, <a href="#installsh"><tt>install.sh</tt>,</a> which provides easy one-command installation on most systems. Occasionally this script will fail, though, so I also provide explicit instructions for <a href="#linux">Linux</a> and <a href="#osx">Mac OS X.</a> Installation under <a href="#windows">Windows</a> also must be done manually. In some cases, you'll have to deviate from the default naming conventions, as described in <a href="#naming">a section on this topic.</a> If you're upgrading rEFInd, see the <a href="#upgrading">section on upgrading.</a> Finally, I describe how to install some <a href="#addons">additional components</a> you might find useful.</a></p>
 
 <a name="installsh">
 <h2>Installing rEFInd Using <tt>install.sh</tt> under Linux or Mac OS X</h2>
@@ -195,13 +195,25 @@ Installation has completed successfully.</pre>
     though; because of the popularity of dual boots with Windows on Macs,
     the BIOS/legacy scans are enabled by default on Macs.</li>
 
+<li>On Linux, <tt>install.sh</tt> checks the filesystem type of the
+    <tt>/boot</tt> directory and, if a matching filesystem driver is
+    available, installs it. Note that the "<tt>/boot</tt> directory" may be
+    on a separate partition or it may be part of your root (<tt>/</tt>)
+    filesystem, in which case the driver for your root filesystem is
+    installed. If <tt>install.sh</tt> detects that the filesystem in
+    question is ext2fs or ext3fs, it installs the ext4fs driver, which can
+    handle all three of these filesystem types. This feature is unlikely to
+    work properly from an emergency system, although it might if you have a
+    separate <tt>/boot</tt> partition and if you mount that partition at
+    <tt>/boot</tt> in your emergency system, and the ESP at
+    <tt>/boot/efi</tt>.</li>
+
 <li>If you run <tt>install.sh</tt> on Linux and if
     <tt>/boot/refind_linux.conf</tt> doesn't already exist,
-    <tt>install.sh</tt> creates this file and populates it with a couple of
+    <tt>install.sh</tt> creates this file and populates it with a few
     sample entries. If <tt>/boot</tt> is on a FAT partition (or HFS+ on a
-    Mac), or if it's on an ext2fs, ext3fs, ReiserFS, or HFS+ partition and
-    you install an appropriate driver (as <tt>install.sh</tt> does
-    automatically when run from your working Linux installation), the
+    Mac), or if it's on an ext2fs, ext3fs, ext4fs, ReiserFS, or HFS+
+    partition and you install an appropriate driver, the
     result is that rEFInd will detect your kernel and will probably boot it
     correctly. Some systems will require manual tweaking to
     <tt>refind_linux.conf</tt>, though&mdash;for instance, to add
@@ -277,7 +289,7 @@ Filesystem     1K-blocks  Used Available Use% Mounted on
 
 <li>Type <tt><b>rm refind_ia32.efi</b></tt> to remove the IA32 binary if you're using an <i>x</i>86-64 (64-bit) system; or type <tt><b>rm refind_x64.efi</b></tt> to remove the <i>x</i>86-64 binary if you're using an <i>x</i>86 (32-bit) system. You can optionally rename the binary you keep as <tt>refind.efi</tt>, 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 <tt>refind_x64.efi</tt>.</li>
 
-<li>Optionally, type <tt class="userinput">rm -r drivers_ia32</tt> to remove the <i>x</i>86 drivers from an <i>x</i>86-64 system, or <tt class="userinput">rm -r drivers_x64</tt> to remove the <i>x</i>86-64 drivers from a 32-bit <i>x</i>86 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 <a href="drivers.html">page on drivers</a> for more on this topic.</li>
+<li>Optionally, type <tt class="userinput">rm -r drivers_ia32</tt> to remove the <i>x</i>86 drivers from an <i>x</i>86-64 system, or <tt class="userinput">rm -r drivers_x64</tt> to remove the <i>x</i>86-64 drivers from a 32-bit <i>x</i>86 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, and worse, if you're using Secure Boot, rEFInd can load just one shim/MOK-signed driver. See the <a href="drivers.html">page on drivers</a> for more on this topic.</li>
 
 <li>Rename the configuration file by typing <tt><b>mv refind.conf-sample refind.conf</b></tt>. Consult the <a href="configfile.html">Editing the rEFInd Configuration File</a> page for information on how to adjust your options.</li>
 
@@ -532,7 +544,7 @@ $ <b>ioreg -l -p IODeviceTree | grep firmware-abi</b>
 <li><b>Drivers</b>&mdash;You can install drivers to extend the capabilities
     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
+    support from an ext2fs, ext3fs, ext4fs, 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
     <a href="drivers.html">Using EFI Drivers</a> page for more on this
@@ -566,6 +578,8 @@ $ <b>ioreg -l -p IODeviceTree | grep firmware-abi</b>
 
 </ol>
 
+<p>Some sources suggest that delayed launches of rEFInd on Macs are more common when installing rEFInd to the ESP, so if you've done this, you could try re-installing it to your OS X boot partition.</p>
+
 <a name="uninstalling">
 <h2>Uninstalling rEFInd</h2>
 </a>
index 92141d28567bc4375c60306ccec90f892582b679..5e9aa882f05c3e8e4a3f70057337833658a7501b 100644 (file)
@@ -15,7 +15,7 @@
 href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <p>Originally written: 3/19/2012; last Web page update:
-12/12/2012, referencing rEFInd 0.5.1</p>
+12/16/2012, referencing rEFInd 0.6.0</p>
 
 
 <p>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!</p>
@@ -108,7 +108,31 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 <h2>Using the EFI Stub Loader: A Quick Setup Guide</h2>
 </a>
 
-<p>The EFI stub loader is basic and reliable, but it requires some setup to use it. I describe both <a href="#testing">a quick test configuration</a> and <a href="#longterm">a long-term setup.</a></p>
+<p>The EFI stub loader is basic and reliable, but it requires some setup to use it on some computers. I describe three methods of using it: an <a href="#easiest">easiest method</a> for those with compatible partition and filesystem layouts, a <a href="#testing">quick test configuration</a> for those without such a layout, and <a href="#longterm">a long-term setup</a> for those without the ideal setup.</p>
+
+<a name="easiest">
+<h3>For Those With Foresight or Luck: The Easiest Method</h3>
+</a>
+
+<p>This method requires that your <tt>/boot</tt> directory, whether it's on a separate partition or is a regular directory in your root (<tt>/</tt>) filesystem, be readable by the EFI. At the moment, all EFI implementations can read FAT and Macs can read HFS+. By using <a href="drivers.html">drivers,</a> you can make any EFI read HFS+, ISO-9660, ReiserFS, ext2fs, ext3fs, or ext4fs. Thus, if you use any of these filesystems on a regular partition (not an LVM or RAID configuration) that holds your kernels in <tt>/boot</tt>, you qualify for this easy method. The default partition layouts used by Ubuntu, Fedora, and many other distributions qualify, because they use one of these filesystems (usually ext4fs) in a normal partition or on a separate <tt>/boot</tt> partition. You must also have a 3.3.0 or later Linux kernel with EFI stub support, of course.</p>
+
+<p>If you installed rEFInd 0.6.0 or later with its <tt>install.sh</tt> script from your regular Linux installation, chances are everything's set up; you should be able to reboot and see your Linux kernels as boot options. If you installed manually, from OS X, or from an emergency system, though, you may need to do a couple of things manually:
+
+<ol>
+
+<li>Copy the relevant driver file for your filesystem and architecture to
+    the <tt>drivers</tt> or <tt>drivers_<tt class="variable">arch</tt></tt>
+    subdirectory of the rEFInd installation directory on the ESP. You may
+    need to create this subdirectory, too.</li>
+
+<li>Create a <tt>refind_linux.conf</tt> file in your <tt>/boot</tt>
+    directory. The <tt>mkrlconf.sh</tt> script that comes with rEFInd
+    should do this job, or you can do it manually as described <a
+    href="#efistub">later.</a></li>
+
+</ol>
+
+<p>When you reboot, you should see rEFInd options for your Linux kernels. If they work, your job is done, although you might want to apply some of the tweaks described in the <a href="#longterm">maintenance-free setup</a> section. If you have problems, you may need to adjust the <tt>refind_linux.conf</tt> file, as described in the <a href="#efistub">detailed configuration section.</a></p>
 
 <a name="testing">
 <h3>Testing the EFI Stub Loader</h3>
@@ -152,7 +176,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 <h3>Configuring a Maintenance-Free Setup</h3>
 </a>
 
-<p>The ideal configuration for use of the EFI stub loader involves giving rEFInd the ability to load your kernels directly from <tt>/boot</tt>. The main obstacle to doing so is that this directory is frequently on an XFS, JFS, Btrfs, or ext4 filesystem that the EFI can't read, or it's tucked away in an LVM or RAID configuration that the EFI can't read. Fortunately, this problem can be overcome with relatively little fuss. Several variant procedures are possible, but I begin by describing one that will almost always work, although it's got some important caveats (described at the end). You should perform the following steps as <tt>root</tt>, or precede each of these commands with <tt>sudo</tt>:</p>
+<p>If your <tt>/boot</tt> directory happens to be on an XFS, JFS, or Btrfs partition that the EFI can't read, or it's tucked away in an LVM or RAID configuration that the EFI can't read, you won't be able to use the <a href="#easiest">easiest solution.</a> Fortunately, this problem can be overcome with relatively little fuss. Several variant procedures are possible, but I begin by describing one that will almost always work, although it's got some important caveats (described at the end). You should perform the following steps as <tt>root</tt>, or precede each of these commands with <tt>sudo</tt>:</p>
 
 <ol>
 
@@ -215,10 +239,9 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <p>Once this task is done, updates to your kernel will automatically be stored in the root directory of your ESP, where rEFInd will automatically detect them. Thus, the boot configuration becomes maintenance-free. The procedure as just described has some drawbacks, though. By placing your kernels in the root directory of your ESP, you render them vulnerable to any other OS with which you might be dual-booting. Your ESP must also be large enough to hold all your kernels. If you dual-boot with multiple Linux distributions, they might conceivably overwrite each others' kernels, and distinguishing one from another becomes more difficult.</p>
 
-<p>For these reasons, a variant of this procedure is desirable on some systems. Most of the steps are similar, but in this variant, you create a separate <tt>/boot</tt> partition that's independent of the ESP. This partition can use FAT, HFS+, ReiserFS, ext2fs, or ext3fs; but if you use any of the last four filesystems (three on Macs), you must install the matching EFI filesystem driver that ships with rEFInd. Creating the filesystem will normally require you to shrink an existing partition by a suitable amount (200&ndash;500MiB). Mount your new <tt>/boot</tt> partition at a temporary location, copy or move the current <tt>/boot</tt> files into it, unmount it, and add it to <tt>/etc/fstab</tt> as <tt>/boot</tt>.</p>
-
+<p>For these reasons, a variant of this procedure is desirable on some systems. Most of the steps are similar, but in this variant, you create a separate <tt>/boot</tt> partition that's independent of the ESP. This partition can use FAT, HFS+, ReiserFS, ext2fs, ext3fs, or ext4fs; but if you use any of the last five filesystems (four on Macs), you must install the matching EFI filesystem driver that ships with rEFInd. Creating the filesystem will normally require you to shrink an existing partition by a suitable amount (200&ndash;500MiB). Mount your new <tt>/boot</tt> partition at a temporary location, copy or move the current <tt>/boot</tt> files into it, unmount it, and add it to <tt>/etc/fstab</tt> as <tt>/boot</tt>.</p>
 
-<p>If your distribution already uses a separate <tt>/boot</tt> partition (as Fedora 17 does by default), but if it uses ext4fs or some other unsuitable filesystem, you can back it up, create a fresh FAT, HFS+, ReiserFS, ext2, or ext3 filesystem on it, and restore the original files. You'll probably need to adjust the UUID value in <tt>/etc/fstab</tt> to ensure that the computer mounts the new filesystem when you boot. If you use a separate non-ESP <tt>/boot</tt> partition, you'll probably want to continue mounting the ESP at <tt>/boot/efi</tt>.</p>
+<p>If your distribution already uses a separate <tt>/boot</tt> partition, but if it uses XFS or some other unsuitable filesystem, you can back it up, create a fresh FAT, HFS+, ReiserFS, ext2, ext3, or ext4 filesystem on it, and restore the original files. You'll probably need to adjust the UUID value in <tt>/etc/fstab</tt> to ensure that the computer mounts the new filesystem when you boot. If you use a separate non-ESP <tt>/boot</tt> partition, you'll probably want to continue mounting the ESP at <tt>/boot/efi</tt>.</p>
 
 <a name="efistub">
 <h2>EFI Stub Loader Support Technical Details</h2>
@@ -306,7 +329,7 @@ total 17943
 
 <a name="refind_linux">
 <pre class="listing">
-"Boot with defaults"         "root=/dev/sda3 ro quiet splash vt.handoff=7"
+"Boot using default options" "root=/dev/sda3 ro quiet splash vt.handoff=7"
 "Boot into single-user mode" "root=UUID=1cd95082-bce0-494c-a290-d2e642dd82b7 ro single"
 "Boot without graphics"      "root=UUID=1cd95082-bce0-494c-a290-d2e642dd82b7 ro"
 # "Boot alternate install"   "root=/dev/sdb9 ro quiet splash vt.handoff=7"
@@ -322,9 +345,7 @@ total 17943
     a refind_linux.conf file in the Linux kernel's directory."
     border=2></center><br />
 
-<p>Note that the first entry shown here takes a name that's set in rEFInd rather than the one specified in the <tt>refind_linux.conf</tt> file. The remaining names match those specified in the file, though.</p>
-
-<p>To assist in initial configuration, rEFInd's <tt>install.sh</tt> script creates a sample <tt>refind_linux.conf</tt> file in <tt>/boot</tt>. This sample file defines two entries that use the default GRUB options defined in <tt>/etc/default/grub</tt>. The first entry boots normally and the second boots into single-user mode. If you want to create a new file, you can use the <tt>mkrlconf.sh</tt> script that comes with rEFInd. If you pass it the <tt>--force</tt> option, it will overwrite the existing <tt>/boot/refind_linux.conf</tt> file; otherwise it will create the file only if one doesn't already exist.</p>
+<p>To assist in initial configuration, rEFInd's <tt>install.sh</tt> script creates a sample <tt>refind_linux.conf</tt> file in <tt>/boot</tt>. This sample file defines three entries, the first two of which use the default GRUB options defined in <tt>/etc/default/grub</tt> and the last of which uses minimal options. The first entry boots normally and the second boots into single-user mode. If you want to create a new file, you can use the <tt>mkrlconf.sh</tt> script that comes with rEFInd. If you pass it the <tt>--force</tt> option, it will overwrite the existing <tt>/boot/refind_linux.conf</tt> file; otherwise it will create the file only if one doesn't already exist.</p>
 
 <p>From a user's perspective, the submenus defined in this way work just like submenus defined via the <tt>submenuentry</tt> options in <tt>refind.conf</tt>, or like the submenus that rEFInd creates automatically for Mac OS X or ELILO. There are, however, limitations in what you can accomplish with this method:</p>
 
index f8c2f3d1673a8717acbff5538d89cfbd16a909de..7e1c7752c5fde864249e15ea4446bcab439dc8b9 100644 (file)
@@ -14,7 +14,7 @@
 <p class="subhead">by Roderick W. Smith, <a
 href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
-<p>Last Web page update: 12/12/2012</p>
+<p>Last Web page update: 12/16/2012</p>
 
 <p>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!</p>
 
@@ -92,6 +92,8 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <ul>
 
+<li><b>0.6.0 (12/16/2012)</b>&mdash;The donation of a working ext4fs driver from Stefan Agner has prompted another big jump in the rEFInd version number, since this driver will greatly simplify installation on many systems: You may be able to simply run the <tt>install.sh</tt> script to get a working rEFInd that boots your Linux kernels directly, bypassing GRUB or ELILO. Other improvements in this version include bug fixes and minor changes to <tt>install.sh</tt>, the addition of hint text to the rEFInd main menu, the ability to disable the options editor via the <tt>editor</tt> option to <tt>hideui</tt> in <tt>refind.conf</tt>, a new <tt>textmode</tt> option to <tt>refind.conf</tt> to set the size of the text-mode display, a change to the code that adds your initial RAM disk to the boot options so that if you specify one manually (via <tt>refind_linux.conf</tt>), it will take precedence, and assorted obscure bug fixes. The <tt>NEWS.txt</tt> file goes into more details about many of these changes, as do the relevant pages of this HTML documentation.</li>
+
 <li><b>0.5.1.1 (12/12/2012)</b>&mdash;This is a micro-update to fix a bug in the <tt>install.sh</tt> script that prevented it from working under OS X. Aside from that, and a few small documentation changes, this version changes nothing in rEFInd.</li>
 
 <li><b>0.5.1 (12/11/2012)</b>&mdash;The most important changes to this version are to the <tt>install.sh</tt> script. It now supports two options, <tt>--shim</tt> and <tt>--localkeys</tt>, to aid in installation on a Secure Boot system. See the <a href="installing.html">Installing rEFInd</a> and <a href="secureboot.html">Managing Secure Boot</a> pages for details. The script also now creates a sample <tt>/boot/refind_linux.conf</tt> file to assist in setting up boots via the Linux EFI stub loader. All of these <tt>install.sh</tt> improvements work only in Linux. A separate <tt>mkrlconf.sh</tt> script creates a <tt>/boot/refind_linux.conf</tt> file if it doesn't exist, for help in post-installation configuration. In rEFInd itself, I've fixed the bug that caused ELILO to be unable to locate its configuration file when launched in Secure Boot mode and fixed a couple of more obscure bugs. I've also added an <tt>include</tt> token to <tt>refind.conf</tt>, to enable you to create a secondary configuration file (say, one managed by scripts while leaving the main file untouched; or one dedicated to manual boot stanzas).</li>
index a399c0b6013daf48f7a2a43f82c4d3271240dfa4..930296fbb7eb26597cd088a794ff0ad8487721f0 100644 (file)
@@ -15,7 +15,7 @@
 href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <p>Originally written: 11/13/2012; last Web page update:
-12/12/2012, referencing rEFInd 0.5.1</p>
+12/16/2012, referencing rEFInd 0.6.0</p>
 
 
 <p>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!</p>
@@ -232,7 +232,7 @@ described on this page currently supports only <i>x</i>86-64, not
 
 <p>At this point the computer may boot into its default OS, reboot, or perhaps even hang. When you reboot it, though, rEFInd should start up in Secure Boot mode. (You can verify this by selecting the <i>About rEFInd</i> tool in the main menu. Check the <i>Platform</i> item in the resulting screen; it should verify that Secure Boot is active.) You should now be able to launch any boot loader signed with a key recognized by the firmware or by shim (including any MOKs you've enrolled). If you want to manage keys in the future, rEFInd displays a new icon in the second (tools) row you can use to launch MokManager. (This icon appears by default if MokManager is installed, but if you edit <tt>showtools</tt> in <tt>refind.conf</tt>, you must be sure to include <tt>mok_tool</tt> as an option in order to gain access to it.)</p>
 
-<p>If you're using Ubuntu 12.10, you can't use its version of shim, but you can replace it with Garrett's shim. If you do so, though, you'll have to add Ubuntu's public key as a MOK, at least if you intend to launch Ubuntu's version of GRUB or launch Ubuntu-provided signed kernels. Ubuntu's public key is available in the <a href="http://archive.ubuntu.com/ubuntu/pool/main/s/shim/shim_0~20120906.bcd0a4e8-0ubuntu4.debian.tar.gz">shim_0~20120906.bcd0a4e8-0ubuntu4.debian.tar.gz</a> tarball, as <tt>canonical-uefi-ca.der</tt>. (The filename extensions <tt>.cer</tt> and <tt>.der</tt> are interchangeable for most purposes.) To use it, copy <tt>canonical-uefi-ca.der</tt> to your ESP and enroll it with MokManager. See <a href="http://falstaff.agner.ch/2012/12/12/secure-boot-implementation-of-ubuntu-12-10-quantal-quetzal/">this blog post</a> for further details on Ubuntu 12.10's handling of Secure Boot. In principle, you should be able to use shim 0.2 or later from future distributions that include it; but you must be sure that whatever you use supports MokManager.</p>
+<p>If you're using Ubuntu 12.10, you can't use its version of shim, but you can replace it with Garrett's shim. If you do so, though, you'll have to add Ubuntu's public key as a MOK, at least if you intend to launch Ubuntu's version of GRUB or launch Ubuntu-provided signed kernels. Ubuntu's public key is available in the <a href="http://archive.ubuntu.com/ubuntu/pool/main/s/shim/shim_0~20120906.bcd0a4e8-0ubuntu4.debian.tar.gz">shim_0~20120906.bcd0a4e8-0ubuntu4.debian.tar.gz</a> tarball, as <tt>canonical-uefi-ca.der</tt>. (The filename extensions <tt>.cer</tt> and <tt>.der</tt> are interchangeable for most purposes.) I've also included this key with rEFInd, in the <tt>refind/keys</tt> subdirectory of its package file. To use this key, copy it to your ESP and enroll it with MokManager. See <a href="http://falstaff.agner.ch/2012/12/12/secure-boot-implementation-of-ubuntu-12-10-quantal-quetzal/">this blog post</a> for further details on Ubuntu 12.10's handling of Secure Boot. In principle, you should be able to use shim 0.2 or later from future distributions that include it; but you must be sure that whatever you use supports MokManager.</p>
 
 <a name="mok">
 <h2>Managing Your MOKs</h2>
index 077dc89e6e44fabd7158017b3da6d15225b0520e..3e370a173ddd566b9ee9c5d984d1926f0dd2346a 100644 (file)
@@ -15,7 +15,7 @@
 href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <p>Originally written: 4/19/2012; last Web page update:
-12/11/2012, referencing rEFInd 0.5.1</p>
+12/16/2012, referencing rEFInd 0.6.0</p>
 
 
 <p>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!</p>
index 92b4a38142100805f6f54324d79740176bbc40c8..459f766a35d76ec39a16c05f7d15931cd8dceae3 100644 (file)
@@ -15,7 +15,7 @@
 href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <p>Originally written: 3/14/2012; last Web page update:
-12/6/2012, referencing rEFInd 0.5.0</p>
+12/16/2012, referencing rEFInd 0.6.0</p>
 
 
 <p>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!</p>
@@ -318,9 +318,9 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
     <ul>
 
-    <li>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
+    <li>Drivers for additional filesystems are desirable. Given the talk of
+       shifting to Btrfs, 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.</li>
 
index 48a94ff135ebfd9535e2ecabc524ad8b52374cb0..399352ccac7143f3c0ea1e8d06f64ecbc4a50e9f 100644 (file)
@@ -15,7 +15,7 @@
 href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <p>Originally written: 3/14/2012; last Web page update:
-12/11/2012, referencing rEFInd 0.5.1</p>
+12/16/2012, referencing rEFInd 0.6.0</p>
 
 
 <p>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!</p>
index 7df71aa740371174225f44d436decf246a3f4ce5..3e96e6200f17f2dc39d13621a841d31f140fcfd9 100644 (file)
@@ -76,7 +76,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"rEFInd 0.5.0 " FSW_EFI_STRINGIFY(t) L" File System Driver"
+#define FSW_EFI_DRIVER_NAME(t) L"rEFInd 0.6.0 " FSW_EFI_STRINGIFY(t) L" File System Driver"
 
 // function prototypes
 
index cb0d6d39bf062cccbc1facbc9917376036328569..e28fb41289c220d5d8c09d61e372024d3c15ffbe 100755 (executable)
@@ -29,7 +29,7 @@
 #
 # Revision history:
 #
-# 0.5.2   -- Changed --drivers to --alldrivers and added --nodrivers option;
+# 0.6.0   -- Changed --drivers to --alldrivers and added --nodrivers option;
 #            changed default driver installation behavior in Linux to install
 #            the driver needed to read /boot (if available)
 # 0.5.1.2 -- Fixed bug that caused failure to generate refind_linux.conf file
@@ -163,11 +163,12 @@ CopyShimFiles() {
 # Copy the public keys to the installation medium
 CopyKeys() {
    if [[ $LocalKeys == 1 ]] ; then
-      cp $EtcKeysDir/$LocalKeysBase.cer $InstallDir/$TargetDir
-      cp $EtcKeysDir/$LocalKeysBase.crt $InstallDir/$TargetDir
-   else
-      cp $ThisDir/refind.cer $InstallDir/$TargetDir
-      cp $ThisDir/refind.crt $InstallDir/$TargetDir
+      mkdir -p $InstallDir/$TargetDir/keys/
+      cp $EtcKeysDir/$LocalKeysBase.cer $InstallDir/$TargetDir/keys/
+      cp $EtcKeysDir/$LocalKeysBase.crt $InstallDir/$TargetDir/keys/
+#    else
+#       cp $ThisDir/refind.cer $InstallDir/$TargetDir/keys/
+#       cp $ThisDir/refind.crt $InstallDir/$TargetDir/keys/
    fi
 } # CopyKeys()
 
@@ -184,10 +185,8 @@ CopyDrivers() {
       BootFS=`blkid -o export $BootPart 2> /dev/null | grep TYPE= | cut -f 2 -d =`
       DriverType=""
       case $BootFS in
-         ext2 | ext3) DriverType="ext2"
+         ext2 | ext3 | ext4) DriverType="ext4"
               ;;
-        ext4) DriverType="ext4"
-             ;;
          reiserfs) DriverType="reiserfs"
               ;;
          hfsplus) DriverType="hfs"
@@ -247,8 +246,8 @@ CopyRefindFiles() {
          if [[ $LocalKeys == 0 ]] ; then
             echo "Storing copies of rEFInd Secure Boot public keys in $EtcKeysDir"
             mkdir -p $EtcKeysDir
-            cp $ThisDir/refind.cer $EtcKeysDir
-            cp $ThisDir/refind.crt $EtcKeysDir
+            cp $ThisDir/keys/refind.cer $EtcKeysDir
+            cp $ThisDir/keys/refind.crt $EtcKeysDir
          fi
       fi
    else
@@ -266,6 +265,7 @@ CopyRefindFiles() {
    if [[ $? != 0 ]] ; then
       Problems=1
    fi
+   cp -rf $ThisDir/keys $InstallDir/$TargetDir/
    if [[ -f $InstallDir/$TargetDir/refind.conf ]] ; then
       echo "Existing refind.conf file found; copying sample file as refind.conf-sample"
       echo "to avoid overwriting your customizations."
@@ -516,7 +516,7 @@ ReSignBinaries() {
    cp $RefindDir/refind_ia32.efi $TempDir
    cp -a $RefindDir/drivers_ia32 $TempDir 2> /dev/null
    cp -a $ThisDir/drivers_ia32 $TempDir 2> /dev/null
-   SignOneBinary $RefindDir/refind_x64.efi $ThisDir/refind_x64.efi
+   SignOneBinary $RefindDir/refind_x64.efi $TempDir/refind_x64.efi
    for Driver in `ls $RefindDir/drivers_x64/*.efi $ThisDir/drivers_x64/*.efi 2> /dev/null` ; do
       TempName=`basename $Driver`
       SignOneBinary $Driver $TempDir/drivers_x64/$TempName
index 222895919b34496def2f04c7a7682836453f6fda..90988cf26cf71cb04d2d07a0a7a5259a7d73bfdb 100644 (file)
 #define LibLocateProtocol EfiLibLocateProtocol
 #endif
 
+// Scan for at least this many text-mode and graphics-mode display modes, even
+// if the first modes are invalid. The number of text modes scanned must be at
+// least 3 on some computers to properly list all the available modes when the
+// user specifies an invalid value, since mode 1 (numbered from 0) is often
+// invalid, but mode 2 (the third one) is usually valid. AFAIK, gaps never
+// occur in graphics modes, although I've heard of one case that makes me think
+// some exceptions may occur.
+#define MIN_SCAN_TEXT_MODES 3
+#define MIN_SCAN_GRAPHICS_MODES 1
+
 // Console defines and variables
 
 static EFI_GUID ConsoleControlProtocolGuid = EFI_CONSOLE_CONTROL_PROTOCOL_GUID;
@@ -140,7 +150,7 @@ BOOLEAN egSetScreenSize(IN OUT UINTN *ScreenWidth, IN OUT UINTN *ScreenHeight) {
                Status = refit_call2_wrapper(GraphicsOutput->SetMode, GraphicsOutput, ModeNum);
                ModeSet = (Status == EFI_SUCCESS);
             } // if
-         } while (((ModeNum++ < 10) || (Status == EFI_SUCCESS)) && !ModeSet);
+         } while (((++ModeNum < MIN_SCAN_GRAPHICS_MODES) || (Status == EFI_SUCCESS)) && !ModeSet);
 //          while ((Status == EFI_SUCCESS) && (!ModeSet)) {
 //             Status = refit_call4_wrapper(GraphicsOutput->QueryMode, GraphicsOutput, ModeNum, &Size, &Info);
 //             if ((Status == EFI_SUCCESS) && (Size >= sizeof(*Info)) &&
@@ -164,7 +174,7 @@ BOOLEAN egSetScreenSize(IN OUT UINTN *ScreenWidth, IN OUT UINTN *ScreenHeight) {
             if ((Status == EFI_SUCCESS) && (Info != NULL)) {
                Print(L"Mode %d: %d x %d\n", ModeNum, Info->HorizontalResolution, Info->VerticalResolution);
             } // else
-         } while ((ModeNum++ < 10) || (Status == EFI_SUCCESS));
+         } while ((++ModeNum < MIN_SCAN_GRAPHICS_MODES) || (Status == EFI_SUCCESS));
 //          Status = EFI_SUCCESS;
 //          while (Status == EFI_SUCCESS) {
 //             Status = refit_call4_wrapper(GraphicsOutput->QueryMode, GraphicsOutput, ModeNum, &Size, &Info);
@@ -222,7 +232,7 @@ UINT32 egSetTextMode(UINT32 RequestedMode) {
             Status = refit_call4_wrapper(ST->ConOut->QueryMode, ST->ConOut, i, &Width, &Height);
             if (Status == EFI_SUCCESS)
                Print(L"Mode: %d: %d x %d\n", i, Width, Height);
-         } while ((i++ < 2) || (Status == EFI_SUCCESS));
+         } while ((++i < MIN_SCAN_TEXT_MODES) || (Status == EFI_SUCCESS));
 
          PauseForKey();
          SwitchToGraphics();
index c12196f477a56219ba20079182062136795b4adb..78f24e31af2d9306d9b4ab6e487c38f87b14cd7f 100755 (executable)
--- a/mkdistrib
+++ b/mkdistrib
@@ -47,10 +47,7 @@ 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 EfiLib libeg refind filesystems install.sh mkrlconf.sh CREDITS.txt NEWS.txt BUILDING.txt COPYING.txt LICENSE.txt README.txt refind.inf Make.tiano Make.common Makefile refind.conf-sample ../snapshots/$1/refind-$1
-if [[ SignIt == 1 ]] ; then
-   cp $KeysDir/refind.cer $KeysDir/refind.crt ../snapshots/$1/refind-$1/
-fi
+cp -a docs images keys include EfiLib libeg refind filesystems install.sh mkrlconf.sh CREDITS.txt NEWS.txt BUILDING.txt COPYING.txt LICENSE.txt README.txt refind.inf Make.tiano Make.common Makefile refind.conf-sample ../snapshots/$1/refind-$1
 
 # Go there and prepare a souce code zip file....
 cd ../snapshots/$1/
@@ -87,11 +84,10 @@ else
    cp refind/refind_x64.efi refind-bin-$1/refind/refind_x64.efi
 fi
 cp refind-bin-$1/refind/refind_x64.efi $StartDir
-cp -a COPYING.txt LICENSE.txt README.txt docs CREDITS.txt install.sh mkrlconf.sh refind-bin-$1
+cp -a docs keys COPYING.txt LICENSE.txt README.txt CREDITS.txt install.sh mkrlconf.sh refind-bin-$1
 
 # Prepare the final .zip file and clean up
 if [[ $SignIt == 1 ]] ; then
-   cp $KeysDir/refind.cer $KeysDir/refind.crt refind-bin-$1/
    umount $KeysDir
 fi
 zip -9r ../refind-bin-$1.zip refind-bin-$1
index 7d2950aa6bd6dc70dd0bb51437d86b81b5b374da..7d77fdef8ea25bc09884ca6f359c01d2f085cfa9 100644 (file)
@@ -167,10 +167,19 @@ timeout 20
 # Directories are specified relative to the volume's root directory. This
 # option applies to ALL the volumes that rEFInd scans. If a specified
 # directory doesn't exist, it's ignored (no error condition results).
-# The default is to scan no additional directories.
+# The default is to scan the "boot" directory in addition to various
+# hard-coded directories.
 #
 #also_scan_dirs boot,EFI/linux/kernels
 
+# Partitions to omit from scans. You must specify a volume by its
+# label, which you can obtain in an EFI shell by typing "vol", from
+# Linux by typing "blkid /dev/{devicename}", or by examining the
+# disk's label in various OSes' file browsers.
+# The default is an empty list (all volumes are scanned).
+#
+#dont_scan_volumes
+
 # Directories that should NOT be scanned for boot loaders. By default,
 # rEFInd doesn't scan its own directory or the EFI/tools directory.
 # You can "blacklist" additional directories with this option, which
index 3831e4cd56530964a2af346896a498b84580173a..b1e09294ca558a9e78d5c3043da362d67ce1704b 100644 (file)
@@ -347,6 +347,8 @@ VOID ReadConfig(CHAR16 *FileName)
     if (StriCmp(FileName, CONFIG_FILE_NAME) == 0) {
        MyFreePool(GlobalConfig.AlsoScan);
        GlobalConfig.AlsoScan = StrDuplicate(ALSO_SCAN_DIRS);
+//        MyFreePool(GlobalConfig.DontScanVolumes);
+//        GlobalConfig.DontScanVolumes = StrDuplicate(L" ");
        MyFreePool(GlobalConfig.DontScanDirs);
        GlobalConfig.DontScanDirs = StrDuplicate(SelfDirPath);
        MyFreePool(GlobalConfig.DontScanFiles);
@@ -411,6 +413,15 @@ VOID ReadConfig(CHAR16 *FileName)
         } else if (StriCmp(TokenList[0], L"also_scan_dirs") == 0) {
             HandleStrings(TokenList, TokenCount, &(GlobalConfig.AlsoScan));
 
+        } else if ((StriCmp(TokenList[0], L"don't_scan_volumes") == 0) || (StriCmp(TokenList[0], L"dont_scan_volumes") == 0)) {
+           HandleStrings(TokenList, TokenCount, &(GlobalConfig.AlsoScan));
+           // Note: Don't use HandleStrings() because it modifies slashes, which might be present in volume name
+            MyFreePool(GlobalConfig.DontScanVolumes);
+            GlobalConfig.DontScanVolumes = NULL;
+            for (i = 1; i < TokenCount; i++) {
+               MergeStrings(&GlobalConfig.DontScanVolumes, TokenList[i], L',');
+            }
+
         } else if ((StriCmp(TokenList[0], L"don't_scan_dirs") == 0) || (StriCmp(TokenList[0], L"dont_scan_dirs") == 0)) {
             HandleStrings(TokenList, TokenCount, &(GlobalConfig.DontScanDirs));
 
@@ -718,7 +729,6 @@ VOID ScanUserConfigured(VOID)
    CHAR16            *Title = NULL;
    UINTN             TokenCount, size;
    LOADER_ENTRY      *Entry;
-//   REFIT_MENU_SCREEN  *SubScreen;
 
    if (FileExists(SelfDir, CONFIG_FILE_NAME)) {
       Status = ReadFile(SelfDir, CONFIG_FILE_NAME, &File, &size);
index 49cb08100f68f3404e27894b08669068c517faf6..a2db177498d905c9940b01abcba97e814ff4b4b2 100644 (file)
@@ -216,6 +216,7 @@ typedef struct {
    CHAR16      *SelectionBigFileName;
    CHAR16      *DefaultSelection;
    CHAR16      *AlsoScan;
+   CHAR16      *DontScanVolumes;
    CHAR16      *DontScanDirs;
    CHAR16      *DontScanFiles;
    CHAR16      *DriverDirs;
index 77e6842404b4cfe7a7ffb56f4c74d3e9bb1d39d2..4eb8378b630ed746884a6377ae0a4e9fcc46ec47 100644 (file)
@@ -94,7 +94,7 @@ static VOID UninitVolumes(VOID);
 //
 
 // Converts forward slashes to backslashes, removes duplicate slashes, and
-// removes slashes from the end of the pathname.
+// removes slashes from both the start and end of the pathname.
 // Necessary because some (buggy?) EFI implementations produce "\/" strings
 // in pathnames, because some user inputs can produce duplicate directory
 // separators, and because we want consistent start and end slashes for
@@ -106,23 +106,20 @@ VOID CleanUpPathNameSlashes(IN OUT CHAR16 *PathName) {
    UINTN    i, FinalChar = 0;
    BOOLEAN  LastWasSlash = FALSE;
 
-   NewName = AllocateZeroPool(sizeof(CHAR16) * (StrLen(PathName) + 4));
+   NewName = AllocateZeroPool(sizeof(CHAR16) * (StrLen(PathName) + 2));
    if (NewName != NULL) {
       for (i = 0; i < StrLen(PathName); i++) {
          if ((PathName[i] == L'/') || (PathName[i] == L'\\')) {
-            if ((!LastWasSlash) /* && (FinalChar != 0) */)
+            if ((!LastWasSlash) && (FinalChar != 0))
                NewName[FinalChar++] = L'\\';
             LastWasSlash = TRUE;
          } else {
-            if (FinalChar == 0) {
-               NewName[FinalChar++] = L'\\';
-            }
             NewName[FinalChar++] = PathName[i];
             LastWasSlash = FALSE;
          } // if/else
       } // for
       NewName[FinalChar] = 0;
-      if ((FinalChar > 1) && (NewName[FinalChar - 1] == L'\\'))
+      if ((FinalChar > 0) && (NewName[FinalChar - 1] == L'\\'))
          NewName[--FinalChar] = 0;
       if (FinalChar == 0) {
          NewName[0] = L'\\';
@@ -134,6 +131,39 @@ VOID CleanUpPathNameSlashes(IN OUT CHAR16 *PathName) {
    } // if allocation OK
 } // CleanUpPathNameSlashes()
 
+// VOID CleanUpPathNameSlashes(IN OUT CHAR16 *PathName) {
+//    CHAR16   *NewName;
+//    UINTN    i, FinalChar = 0;
+//    BOOLEAN  LastWasSlash = FALSE;
+// 
+//    NewName = AllocateZeroPool(sizeof(CHAR16) * (StrLen(PathName) + 4));
+//    if (NewName != NULL) {
+//       for (i = 0; i < StrLen(PathName); i++) {
+//          if ((PathName[i] == L'/') || (PathName[i] == L'\\')) {
+//             if ((!LastWasSlash) /* && (FinalChar != 0) */)
+//                NewName[FinalChar++] = L'\\';
+//             LastWasSlash = TRUE;
+//          } else {
+//             if (FinalChar == 0) {
+//                NewName[FinalChar++] = L'\\';
+//             }
+//             NewName[FinalChar++] = PathName[i];
+//             LastWasSlash = FALSE;
+//          } // if/else
+//       } // for
+//       NewName[FinalChar] = 0;
+//       if ((FinalChar > 1) && (NewName[FinalChar - 1] == L'\\'))
+//          NewName[--FinalChar] = 0;
+//       if (FinalChar == 0) {
+//          NewName[0] = L'\\';
+//          NewName[1] = 0;
+//       }
+//       // Copy the transformed name back....
+//       StrCpy(PathName, NewName);
+//       FreePool(NewName);
+//    } // if allocation OK
+// } // CleanUpPathNameSlashes()
+
 // Splits an EFI device path into device and filename components. For instance, if InString is
 // PciRoot(0x0)/Pci(0x1f,0x2)/Ata(Secondary,Master,0x0)/HD(2,GPT,8314ae90-ada3-48e9-9c3b-09a88f80d921,0x96028,0xfa000)/\bzImage-3.5.1.efi,
 // this function will truncate that input to
@@ -1229,7 +1259,7 @@ VOID MergeStrings(IN OUT CHAR16 **First, IN CHAR16 *Second, CHAR16 AddChar) {
          StrCat(NewString, *First);
          if (AddChar) {
             NewString[Length1] = AddChar;
-            NewString[Length1 + 1] = 0;
+            NewString[Length1 + 1] = '\0';
          } // if (AddChar)
       } // if (*First != NULL)
       if (Second != NULL)
@@ -1463,18 +1493,18 @@ BOOLEAN EjectMedia(VOID) {
 } // VOID EjectMedia()
 
 
-// Return the GUID as a string, suitable for display to the user. Note that the calling
-// function is responsible for freeing the allocated memory.
-CHAR16 * GuidAsString(EFI_GUID *GuidData) {
-   CHAR16 *TheString;
-
-   TheString = AllocateZeroPool(42 * sizeof(CHAR16));
-   if (TheString != 0) {
-      SPrint (TheString, 82, L"%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
-              (UINTN)GuidData->Data1, (UINTN)GuidData->Data2, (UINTN)GuidData->Data3,
-              (UINTN)GuidData->Data4[0], (UINTN)GuidData->Data4[1], (UINTN)GuidData->Data4[2],
-              (UINTN)GuidData->Data4[3], (UINTN)GuidData->Data4[4], (UINTN)GuidData->Data4[5],
-              (UINTN)GuidData->Data4[6], (UINTN)GuidData->Data4[7]);
-   }
-   return TheString;
-} // GuidAsString(EFI_GUID *GuidData)
+// // Return the GUID as a string, suitable for display to the user. Note that the calling
+// // function is responsible for freeing the allocated memory.
+// CHAR16 * GuidAsString(EFI_GUID *GuidData) {
+//    CHAR16 *TheString;
+// 
+//    TheString = AllocateZeroPool(42 * sizeof(CHAR16));
+//    if (TheString != 0) {
+//       SPrint (TheString, 82, L"%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
+//               (UINTN)GuidData->Data1, (UINTN)GuidData->Data2, (UINTN)GuidData->Data3,
+//               (UINTN)GuidData->Data4[0], (UINTN)GuidData->Data4[1], (UINTN)GuidData->Data4[2],
+//               (UINTN)GuidData->Data4[3], (UINTN)GuidData->Data4[4], (UINTN)GuidData->Data4[5],
+//               (UINTN)GuidData->Data4[6], (UINTN)GuidData->Data4[7]);
+//    }
+//    return TheString;
+// } // GuidAsString(EFI_GUID *GuidData)
index 1e74ac94dbd9347b7bb30f3e36c79bdad9c2b26b..7245191e78d32bb99f54d4cf3e3799c9a8a8739f 100644 (file)
@@ -116,6 +116,6 @@ VOID MyFreePool(IN OUT VOID *Pointer);
 
 BOOLEAN EjectMedia(VOID);
 
-CHAR16 * GuidAsString(EFI_GUID *GuidData);
+//CHAR16 * GuidAsString(EFI_GUID *GuidData);
 
 #endif
\ No newline at end of file
index 05d15be0a40bf2fe7ef61b9e8a33a043a322a9b9..ab6efe6452fd7c7a37a8c73259b7871e21bf4939 100644 (file)
@@ -61,7 +61,7 @@
 // 
 // variables
 
-#define MACOSX_LOADER_PATH      L"\\System\\Library\\CoreServices\\boot.efi"
+#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"
@@ -97,7 +97,7 @@ static REFIT_MENU_SCREEN MainMenu       = { L"Main Menu", NULL, 0, NULL, 0, NULL
 static REFIT_MENU_SCREEN AboutMenu      = { L"About", NULL, 0, NULL, 0, NULL, 0, NULL };
 
 REFIT_CONFIG GlobalConfig = { FALSE, FALSE, 0, 0, 0, 20, 0, 0, GRAPHICS_FOR_OSX, LEGACY_TYPE_MAC, 0,
-                              NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+                              NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
                               {TAG_SHELL, TAG_APPLE_RECOVERY, TAG_MOK_TOOL, TAG_ABOUT, TAG_SHUTDOWN, TAG_REBOOT, 0, 0, 0, 0, 0 }};
 
 // Structure used to hold boot loader filenames and time stamps in
@@ -118,7 +118,7 @@ static VOID AboutrEFInd(VOID)
 
     if (AboutMenu.EntryCount == 0) {
         AboutMenu.TitleImage = BuiltinIcon(BUILTIN_ICON_FUNC_ABOUT);
-        AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.5.1.6");
+        AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.6.0");
         AddMenuInfoLine(&AboutMenu, L"");
         AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2006-2010 Christoph Pfisterer");
         AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2012 Roderick W. Smith");
@@ -186,7 +186,7 @@ static EFI_STATUS StartEFIImageList(IN EFI_DEVICE_PATH **DevicePaths,
     // set load options
     if (LoadOptions != NULL) {
         if (LoadOptionsPrefix != NULL) {
-            MergeStrings(&FullLoadOptions, LoadOptionsPrefix, 0);
+//            MergeStrings(&FullLoadOptions, LoadOptionsPrefix, 0);
             MergeStrings(&FullLoadOptions, LoadOptions, L' ');
             if (OSType == 'M') {
                MergeStrings(&FullLoadOptions, L" ", 0);
@@ -461,9 +461,10 @@ LOADER_ENTRY *InitializeLoaderEntry(IN LOADER_ENTRY *Entry) {
 // Returns a pointer to a new string. The calling function is responsible for
 // freeing its memory.
 static CHAR16 *AddInitrdToOptions(CHAR16 *Options, CHAR16 *InitrdPath) {
-   CHAR16 *NewOptions;
+   CHAR16 *NewOptions = NULL;
 
-   NewOptions = StrDuplicate(Options);
+   if (Options != NULL)
+      NewOptions = StrDuplicate(Options);
    if ((InitrdPath != NULL) && !StriSubCmp(L"initrd=", Options)) {
       MergeStrings(&NewOptions, L"initrd=", L' ');
       MergeStrings(&NewOptions, InitrdPath, 0);
@@ -494,7 +495,7 @@ REFIT_MENU_SCREEN *InitializeSubScreen(IN LOADER_ENTRY *Entry) {
          // default entry
          SubEntry = InitializeLoaderEntry(Entry);
          if (SubEntry != NULL) {
-            SubEntry->me.Title = L"Boot using default options";
+            SubEntry->me.Title = StrDuplicate(L"Boot using default options");
             MainOptions = SubEntry->LoadOptions;
             SubEntry->LoadOptions = AddInitrdToOptions(MainOptions, SubEntry->InitrdPath);
             MyFreePool(MainOptions);
@@ -510,7 +511,7 @@ REFIT_MENU_SCREEN *InitializeSubScreen(IN LOADER_ENTRY *Entry) {
 VOID GenerateSubScreen(LOADER_ENTRY *Entry, IN REFIT_VOLUME *Volume) {
    REFIT_MENU_SCREEN  *SubScreen;
    LOADER_ENTRY       *SubEntry;
-   CHAR16             *InitrdOption = NULL, *Temp;
+   CHAR16             *InitrdName;
    CHAR16             DiagsFileName[256];
    REFIT_FILE         *File;
    UINTN              TokenCount;
@@ -580,7 +581,7 @@ VOID GenerateSubScreen(LOADER_ENTRY *Entry, IN REFIT_VOLUME *Volume) {
       } // not single-user
 
       // check for Apple hardware diagnostics
-      StrCpy(DiagsFileName, L"\\System\\Library\\CoreServices\\.diagnostics\\diags.efi");
+      StrCpy(DiagsFileName, L"System\\Library\\CoreServices\\.diagnostics\\diags.efi");
       if (FileExists(Volume->RootDir, DiagsFileName) && !(GlobalConfig.HideUIFlags & HIDEUI_FLAG_HWTEST)) {
          SubEntry = InitializeLoaderEntry(Entry);
          if (SubEntry != NULL) {
@@ -596,20 +597,26 @@ VOID GenerateSubScreen(LOADER_ENTRY *Entry, IN REFIT_VOLUME *Volume) {
    } else if (Entry->OSType == 'L') {   // entries for Linux kernels with EFI stub loaders
       File = ReadLinuxOptionsFile(Entry->LoaderPath, Volume);
       if (File != NULL) {
-         Temp =  FindInitrd(Entry->LoaderPath, Volume);
-         TokenCount = ReadTokenLine(File, &TokenList); // read and discard first entry, since it's
-         FreeTokenLine(&TokenList, &TokenCount);       // set up by InitializeSubScreen(), earlier....
+         InitrdName =  FindInitrd(Entry->LoaderPath, Volume);
+         TokenCount = ReadTokenLine(File, &TokenList);
+         // first entry requires special processing, since it was initially set
+         // up with a default title but correct options by InitializeSubScreen(),
+         // earlier....
+         if ((SubScreen->Entries != NULL) && (SubScreen->Entries[0] != NULL)) {
+            MyFreePool(SubScreen->Entries[0]->Title);
+            SubScreen->Entries[0]->Title = StrDuplicate(TokenList[0]);
+         } // if
+         FreeTokenLine(&TokenList, &TokenCount);
          while ((TokenCount = ReadTokenLine(File, &TokenList)) > 1) {
             SubEntry = InitializeLoaderEntry(Entry);
             SubEntry->me.Title = StrDuplicate(TokenList[0]);
             MyFreePool(SubEntry->LoadOptions);
-            SubEntry->LoadOptions = AddInitrdToOptions(TokenList[1], Temp);
+            SubEntry->LoadOptions = AddInitrdToOptions(TokenList[1], InitrdName);
             FreeTokenLine(&TokenList, &TokenCount);
             SubEntry->UseGraphicsMode = GlobalConfig.GraphicsFor & GRAPHICS_FOR_LINUX;
             AddMenuEntry(SubScreen, (REFIT_MENU_ENTRY *)SubEntry);
          } // while
-         MyFreePool(InitrdOption);
-         MyFreePool(Temp);
+         MyFreePool(InitrdName);
          MyFreePool(File);
       } // if Linux options file exists
 
@@ -820,8 +827,7 @@ INTN TimeComp(EFI_TIME *Time1, EFI_TIME *Time2) {
    INT64 Time1InSeconds, Time2InSeconds;
 
    // Following values are overestimates; I'm assuming 31 days in every month.
-   // This is fine for the purpose of this function, which has a limited
-   // purpose.
+   // This is fine for the purpose of this function, which is limited
    Time1InSeconds = Time1->Second + (Time1->Minute * 60) + (Time1->Hour * 3600) + (Time1->Day * 86400) +
                     (Time1->Month * 2678400) + ((Time1->Year - 1998) * 32140800);
    Time2InSeconds = Time2->Second + (Time2->Minute * 60) + (Time2->Hour * 3600) + (Time2->Day * 86400) +
@@ -880,8 +886,10 @@ static VOID ScanLoaderDir(IN REFIT_VOLUME *Volume, IN CHAR16 *Path, IN CHAR16 *P
     CHAR16                  FileName[256], *Extension;
     struct LOADER_LIST      *LoaderList = NULL, *NewLoader;
 
-    if ((!SelfDirPath || !Path || ((StriCmp(Path, SelfDirPath) == 0) && Volume->DeviceHandle != SelfVolume->DeviceHandle) ||
-        (StriCmp(Path, SelfDirPath) != 0)) && (!IsIn(Path, GlobalConfig.DontScanDirs))) {
+    if ((!SelfDirPath || !Path || ((StriCmp(Path, SelfDirPath) == 0) && (Volume->DeviceHandle != SelfVolume->DeviceHandle)) ||
+           (StriCmp(Path, SelfDirPath) != 0)) &&
+         (!IsIn(Path, GlobalConfig.DontScanDirs)) &&
+         (!IsIn(Volume->VolName, GlobalConfig.DontScanVolumes))) {
        // look through contents of the directory
        DirIterOpen(Volume->RootDir, Path, &DirIter);
        while (DirIterNext(&DirIter, 2, Pattern, &DirEntry)) {
@@ -893,9 +901,9 @@ static VOID ScanLoaderDir(IN REFIT_VOLUME *Volume, IN CHAR16 *Path, IN CHAR16 *P
                 continue;   // skip this
 
           if (Path)
-                SPrint(FileName, 255, L"\\%s\\%s", Path, DirEntry->FileName);
+             SPrint(FileName, 255, L"\\%s\\%s", Path, DirEntry->FileName);
           else
-                SPrint(FileName, 255, L"\\%s", DirEntry->FileName);
+             SPrint(FileName, 255, L"\\%s", DirEntry->FileName);
           CleanUpPathNameSlashes(FileName);
           NewLoader = AllocateZeroPool(sizeof(struct LOADER_LIST));
           if (NewLoader != NULL) {
@@ -935,22 +943,22 @@ static VOID ScanEfiFiles(REFIT_VOLUME *Volume) {
 
    if ((Volume->RootDir != NULL) && (Volume->VolName != NULL)) {
       // check for Mac OS X boot loader
-      if (!IsIn(L"\\System\\Library\\CoreServices", GlobalConfig.DontScanDirs)) {
+      if (!IsIn(L"System\\Library\\CoreServices", GlobalConfig.DontScanDirs)) {
          StrCpy(FileName, MACOSX_LOADER_PATH);
          if (FileExists(Volume->RootDir, FileName) && !IsIn(L"boot.efi", GlobalConfig.DontScanFiles)) {
             AddLoaderEntry(FileName, L"Mac OS X", Volume);
          }
 
          // check for XOM
-         StrCpy(FileName, L"\\System\\Library\\CoreServices\\xom.efi");
+         StrCpy(FileName, L"System\\Library\\CoreServices\\xom.efi");
          if (FileExists(Volume->RootDir, FileName) && !IsIn(L"boot.efi", GlobalConfig.DontScanFiles)) {
             AddLoaderEntry(FileName, L"Windows XP (XoM)", Volume);
          }
       } // if Mac directory not in GlobalConfig.DontScanDirs list
 
       // check for Microsoft boot loader/menu
-      StrCpy(FileName, L"\\EFI\\Microsoft\\Boot\\Bootmgfw.efi");
-      if (FileExists(Volume->RootDir, FileName) && !IsIn(L"\\EFI\\Microsoft\\Boot", GlobalConfig.DontScanDirs) &&
+      StrCpy(FileName, L"EFI\\Microsoft\\Boot\\Bootmgfw.efi");
+      if (FileExists(Volume->RootDir, FileName) && !IsIn(L"EFI\\Microsoft\\Boot", GlobalConfig.DontScanDirs) &&
           !IsIn(L"bootmgfw.efi", GlobalConfig.DontScanFiles)) {
          AddLoaderEntry(FileName, L"Microsoft EFI boot", Volume);
       }
@@ -963,7 +971,7 @@ static VOID ScanEfiFiles(REFIT_VOLUME *Volume) {
       while (DirIterNext(&EfiDirIter, 1, NULL, &EfiDirEntry)) {
          if (StriCmp(EfiDirEntry->FileName, L"tools") == 0 || EfiDirEntry->FileName[0] == '.')
             continue;   // skip this, doesn't contain boot loaders
-         SPrint(FileName, 255, L"\\EFI\\%s", EfiDirEntry->FileName);
+         SPrint(FileName, 255, L"EFI\\%s", EfiDirEntry->FileName);
          ScanLoaderDir(Volume, FileName, MatchPatterns);
       } // while()
       Status = DirIterClose(&EfiDirIter);
@@ -1805,16 +1813,16 @@ static VOID ScanForTools(VOID) {
             break;
          case TAG_GPTSYNC:
             MyFreePool(FileName);
-            FileName = NULL;
-            MergeStrings(&FileName, L"\\efi\\tools\\gptsync.efi", 0);
+            FileName = StrDuplicate(L"\\efi\\tools\\gptsync.efi");
+//            MergeStrings(&FileName, L"\\efi\\tools\\gptsync.efi", 0);
             if (FileExists(SelfRootDir, FileName)) {
                AddToolEntry(SelfLoadedImage->DeviceHandle, FileName, L"Make Hybrid MBR", BuiltinIcon(BUILTIN_ICON_TOOL_PART), 'P', FALSE);
             }
             break;
          case TAG_APPLE_RECOVERY:
             MyFreePool(FileName);
-            FileName = NULL;
-            MergeStrings(&FileName, L"\\com.apple.recovery.boot\\boot.efi", 0);
+            FileName = StrDuplicate(L"\\com.apple.recovery.boot\\boot.efi");
+//            MergeStrings(&FileName, L"\\com.apple.recovery.boot\\boot.efi", 0);
             for (VolumeIndex = 0; VolumeIndex < VolumesCount; VolumeIndex++) {
                if ((Volumes[VolumeIndex]->RootDir != NULL) && (FileExists(Volumes[VolumeIndex]->RootDir, FileName))) {
                   SPrint(Description, 255, L"Apple Recovery on %s", Volumes[VolumeIndex]->VolName);
index 7b74e517940b8a9bfe77b9e921107e7ec4bb0636..75799789ab99e7f6a632dfb6c06fba64835ca347 100644 (file)
@@ -721,8 +721,8 @@ static VOID GraphicsMenuStyle(IN REFIT_MENU_SCREEN *Screen, IN SCROLL_STATE *Sta
                } else {
                   DrawMenuText(L"Use arrow keys to move cursor; Enter to boot;", 0,
                                (UGAWidth - (45 * FONT_CELL_WIDTH)) / 2, UGAHeight - (FONT_CELL_HEIGHT * 3));
-                  DrawMenuText(L"Insert or F2 to edit options", 0,
-                               (UGAWidth - (28 * FONT_CELL_WIDTH)) / 2, UGAHeight - (FONT_CELL_HEIGHT * 2));
+                  DrawMenuText(L"Insert or F2 to edit options; Esc to return to main menu", 0,
+                               (UGAWidth - (56 * FONT_CELL_WIDTH)) / 2, UGAHeight - (FONT_CELL_HEIGHT * 2));
                } // if/else
             } // if
             break;
@@ -799,7 +799,7 @@ static VOID PaintAll(IN REFIT_MENU_SCREEN *Screen, IN SCROLL_STATE *State, UINTN
    if (!(GlobalConfig.HideUIFlags & HIDEUI_FLAG_HINTS)) {
       DrawMainMenuText(L"Use arrow keys to move cursor; Enter to boot;",
                        (UGAWidth - LAYOUT_TEXT_WIDTH) / 2, UGAHeight - (FONT_CELL_HEIGHT * 3));
-      DrawMainMenuText(L"Insert or F2 for more options",
+      DrawMainMenuText(L"Insert or F2 for more options; Esc to refresh",
                        (UGAWidth - LAYOUT_TEXT_WIDTH) / 2, UGAHeight - (FONT_CELL_HEIGHT * 2));
    } // if
 } // static VOID PaintAll()