#include <Ventoy.h>
BOOLEAN gDebugPrint = FALSE;
+BOOLEAN gDotEfiBoot = FALSE;
BOOLEAN gLoadIsoEfi = FALSE;
ventoy_ram_disk g_ramdisk_param;
ventoy_chain_head *g_chain;
UINT32 g_virt_chunk_num;
vtoy_block_data gBlockData;
static grub_env_get_pf grub_env_get = NULL;
+static grub_env_set_pf grub_env_set = NULL;
ventoy_grub_param_file_replace *g_file_replace_list = NULL;
ventoy_efi_file_replace g_efi_file_replace;
{
gDebugPrint = TRUE;
}
+
+ if (StrStr(pCmdLine, L"dotefi"))
+ {
+ gDotEfiBoot = TRUE;
+ }
if (StrStr(pCmdLine, L"isoefi=on"))
{
pGrubParam = (ventoy_grub_param *)StrHexToUintn(pPos + StrLen(L"env_param="));
grub_env_get = pGrubParam->grub_env_get;
+ grub_env_set = pGrubParam->grub_env_set;
g_file_replace_list = &pGrubParam->file_replace;
old_cnt = g_file_replace_list->old_file_cnt;
debug("memory addr:%p size:%lu", chain, size);
+ if (StrStr(pCmdLine, L"sector512"))
+ {
+ gSector512Mode = TRUE;
+ }
+
if (StrStr(pCmdLine, L"memdisk"))
{
g_iso_data_buf = (UINT8 *)chain + sizeof(ventoy_chain_head);
if (Find == 0)
{
+ if (gDotEfiBoot)
+ {
+ break;
+ }
+
debug("Fs not found, now wait and retry...");
sleep(2);
}
{
gBS->UnloadImage(gBlockData.IsoDriverImage);
}
+
+ gBS->DisconnectController(gBlockData.Handle, NULL, NULL);
+ gBS->UninstallMultipleProtocolInterfaces(gBlockData.Handle,
+ &gEfiBlockIoProtocolGuid, &gBlockData.BlockIo,
+ &gEfiDevicePathProtocolGuid, gBlockData.Path,
+ NULL);
}
else
{
ventoy_clean_env();
}
- if (EFI_NOT_FOUND == Status)
+ if (FALSE == gDotEfiBoot)
{
- gST->ConOut->OutputString(gST->ConOut, L"No bootfile found for UEFI!\r\n");
- gST->ConOut->OutputString(gST->ConOut, L"Maybe the image does not support " VENTOY_UEFI_DESC L"!\r\n");
- sleep(30);
+ if (EFI_NOT_FOUND == Status)
+ {
+ gST->ConOut->OutputString(gST->ConOut, L"No bootfile found for UEFI!\r\n");
+ gST->ConOut->OutputString(gST->ConOut, L"Maybe the image does not support " VENTOY_UEFI_DESC L"!\r\n");
+ sleep(30);
+ }
}
-
+
ventoy_clear_input();
gST->ConOut->ClearScreen(gST->ConOut);
+ if (gDotEfiBoot && (EFI_NOT_FOUND == Status))
+ {
+ grub_env_set("vtoy_dotefi_retry", "YES");
+ }
+
return EFI_SUCCESS;
}