From: srs5694 Date: Wed, 14 May 2014 01:00:33 +0000 (-0400) Subject: Suppress messages about delays for scanning boot loaders when X-Git-Url: https://code.delx.au/refind/commitdiff_plain/4cfc89efc08cf488803e93b1356446ac4d34f181 Suppress messages about delays for scanning boot loaders when scan_delay is just 1 second. --- diff --git a/EfiLib/BdsHelper.c b/EfiLib/BdsHelper.c index b595858..563993a 100644 --- a/EfiLib/BdsHelper.c +++ b/EfiLib/BdsHelper.c @@ -68,7 +68,11 @@ VOID UpdateBbsTable (BDS_COMMON_OPTION *Option) { // in priority. Done mainly as a fallback in case of string-matching weirdness. LocalBbsTable[Idx].BootPriority = 1; } // if/else - } // if + } else if (LocalBbsTable[Idx].BootPriority <= 1) { + // Something's got a high enough boot priority to interfere with booting + // our chosen entry, so bump it down a bit.... + LocalBbsTable[Idx].BootPriority = 2; + } // if/else if // Print ( // L" %02x: %04x %02x/%02x/%02x %02x/%02x %04x %04x %04x:%04x\n", @@ -89,6 +93,7 @@ VOID UpdateBbsTable (BDS_COMMON_OPTION *Option) { // Print(L"%s\n", Desc); } // for +// PauseForKey(); } /** diff --git a/Make.common b/Make.common index c1afdfe..af47ccc 100644 --- a/Make.common +++ b/Make.common @@ -4,9 +4,9 @@ # EFIINC = /usr/include/efi -GNUEFILIB = /usr/lib64 -EFILIB = /usr/lib64 -EFICRT0 = /usr/lib64 +GNUEFILIB = /usr/lib +EFILIB = /usr/lib +EFICRT0 = /usr/lib # Comment out above and uncomment below if using locally-compiled GNU-EFI.... #EFIINC = /usr/local/include/efi diff --git a/NEWS.txt b/NEWS.txt index 49c680d..2bf51dc 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -1,6 +1,20 @@ 0.8.1 (5/??/2014): ------------------ +- Added two new bitmap fonts to those distributed with rEFInd: Ubuntu Mono + and Nimbus Mono. Both come in 12-, 14-, 16-, and 24-point sizes. + +- Messages about pauses for scanning and re-scanning of boot loaders are + now suppressed when doing an initial delayed scan when scan_delay is 1 + second. + +- Improved centering of legacy boot option descriptions on some systems' + screens. + +- Fixed bug that could cause a BIOS-mode boot to launch an inappropriate + device if that device had an innately high boot priority (as set by the + firmware). + - Changed icons from ICNS to PNG form. There are several reasons to do this, all of them minor; but together they're enough to warrant a change. PNG is more common, and therefore more accessible to most users -- diff --git a/docs/refind/themes.html b/docs/refind/themes.html index 586e7d5..e09a16b 100644 --- a/docs/refind/themes.html +++ b/docs/refind/themes.html @@ -228,7 +228,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com

rEFInd's default font is a 14-point (12-point in 0.6.5 and earlier) serif monospaced font. I also include a handful of alternatives in the fonts subdirectory. rEFInd's font support is extremely rudimentary, though; it reads a PNG file that holds the glyphs from ASCII 32 (space) through ASCII 126 (tilde, ~), plus a glyph that's displayed for all characters outside of this range. Thus, rEFInd can't currently display non-ASCII characters or use proportional (variable-width) fonts. You can change the font from one monospaced font to another and change the font size, though.

-

If you want to create your own fonts, you can do so. If you're using Linux, the mkfont.sh script in the fonts subdirectory will convert an installed monospace font into a suitable format. You can use it like this:

+

If you want to create your own fonts, you can do so. If you're using Linux, the mkfont.sh script in the fonts subdirectory will convert an installed monospace font into a suitable format. (This script works properly for most fonts, but if a font is unusually thin or wide, you will have to adjust the let CellWidth= line near the end of the file.) You can use it like this:

 $ ./mkfont.sh Liberation-Mono-Italic 14 -1 liberation-mono-italic-14.png
