files.
-0.5.0 (12/5/2012):
+0.5.0 (12/?/2012):
------------------
+- Added the ability to include quote marks ('"') in refind.conf and
+ refind_linux.conf tokens by doubling them up, as in:
+ "ro root=/dev/sda4 some_value=""this is it"""
+ This example results in the following string being passed as an
+ option:
+ ro root=/dev/sda4 some_value="this is it"
+
- Changed refind.conf-sample to uncomment the scan_all_linux_kernels
option by default. If this option is deleted or commented out, the
program default remains to not scan all Linux kernels; but with
<tr>
<td><tt>options</tt></td>
<td>options passed to the boot loader</td>
- <td>Pass arbitrary options to your boot loader with this line. Note that if the option string should contain spaces (as it often should) or characters that should not be modified by rEFInd's option parser (such as slashes or commas), it <i>must</i> be enclosed in quotes.</td>
+ <td>Pass arbitrary options to your boot loader with this line. Note that if the option string should contain spaces (as it often should) or characters that should not be modified by rEFInd's option parser (such as slashes or commas), it <i>must</i> be enclosed in quotes. If you must include quotes in an option, you can double them up, as in <tt>my_opt=""with quotes""</tt>, which passes <tt>my_opt="with quotes"</tt> as an option.</td>
</tr>
<tr>
<td><tt>disabled</tt></td>
# "Boot alternate install" "root=/dev/sdb9 ro quiet splash vt.handoff=7"
</pre>
-<p>Ordinarily, both fields in this file must be enclosed in quotes. 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>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>In the preceding example, the first line sets the options that rEFInd passes to the kernel by default (along with the name of the <tt>initrd.img-3.3.0</tt> file, since its version string matches that of the kernel). The next two lines set options that you can obtain by pressing Insert, F2, or + on the main menu, as shown here:</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; and a change of the <tt>esp</tt> installation script option to <tt>--esp</tt>.</li>
+<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.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>
return Line;
}
+// Returns FALSE if *p points to the end of a token, TRUE otherwise.
+// Also modifies *p **IF** the first and second characters are both
+// quotes ('"'); it deletes one of them.
+static BOOLEAN KeepReading(IN OUT CHAR16 *p, IN OUT BOOLEAN *IsQuoted) {
+ BOOLEAN MoreToRead = FALSE;
+ CHAR16 *Temp = NULL;
+// while (*p && *p != '"' && ((*p != ' ' && *p != '\t' && *p != '=' && *p != '#' && *p != ',') || IsQuoted)) {
+
+ if ((p == NULL) || (IsQuoted == NULL))
+ return FALSE;
+
+ if (*p == L'\0')
+ return FALSE;
+
+ if ((*p != ' ' && *p != '\t' && *p != '=' && *p != '#' && *p != ',') || *IsQuoted) {
+ MoreToRead = TRUE;
+ }
+ if (*p == L'"') {
+ if (p[1] == L'"') {
+ Temp = StrDuplicate(&p[1]);
+ if (Temp != NULL) {
+ StrCpy(p, Temp);
+ FreePool(Temp);
+ }
+ MoreToRead = TRUE;
+ } else {
+ *IsQuoted = !(*IsQuoted);
+ MoreToRead = FALSE;
+ } // if/else second character is a quote
+ } // if first character is a quote
+
+ return MoreToRead;
+} // BOOLEAN KeepReading()
+
//
// get a line of tokens from a file
//
-
UINTN ReadTokenLine(IN REFIT_FILE *File, OUT CHAR16 ***TokenList)
{
BOOLEAN LineFinished, IsQuoted = FALSE;
- CHAR16 *Line, *Token, *p, *Temp;
+ CHAR16 *Line, *Token, *p;
UINTN TokenCount = 0;
*TokenList = NULL;
p = Line;
LineFinished = FALSE;
while (!LineFinished) {
- // skip whitespace
+ // skip whitespace & find start of token
while ((*p == ' ' || *p == '\t' || *p == '=' || *p == ',') && !IsQuoted)
p++;
if (*p == 0 || *p == '#')
Token = p;
// find end of token
- while (*p && *p != '"' && ((*p != ' ' && *p != '\t' && *p != '=' && *p != '#' && *p != ',') || IsQuoted)) {
- if ((*p == '/') && !IsQuoted) // Switch Unix-style to DOS-style directory separators
- *p = '\\';
- if (*p == '|') {
- Temp = StrDuplicate(&p[1]);
- StrCpy(p, Temp);
- }
+ while (KeepReading(p, &IsQuoted)) {
+ if ((*p == L'/') && !IsQuoted) // Switch Unix-style to DOS-style directory separators
+ *p = L'\\';
p++;
- } // if
- if (*p == '"')
- IsQuoted = !IsQuoted;
- if (*p == 0 || *p == '#')
+ } // while
+ if (*p == L'\0' || *p == L'#')
LineFinished = TRUE;
*p++ = 0;
if (AboutMenu.EntryCount == 0) {
AboutMenu.TitleImage = BuiltinIcon(BUILTIN_ICON_FUNC_ABOUT);
- AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.4.7.11");
+ AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.4.7.12");
AddMenuInfoLine(&AboutMenu, L"");
AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2006-2010 Christoph Pfisterer");
AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2012 Roderick W. Smith");