| 186 | } |
| 187 | |
| 188 | VOID 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 |
| 234 | VOID AddCustomTool(VOID) |
no test coverage detected