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");
+ AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.6.5");
AddMenuInfoLine(&AboutMenu, L"");
AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2006-2010 Christoph Pfisterer");
AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2012 Roderick W. Smith");
SubEntry->LoadOptions = L"-v -s";
AddMenuEntry(SubScreen, (REFIT_MENU_ENTRY *)SubEntry);
} // if
- } // not single-user
+ } // single-user mode allowed
+
+ if (!(GlobalConfig.HideUIFlags & HIDEUI_FLAG_SAFEMODE)) {
+ SubEntry = InitializeLoaderEntry(Entry);
+ if (SubEntry != NULL) {
+ SubEntry->me.Title = L"Boot Mac OS X in safe mode";
+ SubEntry->UseGraphicsMode = FALSE;
+ SubEntry->LoadOptions = L"-v -x";
+ AddMenuEntry(SubScreen, (REFIT_MENU_ENTRY *)SubEntry);
+ } // if
+ } // safe mode allowed
// check for Apple hardware diagnostics
StrCpy(DiagsFileName, L"System\\Library\\CoreServices\\.diagnostics\\diags.efi");
// 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);
+ }
+ 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