From: srs5694 Date: Sat, 25 Jul 2015 15:41:27 +0000 (-0400) Subject: Documentation changes and limiting line length of secondary kernel X-Git-Url: https://code.delx.au/refind/commitdiff_plain/96e4448844c6f535679f9def29d700b94918d293 Documentation changes and limiting line length of secondary kernel entries on submenu page. --- diff --git a/NEWS.txt b/NEWS.txt index f9d10fd..4986260 100644 --- 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 diff --git a/docs/refind/configfile.html b/docs/refind/configfile.html index 041dfa7..809eafa 100644 --- a/docs/refind/configfile.html +++ b/docs/refind/configfile.html @@ -152,6 +152,8 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com

  • Creating Submenu Entries
  • +
  • Adjusting the Default Boot Option
  • + @@ -357,7 +359,7 @@ timeout 20 fold_linux_kernels none or one of true, on, 1, false, off, or 0 - When uncommented or set to true, on, or 1, 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 false, off, or 0. Note that this option is new with version 0.9.0, which changes the default behavior; earlier versions of rEFInd behaved as if fold_linux_kernels false was set. + When uncommented or set to true, on, or 1, 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 root, touch /boot/vmlinuz-{whatever}, to make /boot/vmlinuz-{whatever} your default kernel in a directory.) If you prefer to see all your kernels in the main menu, set this option to false, off, or 0. Note that this option is new with version 0.9.0, which changes the default behavior; earlier versions of rEFInd behaved as if fold_linux_kernels false was set. max_tags @@ -605,6 +607,24 @@ menuentry Gentoo { + +

    Adjusting the Default Boot Option

    +
    + +

    Just before launching an OS, rEFInd stores the description in the EFI variable PreviousBoot 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 default_selection in the refind.conf file is a plus sign (+).

    + +

    Under Linux, the variable that rEFInd uses to store this information is accessible as /sys/firmware/efi/efivars/PreviousBoot-36d08fa7-cf0b-42f5-8f14-68df73ed3740. 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 default_selection token in refind.conf, you can enter any substring that uniquely identifies the entry you want to boot.

    + +

    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.

    + +

    If you want to consistently boot a particular OS by default and ignore the previous boot, you can use default_selection, but omit the + at the start of the line.

    + +

    + +

    + +

    +

    copyright © 2012–2015 by Roderick W. Smith

    diff --git a/docs/refind/installing.html b/docs/refind/installing.html index 0bd039f..fab25df 100644 --- a/docs/refind/installing.html +++ b/docs/refind/installing.html @@ -134,7 +134,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com

    Don't be scared by the length of this page! 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 install.sh script in minute or two.

    -

    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 install.sh script can be a good way to go. If you're using Windows, you'll have to install manually.

    +

    Once you've obtained a rEFInd binary file, as described on the preceding page, 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 install.sh script can be a good way to go. If you're using Windows, you'll have to install manually.

    diff --git a/refind.conf-sample b/refind.conf-sample index 615a357..f3c31a4 100644 --- a/refind.conf-sample +++ b/refind.conf-sample @@ -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 diff --git a/refind/main.c b/refind/main.c index 1d5297d..d96c6e5 100644 --- a/refind/main.c +++ b/refind/main.c @@ -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);