]> code.delx.au - refind/commitdiff
Fixed ELILO-in-Secure-Boot bug and bug that caused hangs of the EFI
authorsrs5694 <srs5694@users.sourceforge.net>
Sat, 8 Dec 2012 22:49:34 +0000 (17:49 -0500)
committersrs5694 <srs5694@users.sourceforge.net>
Sat, 8 Dec 2012 22:49:34 +0000 (17:49 -0500)
shell on some systems.

NEWS.txt
docs/refind/secureboot.html
refind/main.c
refind/mok.c

index ca90d7e14bb223d3ac53e7e6b4e502fbc0ec446d..c9277003cd5e9110e80fa0b8837f369aed49918b 100644 (file)
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -1,12 +1,12 @@
 0.5.1 (??/??/201?):
 -------------------
 
-- Implemented a workaround to enable ELILO to launch with Secure Boot
-  active: Pass a "-C \path\to\elilo\elilo.conf" option to the program.
-  The user will need to explicitly provide the path to the Linux kernel and
-  initrd, not rely on the program to be able to read the files from the
-  current directory. In elilo.conf, the path should be specified with
-  forward slashes or doubled-up backslashes.
+- Fixed bug that caused some programs (EFI shells, in particular) to hang
+  when launching on some systems (DUET, in particular).
+
+- Implemented a fix to enable ELILO to launch with Secure Boot active.
+  This fix might help with some other boot loaders in Secure Boot mode,
+  too, but I don't know of any specifics.
 
 0.5.0 (12/6/2012):
 ------------------
index d193e87d50f0fadab33b71ecd152aeb5cd0a9f08..d254f817b3557ae935f649851e540fe6b0d5922d 100644 (file)
@@ -226,25 +226,12 @@ Change <tt>Your Name</tt> to your own name or other identifying characteristics,
     try to launch two drivers, rEFInd throws up an <tt>Access Denied</tt>
     error for the second driver.</li>
 
-<li>ELILO can't find the directory from which it was launched when launched
-    from rEFInd in Secure Boot mode. This means that you must pass the
-    <tt>-C <tt class="variable">/path/to/binary/</tt>elilo.conf</tt> option
-    to ELILO. rEFInd does this automatically for the default ELILO option,
-    but you should bear the need in mind if you edit that option or use the
-    secondary boot options. Because of the same problem, you must specify
-    the complete path to your kernel and initial RAM disk file in
-    <tt>elilo.conf</tt>. Be sure to specify these paths using either
-    forward slashes (<tt>/</tt>) or doubled-up backslashes (<tt>\\</tt>).
-    It's possible that some other boot loaders will suffer from the same
-    problem.</li>
-
-<li>Signing the Windows boot loader with a MOK won't work; it hangs,
-    probably for reasons similar to the ones that cause ELILO to fail to
-    find its home directory. Fortunately, the Windows 8 boot loader should
-    work because it should be verified and launched via EFI calls rather
-    than via the new shim-derived code. (I lack a Windows 8 installation
-    for testing, though.) This limitation could affect you if you want to
-    boot Windows 7 with Secure Boot active, though.</li>
+<li>Signing the Windows boot loader with a MOK won't work; it hangs.
+    Fortunately, the Windows 8 boot loader should work because it should be
+    verified and launched via EFI calls rather than via the new
+    shim-derived code. (I lack a Windows 8 installation for testing,
+    though.) This limitation could affect you if you want to boot Windows 7
+    with Secure Boot active.</li>
 
 <li>Under certain circumstances, the time required to launch a boot loader
     can increase. This is unlikely to be noticeable for the average small
