]> code.delx.au - refind/commitdiff
Version 0.2.6; adds more options for "volume" token in config file
authorsrs5694 <srs5694@users.sourceforge.net>
Sun, 15 Apr 2012 00:41:27 +0000 (20:41 -0400)
committersrs5694 <srs5694@users.sourceforge.net>
Sun, 15 Apr 2012 00:41:27 +0000 (20:41 -0400)
16 files changed:
NEWS.txt
docs/refind/bootmode.html
docs/refind/configfile.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/todo.html
docs/refind/using.html
refind.conf-sample
refind/config.c
refind/global.h
refind/lib.c
refind/main.c

index 259b03e851b8e9afad12fe1d050ad52a94983b98..8723aa573a7eb633ee0e2d881c731829247ae625 100644 (file)
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -1,10 +1,14 @@
-0.2.6 (?/??/2012):
+0.2.6 (4/14/2012):
 ------------------
 
 - Added "volume" keyword to configuration file's stanza options. This
   option changes the volume from which subsequent files (specified by
   "loader" and "icon") are loaded. You pass "volume" the name/label of the
-  FILESYSTEM you want to use (not the GPT partition name).
+  FILESYSTEM you want to use (not the GPT partition name), or a number
+  followed by a colon (e.g., "1:"). The former should reliably identify a
+  filesystem, assuming the name is unique. The latter assigns numbers based
+  on the order in which they're scanned, which may not be as reliable but
+  should work when a volume is unnamed.
 
 - Fixed bug in 0.2.5 that caused failure of Linux initial RAM disk
   mapping on some (but not all) systems. Affected computers include at
index d4f48d9ee73c5d972961f3ada2a1f149170423f9..4d3e5abbff2d85fe1129445bd7777478c4a10bd3 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>Originally written: 3/14/2012; last Web page update: 4/9/2012, referencing rEFInd 0.2.5</p>
+<p>Originally written: 3/14/2012; last Web page update: 4/14/2012, referencing rEFInd 0.2.6</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 25330bbe17b1837f3043588956724a1c16e3b767..ce7cebeb21dc135cd83478121c8b400d9d5aa263 100644 (file)
@@ -228,17 +228,17 @@ default_selection elilo
 <tr>
    <td><tt>volume</tt></td>
    <td>filesystem label</td>
-   <td>Sets the volume that's used for subsequent file accesses (by <tt>icon</tt> and <tt>loader</tt>, and by implication by <tt>initrd</tt> if <tt>loader</tt> follows <tt>volume</tt>). You pass this token a filesystem's name/label, which is typically displayed under the volume's icon in file managers and that rEFInd displays on its menu at the end of the boot prompt string. If this label isn't unique, the first volume with the specified label is used. The matching is nominally case-insensitive, but on some EFIs it's case-sensitive.</td>
+   <td>Sets the volume that's used for subsequent file accesses (by <tt>icon</tt> and <tt>loader</tt>, and by implication by <tt>initrd</tt> if <tt>loader</tt> follows <tt>volume</tt>). You pass this token a filesystem's label or a volume number. A filesystem label is typically displayed under the volume's icon in file managers and that rEFInd displays on its menu at the end of the boot prompt string. If this label isn't unique, the first volume with the specified label is used. The matching is nominally case-insensitive, but on some EFIs it's case-sensitive. If a filesystem has no label, you can use a volume number followed by a colon, such as <tt>0:</tt> to refer to the first filesystem or <tt>1:</tt> to refer to the second. The assignment of numbers is arbitrary and may not be consistent across boots, though. It might change if you insert an optical disc or plug in a USB flash drive, for instance. If this option is not set, the volume defaults to the one from which rEFInd launched.</td>
 </tr>
 <tr>
    <td><tt>loader</tt></td>
    <td>filename</td>
