]> code.delx.au - refind/commitdiff
Documentation changes and limiting line length of secondary kernel
authorsrs5694 <srs5694@users.sourceforge.net>
Sat, 25 Jul 2015 15:41:27 +0000 (11:41 -0400)
committersrs5694 <srs5694@users.sourceforge.net>
Sat, 25 Jul 2015 15:41:27 +0000 (11:41 -0400)
entries on submenu page.

NEWS.txt
docs/refind/configfile.html
docs/refind/installing.html
refind.conf-sample
refind/main.c

index f9d10fdbf73177a552ae2c16f218917fe1e6f517..498626004591e4c504320dd966aba9def200e606 100644 (file)
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -1,6 +1,10 @@
 0.9.0 (6/??/2015):
 ------------------
 
+- Minor code changes to ensure that rEFInd compiles with GCC 5.1. (Tested
+  with GNU-EFI on a Fedora 22 system; not yet tested with the TianoCore
+  EDK2.)
+
 - Added new "fold_linux_kernels" token to refind.conf. This option, when
   active (the default) "folds" all Linux kernels in a directory into a
   single entry on the rEFInd menu. The kernel with the most recent time
index 041dfa723f6115674a1b6d2d6c30fd7e291f5cfc..809eafa68f964a5b49bf9880880e3753d6b22916 100644 (file)
@@ -152,6 +152,8 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <li class="tight"><a href="#submenu">Creating Submenu Entries</a></li>
 
+<li class="tight"><a href="#default">Adjusting the Default Boot Option</a></li>
+
 </ul>
 
 </div>
@@ -357,7 +359,7 @@ timeout 20
 <tr>
    <td><tt>fold_linux_kernels</tt></td>
    <td>none or one of <tt>true</tt>, <tt>on</tt>, <tt>1</tt>, <tt>false</tt>, <tt>off</tt>, or <tt>0</tt></td>
-   <td>When uncommented or set to <tt>true</tt>, <tt>on</tt>, or <tt>1</tt>, causes rEFInd to "fold" all Linux kernels in a given directory into a single main-menu icon. Selecting that icon launches the most recent kernel. To launch an older kernel, you must press F2 or Insert; older kernels appear on the resulting submenu display. If you prefer to see all your kernels in the main menu, set this option to <tt>false</tt>, <tt>off</tt>, or <tt>0</tt>. Note that this option is new with version 0.9.0, which changes the default behavior; earlier versions of rEFInd behaved as if <tt>fold_linux_kernels false</tt> was set.</td>
+   <td>When uncommented or set to <tt>true</tt>, <tt>on</tt>, or <tt>1</tt>, causes rEFInd to "fold" all Linux kernels in a given directory into a single main-menu icon. Selecting that icon launches the most recent kernel. To launch an older kernel, you must press F2 or Insert; older kernels appear on the resulting submenu display. (You can type, as <tt>root</tt>, <tt class="userinput">touch /boot/vmlinuz-{whatever}</tt>, to make <tt>/boot/vmlinuz-{whatever}</tt> your default kernel in a directory.) If you prefer to see all your kernels in the main menu, set this option to <tt>false</tt>, <tt>off</tt>, or <tt>0</tt>. Note that this option is new with version 0.9.0, which changes the default behavior; earlier versions of rEFInd behaved as if <tt>fold_linux_kernels false</tt> was set.</td>
 </tr>
 <tr>
    <td><tt>max_tags</tt></td>
