From: srs5694 Date: Tue, 15 Apr 2014 00:26:14 +0000 (-0400) Subject: Remove redundant Ubuntu kernel entries; attempt at fix for re-scanning X-Git-Url: https://code.delx.au/refind/commitdiff_plain/23e45cf6420a171473675a78346c5b0c184b95d8 Remove redundant Ubuntu kernel entries; attempt at fix for re-scanning after ejecting disc. --- diff --git a/NEWS.txt b/NEWS.txt index a5acbac..dbe119f 100644 --- 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): ----------------- diff --git a/install.sh b/install.sh index 6ca86f5..f538a43 100755 --- a/install.sh +++ b/install.sh @@ -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 diff --git a/refind/lib.c b/refind/lib.c index 7ee9c4c..e45a226 100644 --- a/refind/lib.c +++ b/refind/lib.c @@ -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); diff --git a/refind/main.c b/refind/main.c index 4f0b0b7..2daffe0 100644 --- a/refind/main.c +++ b/refind/main.c @@ -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; }