Add custom entries
| 1922 | |
| 1923 | // Add custom entries |
| 1924 | VOID AddCustomEntries(VOID) |
| 1925 | { |
| 1926 | CUSTOM_LOADER_ENTRY *Custom; |
| 1927 | UINTN i = 0; |
| 1928 | |
| 1929 | if (!gSettings.CustomEntries) { |
| 1930 | return; |
| 1931 | } |
| 1932 | |
| 1933 | //DBG("Custom entries start\n"); |
| 1934 | DbgHeader("AddCustomEntries"); |
| 1935 | // Traverse the custom entries |
| 1936 | for (Custom = gSettings.CustomEntries; Custom; ++i, Custom = Custom->Next) { |
| 1937 | if ((Custom->Path.isEmpty()) && (Custom->Type != 0)) { |
| 1938 | if (OSTYPE_IS_OSX(Custom->Type)) { |
| 1939 | AddCustomEntry(i, MACOSX_LOADER_PATH, Custom, NULL); |
| 1940 | } else if (OSTYPE_IS_OSX_RECOVERY(Custom->Type)) { |
| 1941 | AddCustomEntry(i, L"\\com.apple.recovery.boot\\boot.efi"_XSW, Custom, NULL); |
| 1942 | } else if (OSTYPE_IS_OSX_INSTALLER(Custom->Type)) { |
| 1943 | UINTN Index = 0; |
| 1944 | while (Index < OSXInstallerPathsCount) { |
| 1945 | AddCustomEntry(i, OSXInstallerPaths[Index++], Custom, NULL); |
| 1946 | } |
| 1947 | } else if (OSTYPE_IS_WINDOWS(Custom->Type)) { |
| 1948 | AddCustomEntry(i, L"\\EFI\\Microsoft\\Boot\\bootmgfw.efi"_XSW, Custom, NULL); |
| 1949 | } else if (OSTYPE_IS_LINUX(Custom->Type)) { |
| 1950 | #if defined(ANDX86) |
| 1951 | for (UINTN Index = 0; Index < AndroidEntryDataCount; ++Index) { |
| 1952 | AddCustomEntry(i, AndroidEntryData[Index].Path, Custom, NULL); |
| 1953 | } |
| 1954 | #endif |
| 1955 | AddCustomEntry(i, NullXStringW, Custom, NULL); |
| 1956 | } else if (Custom->Type == OSTYPE_LINEFI) { |
| 1957 | AddCustomEntry(i, NullXStringW, Custom, NULL); |
| 1958 | } else { |
| 1959 | AddCustomEntry(i, BOOT_LOADER_PATH, Custom, NULL); |
| 1960 | } |
| 1961 | } else { |
| 1962 | AddCustomEntry(i, Custom->Path, Custom, NULL); |
| 1963 | } |
| 1964 | } |
| 1965 | //DBG("Custom entries finish\n"); |
| 1966 | } |
no test coverage detected