-0.5.1 (??/??/201?):
+0.5.1 (12/11/2012):
-------------------
+- Added support for "0" options to "textonly" and "scan_all_linux_kernels"
+ to reverse the usual meaning of these tokens. This is useful for
+ including these options in a secondary configuration file called with the
+ new "include" token to override a setting set in the main file.
+
+- Added "include" token for refind.conf, to enable including a secondary
+ configuration file from a primary one.
+
+- Modified install.sh so that it creates a simple refind_linux.conf file in
+ /boot, if that file doesn't already exist and if install.sh is run from
+ Linux. If that directory happens to be on a FAT, HFS+, ext2fs, ext3fs, or
+ ReiserFS volume, and if the necessary drivers are installed, the result
+ is that rEFInd will detect the Linux installation with no further
+ configuration on many systems. (Some may still require tweaking of kernel
+ options, though; for instance, adding "dolvm" on Gentoo systems that use
+ LVM.)
+
+- Added --shim and --localkeys options to install.sh to help simplify setup
+ on systems with Secure Boot active.
+
+- Fixed (maybe) bug that caused resolution options to not be displayed on
+ recent Macs with GOP graphics when specifying an invalid resolution in
+ refind.conf.
+
- Fixed bug that caused some programs (EFI shells, in particular) to hang
when launching on some systems (DUET, in particular).
href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>\r
\r
<p>Originally written: 3/14/2012; last Web page update:\r
-12/6/2012, referencing rEFInd 0.5.0</p>\r
+12/11/2012, referencing rEFInd 0.5.1</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
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/11/2012, referencing rEFInd 0.5.1</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>
</tr>
<tr>
<td><tt>textonly</tt></td>
- <td>None</td>
- <td>rEFInd defaults to a graphical mode; however, if you prefer to do without the flashy graphics, you can run it in text mode by including this option.</td>
+ <td>None or <tt>0</tt></td>
+ <td>rEFInd defaults to a graphical mode; however, if you prefer to do without the flashy graphics, you can run it in text mode by including this option. Passing any option but <tt>0</tt> causes text mode to be used; passing a <tt>0</tt> causes graphics mode to be used. (This could be useful if you want to override a text-mode setting in an included secondary configuration file.)</td>
</tr>
<tr>
<td><tt>resolution</tt></td>
</tr>
<tr>
<td><tt>scan_all_linux_kernels</tt></td>
- <td>None</td>
- <td>When set, causes rEFInd to add Linux kernels (files with names that begin with <tt>vmlinuz</tt> or <tt>bzImage</tt>) to the list of EFI boot loaders, even if they lack <tt>.efi</tt> filename extensions. The hope is that this will simplify use of rEFInd on distributions that provide kernels with EFI stub loader support but that don't give those kernels names that end in <tt>.efi</tt>. Of course, the kernels must still be stored on a filesystem that rEFInd can read, and in a directory that it scans. (<a href="drivers.html">Drivers</a> and the <tt>also_scan_dirs</tt> options can help with those issues.) Note that this option can cause unwanted files to be improperly detected and given loader tags, such as older kernels without EFI stub loader support. Versions of rEFInd prior to 0.5.0 left this option commented out in the <tt>refind.conf-sample</tt> file, but as of version 0.5.0, this option is enabled in the default configuration file. The program default remains to not scan for such kernels, though, so you can delete or uncomment this option to keep them from appearing in your boot menu.</td>
+ <td>None or <tt>0</tt></td>
+ <td>When set, causes rEFInd to add Linux kernels (files with names that begin with <tt>vmlinuz</tt> or <tt>bzImage</tt>) to the list of EFI boot loaders, even if they lack <tt>.efi</tt> filename extensions. The hope is that this will simplify use of rEFInd on distributions that provide kernels with EFI stub loader support but that don't give those kernels names that end in <tt>.efi</tt>. Of course, the kernels must still be stored on a filesystem that rEFInd can read, and in a directory that it scans. (<a href="drivers.html">Drivers</a> and the <tt>also_scan_dirs</tt> options can help with those issues.) Note that this option can cause unwanted files to be improperly detected and given loader tags, such as older kernels without EFI stub loader support. Versions of rEFInd prior to 0.5.0 left this option commented out in the <tt>refind.conf-sample</tt> file, but as of version 0.5.0, this option is enabled in the default configuration file. The program default remains to not scan for such kernels, though, so you can delete or uncomment this option to keep them from appearing in your boot menu. Passing any option but <tt>0</tt> causes scans for all kernels to occur; passing a <tt>0</tt> causes these kernels to not be scanned. (This could be useful if you want to override a setting of <tt>scan_all_linux_kernels</tt> in an included secondary configuration file.)</td>
</tr>
<tr>
<td><tt>default_selection</tt></td>
<td>A substring of a boot loader's title; or a numeric position</td>
<td>Sets the default boot OS based on the loader's title, which appears in the main menu beneath the icons when you select the loader. You can enter any substring of the title as the <tt>default_selection</tt>, so long as it's two or more characters in length. It's best to use a unique substring, since rEFInd stops searching when it finds the first match. Because rEFInd sorts entries within a directory in descending order by file modification time, if you specify a directory (or volume name, for loaders in a partition's root directory) as the <tt>default_selection</tt>, the most recent loader in that directory will be the default. One-character entries are matched against the first character of the title, except for digits, which refer to the numeric order of the boot loader entries.</td>
</tr>
+<tr>
+ <td><tt>include</tt></td>
+ <td>filename</td>
+ <td>Includes the specified file into the current configuration file. Essentially, the included file replaces the <tt>include</tt> line, so positioning of this token is important if the included file includes options that contradict those in the main file. The included file must reside in the same directory as the rEFInd binary and the main configuration file. This option is valid only in the main configuration file; included files may not include third-tier configuration files.</td>
+</tr>
</table>
<p>Prior to version 0.2.4, rEFInd supported a token called <tt>disable</tt>, whose function partially overlapped with <tt>hideui</tt>. Version 0.2.4 merges many of the features of these two tokens into <tt>hideui</tt> and creates the new <tt>showtools</tt> option, which provides the remaining functionality in a more flexible way.</p>
href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
<p>Originally written: 4/19/2012; last Web page update:
-12/6/2012, referencing rEFInd 0.5.0</p>
+12/11/2012, referencing rEFInd 0.5.1</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>
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/11/2012, referencing rEFInd 0.5.1</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>
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/11/2012, referencing rEFInd 0.5.1</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>
<ul>
<li><b><a
- href="http://sourceforge.net/projects/refind/files/0.5.0/refind-src-0.5.0.zip/download">A
+ href="http://sourceforge.net/projects/refind/files/0.5.1/refind-src-0.5.1.zip/download">A
source code zip file</a></b>—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
possible, but I've not attempted it.</li>
<li><b><a
- href="http://sourceforge.net/projects/refind/files/0.5.0/refind-bin-0.5.0.zip/download">A
+ href="http://sourceforge.net/projects/refind/files/0.5.1/refind-bin-0.5.1.zip/download">A
binary zip file</a></b>—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
<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.0/refind-cd-0.5.0.zip/download">A
+ href="http://sourceforge.net/projects/refind/files/0.5.1/refind-cd-0.5.1.zip/download">A
CD-R image file</a></b>—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
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/11/2012, referencing rEFInd 0.5.1</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>
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/11/2012, referencing rEFInd 0.5.1</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>
though; because of the popularity of dual boots with Windows on Macs,
the BIOS/legacy scans are enabled by default on Macs.</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
+ 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 (for instance by passing
+ <tt>--drivers</tt> to the script), 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—for instance, to add <tt>dolvm</tt> to the boot options on
+ Gentoo systems that use LVM.</li>
+
</ul>
<p>In addition to these quirks, you should be aware of some options that <tt>install.sh</tt> supports to enable you to customize your installation in various ways. The syntax for <tt>install.sh</tt> is as follows:</p>
href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
<p>Originally written: 3/19/2012; last Web page update:
-12/6/2012, referencing rEFInd 0.5.0</p>
+12/11/2012, referencing rEFInd 0.5.1</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>
<p>Windows and Mac OS X both provide relatively simple EFI boot loader programs. Launch them, and if they're launched from the correct locations and have the correct files in place, they'll boot their respective OSes. This makes rEFInd's job easy; it just locates the boot loader program files and runs them.</p>
-<p>Under Linux, by contrast, things can get complicated. As detailed on my <a href="http://www.rodsbooks.com/efi-bootloaders/index.html">Managing EFI Boot Loaders for Linux</a> page, several different EFI boot loaders for Linux exist, and all of them require configuration. If you're lucky, your distribution will have set up a Linux boot loader in a sensible way, in which case rEFInd should detect it and it will work as easily as a Windows or Mac OS X boot loader. If you're not lucky, though, you may need to configure it further. rEFInd offers options to help out with this task. Specifically, you can use a traditional Linux boot loader or configure an EFI stub loader.</p>
+<p>Under Linux, by contrast, things can get complicated. As detailed on my <a href="http://www.rodsbooks.com/efi-bootloaders/index.html">Managing EFI Boot Loaders for Linux</a> page, several different EFI boot loaders for Linux exist, and all of them require configuration. If you're lucky, your distribution will have set up a Linux boot loader in a sensible way, in which case rEFInd should detect it and it will work as easily as a Windows or Mac OS X boot loader. If you're not lucky, though, you may need to configure it further. rEFInd offers options to help out with this task. Naturally, rEFInd supports <a href="#traditional">traditional Linux boot loaders.</a> It works even better with the Linux EFI stub loader, so I provide <a href="#quickstart">instructions on starting with it.</a> For those interested in manual configuration, I also provide <a href="#efistub">detailed instructions</a> on how the EFI stub support works and how to configure it.</p>
+<a name="traditional">
<h2>Using a Traditional Linux Boot Loader</h2>
+</a>
-<p>I consider <a href="http://www.rodsbooks.com/efi-bootloaders/elilo.html">ELILO,</a> <a href="http://www.rodsbooks.com/efi-bootloaders/grub_legacy.html">GRUB Legacy,</a> and <a href="http://www.rodsbooks.com/efi-bootloaders/grub2.html">GRUB 2</a> to be traditional Linux boot loaders. These programs all exist as EFI programs that are independent of the Linux kernel, but that can load a kernel and hand off control to it. All three programs have their own configuration files that reside in the same directory as the boot loader itself (or optionally elsewhere, in the case of GRUB 2).</p>
+<p>I consider <a href="http://www.rodsbooks.com/efi-bootloaders/elilo.html">ELILO,</a> <a href="http://www.rodsbooks.com/efi-bootloaders/grub_legacy.html">GRUB Legacy,</a> and <a href="http://www.rodsbooks.com/efi-bootloaders/grub2.html">GRUB 2</a> to be traditional Linux boot loaders. These programs all exist independent of the Linux kernel, but they can load a kernel and hand off control to it. All three programs have their own configuration files that reside in the same directory as the boot loader itself (or optionally elsewhere, in the case of GRUB 2).</p>
<p>Ordinarily, rEFInd will detect these traditional boot loaders and provide main menu entries for them. If the boot loader exists in a directory with a name that matches a Linux distribution's icon filename, you'll automatically get a distribution-specific icon to refer to the boot loader.</p>
<p>If you prefer, you can disable automatic scanning and create an entry in <tt>refind.conf</tt> for your distribution, as described on the <a href="configfile.html">Configuring the Boot Manager</a> page. This method is harder to set up but can be preferable if you want to customize your options.</p>
-<h2>Using the EFI Stub Loader</h2>
+<a name="quickstart">
+<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>
+
+<a name="testing">
+<h3>Testing the EFI Stub Loader</h3>
+</a>
+
+<p>If you're not sure you want to use the EFI stub loader in the long term, you can perform a fairly quick initial test of it. This procedure assumes that you have access to a 3.3.0 or later Linux kernel with EFI stub support compiled into it. (Fedora 17, Ubuntu 12.10, and probably other distributions ship with such kernels.) Creating this configuration poses no risk to your current boot options, provided you don't accidentally delete existing files. The procedure for a quick test is:</p>
+
+<ol>
+
+<li>Copy your kernel file (<tt>vmlinuz-*</tt>) and matching initial RAM
+ disk file (<tt>init*</tt>) from <tt>/boot</tt> to a subdirectory of
+ <tt>EFI</tt> on your ESP. Your distribution's directory there should
+ work fine. For instance, typing <tt class="userinput">cp
+ /boot/vmlinuz-3.6.7-4.fc17.x86_64
+ /boot/initramfs-3.6.7-4.fc17.x86_64.img /boot/efi/EFI/redhat</tt> might
+ do the trick on a Fedora system, although you'll probably have to
+ adjust the version numbers. Note that the filename forms vary from one
+ distribution to another, so don't worry if yours look different from
+ these. Be sure that you match up the correct files by version number,
+ though.</li>
+
+<li>Copy the <tt>/boot/refind_linux.conf</tt> file to the same directory to
+ which you copied your kernel. If this file doesn't exist, create it by
+ running (as <tt>root</tt>) the <tt>mkrlconf.sh</tt> script that came
+ with rEFInd.</li>
+
+<li>Reboot. You should now see a new entry for launching the Linux kernel
+ that you copied. Try the option. If it works, great. If not, you may
+ need to adjust your <tt>refind_linux.conf</tt> file. See the <a
+ href="#efistub">detailed configuration section</a> for a description of
+ this file's format. If the kernel begins to boot but complains that it
+ couldn't find its root filesystem, double-check the version numbers on
+ your kernel and initial RAM disk file, and check the <tt>root=</tt>
+ option in <tt>refind_linux.conf</tt>.</li>
+
+</ol>
+
+<p>You can continue to boot your computer with this type of configuration; however, the drawback is that you'll need to copy your kernel whenever it's updated. This can be a hassle. A better way is to configure you system so that the EFI, and therefore rEFInd, can read your Linux <tt>/boot</tt> directory, where most Linux distributions place their kernels.</p>
+
+<a name="longterm">
+<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). If you're currently booting via GRUB 2, it is likely to cease working when you try this, although GRUB should be recoverable by re-installing it. (On the other hand, GRUB will become redundant once this method of booting starts working so you might prefer to remove it completely.) You should perform the following steps as <tt>root</tt>, or precede each of these commands with <tt>sudo</tt>:</p>
+
+<ol>
+
+<li>Begin with your ESP mounted at <tt>/boot/efi</tt>, which is the most
+ common location. If it's not mounted there, type <tt
+ class="userinput">mount /dev/sda1 /boot/efi</tt> to do so (adjusting
+ <tt>/dev/sda1</tt>, if necessary), or mount it elsewhere and adjust the
+ paths in the following procedure as necessary.</li>
+
+<li>Check the size of the ESP by typing <tt class="userinput">df -h
+ /boot/efi</tt>. The ESP must be large enough to hold several Linux
+ kernels and initial RAM disk files—100MiB at a bare minimum, and
+ preferably 200–500MiB.</li>
+
+<li>Check your <tt>/boot</tt> directory to be sure it contains no links or
+ other files that rely on Unix/Linux-style permissions or ownership. If
+ it does, don't proceed, or at least research these files further to
+ determine if you can work around the need for such permissions and
+ ownership.</li>
+
+<li>Type <tt class="userinput">mv /boot/* /boot/efi</tt>. You'll see an
+ error message about being unable to move <tt>/boot/efi</tt> into
+ itself. Ignore this.</li>
+
+<li>Type <tt class="userinput">umount /boot/efi</tt>.</li>
+
+<li>Edit <tt>/etc/fstab</tt> and change the mount point for
+ <tt>/boot/efi</tt> to <tt>/boot</tt>. If the ESP isn't present in
+ <tt>/etc/fstab</tt>, you must create an entry for it, with a mount
+ point of <tt>/boot</tt>.</li>
+
+<li>Type <tt class="userinput">mount -a</tt> to re-mount everything,
+ including <tt>/boot</tt>. Check that your normal <tt>/boot</tt> files
+ are all present, along with the new <tt>/boot/EFI</tt> directory, which
+ holds what used to be <tt>/boot/efi/EFI</tt>. If something seems to be
+ missing (other than <tt>/boot/efi</tt> with a lowercase <tt>efi</tt>),
+ then you should try to correct the problem.</li>
+
+<li>If it doesn't already exist, create a file called
+ <tt>/boot/refind_linux.conf</tt> and populate it with kernel options,
+ as described <a href="#refind_linux">later.</a> If this file doesn't
+ already exist, the easiest way to create it is to run the
+ <tt>mkrlconf.sh</tt> script that comes with rEFInd 0.5.1 and
+ later.</li>
+
+<li>Check your <tt>refind.conf</tt> file (presumably in
+ <tt>/boot/EFI/refind</tt>) to be sure that the
+ <tt>scan_all_linux_kernels</tt> line is uncommented. If it's not,
+ uncomment that line.</li>
+
+<li>Optionally, type <tt class="userinput">cp
+ /boot/EFI/refind/icons/os_<i>name</i>.icns /boot/.VolumeIcon.icns</tt>
+ to give loaders in <tt>/boot</tt> an icon for your distribution.</li>
+
+<li>Reboot to test that this configuration works.</li>
+
+</ol>
+
+<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 may be desirable. 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; 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–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. 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>
+</a>
<p>The Linux <a href="http://www.rodsbooks.com/efi-bootloaders/efistub.html">EFI stub loader</a> is a way to turn a Linux kernel into an EFI application. In a sense, the kernel becomes its own boot loader. This approach to booting Linux is very elegant in some ways, but as described on the page to which I just linked, it has its disadvantages, too. One challenge to booting in this way is that modern Linux installations typically require that the kernel be passed a number of options at boot time. These tell the kernel where the Linux root (<tt>/</tt>) filesystem is, where the initial RAM disk is, and so on. Without these options, Linux won't boot. These options are impossible for a generic boot loader to guess without a little help. It's possible to build a kernel with a default set of options, but this is rather limiting. Thus, rEFInd provides configuration options to help.</p>
might set inappropriate options for another distribution. This is a problem
that's been a minor annoyance for years under BIOS, since the same
potential for poor configuration applies to LILO, GRUB Legacy, and GRUB 2
-on BIOS. The most reliable solution there is to chainload one boot loader
-to another. The same solution is possible under EFI, but rEFInd offers
-another possibility.</p>
+on BIOS. The most reliable solution under BIOS is to chainload one boot
+loader to another. The same solution is possible under EFI, but rEFInd
+offers another possibility.</p>
<p>rEFInd 0.2.1 and later supports semi-automatic Linux EFI stub loader detection. This feature works as part of the standard boot loader scan operation, but it extends it as follows:</p>
with version 0.3.0, if you uncomment the
<tt>scan_all_linux_kernels</tt> option in <tt>refind.conf</tt>, rEFInd
will also scan for kernels <i>without</i> a <tt>.efi</tt> filename
- extension. This option is not the default, though, because it can pick
- up old kernels that lack EFI stub loader support and even non-kernel
- files.</li>
+ extension. This option is uncommented by default, but if you comment it
+ out, delete it, or change it to read <tt>scan_all_linux_kernels 0</tt>,
+ rEFInd won't scan for kernels that lack <tt>.efi</tt> filename
+ extensions.</li>
<p class="sidebar">A kernel whose filename lacks a version string matches an initial RAM disk that also lacks a version string in its filename. Note that you can reliably use only <i>one</i> kernel and initial RAM disk per directory that lack version numbers in their filenames.</p>
booting from an auto-detected kernel. It consists of a series of lines,
each of which consists of a label followed by a series of kernel
options. The first line sets default options, and subsequent lines set
- options that are accessible from the main menu tag's submenu
- screen.</li>
+ options that are accessible from the main menu tag's submenu screen. If
+ you installed rEFInd 0.5.1 or later with the <tt>install.sh</tt>
+ script, that script created a sample <tt>refind_linux.conf</tt> file,
+ customized for your computer, in <tt>/boot</tt>. This file will work
+ without changes on many installations, but you may need to tweak it for
+ some.</li>
</ol>
-<p>The intent of this system is that distribution maintainers can place their kernels, initial RAM disks, and a <tt>refind_linux.conf</tt> file in their own subdirectory on the ESP. rEFInd will detect their kernels and create one main menu entry for each kernel. Each entry will implement as many options as there are lines in the <tt>refind_linux.conf</tt> file. In this way, two or more distributions can each maintain their boot loader entries, without being too concerned about who maintains rEFInd as a whole.</p>
+<p>The intent of this system is that distribution maintainers can place their kernels, initial RAM disks, and a <tt>refind_linux.conf</tt> file in their own subdirectories on the ESP, on EFI-accessible <tt>/boot</tt> partitions, or in <tt>/boot</tt> directories on EFI-accessible Linux root (<tt>/</tt>) partitions. rEFInd will detect these kernels and create one main menu entry for each kernel. Each entry will implement as many options as there are lines in the <tt>refind_linux.conf</tt> file. In this way, two or more distributions can each maintain their boot loader entries, without being too concerned about who maintains rEFInd as a whole.</p>
<p>The <tt>scan_all_linux_kernels</tt> option is intended to help users and distribution maintainers when rEFInd is used in conjunction with a Linux filesystem driver for EFI or when the ESP is mounted as the Linux <tt>/boot</tt> partition. In these cases, if all the kernels in Linux's <tt>/boot</tt> directory include EFI stub loader support, rEFInd will automatically detect and use kernels installed in the usual way, such as via an automatic system update. You won't even need to move or rename your kernels. You will need to set up a <tt>refind_linux.conf</tt> file and you may need to install a driver or set the <tt>also_scan_dirs</tt> option in <tt>refind.conf</tt>; but these are one-time requirements. Set up in this way, ongoing maintenance to handle kernel updates drops to zero!</p>
<p>When rEFInd scans this directory, it will find two EFI boot loaders in <tt>EFI/ubuntu</tt>: <tt>grubx64.EFI</tt> and <tt>bzImage-3.3.0.efi</tt>. rEFInd will create two main-menu tags for these two loaders, one of which will launch Ubuntu's standard GRUB and the other of which will launch the 3.3.0 kernel file directly. The <tt>refind_linux.conf</tt> file contains a list of labels and options:</p>
+<a name="refind_linux">
<pre class="listing">
"Boot with defaults" "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"
</pre>
+</a>
<p>Ordinarily, both fields in this file must be enclosed in quotes. If you have to pass an option that includes quotes, you can do so by doubling up on them, as in <tt>"root=/dev/sdb9 my_opt=""this is it"""</tt>, which passes <tt>root=/dev/sdb9 my_opt="this is it"</tt> to the shell. You can include as much white space as you like between options. You can also place comments in the file, or remove an option by commenting it out with a leading hash mark (<tt>#</tt>), as in the fourth line in this example.</p>
<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>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>
<ul>
<p class="subhead">by Roderick W. Smith, <a
href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
-<p>Last Web page update: 12/6/2012</p>
+<p>Last Web page update: 12/11/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>
<ul>
-<li><b>0.5.0 (12/5/2012)</b>—I've focused on adding support for Matthew J. Garrett's shim program to this version of rEFInd; with this support, rEFInd is capable of launching Linux kernels and other programs signed with a suitable key while the computer is in Secure Boot mode. This initial release, however, requires significant manual configuration and has some known bugs and limitations. See the <a href="secureboot.html">Managing Secure Boot</a> page for details. Beyond this major new feature, this version includes several more minor improvements. These include a change to the <tt>resolution</tt> token so that it applies to text mode as well as to graphics mode; a bug fix that caused the line editor to blank out lines that were left unedited; a new <tt>dont_scan_files</tt> option to blacklist boot programs by filename; support for launching MokManager and Apple's Recovery HD partitions via tools (2nd-row) icons; new <tt>--usedefault</tt> and <tt>--drivers</tt> options to the <tt>install.sh</tt> script; a change of the <tt>esp</tt> installation script option to <tt>--esp</tt>; and the ability to use quote marks inside option strings by doubling them up.</li>
+<li><b>0.5.1 (12/11/2012)</b>—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>
+
+<li><b>0.5.0 (12/6/2012)</b>—I've focused on adding support for Matthew J. Garrett's shim program to this version of rEFInd; with this support, rEFInd is capable of launching Linux kernels and other programs signed with a suitable key while the computer is in Secure Boot mode. This initial release, however, requires significant manual configuration and has some known bugs and limitations. See the <a href="secureboot.html">Managing Secure Boot</a> page for details. Beyond this major new feature, this version includes several more minor improvements. These include a change to the <tt>resolution</tt> token so that it applies to text mode as well as to graphics mode; a bug fix that caused the line editor to blank out lines that were left unedited; a new <tt>dont_scan_files</tt> option to blacklist boot programs by filename; support for launching MokManager and Apple's Recovery HD partitions via tools (2nd-row) icons; new <tt>--usedefault</tt> and <tt>--drivers</tt> options to the <tt>install.sh</tt> script; a change of the <tt>esp</tt> installation script option to <tt>--esp</tt>; and the ability to use quote marks inside option strings by doubling them up.</li>
<li><b>0.4.7 (11/6/2012)</b>—The most important new feature in this version is a boot options editor. From rEFInd's main menu, press Insert or F2 to see the options menu. Select one of the options and press Insert or F2 again and the screen switches to a text-mode display in which you can edit the options that will be passed to the boot loader. A second new feature is a new icon for <a href="http://freedesktop.org/wiki/Software/gummiboot">gummiboot,</a> which is another EFI boot manager. This version also alters the behavior of the <tt>scan_delay</tt> option, since I've been told that the previous version didn't work; the new one does. Finally, this version omits the space that followed boot options when booting most OSes. This behavior was inherited from rEFIt; a comment in the source code indicates it's needed by OS X, but I've been told it causes boot failures when launching Linux on some Macs. Thus, rEFInd now adds this space only when booting Mac OS X.</li>
href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
<p>Originally written: 11/13/2012; last Web page update:
-12/8/2012, referencing rEFInd 0.5.0.1</p>
+12/11/2012, referencing rEFInd 0.5.1</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>
href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
<p>Originally written: 4/19/2012; last Web page update:
-12/6/2012, referencing rEFInd 0.5.0</p>
+12/11/2012, referencing rEFInd 0.5.1</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>
<tt>/usr/local/UDK2010/MyWorkSpace/MdeModulePkg/Core/Dxe/Image/Image.c</tt>
for the reference UEFI implementation. --> </li>
- <li>When launching ELILO in Secure Boot mode, ELILO can't find its
- configuration file. It's possible that a similar problem exists for
- other boot loaders, too.</li>
-
<li>When setting a resolution higher than about 800x600 (or maybe even
640x480) in text mode, the text displayed by rEFInd, and on some
systems shells and other programs launched from rEFInd, is
<ul>
- <li>With the arrival of PCs preloaded with Windows 8 and with Secure
- Boot enabled, some way to cope is in order. I'm thinking of adding
- code to limit or prohibit booting of unsigned boot loaders if
- rEFInd detects that Secure Boot is active, and link with the <a
- href="http://mjg59.dreamwidth.org/18945.html">Shim</a>
- pre-bootloader to help handle signing and authentication. I need to
- research the technical details more, though.</li>
-
<li>EFI supports network boots. rEFInd doesn't, but it would be nice if
it would.</li>
boot. Perhaps this could be done via a separate tool that could be
launched much like the shell or <tt>gptsync</tt>.</li>
- <li>I'd like to give the user the ability to set custom options on a
- single-boot basis, similar to what's possible in GRUB.</li>
-
<li>A way to set the color of the font would be useful for theming
purposes.</li>
written in a cross-platform GUI toolkit, so that a single code base
can be used on any of the major OSes.</li>
- <li>A way to "source" one configuration file from another one would be
- helpful for some types of configuration scripts. (This would enable
- overriding options in a secondary file without modifying the
- default original file, for instance.)</li>
-
</ul></li> <!-- New features -->
<li><b>Improvements to the EFI drivers:</b>
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/11/2012, referencing rEFInd 0.5.1</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>
#
# Revision history:
#
-# 0.5.1 -- Added --shim & --localkeys options
+# 0.5.1 -- Added --shim & --localkeys options & create sample refind_linux.conf
+# in /boot
# 0.5.0 -- Added --usedefault & --drivers options & changed "esp" option to "--esp"
# 0.4.5 -- Fixed check for rEFItBlesser in OS X
# 0.4.2 -- Added notice about BIOS-based OSes & made NVRAM changes in Linux smarter
TargetIA32="bootia32.efi"
shift
;;
+ --localkeys) LocalKeys=1
+ ;;
--shim) ShimSource=$2
shift
;;
--drivers) InstallDrivers=1
;;
- --localkeys) LocalKeys=1
- ;;
* ) echo "Usage: $0 [--esp | --usedefault {device-file}] [--drivers] "
- echo " [--localkeys] [--shim {shim-filename}]"
- echo "Aborting!"
+ echo " [--shim {shim-filename}] [--localkeys]"
exit 1
esac
shift
fi
} # AddBootEntry()
+# Create a minimal/sample refind_linux.conf file in /boot.
+GenerateRefindLinuxConf() {
+ if [[ ! -f /boot/refind_linux.conf ]] ; then
+ if [[ -f /etc/default/grub ]] ; then
+ # We want the default options used by the distribution, stored here....
+ source /etc/default/grub
+ fi
+ RootFS=`df / | grep dev | cut -f 1 -d " "`
+ StartOfDevname=`echo $RootFS | cut -b 1-7`
+ if [[ $StartOfDevname == "/dev/sd" || $StartOfDevName == "/dev/hd" ]] ; then
+ # Identify root filesystem by UUID rather than by device node, if possible
+ Uuid=`blkid -o export $RootFS 2> /dev/null | grep UUID=`
+ if [[ -n $Uuid ]] ; then
+ RootFS=$Uuid
+ fi
+ fi
+ DefaultOptions="$GRUB_CMDLINE_LINUX $GRUB_CMDLINE_LINUX_DEFAULT"
+ echo "\"Boot with standard options\" \"ro root=$RootFS $DefaultOptions \"" > $RLConfFile
+ echo "\"Boot to single-user mode\" \"ro root=$RootFS $DefaultOptions single\"" >> $RLConfFile
+ fi
+}
+
# Controls rEFInd installation under Linux.
# Sets Problems=1 if something goes wrong.
InstallOnLinux() {
CopyRefindFiles
if [[ $TargetDir != "/EFI/BOOT" ]] ; then
AddBootEntry
+ GenerateRefindLinuxConf
fi
} # InstallOnLinux()
ThisScript="$ThisDir/`basename $0`"
if [[ `whoami` != "root" ]] ; then
echo "Not running as root; attempting to elevate privileges via sudo...."
- sudo $ThisScript $1 $2 $3 $4 $5 $6
+ sudo $ThisScript "$@"
if [[ $? != 0 ]] ; then
echo "This script must be run as root (or using sudo). Exiting!"
exit 1
IN UINTN ScreenPosX, IN UINTN ScreenPosY);
VOID egDisplayMessage(IN CHAR16 *Text, EG_PIXEL *BGColor);
VOID egScreenShot(VOID);
+//UINT32 egGetGraphicsMode(VOID);
#endif /* __LIBEG_LIBEG_H__ */
}
}
+// // Returns current graphics mode number
+// UINT32 egGetGraphicsMode(VOID) {
+// UINT32 retval = 0;
+//
+// if (GraphicsOutput != NULL) {
+// retval = GraphicsOutput->Mode->Mode;
+// }
+//
+// return retval;
+// } // UINT32 egGetGraphicsMode()
+
// Sets the screen resolution to the specified value, if possible.
// If the specified value is not valid, displays a warning with the valid
// modes on UEFI systems, or silently fails on EFI 1.x systems. Note that
if ((Status == EFI_SUCCESS) && (Size >= sizeof(*Info)) &&
(Info->HorizontalResolution == ScreenWidth) && (Info->VerticalResolution == ScreenHeight)) {
Status = refit_call2_wrapper(GraphicsOutput->SetMode, GraphicsOutput, ModeNum);
+// if (Status == EFI_SUCCESS)
+// Status = refit_call2_wrapper(ST->ConOut->SetMode, ST->ConOut, ModeNum);
ModeSet = (Status == EFI_SUCCESS);
} // if
ModeNum++;
egScreenWidth = ScreenWidth;
egScreenHeight = ScreenHeight;
} else {// If unsuccessful, display an error message for the user....
+ SwitchToText(FALSE);
Print(L"Error setting mode %d x %d; using default mode!\nAvailable modes are:\n", ScreenWidth, ScreenHeight);
ModeNum = 0;
Status = EFI_SUCCESS;
ModeNum++;
} // while()
PauseForKey();
+ SwitchToGraphics();
} // if()
} else if (UgaDraw != NULL) { // UGA mode (EFI 1.x)
// Try to use current color depth & refresh rate for new mode. Maybe not the best choice
# 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 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
+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
cp $KeysDir/refind.cer $KeysDir/refind.crt ../snapshots/$1/refind-$1/
# Go there and prepare a souce code zip file....
cp --preserve=timestamps refind.conf-sample refind-bin-$1/refind/
$SBSign --key $KeysDir/refind.key --cert $KeysDir/refind.crt --output refind-bin-$1/refind/refind_x64.efi refind/refind_x64.efi
cp refind-bin-$1/refind/refind_x64.efi $StartDir
-cp -a COPYING.txt LICENSE.txt README.txt docs CREDITS.txt install.sh refind-bin-$1
+cp -a COPYING.txt LICENSE.txt README.txt docs CREDITS.txt install.sh mkrlconf.sh refind-bin-$1
# Prepare the final .zip file and clean up
cp $KeysDir/refind.cer $KeysDir/refind.crt refind-bin-$1/
#selection_small selection-small.bmp
# Use text mode only. When enabled, this option forces rEFInd into text mode.
+# Passing this option a "0" value causes graphics mode to be used. Pasing
+# it no value or any non-0 value causes text mode to be used.
+# Default is to use graphics mode.
#
#textonly
# want to give a kernel a custom icon by placing an icon with the kernel's
# filename but a ".icns" extension in the same directory as the kernel, this
# option will cause the icon file to show up as a non-functional loader tag.
+# Passing this option a "0" value causes kernels without ".efi" extensions
+# to NOT be scanned; passing it alone or with any other value causes all
+# kernels to be scanned.
# Default is to NOT scan for kernels without ".efi" extensions.
#
scan_all_linux_kernels
#
#default_selection 1
+# Include a secondary configuration file within this one. This secondary
+# file is loaded as if its options appeared at the point of the "include"
+# token itself, so if you want to override a setting in the main file,
+# the secondary file must be referenced AFTER the setting you want to
+# override. Note that the secondary file may NOT load a tertiary file.
+#
+#include manual.conf
+
# Sample manual configuration stanzas. Each begins with the "menuentry"
# keyword followed by a name that's to appear in the menu (use quotes
# if you want the name to contain a space) and an open curly brace
// constants
-#define CONFIG_FILE_NAME L"refind.conf"
#define LINUX_OPTIONS_FILENAMES L"refind_linux.conf,refind-linux.conf"
#define MAXCONFIGFILESIZE (128*1024)
} // static VOID HandleStrings()
// read config file
-VOID ReadConfig(VOID)
+VOID ReadConfig(CHAR16 *FileName)
{
EFI_STATUS Status;
REFIT_FILE File;
CHAR16 *FlagName;
UINTN TokenCount, i;
- if (!FileExists(SelfDir, CONFIG_FILE_NAME)) {
- Print(L"Configuration file missing!\n");
+ // Set a few defaults only if we're loading the default file.
+ if (StriCmp(FileName, CONFIG_FILE_NAME) == 0) {
+ MyFreePool(GlobalConfig.DontScanDirs);
+ GlobalConfig.DontScanDirs = StrDuplicate(SelfDirPath);
+ MyFreePool(GlobalConfig.DontScanFiles);
+ GlobalConfig.DontScanFiles = StrDuplicate(DONT_SCAN_FILES);
+ }
+
+ if (!FileExists(SelfDir, FileName)) {
+ Print(L"Configuration file '%s' missing!\n", FileName);
return;
}
- Status = ReadFile(SelfDir, CONFIG_FILE_NAME, &File, &i);
+ Status = ReadFile(SelfDir, FileName, &File, &i);
if (EFI_ERROR(Status))
return;
- MyFreePool(GlobalConfig.DontScanDirs);
- GlobalConfig.DontScanDirs = StrDuplicate(SelfDirPath);
- MyFreePool(GlobalConfig.DontScanFiles);
- GlobalConfig.DontScanFiles = StrDuplicate(DONT_SCAN_FILES);
-
for (;;) {
TokenCount = ReadTokenLine(&File, &TokenList);
if (TokenCount == 0)
HandleString(TokenList, TokenCount, &(GlobalConfig.DefaultSelection));
} else if (StriCmp(TokenList[0], L"textonly") == 0) {
- GlobalConfig.TextOnly = TRUE;
+ if ((TokenCount >= 2) && (StriCmp(TokenList[1], L"0") == 0)) {
+ GlobalConfig.TextOnly = FALSE;
+ } else {
+ GlobalConfig.TextOnly = TRUE;
+ }
} else if ((StriCmp(TokenList[0], L"resolution") == 0) && (TokenCount == 3)) {
GlobalConfig.RequestedScreenWidth = Atoi(TokenList[1]);
} // for (graphics_on tokens)
} else if (StriCmp(TokenList[0], L"scan_all_linux_kernels") == 0) {
- GlobalConfig.ScanAllLinux = TRUE;
+ if ((TokenCount >= 2) && (StriCmp(TokenList[1], L"0") == 0)) {
+ GlobalConfig.ScanAllLinux = FALSE;
+ } else {
+ GlobalConfig.ScanAllLinux = TRUE;
+ }
} else if (StriCmp(TokenList[0], L"max_tags") == 0) {
HandleInt(TokenList, TokenCount, &(GlobalConfig.MaxTags));
+ } else if ((StriCmp(TokenList[0], L"include") == 0) && (TokenCount == 2) && (StriCmp(FileName, CONFIG_FILE_NAME) == 0)) {
+ if (StriCmp(TokenList[1], FileName) != 0) {
+ ReadConfig(TokenList[1]);
+ }
+
}
FreeTokenLine(&TokenList, &TokenCount);
#define HIDEUI_FLAG_ARROWS (0x0010)
#define HIDEUI_ALL ((0xffff))
+#define CONFIG_FILE_NAME L"refind.conf"
#define DONT_SCAN_FILES L"shim.efi,MokManager.efi,TextMode.efi,ebounce.efi,GraphicsConsole.efi"
EFI_STATUS ReadFile(IN EFI_FILE_HANDLE BaseDir, CHAR16 *FileName, REFIT_FILE *File, UINTN *size);
-VOID ReadConfig(VOID);
+VOID ReadConfig(CHAR16 *FileName);
VOID ScanUserConfigured(VOID);
UINTN ReadTokenLine(IN REFIT_FILE *File, OUT CHAR16 ***TokenList);
VOID FreeTokenLine(IN OUT CHAR16 ***TokenList, IN OUT UINTN *TokenCount);
if (AboutMenu.EntryCount == 0) {
AboutMenu.TitleImage = BuiltinIcon(BUILTIN_ICON_FUNC_ABOUT);
- AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.5.0.3");
+ AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.5.1");
AddMenuInfoLine(&AboutMenu, L"");
AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2006-2010 Christoph Pfisterer");
AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2012 Roderick W. Smith");
FreeList((VOID ***) &(MainMenu.Entries), &MainMenu.EntryCount);
MainMenu.Entries = NULL;
MainMenu.EntryCount = 0;
- ReadConfig();
+ ReadConfig(CONFIG_FILE_NAME);
ConnectAllDriversToAllControllers();
ScanVolumes();
ScanForBootloaders();
FindLegacyBootType();
if (GlobalConfig.LegacyType == LEGACY_TYPE_MAC)
CopyMem(GlobalConfig.ScanFor, "ihebocm ", NUM_SCAN_OPTIONS);
- ReadConfig();
+ ReadConfig(CONFIG_FILE_NAME);
WarnIfLegacyProblems();
MainMenu.TimeoutSeconds = GlobalConfig.Timeout;
#define SHIM_LOCK_GUID \
{ 0x605dab50, 0xe046, 0x4300, {0xab, 0xb6, 0x3d, 0xd8, 0x10, 0xdd, 0x8b, 0x23} }
+#if defined (EFIX64)
typedef struct _SHIM_LOCK
{
EFI_STATUS __attribute__((sysv_abi)) (*shim_verify) (VOID *buffer, UINT32 size);
EFI_STATUS __attribute__((sysv_abi)) (*read_header) (void *data, unsigned int datasize,
GNUEFI_PE_COFF_LOADER_IMAGE_CONTEXT *context);
} SHIM_LOCK;
+#else
+typedef struct _SHIM_LOCK
+{
+ EFI_STATUS (*shim_verify) (VOID *buffer, UINT32 size);
+ EFI_STATUS (*generate_hash) (char *data, int datasize,
+ GNUEFI_PE_COFF_LOADER_IMAGE_CONTEXT *context, UINT8 *sha256hash,
+ UINT8 *sha1hash);
+ EFI_STATUS (*read_header) (void *data, unsigned int datasize,
+ GNUEFI_PE_COFF_LOADER_IMAGE_CONTEXT *context);
+} SHIM_LOCK;
+#endif
BOOLEAN ShimLoaded(void);
BOOLEAN secure_mode (VOID);