From: srs5694 Date: Tue, 2 Oct 2012 18:35:58 +0000 (-0400) Subject: Added new "scan_delay" feature. X-Git-Url: https://code.delx.au/refind/commitdiff_plain/40f640cba5b0b4136e6af59625242b623c28dca4 Added new "scan_delay" feature. --- diff --git a/docs/refind/configfile.html b/docs/refind/configfile.html index 2c6e161..ced9032 100644 --- a/docs/refind/configfile.html +++ b/docs/refind/configfile.html @@ -198,6 +198,11 @@ timeout 20 internal, external, optical, hdbios, biosexternal, cd, and manual Tells rEFInd what methods to use to locate boot loaders. The internal, external, and optical parameters tell rEFInd to scan for EFI boot loaders on internal, external, and optical (CD, DVD, and Blu-ray) devices, respectively. The hdbios, biosexternal, and cd parameters are similar, but scan for BIOS boot loaders. (Note that the BIOS options are likely to be useless on UEFI PCs.) The manual parameter tells rEFInd to scan the configuration file for manual settings. You can specify multiple parameters to have the program scan for multiple boot loader types. When you do so, the order determines the order in which the boot loaders appear in the menu. The default is internal, external, optical. + + scan_delay + Numeric (integer) value + Imposes a delay before rEFInd scans for disk devices. Ordinarily this is not necessary, but on some systems, some disks (particularly external drives and optical discs) can take a few seconds to become available. If some of your disks don't appear when rEFInd starts but they do appear when you press the Esc key to re-scan, try uncommenting this option and setting it to a modest value, such as 2, 5, or even 10. The default is 0. + also_scan_dirs directory path(s) diff --git a/docs/refind/features.html b/docs/refind/features.html index cb0d8ac..1b6a717 100644 --- a/docs/refind/features.html +++ b/docs/refind/features.html @@ -137,6 +137,8 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com

  • The ability to re-scan boot loaders, to assist when changing removable media or after making a change to the configuration file with an EFI shell (as of version 0.3.5).
  • +
  • A configurable delay before scanning for boot loaders, for systems on which there's a delay before disks become available (as of version 0.4.6).
  • +
  • The ability to specify an additional icon storage directory, to assist in efforts to customize rEFInd's appearance (as of version 0.3.4).
  • The ability to set the screen's resolution, within limits imposed by the EFI (as of rEFInd 0.3.0).
  • diff --git a/refind.conf-sample b/refind.conf-sample index 7a5b9e7..5ed1480 100644 --- a/refind.conf-sample +++ b/refind.conf-sample @@ -123,6 +123,13 @@ timeout 20 # #scanfor internal,external,optical,manual +# Delay for the specified number of seconds before scanning disks. +# This can help some users who find that some of their disks +# (usually external or optical discs) aren't detected initially, +# but are detected after pressing Esc. +# +#scan_delay 5 + # When scanning volumes for EFI boot loaders, rEFInd always looks for # Mac OS X's and Microsoft Windows' boot loaders in their normal locations, # and scans the root directory and every subdirectory of the /EFI directory diff --git a/refind/config.c b/refind/config.c index 585b0e8..c9d76e3 100644 --- a/refind/config.c +++ b/refind/config.c @@ -356,6 +356,9 @@ VOID ReadConfig(VOID) GlobalConfig.ScanFor[i] = ' '; } + } else if ((StriCmp(TokenList[0], L"scan_delay") == 0) && (TokenCount == 2)) { + HandleInt(TokenList, TokenCount, &(GlobalConfig.ScanDelay)); + } else if (StriCmp(TokenList[0], L"also_scan_dirs") == 0) { HandleStrings(TokenList, TokenCount, &(GlobalConfig.AlsoScan)); diff --git a/refind/global.h b/refind/global.h index f501bb7..62845d7 100644 --- a/refind/global.h +++ b/refind/global.h @@ -199,6 +199,7 @@ typedef struct { UINTN MaxTags; // max. number of OS entries to show simultaneously in graphics mode UINTN GraphicsFor; UINTN LegacyType; + UINTN ScanDelay; CHAR16 *BannerFileName; CHAR16 *SelectionSmallFileName; CHAR16 *SelectionBigFileName; diff --git a/refind/main.c b/refind/main.c index 0e604c8..de40bd9 100644 --- a/refind/main.c +++ b/refind/main.c @@ -93,7 +93,7 @@ static REFIT_MENU_ENTRY MenuEntryExit = { L"Exit rEFInd", TAG_EXIT, 1, 0, 0, static REFIT_MENU_SCREEN MainMenu = { L"Main Menu", NULL, 0, NULL, 0, NULL, 0, L"Automatic boot" }; static REFIT_MENU_SCREEN AboutMenu = { L"About", NULL, 0, NULL, 0, NULL, 0, NULL }; -REFIT_CONFIG GlobalConfig = { FALSE, FALSE, 0, 0, 20, 0, 0, GRAPHICS_FOR_OSX, LEGACY_TYPE_MAC, +REFIT_CONFIG GlobalConfig = { FALSE, FALSE, 0, 0, 20, 0, 0, GRAPHICS_FOR_OSX, LEGACY_TYPE_MAC, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, {TAG_SHELL, TAG_ABOUT, TAG_SHUTDOWN, TAG_REBOOT, 0, 0, 0, 0, 0 }}; @@ -115,7 +115,7 @@ static VOID AboutrEFInd(VOID) if (AboutMenu.EntryCount == 0) { AboutMenu.TitleImage = BuiltinIcon(BUILTIN_ICON_FUNC_ABOUT); - AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.4.5.3"); + AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.4.5.4"); AddMenuInfoLine(&AboutMenu, L""); AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2006-2010 Christoph Pfisterer"); AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2012 Roderick W. Smith"); @@ -1633,9 +1633,6 @@ static VOID ScanForBootloaders(VOID) { case 'o': case 'O': ScanOptical(); break; -// case 'l': case 'L': -// ScanLegacyNonMac(); -// break; } // switch() } // for @@ -1743,8 +1740,9 @@ efi_main (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable) EFI_STATUS Status; BOOLEAN MainLoopRunning = TRUE; REFIT_MENU_ENTRY *ChosenEntry; - UINTN MenuExit; + UINTN MenuExit, i; CHAR16 *Selection; + EG_PIXEL BGColor; // bootstrap InitializeLib(ImageHandle, SystemTable); @@ -1763,6 +1761,15 @@ efi_main (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable) // further bootstrap (now with config available) SetupScreen(); + if (GlobalConfig.ScanDelay > 0) { + BGColor.b = 255; + BGColor.g = 175; + BGColor.r = 100; + BGColor.a = 0; + egDisplayMessage(L"Pausing before disk scan; please wait....", &BGColor); + for (i = 0; i < GlobalConfig.ScanDelay; i++) + refit_call1_wrapper(BS->Stall, 1000000); + } // if LoadDrivers(); ScanForBootloaders(); ScanForTools();