@@ -605,6 +607,24 @@ menuentry Gentoo {
 
 </ul>
 
+<a name="default">
+<h2>Adjusting the Default Boot Option</h2>
+</a>
+
+<p>Just before launching an OS, rEFInd stores the description in the EFI variable <tt>PreviousBoot</tt> with a GUID of 36d08fa7-cf0b-42f5-8f14-68df73ed3740. The next time it launches, it reads that same variable and sets the default boot loader to that value, if it's still available and if the first item in <tt>default_selection</tt> in the <tt>refind.conf</tt> file is a plus sign (<tt>+</tt>).</p>
+
+<p>Under Linux, the variable that rEFInd uses to store this information is accessible as <tt>/sys/firmware/efi/efivars/PreviousBoot-36d08fa7-cf0b-42f5-8f14-68df73ed3740</tt>. Thus, you can back up this value, modify it, and write it back out to adjust your next-booted OS. Getting this string just right can be a bit tricky, though, and if the kernel doesn't like its format, it will not let you modify the variable. If you try to modify the variable, be aware that it's stored in UTF-16 format. As with the <tt>default_selection</tt> token in <tt>refind.conf</tt>, you can enter any substring that uniquely identifies the entry you want to boot.</p>
+
+<p>In principle, you should be able to use a similar procedure to force rEFInd to boot another OS by default in any other OS that supports writing EFI runtime variables. Unfortunately, I don't know the mechanisms used for this task in Windows, OS X, FreeBSD, or any other OS.</p>
+
+<p>If you want to consistently boot a particular OS by default and ignore the previous boot, you can use <tt>default_selection</tt>, but <i>omit</i> the <tt>+</tt> at the start of the line.</p>
+
+<p></p>
+
+<p></p>
+
+<p></p>
+
 <hr />
 
 <p>copyright &copy; 2012&ndash;2015 by Roderick W. Smith</p>
index 0bd039f9025be8ff15f0db65515a3aa27bd1450a..fab25dfab062c3c86ee3b33f8e0ca6f84ccb4505 100644 (file)
@@ -134,7 +134,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <p><b>Don't be scared by the length of this page!</b> Only portions of this page apply to any given user, and most people can install rEFInd from an RPM or Debian package in a matter of seconds or by using the <tt>install.sh</tt> script in minute or two.</p>
 
-<p>Once you've obtained a rEFInd binary file, you must install it to your computer's EFI System Partition (ESP) (or conceivably to some other location). The details of how you do this depend on your OS and your computer (UEFI-based PC vs. Macintosh). The upcoming sections provide details. See the Contents sidebar to the left for links to specific installation procedures. For most Linux users, an RPM or Debian package is the best way to go. If your Linux system doesn't support these formats, though, or if you're running OS X, using the <tt>install.sh</tt> script can be a good way to go. If you're using Windows, you'll have to install manually.</p>
+<p>Once you've obtained a rEFInd binary file, as described on <a href="getting.html">the preceding page,</a> you must install it to your computer's EFI System Partition (ESP) (or conceivably to some other location). The details of how you do this depend on your OS and your computer (UEFI-based PC vs. Macintosh). The upcoming sections provide details. See the Contents sidebar to the left for links to specific installation procedures. For most Linux users, an RPM or Debian package is the best way to go. If your Linux system doesn't support these formats, though, or if you're running OS X, using the <tt>install.sh</tt> script can be a good way to go. If you're using Windows, you'll have to install manually.</p>
 
 <p class="sidebar" style="width:95%"><b>Important:</b> A rEFInd zip file, when uncompressed, creates a directory called <tt>refind-<i>version</i></tt>, where <tt><i>version</i></tt> is the version number. This directory includes a subdirectory called <tt>refind</tt> that holds the rEFInd binary along with another that holds documentation, as well as miscellaneous files in <tt>refind-<i>version</i></tt> itself. When I refer to "the <tt>refind</tt> directory" on this page, I mean the directory with that precise name, not the <tt>refind-<i>version</i></tt> directory that is its parent.</p>
 
index 615a357ca81eac85dee5fc394ada002ca8c7ee78..f3c31a4a8c8ba5b9928862a0d85be69c706ee4d2 100644 (file)
@@ -134,6 +134,7 @@ timeout 20
 # Default is "0 0" (use the system default resolution, usually 800x600).
 #
 #resolution 1024 768
+#resolution 1440 900
 #resolution 3
 
 # Launch specified OSes in graphics mode. By default, rEFInd switches
index 1d5297df38b1d3f8638d00549ba958871eb81822..d96c6e59a096c2df38ab52e7a223186b83fe05ec 100644 (file)
@@ -128,6 +128,9 @@ EFI_GUID gFreedesktopRootGuid = { 0xb921b045, 0x1df0, 0x41c3, { 0xaf, 0x44, 0x4c
 // a ".efi" extension to be found when scanning for boot loaders.
 #define LINUX_MATCH_PATTERNS    L"vmlinuz*,bzImage*"
 
+// Maximum length of a text string in certain menus
+#define MAX_LINE_LENGTH 65
+
 static REFIT_MENU_ENTRY MenuEntryAbout    = { L"About rEFInd", TAG_ABOUT, 1, 0, 'A', NULL, NULL, NULL };
 static REFIT_MENU_ENTRY MenuEntryReset    = { L"Reboot Computer", TAG_REBOOT, 1, 0, 'R', NULL, NULL, NULL };
 static REFIT_MENU_ENTRY MenuEntryShutdown = { L"Shut Down Computer", TAG_SHUTDOWN, 1, 0, 'U', NULL, NULL, NULL };
@@ -189,7 +192,7 @@ static VOID AboutrEFInd(VOID)
         AddMenuInfoLine(&AboutMenu, L" Platform: unknown");
 #endif
         FirmwareVendor = StrDuplicate(ST->FirmwareVendor);
-        LimitStringLength(FirmwareVendor, 65); // More than ~65 causes empty info page on 800x600 display
+        LimitStringLength(FirmwareVendor, MAX_LINE_LENGTH); // More than ~65 causes empty info page on 800x600 display
         AddMenuInfoLine(&AboutMenu, PoolPrint(L" Firmware: %s %d.%02d", FirmwareVendor, ST->FirmwareRevision >> 16,
                                               ST->FirmwareRevision & ((1 << 16) - 1)));
         AddMenuInfoLine(&AboutMenu, PoolPrint(L" Screen Output: %s", egScreenDescription()));
@@ -1080,6 +1083,7 @@ static VOID AddKernelToSubmenu(LOADER_ENTRY * TargetLoader, CHAR16 *FileName, RE
             MergeStrings(&SubmenuName, L": ", '\0');
             MergeStrings(&SubmenuName, TokenList[0] ? StrDuplicate(TokenList[0]) : StrDuplicate(L"Boot Linux"), '\0');
             Title = StrDuplicate(SubmenuName);
+            LimitStringLength(Title, MAX_LINE_LENGTH);
             SubEntry->me.Title = Title;
             MyFreePool(SubEntry->LoadOptions);
             SubEntry->LoadOptions = AddInitrdToOptions(TokenList[1], InitrdName);