@@ -272,7 +272,7 @@ to be tedious.

I used icons from the Oxygen Icons project, both from the Oxygen Refit package and from Gentoo's oxygen-icons package. These icons supplemented or replaced icons that rEFIt used; however, many OS icons (such as those for Windows and Mac OS) are carried over from rEFIt. I've also used a handful of icons for individual Linux distributions from other sources—usually documentation associated with the distribution in question.

-

In addition to this default icon set, I've received word of three other rEFInd themes:

+

In addition to this default icon set, I've received word of a few other rEFInd themes:

If you've created or discovered another rEFInd theme, please tell me about it so that I can provide a link to it from this page.

diff --git a/fonts/mkfont.sh b/fonts/mkfont.sh index 2f035e5..9ae3932 100755 --- a/fonts/mkfont.sh +++ b/fonts/mkfont.sh @@ -39,6 +39,7 @@ fi Height=$2 let CellWidth=(${Height}*6+5)/10 +#let CellWidth=(${Height}*5)/10 let Width=${CellWidth}*96 echo "Creating ${Width}x${Height} font bitmap...." $Convert -size ${Width}x${Height} xc:transparent -gravity NorthWest -font $1 -pointsize $2 \ diff --git a/refind/main.c b/refind/main.c index 1340814..51288d2 100644 --- a/refind/main.c +++ b/refind/main.c @@ -168,7 +168,7 @@ static VOID AboutrEFInd(VOID) if (AboutMenu.EntryCount == 0) { AboutMenu.TitleImage = BuiltinIcon(BUILTIN_ICON_FUNC_ABOUT); - AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.8.0.5"); + AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.8.0.6"); AddMenuInfoLine(&AboutMenu, L""); AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2006-2010 Christoph Pfisterer"); AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2012-2014 Roderick W. Smith"); @@ -1704,7 +1704,7 @@ static LEGACY_ENTRY * AddLegacyEntry(IN CHAR16 *LoaderTitle, IN REFIT_VOLUME *Vo Entry->me.BadgeImage = Volume->VolBadgeImage; Entry->Volume = Volume; Entry->LoadOptions = (Volume->DiskKind == DISK_KIND_OPTICAL) ? L"CD" : - ((Volume->DiskKind == DISK_KIND_EXTERNAL) ? L"USB" : L"HD"); + ((Volume->DiskKind == DISK_KIND_EXTERNAL) ? L"USB" : L"HD"); Entry->Enabled = TRUE; // create the submenu @@ -1764,11 +1764,16 @@ static LEGACY_ENTRY * AddLegacyEntryUEFI(BDS_COMMON_OPTION *BdsOption, IN UINT16 LEGACY_ENTRY *Entry, *SubEntry; REFIT_MENU_SCREEN *SubScreen; CHAR16 ShortcutLetter = 0; - CHAR16 *LegacyDescription = BdsOption->Description; + CHAR16 *LegacyDescription = StrDuplicate(BdsOption->Description); if (IsInSubstring(LegacyDescription, GlobalConfig.DontScanVolumes)) return NULL; + // Remove stray spaces, since many EFIs produce descriptions with lots of + // extra spaces, especially at the end; this throws off centering of the + // description on the screen.... + LimitStringLength(LegacyDescription, 100); + // prepare the menu entry Entry = AllocateZeroPool(sizeof(LEGACY_ENTRY)); Entry->me.Title = AllocateZeroPool(256 * sizeof(CHAR16)); @@ -2157,8 +2162,7 @@ static VOID FindLegacyBootType(VOID) { GlobalConfig.LegacyType = LEGACY_TYPE_NONE; - // UEFI-style legacy BIOS support is available only with the TianoCore EDK2 - // build environment, and then only with some EFI implementations.... + // UEFI-style legacy BIOS support is available only with some EFI implementations.... Status = refit_call3_wrapper(gBS->LocateProtocol, &gEfiLegacyBootProtocolGuid, NULL, (VOID **) &LegacyBios); if (!EFI_ERROR (Status)) GlobalConfig.LegacyType = LEGACY_TYPE_UEFI; @@ -2173,20 +2177,23 @@ static VOID FindLegacyBootType(VOID) { } // static VOID FindLegacyBootType // Warn the user if legacy OS scans are enabled but the firmware can't support them.... -static VOID WarnIfLegacyProblems() { +static VOID WarnIfLegacyProblems(VOID) { BOOLEAN found = FALSE; UINTN i = 0; if (GlobalConfig.LegacyType == LEGACY_TYPE_NONE) { do { - if (GlobalConfig.ScanFor[i] == 'h' || GlobalConfig.ScanFor[i] == 'b' || GlobalConfig.ScanFor[i] == 'c') + if (GlobalConfig.ScanFor[i] == 'h' || GlobalConfig.ScanFor[i] == 'b' || GlobalConfig.ScanFor[i] == 'c' || + GlobalConfig.ScanFor[i] == 'H' || GlobalConfig.ScanFor[i] == 'B' || GlobalConfig.ScanFor[i] == 'C') found = TRUE; i++; } while ((i < NUM_SCAN_OPTIONS) && (!found)); + if (found) { Print(L"NOTE: refind.conf's 'scanfor' line specifies scanning for one or more legacy\n"); Print(L"(BIOS) boot options; however, this is not possible because your computer lacks\n"); - Print(L"the necessary Compatibility Support Module (CSM) support.\n"); + Print(L"the necessary Compatibility Support Module (CSM) support or that support is\n"); + Print(L"disabled in your firmware.\n"); PauseForKey(); } // if (found) } // if no legacy support @@ -2401,14 +2408,15 @@ static VOID ScanForTools(VOID) { } // static VOID ScanForTools // Rescan for boot loaders -VOID RescanAll(VOID) { +static VOID RescanAll(BOOLEAN DisplayMessage) { EG_PIXEL BGColor; BGColor.b = 255; BGColor.g = 175; BGColor.r = 100; BGColor.a = 0; - egDisplayMessage(L"Scanning for new boot loaders; please wait....", &BGColor); + if (DisplayMessage) + egDisplayMessage(L"Scanning for new boot loaders; please wait....", &BGColor); FreeList((VOID ***) &(MainMenu.Entries), &MainMenu.EntryCount); MainMenu.Entries = NULL; MainMenu.EntryCount = 0; @@ -2530,7 +2538,6 @@ efi_main (EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable) CopyMem(GlobalConfig.ScanFor, "ihebocm ", NUM_SCAN_OPTIONS); SetConfigFilename(ImageHandle); ReadConfig(GlobalConfig.ConfigFilename); -// ScanVolumes(); InitScreen(); WarnIfLegacyProblems(); @@ -2552,10 +2559,11 @@ efi_main (EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable) BGColor.g = 175; BGColor.r = 100; BGColor.a = 0; - egDisplayMessage(L"Pausing before disk scan; please wait....", &BGColor); + if (GlobalConfig.ScanDelay > 1) + egDisplayMessage(L"Pausing before disk scan; please wait....", &BGColor); for (i = 0; i < GlobalConfig.ScanDelay; i++) refit_call1_wrapper(BS->Stall, 1000000); - RescanAll(); + RescanAll(GlobalConfig.ScanDelay > 1); } // if if (GlobalConfig.DefaultSelection) @@ -2567,7 +2575,7 @@ efi_main (EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable) // The Escape key triggers a re-scan operation.... if (MenuExit == MENU_EXIT_ESCAPE) { MenuExit = 0; - RescanAll(); + RescanAll(TRUE); continue; } diff --git a/refind/menu.c b/refind/menu.c index 4c0d359..427deda 100644 --- a/refind/menu.c +++ b/refind/menu.c @@ -734,10 +734,8 @@ static VOID DrawTextWithTransparency(IN CHAR16 *Text, IN UINTN XPos, IN UINTN YP } TextBuffer = egCropImage(GlobalConfig.ScreenBackground, XPos, YPos, TextWidth, TextLineHeight()); - if (TextBuffer == NULL) { - Print(L"Error: NULL TextBuffer in DrawTextWithTransparency()\n"); + if (TextBuffer == NULL) return; - } // render the text egRenderText(Text, TextBuffer, 0, 0, AverageBrightness(TextBuffer));