"windows_recovery_files" option.
<tr>
<td><tt>showtools</tt></td>
<td><tt>shell</tt>, <tt>memtest</tt>, <tt>gptsync</tt>, <tt>apple_recovery</tt>, <tt>mok_tool</tt>, <tt>about</tt>, <tt>exit</tt>, <tt>shutdown</tt>, <tt>reboot</tt>, and <tt>firmware</tt></td>
- <td>Specifies which tool tags to display on the second row. <tt>shell</tt> launches an EFI shell, <tt>memtest</tt> (or <tt>memtest86</tt> launches the <a href="http://www.memtest86.com/download.htm">Memtest86</a> program, <tt>gptsync</tt> launches a tool that creates a hybrid MBR, <tt>apple_recovery</tt> boots the OS X Recovery HD, <tt>mok_tool</tt> launches a tool to manage Machine Owner Keys (MOKs) on systems with Secure Boot active, <tt>about</tt> displays information about the program, <tt>exit</tt> terminates rEFInd, <tt>shutdown</tt> shuts down the computer (or reboots it, on some UEFI PCs), <tt>reboot</tt> reboots the computer, and <tt>firmware</tt> reboots the computer into the computer's own setup utility. The tags appear in the order in which you specify them. The default is <tt>shell, memtest, apple_recovery, mok_tool, about, shutdown, reboot, firmware</tt>. Note that the <tt>shell</tt>, <tt>memtest</tt>, <tt>apple_recovery</tt>, and <tt>mok_tool</tt> options all require the presence of programs not included with rEFInd. The <tt>gptsync</tt> option requires use of a like-named program which, although it ships with rEFInd 0.6.9 and later, is not installed by default except under OS X. See the <a href="installing.html#addons">"Installing Additional Components"</a> section of the <a href="installing.html">Installing rEFInd</a> page for pointers to the shell, Memtest86, and <tt>gptsync</tt> programs. The <tt>apple_recovery</tt> option will appear only if you've got an Apple Recovery HD partition (which has a boot loader called <tt>com.apple.recovery.boot/boot.efi</tt>). The <tt>firmware</tt> option works only on computers that support this option; on other computers, the option is quietly ignored. See the <a href="secureboot.html">Secure Boot</a> page for information on Secure Boot and MOK management.</td>
+ <td>Specifies which tool tags to display on the second row. <tt>shell</tt> launches an EFI shell, <tt>memtest</tt> (or <tt>memtest86</tt> launches the <a href="http://www.memtest86.com/download.htm">Memtest86</a> program, <tt>gptsync</tt> launches a tool that creates a hybrid MBR, <tt>apple_recovery</tt> boots the OS X Recovery HD, <tt>windows_recovery</tt> boots a Windows recovery tool, <tt>mok_tool</tt> launches a tool to manage Machine Owner Keys (MOKs) on systems with Secure Boot active, <tt>about</tt> displays information about the program, <tt>exit</tt> terminates rEFInd, <tt>shutdown</tt> shuts down the computer (or reboots it, on some UEFI PCs), <tt>reboot</tt> reboots the computer, and <tt>firmware</tt> reboots the computer into the computer's own setup utility. The tags appear in the order in which you specify them. The default is <tt>shell, memtest, apple_recovery, mok_tool, about, shutdown, reboot, firmware</tt>. Note that the <tt>shell</tt>, <tt>memtest</tt>, <tt>apple_recovery</tt>, and <tt>mok_tool</tt> options all require the presence of programs not included with rEFInd. The <tt>gptsync</tt> option requires use of a like-named program which, although it ships with rEFInd 0.6.9 and later, is not installed by default except under OS X. See the <a href="installing.html#addons">"Installing Additional Components"</a> section of the <a href="installing.html">Installing rEFInd</a> page for pointers to the shell, Memtest86, and <tt>gptsync</tt> programs. The <tt>apple_recovery</tt> option will appear only if you've got an Apple Recovery HD partition (which has a boot loader called <tt>com.apple.recovery.boot/boot.efi</tt>). The <tt>firmware</tt> option works only on computers that support this option; on other computers, the option is quietly ignored. See the <a href="secureboot.html">Secure Boot</a> page for information on Secure Boot and MOK management.</td>
</tr>
<tr>
<td><tt>font</tt></td>
<td>filename(s)</td>
<td>Adds the specified filename or filenames to a filename "blacklist"—these files are <i>not</i> included as boot loader options even if they're found on the disk. This is useful to exclude support programs (such as <tt>shim.efi</tt> and <tt>MokManager.efi</tt>) and drivers from your OS list. The default value is <tt>shim.efi, shim-fedora.efi, PreLoader.efi, TextMode.efi, ebounce.efi, GraphicsConsole.efi, MokManager.efi, HashTool.efi, HashTool-signed.efi</tt>. To add files to the default list rather than replace the list, specify <tt>+</tt> as the first option, as in <tt>dont_scan_files + badloader.efi</tt>.</td>
</tr>
+<tr>
+ <td><tt>windows_recovery_files</tt></td>
+ <td>filename(s)</td>
+ <td>Adds the specified filename or filenames to list that will be recognized as Windows recovery tools and presented as such on the second row, if <tt>windows_recovery</tt> is among the options to <tt>showtools</tt>. The filename must include a complete path and may optionally include a filesystem label, as in <tt>LRS_EFI:\EFI\Microsoft\Boot\LrsBootmgr.efi</tt>.</td>
+</tr>
<tr>
<td><tt>scan_all_linux_kernels</tt></td>
<td>none or <tt>0</tt></td>
# Which non-bootloader tools to show on the tools line, and in what
# order to display them:
-# shell - the EFI shell (requires external program; see rEFInd
-# documentation for details)
-# memtest - the memtest86 program, in EFI/tools, EFI/memtest86,
-# EFI/memtest, EFI/tools/memtest86, or EFI/tools/memtest
-# gptsync - the (dangerous) gptsync.efi utility (requires external
-# program; see rEFInd documentation for details)
-# apple_recovery - boots the Apple Recovery HD partition, if present
-# mok_tool - makes available the Machine Owner Key (MOK) maintenance
-# tool, MokManager.efi, used on Secure Boot systems
-# about - an "about this program" option
-# exit - a tag to exit from rEFInd
-# shutdown - shuts down the computer (a bug causes this to reboot
-# many UEFI systems)
-# reboot - a tag to reboot the computer
-# firmware - a tag to reboot the computer into the firmware's
-# user interface (ignored on older computers)
+# shell - the EFI shell (requires external program; see rEFInd
+# documentation for details)
+# memtest - the memtest86 program, in EFI/tools, EFI/memtest86,
+# EFI/memtest, EFI/tools/memtest86, or EFI/tools/memtest
+# gptsync - the (dangerous) gptsync.efi utility (requires external
+# program; see rEFInd documentation for details)
+# apple_recovery - boots the Apple Recovery HD partition, if present
+# windows_recovery - boots an OEM Windows recovery tool, if present
+# (see also the windows_recovery_files option)
+# mok_tool - makes available the Machine Owner Key (MOK) maintenance
+# tool, MokManager.efi, used on Secure Boot systems
+# about - an "about this program" option
+# exit - a tag to exit from rEFInd
+# shutdown - shuts down the computer (a bug causes this to reboot
+# many UEFI systems)
+# reboot - a tag to reboot the computer
+# firmware - a tag to reboot the computer into the firmware's
+# user interface (ignored on older computers)
# Default is shell,memtest,apple_recovery,mok_tool,about,shutdown,reboot,firmware
#
#showtools shell, memtest, mok_tool, about, reboot, exit, firmware
+# Boot loaders that can launch a Windows restore or emergency system.
+# These tend to be OEM-specific.
+#
+#windows_recovery_files LRS_ESP:/EFI/Microsoft/Boot/LrsBootmgr.efi
+
# Directories in which to search for EFI drivers. These drivers can
# provide filesystem support, give access to hard disks on plug-in
# controllers, etc. In most cases none are needed, but if you add
# label, which you can obtain in an EFI shell by typing "vol", from
# Linux by typing "blkid /dev/{devicename}", or by examining the
# disk's label in various OSes' file browsers.
-# The default is "Recovery HD".
+# The default is "Recovery HD,LRS_ESP".
#
#dont_scan_volumes "Recovery HD"
# set of tools. Most notably, MokManager.efi is in this blacklist,
# but will show up as a tool if present in certain directories. You
# can control the tools row with the showtools token.
-# The default is shim.efi,PreLoader.efi,TextMode.efi,ebounce.efi,GraphicsConsole.efi,MokManager.efi,HashTool.efi,HashTool-signed.efi
+# The default is shim.efi,PreLoader.efi,TextMode.efi,ebounce.efi,
+# GraphicsConsole.efi,MokManager.efi,HashTool.efi,HashTool-signed.efi,
+# bootmgr.efi
#
#dont_scan_files shim.efi,MokManager.efi
MergeStrings(&(GlobalConfig.DontScanFiles), MOK_NAMES, L',');
MyFreePool(GlobalConfig.DontScanVolumes);
GlobalConfig.DontScanVolumes = StrDuplicate(DONT_SCAN_VOLUMES);
+ GlobalConfig.WindowsRecoveryFiles = StrDuplicate(WINDOWS_RECOVERY_FILES);
} // if
if (!FileExists(SelfDir, FileName)) {
} else if ((StriCmp(TokenList[0], L"don't_scan_files") == 0) || (StriCmp(TokenList[0], L"dont_scan_files") == 0)) {
HandleStrings(TokenList, TokenCount, &(GlobalConfig.DontScanFiles));
+ } else if (StriCmp(TokenList[0], L"windows_recovery_files") == 0) {
+ HandleStrings(TokenList, TokenCount, &(GlobalConfig.WindowsRecoveryFiles));
+
} else if (StriCmp(TokenList[0], L"scan_driver_dirs") == 0) {
HandleStrings(TokenList, TokenCount, &(GlobalConfig.DriverDirs));
GlobalConfig.ShowTools[i - 1] = TAG_SHUTDOWN;
} else if (StriCmp(FlagName, L"apple_recovery") == 0) {
GlobalConfig.ShowTools[i - 1] = TAG_APPLE_RECOVERY;
+ } else if (StriCmp(FlagName, L"windows_recovery") == 0) {
+ GlobalConfig.ShowTools[i - 1] = TAG_WINDOWS_RECOVERY;
} else if (StriCmp(FlagName, L"mok_tool") == 0) {
GlobalConfig.ShowTools[i - 1] = TAG_MOK_TOOL;
} else if (StriCmp(FlagName, L"firmware") == 0) {
#define CONFIG_FILE_NAME L"refind.conf"
// Note: Below is combined with MOK_NAMES to make default
-#define DONT_SCAN_FILES L"shim.efi,shim-fedora.efi,PreLoader.efi,TextMode.efi,ebounce.efi,GraphicsConsole.efi"
-#define DONT_SCAN_VOLUMES L"Recovery HD"
+#define DONT_SCAN_FILES L"shim.efi,shim-fedora.efi,PreLoader.efi,TextMode.efi,ebounce.efi,GraphicsConsole.efi,bootmgr.efi"
+#define DONT_SCAN_VOLUMES L"Recovery HD,LRS_ESP"
#define ALSO_SCAN_DIRS L"boot"
EFI_STATUS ReadFile(IN EFI_FILE_HANDLE BaseDir, CHAR16 *FileName, REFIT_FILE *File, UINTN *size);
#define REFIT_DEBUG (0)
// Tag classifications; used in various ways.
-#define TAG_ABOUT (1)
-#define TAG_REBOOT (2)
-#define TAG_SHUTDOWN (3)
-#define TAG_TOOL (4)
-#define TAG_LOADER (5)
-#define TAG_LEGACY (6)
-#define TAG_EXIT (7)
-#define TAG_SHELL (8)
-#define TAG_GPTSYNC (9)
-#define TAG_LEGACY_UEFI (10)
-#define TAG_APPLE_RECOVERY (11)
-#define TAG_MOK_TOOL (12)
-#define TAG_FIRMWARE (13)
-#define TAG_MEMTEST (14)
-#define NUM_TOOLS (14)
+#define TAG_ABOUT (1)
+#define TAG_REBOOT (2)
+#define TAG_SHUTDOWN (3)
+#define TAG_TOOL (4)
+#define TAG_LOADER (5)
+#define TAG_LEGACY (6)
+#define TAG_EXIT (7)
+#define TAG_SHELL (8)
+#define TAG_GPTSYNC (9)
+#define TAG_LEGACY_UEFI (10)
+#define TAG_APPLE_RECOVERY (11)
+#define TAG_WINDOWS_RECOVERY (12)
+#define TAG_MOK_TOOL (13)
+#define TAG_FIRMWARE (14)
+#define TAG_MEMTEST (15)
+#define NUM_TOOLS (16)
#define NUM_SCAN_OPTIONS 10
#define MOK_LOCATIONS L"\\,EFI\\tools,EFI\\fedora,EFI\\redhat,EFI\\ubuntu,EFI\\suse,EFI\\opensuse,EFI\\altlinux"
// Directories to search for memtest86....
#define MEMTEST_LOCATIONS L"EFI\\tools,EFI\\tools\\memtest86,EFI\\tools\\memtest,EFI\\memtest86,EFI\\memtest"
+// Files that may be Windows recovery files
+#define WINDOWS_RECOVERY_FILES L"EFI\\Microsoft\\Boot\\LrsBootmgr.efi"
//
// global definitions
CHAR16 *DontScanVolumes;
CHAR16 *DontScanDirs;
CHAR16 *DontScanFiles;
+ CHAR16 *WindowsRecoveryFiles;
CHAR16 *DriverDirs;
CHAR16 *IconsDir;
UINTN ShowTools[NUM_TOOLS];
{ NULL, L"tool_part", 48 },
{ NULL, L"tool_rescue", 48 },
{ NULL, L"tool_apple_rescue", 48 },
+ { NULL, L"tool_windows_rescue", 48 },
{ NULL, L"tool_mok_tool", 48 },
{ NULL, L"tool_memtest", 48 },
{ NULL, L"vol_internal", 32 },
EG_IMAGE * BuiltinIcon(IN UINTN Id);
-#define BUILTIN_ICON_FUNC_ABOUT (0)
-#define BUILTIN_ICON_FUNC_RESET (1)
-#define BUILTIN_ICON_FUNC_SHUTDOWN (2)
-#define BUILTIN_ICON_FUNC_EXIT (3)
-#define BUILTIN_ICON_FUNC_FIRMWARE (4)
-#define BUILTIN_ICON_TOOL_SHELL (5)
-#define BUILTIN_ICON_TOOL_PART (6)
-#define BUILTIN_ICON_TOOL_RESCUE (7)
-#define BUILTIN_ICON_TOOL_APPLE_RESCUE (8)
-#define BUILTIN_ICON_TOOL_MOK_TOOL (9)
-#define BUILTIN_ICON_TOOL_MEMTEST (10)
-#define BUILTIN_ICON_VOL_INTERNAL (11)
-#define BUILTIN_ICON_VOL_EXTERNAL (12)
-#define BUILTIN_ICON_VOL_OPTICAL (13)
-#define BUILTIN_ICON_COUNT (14)
+#define BUILTIN_ICON_FUNC_ABOUT (0)
+#define BUILTIN_ICON_FUNC_RESET (1)
+#define BUILTIN_ICON_FUNC_SHUTDOWN (2)
+#define BUILTIN_ICON_FUNC_EXIT (3)
+#define BUILTIN_ICON_FUNC_FIRMWARE (4)
+#define BUILTIN_ICON_TOOL_SHELL (5)
+#define BUILTIN_ICON_TOOL_PART (6)
+#define BUILTIN_ICON_TOOL_RESCUE (7)
+#define BUILTIN_ICON_TOOL_APPLE_RESCUE (8)
+#define BUILTIN_ICON_TOOL_WINDOWS_RESCUE (9)
+#define BUILTIN_ICON_TOOL_MOK_TOOL (10)
+#define BUILTIN_ICON_TOOL_MEMTEST (11)
+#define BUILTIN_ICON_VOL_INTERNAL (12)
+#define BUILTIN_ICON_VOL_EXTERNAL (13)
+#define BUILTIN_ICON_VOL_OPTICAL (14)
+#define BUILTIN_ICON_COUNT (15)
#endif
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, 0, DONT_CHANGE_TEXT_MODE, 20, 0, 0, GRAPHICS_FOR_OSX, LEGACY_TYPE_MAC, 0, 0,
- NULL, NULL, CONFIG_FILE_NAME, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- { TAG_SHELL, TAG_MEMTEST, TAG_APPLE_RECOVERY, TAG_MOK_TOOL, TAG_ABOUT, TAG_SHUTDOWN,
- TAG_REBOOT, TAG_FIRMWARE, 0, 0, 0, 0, 0, 0 }
+ NULL, NULL, CONFIG_FILE_NAME, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ { TAG_SHELL, TAG_MEMTEST, TAG_APPLE_RECOVERY, TAG_WINDOWS_RECOVERY, TAG_MOK_TOOL, TAG_ABOUT,
+ TAG_SHUTDOWN, TAG_REBOOT, TAG_FIRMWARE, 0, 0, 0, 0, 0, 0 }
};
EFI_GUID GlobalGuid = EFI_GLOBAL_VARIABLE;
// Add the second-row tags containing built-in and external tools (EFI shell,
// reboot, etc.)
static VOID ScanForTools(VOID) {
- CHAR16 *FileName = NULL, *MokLocations, Description[256];
+ CHAR16 *FileName = NULL, *VolName = NULL, *MokLocations, Description[256];
REFIT_MENU_ENTRY *TempMenuEntry;
UINTN i, j, VolumeIndex;
UINT64 osind;
SPrint(Description, 255, L"Apple Recovery on %s", Volumes[VolumeIndex]->VolName);
AddToolEntry(Volumes[VolumeIndex]->DeviceHandle, FileName, Description,
BuiltinIcon(BUILTIN_ICON_TOOL_APPLE_RESCUE), 'R', TRUE);
- }
+ } // if
} // for
MyFreePool(FileName);
FileName = NULL;
break;
+ case TAG_WINDOWS_RECOVERY:
+ j = 0;
+ while ((FileName = FindCommaDelimited(GlobalConfig.WindowsRecoveryFiles, j++)) != NULL) {
+ SplitVolumeAndFilename(&FileName, &VolName);
+ for (VolumeIndex = 0; VolumeIndex < VolumesCount; VolumeIndex++) {
+ if ((Volumes[VolumeIndex]->RootDir != NULL) && (FileExists(Volumes[VolumeIndex]->RootDir, FileName)) &&
+ ((VolName == NULL) || (StriCmp(VolName, Volumes[VolumeIndex]->VolName) == 0))) {
+ SPrint(Description, 255, L"Microsoft Recovery on %s", Volumes[VolumeIndex]->VolName);
+ AddToolEntry(Volumes[VolumeIndex]->DeviceHandle, FileName, Description,
+ BuiltinIcon(BUILTIN_ICON_TOOL_WINDOWS_RESCUE), 'R', TRUE);
+ } // if
+ } // for
+ } // while
+ MyFreePool(FileName);
+ FileName = NULL;
+ MyFreePool(VolName);
+ VolName = NULL;
+ break;
+
case TAG_MOK_TOOL:
FindTool(MokLocations, MOK_NAMES, L"MOK utility utility", BUILTIN_ICON_TOOL_MOK_TOOL);
break;