index ffbcdb31de6d9308e885381181317fc5585a807b..e53c2edad1bf6657b7f13630057172005f78065a 100644 (file)
@@ -118,7 +118,7 @@ static VOID AboutrEFInd(VOID)
 
     if (AboutMenu.EntryCount == 0) {
         AboutMenu.TitleImage = BuiltinIcon(BUILTIN_ICON_FUNC_ABOUT);
-        AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.5.0.1");
+        AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.5.0.2");
         AddMenuInfoLine(&AboutMenu, L"");
         AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2006-2010 Christoph Pfisterer");
         AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2012 Roderick W. Smith");
@@ -196,8 +196,12 @@ static EFI_STATUS StartEFIImageList(IN EFI_DEVICE_PATH **DevicePaths,
         } else {
             MergeStrings(&FullLoadOptions, LoadOptions, 0);
         } // if/else
-        // NOTE: We also include the terminating null in the length for safety.
-    } // if (LoadOptions != NULL)
+    } else { // LoadOptions == NULL
+       // NOTE: We provide a non-null string when no options are specified for safety;
+       // some systems (at least DUET) can hang when launching some programs (such as
+       // an EFI shell) without this.
+       FullLoadOptions = StrDuplicate(L" ");
+    }
     if (Verbose)
        Print(L"Starting %s\nUsing load options '%s'\n", ImageTitle, FullLoadOptions);
 
@@ -211,8 +215,8 @@ static EFI_STATUS StartEFIImageList(IN EFI_DEVICE_PATH **DevicePaths,
        // TODO: Track down the cause of this error and fix it, if possible.
        // ReturnStatus = Status = refit_call6_wrapper(BS->LoadImage, FALSE, SelfImageHandle, DevicePaths[DevicePathIndex],
        //                                            ImageData, ImageSize, &ChildImageHandle);
-       ReturnStatus = Status = refit_call6_wrapper(BS->LoadImage, FALSE, SelfImageHandle, DevicePaths[DevicePathIndex],
-                                                   NULL, 0, &ChildImageHandle);
+        ReturnStatus = Status = refit_call6_wrapper(BS->LoadImage, FALSE, SelfImageHandle, DevicePaths[DevicePathIndex],
+                                                    NULL, 0, &ChildImageHandle);
        if ((Status == EFI_ACCESS_DENIED) && (ShimLoaded())) {
           FindVolumeAndFilename(DevicePaths[DevicePathIndex], &DeviceVolume, &loader);
           if (DeviceVolume != NULL) {
@@ -743,12 +747,12 @@ VOID SetLoaderDefaults(LOADER_ENTRY *Entry, CHAR16 *LoaderPath, IN REFIT_VOLUME
    } else if (StriCmp(FileName, L"e.efi") == 0 || StriCmp(FileName, L"elilo.efi") == 0 || StriSubCmp(L"elilo", FileName)) {
       MergeStrings(&OSIconName, L"elilo,linux", L',');
       Entry->OSType = 'E';
-      if (secure_mode()) { // hack to enable ELILO to boot in secure mode
-         Temp = StrDuplicate(L"-C ");
-         MergeStrings(&Temp, PathOnly, 0);
-         MergeStrings(&Temp, L"elilo.conf", L'\\');
-         Entry->LoadOptions = Temp;
-      }
+//       if (secure_mode()) { // hack to enable ELILO to boot in secure mode
+//          Temp = StrDuplicate(L"-C ");
+//          MergeStrings(&Temp, PathOnly, 0);
+//          MergeStrings(&Temp, L"elilo.conf", L'\\');
+//          Entry->LoadOptions = Temp;
+//       }
       if (ShortcutLetter == 0)
          ShortcutLetter = 'L';
       Entry->UseGraphicsMode = GlobalConfig.GraphicsFor & GRAPHICS_FOR_ELILO;
index d97d8773075a41afcb7c1a331ea0fa1fa5a7fe8b..091028abcb9f2b3677f47432c96091caf2cd714f 100644 (file)
@@ -436,7 +436,7 @@ static EFI_STATUS handle_image (void *data, unsigned int datasize, EFI_LOADED_IM
     * disk, and its load options, so fix up the loaded image protocol values
     */
    DevicePath = FileDevicePath(NULL, FileName);
-   DevicePath = FileDevicePath(DeviceVolume->DeviceHandle, FileName);
+//   DevicePath = FileDevicePath(DeviceVolume->DeviceHandle, FileName);
    li->DeviceHandle = DeviceVolume->DeviceHandle;
    li->FilePath = DevicePath;
    li->LoadOptionsSize = ((UINT32)StrLen(Options) + 1) * sizeof(CHAR16);