]> code.delx.au - refind/commitdiff
Added new "scan_delay" feature.
authorsrs5694 <srs5694@users.sourceforge.net>
Tue, 2 Oct 2012 18:35:58 +0000 (14:35 -0400)
committersrs5694 <srs5694@users.sourceforge.net>
Tue, 2 Oct 2012 18:35:58 +0000 (14:35 -0400)
docs/refind/configfile.html
docs/refind/features.html
refind.conf-sample
refind/config.c
refind/global.h
refind/main.c

index 2c6e16142e90e0f11a3a88c178ed8349e0047aaa..ced903270a459898f65fc369a6064d70f6c91696 100644 (file)
@@ -198,6 +198,11 @@ timeout 20
    <td><tt>internal</tt>, <tt>external</tt>, <tt>optical</tt>, <tt>hdbios</tt>, <tt>biosexternal</tt>, <tt>cd</tt>, and <tt>manual</tt></td>
    <td>Tells rEFInd what methods to use to locate boot loaders. The <tt>internal</tt>, <tt>external</tt>, and <tt>optical</tt> parameters tell rEFInd to scan for EFI boot loaders on internal, external, and optical (CD, DVD, and Blu-ray) devices, respectively. The <tt>hdbios</tt>, <tt>biosexternal</tt>, and <tt>cd</tt> parameters are similar, but scan for BIOS boot loaders. (Note that the BIOS options are likely to be useless on UEFI PCs.) The <tt>manual</tt> 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 <tt>internal, external, optical</tt>.</td>
 </tr>
+<tr>
+   <td><tt>scan_delay</tt></td>
+   <td>Numeric (integer) value</td>
+   <td>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 <i>do</i> appear when you press the Esc key to re-scan, try uncommenting this option and setting it to a modest value, such as <tt>2</tt>, <tt>5</tt>, or even <tt>10</tt>. The default is <tt>0</tt>.</td>
+</tr>
 <tr>
    <td><tt>also_scan_dirs</tt></td>
    <td>directory path(s)</td>
index cb0d8ac9329b5646c0cc343ab0046e42cb36c0a0..1b6a717e8993e9f319d3eba4836204549fc5b86a 100644 (file)
@@ -137,6 +137,8 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <li>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).</li>
 
+<li>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).</li>
+
 <li>The ability to specify an additional icon storage directory, to assist in efforts to customize rEFInd's appearance (as of version 0.3.4).</li>
 
 <li>The ability to set the screen's resolution, within limits imposed by the EFI (as of rEFInd 0.3.0).</li>
index 7a5b9e737f2d6d786780b3d3f5e0ddf03d686aa6..5ed14802aabf5a768fb67afc58bb37f8f5ec7d46 100644 (file)
@@ -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
index 585b0e842fb5d5c70b676f18cc14e075713458bb..c9d76e31fbd7a5c492a26439fa2cef22a97b932f 100644 (file)
@@ -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));
 
index f501bb7f2feb0d6b552ae60982a2634efabadd23..62845d781cc88c9d057fad8da9afb877db550a55 100644 (file)
@@ -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;
index 0e604c89f769a1dd9024acd9f3f66c5e7c3023db..de40bd90992abc3eff242ca3bc9b960842c46855 100644 (file)
@@ -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();