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, 0, 0, DONT_CHANGE_TEXT_MODE, 20, 0, 0, GRAPHICS_FOR_OSX, LEGACY_TYPE_MAC, 0,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+REFIT_CONFIG GlobalConfig = { FALSE, FALSE, 0, 0, 0, DONT_CHANGE_TEXT_MODE, 20, 0, 0, GRAPHICS_FOR_OSX, LEGACY_TYPE_MAC, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
{TAG_SHELL, TAG_APPLE_RECOVERY, TAG_MOK_TOOL, TAG_ABOUT, TAG_SHUTDOWN, TAG_REBOOT, 0, 0, 0, 0, 0 }};
// Structure used to hold boot loader filenames and time stamps in
if (AboutMenu.EntryCount == 0) {
AboutMenu.TitleImage = BuiltinIcon(BUILTIN_ICON_FUNC_ABOUT);
- AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.6.4.1");
+ AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.6.5.4");
AddMenuInfoLine(&AboutMenu, L"");
AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2006-2010 Christoph Pfisterer");
AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2012 Roderick W. Smith");
// earlier....
if ((SubScreen->Entries != NULL) && (SubScreen->Entries[0] != NULL)) {
MyFreePool(SubScreen->Entries[0]->Title);
- SubScreen->Entries[0]->Title = StrDuplicate(TokenList[0]);
+ SubScreen->Entries[0]->Title = TokenList[0] ? StrDuplicate(TokenList[0]) : StrDuplicate(L"Boot Linux");
} // if
FreeTokenLine(&TokenList, &TokenCount);
while ((TokenCount = ReadTokenLine(File, &TokenList)) > 1) {
SubEntry = InitializeLoaderEntry(Entry);
- SubEntry->me.Title = StrDuplicate(TokenList[0]);
+ SubEntry->me.Title = TokenList[0] ? StrDuplicate(TokenList[0]) : StrDuplicate(L"Boot Linux");
MyFreePool(SubEntry->LoadOptions);
SubEntry->LoadOptions = AddInitrdToOptions(TokenList[1], InitrdName);
FreeTokenLine(&TokenList, &TokenCount);
// code and shortcut letter. For Linux EFI stub loaders, also sets kernel options
// that will (with luck) work fairly automatically.
VOID SetLoaderDefaults(LOADER_ENTRY *Entry, CHAR16 *LoaderPath, REFIT_VOLUME *Volume) {
- CHAR16 IconFileName[256];
- CHAR16 *FileName, *PathOnly, *OSIconName = NULL, *Temp, *SubString;
+ CHAR16 *FileName, *PathOnly, *IconNames = NULL, *NoExtension, *OSIconName = NULL, *Temp, *SubString;
CHAR16 ShortcutLetter = 0;
- UINTN i, Length;
+ UINTN i = 0, Length;
FileName = Basename(LoaderPath);
PathOnly = FindPath(LoaderPath);
+ NoExtension = StripEfiExtension(FileName);
// locate a custom icon for the loader
// Anything found here takes precedence over the "hints" in the OSIconName variable
- StrCpy(IconFileName, LoaderPath);
- ReplaceEfiExtension(IconFileName, L".icns");
- if (FileExists(Volume->RootDir, IconFileName)) {
- Entry->me.Image = LoadIcns(Volume->RootDir, IconFileName, 128);
- } else if ((StrLen(PathOnly) == 0) && (Volume->VolIconImage != NULL)) {
+ while ((Temp = FindCommaDelimited(ICON_EXTENSIONS, i++)) != NULL) {
+ MergeStrings(&IconNames, NoExtension, L',');
+ MergeStrings(&IconNames, Temp, L'.');
+ MyFreePool(Temp);
+ }
+ if (!Entry->me.Image)
+ Entry->me.Image = LoadIcns(Volume->RootDir, IconNames, 128);
+ if (!Entry->me.Image)
Entry->me.Image = Volume->VolIconImage;
- } // icon matched to loader or volume
+ MyFreePool(IconNames);
// Begin creating icon "hints" by using last part of directory path leading
// to the loader
Extension = FindExtension(DirEntry->FileName);
if (DirEntry->FileName[0] == '.' ||
StriCmp(Extension, L".icns") == 0 ||
+ StriCmp(Extension, L".png") == 0 ||
StriSubCmp(L"shell", DirEntry->FileName) ||
IsIn(DirEntry->FileName, GlobalConfig.DontScanFiles))
continue; // skip this
} // while
if (FileExists(SelfDir, L"MokManager.efi")) {
MyFreePool(FileName);
- FileName = StrDuplicate(SelfDirPath);
+ FileName = SelfDirPath ? StrDuplicate(SelfDirPath) : NULL;
MergeStrings(&FileName, L"\\MokManager.efi", 0);
SPrint(Description, 255, L"MOK Key Manager at %s", FileName);
AddToolEntry(SelfLoadedImage->DeviceHandle, FileName, Description,
BOOLEAN MokProtocol;
REFIT_MENU_ENTRY *ChosenEntry;
UINTN MenuExit, i;
- CHAR16 *Selection;
+ CHAR16 *Selection = NULL;
EG_PIXEL BGColor;
// bootstrap
refit_call4_wrapper(BS->SetWatchdogTimer, 0x0000, 0x0000, 0x0000, NULL);
// further bootstrap (now with config available)
- SetupScreen();
MokProtocol = SecureBootSetup();
// ScanVolumes();
LoadDrivers();
ScanForBootloaders();
ScanForTools();
+ SetupScreen();
if (GlobalConfig.ScanDelay > 0) {
BGColor.b = 255;
RescanAll();
} // if
- Selection = StrDuplicate(GlobalConfig.DefaultSelection);
+ if (GlobalConfig.DefaultSelection)
+ Selection = StrDuplicate(GlobalConfig.DefaultSelection);
+
while (MainLoopRunning) {
MenuExit = RunMainMenu(&MainMenu, Selection, &ChosenEntry);