]> code.delx.au - refind/commitdiff
Remove redundant Ubuntu kernel entries; attempt at fix for re-scanning
authorsrs5694 <srs5694@users.sourceforge.net>
Tue, 15 Apr 2014 00:26:14 +0000 (20:26 -0400)
committersrs5694 <srs5694@users.sourceforge.net>
Tue, 15 Apr 2014 00:26:14 +0000 (20:26 -0400)
after ejecting disc.

NEWS.txt
install.sh
refind/lib.c
refind/main.c

index a5acbaced5b0b6f7c10f15d5b5a3c4f61b874e75..dbe119fdcdfaca7f3e6505aa933d42cbed41524e 100644 (file)
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -1,6 +1,13 @@
 0.7.9 (?/??/2014):
 ------------------
 
+- Attempt to fix rEFInd perpetually re-scanning after ejecting a disc on
+  some Macs.
+
+- Added check to remove redundant (or non-functional if Secure Boot is
+  active) kernel entries for Ubuntu, which is now including two versions of
+  kernels, one signed and the other unsigned.
+
 - Fixed bug in install.sh that could cause it to display error messages
   if the dmraid utility was not installed.
 
@@ -15,8 +22,6 @@
 - Fixed mistaken identification of the MOK utility as the "MOK utility
   utility."
 
-- Added detection of German-language FAT (non-)boot sector created by
-  iPartition to keep it out of the Mac boot menu.
 
 0.7.8 (3/9/2014):
 -----------------
index 6ca86f50d38698f4fa27f528fd8181db64b7726b..f538a43de920eff32a91a1d13025970c108f7cb8 100755 (executable)
@@ -35,6 +35,7 @@
 #
 # Revision history:
 #
+# 0.7.9   -- Fixed bug that caused errors if dmraid utility not installed
 # 0.7.7   -- Fixed bug that created mangled refind_linux.conf file; added ability
 #            to locate and mount ESP on Linux, if it's not mounted
 # 0.7.6   -- Added --ownhfs {device-filename} option
index 7ee9c4c2cbe5458768eb893da99495b1c2ced934..e45a226014a995ca76b6f0a89f48ab9f90df41b8 100644 (file)
@@ -635,11 +635,6 @@ static VOID ScanVolumeBootcode(REFIT_VOLUME *Volume, BOOLEAN *Bootable)
         if (FindMem(Buffer, 512, "Press any key to restart", 24) >= 0)
             Volume->HasBootCode = FALSE;
 
-        // dummy FAT boot sector (created by iPartition)
-        if ((FindMem(Buffer, 512, "Medienfehler", 12) >= 0) &&
-            (FindMem(Buffer, 512, "Neustart: Taste dr\x81" "cken", 22) >= 0))
-            Volume->HasBootCode = FALSE;
-
         // check for MBR partition table
         if (*((UINT16 *)(Buffer + 510)) == 0xaa55) {
             MbrTable = (MBR_PARTITION_INFO *)(Buffer + 446);
index 4f0b0b7fb6d187e4e67b68673900259ddf404007..2daffe0ed0924f44e07f9bdd4d2017fcc1398616 100644 (file)
@@ -159,7 +159,7 @@ static VOID AboutrEFInd(VOID)
 {
     if (AboutMenu.EntryCount == 0) {
         AboutMenu.TitleImage = BuiltinIcon(BUILTIN_ICON_FUNC_ABOUT);
-        AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.7.8.4");
+        AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.7.8.6");
         AddMenuInfoLine(&AboutMenu, L"");
         AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2006-2010 Christoph Pfisterer");
         AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2012-2014 Roderick W. Smith");
@@ -1224,6 +1224,26 @@ static BOOLEAN IsSymbolicLink(REFIT_VOLUME *Volume, CHAR16 *Path, EFI_FILE_INFO
    return (DirEntry->FileSize != FileSize2);
 } // BOOLEAN IsSymbolicLink()
 
+// Returns TRUE if a file with the same name as the original but with
+// ".efi.signed" is also present in the same directory. Ubuntu is using
+// this filename as a signed version of the original unsigned kernel, and
+// there's no point in cluttering the display with two kernels that will
+// behave identically on non-SB systems, or when one will fail when SB
+// is active.
+static BOOLEAN HasSignedCounterpart(IN REFIT_VOLUME *Volume, IN CHAR16 *Path, IN CHAR16 *Filename) {
+   CHAR16 *NewFile = NULL;
+   BOOLEAN retval = FALSE;
+
+   MergeStrings(&NewFile, Path, 0);
+   MergeStrings(&NewFile, Filename, L'\\');
+   MergeStrings(&NewFile, L".efi.signed", 0);
+   if (FileExists(Volume->RootDir, NewFile))
+      retval = TRUE;
+   MyFreePool(NewFile);
+
+   return retval;
+} // BOOLEAN HasSignedCounterpart()
+
 // Scan an individual directory for EFI boot loader files and, if found,
 // add them to the list. Exception: Ignores FALLBACK_FULLNAME, which is picked
 // up in ScanEfiFiles(). Sorts the entries within the loader directory so that
@@ -1251,6 +1271,7 @@ static BOOLEAN ScanLoaderDir(IN REFIT_VOLUME *Volume, IN CHAR16 *Path, IN CHAR16
               (StriCmp(DirEntry->FileName, FALLBACK_BASENAME) == 0 && (StriCmp(Path, L"EFI\\BOOT") == 0)) ||
               StriSubCmp(L"shell", DirEntry->FileName) ||
               IsSymbolicLink(Volume, Path, DirEntry) || /* is symbolic link */
+              HasSignedCounterpart(Volume, Path, DirEntry->FileName) || /* a file with same name plus ".efi.signed" is present */
               FilenameIn(Volume, Path, DirEntry->FileName, GlobalConfig.DontScanFiles))
                 continue;   // skip this
 
@@ -2521,6 +2542,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();
             continue;
         }