MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / ScanTool

Function ScanTool

rEFIt_UEFI/entry_scan/tool.cpp:188–231  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

186}
187
188VOID ScanTool(VOID)
189{
190 EFI_STATUS Status;
191 UINTN VolumeIndex;
192 REFIT_VOLUME *Volume;
193 VOID *Interface;
194 if (ThemeX.HideUIFlags & HIDEUI_FLAG_TOOLS)
195 return;
196
197 // DBG("Scanning for tools...\n");
198 if (!(ThemeX.HideUIFlags & HIDEUI_FLAG_SHELL)) {
199 if (!AddToolEntry(L"\\EFI\\CLOVER\\tools\\Shell64U.efi"_XSW, NULL, L"UEFI Shell 64", SelfVolume, ThemeX.GetIcon(BUILTIN_ICON_TOOL_SHELL), 'S', NullXString8Array)) {
200 AddToolEntry(L"\\EFI\\CLOVER\\tools\\Shell64.efi"_XSW, NULL, L"EFI Shell 64", SelfVolume, ThemeX.GetIcon(BUILTIN_ICON_TOOL_SHELL), 'S', NullXString8Array);
201 }
202 }
203
204// if (!gFirmwareClover) { //Slice: I wish to extend functionality on emulated nvram
205 for (VolumeIndex = 0; VolumeIndex < Volumes.size(); VolumeIndex++) {
206 Volume = &Volumes[VolumeIndex];
207 if (!Volume->RootDir || !Volume->DeviceHandle) {
208 continue;
209 }
210
211 Status = gBS->HandleProtocol (Volume->DeviceHandle, &gEfiPartTypeSystemPartGuid, &Interface);
212 if (Status == EFI_SUCCESS) {
213 DBG("Checking EFI partition Volume %llu for Clover\n", VolumeIndex);
214
215 // OSX adds label "EFI" to EFI volumes and some UEFIs see that
216 // as a file. This file then blocks access to the /EFI directory.
217 // We will delete /EFI file here and leave only /EFI directory.
218 if (DeleteFile(Volume->RootDir, L"EFI")) {
219 DBG(" Deleted /EFI label\n");
220 }
221
222 if (FileExists(Volume->RootDir, CLOVER_MEDIA_FILE_NAME)) {
223 DBG(" Found Clover\n");
224 // Volume->BootType = BOOTING_BY_EFI;
225 AddCloverEntry(CLOVER_MEDIA_FILE_NAME, L"Clover Boot Options", Volume);
226 break;
227 }
228 }
229 }
230// }
231}
232
233// Add custom tool entries
234VOID AddCustomTool(VOID)

Callers 1

RefitMainFunction · 0.85

Calls 5

AddToolEntryFunction · 0.85
DeleteFileFunction · 0.85
FileExistsFunction · 0.85
AddCloverEntryFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected