]> code.delx.au - refind/commitdiff
Don't unload drivers immediately after loading them. (Fix required for
authorsrs5694 <srs5694@users.sourceforge.net>
Sun, 29 Jun 2014 02:54:05 +0000 (22:54 -0400)
committersrs5694 <srs5694@users.sourceforge.net>
Sun, 29 Jun 2014 02:54:05 +0000 (22:54 -0400)
some non-rEFInd drivers.)

NEWS.txt
debian/changelog
docs/refind/getting.html
docs/refind/installing.html
refind.conf-sample
refind.spec
refind/config.c
refind/global.h
refind/main.c

index 61ae5093f857ebdf0b221741e26e0ba7014ac34b..f1cc43c7c52037122671d598fd0f6d576f6bb3b8 100644 (file)
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -1,3 +1,28 @@
+0.8.3 (?/??/2014):
+------------------
+
+- Fixed bug that caused rEFInd to unload drivers immediately after loading
+  them. This didn't affect rEFInd's own drivers because they didn't include
+  the unload hooks, but it did affect some other drivers.
+
+- Changed default scan_all_linux_kernels setting from "false" to "true",
+  and commented the option out in refind.conf-sample. This should not
+  affect most people, since refind.conf-sample had this option commented
+  out, and most rEFInd users either use it that way or don't have Linux
+  kernels installed at all. I've made this change because I want rEFInd to
+  "do the right thing" by default in as many cases as possible. For a while
+  now, rEFInd has been excluding non-bootable files from its menu, and most
+  kernels "in the wild" now include the EFI stub. Thus, enabling this
+  support by default seems worthwhile. If you prefer to not scan Linux
+  kernels by default, simply uncomment the "scan_all_linux_kernels" line
+  and ensure it's set to "false".
+
+0.8.2.1 (6/8/2014):
+-------------------
+
+- Removed stray bit of debugging code that caused a prompt to press a
+  key to appear at rEFInd startup.
+
 0.8.2 (6/8/2014):
 -----------------
 
index 47f98c5b225bfbd23cb9aea4df78cf20bab030ec..bed26ec2c047323afded06d69da7cadfc026f0c3 100644 (file)
@@ -1,8 +1,14 @@
-refind (0.8.2-0ppa1) trusty; urgency=medium
+refind (0.8.2-0ppa3) trusty; urgency=medium
+
+  * Removed stray debugging code that caused pause during startup
+
+ -- Rod Smith <rodsmith@rodsbooks.com>  Sun, 08 Jun 2014 16:48:48 -0400
+
+refind (0.8.2-0ppa2) trusty; urgency=medium
 
   * Version bump
 
- -- Rod Smith <rodsmith@vbu1404>  Sun, 08 Jun 2014 12:32:48 -0400
+ -- Rod Smith <rodsmith@rodsbooks.com>  Sun, 08 Jun 2014 12:32:48 -0400
 
 refind (0.8.1-0ppa2) trusty; urgency=medium
 
index 8e9a33ff3e3782d9cae5d87c48f949dc5a10721d..e9e62eca19d10ba65e5593a61e042c7b27fc5537 100644 (file)
@@ -152,7 +152,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
     users with this problem.</li>
 
 <li><b><a
-    href="http://sourceforge.net/projects/refind/files/0.8.2/refind-0.8.2-1.x86_64.rpm/download">A
+    href="http://sourceforge.net/projects/refind/files/0.8.2/refind-0.8.2-2.x86_64.rpm/download">A
     binary RPM file</a></b>&mdash;If you use an RPM-based <i>x</i>86-64
     Linux system such as Fedora or openSUSE, you can install the binary RPM
     package rather than use the binary zip file. (I don't provide an
@@ -161,13 +161,13 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
     rEFInd</a> page) as part of the installation process. Distribution
     maintainers can examine the <tt>refind.spec</tt> file in the source
     package and tweak it to their needs. The <a
-    href="http://sourceforge.net/projects/refind/files/0.8.2/refind-0.8.2-1.src.rpm/download">source
+    href="http://sourceforge.net/projects/refind/files/0.8.2/refind-0.8.2-2.src.rpm/download">source
     RPM file</a> might or might not build on your system as-is; it relies
     on assumptions about the locations of the GNU-EFI development
     files.</li>
 
 <li><b><a
-    href="http://sourceforge.net/projects/refind/files/0.8.2/refind_0.8.2-1_amd64.deb/download">A
+    href="http://sourceforge.net/projects/refind/files/0.8.2/refind_0.8.2-2_amd64.deb/download">A
     binary Debian package</a></b>&mdash;If you use an <i>x</i>86-64 version
     of Debian, Ubuntu, Mint, or another Debian-based distribution, you can
     install from this package, which was converted from the binary RPM
index afa6cd0951788b0aa5886db67f6da235182c006b..54ad51f86943638ba8ea4f30a7b53e7f60ac94c5 100644 (file)
@@ -15,7 +15,7 @@
 href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <p>Originally written: 3/14/2012; last Web page update:
-6/8/2014, referencing rEFInd 0.8.2</p>
+6/23/2014, referencing rEFInd 0.8.2</p>
 
 
 <p>This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!</p>
@@ -194,6 +194,8 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
    <li class="tight"><a href="#clearing">Clearing the NVRAM Entries</a></li>
 
+   <li class="tight"><a href="#wakeprobs">Fixing Wake Problems</a></li>
+
    </ul></li>
 
 <li class="tight"><a href="#uninstalling">Uninstalling rEFInd</a></li>
@@ -943,10 +945,10 @@ $ <b>ioreg -l -p IODeviceTree | grep firmware-abi</b>
 <p>I've seen links to other versions of these tools from time to time on the Web, so if you try one of these programs and it crashes or behaves strangely, try performing a Web search; you may turn up something that works better for you than the one to which I've linked.</p>
 
 <a name="sluggish">
-<h2>Fixing a Sluggish Macintosh Boot</h2>
+<h2>Fixing Macintosh Boot Problems</h2>
 </a>
 
-<p>I've received a few reports of a sluggish boot process (a delay of about 30 seconds before starting rEFInd) on some Macs after installing rEFInd. I've been unable to replicate this problem myself, and its true cause remains mysterious to me. I have found three possible solutions, though: <a href="#moving">moving rEFInd to an HFS+ volume,</a> <a href="#fallback">using the fallback filename,</a> and <a href="#clearing">clearing NVRAM entries.</a></p>
+<p>I've received a few reports of a sluggish boot process (a delay of about 30 seconds before starting rEFInd) on some Macs after installing rEFInd, as well as some other Mac-specific peculiarities. I've been unable to replicate this problem myself, and its true cause remains mysterious to me. I have found three possible solutions, though: <a href="#moving">moving rEFInd to an HFS+ volume,</a> <a href="#fallback">using the fallback filename,</a> and <a href="#clearing">clearing NVRAM entries.</a></p>
 
 <a name="moving">
 <h3>Moving rEFInd to an HFS+ Volume</h3>
@@ -986,6 +988,22 @@ $ <b>ioreg -l -p IODeviceTree | grep firmware-abi</b>
 
 <p>Some sources suggest that delayed launches of rEFInd on Macs are more common when installing rEFInd to the ESP, so if you've done this, you could try re-installing it to your OS X boot partition.</p>
 
+<a name="wakeprobs">
+<h3>Fixing Wake Problems</h3>
+</a>
+
+<p>Some people have reported that installing rEFInd causes problems with resuming from a suspended OS X session. I know of two workarounds to such problems:</p>
+
+<ul>
+
+<li>Install rEFInd to an HFS+ volume using the <tt>--ownhfs</tt> option to <tt>install.sh</tt>. Unfortunately, this solution requires either creating a small HFS+ volume for rEFInd or using an already-existing non-bootable HFS+ volume (if you've got one for data storage, for example).</li>
+
+<li>Type <tt class="userinput">sudo pmset -a autopoweroff 0</tt> in a Terminal window. This solution is likely to work if sleep operations work normally up to a point, but fail after about three hours.</li>
+
+</ul>
+
+<p>Unfortunately, I lack a recent Mac and so can't investigate these issues myself, so I'm dependent upon others (mostly non-programmers) to offer workarounds. This is the type of problem that really requires hands-on interactive debugging sessions with the code to stand any chance of finding a better solution.</p>
+
 <a name="uninstalling">
 <h2>Uninstalling rEFInd</h2>
 </a>
index 4c6fdd0d1bdda92e39373ac6c53e11862e04c362..19d04309fd320590c9dd4d09b3bff75b20ec4216 100644 (file)
@@ -214,6 +214,7 @@ timeout 20
 # "false" resets to the default value. This token has no effect on Macs or
 # when no BIOS-mode options are set via scanfor.
 # Default is unset (or "uefi_deep_legacy_scan true")
+#
 #uefi_deep_legacy_scan
 
 # Delay for the specified number of seconds before scanning disks.
@@ -291,16 +292,14 @@ timeout 20
 # useful for better integration with Linux distributions that provide
 # kernels with EFI stub loaders but that don't give those kernels filenames
 # that end in ".efi", particularly if the kernels are stored on a
-# filesystem that the EFI can read. When uncommented, this option causes
-# all files in scanned directories with names that begin with "vmlinuz"
-# or "bzImage" to be included as loaders, even if they lack ".efi"
-# extensions. The drawback to this option is that it can pick up kernels
-# that lack EFI stub loader support and other files. Passing this option
-# a "0" value causes kernels without ".efi" extensions to NOT be scanned;
-# passing it alone or with any other value causes all kernels to be scanned.
-# Default is to NOT scan for kernels without ".efi" extensions.
+# filesystem that the EFI can read. When set to "1", "true", or "on", this
+# option causes all files in scanned directories with names that begin with
+# "vmlinuz" or "bzImage" to be included as loaders, even if they lack ".efi"
+# extensions. Passing this option a "0", "false", or "off" value causes
+# kernels without ".efi" extensions to NOT be scanned.
+# Default is "true" -- to scan for kernels without ".efi" extensions.
 #
-scan_all_linux_kernels
+#scan_all_linux_kernels false
 
 # Set the maximum number of tags that can be displayed on the screen at
 # any time. If more loaders are discovered than this value, rEFInd shows
index 15a37fb4d87c5f04e190de0c53be74eff6fb58f8..35017322c80f2400f54fedf7cbed5572f4b5b977 100644 (file)
@@ -1,7 +1,7 @@
 Summary: EFI boot manager software
 Name: refind
 Version: 0.8.2
-Release: 1%{?dist}
+Release: 2%{?dist}
 Summary: EFI boot manager software
 License: GPLv3
 URL: http://www.rodsbooks.com/refind/
index e58238b53b55eb4b94366720510398b5e4b66213..7afb52900a46da8cd7971cd1f7c88272a3b000a0 100644 (file)
@@ -332,7 +332,6 @@ static VOID HandleString(IN CHAR16 **TokenList, IN UINTN TokenCount, OUT CHAR16
          *Target = StrDuplicate(TokenList[1]);
       } // if/else
    } // if
-   PauseForKey();
 } // static VOID HandleString()
 
 // Handle a parameter with a series of string arguments, to replace or be added to a