-   <td>Sets the filename for the boot loader. You may use either Unix-style slashes (<tt>/</tt>) or Windows/EFI-style backslashes (<tt>\</tt>) to separate directory elements. In either case, the references are to files on the ESP from which rEFInd launched; you can't (yet) launch loaders from other locations. This option should normally be the first in the body of an OS stanza; if it's not, some other options may be ignored.</td>
+   <td>Sets the filename for the boot loader. You may use either Unix-style slashes (<tt>/</tt>) or Windows/EFI-style backslashes (<tt>\</tt>) to separate directory elements. In either case, the references are to files on the ESP from which rEFInd launched or to the one identified by a preceding <tt>volume</tt> token. This option should normally be the first in the body of an OS stanza; if it's not, some other options may be ignored. An exception is if you want to boot a loader from a volume other than the one on which rEFInd resides, in which case <tt>volume</tt> should precede <tt>loader</tt>.</td>
 </tr>
 <tr>
    <td><tt>initrd</tt></td>
    <td>filename</td>
-   <td>Sets the filename for a Linux kernel's initial RAM disk (initrd). This option is useful only when booting a Linux kernel that includes an <a href="http://www.rodsbooks.com/efi-bootloaders/efistub.html">EFI stub loader</a>, which enables you to boot a kernel without the benefit of a separate boot loader. When booted in this way, though, you must normally pass an initrd filename to the boot loader. You must specify the complete EFI path to the initrd file with this option, as in <tt>initrd EFI/linux/initrd-3.3.0-rc7.img</tt>. You'll also have to use the <tt>options</tt> line to pass the Linux root filesystem, and perhaps other options (as in <tt>options "root=/dev/sda4 ro"</tt>).</td>
+   <td>Sets the filename for a Linux kernel's initial RAM disk (initrd). This option is useful only when booting a Linux kernel that includes an <a href="http://www.rodsbooks.com/efi-bootloaders/efistub.html">EFI stub loader</a>, which enables you to boot a kernel without the benefit of a separate boot loader. When booted in this way, though, you must normally pass an initrd filename to the boot loader. You must specify the complete EFI path to the initrd file with this option, as in <tt>initrd EFI/linux/initrd-3.3.0-rc7.img</tt>. You'll also have to use the <tt>options</tt> line to pass the Linux root filesystem, and perhaps other options (as in <tt>options "root=/dev/sda4 ro"</tt>). The initial RAM disk file must reside on the same volume as the kernel.</td>
 </tr>
 <tr>
    <td><tt>icon</tt></td>
