X-Git-Url: https://code.delx.au/refind/blobdiff_plain/672b9a0c278036e626685ab3439631c298909a22..e63c2d65be451323f51c85910d1e125deb1ad1ea:/refind/main.c diff --git a/refind/main.c b/refind/main.c index f169086..ba3368b 100644 --- a/refind/main.c +++ b/refind/main.c @@ -65,6 +65,7 @@ #include "mok.h" #include "gpt.h" #include "apple.h" +#include "mystrings.h" #include "security_policy.h" #include "driver_support.h" #include "../include/Handle.h" @@ -140,7 +141,7 @@ EFI_GUID gFreedesktopRootGuid = { 0xb921b045, 0x1df0, 0x41c3, { 0xaf, 0x44, 0x4c // Patterns that identify Linux kernels. Added to the loader match pattern when the // scan_all_linux_kernels option is set in the configuration file. Causes kernels WITHOUT // a ".efi" extension to be found when scanning for boot loaders. -#define LINUX_MATCH_PATTERNS L"vmlinuz*,bzImage*" +#define LINUX_MATCH_PATTERNS L"vmlinuz*,bzImage*,kernel*" // Maximum length of a text string in certain menus #define MAX_LINE_LENGTH 65 @@ -187,12 +188,12 @@ struct LOADER_LIST { static VOID AboutrEFInd(VOID) { - CHAR16 *FirmwareVendor; - INTN CsrStatus; + CHAR16 *FirmwareVendor; + UINT32 CsrStatus; if (AboutMenu.EntryCount == 0) { AboutMenu.TitleImage = BuiltinIcon(BUILTIN_ICON_FUNC_ABOUT); - AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.9.2.6"); + AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.10.0.3"); AddMenuInfoLine(&AboutMenu, L""); AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2006-2010 Christoph Pfisterer"); AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2012-2015 Roderick W. Smith"); @@ -210,10 +211,10 @@ static VOID AboutrEFInd(VOID) #else AddMenuInfoLine(&AboutMenu, L" Platform: unknown"); #endif - CsrStatus = GetCsrStatus(); - RecordgCsrStatus(CsrStatus); - if ((CsrStatus == -2) || (CsrStatus >= 0)) + if (GetCsrStatus(&CsrStatus) == EFI_SUCCESS) { + RecordgCsrStatus(CsrStatus, FALSE); AddMenuInfoLine(&AboutMenu, gCsrStatus); + } FirmwareVendor = StrDuplicate(ST->FirmwareVendor); LimitStringLength(FirmwareVendor, MAX_LINE_LENGTH); // More than ~65 causes empty info page on 800x600 display AddMenuInfoLine(&AboutMenu, PoolPrint(L" Firmware: %s %d.%02d", FirmwareVendor, ST->FirmwareRevision >> 16, @@ -1002,7 +1003,7 @@ VOID SetLoaderDefaults(LOADER_ENTRY *Entry, CHAR16 *LoaderPath, REFIT_VOLUME *Vo } // if/else network boot // detect specific loaders - if (StriSubCmp(L"bzImage", NameClues) || StriSubCmp(L"vmlinuz", NameClues)) { + if (StriSubCmp(L"bzImage", NameClues) || StriSubCmp(L"vmlinuz", NameClues) || StriSubCmp(L"kernel", NameClues)) { if (Volume->DiskKind != DISK_KIND_NET) { GuessLinuxDistribution(&OSIconName, Volume, LoaderPath); Entry->LoadOptions = GetMainLinuxOptions(LoaderPath, Volume); @@ -1416,7 +1417,9 @@ static BOOLEAN ScanLoaderDir(IN REFIT_VOLUME *Volume, IN CHAR16 *Path, IN CHAR16 NewLoader = LoaderList; while (NewLoader != NULL) { - IsLinux = (StriSubCmp(L"bzImage", NewLoader->FileName) || StriSubCmp(L"vmlinuz", NewLoader->FileName)); + IsLinux = (StriSubCmp(L"bzImage", NewLoader->FileName) || + StriSubCmp(L"vmlinuz", NewLoader->FileName) || + StriSubCmp(L"kernel", NewLoader->FileName)); if ((FirstKernel != NULL) && IsLinux && GlobalConfig.FoldLinuxKernels) { AddKernelToSubmenu(FirstKernel, NewLoader->FileName, Volume); } else { @@ -1912,6 +1915,7 @@ static VOID ScanForTools(VOID) { UINTN i, j, VolumeIndex; UINT64 osind; CHAR8 *b = 0; + UINT32 CsrValue; MokLocations = StrDuplicate(MOK_LOCATIONS); if (MokLocations != NULL) @@ -2043,7 +2047,7 @@ static VOID ScanForTools(VOID) { break; case TAG_CSR_ROTATE: - if ((GetCsrStatus() >= 0) && (GlobalConfig.CsrValues)) { + if ((GetCsrStatus(&CsrValue) == EFI_SUCCESS) && (GlobalConfig.CsrValues)) { TempMenuEntry = CopyMenuEntry(&MenuEntryRotateCsr); TempMenuEntry->Image = BuiltinIcon(BUILTIN_ICON_FUNC_CSR_ROTATE); AddMenuEntry(&MainMenu, TempMenuEntry);