]> glassweightruler.freedombox.rocks Git - Ventoy.git/blobdiff - EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/Ventoy/Ventoy.h
Add support for boot conf replace for distro which use systemd-boot in UEFI mode.
[Ventoy.git] / EDK2 / edk2_mod / edk2-edk2-stable201911 / MdeModulePkg / Application / Ventoy / Ventoy.h
index 7113e86ef4b4427cadd70840fbf6cad12259e33c..30ed3c5c9cb71ef6385db4aa633491a996d37e99 100644 (file)
@@ -168,24 +168,30 @@ typedef struct ventoy_virt_chunk
 #define VTOY_BLOCK_DEVICE_PATH_GUID                                    \
        { 0x37b87ac6, 0xc180, 0x4583, { 0xa7, 0x05, 0x41, 0x4d, 0xa8, 0xf7, 0x7e, 0xd2 }}
 
-#define ISO9660_EFI_DRIVER_PATH  L"\\ventoy\\iso9660_x64.efi"
 
-#define VTOY_BLOCK_DEVICE_PATH_NAME  L"ventoy"
 
 #if   defined (MDE_CPU_IA32)
   #define VENTOY_UEFI_DESC   L"IA32 UEFI"
+  #define ISO9660_EFI_DRIVER_PATH  L"\\ventoy\\iso9660_ia32.efi"
+  #define UDF_EFI_DRIVER_PATH  L"\\ventoy\\udf_ia32.efi"
 #elif defined (MDE_CPU_X64)
   #define VENTOY_UEFI_DESC   L"X64 UEFI"
+  #define ISO9660_EFI_DRIVER_PATH  L"\\ventoy\\iso9660_x64.efi"
+  #define UDF_EFI_DRIVER_PATH  L"\\ventoy\\udf_x64.efi"
 #elif defined (MDE_CPU_EBC)
 #elif defined (MDE_CPU_ARM)
   #define VENTOY_UEFI_DESC   L"ARM UEFI"
+  #define ISO9660_EFI_DRIVER_PATH  L"\\ventoy\\iso9660_arm.efi"
+  #define UDF_EFI_DRIVER_PATH  L"\\ventoy\\udf_arm.efi"
 #elif defined (MDE_CPU_AARCH64)
   #define VENTOY_UEFI_DESC   L"ARM64 UEFI"
+  #define ISO9660_EFI_DRIVER_PATH  L"\\ventoy\\iso9660_aa64.efi"
+  #define UDF_EFI_DRIVER_PATH  L"\\ventoy\\udf_aa64.efi"
 #else
   #error Unknown Processor Type
 #endif
 
-#define VENTOY_DEVICE_WARN 0
+#define VENTOY_DEVICE_WARN 1
 #define VTOY_WARNING  L"!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!"
 
 typedef struct ventoy_sector_flag
@@ -237,6 +243,7 @@ typedef int (*grub_env_printf_pf)(const char *fmt, ...);
 #pragma pack(1)
 
 #define GRUB_FILE_REPLACE_MAGIC  0x1258BEEF
+#define GRUB_IMG_REPLACE_MAGIC   0x1259BEEF
 
 typedef struct ventoy_efi_file_replace
 {
@@ -261,6 +268,7 @@ typedef struct ventoy_grub_param
     grub_env_get_pf grub_env_get;
     grub_env_set_pf grub_env_set;
     ventoy_grub_param_file_replace file_replace;
+    ventoy_grub_param_file_replace img_replace;
     grub_env_printf_pf grub_env_printf;    
 }ventoy_grub_param;
 
@@ -337,6 +345,14 @@ typedef struct ventoy_system_wrapper
     EFI_LOCATE_DEVICE_PATH OriLocateDevicePath;
 } ventoy_system_wrapper;
 
+
+#define MAX_DRIVER_BIND_WRAPPER  64
+typedef struct DriverBindWrapper
+{
+    EFI_DRIVER_BINDING_PROTOCOL *DriverBinding;
+    EFI_DRIVER_BINDING_SUPPORTED pfOldSupport;
+}DRIVER_BIND_WRAPPER;
+
 #define ventoy_wrapper(bs, wrapper, func, newfunc) \
 {\
     wrapper.Ori##func = bs->func;\
@@ -344,6 +360,22 @@ typedef struct ventoy_system_wrapper
     bs->func = wrapper.New##func;\
 }
 
+
+#define VENTOY_GET_COMPONENT_NAME(Protocol, DriverName) \
+{\
+    DriverName = NULL;\
+    Status = Protocol->GetDriverName(Protocol, "en", &DriverName);\
+    if (EFI_ERROR(Status) || NULL == DriverName) \
+    {\
+        DriverName = NULL;\
+        Status = Protocol->GetDriverName(Protocol, "eng", &DriverName);\
+        if (EFI_ERROR(Status) || NULL == DriverName) \
+        {\
+            continue;\
+        }\
+    }\
+}
+
 extern BOOLEAN gDebugPrint;
 VOID EFIAPI VtoyDebug(IN CONST CHAR8  *Format, ...);
 EFI_STATUS EFIAPI ventoy_wrapper_system(VOID);
@@ -366,6 +398,7 @@ extern ventoy_virt_chunk *g_virt_chunk;
 extern UINT32 g_virt_chunk_num;
 extern vtoy_block_data gBlockData;
 extern ventoy_efi_file_replace g_efi_file_replace;
+extern ventoy_efi_file_replace g_img_file_replace;
 extern ventoy_sector_flag *g_sector_flag;
 extern UINT32 g_sector_flag_num;
 extern BOOLEAN gMemdiskMode;
@@ -373,6 +406,7 @@ extern BOOLEAN gSector512Mode;
 extern UINTN g_iso_buf_size;
 extern UINT8 *g_iso_data_buf;
 extern ventoy_grub_param_file_replace *g_file_replace_list;
+extern ventoy_grub_param_file_replace *g_img_replace_list;
 extern BOOLEAN g_fixup_iso9660_secover_enable;
 extern EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *g_con_simple_input_ex;
 extern BOOLEAN g_fix_windows_1st_cdrom_issue;
@@ -389,6 +423,8 @@ EFI_STATUS ventoy_hook_keyboard_stop(VOID);
 BOOLEAN ventoy_is_cdrom_dp_exist(VOID);
 EFI_STATUS ventoy_hook_1st_cdrom_start(VOID);
 EFI_STATUS ventoy_hook_1st_cdrom_stop(VOID);
+EFI_STATUS ventoy_disable_ex_filesystem(VOID);
+EFI_STATUS ventoy_enable_ex_filesystem(VOID);
 
 #endif