@@ -317,7 +317,7 @@ menuentry Gentoo {
 <tr>
    <td><tt>loader</tt></td>
    <td>filename</td>
-   <td>Sets the filename for the boot loader, as described in <a href="#table2">Table 2.</a></td>
+   <td>Sets the filename for the boot loader, as described in <a href="#table2">Table 2.</a> Note that the loader is read from whatever filesystem is specified by the main stanza's <tt>volume</tt> option, provided that option precedes the submenu definition.</td>
 </tr>
 <tr>
    <td><tt>initrd</tt></td>
@@ -346,7 +346,7 @@ menuentry Gentoo {
 </tr>
 </table>
 
-<p>The following menu entry illustrates the use of submenu entries. This is an expansion on the second entry presented earlier:</p>
+<p>The following menu entry illustrates the use of submenu entries. This is a variant of the second entry presented earlier:</p>
 
 <pre class="listing">
 menuentry Gentoo {
index 13508ae86fc5c60baff368743ef0e422e9f35d39..0789f199a8c0d306223ab68af3f4b54bcee79953 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>Originally written: 3/14/2012; last Web page update: 4/9/2012, referencing rEFInd 0.2.5</p>
+<p>Originally written: 3/14/2012; last Web page update: 4/14/2012, referencing rEFInd 0.2.6</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 a5e69054567920d540ee4c162fc17146f2573c7c..d2070f06fb9cc628ced37519193ab9d43c241b9a 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>Originally written: 3/14/2012; last Web page update: 4/9/2012, referencing rEFInd 0.2.5</p>
+  <p>Originally written: 3/14/2012; last Web page update: 4/14/2012, referencing rEFInd 0.2.6</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>
 
@@ -96,7 +96,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <ul>
 
-<li><b><a href="http://sourceforge.net/projects/refind/files/0.2.5/refind-src-0.2.5.zip/download">A
+<li><b><a href="http://sourceforge.net/projects/refind/files/0.2.6/refind-src-0.2.6.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="http://sourceforge.net/projects/gnu-efi">GNU-EFI</a> development
@@ -104,7 +104,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
     that toolchain is theoretically possible, but I've not attempted
     it.</li>
 
-<li><b><a href="http://sourceforge.net/projects/refind/files/0.2.5/refind-bin-0.2.5.zip/download">A
+<li><b><a href="http://sourceforge.net/projects/refind/files/0.2.6/refind-bin-0.2.6.zip/download">A
     binary zip file</a></b>&mdash;Download this if you want to install rEFInd 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 optical disc. This zip file package includes both
@@ -112,7 +112,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
     versions of rEFInd. Which you install depends on your architecture, as
     described on the <a href="installing.html">Installing rEFInd</a> page.</li>
 
-<li><b><a href="http://sourceforge.net/projects/refind/files/0.2.5/refind-cd-0.2.5.zip/download">A
+<li><b><a href="http://sourceforge.net/projects/refind/files/0.2.6/refind-cd-0.2.6.zip/download">A
     CD-R image file</a></b>&mdash;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 at least some Macs.) If you like
index 183e069464ce926964040a17a8915a4aba7deddb..7fe532258fed63896ee0ef36ffe3f3083d02cf12 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>Originally written: 3/14/2012; last Web page update: 4/9/2012, referencing rEFInd 0.2.5</p>
+  <p>Originally written: 3/14/2012; last Web page update: 4/14/2012, referencing rEFInd 0.2.6</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 978a70e53fcbd04fb9367909aa77a8a80242ff9e..048807cd199baac3caf46cecd673343439687feb 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>Originally written: 3/14/2012; last Web page update: 4/9/2012, referencing rEFInd 0.2.5</p>
+  <p>Originally written: 3/14/2012; last Web page update: 4/14/2012, referencing rEFInd 0.2.6</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>
@@ -147,13 +147,13 @@ Filesystem     1K-blocks  Used Available Use% Mounted on
 
 <p class="sidebar">One of the reasons I've abandoned rEFIt's GUI installation tools for Mac OS X is that there are several bug reports (such as <a href="https://sourceforge.net/tracker/index.php?func=detail&aid=3147364&group_id=161917&atid=821764">this one</a> and <a href="https://sourceforge.net/tracker/?func=detail&aid=3218104&group_id=161917&atid=821764">this one</a>) that the rEFIt installer may be causing filesystem corruption on disks over about 500 MiB. I don't have such a disk on my Mac, so I can't test solutions. Rather than risk other peoples' hard disks, I thought it best to revert to a manual installation proceudure that will, I hope, be less likely to cause problems.</p>
 
-<p>The procedure for installing rEFInd on a Mac is similar to that for installing it under Linux, except that you can install it to the OS X's system directory rather than to the ESP, and you must use the <tt>bless</tt> utility rather than <tt>efibootmgr</tt>. To be precise, you should follow these steps:</p>
+<p>The procedure for installing rEFInd on a Mac is similar to that for installing it under Linux, except that you can (and probably should) install it to the OS X's system directory or some other HFS+ partition rather than to the ESP, and you must use the <tt>bless</tt> utility rather than <tt>efibootmgr</tt>. To be precise, you should follow these steps:</p>
 
 <ol>
 
 <li>Open a Terminal window in which you'll type the following commands.</li>
 
-<li>If you want to install rEFInd on your ESP, you must first mount it. You can do this by typing <b><tt>mkdir /Volumes/esp</tt></b> followed by <b><tt>sudo mount_msdos /dev/disk0s1 /Volumes/esp</tt></b>. Note that this step is optional. Also, you may need to change <tt>/dev/disk0s1</tt> to something else if your ESP is at an unusual location. Use a tool such as my <a href="http://www.rodsbooks.com/gdisk/">GPT fdisk (<tt>gdisk</tt>)</a> to examine your partition table to find your ESP if necessary.</li>
+<li>If you want to install rEFInd on your ESP, you must first mount it. You can do this by typing <b><tt>mkdir /Volumes/esp</tt></b> followed by <b><tt>sudo mount_msdos /dev/disk0s1 /Volumes/esp</tt></b>. Note that this step is optional, and in fact I've had problems blessing a boot loader on the ESP, so I don't recommend doing this. Also, you may need to change <tt>/dev/disk0s1</tt> to something else if your ESP is at an unusual location. Use a tool such as my <a href="http://www.rodsbooks.com/gdisk/">GPT fdisk (<tt>gdisk</tt>)</a> to examine your partition table to find your ESP if necessary.</li>
 
 <li>Type <b><tt>sudo mkdir -p /efi/refind</tt></b> to create a suitable directory for rEFInd. If you want to place rEFInd on your ESP, you should adjust the pathname appropriately, as in <tt>/Volumes/esp/efi/refind</tt> if you mounted your ESP as described in the previous step. Alternatively, you can use the Finder to create the directory.</li>
 
@@ -163,11 +163,11 @@ Filesystem     1K-blocks  Used Available Use% Mounted on
 
 <li>If this is your first installation, type <b><tt>sudo mv /efi/refind/refind.conf-sample /efi/refind/refind.conf</tt></b> (adjusting the path as necessary) to rename the sample configuration file so that it will serve as a real configuration file. (Again, you can do this with the Finder, if you prefer.)</li>
 
-<li>Type <b><tt>sudo bless --setBoot --folder /efi/refind --file /efi/refind/refind_x64.efi</tt></b> to tell the computer to use rEFInd as the primary boot program. (Adjust the path and filename as necessary if you're placing rEFInd somewhere else or using the 32-bit version.) If you're installing rEFInd to an ESP (or to any partition other than the OS X system partition), you may need to add <b><tt>--mount <i>/Volumes/mounpoint</i></tt></b> to the command, where <tt><i>/Volumes/mounpoint</i></tt> is the location where you've mounted the partition.</li>
+<li>Type <b><tt>sudo bless --setBoot --folder /efi/refind --file /efi/refind/refind_x64.efi</tt></b> to tell the computer to use rEFInd as the primary boot program. (Adjust the path and filename as necessary if you're placing rEFInd somewhere else or using the 32-bit version.) In theory, you can bless a boot file on an ESP by adding <b><tt>--mount <i>/Volumes/mounpoint</i></tt></b> to the command, where <tt><i>/Volumes/mounpoint</i></tt> is the location where you've mounted the partition. In practice, though, I've never gotten this to work. (If you know the trick to blessing a boot program on an ESP, please <a href="mailto:rodsmith@rodsbooks.com">drop me a line</a>.)</li>
 
 </ol>
 
-<p>When you reboot, your Mac should bring up the rEFInd menu, and should continue to do so thereafter. If you make changes that break this association, you can re-run the <tt>bless</tt> command (if necessary, restoring the rEFInd files first). This might be necessary after installing system updates from Apple.</p>
+<p>When you reboot, your Mac should bring up the rEFInd menu, and should continue to do so thereafter. If you make changes that break this association, you can re-run the <tt>bless</tt> command (if necessary, restoring the rEFInd files first). This might be necessary after installing system updates from Apple or if you upgrade rEFInd to a newer version.</p>
 
 <p>If you're replacing rEFIt, you may discover that rEFInd works on the first boot, but the system reverts back to rEFIt or a direct boot to OS X on the second boot. To fix this problem, you can remove the rEFItBlesser program, which is located at <tt>/Library/StartupItems/rEFItBlesser</tt>. This program attempts to keep rEFIt set as the default boot loader, but it also has the purpose of protecting the computer from launching the wrong OS after waking from sleep. If you want that protection, my suggestion is to install rEFIt and rEFItBlesser and then replace the <tt>refit.efi</tt> file with <tt>refind_x64.efi</tt> or <tt>refind_ia32.efi</tt> (renaming it to <tt>refit.efi</tt>. Used in this way, rEFInd will still look for its own configuration file, <tt>refind.conf</tt>, so you'll need to move it but <i>not</i> rename it. If you don't move the icons from the rEFInd package, your icons will continue to look like rEFIt icons, and you'll be missing the new icons for specific Linux distributions that rEFInd provides.</p>
 
index 939e798799f34c7e443a3883efb38939e9990999..b31d20dc979e32cdbf27171e704f31029516863c 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>Originally written: 3/19/2012; last Web page update: 4/9/2012, referencing rEFInd 0.2.5</p>
+<p>Originally written: 3/19/2012; last Web page update: 4/14/2012, referencing rEFInd 0.2.6</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 bb06648ee832e7d8af34c3d618a0edaa7dd60ae3..9b39aadc6f235f72efaf6a91eb2a322a10c1b11a 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: 4/9/2012</p>
+<p>Last Web page update: 4/14/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>
@@ -93,6 +93,8 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <ul>
 
+<li><b>0.2.6 (4/14/2012)</b>&mdash;This version provides one bug fix and one new feature. The bug was introduced in version 0.2.5 and prevents rEFInd from identifying a Linux initial RAM disk file on some (but not all) EFI implementations. The new feature is the <tt>volume</tt> stanza token, which enables you to manually load a boot program from a filesystem other than the one from which rEFInd launched. You can specify a volume either by its label (as in <tt>volume KERNELS</tt> to load from the volume with a filesystem name <tt>KERNELS</tt>) or by number followed by a colon (as in <tt>volume 0:</tt> for the first filesystem or <tt>volume 1:</tt> for the second). See the <a href="configfile.html">Configuring the Boot Manager</a> page for more on this new feature.</li>
+
 <li><b>0.2.5 (4/9/2012)</b>&mdash;Icon-handling improvements are key in this version. I've fixed a bug that caused icons to be replaced with ugly "not-found" default icons when rEFInd was launched in certain ways. I've also added support for <tt>.VolumeIcon.icns</tt> and <tt>.VolumeBadge.icns</tt> files to set loader tags and disk-type badges, respectively. (See the <a href="configfile.html">configuration page</a> for details.) I've also fixed a bug that prevented rEFInd from finding the correct initial RAM disk for Linux kernels stored in the root directory of a partition.</li>
 
 <li><b>0.2.4 (4/5/2012)</b>&mdash;This version adds support for a new location for EFI shells (<tt>shell<tt class="variable">arch</tt>.efi</tt> in the ESP's root directory. It also adds two new <tt>refind.conf</tt> options: <tt>showtools</tt> and <tt>max_tags</tt>, and removes another one (<tt>disable</tt>). The options available in <tt>hideui</tt> are now essentially a combination of what <tt>disable</tt> and <tt>hideui</tt> did, minus functionality now present in <tt>showtools</tt>. I made these changes to reduce redundancy and to increase flexibility. See the <a href="configfile.html">Configuring the Boot Manager</a> page for details.</li>
index d9908ac6cd1bf4c25b7862a7ed728b5b534eb34e..f1a69ecebace73a2f2cbc3c7d0e6342ab823fc30 100644 (file)
@@ -119,7 +119,7 @@ program. I'm not sure what you'd use in Windows to create ICNS files.</li>
 
 <li>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.</li>
 
-<li>I want to be able to specify the volume on which a boot loader resides using features other than the filesystem's name/label. I used the label because this feature was easily extracted from the data structures that rEFInd maintains (inherited from rEFIt). A number would also be fairly easy to implement, but would be arbitrary and therefore difficult to predict. A partition GUID value would be good, but extracting a GUID from the partition data is harder than extracting the volume's label.</li>
+<li>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.</li>
 
 <li>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).</li>
 
index 2c93755b1e020d8bc792daafc4b4c538a99730fe..c8df001a4502bb1bc8c077b0470d2b1c5d21675e 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>Originally written: 3/14/2012; last Web page update: 4/9/2012, referencing rEFInd 0.2.5</p>
+  <p>Originally written: 3/14/2012; last Web page update: 4/14/2012, referencing rEFInd 0.2.6</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>
@@ -101,7 +101,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <p>If you don't press any key before the timeout (shown on the last line) expires, the default boot loader will launch. This is normally the first item in the menu, but you can adjust the default by editing the configuration file. (In this example, it's the SUSE loader, which is further identified by text above the timeout as <i>Linux 3.3.0-rc7 from ESP.</i>)</p>
 
-<p>This display is dominated by the central set of icons, which in this example includes icons for OS X, Windows, Ubuntu, a generic Linux installation (ELILO, in fact), SUSE, and an unkown boot loader. All but the last of these are on hard disks, but the unknown boot loader is on an optical disc, as revealed by the small icons in the lower-right corner of the OS icons.</p>
+<p>This display is dominated by the central set of icons, which in this example includes icons for OS X, Windows, Ubuntu, a generic Linux installation (ELILO, in fact), SUSE, and an unkown boot loader. All but the last of these are on hard disks, but the unknown boot loader is on an optical disc, as revealed by the small icons (known as <i>badges</i>) in the lower-right corner of the OS icons.</p>
 
 <p>In this example, the SUSE tag is selected. You can move the selection left by pressing the left or down arrow key and right by pressing the right or up arrow key. If your system has many boot loaders, an arrow icon will appear to the right of the boot loader list, indicating that the boot loader list will scroll when you move off the right edge. If you do this, an arrow icon will appear to the left of the icon list, indicating that you can scroll back in a similar manner. Moving past the final selection or using the Page Down key moves the selection to the second row of small icons, which launch ancillary programs or perform special actions. In this figure, these five icons are present:</p>
 
index 1c0d57ba9aac2017fd08e1a4be7a81257e7b5fa2..7e3cb2cdff61ecb28e96d5b219aaa551f7e5a9fd 100644 (file)
@@ -93,6 +93,10 @@ scanfor internal,external,optical
 # ("{"). Each entry ends with a close curly brace ("}"). Common
 # keywords within each stanza include:
 #
+#  volume    - identifies the filesystem from which subsequent files
+#              are loaded. You can specify the volume by label or by
+#              a number followed by a colon (as in "0:" for the first
+#              filesystem or "1:" for the second).
 #  loader    - identifies the boot loader file
 #  initrd    - Specifies an initial RAM disk file
 #  icon      - specifies a custom boot loader icon
@@ -125,14 +129,16 @@ scanfor internal,external,optical
 # and adjust the entries to suit your needs.
 
 # A sample entry for a Linux 3.3 kernel with its new EFI boot stub
-# support. This includes Linux-specific boot options and specification
-# of an initial RAM disk. Note uses of Linux-style forward slashes,
-# even in the initrd specification. Also note that a leading slash is
-# optional in file specifications.
+# support on a filesystem called "KERNELS". This entry includes
+# Linux-specific boot options and specification of an initial RAM disk.
+# Note uses of Linux-style forward slashes, even in the initrd
+# specification. Also note that a leading slash is optional in file
+# specifications.
 menuentry Linux {
-       loader EFI/Linux/bzImage-3.3.0-rc7
-       initrd EFI/Linux/initrd-3.3.0.img
        icon EFI/refind/icons/os_linux.icns
+       volume KERNELS
+       loader bzImage-3.3.0-rc7
+       initrd initrd-3.3.0.img
        options "ro root=UUID=5f96cafa-e0a7-4057-b18f-fa709db5b837"
        disabled
 }
index 8f955e142cebad0b3f192f6f075cdaca6b49c233..8016931c5f5bb83d454a414e3c6a080ab6876fed 100644 (file)
@@ -389,7 +389,7 @@ VOID ReadConfig(VOID)
 
         } else if (StriCmp(TokenList[0], L"default_selection") == 0) {
             HandleString(TokenList, TokenCount, &(GlobalConfig.DefaultSelection));
-            
+
         } else if (StriCmp(TokenList[0], L"textonly") == 0) {
             GlobalConfig.TextOnly = TRUE;
 
@@ -461,24 +461,40 @@ static VOID AddSubmenu(LOADER_ENTRY *Entry, REFIT_FILE *File, REFIT_VOLUME *Volu
    Entry->me.SubScreen = SubScreen;
 } // VOID AddSubmenu()
 
-// Finds a volume with the specified Identifier (a volume label, for the moment).
-// If found, sets *Volume to point to that volume. If not, leaves it unchanged.
+// Finds a volume with the specified Identifier (a volume label or a number
+// followed by a colon, for the moment). If found, sets *Volume to point to
+// that volume. If not, leaves it unchanged.
 // Returns TRUE if a match was found, FALSE if not.
 static BOOLEAN FindVolume(REFIT_VOLUME **Volume, CHAR16 *Identifier) {
-   UINTN     i = 0;
+   UINTN     i = 0, CountedVolumes = 0;
+   INTN      Number = -1;
    BOOLEAN   Found = FALSE;
 
+   if ((StrLen(Identifier) >= 2) && (Identifier[StrLen(Identifier) - 1] == L':') &&
+       (Identifier[0] >= L'0') && (Identifier[0] <= L'9')) {
+      Number = (INTN) Atoi(Identifier);
+   }
    while ((i < VolumesCount) && (!Found)) {
-      if (StriCmp(Identifier, Volumes[i]->VolName) == 0) {
-         *Volume = Volumes[i];
-         Found = TRUE;
-      } // if
+      if (Number >= 0) { // User specified a volume by number
+         if (Volumes[i]->IsReadable) {
+            if (CountedVolumes == Number) {
+               *Volume = Volumes[i];
+               Found = TRUE;
+            }
+            CountedVolumes++;
+         } // if
+      } else { // User specified a volume by label
+         if (StriCmp(Identifier, Volumes[i]->VolName) == 0) {
+            *Volume = Volumes[i];
+            Found = TRUE;
+         } // if
+      } // if/else
       i++;
    } // while()
    return (Found);
 } // static VOID FindVolume()
 
-// Adds the options from a SINGLE loaders.conf stanza to a new loader entry and returns
+// Adds the options from a SINGLE refind.conf stanza to a new loader entry and returns
 // that entry. The calling function is then responsible for adding the entry to the
 // list of entries.
 static LOADER_ENTRY * AddStanzaEntries(REFIT_FILE *File, REFIT_VOLUME *Volume, CHAR16 *Title) {
index 63bc00802d066f440e29237601fb098b60f0cddd..9489beee85b5e8514dd95a500cd61402c0c70cd0 100644 (file)
@@ -105,6 +105,7 @@ typedef struct {
    EFI_BLOCK_IO        *WholeDiskBlockIO;
    EFI_DEVICE_PATH     *WholeDiskDevicePath;
    MBR_PARTITION_INFO  *MbrPartitionTable;
+   BOOLEAN             IsReadable;
 } REFIT_VOLUME;
 
 typedef struct _refit_menu_entry {
index 18ab99735b892ee361d45993c2541881cd34bc0f..e78ae6a341edfbfa2adaaffeb223e84a9e433e97 100644 (file)
@@ -579,7 +579,10 @@ static VOID ScanVolume(IN OUT REFIT_VOLUME *Volume)
     // open the root directory of the volume
     Volume->RootDir = LibOpenRoot(Volume->DeviceHandle);
     if (Volume->RootDir == NULL) {
+        Volume->IsReadable = FALSE;
         return;
+    } else {
+        Volume->IsReadable = TRUE;
     }
 
     // get volume name
index e97be6243d758a7a4014b4673533a25ec368444e..5e8496e0156f4f1b72f8216b9f7a99ec2d849f88 100644 (file)
@@ -83,7 +83,7 @@ static VOID AboutrEFInd(VOID)
 {
     if (AboutMenu.EntryCount == 0) {
         AboutMenu.TitleImage = BuiltinIcon(BUILTIN_ICON_FUNC_ABOUT);
-        AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.2.5.2");
+        AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.2.6");
         AddMenuInfoLine(&AboutMenu, L"");
         AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2006-2010 Christoph Pfisterer");
         AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2012 Roderick W. Smith");
@@ -650,9 +650,8 @@ static VOID ScanLoaderDir(IN REFIT_VOLUME *Volume, IN CHAR16 *Path)
                 SPrint(FileName, 255, L"\\%s\\%s", Path, DirEntry->FileName);
           else
                 SPrint(FileName, 255, L"\\%s", DirEntry->FileName);
-          // TODO: Sort loader entries by date/time, most recent first
           AddLoaderEntry(FileName, NULL, Volume);
-       } // while()
+       }
        Status = DirIterClose(&DirIter);
        if (Status != EFI_NOT_FOUND) {
           if (Path)