@@ -666,11 +665,6 @@ VOID ReadConfig(CHAR16 *FileName)
 
         } else if (StriCmp(TokenList[0], L"scan_all_linux_kernels") == 0) {
            GlobalConfig.ScanAllLinux = HandleBoolean(TokenList, TokenCount);
-//            if ((TokenCount >= 2) && (StriCmp(TokenList[1], L"0") == 0)) {
-//               GlobalConfig.ScanAllLinux = FALSE;
-//            } else {
-//               GlobalConfig.ScanAllLinux = TRUE;
-//            }
 
         } else if (StriCmp(TokenList[0], L"max_tags") == 0) {
            HandleInt(TokenList, TokenCount, &(GlobalConfig.MaxTags));
index 95ac32f19fb6ad00d3bfb9f28d4ffe11ca7c4114..4397db831f526e5c2e7b766dd80ce2039afbd6c9 100644 (file)
 // Directories to search for memtest86....
 #define MEMTEST_LOCATIONS       L"EFI\\tools,EFI\\tools\\memtest86,EFI\\tools\\memtest,EFI\\memtest86,EFI\\memtest"
 // Files that may be Windows recovery files
-#define WINDOWS_RECOVERY_FILES  L"EFI\\Microsoft\\Boot\\LrsBootmgr.efi"
+#define WINDOWS_RECOVERY_FILES  L"EFI\\Microsoft\\Boot\\LrsBootmgr.efi,Recovery:\\EFI\\BOOT\\bootx64.efi,Recovery:\\EFI\\BOOT\\bootia32.efi"
 
 #define NULL_GUID_VALUE { 0x00000000, 0x0000, 0x0000, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} };
 #define REFIND_GUID_VALUE { 0x36D08FA7, 0xCF0B, 0x42F5, {0x8F, 0x14, 0x68, 0xDF, 0x73, 0xED, 0x37, 0x40} };
index aacbe93b848a4c5975c273fe17881f7d269d893e..0032e16287dc612dc04fbc00dcf5c61c756e89c5 100644 (file)
@@ -139,7 +139,7 @@ static REFIT_MENU_SCREEN MainMenu       = { L"Main Menu", NULL, 0, NULL, 0, NULL
                                             L"Insert or F2 for more options; Esc to refresh" };
 static REFIT_MENU_SCREEN AboutMenu      = { L"About", NULL, 0, NULL, 0, NULL, 0, NULL, L"Press Enter to return to main menu", L"" };
 
-REFIT_CONFIG GlobalConfig = { FALSE, FALSE, FALSE, 0, 0, 0, DONT_CHANGE_TEXT_MODE, 20, 0, 0, GRAPHICS_FOR_OSX, LEGACY_TYPE_MAC, 0, 0,
+REFIT_CONFIG GlobalConfig = { FALSE, TRUE, FALSE, 0, 0, 0, DONT_CHANGE_TEXT_MODE, 20, 0, 0, GRAPHICS_FOR_OSX, LEGACY_TYPE_MAC, 0, 0,
                               { DEFAULT_BIG_ICON_SIZE / 4, DEFAULT_SMALL_ICON_SIZE, DEFAULT_BIG_ICON_SIZE }, BANNER_NOSCALE,
                               NULL, NULL, CONFIG_FILE_NAME, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
                               { TAG_SHELL, TAG_MEMTEST, TAG_GDISK, TAG_APPLE_RECOVERY, TAG_WINDOWS_RECOVERY, TAG_MOK_TOOL,
@@ -169,7 +169,7 @@ static VOID AboutrEFInd(VOID)
 
     if (AboutMenu.EntryCount == 0) {
         AboutMenu.TitleImage = BuiltinIcon(BUILTIN_ICON_FUNC_ABOUT);
-        AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.8.2");
+        AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.8.2.3");
         AddMenuInfoLine(&AboutMenu, L"");
         AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2006-2010 Christoph Pfisterer");
         AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2012-2014 Roderick W. Smith");
@@ -267,7 +267,8 @@ static EFI_STATUS StartEFIImageList(IN EFI_DEVICE_PATH **DevicePaths,
                                     IN CHAR16 *LoadOptions, IN UINTN LoaderType,
                                     IN CHAR16 *ImageTitle, IN CHAR8 OSType,
                                     OUT UINTN *ErrorInStep,
-                                    IN BOOLEAN Verbose)
+                                    IN BOOLEAN Verbose,
+                                    IN BOOLEAN IsDriver)
 {
     EFI_STATUS              Status, ReturnStatus;
     EFI_HANDLE              ChildImageHandle;
@@ -366,7 +367,8 @@ static EFI_STATUS StartEFIImageList(IN EFI_DEVICE_PATH **DevicePaths,
 
 bailout_unload:
     // unload the image, we don't care if it works or not...
-    Status = refit_call1_wrapper(BS->UnloadImage, ChildImageHandle);
+    if (!IsDriver)
+       Status = refit_call1_wrapper(BS->UnloadImage, ChildImageHandle);
 
 bailout:
     MyFreePool(FullLoadOptions);
@@ -377,13 +379,15 @@ static EFI_STATUS StartEFIImage(IN EFI_DEVICE_PATH *DevicePath,
                                 IN CHAR16 *LoadOptions, IN UINTN LoaderType,
                                 IN CHAR16 *ImageTitle, IN CHAR8 OSType,
                                 OUT UINTN *ErrorInStep,
-                                IN BOOLEAN Verbose)
+                                IN BOOLEAN Verbose,
+                                IN BOOLEAN IsDriver
+                               )
 {
     EFI_DEVICE_PATH *DevicePaths[2];
 
     DevicePaths[0] = DevicePath;
     DevicePaths[1] = NULL;
-    return StartEFIImageList(DevicePaths, LoadOptions, LoaderType, ImageTitle, OSType, ErrorInStep, Verbose);
+    return StartEFIImageList(DevicePaths, LoadOptions, LoaderType, ImageTitle, OSType, ErrorInStep, Verbose, IsDriver);
 } /* static EFI_STATUS StartEFIImage() */
 
 // From gummiboot: Reboot the computer into its built-in user interface
@@ -437,7 +441,7 @@ static VOID StartLoader(LOADER_ENTRY *Entry, CHAR16 *SelectionName)
     BeginExternalScreen(Entry->UseGraphicsMode, L"Booting OS");
     StoreLoaderName(SelectionName);
     StartEFIImage(Entry->DevicePath, Entry->LoadOptions, TYPE_EFI,
-                  Basename(Entry->LoaderPath), Entry->OSType, &ErrorInStep, !Entry->UseGraphicsMode);
+                  Basename(Entry->LoaderPath), Entry->OSType, &ErrorInStep, !Entry->UseGraphicsMode, FALSE);
     FinishExternalScreen();
 }
 
@@ -1629,7 +1633,7 @@ static VOID StartLegacy(IN LEGACY_ENTRY *Entry, IN CHAR16 *SelectionName)
     ExtractLegacyLoaderPaths(DiscoveredPathList, MAX_DISCOVERED_PATHS, LegacyLoaderList);
 
     StoreLoaderName(SelectionName);
-    Status = StartEFIImageList(DiscoveredPathList, Entry->LoadOptions, TYPE_LEGACY, L"legacy loader", 0, &ErrorInStep, TRUE);
+    Status = StartEFIImageList(DiscoveredPathList, Entry->LoadOptions, TYPE_LEGACY, L"legacy loader", 0, &ErrorInStep, TRUE, FALSE);
     if (Status == EFI_NOT_FOUND) {
         if (ErrorInStep == 1) {
             Print(L"\nPlease make sure that you have the latest firmware update installed.\n");
@@ -1974,7 +1978,7 @@ static VOID StartTool(IN LOADER_ENTRY *Entry)
    BeginExternalScreen(Entry->UseGraphicsMode, Entry->me.Title + 6);  // assumes "Start <title>" as assigned below
    StoreLoaderName(Entry->me.Title);
    StartEFIImage(Entry->DevicePath, Entry->LoadOptions, TYPE_EFI,
-                 Basename(Entry->LoaderPath), Entry->OSType, NULL, TRUE);
+                 Basename(Entry->LoaderPath), Entry->OSType, NULL, TRUE, FALSE);
    FinishExternalScreen();
 } /* static VOID StartTool() */
 
@@ -2022,7 +2026,7 @@ static UINTN ScanDriverDir(IN CHAR16 *Path)
         SPrint(FileName, 255, L"%s\\%s", Path, DirEntry->FileName);
         NumFound++;
         Status = StartEFIImage(FileDevicePath(SelfLoadedImage->DeviceHandle, FileName),
-                               L"", TYPE_EFI, DirEntry->FileName, 0, NULL, FALSE);
+                               L"", TYPE_EFI, DirEntry->FileName, 0, NULL, FALSE, TRUE);
     }
     Status = DirIterClose(&DirIter);
     if (Status != EFI_NOT_FOUND) {