From: srs5694 Date: Thu, 10 Jan 2013 07:06:11 +0000 (-0500) Subject: New "safe mode" boot option for OS X and "safemode" option for X-Git-Url: https://code.delx.au/refind/commitdiff_plain/f9672fe29af6b6b20434ad8600773b04ce1f1ded New "safe mode" boot option for OS X and "safemode" option for "hideui" refind.conf token to disable it. --- diff --git a/NEWS.txt b/NEWS.txt index 4357400..d14ebed 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -1,6 +1,11 @@ 0.6.5 (1/??/2013): ------------------ +- Added "safemode" option to "hideui" token, to hide option to boot into + safe mode for OS X ("-v -x" option to boot.efi). + +- Added icon for Haiku (os_haiku.icns). + - Fixed bug that could cause rEFInd to crash if fed a banner image that's too big. Note that "too big" can be substantially smaller than the screen resolution! diff --git a/docs/refind/configfile.html b/docs/refind/configfile.html index b45b129..ae5bc7c 100644 --- a/docs/refind/configfile.html +++ b/docs/refind/configfile.html @@ -175,8 +175,8 @@ timeout 20 hideui - banner, label, singleuser, hwtest, arrows, hints, editor, or all - Removes the specified user interface features. banner removes the banner graphic, label removes the text description of each tag and the countdown timer, singleuser removes the single-user option from the Mac OS sub-menu, hwtest removes the Mac OS hardware test option, arrows removes the arrows to the right or left of the OS tags when rEFInd finds too many OSes to display simultaneously, hints removes the brief description of what basic keypressed do, editor disables the options editor, and all removes all of these options. You can specify multiple parameters with this option. The default is to set none of these values. + banner, label, singleuser, safemode, hwtest, arrows, hints, editor, or all + Removes the specified user interface features. banner removes the banner graphic, label removes the text description of each tag and the countdown timer, singleuser removes the single-user option from the OS X sub-menu, safemode removes the option to boot to safe mode from the OS X sub-menu, hwtest removes the Macintosh hardware test option, arrows removes the arrows to the right or left of the OS tags when rEFInd finds too many OSes to display simultaneously, hints removes the brief description of what basic keypresses do, editor disables the options editor, and all removes all of these options. You can specify multiple parameters with this option. The default is to set none of these values. icons_dir diff --git a/refind/config.c b/refind/config.c index 12375c4..8c18f41 100644 --- a/refind/config.c +++ b/refind/config.c @@ -398,6 +398,8 @@ VOID ReadConfig(CHAR16 *FileName) GlobalConfig.HideUIFlags |= HIDEUI_FLAG_HINTS; } else if (StriCmp(FlagName, L"editor") == 0) { GlobalConfig.HideUIFlags |= HIDEUI_FLAG_EDITOR; + } else if (StriCmp(FlagName, L"safemode") == 0) { + GlobalConfig.HideUIFlags |= HIDEUI_FLAG_SAFEMODE; } else if (StriCmp(FlagName, L"all") == 0) { GlobalConfig.HideUIFlags = HIDEUI_FLAG_ALL; } else { diff --git a/refind/config.h b/refind/config.h index bc211a9..cafcb4f 100644 --- a/refind/config.h +++ b/refind/config.h @@ -75,6 +75,7 @@ typedef struct { #define HIDEUI_FLAG_ARROWS (0x0010) #define HIDEUI_FLAG_HINTS (0x0020) #define HIDEUI_FLAG_EDITOR (0x0040) +#define HIDEUI_FLAG_SAFEMODE (0x0080) #define HIDEUI_FLAG_ALL ((0xffff)) #define CONFIG_FILE_NAME L"refind.conf" diff --git a/refind/main.c b/refind/main.c index 5f5a64d..4006ac7 100644 --- a/refind/main.c +++ b/refind/main.c @@ -568,7 +568,17 @@ VOID GenerateSubScreen(LOADER_ENTRY *Entry, IN REFIT_VOLUME *Volume) { 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");