mirror of
https://github.com/ventoy/Ventoy.git
synced 2025-09-18 01:41:15 +00:00
Compare commits
40 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
b5503a7375 | ||
|
0b7fa630a4 | ||
|
7babe823d6 | ||
|
6db513a067 | ||
|
bafac7479d | ||
|
d3138479d7 | ||
|
56a1543f7d | ||
|
659ac1cfe3 | ||
|
c83daa86b6 | ||
|
dfcfaa9967 | ||
|
188f9e707c | ||
|
8b975b5e80 | ||
|
2ab717cc66 | ||
|
88793d548a | ||
|
5fea6eab7e | ||
|
5d55dc68ae | ||
|
2c320aad60 | ||
|
b63034b2c7 | ||
|
6c113880e5 | ||
|
e2656c287b | ||
|
d8433985e7 | ||
|
b003105925 | ||
|
2ca2c83b6b | ||
|
dff7e495ca | ||
|
cf0f395c56 | ||
|
69bc90da42 | ||
|
ffc40234ca | ||
|
e57daa5065 | ||
|
5c733a20f8 | ||
|
069342ab9a | ||
|
32a964eded | ||
|
51b92f398a | ||
|
5d0ebf4510 | ||
|
cf94487ad5 | ||
|
af83f46a3d | ||
|
4910e9f380 | ||
|
fb38b321c2 | ||
|
7b78fe555e | ||
|
094ba61848 | ||
|
faa0e46d3a |
10
.github/ISSUE_TEMPLATE/issue_template.yml
vendored
10
.github/ISSUE_TEMPLATE/issue_template.yml
vendored
@@ -21,7 +21,7 @@ body:
|
|||||||
attributes:
|
attributes:
|
||||||
label: Ventoy Version
|
label: Ventoy Version
|
||||||
description: What version of ventoy are you running?
|
description: What version of ventoy are you running?
|
||||||
placeholder: 1.0.46
|
placeholder: 1.0.49
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
- type: dropdown
|
- type: dropdown
|
||||||
@@ -73,6 +73,14 @@ body:
|
|||||||
- No.
|
- No.
|
||||||
validations:
|
validations:
|
||||||
required: false
|
required: false
|
||||||
|
- type: input
|
||||||
|
id: link
|
||||||
|
attributes:
|
||||||
|
label: Image file download link (if applicable)
|
||||||
|
description: What is the image file download link?
|
||||||
|
placeholder: https://xxx
|
||||||
|
validations:
|
||||||
|
required: false
|
||||||
- type: textarea
|
- type: textarea
|
||||||
id: what-happened
|
id: what-happened
|
||||||
attributes:
|
attributes:
|
||||||
|
1
.github/workflows/sync2gitee.yml
vendored
1
.github/workflows/sync2gitee.yml
vendored
@@ -11,6 +11,7 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
run:
|
run:
|
||||||
name: Sync-GitHub-to-Gitee
|
name: Sync-GitHub-to-Gitee
|
||||||
|
if: ${{ github.repository_owner == 'ventoy' }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Mirror the Github repos to Gitee.
|
- name: Mirror the Github repos to Gitee.
|
||||||
|
@@ -34,6 +34,7 @@
|
|||||||
#include <Protocol/BlockIo.h>
|
#include <Protocol/BlockIo.h>
|
||||||
#include <Protocol/RamDisk.h>
|
#include <Protocol/RamDisk.h>
|
||||||
#include <Protocol/SimpleFileSystem.h>
|
#include <Protocol/SimpleFileSystem.h>
|
||||||
|
#include <Protocol/DriverBinding.h>
|
||||||
#include <Ventoy.h>
|
#include <Ventoy.h>
|
||||||
|
|
||||||
BOOLEAN gDebugPrint = FALSE;
|
BOOLEAN gDebugPrint = FALSE;
|
||||||
@@ -362,10 +363,22 @@ EFI_HANDLE EFIAPI ventoy_get_parent_handle(IN EFI_DEVICE_PATH_PROTOCOL *pDevPath
|
|||||||
return Handle;
|
return Handle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
STATIC ventoy_ram_disk g_backup_ramdisk_param;
|
||||||
|
STATIC ventoy_os_param g_backup_os_param_var;
|
||||||
|
|
||||||
|
|
||||||
EFI_STATUS EFIAPI ventoy_save_ramdisk_param(VOID)
|
EFI_STATUS EFIAPI ventoy_save_ramdisk_param(VOID)
|
||||||
{
|
{
|
||||||
|
UINTN DataSize;
|
||||||
EFI_STATUS Status = EFI_SUCCESS;
|
EFI_STATUS Status = EFI_SUCCESS;
|
||||||
EFI_GUID VarGuid = VENTOY_GUID;
|
EFI_GUID VarGuid = VENTOY_GUID;
|
||||||
|
|
||||||
|
DataSize = sizeof(g_backup_ramdisk_param);
|
||||||
|
Status = gRT->GetVariable(L"VentoyRamDisk", &VarGuid, NULL, &DataSize, &g_backup_ramdisk_param);
|
||||||
|
if (!EFI_ERROR(Status))
|
||||||
|
{
|
||||||
|
debug("find previous ramdisk variable <%llu>", g_backup_ramdisk_param.DiskSize);
|
||||||
|
}
|
||||||
|
|
||||||
Status = gRT->SetVariable(L"VentoyRamDisk", &VarGuid,
|
Status = gRT->SetVariable(L"VentoyRamDisk", &VarGuid,
|
||||||
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
|
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
|
||||||
@@ -379,21 +392,38 @@ EFI_STATUS EFIAPI ventoy_delete_ramdisk_param(VOID)
|
|||||||
{
|
{
|
||||||
EFI_STATUS Status = EFI_SUCCESS;
|
EFI_STATUS Status = EFI_SUCCESS;
|
||||||
EFI_GUID VarGuid = VENTOY_GUID;
|
EFI_GUID VarGuid = VENTOY_GUID;
|
||||||
|
|
||||||
Status = gRT->SetVariable(L"VentoyRamDisk", &VarGuid,
|
if (g_backup_ramdisk_param.DiskSize > 0 && g_backup_ramdisk_param.PhyAddr > 0)
|
||||||
|
{
|
||||||
|
Status = gRT->SetVariable(L"VentoyRamDisk", &VarGuid,
|
||||||
|
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
|
||||||
|
sizeof(g_backup_ramdisk_param), &g_backup_ramdisk_param);
|
||||||
|
debug("resotre ramdisk variable %r", Status);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Status = gRT->SetVariable(L"VentoyRamDisk", &VarGuid,
|
||||||
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
|
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
|
||||||
0, NULL);
|
0, NULL);
|
||||||
debug("delete efi variable %r", Status);
|
debug("delete ramdisk variable %r", Status);
|
||||||
|
}
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
EFI_STATUS EFIAPI ventoy_save_variable(VOID)
|
EFI_STATUS EFIAPI ventoy_save_variable(VOID)
|
||||||
{
|
{
|
||||||
|
UINTN DataSize;
|
||||||
EFI_STATUS Status = EFI_SUCCESS;
|
EFI_STATUS Status = EFI_SUCCESS;
|
||||||
EFI_GUID VarGuid = VENTOY_GUID;
|
EFI_GUID VarGuid = VENTOY_GUID;
|
||||||
|
|
||||||
|
DataSize = sizeof(g_backup_os_param_var);
|
||||||
|
Status = gRT->GetVariable(L"VentoyOsParam", &VarGuid, NULL, &DataSize, &g_backup_os_param_var);
|
||||||
|
if (!EFI_ERROR(Status))
|
||||||
|
{
|
||||||
|
debug("find previous efi variable <%a>", g_backup_os_param_var.vtoy_img_path);
|
||||||
|
}
|
||||||
|
|
||||||
Status = gRT->SetVariable(L"VentoyOsParam", &VarGuid,
|
Status = gRT->SetVariable(L"VentoyOsParam", &VarGuid,
|
||||||
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
|
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
|
||||||
sizeof(g_chain->os_param), &(g_chain->os_param));
|
sizeof(g_chain->os_param), &(g_chain->os_param));
|
||||||
@@ -406,11 +436,21 @@ EFI_STATUS EFIAPI ventoy_delete_variable(VOID)
|
|||||||
{
|
{
|
||||||
EFI_STATUS Status = EFI_SUCCESS;
|
EFI_STATUS Status = EFI_SUCCESS;
|
||||||
EFI_GUID VarGuid = VENTOY_GUID;
|
EFI_GUID VarGuid = VENTOY_GUID;
|
||||||
|
|
||||||
Status = gRT->SetVariable(L"VentoyOsParam", &VarGuid,
|
if (0 == CompareMem(&(g_backup_os_param_var.guid), &VarGuid, sizeof(EFI_GUID)))
|
||||||
|
{
|
||||||
|
Status = gRT->SetVariable(L"VentoyOsParam", &VarGuid,
|
||||||
|
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
|
||||||
|
sizeof(g_backup_os_param_var), &(g_backup_os_param_var));
|
||||||
|
debug("restore efi variable %r", Status);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Status = gRT->SetVariable(L"VentoyOsParam", &VarGuid,
|
||||||
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
|
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
|
||||||
0, NULL);
|
0, NULL);
|
||||||
debug("delete efi variable %r", Status);
|
debug("delete efi variable %r", Status);
|
||||||
|
}
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
@@ -1085,6 +1125,8 @@ EFI_STATUS EFIAPI VentoyEfiMain
|
|||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ventoy_disable_ex_filesystem();
|
||||||
|
|
||||||
if (gMemdiskMode)
|
if (gMemdiskMode)
|
||||||
{
|
{
|
||||||
g_ramdisk_param.PhyAddr = (UINT64)(UINTN)g_iso_data_buf;
|
g_ramdisk_param.PhyAddr = (UINT64)(UINTN)g_iso_data_buf;
|
||||||
@@ -1159,6 +1201,8 @@ EFI_STATUS EFIAPI VentoyEfiMain
|
|||||||
grub_env_set("vtoy_dotefi_retry", "YES");
|
grub_env_set("vtoy_dotefi_retry", "YES");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ventoy_enable_ex_filesystem();
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -169,7 +169,6 @@ typedef struct ventoy_virt_chunk
|
|||||||
{ 0x37b87ac6, 0xc180, 0x4583, { 0xa7, 0x05, 0x41, 0x4d, 0xa8, 0xf7, 0x7e, 0xd2 }}
|
{ 0x37b87ac6, 0xc180, 0x4583, { 0xa7, 0x05, 0x41, 0x4d, 0xa8, 0xf7, 0x7e, 0xd2 }}
|
||||||
|
|
||||||
|
|
||||||
#define VTOY_BLOCK_DEVICE_PATH_NAME L"ventoy"
|
|
||||||
|
|
||||||
#if defined (MDE_CPU_IA32)
|
#if defined (MDE_CPU_IA32)
|
||||||
#define VENTOY_UEFI_DESC L"IA32 UEFI"
|
#define VENTOY_UEFI_DESC L"IA32 UEFI"
|
||||||
@@ -344,6 +343,14 @@ typedef struct ventoy_system_wrapper
|
|||||||
EFI_LOCATE_DEVICE_PATH OriLocateDevicePath;
|
EFI_LOCATE_DEVICE_PATH OriLocateDevicePath;
|
||||||
} ventoy_system_wrapper;
|
} 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) \
|
#define ventoy_wrapper(bs, wrapper, func, newfunc) \
|
||||||
{\
|
{\
|
||||||
wrapper.Ori##func = bs->func;\
|
wrapper.Ori##func = bs->func;\
|
||||||
@@ -351,6 +358,22 @@ typedef struct ventoy_system_wrapper
|
|||||||
bs->func = wrapper.New##func;\
|
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;
|
extern BOOLEAN gDebugPrint;
|
||||||
VOID EFIAPI VtoyDebug(IN CONST CHAR8 *Format, ...);
|
VOID EFIAPI VtoyDebug(IN CONST CHAR8 *Format, ...);
|
||||||
EFI_STATUS EFIAPI ventoy_wrapper_system(VOID);
|
EFI_STATUS EFIAPI ventoy_wrapper_system(VOID);
|
||||||
@@ -396,6 +419,8 @@ EFI_STATUS ventoy_hook_keyboard_stop(VOID);
|
|||||||
BOOLEAN ventoy_is_cdrom_dp_exist(VOID);
|
BOOLEAN ventoy_is_cdrom_dp_exist(VOID);
|
||||||
EFI_STATUS ventoy_hook_1st_cdrom_start(VOID);
|
EFI_STATUS ventoy_hook_1st_cdrom_start(VOID);
|
||||||
EFI_STATUS ventoy_hook_1st_cdrom_stop(VOID);
|
EFI_STATUS ventoy_hook_1st_cdrom_stop(VOID);
|
||||||
|
EFI_STATUS ventoy_disable_ex_filesystem(VOID);
|
||||||
|
EFI_STATUS ventoy_enable_ex_filesystem(VOID);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -34,6 +34,7 @@
|
|||||||
#include <Protocol/BlockIo.h>
|
#include <Protocol/BlockIo.h>
|
||||||
#include <Protocol/RamDisk.h>
|
#include <Protocol/RamDisk.h>
|
||||||
#include <Protocol/SimpleFileSystem.h>
|
#include <Protocol/SimpleFileSystem.h>
|
||||||
|
#include <Protocol/DriverBinding.h>
|
||||||
#include <Ventoy.h>
|
#include <Ventoy.h>
|
||||||
|
|
||||||
#define PROCOTOL_SLEEP_MSECONDS 0
|
#define PROCOTOL_SLEEP_MSECONDS 0
|
||||||
|
@@ -34,6 +34,7 @@
|
|||||||
#include <Protocol/BlockIo.h>
|
#include <Protocol/BlockIo.h>
|
||||||
#include <Protocol/RamDisk.h>
|
#include <Protocol/RamDisk.h>
|
||||||
#include <Protocol/SimpleFileSystem.h>
|
#include <Protocol/SimpleFileSystem.h>
|
||||||
|
#include <Protocol/DriverBinding.h>
|
||||||
#include <Ventoy.h>
|
#include <Ventoy.h>
|
||||||
|
|
||||||
UINT8 *g_iso_data_buf = NULL;
|
UINT8 *g_iso_data_buf = NULL;
|
||||||
@@ -73,6 +74,9 @@ STATIC UINT8 g_sector_buf[2048];
|
|||||||
STATIC EFI_BLOCK_READ g_sector_2048_read = NULL;
|
STATIC EFI_BLOCK_READ g_sector_2048_read = NULL;
|
||||||
STATIC EFI_BLOCK_WRITE g_sector_2048_write = NULL;
|
STATIC EFI_BLOCK_WRITE g_sector_2048_write = NULL;
|
||||||
|
|
||||||
|
STATIC UINTN g_DriverBindWrapperCnt = 0;
|
||||||
|
STATIC DRIVER_BIND_WRAPPER g_DriverBindWrapperList[MAX_DRIVER_BIND_WRAPPER];
|
||||||
|
|
||||||
BOOLEAN ventoy_is_cdrom_dp_exist(VOID)
|
BOOLEAN ventoy_is_cdrom_dp_exist(VOID)
|
||||||
{
|
{
|
||||||
UINTN i = 0;
|
UINTN i = 0;
|
||||||
@@ -620,26 +624,74 @@ EFI_STATUS EFIAPI ventoy_block_io_flush(IN EFI_BLOCK_IO_PROTOCOL *This)
|
|||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
STATIC UINTN ventoy_get_current_device_path_id(VOID)
|
||||||
|
{
|
||||||
|
UINTN i = 0;
|
||||||
|
UINTN Count = 0;
|
||||||
|
UINTN MaxId = 0;
|
||||||
|
UINTN CurId = 0;
|
||||||
|
BOOLEAN Find = FALSE;
|
||||||
|
EFI_HANDLE *Handles = NULL;
|
||||||
|
EFI_STATUS Status = EFI_SUCCESS;
|
||||||
|
EFI_DEVICE_PATH_PROTOCOL *DevicePath = NULL;
|
||||||
|
VENDOR_DEVICE_PATH *venPath = NULL;
|
||||||
|
|
||||||
|
Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiDevicePathProtocolGuid,
|
||||||
|
NULL, &Count, &Handles);
|
||||||
|
if (EFI_ERROR(Status))
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < Count; i++)
|
||||||
|
{
|
||||||
|
Status = gBS->HandleProtocol(Handles[i], &gEfiDevicePathProtocolGuid, (VOID **)&DevicePath);
|
||||||
|
if (EFI_ERROR(Status))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (DevicePath->Type == HARDWARE_DEVICE_PATH && DevicePath->SubType == HW_VENDOR_DP)
|
||||||
|
{
|
||||||
|
venPath = (VENDOR_DEVICE_PATH *)DevicePath;
|
||||||
|
if (CompareGuid(&venPath->Guid, &gVtoyBlockDevicePathGuid))
|
||||||
|
{
|
||||||
|
CurId = StrDecimalToUintn((CHAR16 *)(venPath + 1) + StrLen(L"ventoy_"));
|
||||||
|
MaxId = MAX(MaxId, CurId);
|
||||||
|
Find = TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FreePool(Handles);
|
||||||
|
|
||||||
|
return Find ? (MaxId + 1) : 0;
|
||||||
|
}
|
||||||
|
|
||||||
EFI_STATUS EFIAPI ventoy_fill_device_path(VOID)
|
EFI_STATUS EFIAPI ventoy_fill_device_path(VOID)
|
||||||
{
|
{
|
||||||
|
UINTN CurVtoyDpId = 0;
|
||||||
UINTN NameLen = 0;
|
UINTN NameLen = 0;
|
||||||
UINT8 TmpBuf[128] = {0};
|
UINT8 TmpBuf[128] = {0};
|
||||||
VENDOR_DEVICE_PATH *venPath = NULL;
|
VENDOR_DEVICE_PATH *venPath = NULL;
|
||||||
|
CHAR16 VtoyDpName[32];
|
||||||
|
|
||||||
|
CurVtoyDpId = ventoy_get_current_device_path_id();
|
||||||
|
UnicodeSPrintAsciiFormat(VtoyDpName, sizeof(VtoyDpName), "ventoy_%03lu", CurVtoyDpId);
|
||||||
|
|
||||||
venPath = (VENDOR_DEVICE_PATH *)TmpBuf;
|
venPath = (VENDOR_DEVICE_PATH *)TmpBuf;
|
||||||
NameLen = StrSize(VTOY_BLOCK_DEVICE_PATH_NAME);
|
NameLen = StrSize(VtoyDpName);
|
||||||
venPath->Header.Type = HARDWARE_DEVICE_PATH;
|
venPath->Header.Type = HARDWARE_DEVICE_PATH;
|
||||||
venPath->Header.SubType = HW_VENDOR_DP;
|
venPath->Header.SubType = HW_VENDOR_DP;
|
||||||
venPath->Header.Length[0] = sizeof(VENDOR_DEVICE_PATH) + NameLen;
|
venPath->Header.Length[0] = sizeof(VENDOR_DEVICE_PATH) + NameLen;
|
||||||
venPath->Header.Length[1] = 0;
|
venPath->Header.Length[1] = 0;
|
||||||
CopyMem(&venPath->Guid, &gVtoyBlockDevicePathGuid, sizeof(EFI_GUID));
|
CopyMem(&venPath->Guid, &gVtoyBlockDevicePathGuid, sizeof(EFI_GUID));
|
||||||
CopyMem(venPath + 1, VTOY_BLOCK_DEVICE_PATH_NAME, NameLen);
|
CopyMem(venPath + 1, VtoyDpName, NameLen);
|
||||||
|
|
||||||
gBlockData.Path = AppendDevicePathNode(NULL, (EFI_DEVICE_PATH_PROTOCOL *)TmpBuf);
|
gBlockData.Path = AppendDevicePathNode(NULL, (EFI_DEVICE_PATH_PROTOCOL *)TmpBuf);
|
||||||
gBlockData.DevicePathCompareLen = sizeof(VENDOR_DEVICE_PATH) + NameLen;
|
gBlockData.DevicePathCompareLen = sizeof(VENDOR_DEVICE_PATH) + NameLen;
|
||||||
|
|
||||||
debug("gBlockData.Path=<%s>\n", ConvertDevicePathToText(gBlockData.Path, FALSE, FALSE));
|
debug("gBlockData.Path=<%lu><%s>\n", CurVtoyDpId, ConvertDevicePathToText(gBlockData.Path, FALSE, FALSE));
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
@@ -672,11 +724,7 @@ EFI_STATUS EFIAPI ventoy_connect_driver(IN EFI_HANDLE ControllerHandle, IN CONST
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = Name2Protocol->GetDriverName(Name2Protocol, "en", &DriverName);
|
VENTOY_GET_COMPONENT_NAME(Name2Protocol, DriverName);
|
||||||
if (EFI_ERROR(Status) || NULL == DriverName)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (StrStr(DriverName, DrvName))
|
if (StrStr(DriverName, DrvName))
|
||||||
{
|
{
|
||||||
@@ -714,11 +762,7 @@ EFI_STATUS EFIAPI ventoy_connect_driver(IN EFI_HANDLE ControllerHandle, IN CONST
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = NameProtocol->GetDriverName(NameProtocol, "en", &DriverName);
|
VENTOY_GET_COMPONENT_NAME(NameProtocol, DriverName);
|
||||||
if (EFI_ERROR(Status))
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (StrStr(DriverName, DrvName))
|
if (StrStr(DriverName, DrvName))
|
||||||
{
|
{
|
||||||
@@ -743,6 +787,223 @@ end:
|
|||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
STATIC BOOLEAN ventoy_filesystem_need_wrapper(IN CONST CHAR16 *DrvName)
|
||||||
|
{
|
||||||
|
UINTN i;
|
||||||
|
CHAR16 UpperDrvName[256];
|
||||||
|
|
||||||
|
StrCpyS(UpperDrvName, 256, DrvName);
|
||||||
|
|
||||||
|
for (i = 0; i < 256 && UpperDrvName[i]; i++)
|
||||||
|
{
|
||||||
|
if (UpperDrvName[i] >= 'a' && UpperDrvName[i] <= 'z')
|
||||||
|
{
|
||||||
|
UpperDrvName[i] = 'A' + (UpperDrvName[i] - 'a');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* suppress some file system drivers
|
||||||
|
* 1. rEFInd File System Driver
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (StrStr(UpperDrvName, L"REFIND") && StrStr(UpperDrvName, L"FILE SYSTEM"))
|
||||||
|
{
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
STATIC VOID ventoy_add_filesystem_wrapper
|
||||||
|
(
|
||||||
|
IN EFI_DRIVER_BINDING_PROTOCOL *DriverBindProtocol,
|
||||||
|
IN CONST CHAR16 *DriverName
|
||||||
|
)
|
||||||
|
{
|
||||||
|
UINTN j;
|
||||||
|
|
||||||
|
if (g_DriverBindWrapperCnt >= MAX_DRIVER_BIND_WRAPPER)
|
||||||
|
{
|
||||||
|
debug("driver binding wrapper overflow %lu", g_DriverBindWrapperCnt);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!ventoy_filesystem_need_wrapper(DriverName))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (j = 0; j < g_DriverBindWrapperCnt; j++)
|
||||||
|
{
|
||||||
|
if (g_DriverBindWrapperList[j].DriverBinding == DriverBindProtocol)
|
||||||
|
{
|
||||||
|
debug("Duplicate driverbinding <%s> %p %lu %lu", DriverName, DriverBindProtocol, j, g_DriverBindWrapperCnt);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (j >= g_DriverBindWrapperCnt)
|
||||||
|
{
|
||||||
|
g_DriverBindWrapperList[g_DriverBindWrapperCnt].DriverBinding = DriverBindProtocol;
|
||||||
|
g_DriverBindWrapperList[g_DriverBindWrapperCnt].pfOldSupport = DriverBindProtocol->Supported;
|
||||||
|
g_DriverBindWrapperCnt++;
|
||||||
|
debug("Add driverbinding <%s> %p %lu", DriverName, DriverBindProtocol, g_DriverBindWrapperCnt);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
STATIC EFI_STATUS ventoy_find_filesystem_driverbind(VOID)
|
||||||
|
{
|
||||||
|
UINTN i = 0;
|
||||||
|
UINTN Count = 0;
|
||||||
|
CHAR16 *DriverName = NULL;
|
||||||
|
EFI_HANDLE *Handles = NULL;
|
||||||
|
EFI_STATUS Status = EFI_SUCCESS;
|
||||||
|
EFI_COMPONENT_NAME_PROTOCOL *NameProtocol = NULL;
|
||||||
|
EFI_COMPONENT_NAME2_PROTOCOL *Name2Protocol = NULL;
|
||||||
|
EFI_DRIVER_BINDING_PROTOCOL *DriverBindProtocol = NULL;
|
||||||
|
|
||||||
|
debug("ventoy_find_filesystem_driverbind...");
|
||||||
|
|
||||||
|
Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiComponentName2ProtocolGuid,
|
||||||
|
NULL, &Count, &Handles);
|
||||||
|
if (EFI_ERROR(Status))
|
||||||
|
{
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < Count; i++)
|
||||||
|
{
|
||||||
|
Status = gBS->HandleProtocol(Handles[i], &gEfiComponentName2ProtocolGuid, (VOID **)&Name2Protocol);
|
||||||
|
if (EFI_ERROR(Status))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
VENTOY_GET_COMPONENT_NAME(Name2Protocol, DriverName);
|
||||||
|
|
||||||
|
Status = gBS->HandleProtocol(Handles[i], &gEfiDriverBindingProtocolGuid, (VOID **)&DriverBindProtocol);
|
||||||
|
if (EFI_ERROR(Status))
|
||||||
|
{
|
||||||
|
debug("### 2 No DriverBind <%s> <%r>", DriverName, Status);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
ventoy_add_filesystem_wrapper(DriverBindProtocol, DriverName);
|
||||||
|
}
|
||||||
|
|
||||||
|
Count = 0;
|
||||||
|
FreePool(Handles);
|
||||||
|
Handles = NULL;
|
||||||
|
|
||||||
|
Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiComponentNameProtocolGuid,
|
||||||
|
NULL, &Count, &Handles);
|
||||||
|
if (EFI_ERROR(Status))
|
||||||
|
{
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < Count; i++)
|
||||||
|
{
|
||||||
|
Status = gBS->HandleProtocol(Handles[i], &gEfiComponentNameProtocolGuid, (VOID **)&NameProtocol);
|
||||||
|
if (EFI_ERROR(Status))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
VENTOY_GET_COMPONENT_NAME(NameProtocol, DriverName);
|
||||||
|
|
||||||
|
Status = gBS->HandleProtocol(Handles[i], &gEfiDriverBindingProtocolGuid, (VOID **)&DriverBindProtocol);
|
||||||
|
if (EFI_ERROR(Status))
|
||||||
|
{
|
||||||
|
debug("### 1 No DriverBind <%s> <%r>", DriverName, Status);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
ventoy_add_filesystem_wrapper(DriverBindProtocol, DriverName);
|
||||||
|
}
|
||||||
|
|
||||||
|
FreePool(Handles);
|
||||||
|
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
STATIC EFI_STATUS EFIAPI ventoy_wrapper_driver_bind_support
|
||||||
|
(
|
||||||
|
IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
||||||
|
IN EFI_HANDLE ControllerHandle,
|
||||||
|
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
|
||||||
|
)
|
||||||
|
{
|
||||||
|
UINTN i;
|
||||||
|
EFI_STATUS Status = EFI_SUCCESS;
|
||||||
|
EFI_DEVICE_PATH_PROTOCOL *DevicePath = NULL;
|
||||||
|
EFI_DRIVER_BINDING_SUPPORTED pfOldSupport = NULL;
|
||||||
|
|
||||||
|
for (i = 0; i < g_DriverBindWrapperCnt; i++)
|
||||||
|
{
|
||||||
|
if (g_DriverBindWrapperList[i].DriverBinding == This)
|
||||||
|
{
|
||||||
|
pfOldSupport = g_DriverBindWrapperList[i].pfOldSupport;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
debug("ventoy_wrapper_driver_bind_support %lu %p", i, pfOldSupport);
|
||||||
|
|
||||||
|
if (!pfOldSupport)
|
||||||
|
{
|
||||||
|
return EFI_UNSUPPORTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
Status = gBS->HandleProtocol(ControllerHandle, &gEfiDevicePathProtocolGuid, (VOID **)&DevicePath);
|
||||||
|
if (EFI_ERROR(Status))
|
||||||
|
{
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (0 == CompareMem(gBlockData.Path, DevicePath, gBlockData.DevicePathCompareLen))
|
||||||
|
{
|
||||||
|
debug("return EFI_UNSUPPORTED for ventoy");
|
||||||
|
return EFI_UNSUPPORTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
out:
|
||||||
|
return pfOldSupport(This, ControllerHandle, RemainingDevicePath);
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_STATUS ventoy_disable_ex_filesystem(VOID)
|
||||||
|
{
|
||||||
|
UINTN i;
|
||||||
|
|
||||||
|
ventoy_find_filesystem_driverbind();
|
||||||
|
|
||||||
|
for (i = 0; i < g_DriverBindWrapperCnt; i++)
|
||||||
|
{
|
||||||
|
g_DriverBindWrapperList[i].DriverBinding->Supported = ventoy_wrapper_driver_bind_support;
|
||||||
|
}
|
||||||
|
|
||||||
|
debug("Wrapper Ex Driver Binding %lu", g_DriverBindWrapperCnt);
|
||||||
|
ventoy_debug_pause();
|
||||||
|
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_STATUS ventoy_enable_ex_filesystem(VOID)
|
||||||
|
{
|
||||||
|
UINTN i;
|
||||||
|
|
||||||
|
for (i = 0; i < g_DriverBindWrapperCnt; i++)
|
||||||
|
{
|
||||||
|
g_DriverBindWrapperList[i].DriverBinding->Supported = g_DriverBindWrapperList[i].pfOldSupport;
|
||||||
|
}
|
||||||
|
g_DriverBindWrapperCnt = 0;
|
||||||
|
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
EFI_STATUS EFIAPI ventoy_block_io_read_512
|
EFI_STATUS EFIAPI ventoy_block_io_read_512
|
||||||
(
|
(
|
||||||
IN EFI_BLOCK_IO_PROTOCOL *This,
|
IN EFI_BLOCK_IO_PROTOCOL *This,
|
||||||
@@ -1139,6 +1400,16 @@ STATIC EFI_STATUS EFIAPI ventoy_wrapper_file_open
|
|||||||
|
|
||||||
debug("## ventoy_wrapper_file_open <%s> ", Name);
|
debug("## ventoy_wrapper_file_open <%s> ", Name);
|
||||||
|
|
||||||
|
if ((Mode & EFI_FILE_MODE_WRITE) > 0 && StrCmp(Name, L"\\loader\\random-seed") == 0)
|
||||||
|
{
|
||||||
|
if (gDebugPrint)
|
||||||
|
{
|
||||||
|
debug("## ventoy_wrapper_file_open return NOT_FOUND for random-seed %lx", Mode);
|
||||||
|
sleep(3);
|
||||||
|
}
|
||||||
|
return EFI_NOT_FOUND;
|
||||||
|
}
|
||||||
|
|
||||||
Status = g_original_fopen(This, New, Name, Mode, Attributes);
|
Status = g_original_fopen(This, New, Name, Mode, Attributes);
|
||||||
if (EFI_ERROR(Status))
|
if (EFI_ERROR(Status))
|
||||||
{
|
{
|
||||||
|
@@ -0,0 +1,140 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* VtoyDrv.c
|
||||||
|
*
|
||||||
|
* Copyright (c) 2020, longpanda <admin@ventoy.net>
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License as
|
||||||
|
* published by the Free Software Foundation; either version 3 of the
|
||||||
|
* License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but
|
||||||
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <Uefi.h>
|
||||||
|
#include <Library/DebugLib.h>
|
||||||
|
#include <Library/PrintLib.h>
|
||||||
|
#include <Library/UefiLib.h>
|
||||||
|
#include <Library/BaseMemoryLib.h>
|
||||||
|
#include <Library/DevicePathLib.h>
|
||||||
|
#include <Library/MemoryAllocationLib.h>
|
||||||
|
#include <Library/UefiBootServicesTableLib.h>
|
||||||
|
#include <Library/UefiRuntimeServicesTableLib.h>
|
||||||
|
#include <Library/UefiApplicationEntryPoint.h>
|
||||||
|
#include <Protocol/LoadedImage.h>
|
||||||
|
#include <Guid/FileInfo.h>
|
||||||
|
#include <Guid/FileSystemInfo.h>
|
||||||
|
#include <Protocol/BlockIo.h>
|
||||||
|
#include <Protocol/RamDisk.h>
|
||||||
|
#include <Protocol/SimpleFileSystem.h>
|
||||||
|
#include <VtoyUtil.h>
|
||||||
|
|
||||||
|
STATIC UINTN g_EfiDriverNameCnt = 0;
|
||||||
|
STATIC CHAR16 *g_EfiDriverNameList[1024] = { NULL };
|
||||||
|
|
||||||
|
STATIC EFI_STATUS AddEfiDriverName(IN CHAR16 *DriverName)
|
||||||
|
{
|
||||||
|
UINTN i = 0;
|
||||||
|
|
||||||
|
if (g_EfiDriverNameCnt >= 1024)
|
||||||
|
{
|
||||||
|
return EFI_OUT_OF_RESOURCES;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < g_EfiDriverNameCnt; i++)
|
||||||
|
{
|
||||||
|
if (g_EfiDriverNameList[i] && StrCmp(g_EfiDriverNameList[i], DriverName) == 0)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (i >= g_EfiDriverNameCnt)
|
||||||
|
{
|
||||||
|
g_EfiDriverNameList[g_EfiDriverNameCnt] = DriverName;
|
||||||
|
g_EfiDriverNameCnt++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_STATUS ShowEfiDrivers(IN EFI_HANDLE ImageHandle, IN CONST CHAR16 *CmdLine)
|
||||||
|
{
|
||||||
|
UINTN i = 0;
|
||||||
|
UINTN Count = 0;
|
||||||
|
CHAR16 *DriverName = NULL;
|
||||||
|
EFI_HANDLE *Handles = NULL;
|
||||||
|
EFI_STATUS Status = EFI_SUCCESS;
|
||||||
|
EFI_COMPONENT_NAME_PROTOCOL *NameProtocol = NULL;
|
||||||
|
EFI_COMPONENT_NAME2_PROTOCOL *Name2Protocol = NULL;
|
||||||
|
|
||||||
|
(VOID)ImageHandle;
|
||||||
|
(VOID)CmdLine;
|
||||||
|
|
||||||
|
Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiComponentName2ProtocolGuid,
|
||||||
|
NULL, &Count, &Handles);
|
||||||
|
if (EFI_ERROR(Status))
|
||||||
|
{
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < Count; i++)
|
||||||
|
{
|
||||||
|
Status = gBS->HandleProtocol(Handles[i], &gEfiComponentName2ProtocolGuid, (VOID **)&Name2Protocol);
|
||||||
|
if (EFI_ERROR(Status))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
DriverName = NULL;
|
||||||
|
Status = VtoyGetComponentName(2, Name2Protocol, &DriverName);
|
||||||
|
if ((!EFI_ERROR(Status)) && (DriverName))
|
||||||
|
{
|
||||||
|
AddEfiDriverName(DriverName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Count = 0;
|
||||||
|
FreePool(Handles);
|
||||||
|
Handles = NULL;
|
||||||
|
|
||||||
|
Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiComponentNameProtocolGuid,
|
||||||
|
NULL, &Count, &Handles);
|
||||||
|
if (EFI_ERROR(Status))
|
||||||
|
{
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < Count; i++)
|
||||||
|
{
|
||||||
|
Status = gBS->HandleProtocol(Handles[i], &gEfiComponentNameProtocolGuid, (VOID **)&NameProtocol);
|
||||||
|
if (EFI_ERROR(Status))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
DriverName = NULL;
|
||||||
|
Status = VtoyGetComponentName(1, Name2Protocol, &DriverName);
|
||||||
|
if ((!EFI_ERROR(Status)) && (DriverName))
|
||||||
|
{
|
||||||
|
AddEfiDriverName(DriverName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FreePool(Handles);
|
||||||
|
|
||||||
|
for (i = 0; i < g_EfiDriverNameCnt; i++)
|
||||||
|
{
|
||||||
|
Printf("%2d %s\n", i, g_EfiDriverNameList[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
@@ -44,8 +44,39 @@ STATIC grub_env_printf_pf g_env_printf = NULL;
|
|||||||
STATIC VtoyUtilFeature gFeatureList[] =
|
STATIC VtoyUtilFeature gFeatureList[] =
|
||||||
{
|
{
|
||||||
{ L"fix_windows_mmap", FixWindowsMemhole },
|
{ L"fix_windows_mmap", FixWindowsMemhole },
|
||||||
|
{ L"show_efi_drivers", ShowEfiDrivers },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
EFI_STATUS VtoyGetComponentName(IN UINTN Ver, IN VOID *Protocol, OUT CHAR16 **DriverName)
|
||||||
|
{
|
||||||
|
EFI_STATUS Status = EFI_SUCCESS;
|
||||||
|
CHAR16 *DrvName = NULL;
|
||||||
|
EFI_COMPONENT_NAME_PROTOCOL *NameProtocol = NULL;
|
||||||
|
EFI_COMPONENT_NAME2_PROTOCOL *Name2Protocol = NULL;
|
||||||
|
|
||||||
|
if (1 == Ver)
|
||||||
|
{
|
||||||
|
NameProtocol = (EFI_COMPONENT_NAME_PROTOCOL *)Protocol;
|
||||||
|
Status = NameProtocol->GetDriverName(Protocol, "en", &DrvName);
|
||||||
|
if (EFI_ERROR(Status) || NULL == DrvName)
|
||||||
|
{
|
||||||
|
Status = NameProtocol->GetDriverName(Protocol, "eng", &DrvName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Name2Protocol = (EFI_COMPONENT_NAME2_PROTOCOL *)Protocol;
|
||||||
|
Status = Name2Protocol->GetDriverName(Protocol, "en", &DrvName);
|
||||||
|
if (EFI_ERROR(Status) || NULL == DrvName)
|
||||||
|
{
|
||||||
|
Status = Name2Protocol->GetDriverName(Protocol, "eng", &DrvName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
*DriverName = DrvName;
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
|
||||||
VOID EFIAPI VtoyUtilDebug(IN CONST CHAR8 *Format, ...)
|
VOID EFIAPI VtoyUtilDebug(IN CONST CHAR8 *Format, ...)
|
||||||
{
|
{
|
||||||
VA_LIST Marker;
|
VA_LIST Marker;
|
||||||
|
@@ -57,7 +57,9 @@ VOID EFIAPI VtoyUtilDebug(IN CONST CHAR8 *Format, ...);
|
|||||||
#define debug(expr, ...) if (gVtoyDebugPrint) VtoyUtilDebug("[VTOY] "expr"\n", ##__VA_ARGS__)
|
#define debug(expr, ...) if (gVtoyDebugPrint) VtoyUtilDebug("[VTOY] "expr"\n", ##__VA_ARGS__)
|
||||||
#define Printf VtoyUtilDebug
|
#define Printf VtoyUtilDebug
|
||||||
|
|
||||||
|
EFI_STATUS VtoyGetComponentName(IN UINTN Ver, IN VOID *Protocol, OUT CHAR16 **DriverName);
|
||||||
EFI_STATUS FixWindowsMemhole(IN EFI_HANDLE ImageHandle, IN CONST CHAR16 *CmdLine);
|
EFI_STATUS FixWindowsMemhole(IN EFI_HANDLE ImageHandle, IN CONST CHAR16 *CmdLine);
|
||||||
|
EFI_STATUS ShowEfiDrivers(IN EFI_HANDLE ImageHandle, IN CONST CHAR16 *CmdLine);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -28,6 +28,7 @@
|
|||||||
[Sources]
|
[Sources]
|
||||||
VtoyUtil.h
|
VtoyUtil.h
|
||||||
VtoyUtil.c
|
VtoyUtil.c
|
||||||
|
VtoyDrv.c
|
||||||
Memhole.c
|
Memhole.c
|
||||||
|
|
||||||
[Packages]
|
[Packages]
|
||||||
|
257
GRUB2/MOD_SRC/grub-2.04/grub-core/disk/loopback.c
Normal file
257
GRUB2/MOD_SRC/grub-2.04/grub-core/disk/loopback.c
Normal file
@@ -0,0 +1,257 @@
|
|||||||
|
/* loopback.c - command to add loopback devices. */
|
||||||
|
/*
|
||||||
|
* GRUB -- GRand Unified Bootloader
|
||||||
|
* Copyright (C) 2005,2006,2007 Free Software Foundation, Inc.
|
||||||
|
*
|
||||||
|
* GRUB is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* GRUB is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <grub/dl.h>
|
||||||
|
#include <grub/misc.h>
|
||||||
|
#include <grub/file.h>
|
||||||
|
#include <grub/disk.h>
|
||||||
|
#include <grub/mm.h>
|
||||||
|
#include <grub/extcmd.h>
|
||||||
|
#include <grub/i18n.h>
|
||||||
|
|
||||||
|
GRUB_MOD_LICENSE ("GPLv3+");
|
||||||
|
|
||||||
|
struct grub_loopback
|
||||||
|
{
|
||||||
|
char *devname;
|
||||||
|
grub_file_t file;
|
||||||
|
struct grub_loopback *next;
|
||||||
|
unsigned long id;
|
||||||
|
grub_off_t skip;
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct grub_loopback *loopback_list;
|
||||||
|
static unsigned long last_id = 0;
|
||||||
|
|
||||||
|
static const struct grub_arg_option options[] =
|
||||||
|
{
|
||||||
|
/* TRANSLATORS: The disk is simply removed from the list of available ones,
|
||||||
|
not wiped, avoid to scare user. */
|
||||||
|
{"delete", 'd', 0, N_("Delete the specified loopback drive."), 0, 0},
|
||||||
|
{"skip", 's', 0, "skip sectors of the file.", "SECTORS", ARG_TYPE_INT },
|
||||||
|
{0, 0, 0, 0, 0, 0}
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Delete the loopback device NAME. */
|
||||||
|
static grub_err_t
|
||||||
|
delete_loopback (const char *name)
|
||||||
|
{
|
||||||
|
struct grub_loopback *dev;
|
||||||
|
struct grub_loopback **prev;
|
||||||
|
|
||||||
|
/* Search for the device. */
|
||||||
|
for (dev = loopback_list, prev = &loopback_list;
|
||||||
|
dev;
|
||||||
|
prev = &dev->next, dev = dev->next)
|
||||||
|
if (grub_strcmp (dev->devname, name) == 0)
|
||||||
|
break;
|
||||||
|
|
||||||
|
if (! dev)
|
||||||
|
return grub_error (GRUB_ERR_BAD_DEVICE, "device not found");
|
||||||
|
|
||||||
|
/* Remove the device from the list. */
|
||||||
|
*prev = dev->next;
|
||||||
|
|
||||||
|
grub_free (dev->devname);
|
||||||
|
grub_file_close (dev->file);
|
||||||
|
grub_free (dev);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* The command to add and remove loopback devices. */
|
||||||
|
static grub_err_t
|
||||||
|
grub_cmd_loopback (grub_extcmd_context_t ctxt, int argc, char **args)
|
||||||
|
{
|
||||||
|
struct grub_arg_list *state = ctxt->state;
|
||||||
|
grub_file_t file;
|
||||||
|
struct grub_loopback *newdev;
|
||||||
|
grub_err_t ret;
|
||||||
|
grub_off_t skip = 0;
|
||||||
|
|
||||||
|
if (argc < 1)
|
||||||
|
return grub_error (GRUB_ERR_BAD_ARGUMENT, "device name required");
|
||||||
|
|
||||||
|
/* Check if `-d' was used. */
|
||||||
|
if (state[0].set)
|
||||||
|
return delete_loopback (args[0]);
|
||||||
|
|
||||||
|
if (state[1].set)
|
||||||
|
skip = (grub_off_t)grub_strtoull(state[1].arg, NULL, 10);
|
||||||
|
|
||||||
|
if (argc < 2)
|
||||||
|
return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected"));
|
||||||
|
|
||||||
|
file = grub_file_open (args[1], GRUB_FILE_TYPE_LOOPBACK
|
||||||
|
| GRUB_FILE_TYPE_NO_DECOMPRESS);
|
||||||
|
if (! file)
|
||||||
|
return grub_errno;
|
||||||
|
|
||||||
|
/* First try to replace the old device. */
|
||||||
|
for (newdev = loopback_list; newdev; newdev = newdev->next)
|
||||||
|
if (grub_strcmp (newdev->devname, args[0]) == 0)
|
||||||
|
break;
|
||||||
|
|
||||||
|
if (newdev)
|
||||||
|
{
|
||||||
|
grub_file_close (newdev->file);
|
||||||
|
newdev->file = file;
|
||||||
|
newdev->skip = skip;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Unable to replace it, make a new entry. */
|
||||||
|
newdev = grub_malloc (sizeof (struct grub_loopback));
|
||||||
|
if (! newdev)
|
||||||
|
goto fail;
|
||||||
|
|
||||||
|
newdev->devname = grub_strdup (args[0]);
|
||||||
|
if (! newdev->devname)
|
||||||
|
{
|
||||||
|
grub_free (newdev);
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
newdev->file = file;
|
||||||
|
newdev->skip = skip;
|
||||||
|
newdev->id = last_id++;
|
||||||
|
|
||||||
|
/* Add the new entry to the list. */
|
||||||
|
newdev->next = loopback_list;
|
||||||
|
loopback_list = newdev;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
fail:
|
||||||
|
ret = grub_errno;
|
||||||
|
grub_file_close (file);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static int
|
||||||
|
grub_loopback_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data,
|
||||||
|
grub_disk_pull_t pull)
|
||||||
|
{
|
||||||
|
struct grub_loopback *d;
|
||||||
|
if (pull != GRUB_DISK_PULL_NONE)
|
||||||
|
return 0;
|
||||||
|
for (d = loopback_list; d; d = d->next)
|
||||||
|
{
|
||||||
|
if (hook (d->devname, hook_data))
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static grub_err_t
|
||||||
|
grub_loopback_open (const char *name, grub_disk_t disk)
|
||||||
|
{
|
||||||
|
struct grub_loopback *dev;
|
||||||
|
|
||||||
|
for (dev = loopback_list; dev; dev = dev->next)
|
||||||
|
if (grub_strcmp (dev->devname, name) == 0)
|
||||||
|
break;
|
||||||
|
|
||||||
|
if (! dev)
|
||||||
|
return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "can't open device");
|
||||||
|
|
||||||
|
/* Use the filesize for the disk size, round up to a complete sector. */
|
||||||
|
if (dev->file->size != GRUB_FILE_SIZE_UNKNOWN)
|
||||||
|
disk->total_sectors = ((dev->file->size + GRUB_DISK_SECTOR_SIZE - 1)
|
||||||
|
/ GRUB_DISK_SECTOR_SIZE);
|
||||||
|
else
|
||||||
|
disk->total_sectors = GRUB_DISK_SIZE_UNKNOWN;
|
||||||
|
/* Avoid reading more than 512M. */
|
||||||
|
disk->max_agglomerate = 1 << (29 - GRUB_DISK_SECTOR_BITS
|
||||||
|
- GRUB_DISK_CACHE_BITS);
|
||||||
|
|
||||||
|
disk->id = dev->id;
|
||||||
|
|
||||||
|
disk->data = dev;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static grub_err_t
|
||||||
|
grub_loopback_read (grub_disk_t disk, grub_disk_addr_t sector,
|
||||||
|
grub_size_t size, char *buf)
|
||||||
|
{
|
||||||
|
grub_file_t file = ((struct grub_loopback *) disk->data)->file;
|
||||||
|
grub_off_t skip = ((struct grub_loopback *) disk->data)->skip;
|
||||||
|
grub_off_t pos;
|
||||||
|
|
||||||
|
grub_file_seek (file, (sector + skip) << GRUB_DISK_SECTOR_BITS);
|
||||||
|
|
||||||
|
grub_file_read (file, buf, size << GRUB_DISK_SECTOR_BITS);
|
||||||
|
if (grub_errno)
|
||||||
|
return grub_errno;
|
||||||
|
|
||||||
|
/* In case there is more data read than there is available, in case
|
||||||
|
of files that are not a multiple of GRUB_DISK_SECTOR_SIZE, fill
|
||||||
|
the rest with zeros. */
|
||||||
|
pos = (sector + skip + size) << GRUB_DISK_SECTOR_BITS;
|
||||||
|
if (pos > file->size)
|
||||||
|
{
|
||||||
|
grub_size_t amount = pos - file->size;
|
||||||
|
grub_memset (buf + (size << GRUB_DISK_SECTOR_BITS) - amount, 0, amount);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static grub_err_t
|
||||||
|
grub_loopback_write (grub_disk_t disk __attribute ((unused)),
|
||||||
|
grub_disk_addr_t sector __attribute ((unused)),
|
||||||
|
grub_size_t size __attribute ((unused)),
|
||||||
|
const char *buf __attribute ((unused)))
|
||||||
|
{
|
||||||
|
return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
|
||||||
|
"loopback write is not supported");
|
||||||
|
}
|
||||||
|
|
||||||
|
static struct grub_disk_dev grub_loopback_dev =
|
||||||
|
{
|
||||||
|
.name = "loopback",
|
||||||
|
.id = GRUB_DISK_DEVICE_LOOPBACK_ID,
|
||||||
|
.disk_iterate = grub_loopback_iterate,
|
||||||
|
.disk_open = grub_loopback_open,
|
||||||
|
.disk_read = grub_loopback_read,
|
||||||
|
.disk_write = grub_loopback_write,
|
||||||
|
.next = 0
|
||||||
|
};
|
||||||
|
|
||||||
|
static grub_extcmd_t cmd;
|
||||||
|
|
||||||
|
GRUB_MOD_INIT(loopback)
|
||||||
|
{
|
||||||
|
cmd = grub_register_extcmd ("loopback", grub_cmd_loopback, 0,
|
||||||
|
N_("[-d] DEVICENAME FILE."),
|
||||||
|
/* TRANSLATORS: The file itself is not destroyed
|
||||||
|
or transformed into drive. */
|
||||||
|
N_("Make a virtual drive from a file."), options);
|
||||||
|
grub_disk_dev_register (&grub_loopback_dev);
|
||||||
|
}
|
||||||
|
|
||||||
|
GRUB_MOD_FINI(loopback)
|
||||||
|
{
|
||||||
|
grub_unregister_extcmd (cmd);
|
||||||
|
grub_disk_dev_unregister (&grub_loopback_dev);
|
||||||
|
}
|
@@ -33,6 +33,7 @@
|
|||||||
GRUB_MOD_LICENSE ("GPLv3+");
|
GRUB_MOD_LICENSE ("GPLv3+");
|
||||||
|
|
||||||
static int g_ventoy_no_joliet = 0;
|
static int g_ventoy_no_joliet = 0;
|
||||||
|
static int g_ventoy_cur_joliet = 0;
|
||||||
static grub_uint64_t g_ventoy_last_read_pos = 0;
|
static grub_uint64_t g_ventoy_last_read_pos = 0;
|
||||||
static grub_uint64_t g_ventoy_last_read_offset = 0;
|
static grub_uint64_t g_ventoy_last_read_offset = 0;
|
||||||
static grub_uint64_t g_ventoy_last_read_dirent_pos = 0;
|
static grub_uint64_t g_ventoy_last_read_dirent_pos = 0;
|
||||||
@@ -451,6 +452,7 @@ grub_iso9660_mount (grub_disk_t disk)
|
|||||||
|
|
||||||
data->disk = disk;
|
data->disk = disk;
|
||||||
|
|
||||||
|
g_ventoy_cur_joliet = 0;
|
||||||
block = 16;
|
block = 16;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
@@ -484,6 +486,7 @@ grub_iso9660_mount (grub_disk_t disk)
|
|||||||
if (0 == g_ventoy_no_joliet) {
|
if (0 == g_ventoy_no_joliet) {
|
||||||
copy_voldesc = 1;
|
copy_voldesc = 1;
|
||||||
data->joliet = 1;
|
data->joliet = 1;
|
||||||
|
g_ventoy_cur_joliet = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1118,6 +1121,11 @@ void grub_iso9660_set_nojoliet(int nojoliet)
|
|||||||
g_ventoy_no_joliet = nojoliet;
|
g_ventoy_no_joliet = nojoliet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int grub_iso9660_is_joliet(void)
|
||||||
|
{
|
||||||
|
return g_ventoy_cur_joliet;
|
||||||
|
}
|
||||||
|
|
||||||
grub_uint64_t grub_iso9660_get_last_read_pos(grub_file_t file)
|
grub_uint64_t grub_iso9660_get_last_read_pos(grub_file_t file)
|
||||||
{
|
{
|
||||||
(void)file;
|
(void)file;
|
||||||
|
@@ -127,6 +127,9 @@ static grub_uint64_t g_enumerate_start_time_ms;
|
|||||||
static grub_uint64_t g_enumerate_finish_time_ms;
|
static grub_uint64_t g_enumerate_finish_time_ms;
|
||||||
static int g_vtoy_file_flt[VTOY_FILE_FLT_BUTT] = {0};
|
static int g_vtoy_file_flt[VTOY_FILE_FLT_BUTT] = {0};
|
||||||
|
|
||||||
|
static int g_pager_flag = 0;
|
||||||
|
static char g_old_pager[32];
|
||||||
|
|
||||||
static const char *g_vtoy_winpeshl_ini = "[LaunchApps]\r\nvtoyjump.exe";
|
static const char *g_vtoy_winpeshl_ini = "[LaunchApps]\r\nvtoyjump.exe";
|
||||||
|
|
||||||
static const char *g_menu_class[] =
|
static const char *g_menu_class[] =
|
||||||
@@ -1221,6 +1224,23 @@ static grub_err_t ventoy_cmd_load_img_memdisk(grub_extcmd_context_t ctxt, int ar
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static grub_err_t ventoy_cmd_iso9660_is_joliet(grub_extcmd_context_t ctxt, int argc, char **args)
|
||||||
|
{
|
||||||
|
(void)ctxt;
|
||||||
|
(void)argc;
|
||||||
|
(void)args;
|
||||||
|
|
||||||
|
if (grub_iso9660_is_joliet())
|
||||||
|
{
|
||||||
|
debug("This time has joliet process\n");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static grub_err_t ventoy_cmd_iso9660_nojoliet(grub_extcmd_context_t ctxt, int argc, char **args)
|
static grub_err_t ventoy_cmd_iso9660_nojoliet(grub_extcmd_context_t ctxt, int argc, char **args)
|
||||||
{
|
{
|
||||||
(void)ctxt;
|
(void)ctxt;
|
||||||
@@ -3148,6 +3168,22 @@ static grub_err_t ventoy_cmd_add_replace_file(grub_extcmd_context_t ctxt, int ar
|
|||||||
VENTOY_CMD_RETURN(GRUB_ERR_NONE);
|
VENTOY_CMD_RETURN(GRUB_ERR_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static grub_err_t ventoy_cmd_get_replace_file_cnt(grub_extcmd_context_t ctxt, int argc, char **args)
|
||||||
|
{
|
||||||
|
char buf[32];
|
||||||
|
ventoy_grub_param_file_replace *replace = &(g_grub_param->file_replace);
|
||||||
|
|
||||||
|
(void)ctxt;
|
||||||
|
|
||||||
|
if (argc >= 1)
|
||||||
|
{
|
||||||
|
grub_snprintf(buf, sizeof(buf), "%u", replace->old_name_cnt);
|
||||||
|
grub_env_set(args[0], buf);
|
||||||
|
}
|
||||||
|
|
||||||
|
VENTOY_CMD_RETURN(GRUB_ERR_NONE);
|
||||||
|
}
|
||||||
|
|
||||||
static grub_err_t ventoy_cmd_dump_menu(grub_extcmd_context_t ctxt, int argc, char **args)
|
static grub_err_t ventoy_cmd_dump_menu(grub_extcmd_context_t ctxt, int argc, char **args)
|
||||||
{
|
{
|
||||||
(void)ctxt;
|
(void)ctxt;
|
||||||
@@ -4425,6 +4461,240 @@ static grub_err_t ventoy_cmd_get_video_mode(grub_extcmd_context_t ctxt, int argc
|
|||||||
VENTOY_CMD_RETURN(0);
|
VENTOY_CMD_RETURN(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static grub_err_t ventoy_cmd_get_efivdisk_offset(grub_extcmd_context_t ctxt, int argc, char **args)
|
||||||
|
{
|
||||||
|
grub_uint32_t i;
|
||||||
|
grub_uint32_t loadsector = 0;
|
||||||
|
grub_file_t file;
|
||||||
|
char value[32];
|
||||||
|
grub_uint32_t boot_catlog = 0;
|
||||||
|
grub_uint8_t buf[512];
|
||||||
|
|
||||||
|
(void)ctxt;
|
||||||
|
|
||||||
|
if (argc != 2)
|
||||||
|
{
|
||||||
|
debug("ventoy_cmd_get_efivdisk_offset, invalid param num %d\n", argc);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
file = grub_file_open(args[0], VENTOY_FILE_TYPE);
|
||||||
|
if (!file)
|
||||||
|
{
|
||||||
|
debug("failed to open %s\n", args[0]);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
boot_catlog = ventoy_get_iso_boot_catlog(file);
|
||||||
|
if (boot_catlog == 0)
|
||||||
|
{
|
||||||
|
debug("No bootcatlog found\n");
|
||||||
|
grub_file_close(file);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
grub_memset(buf, 0, sizeof(buf));
|
||||||
|
grub_file_seek(file, boot_catlog * 2048);
|
||||||
|
grub_file_read(file, buf, sizeof(buf));
|
||||||
|
grub_file_close(file);
|
||||||
|
|
||||||
|
for (i = 0; i < sizeof(buf); i += 32)
|
||||||
|
{
|
||||||
|
if ((buf[i] == 0 || buf[i] == 0x90 || buf[i] == 0x91) && buf[i + 1] == 0xEF)
|
||||||
|
{
|
||||||
|
if (buf[i + 32] == 0x88)
|
||||||
|
{
|
||||||
|
loadsector = *(grub_uint32_t *)(buf + i + 32 + 8);
|
||||||
|
grub_snprintf(value, sizeof(value), "%u", loadsector * 4); //change to sector size 512
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (loadsector == 0)
|
||||||
|
{
|
||||||
|
debug("No EFI eltorito info found\n");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
debug("ventoy_cmd_get_efivdisk_offset <%s>\n", value);
|
||||||
|
grub_env_set(args[1], value);
|
||||||
|
VENTOY_CMD_RETURN(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int ventoy_collect_replace_initrd(const char *filename, const struct grub_dirhook_info *info, void *data)
|
||||||
|
{
|
||||||
|
int curpos;
|
||||||
|
int printlen;
|
||||||
|
grub_size_t len;
|
||||||
|
replace_fs_dir *pfsdir = (replace_fs_dir *)data;
|
||||||
|
|
||||||
|
if (pfsdir->initrd[0])
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
curpos = pfsdir->curpos;
|
||||||
|
len = grub_strlen(filename);
|
||||||
|
|
||||||
|
if (info->dir)
|
||||||
|
{
|
||||||
|
if ((len == 1 && filename[0] == '.') ||
|
||||||
|
(len == 2 && filename[0] == '.' && filename[1] == '.'))
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//debug("#### [DIR] <%s> <%s>\n", pfsdir->fullpath, filename);
|
||||||
|
pfsdir->dircnt++;
|
||||||
|
|
||||||
|
printlen = grub_snprintf(pfsdir->fullpath + curpos, 512 - curpos, "%s/", filename);
|
||||||
|
pfsdir->curpos = curpos + printlen;
|
||||||
|
pfsdir->fs->fs_dir(pfsdir->dev, pfsdir->fullpath, ventoy_collect_replace_initrd, pfsdir);
|
||||||
|
pfsdir->curpos = curpos;
|
||||||
|
pfsdir->fullpath[curpos] = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//debug("#### [FILE] <%s> <%s>\n", pfsdir->fullpath, filename);
|
||||||
|
pfsdir->filecnt++;
|
||||||
|
|
||||||
|
/* We consider the xxx.img file bigger than 32MB is the initramfs file */
|
||||||
|
if (len > 4 && grub_strncmp(filename + len - 4, ".img", 4) == 0)
|
||||||
|
{
|
||||||
|
if (info->size > 32 * VTOY_SIZE_1MB)
|
||||||
|
{
|
||||||
|
grub_snprintf(pfsdir->initrd, sizeof(pfsdir->initrd), "%s%s", pfsdir->fullpath, filename);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static grub_err_t ventoy_cmd_search_replace_initrd(grub_extcmd_context_t ctxt, int argc, char **args)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
char *pos = NULL;
|
||||||
|
char *device_name = NULL;
|
||||||
|
grub_device_t dev = NULL;
|
||||||
|
grub_fs_t fs = NULL;
|
||||||
|
replace_fs_dir *pfsdir = NULL;
|
||||||
|
|
||||||
|
(void)ctxt;
|
||||||
|
|
||||||
|
if (argc != 2)
|
||||||
|
{
|
||||||
|
debug("ventoy_cmd_search_replace_initrd, invalid param num %d\n", argc);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
pfsdir = grub_zalloc(sizeof(replace_fs_dir));
|
||||||
|
if (!pfsdir)
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
device_name = grub_file_get_device_name(args[0]);
|
||||||
|
if (!device_name)
|
||||||
|
{
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
dev = grub_device_open(device_name);
|
||||||
|
if (!dev)
|
||||||
|
{
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
fs = grub_fs_probe(dev);
|
||||||
|
if (!fs)
|
||||||
|
{
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
pfsdir->dev = dev;
|
||||||
|
pfsdir->fs = fs;
|
||||||
|
pfsdir->curpos = 1;
|
||||||
|
pfsdir->fullpath[0] = '/';
|
||||||
|
fs->fs_dir(dev, "/", ventoy_collect_replace_initrd, pfsdir);
|
||||||
|
|
||||||
|
if (pfsdir->initrd[0])
|
||||||
|
{
|
||||||
|
debug("Replace initrd <%s> <%d %d>\n", pfsdir->initrd, pfsdir->dircnt, pfsdir->filecnt);
|
||||||
|
|
||||||
|
for (i = 0; i < (int)sizeof(pfsdir->initrd) && pfsdir->initrd[i]; i++)
|
||||||
|
{
|
||||||
|
if (pfsdir->initrd[i] == '/')
|
||||||
|
{
|
||||||
|
pfsdir->initrd[i] = '\\';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pos = (pfsdir->initrd[0] == '\\') ? pfsdir->initrd + 1 : pfsdir->initrd;
|
||||||
|
grub_env_set(args[1], pos);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
debug("Replace initrd NOT found <%s> <%d %d>\n", args[0], pfsdir->dircnt, pfsdir->filecnt);
|
||||||
|
}
|
||||||
|
|
||||||
|
fail:
|
||||||
|
|
||||||
|
grub_check_free(pfsdir);
|
||||||
|
grub_check_free(device_name);
|
||||||
|
check_free(dev, grub_device_close);
|
||||||
|
|
||||||
|
VENTOY_CMD_RETURN(GRUB_ERR_NONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
static grub_err_t ventoy_cmd_push_pager(grub_extcmd_context_t ctxt, int argc, char **args)
|
||||||
|
{
|
||||||
|
const char *pager = NULL;
|
||||||
|
|
||||||
|
(void)ctxt;
|
||||||
|
(void)argc;
|
||||||
|
(void)args;
|
||||||
|
|
||||||
|
pager = grub_env_get("pager");
|
||||||
|
if (NULL == pager)
|
||||||
|
{
|
||||||
|
g_pager_flag = 1;
|
||||||
|
grub_env_set("pager", "1");
|
||||||
|
}
|
||||||
|
else if (pager[0] == '1')
|
||||||
|
{
|
||||||
|
g_pager_flag = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
grub_snprintf(g_old_pager, sizeof(g_old_pager), "%s", pager);
|
||||||
|
g_pager_flag = 2;
|
||||||
|
grub_env_set("pager", "1");
|
||||||
|
}
|
||||||
|
|
||||||
|
VENTOY_CMD_RETURN(GRUB_ERR_NONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
static grub_err_t ventoy_cmd_pop_pager(grub_extcmd_context_t ctxt, int argc, char **args)
|
||||||
|
{
|
||||||
|
(void)ctxt;
|
||||||
|
(void)argc;
|
||||||
|
(void)args;
|
||||||
|
|
||||||
|
if (g_pager_flag == 1)
|
||||||
|
{
|
||||||
|
grub_env_unset("pager");
|
||||||
|
}
|
||||||
|
else if (g_pager_flag == 2)
|
||||||
|
{
|
||||||
|
grub_env_set("pager", g_old_pager);
|
||||||
|
}
|
||||||
|
|
||||||
|
VENTOY_CMD_RETURN(GRUB_ERR_NONE);
|
||||||
|
}
|
||||||
|
|
||||||
int ventoy_env_init(void)
|
int ventoy_env_init(void)
|
||||||
{
|
{
|
||||||
char buf[64];
|
char buf[64];
|
||||||
@@ -4532,6 +4802,7 @@ static cmd_para ventoy_cmds[] =
|
|||||||
{ "vt_select_conf_replace", ventoy_select_conf_replace, 0, NULL, "", "", NULL },
|
{ "vt_select_conf_replace", ventoy_select_conf_replace, 0, NULL, "", "", NULL },
|
||||||
|
|
||||||
{ "vt_iso9660_nojoliet", ventoy_cmd_iso9660_nojoliet, 0, NULL, "", "", NULL },
|
{ "vt_iso9660_nojoliet", ventoy_cmd_iso9660_nojoliet, 0, NULL, "", "", NULL },
|
||||||
|
{ "vt_iso9660_isjoliet", ventoy_cmd_iso9660_is_joliet, 0, NULL, "", "", NULL },
|
||||||
{ "vt_is_udf", ventoy_cmd_is_udf, 0, NULL, "", "", NULL },
|
{ "vt_is_udf", ventoy_cmd_is_udf, 0, NULL, "", "", NULL },
|
||||||
{ "vt_file_size", ventoy_cmd_file_size, 0, NULL, "", "", NULL },
|
{ "vt_file_size", ventoy_cmd_file_size, 0, NULL, "", "", NULL },
|
||||||
{ "vt_load_file_to_mem", ventoy_cmd_load_file_to_mem, 0, NULL, "", "", NULL },
|
{ "vt_load_file_to_mem", ventoy_cmd_load_file_to_mem, 0, NULL, "", "", NULL },
|
||||||
@@ -4560,6 +4831,7 @@ static cmd_para ventoy_cmds[] =
|
|||||||
{ "vt_wim_chain_data", ventoy_cmd_wim_chain_data, 0, NULL, "", "", NULL },
|
{ "vt_wim_chain_data", ventoy_cmd_wim_chain_data, 0, NULL, "", "", NULL },
|
||||||
|
|
||||||
{ "vt_add_replace_file", ventoy_cmd_add_replace_file, 0, NULL, "", "", NULL },
|
{ "vt_add_replace_file", ventoy_cmd_add_replace_file, 0, NULL, "", "", NULL },
|
||||||
|
{ "vt_get_replace_file_cnt", ventoy_cmd_get_replace_file_cnt, 0, NULL, "", "", NULL },
|
||||||
{ "vt_test_block_list", ventoy_cmd_test_block_list, 0, NULL, "", "", NULL },
|
{ "vt_test_block_list", ventoy_cmd_test_block_list, 0, NULL, "", "", NULL },
|
||||||
{ "vt_file_exist_nocase", ventoy_cmd_file_exist_nocase, 0, NULL, "", "", NULL },
|
{ "vt_file_exist_nocase", ventoy_cmd_file_exist_nocase, 0, NULL, "", "", NULL },
|
||||||
|
|
||||||
@@ -4596,6 +4868,10 @@ static cmd_para ventoy_cmds[] =
|
|||||||
{ "vt_set_wim_load_prompt", ventoy_cmd_set_wim_prompt, 0, NULL, "", "", NULL },
|
{ "vt_set_wim_load_prompt", ventoy_cmd_set_wim_prompt, 0, NULL, "", "", NULL },
|
||||||
{ "vt_set_theme", ventoy_cmd_set_theme, 0, NULL, "", "", NULL },
|
{ "vt_set_theme", ventoy_cmd_set_theme, 0, NULL, "", "", NULL },
|
||||||
|
|
||||||
|
{ "vt_get_efi_vdisk_offset", ventoy_cmd_get_efivdisk_offset, 0, NULL, "", "", NULL },
|
||||||
|
{ "vt_search_replace_initrd", ventoy_cmd_search_replace_initrd, 0, NULL, "", "", NULL },
|
||||||
|
{ "vt_push_pager", ventoy_cmd_push_pager, 0, NULL, "", "", NULL },
|
||||||
|
{ "vt_pop_pager", ventoy_cmd_pop_pager, 0, NULL, "", "", NULL },
|
||||||
};
|
};
|
||||||
|
|
||||||
int ventoy_register_all_cmd(void)
|
int ventoy_register_all_cmd(void)
|
||||||
|
@@ -69,6 +69,9 @@
|
|||||||
#define VTOY_ARCH_CPIO "ventoy_x86.cpio"
|
#define VTOY_ARCH_CPIO "ventoy_x86.cpio"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define ventoy_varg_4(arg) arg[0], arg[1], arg[2], arg[3]
|
||||||
|
#define ventoy_varg_8(arg) arg[0], arg[1], arg[2], arg[3], arg[4], arg[5], arg[6], arg[7]
|
||||||
|
|
||||||
#define VTOY_PWD_CORRUPTED(err) \
|
#define VTOY_PWD_CORRUPTED(err) \
|
||||||
{\
|
{\
|
||||||
grub_printf("\n\n Password corrupted, will reboot after 5 seconds.\n\n"); \
|
grub_printf("\n\n Password corrupted, will reboot after 5 seconds.\n\n"); \
|
||||||
@@ -533,6 +536,17 @@ typedef struct plugin_entry
|
|||||||
ventoy_plugin_check_pf checkfunc;
|
ventoy_plugin_check_pf checkfunc;
|
||||||
}plugin_entry;
|
}plugin_entry;
|
||||||
|
|
||||||
|
typedef struct replace_fs_dir
|
||||||
|
{
|
||||||
|
grub_device_t dev;
|
||||||
|
grub_fs_t fs;
|
||||||
|
char fullpath[512];
|
||||||
|
char initrd[512];
|
||||||
|
int curpos;
|
||||||
|
int dircnt;
|
||||||
|
int filecnt;
|
||||||
|
}replace_fs_dir;
|
||||||
|
|
||||||
int ventoy_strcmp(const char *pattern, const char *str);
|
int ventoy_strcmp(const char *pattern, const char *str);
|
||||||
int ventoy_strncmp (const char *pattern, const char *str, grub_size_t n);
|
int ventoy_strncmp (const char *pattern, const char *str, grub_size_t n);
|
||||||
void ventoy_fill_os_param(grub_file_t file, ventoy_os_param *param);
|
void ventoy_fill_os_param(grub_file_t file, ventoy_os_param *param);
|
||||||
|
@@ -333,7 +333,9 @@ end:
|
|||||||
static grub_err_t ventoy_grub_cfg_initrd_collect(const char *fileName)
|
static grub_err_t ventoy_grub_cfg_initrd_collect(const char *fileName)
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
int len = 0;
|
||||||
int dollar = 0;
|
int dollar = 0;
|
||||||
|
int quotation = 0;
|
||||||
grub_file_t file = NULL;
|
grub_file_t file = NULL;
|
||||||
char *buf = NULL;
|
char *buf = NULL;
|
||||||
char *start = NULL;
|
char *start = NULL;
|
||||||
@@ -382,6 +384,12 @@ static grub_err_t ventoy_grub_cfg_initrd_collect(const char *fileName)
|
|||||||
start++;
|
start++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (*start == '"')
|
||||||
|
{
|
||||||
|
quotation = 1;
|
||||||
|
start++;
|
||||||
|
}
|
||||||
|
|
||||||
while (*start)
|
while (*start)
|
||||||
{
|
{
|
||||||
img = grub_zalloc(sizeof(initrd_info));
|
img = grub_zalloc(sizeof(initrd_info));
|
||||||
@@ -400,6 +408,16 @@ static grub_err_t ventoy_grub_cfg_initrd_collect(const char *fileName)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (quotation)
|
||||||
|
{
|
||||||
|
len = (int)grub_strlen(img->name);
|
||||||
|
if (len > 2 && img->name[len - 1] == '"')
|
||||||
|
{
|
||||||
|
img->name[len - 1] = 0;
|
||||||
|
}
|
||||||
|
debug("Remove quotation <%s>\n", img->name);
|
||||||
|
}
|
||||||
|
|
||||||
if (dollar == 1 || ventoy_find_initrd_by_name(g_initrd_img_list, img->name))
|
if (dollar == 1 || ventoy_find_initrd_by_name(g_initrd_img_list, img->name))
|
||||||
{
|
{
|
||||||
grub_free(img);
|
grub_free(img);
|
||||||
@@ -1441,9 +1459,9 @@ grub_err_t ventoy_cmd_trailer_cpio(grub_extcmd_context_t ctxt, int argc, char **
|
|||||||
VENTOY_CMD_RETURN(GRUB_ERR_NONE);
|
VENTOY_CMD_RETURN(GRUB_ERR_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
grub_err_t ventoy_cmd_linux_chain_data(grub_extcmd_context_t ctxt, int argc, char **args)
|
grub_err_t ventoy_cmd_linux_chain_data(grub_extcmd_context_t ctxt, int argc, char **args)
|
||||||
{
|
{
|
||||||
|
int len = 0;
|
||||||
int ventoy_compatible = 0;
|
int ventoy_compatible = 0;
|
||||||
grub_uint32_t size = 0;
|
grub_uint32_t size = 0;
|
||||||
grub_uint64_t isosize = 0;
|
grub_uint64_t isosize = 0;
|
||||||
@@ -1493,13 +1511,21 @@ grub_err_t ventoy_cmd_linux_chain_data(grub_extcmd_context_t ctxt, int argc, cha
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (ventoy_is_efi_os())
|
len = (int)grub_strlen(args[0]);
|
||||||
|
if (len >= 4 && 0 == grub_strcasecmp(args[0] + len - 4, ".img"))
|
||||||
{
|
{
|
||||||
grub_env_set("LoadIsoEfiDriver", "on");
|
debug("boot catlog %u for img file\n", boot_catlog);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return grub_error(GRUB_ERR_BAD_ARGUMENT, "File %s is not bootable", args[0]);
|
if (ventoy_is_efi_os())
|
||||||
|
{
|
||||||
|
grub_env_set("LoadIsoEfiDriver", "on");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return grub_error(GRUB_ERR_BAD_ARGUMENT, "File %s is not bootable", args[0]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -660,30 +660,22 @@ static wim_directory_entry * search_full_wim_dirent
|
|||||||
|
|
||||||
static wim_directory_entry * search_replace_wim_dirent(void *meta_data, wim_directory_entry *dir)
|
static wim_directory_entry * search_replace_wim_dirent(void *meta_data, wim_directory_entry *dir)
|
||||||
{
|
{
|
||||||
wim_directory_entry *wim_dirent1 = NULL;
|
wim_directory_entry *wim_dirent = NULL;
|
||||||
wim_directory_entry *wim_dirent2 = NULL;
|
|
||||||
const char *pecmd_path[] = { "Windows", "System32", "pecmd.exe", NULL };
|
const char *pecmd_path[] = { "Windows", "System32", "pecmd.exe", NULL };
|
||||||
const char *wpeinit_path[] = { "Windows", "System32", "wpeinit.exe", NULL };
|
|
||||||
const char *winpeshl_path[] = { "Windows", "System32", "winpeshl.exe", NULL };
|
const char *winpeshl_path[] = { "Windows", "System32", "winpeshl.exe", NULL };
|
||||||
|
|
||||||
wim_dirent1 = search_full_wim_dirent(meta_data, dir, pecmd_path);
|
wim_dirent = search_full_wim_dirent(meta_data, dir, pecmd_path);
|
||||||
debug("search pecmd.exe %p\n", wim_dirent1);
|
debug("search pecmd.exe %p\n", wim_dirent);
|
||||||
if (wim_dirent1)
|
if (wim_dirent)
|
||||||
{
|
{
|
||||||
wim_dirent2 = search_full_wim_dirent(meta_data, dir, wpeinit_path);
|
return wim_dirent;
|
||||||
debug("search wpeinit.exe %p\n", wim_dirent1);
|
|
||||||
if (wim_dirent2)
|
|
||||||
{
|
|
||||||
return wim_dirent2;
|
|
||||||
}
|
|
||||||
return wim_dirent1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
wim_dirent1 = search_full_wim_dirent(meta_data, dir, winpeshl_path);
|
wim_dirent = search_full_wim_dirent(meta_data, dir, winpeshl_path);
|
||||||
debug("search winpeshl.exe %p\n", wim_dirent1);
|
debug("search winpeshl.exe %p\n", wim_dirent);
|
||||||
if (wim_dirent1)
|
if (wim_dirent)
|
||||||
{
|
{
|
||||||
return wim_dirent1;
|
return wim_dirent;
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -745,6 +737,27 @@ static grub_uint64_t ventoy_get_stream_len(wim_directory_entry *dir)
|
|||||||
return offset;
|
return offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int ventoy_update_stream_hash(wim_patch *patch, wim_directory_entry *dir)
|
||||||
|
{
|
||||||
|
grub_uint16_t i;
|
||||||
|
grub_uint64_t offset = 0;
|
||||||
|
wim_stream_entry *stream = (wim_stream_entry *)((char *)dir + dir->len);
|
||||||
|
|
||||||
|
for (i = 0; i < dir->streams; i++)
|
||||||
|
{
|
||||||
|
if (grub_memcmp(stream->hash.sha1, patch->old_hash.sha1, sizeof(wim_hash)) == 0)
|
||||||
|
{
|
||||||
|
debug("find target stream %u, name_len:%u upadte hash\n", i, stream->name_len);
|
||||||
|
grub_memcpy(stream->hash.sha1, &(patch->wim_data.bin_hash), sizeof(wim_hash));
|
||||||
|
}
|
||||||
|
|
||||||
|
offset += stream->len;
|
||||||
|
stream = (wim_stream_entry *)((char *)stream + stream->len);
|
||||||
|
}
|
||||||
|
|
||||||
|
return offset;
|
||||||
|
}
|
||||||
|
|
||||||
static int ventoy_update_all_hash(wim_patch *patch, void *meta_data, wim_directory_entry *dir)
|
static int ventoy_update_all_hash(wim_patch *patch, void *meta_data, wim_directory_entry *dir)
|
||||||
{
|
{
|
||||||
if ((meta_data == NULL) || (dir == NULL))
|
if ((meta_data == NULL) || (dir == NULL))
|
||||||
@@ -772,6 +785,7 @@ static int ventoy_update_all_hash(wim_patch *patch, void *meta_data, wim_directo
|
|||||||
|
|
||||||
if (dir->streams)
|
if (dir->streams)
|
||||||
{
|
{
|
||||||
|
ventoy_update_stream_hash(patch, dir);
|
||||||
dir = (wim_directory_entry *)((char *)dir + dir->len + ventoy_get_stream_len(dir));
|
dir = (wim_directory_entry *)((char *)dir + dir->len + ventoy_get_stream_len(dir));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -932,6 +946,7 @@ static int ventoy_update_before_chain(ventoy_os_param *param, char *isopath)
|
|||||||
static int ventoy_wimdows_locate_wim(const char *disk, wim_patch *patch)
|
static int ventoy_wimdows_locate_wim(const char *disk, wim_patch *patch)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
|
grub_uint16_t i;
|
||||||
grub_file_t file;
|
grub_file_t file;
|
||||||
grub_uint32_t exe_len;
|
grub_uint32_t exe_len;
|
||||||
grub_uint8_t *exe_data = NULL;
|
grub_uint8_t *exe_data = NULL;
|
||||||
@@ -940,6 +955,7 @@ static int ventoy_wimdows_locate_wim(const char *disk, wim_patch *patch)
|
|||||||
wim_security_header *security = NULL;
|
wim_security_header *security = NULL;
|
||||||
wim_directory_entry *rootdir = NULL;
|
wim_directory_entry *rootdir = NULL;
|
||||||
wim_directory_entry *search = NULL;
|
wim_directory_entry *search = NULL;
|
||||||
|
wim_stream_entry *stream = NULL;
|
||||||
wim_header *head = &(patch->wim_data.wim_header);
|
wim_header *head = &(patch->wim_data.wim_header);
|
||||||
wim_tail *wim_data = &patch->wim_data;
|
wim_tail *wim_data = &patch->wim_data;
|
||||||
|
|
||||||
@@ -1002,8 +1018,28 @@ static int ventoy_wimdows_locate_wim(const char *disk, wim_patch *patch)
|
|||||||
}
|
}
|
||||||
|
|
||||||
debug("find replace file at %p\n", search);
|
debug("find replace file at %p\n", search);
|
||||||
|
|
||||||
grub_memcpy(&patch->old_hash, search->hash.sha1, sizeof(wim_hash));
|
grub_memset(&patch->old_hash, 0, sizeof(wim_hash));
|
||||||
|
if (grub_memcmp(&patch->old_hash, search->hash.sha1, sizeof(wim_hash)) == 0)
|
||||||
|
{
|
||||||
|
debug("search hash all 0, now do deep search\n");
|
||||||
|
stream = (wim_stream_entry *)((char *)search + search->len);
|
||||||
|
for (i = 0; i < search->streams; i++)
|
||||||
|
{
|
||||||
|
if (stream->name_len == 0)
|
||||||
|
{
|
||||||
|
grub_memcpy(&patch->old_hash, stream->hash.sha1, sizeof(wim_hash));
|
||||||
|
debug("new search hash: %02x %02x %02x %02x %02x %02x %02x %02x\n",
|
||||||
|
ventoy_varg_8(patch->old_hash.sha1));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
stream = (wim_stream_entry *)((char *)stream + stream->len);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
grub_memcpy(&patch->old_hash, search->hash.sha1, sizeof(wim_hash));
|
||||||
|
}
|
||||||
|
|
||||||
debug("read lookup offset:%llu size:%llu\n", (ulonglong)head->lookup.offset, (ulonglong)head->lookup.raw_size);
|
debug("read lookup offset:%llu size:%llu\n", (ulonglong)head->lookup.offset, (ulonglong)head->lookup.raw_size);
|
||||||
lookup = grub_malloc(head->lookup.raw_size);
|
lookup = grub_malloc(head->lookup.raw_size);
|
||||||
@@ -1030,8 +1066,8 @@ static int ventoy_wimdows_locate_wim(const char *disk, wim_patch *patch)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
debug("failed to find lookup entry for replace file 0x%02x 0x%02x\n",
|
debug("failed to find lookup entry for replace file %02x %02x %02x %02x\n",
|
||||||
patch->old_hash.sha1[0], patch->old_hash.sha1[1]);
|
ventoy_varg_4(patch->old_hash.sha1));
|
||||||
}
|
}
|
||||||
|
|
||||||
wim_data->wim_raw_size = (grub_uint32_t)file->size;
|
wim_data->wim_raw_size = (grub_uint32_t)file->size;
|
||||||
|
@@ -267,6 +267,7 @@ typedef struct ventoy_grub_param
|
|||||||
int grub_ext_get_file_chunk(grub_uint64_t part_start, grub_file_t file, ventoy_img_chunk_list *chunk_list);
|
int grub_ext_get_file_chunk(grub_uint64_t part_start, grub_file_t file, ventoy_img_chunk_list *chunk_list);
|
||||||
int grub_fat_get_file_chunk(grub_uint64_t part_start, grub_file_t file, ventoy_img_chunk_list *chunk_list);
|
int grub_fat_get_file_chunk(grub_uint64_t part_start, grub_file_t file, ventoy_img_chunk_list *chunk_list);
|
||||||
void grub_iso9660_set_nojoliet(int nojoliet);
|
void grub_iso9660_set_nojoliet(int nojoliet);
|
||||||
|
int grub_iso9660_is_joliet(void);
|
||||||
grub_uint64_t grub_iso9660_get_last_read_pos(grub_file_t file);
|
grub_uint64_t grub_iso9660_get_last_read_pos(grub_file_t file);
|
||||||
grub_uint64_t grub_iso9660_get_last_file_dirent_pos(grub_file_t file);
|
grub_uint64_t grub_iso9660_get_last_file_dirent_pos(grub_file_t file);
|
||||||
grub_uint64_t grub_udf_get_file_offset(grub_file_t file);
|
grub_uint64_t grub_udf_get_file_offset(grub_file_t file);
|
||||||
|
@@ -121,6 +121,11 @@ elif [ "$VTOY_ARCH" = "i386" ]; then
|
|||||||
ln -s $VTOY_PATH/tool/dmsetup32 $VTOY_PATH/tool/dmsetup
|
ln -s $VTOY_PATH/tool/dmsetup32 $VTOY_PATH/tool/dmsetup
|
||||||
ln -s $VTOY_PATH/tool/lunzip32 $VTOY_PATH/tool/lunzip
|
ln -s $VTOY_PATH/tool/lunzip32 $VTOY_PATH/tool/lunzip
|
||||||
|
|
||||||
|
if uname -a | egrep -q 'x86_64|amd64'; then
|
||||||
|
echo "zstdcat use 64bit ..." >>$VTLOG
|
||||||
|
rm -f $VTOY_PATH/tool/zstdcat
|
||||||
|
ln -s $VTOY_PATH/tool/zstdcat64 $VTOY_PATH/tool/zstdcat
|
||||||
|
fi
|
||||||
elif [ "$VTOY_ARCH" = "mips64el" ]; then
|
elif [ "$VTOY_ARCH" = "mips64el" ]; then
|
||||||
echo "Use MIPS64 busybox toolkit ..." >>$VTLOG
|
echo "Use MIPS64 busybox toolkit ..." >>$VTLOG
|
||||||
ln -s $BUSYBOX_PATH/xzminidecm64e $BUSYBOX_PATH/xzminidec
|
ln -s $BUSYBOX_PATH/xzminidecm64e $BUSYBOX_PATH/xzminidec
|
||||||
|
@@ -41,18 +41,18 @@ ventoy_os_install_dmsetup() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# install md-modules
|
# install md-modules
|
||||||
LINE=$($GREP ' md-modules.*\.udeb' $VTOY_PATH/iso_file_list)
|
LINE=$($GREP -i ' md-modules.*\.udeb' $VTOY_PATH/iso_file_list)
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
LINTCNT=$($GREP -c ' md-modules.*\.udeb' $VTOY_PATH/iso_file_list)
|
LINTCNT=$($GREP -i -c ' md-modules.*\.udeb' $VTOY_PATH/iso_file_list)
|
||||||
if [ $LINTCNT -gt 1 ]; then
|
if [ $LINTCNT -gt 1 ]; then
|
||||||
vtlog "more than one pkgs, need to filter..."
|
vtlog "more than one pkgs, need to filter..."
|
||||||
VER=$($BUSYBOX_PATH/uname -r)
|
VER=$($BUSYBOX_PATH/uname -r)
|
||||||
|
|
||||||
LINE=$($GREP ' md-modules.*\.udeb' $VTOY_PATH/iso_file_list | $GREP $VER)
|
LINE=$($GREP -i ' md-modules.*\.udeb' $VTOY_PATH/iso_file_list | $GREP -i $VER)
|
||||||
LINTCNT=$($GREP ' md-modules.*\.udeb' $VTOY_PATH/iso_file_list | $GREP -c $VER)
|
LINTCNT=$($GREP -i ' md-modules.*\.udeb' $VTOY_PATH/iso_file_list | $GREP -i -c $VER)
|
||||||
if [ $LINTCNT -gt 1 ]; then
|
if [ $LINTCNT -gt 1 ]; then
|
||||||
vtlog "Still more than one pkgs, use the first one..."
|
vtlog "Still more than one pkgs, use the first one..."
|
||||||
LINE=$($GREP ' md-modules.*\.udeb' $VTOY_PATH/iso_file_list | $GREP -m1 $VER)
|
LINE=$($GREP -i ' md-modules.*\.udeb' $VTOY_PATH/iso_file_list | $GREP -i -m1 $VER)
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
install_udeb_from_line "$LINE" ${vt_usb_disk}
|
install_udeb_from_line "$LINE" ${vt_usb_disk}
|
||||||
|
42
IMG/cpio/ventoy/hook/suse/udev_setup_hook.sh
Normal file
42
IMG/cpio/ventoy/hook/suse/udev_setup_hook.sh
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
#!/ventoy/busybox/sh
|
||||||
|
#************************************************************************************
|
||||||
|
# Copyright (c) 2020, longpanda <admin@ventoy.net>
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU General Public License as
|
||||||
|
# published by the Free Software Foundation; either version 3 of the
|
||||||
|
# License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful, but
|
||||||
|
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
# General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||||
|
#
|
||||||
|
#************************************************************************************
|
||||||
|
|
||||||
|
. /ventoy/hook/ventoy-hook-lib.sh
|
||||||
|
|
||||||
|
wait_for_usb_disk_ready
|
||||||
|
|
||||||
|
vtdiskname=$(get_ventoy_disk_name)
|
||||||
|
if [ "$vtdiskname" = "unknown" ]; then
|
||||||
|
vtlog "ventoy disk not found"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
vtlog "wait_for_usb_disk_ready $vtdiskname ..."
|
||||||
|
|
||||||
|
if echo $vtdiskname | $EGREP -q "nvme|mmc|nbd"; then
|
||||||
|
vtpart2=${vtdiskname}p2
|
||||||
|
else
|
||||||
|
vtpart2=${vtdiskname}2
|
||||||
|
fi
|
||||||
|
|
||||||
|
/ventoy/busybox/sh /ventoy/hook/suse/udev_disk_hook.sh "${vtpart2#/dev/}"
|
||||||
|
|
||||||
|
if $GREP -q 'mediacheck=1' /proc/cmdline; then
|
||||||
|
ventoy_copy_device_mapper "${vtdiskname}"
|
||||||
|
fi
|
@@ -63,6 +63,9 @@ if [ -e /etc/initrd.functions ] && $GREP -q 'HPIP' /etc/initrd.functions; then
|
|||||||
$BUSYBOX_PATH/mknod -m 660 /dev/console b 5 1
|
$BUSYBOX_PATH/mknod -m 660 /dev/console b 5 1
|
||||||
$SED "/CD_DEVICES=/a $BUSYBOX_PATH/sh $VTOY_PATH/hook/suse/disk_hook.sh" -i /etc/initrd.functions
|
$SED "/CD_DEVICES=/a $BUSYBOX_PATH/sh $VTOY_PATH/hook/suse/disk_hook.sh" -i /etc/initrd.functions
|
||||||
$SED "/CD_DEVICES=/a CD_DEVICES=\"/dev/ventoy \$CD_DEVICES\"" -i /etc/initrd.functions
|
$SED "/CD_DEVICES=/a CD_DEVICES=\"/dev/ventoy \$CD_DEVICES\"" -i /etc/initrd.functions
|
||||||
|
elif [ -f /scripts/udev_setup ]; then
|
||||||
|
echo "udev_setup" >> $VTLOG
|
||||||
|
echo "/ventoy/busybox/sh /ventoy/hook/suse/udev_setup_hook.sh" >> /scripts/udev_setup
|
||||||
else
|
else
|
||||||
echo "SUSE" >> $VTLOG
|
echo "SUSE" >> $VTLOG
|
||||||
ventoy_systemd_udevd_work_around
|
ventoy_systemd_udevd_work_around
|
||||||
|
@@ -21,19 +21,19 @@ ln -s sbin/init linuxrc
|
|||||||
|
|
||||||
cd ventoy
|
cd ventoy
|
||||||
|
|
||||||
find ./loop | cpio -o -H newc>loop.cpio
|
find ./loop | cpio -o -H newc --owner=root:root >loop.cpio
|
||||||
xz loop.cpio
|
xz loop.cpio
|
||||||
rm -rf loop
|
rm -rf loop
|
||||||
|
|
||||||
xz ventoy_chain.sh
|
xz ventoy_chain.sh
|
||||||
xz ventoy_loop.sh
|
xz ventoy_loop.sh
|
||||||
|
|
||||||
find ./hook | cpio -o -H newc>hook.cpio
|
find ./hook | cpio -o -H newc --owner=root:root >hook.cpio
|
||||||
xz hook.cpio
|
xz hook.cpio
|
||||||
rm -rf hook
|
rm -rf hook
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
find .| cpio -o -H newc>../ventoy.cpio
|
find .| cpio -o -H newc --owner=root:root >../ventoy.cpio
|
||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
rm -rf cpio_tmp
|
rm -rf cpio_tmp
|
||||||
@@ -64,12 +64,12 @@ cp -a $VENTOY_PATH/LZIP/lunzip64 tool/
|
|||||||
|
|
||||||
chmod -R 777 ./tool
|
chmod -R 777 ./tool
|
||||||
|
|
||||||
find ./tool | cpio -o -H newc>tool.cpio
|
find ./tool | cpio -o -H newc --owner=root:root >tool.cpio
|
||||||
xz tool.cpio
|
xz tool.cpio
|
||||||
rm -rf tool
|
rm -rf tool
|
||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
find .| cpio -o -H newc>../ventoy_x86.cpio
|
find .| cpio -o -H newc --owner=root:root >../ventoy_x86.cpio
|
||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
rm -rf cpio_tmp
|
rm -rf cpio_tmp
|
||||||
@@ -95,12 +95,12 @@ cp -a $VENTOY_PATH/LZIP/lunzipaa64 tool/
|
|||||||
|
|
||||||
chmod -R 777 ./tool
|
chmod -R 777 ./tool
|
||||||
|
|
||||||
find ./tool | cpio -o -H newc>tool.cpio
|
find ./tool | cpio -o -H newc --owner=root:root >tool.cpio
|
||||||
xz tool.cpio
|
xz tool.cpio
|
||||||
rm -rf tool
|
rm -rf tool
|
||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
find .| cpio -o -H newc>../ventoy_arm64.cpio
|
find .| cpio -o -H newc --owner=root:root >../ventoy_arm64.cpio
|
||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
rm -rf cpio_tmp
|
rm -rf cpio_tmp
|
||||||
@@ -127,12 +127,12 @@ rm -f tool/vtoytool/00/vtoytool_aa64
|
|||||||
|
|
||||||
chmod -R 777 ./tool
|
chmod -R 777 ./tool
|
||||||
|
|
||||||
find ./tool | cpio -o -H newc>tool.cpio
|
find ./tool | cpio -o -H newc --owner=root:root >tool.cpio
|
||||||
xz tool.cpio
|
xz tool.cpio
|
||||||
rm -rf tool
|
rm -rf tool
|
||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
find .| cpio -o -H newc>../ventoy_mips64.cpio
|
find .| cpio -o -H newc --owner=root:root >../ventoy_mips64.cpio
|
||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
rm -rf cpio_tmp
|
rm -rf cpio_tmp
|
||||||
|
@@ -14,7 +14,7 @@ for dir in $(ls); do
|
|||||||
cd ..
|
cd ..
|
||||||
done
|
done
|
||||||
|
|
||||||
find . | cpio -o -H newc>../vtloopex.cpio
|
find . | cpio -o -H newc --owner=root:root >../vtloopex.cpio
|
||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
|
@@ -21,9 +21,6 @@ Please refer https://www.ventoy.net/en/doc_start.html for details.
|
|||||||
1. sudo sh VentoyWeb.sh
|
1. sudo sh VentoyWeb.sh
|
||||||
2. open your browser and visit http://127.0.0.1:24680
|
2. open your browser and visit http://127.0.0.1:24680
|
||||||
|
|
||||||
========== VentoyWebDeepin.sh ===============
|
|
||||||
1. sudo sh VentoyWebDeepin.sh
|
|
||||||
|
|
||||||
|
|
||||||
========== CreatePersistentImg.sh ===============
|
========== CreatePersistentImg.sh ===============
|
||||||
|
|
||||||
|
Binary file not shown.
@@ -45,6 +45,7 @@ if [ ! -f ./boot/boot.img ]; then
|
|||||||
if [ -d ./grub ]; then
|
if [ -d ./grub ]; then
|
||||||
echo "Don't run VentoyWeb.sh here, please download the released install package, and run the script in it."
|
echo "Don't run VentoyWeb.sh here, please download the released install package, and run the script in it."
|
||||||
else
|
else
|
||||||
|
echo "Current directory is $PWD"
|
||||||
echo "Please run under the correct directory!"
|
echo "Please run under the correct directory!"
|
||||||
fi
|
fi
|
||||||
exit 1
|
exit 1
|
||||||
|
@@ -40,6 +40,15 @@ submenu "Screen Display Mode" --class=debug_screen_mode --class=F5tool {
|
|||||||
|
|
||||||
if [ "$grub_platform" != "pc" ]; then
|
if [ "$grub_platform" != "pc" ]; then
|
||||||
submenu 'Ventoy UEFI Utilities' --class=debug_util --class=F5tool {
|
submenu 'Ventoy UEFI Utilities' --class=debug_util --class=F5tool {
|
||||||
|
menuentry 'Show EFI Drivers' --class=debug_util_efidrv --class=debug_util --class=F5tool {
|
||||||
|
vt_push_pager
|
||||||
|
chainloader ${vtoy_path}/vtoyutil_${VTOY_EFI_ARCH}.efi env_param=${env_param} ${vtdebug_flag} feature=show_efi_drivers
|
||||||
|
boot
|
||||||
|
vt_pop_pager
|
||||||
|
echo -e "\npress ENTER to exit ..."
|
||||||
|
read vtInputKey
|
||||||
|
}
|
||||||
|
|
||||||
menuentry 'Fixup Windows BlinitializeLibrary Failure' --class=debug_util_blinit --class=debug_util --class=F5tool {
|
menuentry 'Fixup Windows BlinitializeLibrary Failure' --class=debug_util_blinit --class=debug_util --class=F5tool {
|
||||||
chainloader ${vtoy_path}/vtoyutil_${VTOY_EFI_ARCH}.efi env_param=${env_param} ${vtdebug_flag} feature=fix_windows_mmap
|
chainloader ${vtoy_path}/vtoyutil_${VTOY_EFI_ARCH}.efi env_param=${env_param} ${vtdebug_flag} feature=fix_windows_mmap
|
||||||
boot
|
boot
|
||||||
|
@@ -130,6 +130,11 @@ function get_os_type {
|
|||||||
|
|
||||||
function vt_check_compatible_pe {
|
function vt_check_compatible_pe {
|
||||||
#Check for PE without external tools
|
#Check for PE without external tools
|
||||||
|
#set compatible if ISO file is less than 80MB
|
||||||
|
if [ $vt_chosen_size -gt 33554432 -a $vt_chosen_size -le 83886080 ]; then
|
||||||
|
set ventoy_compatible=YES
|
||||||
|
fi
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -159,7 +164,7 @@ function distro_specify_wim_patch {
|
|||||||
vt_windows_collect_wim_patch wim /BOOT/H3_7PE.WIM
|
vt_windows_collect_wim_patch wim /BOOT/H3_7PE.WIM
|
||||||
vt_windows_collect_wim_patch wim /BOOT/H3_8PE.WIM
|
vt_windows_collect_wim_patch wim /BOOT/H3_8PE.WIM
|
||||||
vt_windows_collect_wim_patch wim /BOOT/H3_81PE.WIM
|
vt_windows_collect_wim_patch wim /BOOT/H3_81PE.WIM
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function distro_specify_wim_patch_phase2 {
|
function distro_specify_wim_patch_phase2 {
|
||||||
@@ -548,6 +553,22 @@ function uefi_windows_menu_func {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function uefi_find_replace_initrd {
|
||||||
|
if vt_get_efi_vdisk_offset "${1}${2}" vt_efivdisk_offset; then
|
||||||
|
loopback -s $vt_efivdisk_offset vtefivdisk "${1}${2}"
|
||||||
|
|
||||||
|
unset vt_rp_initrd
|
||||||
|
vt_search_replace_initrd (vtefivdisk) vt_rp_initrd
|
||||||
|
|
||||||
|
if [ -n "$vt_rp_initrd" ]; then
|
||||||
|
vt_add_replace_file $3 "$vt_rp_initrd"
|
||||||
|
fi
|
||||||
|
|
||||||
|
loopback -d vtefivdisk
|
||||||
|
ventoy_debug_pause
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
function uefi_linux_menu_func {
|
function uefi_linux_menu_func {
|
||||||
|
|
||||||
if [ "$ventoy_compatible" = "NO" ]; then
|
if [ "$ventoy_compatible" = "NO" ]; then
|
||||||
@@ -629,6 +650,11 @@ function uefi_linux_menu_func {
|
|||||||
elif [ -f (loop)/loader/entries/pisi-efi-x86_64.conf ]; then
|
elif [ -f (loop)/loader/entries/pisi-efi-x86_64.conf ]; then
|
||||||
vt_add_replace_file $vtindex "EFI\\pisi\\initrd.img"
|
vt_add_replace_file $vtindex "EFI\\pisi\\initrd.img"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
vt_get_replace_file_cnt vt_replace_cnt
|
||||||
|
if [ $vt_replace_cnt -eq 0 ]; then
|
||||||
|
uefi_find_replace_initrd "$1" "$2" $vtindex
|
||||||
|
fi
|
||||||
elif [ -d (loop)/EFI/boot/entries ]; then
|
elif [ -d (loop)/EFI/boot/entries ]; then
|
||||||
if [ -f (loop)/parabola/boot/x86_64/parabolaiso.img ]; then
|
if [ -f (loop)/parabola/boot/x86_64/parabolaiso.img ]; then
|
||||||
vt_add_replace_file 0 "EFI\\parabolaiso\\parabolaiso.img"
|
vt_add_replace_file 0 "EFI\\parabolaiso\\parabolaiso.img"
|
||||||
@@ -900,7 +926,7 @@ function legacy_windows_menu_func {
|
|||||||
loopback loop "$1$2"
|
loopback loop "$1$2"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for file in "boot/bcd" "/efi/microsoft/boot/bcd" "SSTR/BCD"; do
|
for file in "boot/bcd" "/efi/microsoft/boot/bcd" "SSTR/BCD" "boot/bce"; do
|
||||||
vt_windows_collect_wim_patch bcd (loop)/$file
|
vt_windows_collect_wim_patch bcd (loop)/$file
|
||||||
done
|
done
|
||||||
|
|
||||||
@@ -940,6 +966,14 @@ function legacy_linux_menu_func {
|
|||||||
set ventoy_fs_probe=iso9660
|
set ventoy_fs_probe=iso9660
|
||||||
loopback loop "$1$2"
|
loopback loop "$1$2"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -f (loop)/isolinux/isolinux.cfg ]; then
|
||||||
|
if vt_iso9660_isjoliet; then
|
||||||
|
vt_iso9660_nojoliet 1
|
||||||
|
loopback -d loop
|
||||||
|
loopback loop "$1$2"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
vt_load_cpio $vtoy_path "$2" "$1" "busybox=$ventoy_busybox_ver"
|
vt_load_cpio $vtoy_path "$2" "$1" "busybox=$ventoy_busybox_ver"
|
||||||
|
|
||||||
@@ -1823,7 +1857,7 @@ function img_unsupport_menuentry {
|
|||||||
#############################################################
|
#############################################################
|
||||||
#############################################################
|
#############################################################
|
||||||
|
|
||||||
set VENTOY_VERSION="1.0.47"
|
set VENTOY_VERSION="1.0.50"
|
||||||
|
|
||||||
#ACPI not compatible with Window7/8, so disable by default
|
#ACPI not compatible with Window7/8, so disable by default
|
||||||
set VTOY_PARAM_NO_ACPI=1
|
set VTOY_PARAM_NO_ACPI=1
|
||||||
|
@@ -1,107 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
LOGFILE=log.txt
|
|
||||||
VUSER=$(get_user)
|
|
||||||
|
|
||||||
if which browser >/dev/null 2>&1; then
|
|
||||||
:
|
|
||||||
else
|
|
||||||
if [ "$LANG" = "zh_CN.UTF-8" ]; then
|
|
||||||
echo " Built-in browser not found in the system, please use VentoyWeb.sh ..."
|
|
||||||
else
|
|
||||||
echo " 未找到系统内置的 browser (卸载了?)请使用 VentoyWeb.sh ..."
|
|
||||||
fi
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
if [ -e $LOGFILE ]; then
|
|
||||||
chown $VUSER $LOGFILE
|
|
||||||
else
|
|
||||||
su $VUSER -c "touch $LOGFILE"
|
|
||||||
fi
|
|
||||||
|
|
||||||
#delete the log.txt if it's more than 8MB
|
|
||||||
if [ -f $LOGFILE ]; then
|
|
||||||
logsize=$(stat -c '%s' $LOGFILE)
|
|
||||||
if [ $logsize -gt 8388608 ]; then
|
|
||||||
rm -f $LOGFILE
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
if [ -f ./tool/$TOOLDIR/V2DServer.xz ]; then
|
|
||||||
xz -d ./tool/$TOOLDIR/V2DServer.xz
|
|
||||||
chmod +x ./tool/$TOOLDIR/V2DServer
|
|
||||||
fi
|
|
||||||
|
|
||||||
rm -rf ./*_VTMPDIR
|
|
||||||
vtWebTmpDir=$(mktemp -d -p ./ --suffix=_VTMPDIR)
|
|
||||||
chown $VUSER $vtWebTmpDir
|
|
||||||
|
|
||||||
|
|
||||||
V2DServer "$HOST" "$PORT" &
|
|
||||||
V2DPid=$!
|
|
||||||
sleep 1
|
|
||||||
|
|
||||||
su $VUSER -c "browser --window-size=550,400 --app=\"http://${HOST}:${PORT}/index.html?chrome-app\" --user-data-dir=$vtWebTmpDir >> $LOGFILE 2>&1" &
|
|
||||||
WebPid=$!
|
|
||||||
|
|
||||||
|
|
||||||
vtoy_trap_exit() {
|
|
||||||
|
|
||||||
[ -d /proc/$V2DPid ] && kill -2 $V2DPid
|
|
||||||
[ -d /proc/$WebPid ] && kill -9 $WebPid
|
|
||||||
|
|
||||||
while [ -n "1" ]; do
|
|
||||||
curPid=$(ps -ef | grep -m1 "$vtWebTmpDir" | egrep -v '\sgrep\s' | awk '{print $2}')
|
|
||||||
if [ -z "$curPid" ]; then
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -d /proc/$curPid ]; then
|
|
||||||
kill -9 $curPid
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
[ -d $vtWebTmpDir ] && rm -rf $vtWebTmpDir
|
|
||||||
|
|
||||||
if [ -n "$OLDDIR" ]; then
|
|
||||||
CURDIR=$(pwd)
|
|
||||||
if [ "$CURDIR" != "$OLDDIR" ]; then
|
|
||||||
cd "$OLDDIR"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
trap vtoy_trap_exit HUP INT QUIT TSTP
|
|
||||||
sleep 1
|
|
||||||
|
|
||||||
|
|
||||||
vtVer=$(cat ventoy/version)
|
|
||||||
echo ""
|
|
||||||
echo "=================================================="
|
|
||||||
if [ "$LANG" = "zh_CN.UTF-8" ]; then
|
|
||||||
echo " Ventoy Server $vtVer 已经启动 ..."
|
|
||||||
else
|
|
||||||
echo " Ventoy Server $vtVer is running ..."
|
|
||||||
fi
|
|
||||||
echo "=================================================="
|
|
||||||
echo ""
|
|
||||||
echo "########### Press Ctrl + C to exit ###############"
|
|
||||||
echo ""
|
|
||||||
|
|
||||||
wait $WebPid
|
|
||||||
|
|
||||||
[ -d /proc/$V2DPid ] && kill -2 $V2DPid
|
|
||||||
|
|
||||||
[ -d $vtWebTmpDir ] && rm -rf $vtWebTmpDir
|
|
||||||
|
|
||||||
if [ -n "$OLDDIR" ]; then
|
|
||||||
CURDIR=$(pwd)
|
|
||||||
if [ "$CURDIR" != "$OLDDIR" ]; then
|
|
||||||
cd "$OLDDIR"
|
|
||||||
fi
|
|
||||||
fi
|
|
@@ -1,68 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
LOGFILE=log.txt
|
|
||||||
|
|
||||||
#delete the log.txt if it's more than 8MB
|
|
||||||
if [ -f $LOGFILE ]; then
|
|
||||||
logsize=$(stat -c '%s' $LOGFILE)
|
|
||||||
if [ $logsize -gt 8388608 ]; then
|
|
||||||
rm -f $LOGFILE
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
if [ -f ./tool/$TOOLDIR/V2DServer.xz ]; then
|
|
||||||
xz -d ./tool/$TOOLDIR/V2DServer.xz
|
|
||||||
chmod +x ./tool/$TOOLDIR/V2DServer
|
|
||||||
fi
|
|
||||||
|
|
||||||
V2DServer "$HOST" "$PORT" &
|
|
||||||
V2DPid=$!
|
|
||||||
sleep 1
|
|
||||||
|
|
||||||
|
|
||||||
vtoy_trap_exit() {
|
|
||||||
|
|
||||||
[ -d /proc/$V2DPid ] && kill -2 $V2DPid
|
|
||||||
|
|
||||||
if [ -n "$OLDDIR" ]; then
|
|
||||||
CURDIR=$(pwd)
|
|
||||||
if [ "$CURDIR" != "$OLDDIR" ]; then
|
|
||||||
cd "$OLDDIR"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
trap vtoy_trap_exit HUP INT QUIT TSTP
|
|
||||||
sleep 1
|
|
||||||
|
|
||||||
|
|
||||||
vtVer=$(cat ventoy/version)
|
|
||||||
echo ""
|
|
||||||
echo "=================================================="
|
|
||||||
if [ "$LANG" = "zh_CN.UTF-8" ]; then
|
|
||||||
echo " Ventoy Server $vtVer 已经启动 ..."
|
|
||||||
else
|
|
||||||
echo " Ventoy Server $vtVer is running ..."
|
|
||||||
fi
|
|
||||||
echo "=================================================="
|
|
||||||
echo ""
|
|
||||||
echo "########### Press Ctrl + C to exit ###############"
|
|
||||||
echo ""
|
|
||||||
|
|
||||||
if [ "$VERBOSE" = "1" ]; then
|
|
||||||
uos-browser --window-size=550,400 --app="http://${HOST}:${PORT}/index.html?chrome-app"
|
|
||||||
else
|
|
||||||
uos-browser --window-size=550,400 --app="http://${HOST}:${PORT}/index.html?chrome-app" > /dev/null 2>&1
|
|
||||||
fi
|
|
||||||
|
|
||||||
[ -d /proc/$V2DPid ] && kill -2 $V2DPid
|
|
||||||
|
|
||||||
if [ -n "$OLDDIR" ]; then
|
|
||||||
CURDIR=$(pwd)
|
|
||||||
if [ "$CURDIR" != "$OLDDIR" ]; then
|
|
||||||
cd "$OLDDIR"
|
|
||||||
fi
|
|
||||||
fi
|
|
Binary file not shown.
Binary file not shown.
@@ -8,8 +8,7 @@ fi
|
|||||||
|
|
||||||
dos2unix -q ./tool/ventoy_lib.sh
|
dos2unix -q ./tool/ventoy_lib.sh
|
||||||
dos2unix -q ./tool/VentoyWorker.sh
|
dos2unix -q ./tool/VentoyWorker.sh
|
||||||
dos2unix -q ./tool/WebDeepin.sh
|
|
||||||
dos2unix -q ./tool/WebUos.sh
|
|
||||||
|
|
||||||
. ./tool/ventoy_lib.sh
|
. ./tool/ventoy_lib.sh
|
||||||
|
|
||||||
@@ -101,7 +100,7 @@ cp $OPT ./tool $tmpdir/
|
|||||||
rm -f $tmpdir/ENROLL_THIS_KEY_IN_MOKMANAGER.cer
|
rm -f $tmpdir/ENROLL_THIS_KEY_IN_MOKMANAGER.cer
|
||||||
cp $OPT Ventoy2Disk.sh $tmpdir/
|
cp $OPT Ventoy2Disk.sh $tmpdir/
|
||||||
cp $OPT VentoyWeb.sh $tmpdir/
|
cp $OPT VentoyWeb.sh $tmpdir/
|
||||||
cp $OPT VentoyWebDeepin.sh $tmpdir/
|
|
||||||
#cp $OPT Ventoy.desktop $tmpdir/
|
#cp $OPT Ventoy.desktop $tmpdir/
|
||||||
cp $OPT README $tmpdir/
|
cp $OPT README $tmpdir/
|
||||||
cp $OPT plugin $tmpdir/
|
cp $OPT plugin $tmpdir/
|
||||||
@@ -109,7 +108,7 @@ cp $OPT CreatePersistentImg.sh $tmpdir/
|
|||||||
cp $OPT ExtendPersistentImg.sh $tmpdir/
|
cp $OPT ExtendPersistentImg.sh $tmpdir/
|
||||||
dos2unix -q $tmpdir/Ventoy2Disk.sh
|
dos2unix -q $tmpdir/Ventoy2Disk.sh
|
||||||
dos2unix -q $tmpdir/VentoyWeb.sh
|
dos2unix -q $tmpdir/VentoyWeb.sh
|
||||||
dos2unix -q $tmpdir/VentoyWebDeepin.sh
|
|
||||||
#dos2unix -q $tmpdir/Ventoy.desktop
|
#dos2unix -q $tmpdir/Ventoy.desktop
|
||||||
dos2unix -q $tmpdir/CreatePersistentImg.sh
|
dos2unix -q $tmpdir/CreatePersistentImg.sh
|
||||||
dos2unix -q $tmpdir/ExtendPersistentImg.sh
|
dos2unix -q $tmpdir/ExtendPersistentImg.sh
|
||||||
@@ -143,7 +142,7 @@ find $tmpdir/ -type d -exec chmod 755 "{}" +
|
|||||||
find $tmpdir/ -type f -exec chmod 644 "{}" +
|
find $tmpdir/ -type f -exec chmod 644 "{}" +
|
||||||
chmod +x $tmpdir/Ventoy2Disk.sh
|
chmod +x $tmpdir/Ventoy2Disk.sh
|
||||||
chmod +x $tmpdir/VentoyWeb.sh
|
chmod +x $tmpdir/VentoyWeb.sh
|
||||||
chmod +x $tmpdir/VentoyWebDeepin.sh
|
|
||||||
#chmod +x $tmpdir/Ventoy.desktop
|
#chmod +x $tmpdir/Ventoy.desktop
|
||||||
chmod +x $tmpdir/CreatePersistentImg.sh
|
chmod +x $tmpdir/CreatePersistentImg.sh
|
||||||
chmod +x $tmpdir/ExtendPersistentImg.sh
|
chmod +x $tmpdir/ExtendPersistentImg.sh
|
||||||
|
@@ -54,13 +54,13 @@
|
|||||||
"name":"Korean (한국어)",
|
"name":"Korean (한국어)",
|
||||||
"FontFamily":"Courier New",
|
"FontFamily":"Courier New",
|
||||||
"FontSize":16,
|
"FontSize":16,
|
||||||
"Author":"Remiz,VenusGirl",
|
"Author":"VenusGirl",
|
||||||
|
|
||||||
"STR_ERROR":"오류",
|
"STR_ERROR":"오류",
|
||||||
"STR_WARNING":"경고",
|
"STR_WARNING":"경고",
|
||||||
"STR_INFO":"정보",
|
"STR_INFO":"정보",
|
||||||
"STR_INCORRECT_DIR":"올바른 디렉토리에서 실행하십시오!",
|
"STR_INCORRECT_DIR":"올바른 디렉토리에서 실행하십시오!",
|
||||||
"STR_INCORRECT_TREE_DIR":"여기서 저를 실행하지 말고, 출시된 설치 패키지를 다운로드한 다음 거기서 실행하십시오.",
|
"STR_INCORRECT_TREE_DIR":"여기서 실행하지 말고, 출시된 설치 패키지를 다운로드한 다음 거기서 실행하십시오.",
|
||||||
"STR_DEVICE":"장치",
|
"STR_DEVICE":"장치",
|
||||||
"STR_LOCAL_VER":"패키지의 Ventoy 버전",
|
"STR_LOCAL_VER":"패키지의 Ventoy 버전",
|
||||||
"STR_DISK_VER":"장치 내부의 Ventoy 버전",
|
"STR_DISK_VER":"장치 내부의 Ventoy 버전",
|
||||||
@@ -95,10 +95,10 @@
|
|||||||
"STR_WEB_SERVICE_UNAVAILABLE":"통신 오류: 서비스를 사용할 수 없음",
|
"STR_WEB_SERVICE_UNAVAILABLE":"통신 오류: 서비스를 사용할 수 없음",
|
||||||
"STR_WEB_TOKEN_MISMATCH":"데몬 상태가 업데이트되었습니다. 나중에 다시 시도하십시오.",
|
"STR_WEB_TOKEN_MISMATCH":"데몬 상태가 업데이트되었습니다. 나중에 다시 시도하십시오.",
|
||||||
"STR_WEB_SERVICE_BUSY":"서비스가 사용 중입니다. 나중에 다시 시도하십시오.",
|
"STR_WEB_SERVICE_BUSY":"서비스가 사용 중입니다. 나중에 다시 시도하십시오.",
|
||||||
"STR_MENU_VTSI_CREATE":"Generate VTSI File",
|
"STR_MENU_VTSI_CREATE":"VTSI 파일 생성",
|
||||||
"STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
|
"STR_VTSI_CREATE_TIP":"이번에는 장치에 쓰지 않고 VTSI 파일#@만 생성합니다.#@계속하시겠습니까?",
|
||||||
"STR_VTSI_CREATE_SUCCESS":"VTSI file created successfully!#@You can use Rufus(3.15+) to write it to the device so as to complete the installation of Ventoy.",
|
"STR_VTSI_CREATE_SUCCESS":"VTSI 파일이 성공적으로 생성되었습니다!#@Rufus(3.15+)를 사용하여 장치에 기록하여 Ventoy 설치를 완료할 수 있습니다.",
|
||||||
"STR_VTSI_CREATE_FAILED":"VTSI file created failed.",
|
"STR_VTSI_CREATE_FAILED":"VTSI 파일을 생성하지 못했습니다.",
|
||||||
"STRXXX":""
|
"STRXXX":""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -186,7 +186,7 @@
|
|||||||
"STR_SPACE_VAL_INVALID":"Invalid value for reserved space",
|
"STR_SPACE_VAL_INVALID":"Invalid value for reserved space",
|
||||||
"STR_MENU_CLEAR":"Clear Ventoy",
|
"STR_MENU_CLEAR":"Clear Ventoy",
|
||||||
"STR_CLEAR_SUCCESS":"Ventoy has been successfully removed from the device.",
|
"STR_CLEAR_SUCCESS":"Ventoy has been successfully removed from the device.",
|
||||||
"STR_CLEAR_FAILED":"An error occurred when clear Ventoy from disk. You can replug the USB and try again. Check log.txt for detail.",
|
"STR_CLEAR_FAILED":"An error occurred when clearing Ventoy from disk. You can replug the USB and try again. Check log.txt for details.",
|
||||||
"STR_MENU_PART_STYLE":"Partition Style",
|
"STR_MENU_PART_STYLE":"Partition Style",
|
||||||
"STR_DISK_2TB_MBR_ERROR":"Please select GPT for disk over 2TB",
|
"STR_DISK_2TB_MBR_ERROR":"Please select GPT for disk over 2TB",
|
||||||
"STR_SHOW_ALL_DEV":"Show All Devices",
|
"STR_SHOW_ALL_DEV":"Show All Devices",
|
||||||
@@ -401,10 +401,10 @@
|
|||||||
"STR_WEB_SERVICE_UNAVAILABLE":"Iletişim hatası: Uzaktan web erişim hizmeti erişilemez durumda",
|
"STR_WEB_SERVICE_UNAVAILABLE":"Iletişim hatası: Uzaktan web erişim hizmeti erişilemez durumda",
|
||||||
"STR_WEB_TOKEN_MISMATCH":"Daemon durumu güncellendi,lütfen daha sonra tekrar deneyiniz.",
|
"STR_WEB_TOKEN_MISMATCH":"Daemon durumu güncellendi,lütfen daha sonra tekrar deneyiniz.",
|
||||||
"STR_WEB_SERVICE_BUSY":"Hizmet meşgul, lütfen daha sonra tekrar deneyin.",
|
"STR_WEB_SERVICE_BUSY":"Hizmet meşgul, lütfen daha sonra tekrar deneyin.",
|
||||||
"STR_MENU_VTSI_CREATE":"Generate VTSI File",
|
"STR_MENU_VTSI_CREATE":"VTSI dosyası oluştur",
|
||||||
"STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
|
"STR_VTSI_CREATE_TIP":"Şu an cihaza yazılmayacak,sadece bir VTSI dosyası oluşturulacak#@Devam edilsin mi?",
|
||||||
"STR_VTSI_CREATE_SUCCESS":"VTSI file created successfully!#@You can use Rufus(3.15+) to write it to the device so as to complete the installation of Ventoy.",
|
"STR_VTSI_CREATE_SUCCESS":"VTSI dosyası başarılı bi şekilde oluşturuldu!#@Ventoy un cihaza kurulumunu tamamlamak için Rufus(3.15+) programını kullanabilirsiniz.",
|
||||||
"STR_VTSI_CREATE_FAILED":"VTSI file created failed.",
|
"STR_VTSI_CREATE_FAILED":"VTSI dosyası oluşturma Başarısız!",
|
||||||
"STRXXX":""
|
"STRXXX":""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -467,7 +467,7 @@
|
|||||||
"STR_ERROR":"Error",
|
"STR_ERROR":"Error",
|
||||||
"STR_WARNING":"Avertiment",
|
"STR_WARNING":"Avertiment",
|
||||||
"STR_INFO":"Info",
|
"STR_INFO":"Info",
|
||||||
"STR_INCORRECT_DIR":"Aqueste programa deu s’executar dins lo bon repertòri!",
|
"STR_INCORRECT_DIR":"Aqueste programa deu s’executar dins lo bon repertòri !",
|
||||||
"STR_INCORRECT_TREE_DIR":"Lancetz pas aquò, mercés de telecargar lo programa d’installacion e relançatz-lo.",
|
"STR_INCORRECT_TREE_DIR":"Lancetz pas aquò, mercés de telecargar lo programa d’installacion e relançatz-lo.",
|
||||||
"STR_DEVICE":"Periferic",
|
"STR_DEVICE":"Periferic",
|
||||||
"STR_LOCAL_VER":"Ventoy en local",
|
"STR_LOCAL_VER":"Ventoy en local",
|
||||||
@@ -475,10 +475,10 @@
|
|||||||
"STR_STATUS":"Estat - prèst",
|
"STR_STATUS":"Estat - prèst",
|
||||||
"STR_INSTALL":"Installacion",
|
"STR_INSTALL":"Installacion",
|
||||||
"STR_UPDATE":"Mesa a jorn",
|
"STR_UPDATE":"Mesa a jorn",
|
||||||
"STR_UPDATE_TIP":"La mesa a jorn es segura, los fichièrs ISO seràn pas modificats.#@Continhar ?",
|
"STR_UPDATE_TIP":"La mesa a jorn es segura, los fichièrs ISO seràn pas modificats.#@Continhar ?",
|
||||||
"STR_INSTALL_TIP":"Lo disc serà formatat e totas sas donadas seràn perdudas.#@Contunhar ?",
|
"STR_INSTALL_TIP":"Lo disc serà formatat e totas sas donadas seràn perdudas.#@Contunhar ?",
|
||||||
"STR_INSTALL_TIP2":"Lo disc serà formatat e totas sas donadas seràn perdudas.#@Contunhar ? (confirmacion)",
|
"STR_INSTALL_TIP2":"Lo disc serà formatat e totas sas donadas seràn perdudas.#@Contunhar ? (confirmacion)",
|
||||||
"STR_INSTALL_SUCCESS":"Felicitacions !#@Ventoy es estat corrèctament installat sul periferic.",
|
"STR_INSTALL_SUCCESS":"Felicitacion !#@Ventoy es estat corrèctament installat sul periferic.",
|
||||||
"STR_INSTALL_FAILED":"Una error s’es producha pendent l’installacion. Podètz tornar brancar lo periferic USB e tornar ensajar. Agachatz lo fichièr log.txt per ne saber mai.",
|
"STR_INSTALL_FAILED":"Una error s’es producha pendent l’installacion. Podètz tornar brancar lo periferic USB e tornar ensajar. Agachatz lo fichièr log.txt per ne saber mai.",
|
||||||
"STR_UPDATE_SUCCESS":"Felicitacions !#@Ventoy es estat corrèctament mes a jorn sul periferic.",
|
"STR_UPDATE_SUCCESS":"Felicitacions !#@Ventoy es estat corrèctament mes a jorn sul periferic.",
|
||||||
"STR_UPDATE_FAILED":"Una error s’es producha pendent la mesa a jorn. Podètz tornar brancar lo periferic USB e tornar ensajar. Agachatz lo fichièr log.txt per ne saber mai.",
|
"STR_UPDATE_FAILED":"Una error s’es producha pendent la mesa a jorn. Podètz tornar brancar lo periferic USB e tornar ensajar. Agachatz lo fichièr log.txt per ne saber mai.",
|
||||||
@@ -488,25 +488,25 @@
|
|||||||
"STR_MENU_PART_CFG":"Configuracion de particion",
|
"STR_MENU_PART_CFG":"Configuracion de particion",
|
||||||
"STR_BTN_OK":"OK",
|
"STR_BTN_OK":"OK",
|
||||||
"STR_BTN_CANCEL":"Anullar",
|
"STR_BTN_CANCEL":"Anullar",
|
||||||
"STR_PRESERVE_SPACE":"Preserve some space at the end of the disk",
|
"STR_PRESERVE_SPACE":"Servar d’espaci a la fin del disc",
|
||||||
"STR_SPACE_VAL_INVALID":"Valor invalida per l’espaci reservat",
|
"STR_SPACE_VAL_INVALID":"Valor invalida per l’espaci reservat",
|
||||||
"STR_MENU_CLEAR":"Escafar Ventoy",
|
"STR_MENU_CLEAR":"Escafar Ventoy",
|
||||||
"STR_CLEAR_SUCCESS":"Ventoy es estat corrèctament tirat del periferic.",
|
"STR_CLEAR_SUCCESS":"Ventoy es estat corrèctament tirat del periferic.",
|
||||||
"STR_CLEAR_FAILED":"Una error s’es producha pendent l’esfaçament de Ventoy del disc. Podètz tornar brancar l’USB e tornar ensajar. Vejatz log.txt pels detalhs.",
|
"STR_CLEAR_FAILED":"Una error s’es producha pendent l’esfaçament de Ventoy del disc. Podètz tornar brancar l’USB e tornar ensajar. Vejatz log.txt pels detalhs.",
|
||||||
"STR_MENU_PART_STYLE":"Estil de particion",
|
"STR_MENU_PART_STYLE":"Estil de particion",
|
||||||
"STR_DISK_2TB_MBR_ERROR":"Pels disques de mai de 2To seleccionatz GPT",
|
"STR_DISK_2TB_MBR_ERROR":"Pels disques de mai de 2 To seleccionatz GPT",
|
||||||
"STR_SHOW_ALL_DEV":"Mostrar totes los periferics",
|
"STR_SHOW_ALL_DEV":"Mostrar totes los periferics",
|
||||||
"STR_PART_ALIGN_4KB":"Alinhar las particions sus 4Ko",
|
"STR_PART_ALIGN_4KB":"Alinhar las particions sus 4 Ko",
|
||||||
"STR_WEB_COMMUNICATION_ERR":"Error de comunicacion :",
|
"STR_WEB_COMMUNICATION_ERR":"Error de comunicacion :",
|
||||||
"STR_WEB_REMOTE_ABNORMAL":"Error de comunicacion : remote abnormal",
|
"STR_WEB_REMOTE_ABNORMAL":"Error de comunicacion : remote abnormal",
|
||||||
"STR_WEB_REQUEST_TIMEOUT":"Error de comunicacion: requèsta tardièra",
|
"STR_WEB_REQUEST_TIMEOUT":"Error de comunicacion : requèsta tardièra",
|
||||||
"STR_WEB_SERVICE_UNAVAILABLE":"Error de comunicacion : servici pas disponible",
|
"STR_WEB_SERVICE_UNAVAILABLE":"Error de comunicacion : servici pas disponible",
|
||||||
"STR_WEB_TOKEN_MISMATCH":"Estat del Daemon actualizat, tornatz ensajar mai tard.",
|
"STR_WEB_TOKEN_MISMATCH":"Estat del Daemon actualizat, tornatz ensajar mai tard.",
|
||||||
"STR_WEB_SERVICE_BUSY":"Lo servici es ocupat, tornatz ensajar mai tard.",
|
"STR_WEB_SERVICE_BUSY":"Lo servici es ocupat, tornatz ensajar mai tard.",
|
||||||
"STR_MENU_VTSI_CREATE":"Generate VTSI File",
|
"STR_MENU_VTSI_CREATE":"Generar lo fichièr VTSI",
|
||||||
"STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
|
"STR_VTSI_CREATE_TIP":"Aqueste còp cap d’escritura al disc, generacion del fichiet VTSI sonque#@Contunhar ?",
|
||||||
"STR_VTSI_CREATE_SUCCESS":"VTSI file created successfully!#@You can use Rufus(3.15+) to write it to the device so as to complete the installation of Ventoy.",
|
"STR_VTSI_CREATE_SUCCESS":"VTSI file created successfully!#@You can use Rufus(3.15+) to write it to the device so as to complete the installation of Ventoy.",
|
||||||
"STR_VTSI_CREATE_FAILED":"VTSI file created failed.",
|
"STR_VTSI_CREATE_FAILED":"Fracàs de la creacion del fichièr VTSI.",
|
||||||
"STRXXX":""
|
"STRXXX":""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -639,7 +639,7 @@
|
|||||||
"STR_MENU_OPTION":"Opción",
|
"STR_MENU_OPTION":"Opción",
|
||||||
"STR_MENU_SECURE_BOOT":"Soporte De Arranque Seguro",
|
"STR_MENU_SECURE_BOOT":"Soporte De Arranque Seguro",
|
||||||
"STR_MENU_PART_CFG":"Configuración De Partición",
|
"STR_MENU_PART_CFG":"Configuración De Partición",
|
||||||
"STR_BTN_OK":"ACEPTAR",
|
"STR_BTN_OK":"Aceptar",
|
||||||
"STR_BTN_CANCEL":"Cancelar",
|
"STR_BTN_CANCEL":"Cancelar",
|
||||||
"STR_PRESERVE_SPACE":"Preservar algo de espacio al final del dispositivo",
|
"STR_PRESERVE_SPACE":"Preservar algo de espacio al final del dispositivo",
|
||||||
"STR_SPACE_VAL_INVALID":"Valor inválido para espacio reservado",
|
"STR_SPACE_VAL_INVALID":"Valor inválido para espacio reservado",
|
||||||
@@ -656,10 +656,10 @@
|
|||||||
"STR_WEB_SERVICE_UNAVAILABLE":"Error de comunicación: Servicio No Disponible",
|
"STR_WEB_SERVICE_UNAVAILABLE":"Error de comunicación: Servicio No Disponible",
|
||||||
"STR_WEB_TOKEN_MISMATCH":" Estado del daemon actualizado, por favor reintenta más tarde.",
|
"STR_WEB_TOKEN_MISMATCH":" Estado del daemon actualizado, por favor reintenta más tarde.",
|
||||||
"STR_WEB_SERVICE_BUSY":" El servicio está ocupado, por favor reintenta más tarde.",
|
"STR_WEB_SERVICE_BUSY":" El servicio está ocupado, por favor reintenta más tarde.",
|
||||||
"STR_MENU_VTSI_CREATE":"Generate VTSI File",
|
"STR_MENU_VTSI_CREATE":"Generar Archivo VTSI",
|
||||||
"STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
|
"STR_VTSI_CREATE_TIP":"Esta vez no se escribirá al dispositivo, pero solo generará un archivo VTSI#@¿Continuar?",
|
||||||
"STR_VTSI_CREATE_SUCCESS":"VTSI file created successfully!#@You can use Rufus(3.15+) to write it to the device so as to complete the installation of Ventoy.",
|
"STR_VTSI_CREATE_SUCCESS":"¡Archivo VTSI creado exitosamente!#@Puedes usar Rufus(3.15+) para escribirlo al dispositivo a fin de completar la instalación de Ventoy.",
|
||||||
"STR_VTSI_CREATE_FAILED":"VTSI file created failed.",
|
"STR_VTSI_CREATE_FAILED":"Fallo en el archivo VTSI creado.",
|
||||||
"STRXXX":""
|
"STRXXX":""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -824,12 +824,12 @@
|
|||||||
"STR_ERROR":"Fout",
|
"STR_ERROR":"Fout",
|
||||||
"STR_WARNING":"Waarschuwing",
|
"STR_WARNING":"Waarschuwing",
|
||||||
"STR_INFO":"Info",
|
"STR_INFO":"Info",
|
||||||
"STR_INCORRECT_DIR":"Voer Ventoy uit in de juiste directory!",
|
"STR_INCORRECT_DIR":"Voer Ventoy uit in de juiste map!",
|
||||||
"STR_INCORRECT_TREE_DIR":"Ventoy kan hier niet worden uitgevoerd. Download het installatiepakket en probeer Ventoy daarmee te starten.",
|
"STR_INCORRECT_TREE_DIR":"Ventoy kan hier niet worden uitgevoerd. Download het installatiepakket en probeer Ventoy daarmee te starten.",
|
||||||
"STR_DEVICE":"Apparaat",
|
"STR_DEVICE":"Apparaat",
|
||||||
"STR_LOCAL_VER":"Ventoy in pakket",
|
"STR_LOCAL_VER":"Ventoy in pakket",
|
||||||
"STR_DISK_VER":"Ventoy op apparaat",
|
"STR_DISK_VER":"Ventoy op apparaat",
|
||||||
"STR_STATUS":"Status - GEREED",
|
"STR_STATUS":"Status - KLAAR",
|
||||||
"STR_INSTALL":"Installeren",
|
"STR_INSTALL":"Installeren",
|
||||||
"STR_UPDATE":"Bijwerken",
|
"STR_UPDATE":"Bijwerken",
|
||||||
"STR_UPDATE_TIP":"Upgraden is veilig: ISO-bestanden blijven ongewijzigd.#@Doorgaan?",
|
"STR_UPDATE_TIP":"Upgraden is veilig: ISO-bestanden blijven ongewijzigd.#@Doorgaan?",
|
||||||
@@ -837,33 +837,33 @@
|
|||||||
"STR_INSTALL_TIP2":"De schijf wordt geformatteerd en alle gegevens gaan verloren.#@Doorgaan? (Dubbelcheck)",
|
"STR_INSTALL_TIP2":"De schijf wordt geformatteerd en alle gegevens gaan verloren.#@Doorgaan? (Dubbelcheck)",
|
||||||
"STR_INSTALL_SUCCESS":"Gefeliciteerd!#@Ventoy is met succes op het apparaat geïnstalleerd.",
|
"STR_INSTALL_SUCCESS":"Gefeliciteerd!#@Ventoy is met succes op het apparaat geïnstalleerd.",
|
||||||
"STR_INSTALL_FAILED":"Er is een fout opgetreden tijdens de installatie. U kunt het apparaat opnieuw aansluiten en het nogmaals proberen. Controleer log.txt voor details.",
|
"STR_INSTALL_FAILED":"Er is een fout opgetreden tijdens de installatie. U kunt het apparaat opnieuw aansluiten en het nogmaals proberen. Controleer log.txt voor details.",
|
||||||
"STR_UPDATE_SUCCESS":"Gefeliciteerd!#@Ventoy is succesvol bijgewerkt op het apparaat.",
|
"STR_UPDATE_SUCCESS":"Gefeliciteerd!#@Ventoy is met succes bijgewerkt op het apparaat.",
|
||||||
"STR_UPDATE_FAILED":"Er is een fout opgetreden tijdens de update. U kunt het apparaat opnieuw aansluiten en het nogmaals proberen. Controleer log.txt voor details.",
|
"STR_UPDATE_FAILED":"Er is een fout opgetreden tijdens de update. U kunt het apparaat opnieuw aansluiten en het nogmaals proberen. Controleer log.txt voor details.",
|
||||||
"STR_WAIT_PROCESS":"Ventoy is nog bezig, even geduld...",
|
"STR_WAIT_PROCESS":"Ventoy is nog bezig, even geduld...",
|
||||||
"STR_MENU_OPTION":"Opties",
|
"STR_MENU_OPTION":"Opties",
|
||||||
"STR_MENU_SECURE_BOOT":"Secure Boot",
|
"STR_MENU_SECURE_BOOT":"Ondersteuning voor Secure Boot",
|
||||||
"STR_MENU_PART_CFG":"Partitieconfiguratie",
|
"STR_MENU_PART_CFG":"Partitieconfiguratie",
|
||||||
"STR_BTN_OK":"OK",
|
"STR_BTN_OK":"Ok",
|
||||||
"STR_BTN_CANCEL":"Annuleren",
|
"STR_BTN_CANCEL":"Annuleren",
|
||||||
"STR_PRESERVE_SPACE":"Ruimte aan het einde van de schijf reserveren",
|
"STR_PRESERVE_SPACE":"Ruimte aan het einde van de schijf reserveren",
|
||||||
"STR_SPACE_VAL_INVALID":"Ongeldige waarde voor gereserveerde ruimte",
|
"STR_SPACE_VAL_INVALID":"Ongeldige waarde voor gereserveerde ruimte",
|
||||||
"STR_MENU_CLEAR":"Ventoy verwijderen",
|
"STR_MENU_CLEAR":"Ventoy verwijderen",
|
||||||
"STR_CLEAR_SUCCESS":"Ventoy is succesvol verwijderd van het apparaat.",
|
"STR_CLEAR_SUCCESS":"Ventoy is met succes verwijderd van het apparaat.",
|
||||||
"STR_CLEAR_FAILED":"Er is een fout opgetreden bij het verwijderen van Ventoy. U kunt het apparaat opnieuw aansluiten en het nogmaals proberen. Controleer log.txt voor details.",
|
"STR_CLEAR_FAILED":"Er is een fout opgetreden bij het verwijderen van Ventoy. U kunt het apparaat opnieuw aansluiten en het nogmaals proberen. Controleer log.txt voor details.",
|
||||||
"STR_MENU_PART_STYLE":"Partitietabel",
|
"STR_MENU_PART_STYLE":"Partitietabel",
|
||||||
"STR_DISK_2TB_MBR_ERROR":"Selecteer GPT als partitietabel voor schijven groter dan 2TB",
|
"STR_DISK_2TB_MBR_ERROR":"Selecteer GPT als partitietabel voor schijven groter dan 2 TB",
|
||||||
"STR_SHOW_ALL_DEV":"Toon alle apparaten",
|
"STR_SHOW_ALL_DEV":"Alle apparaten weergeven",
|
||||||
"STR_PART_ALIGN_4KB":"Lijn partities uit met 4KB",
|
"STR_PART_ALIGN_4KB":"Partities uitlijnen met 4 KB",
|
||||||
"STR_WEB_COMMUNICATION_ERR":"Communicatie fout:",
|
"STR_WEB_COMMUNICATION_ERR":"Communicatiefout:",
|
||||||
"STR_WEB_REMOTE_ABNORMAL":"Communicatiefout: abnormaal op afstand",
|
"STR_WEB_REMOTE_ABNORMAL":"Communicatiefout: extern abnormaal",
|
||||||
"STR_WEB_REQUEST_TIMEOUT":"Communicatiefout: time-out van verzoek",
|
"STR_WEB_REQUEST_TIMEOUT":"Communicatiefout: time-out van verzoek",
|
||||||
"STR_WEB_SERVICE_UNAVAILABLE":"Communicatiefout: service niet beschikbaar",
|
"STR_WEB_SERVICE_UNAVAILABLE":"Communicatiefout: service niet beschikbaar",
|
||||||
"STR_WEB_TOKEN_MISMATCH":"Daemon-status bijgewerkt, probeer het later opnieuw.",
|
"STR_WEB_TOKEN_MISMATCH":"Daemon-status bijgewerkt, probeer het later opnieuw.",
|
||||||
"STR_WEB_SERVICE_BUSY":"Service is bezet, probeer het later opnieuw.",
|
"STR_WEB_SERVICE_BUSY":"Service is bezet, probeer het later opnieuw.",
|
||||||
"STR_MENU_VTSI_CREATE":"Generate VTSI File",
|
"STR_MENU_VTSI_CREATE":"VTSI-bestand genereren",
|
||||||
"STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
|
"STR_VTSI_CREATE_TIP":"Deze keer wordt er niet naar het apparaat geschreven, maar wordt er alleen een VTSI-bestand gegenereerd#@Doorgaan?",
|
||||||
"STR_VTSI_CREATE_SUCCESS":"VTSI file created successfully!#@You can use Rufus(3.15+) to write it to the device so as to complete the installation of Ventoy.",
|
"STR_VTSI_CREATE_SUCCESS":"VTSI-bestand met succes aangemaakt!#@U kunt Rufus(3.15+) gebruiken om het bestand naar het apparaat te schrijven om de installatie van Ventoy te voltooien.",
|
||||||
"STR_VTSI_CREATE_FAILED":"VTSI file created failed.",
|
"STR_VTSI_CREATE_FAILED":"Aanmaken van VTSI-bestand mislukt.",
|
||||||
"STRXXX":""
|
"STRXXX":""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -1393,12 +1393,12 @@
|
|||||||
"STR_STATUS":"Trạng thái - SẴN SÀNG",
|
"STR_STATUS":"Trạng thái - SẴN SÀNG",
|
||||||
"STR_INSTALL":"Cài đặt",
|
"STR_INSTALL":"Cài đặt",
|
||||||
"STR_UPDATE":"Cập nhật",
|
"STR_UPDATE":"Cập nhật",
|
||||||
"STR_UPDATE_TIP":"Việc cập nhật Ventoy là an toàn, các tập tin ISO của bạn sẽ được giữ nguyên trạng.#@ Bạn thật sự muốn tiếp tục ?.",
|
"STR_UPDATE_TIP":"Việc cập nhật Ventoy là an toàn, các tập tin ISO của bạn sẽ được giữ nguyên trạng.#@Bạn thật sự muốn tiếp tục?",
|
||||||
"STR_INSTALL_TIP":"Thiết bị sẽ được định dạng và do đó TẤT CẢ DỮ LIỆU trên thiết bị sẽ bị mất.#@ Bạn thật sự muốn tiếp tục ?.",
|
"STR_INSTALL_TIP":"Thiết bị sẽ được định dạng và do đó TẤT CẢ DỮ LIỆU trên thiết bị sẽ bị mất.#@Bạn thật sự muốn tiếp tục?",
|
||||||
"STR_INSTALL_TIP2":"Thiết bị sẽ được định dạng và do đó TẤT CẢ DỮ LIỆU trên thiết bị sẽ bị mất.#@ Bạn thật sự muốn tiếp tục ?. (Xác nhận lần hai)",
|
"STR_INSTALL_TIP2":"Thiết bị sẽ được định dạng và do đó TẤT CẢ DỮ LIỆU trên thiết bị sẽ bị mất.#@Bạn thật sự muốn tiếp tục? (Xác nhận lần hai)",
|
||||||
"STR_INSTALL_SUCCESS":"Chúc mừng bạn !.#@ Thiết bị đã được cài Ventoy thành công.",
|
"STR_INSTALL_SUCCESS":"Chúc mừng bạn !.#@Thiết bị đã được cài Ventoy thành công.",
|
||||||
"STR_INSTALL_FAILED":"Đã xảy ra lỗi trong quá trình cài đặt Ventoy. Bạn có thể rút thiết bị ra và thử lại. Xem chi tiết ở tệp log.txt.",
|
"STR_INSTALL_FAILED":"Đã xảy ra lỗi trong quá trình cài đặt Ventoy. Bạn có thể rút thiết bị ra và thử lại. Xem chi tiết ở tệp log.txt.",
|
||||||
"STR_UPDATE_SUCCESS":"Chúc mừng bạn !.#@ Thiết bị đã được cập nhật Ventoy thành công.",
|
"STR_UPDATE_SUCCESS":"Chúc mừng bạn !.#@Thiết bị đã được cập nhật Ventoy thành công.",
|
||||||
"STR_UPDATE_FAILED":"Đã xảy ra lỗi trong quá trình cập nhật Ventoy. Bạn có thể rút thiết bị ra và thử lại. Xem chi tiết ở tệp log.txt.",
|
"STR_UPDATE_FAILED":"Đã xảy ra lỗi trong quá trình cập nhật Ventoy. Bạn có thể rút thiết bị ra và thử lại. Xem chi tiết ở tệp log.txt.",
|
||||||
"STR_WAIT_PROCESS":"Một luồng xử lý đang chạy, vui lòng chờ...",
|
"STR_WAIT_PROCESS":"Một luồng xử lý đang chạy, vui lòng chờ...",
|
||||||
"STR_MENU_OPTION":"Tùy chọn",
|
"STR_MENU_OPTION":"Tùy chọn",
|
||||||
@@ -1409,7 +1409,7 @@
|
|||||||
"STR_PRESERVE_SPACE":"Giữ lại phần dung lượng ở cuối thiết bị",
|
"STR_PRESERVE_SPACE":"Giữ lại phần dung lượng ở cuối thiết bị",
|
||||||
"STR_SPACE_VAL_INVALID":"Giá trị dung lượng giữ lại không hợp lệ.",
|
"STR_SPACE_VAL_INVALID":"Giá trị dung lượng giữ lại không hợp lệ.",
|
||||||
"STR_MENU_CLEAR":"Gỡ bỏ Ventoy",
|
"STR_MENU_CLEAR":"Gỡ bỏ Ventoy",
|
||||||
"STR_CLEAR_SUCCESS":"Chúc mừng bạn !.#@ Thiết bị đã được gỡ bỏ Ventoy thành công.",
|
"STR_CLEAR_SUCCESS":"Chúc mừng bạn !.#@Thiết bị đã được gỡ bỏ Ventoy thành công.",
|
||||||
"STR_CLEAR_FAILED":"Đã xảy ra lỗi trong quá trình gỡ bỏ Ventoy. Bạn có thể rút thiết bị ra và thử lại. Xem chi tiết ở tệp log.txt.",
|
"STR_CLEAR_FAILED":"Đã xảy ra lỗi trong quá trình gỡ bỏ Ventoy. Bạn có thể rút thiết bị ra và thử lại. Xem chi tiết ở tệp log.txt.",
|
||||||
"STR_MENU_PART_STYLE":"Kiểu phân vùng",
|
"STR_MENU_PART_STYLE":"Kiểu phân vùng",
|
||||||
"STR_DISK_2TB_MBR_ERROR":"Thiết bị có dung lượng lớn hơn 2TB. Vui lòng chọn Kiểu phân vùng là GPT.",
|
"STR_DISK_2TB_MBR_ERROR":"Thiết bị có dung lượng lớn hơn 2TB. Vui lòng chọn Kiểu phân vùng là GPT.",
|
||||||
@@ -1421,10 +1421,10 @@
|
|||||||
"STR_WEB_SERVICE_UNAVAILABLE":"Lỗi giao tiếp: Dịch vụ không sẵn có",
|
"STR_WEB_SERVICE_UNAVAILABLE":"Lỗi giao tiếp: Dịch vụ không sẵn có",
|
||||||
"STR_WEB_TOKEN_MISMATCH":"Đã cập nhật trạng thái Daemon, vui lòng thử lại sau.",
|
"STR_WEB_TOKEN_MISMATCH":"Đã cập nhật trạng thái Daemon, vui lòng thử lại sau.",
|
||||||
"STR_WEB_SERVICE_BUSY":"Dịch vụ bận, vui lòng thử lại sau.",
|
"STR_WEB_SERVICE_BUSY":"Dịch vụ bận, vui lòng thử lại sau.",
|
||||||
"STR_MENU_VTSI_CREATE":"Generate VTSI File",
|
"STR_MENU_VTSI_CREATE":"Tạo tệp VTSI",
|
||||||
"STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
|
"STR_VTSI_CREATE_TIP":"Lần này sẽ không ghi vào thiết bị, chỉ tạo một tệp VTSI#@Bạn muốn tiếp tục?",
|
||||||
"STR_VTSI_CREATE_SUCCESS":"VTSI file created successfully!#@You can use Rufus(3.15+) to write it to the device so as to complete the installation of Ventoy.",
|
"STR_VTSI_CREATE_SUCCESS":"Tạo tệp VTSI thành công!#@Để hoàn thành cài đặt Ventoy, bạn có thể dùng Rufus (3.15+) để ghi tệp này vào thiết bị.",
|
||||||
"STR_VTSI_CREATE_FAILED":"VTSI file created failed.",
|
"STR_VTSI_CREATE_FAILED":"Tạo tệp VTSI đã gặp lỗi.",
|
||||||
"STRXXX":""
|
"STRXXX":""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -1523,10 +1523,10 @@
|
|||||||
"STR_WEB_SERVICE_UNAVAILABLE":"Комуникациска грешка: Недостапен сервис",
|
"STR_WEB_SERVICE_UNAVAILABLE":"Комуникациска грешка: Недостапен сервис",
|
||||||
"STR_WEB_TOKEN_MISMATCH":"Ажуриран статус на даемонот, молиме обидете се подоцна.",
|
"STR_WEB_TOKEN_MISMATCH":"Ажуриран статус на даемонот, молиме обидете се подоцна.",
|
||||||
"STR_WEB_SERVICE_BUSY":"Сервисот е зафатен, молиме обидете се подоцна.",
|
"STR_WEB_SERVICE_BUSY":"Сервисот е зафатен, молиме обидете се подоцна.",
|
||||||
"STR_MENU_VTSI_CREATE":"Generate VTSI File",
|
"STR_MENU_VTSI_CREATE":"Генерирај VTSI датотека",
|
||||||
"STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
|
"STR_VTSI_CREATE_TIP":"Овој пат ништо нема да се запише на уредот туку само ќе се генерира VTSI датотека#@Продолжи?",
|
||||||
"STR_VTSI_CREATE_SUCCESS":"VTSI file created successfully!#@You can use Rufus(3.15+) to write it to the device so as to complete the installation of Ventoy.",
|
"STR_VTSI_CREATE_SUCCESS":"Успешно креирана VTSI датотека!#@Можете да го користите Rufus(3.15+) за да ја запишете на уредот како и да ја комплетирате инсталацијата на Ventoy.",
|
||||||
"STR_VTSI_CREATE_FAILED":"VTSI file created failed.",
|
"STR_VTSI_CREATE_FAILED":"Креирањето на VTSI датотека е неуспешно.",
|
||||||
"STRXXX":""
|
"STRXXX":""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -1669,17 +1669,17 @@
|
|||||||
"STR_MENU_PART_STYLE":"Gaya Partisi",
|
"STR_MENU_PART_STYLE":"Gaya Partisi",
|
||||||
"STR_DISK_2TB_MBR_ERROR":"Silakan pilih GPT untuk disk yang lebih dari 2TB",
|
"STR_DISK_2TB_MBR_ERROR":"Silakan pilih GPT untuk disk yang lebih dari 2TB",
|
||||||
"STR_SHOW_ALL_DEV":"Show All Devices",
|
"STR_SHOW_ALL_DEV":"Show All Devices",
|
||||||
"STR_PART_ALIGN_4KB":"Align partitions with 4KB",
|
"STR_PART_ALIGN_4KB":"Meluruskan dengan partisi 4KB",
|
||||||
"STR_WEB_COMMUNICATION_ERR":"Communication error:",
|
"STR_WEB_COMMUNICATION_ERR":"Kesalahan komunikasi:",
|
||||||
"STR_WEB_REMOTE_ABNORMAL":"Communication error: remote abnormal",
|
"STR_WEB_REMOTE_ABNORMAL":"Kesalahan komunikasi: tidak normalnya kendali",
|
||||||
"STR_WEB_REQUEST_TIMEOUT":"Communication error: Request timed out",
|
"STR_WEB_REQUEST_TIMEOUT":"Kesalahan komunikasi: Waktu permintaan habis",
|
||||||
"STR_WEB_SERVICE_UNAVAILABLE":"Communication error: Service Unavailable",
|
"STR_WEB_SERVICE_UNAVAILABLE":"Kesalahan komunikasi: Layanan tidak tersedia",
|
||||||
"STR_WEB_TOKEN_MISMATCH":"Daemon status updated, please retry later.",
|
"STR_WEB_TOKEN_MISMATCH":"Status daemon diperbarui, silakan coba lagi nanti.",
|
||||||
"STR_WEB_SERVICE_BUSY":"Service is busy, please retry later.",
|
"STR_WEB_SERVICE_BUSY":"Layanan sedang sibuk, silakan coba lagi nanti.",
|
||||||
"STR_MENU_VTSI_CREATE":"Generate VTSI File",
|
"STR_MENU_VTSI_CREATE":"Membuat berkas VTSI",
|
||||||
"STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
|
"STR_VTSI_CREATE_TIP":"Saat ini tidak akan menuliskan di perangkat, tetapi hanya membuat berkas VTSI #@Lanjutkan?",
|
||||||
"STR_VTSI_CREATE_SUCCESS":"VTSI file created successfully!#@You can use Rufus(3.15+) to write it to the device so as to complete the installation of Ventoy.",
|
"STR_VTSI_CREATE_SUCCESS":"Berkas VTSI berhasil dibuat#@Anda bisa menggunakan Rufus(3.15+) untuk menulisnya ke perangkat untuk menyelesaikan instalasi Ventoy.",
|
||||||
"STR_VTSI_CREATE_FAILED":"VTSI file created failed.",
|
"STR_VTSI_CREATE_FAILED":"Berkas VTSI gagal dibuat.",
|
||||||
"STRXXX":""
|
"STRXXX":""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -1885,5 +1885,107 @@
|
|||||||
"STR_VTSI_CREATE_SUCCESS":"VTSI file created successfully!#@You can use Rufus(3.15+) to write it to the device so as to complete the installation of Ventoy.",
|
"STR_VTSI_CREATE_SUCCESS":"VTSI file created successfully!#@You can use Rufus(3.15+) to write it to the device so as to complete the installation of Ventoy.",
|
||||||
"STR_VTSI_CREATE_FAILED":"VTSI file created failed.",
|
"STR_VTSI_CREATE_FAILED":"VTSI file created failed.",
|
||||||
"STRXXX":""
|
"STRXXX":""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name":"Bulgarian (Български)",
|
||||||
|
"FontFamily":"Courier New",
|
||||||
|
"FontSize":16,
|
||||||
|
"Author":"jekovcar",
|
||||||
|
|
||||||
|
"STR_ERROR":"Грешка",
|
||||||
|
"STR_WARNING":"Предупреждение",
|
||||||
|
"STR_INFO":"Информация",
|
||||||
|
"STR_INCORRECT_DIR":"Моля, стартирайте в друга директория!",
|
||||||
|
"STR_INCORRECT_TREE_DIR":"Не ме стартирайте оттук, моля, изтеглете инсталационен пакет и го стартирайте в друго място.",
|
||||||
|
"STR_DEVICE":"Устройство",
|
||||||
|
"STR_LOCAL_VER":"Ventoy в пакета",
|
||||||
|
"STR_DISK_VER":"Ventoy на устройството",
|
||||||
|
"STR_STATUS":"Статус - ГОТОВ",
|
||||||
|
"STR_INSTALL":"Инсталирай",
|
||||||
|
"STR_UPDATE":"Обнови",
|
||||||
|
"STR_UPDATE_TIP":"Обновяването е безопасно, ISO-файловете няма да се променят.#@Продължаваме?",
|
||||||
|
"STR_INSTALL_TIP":"Диска ще се форматира и всички данни изтрият.#@Продължаваме?",
|
||||||
|
"STR_INSTALL_TIP2":"Диска ще се форматира и всички данни изтрият..#@ДЕЙСТВИТЕЛНО ще продължите?",
|
||||||
|
"STR_INSTALL_SUCCESS":"Поздрави!#@Ventoy бе успешно инсталиран на устройството.",
|
||||||
|
"STR_INSTALL_FAILED":"По време на инсталирането на Ventoy възникна грешка. Подсъединете устройството и опитайте отново. Проверете log.txt за грешки.",
|
||||||
|
"STR_UPDATE_SUCCESS":"Поздрави!#@Ventoy бе успешно обновен на устройството.",
|
||||||
|
"STR_UPDATE_FAILED":"По време на обновяването на Ventoy възникна грешка. Подсъединете устройството и опитайте отново. Проверете log.txt за грешки.",
|
||||||
|
"STR_WAIT_PROCESS":"Процеса е стартиран, моля изчакайте...",
|
||||||
|
"STR_MENU_OPTION":"Опции",
|
||||||
|
"STR_MENU_SECURE_BOOT":"Поддръжка на Secure Boot",
|
||||||
|
"STR_MENU_PART_CFG":"Допълнителен дял",
|
||||||
|
"STR_BTN_OK":"ОК",
|
||||||
|
"STR_BTN_CANCEL":"Отказ",
|
||||||
|
"STR_PRESERVE_SPACE":"Създай Допълнителен дял в края на диска",
|
||||||
|
"STR_SPACE_VAL_INVALID":"Неправилен размер на дяла",
|
||||||
|
"STR_MENU_CLEAR":"Изтрий Ventoy",
|
||||||
|
"STR_CLEAR_SUCCESS":"Ventoy бе успешно изтрит от устройството.",
|
||||||
|
"STR_CLEAR_FAILED":"По време на изтриването на Ventoy възникна грешка. Подсъединете устройството и опитайте отново. Проверете log.txt за грешки.",
|
||||||
|
"STR_MENU_PART_STYLE":"Стил на оразмеряване на дяловете",
|
||||||
|
"STR_DISK_2TB_MBR_ERROR":"Моля, изберете GPT за дискове по-големи от 2ТБ",
|
||||||
|
"STR_SHOW_ALL_DEV":"Покажи всички устройства",
|
||||||
|
"STR_PART_ALIGN_4KB":"Подравни дяловете с размер 4КБ",
|
||||||
|
"STR_WEB_COMMUNICATION_ERR":"Грешка при свързване:",
|
||||||
|
"STR_WEB_REMOTE_ABNORMAL":"Грешка при свързване: Отдалечената връзка е недействителна",
|
||||||
|
"STR_WEB_REQUEST_TIMEOUT":"Грешка при свързване: Изтекло време за изчакване на заявката",
|
||||||
|
"STR_WEB_SERVICE_UNAVAILABLE":"Грешка при свързване: Службата е недостъпна",
|
||||||
|
"STR_WEB_TOKEN_MISMATCH":"Статуса на агента е обновен. Повторете по-късно.",
|
||||||
|
"STR_WEB_SERVICE_BUSY":"Службата е заета, Повторете по-късно.",
|
||||||
|
"STR_MENU_VTSI_CREATE":"Generate VTSI File",
|
||||||
|
"STR_VTSI_CREATE_TIP":"Сега няма да се записва на диска, само ще се генерира VTSI файл#@Продължаваме?",
|
||||||
|
"STR_VTSI_CREATE_SUCCESS":"VTSI файла бе създаден успешно!#@Може да използвате Rufus(3.15+) да го запишете на устройството за инсталацията с Ventoy.",
|
||||||
|
"STR_VTSI_CREATE_FAILED":"VTSI файла създаване се провали.",
|
||||||
|
"STRXXX":""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name":"Armenian (Հայերեն)",
|
||||||
|
"FontFamily":"Courier New",
|
||||||
|
"FontSize":16,
|
||||||
|
"Author":"Egho",
|
||||||
|
|
||||||
|
"STR_ERROR":"Սխալ",
|
||||||
|
"STR_WARNING":"Զգուշացում",
|
||||||
|
"STR_INFO":"Տեղեկություն",
|
||||||
|
"STR_INCORRECT_DIR":"Խնդրում ենք գործարկել ճիշտ թղթախանակում!",
|
||||||
|
"STR_INCORRECT_TREE_DIR":"Չգործարկել այստեղ, խնդրում եմ ներբեռնեք թողարկված տեղադրման փաթեթը և գործարկել այնտեղ:",
|
||||||
|
"STR_DEVICE":"Կրիչը",
|
||||||
|
"STR_LOCAL_VER":"Ventoy-ը փաթեթում",
|
||||||
|
"STR_DISK_VER":"Ventoy-ը կրիչում",
|
||||||
|
"STR_STATUS":"Կարգավիճակ - ՊԱՏՐԱՍՏ",
|
||||||
|
"STR_INSTALL":"Տեղադրել",
|
||||||
|
"STR_UPDATE":"Թարմացնել",
|
||||||
|
"STR_UPDATE_TIP":"Թարմացման գործողությունը անվտանգ է, ISO ֆայլերը կմնան անփոփոխ.#@Շարունակել?",
|
||||||
|
"STR_INSTALL_TIP":"Սկավառակը կձևաչափվի և բոլոր տվյալները կկորչեն.#@Շարունակել?",
|
||||||
|
"STR_INSTALL_TIP2":"Սկավառակը կձևաչափվի և բոլոր տվյալները կկորչեն:#@Դուք համոզված եք, մաքրել կրիչը? (Double Check)",
|
||||||
|
"STR_INSTALL_SUCCESS":"Շնորհավորում ենք!#@Ventoy- ը հաջողությամբ տեղադրվել է կրիչում:",
|
||||||
|
"STR_INSTALL_FAILED":"Տեղադրման ընթացքում տեղի ունեցավ սխալ: Կարող եք նորից միացնել USB- կրիչը և կրկին փորձել: Մանրամասների համար ստուգել log.txt-ը ",
|
||||||
|
"STR_UPDATE_SUCCESS":"Շնորհավորում ենք!#@Ventoy-ը հաջողությամբ թարմացվեց կրիչում:",
|
||||||
|
"STR_UPDATE_FAILED":"Թարմացման ընթացքում տեղի ունեցավ սխալ: Կարող եք նորից միացնել USB- կրիչը և կրկին փորձել: Մանրամասների համար ստուգել log.txt-ը ",
|
||||||
|
"STR_WAIT_PROCESS":"Աշխատանքն ընթանում, խնդրում ենք սպասել...",
|
||||||
|
"STR_MENU_OPTION":"Ընտրանքներ",
|
||||||
|
"STR_MENU_SECURE_BOOT":"Secure Boot աջակցություն",
|
||||||
|
"STR_MENU_PART_CFG":"Partition կազմաձևում",
|
||||||
|
"STR_BTN_OK":"Այո",
|
||||||
|
"STR_BTN_CANCEL":"Չեղարկել",
|
||||||
|
"STR_PRESERVE_SPACE":"Պահպանեք որոշակի տարածք կրիչի վերջում",
|
||||||
|
"STR_SPACE_VAL_INVALID":"Պահված տարածքի անվավեր արժեք",
|
||||||
|
"STR_MENU_CLEAR":"Մաքրել Ventoy-ը",
|
||||||
|
"STR_CLEAR_SUCCESS":"Ventoy-ը հաջողությամբ հեռացված է կրիչից:",
|
||||||
|
"STR_CLEAR_FAILED":"Ventoy-ը կրիչից մաքրելիս տեղի ունեցավ սխալ: Կարող եք նորից միացնել USB-կրիչը և կրկին փորձել: Մանրամասների համար ստուգել log.txt-ը",
|
||||||
|
"STR_MENU_PART_STYLE":"Partition-ի տեսակը",
|
||||||
|
"STR_DISK_2TB_MBR_ERROR":"Խնդրում ենք ընտրել GPT 2TB-ից մեծ կրիչի դեպքում",
|
||||||
|
"STR_SHOW_ALL_DEV":"Ցուցադրել բոլոր կրիչները",
|
||||||
|
"STR_PART_ALIGN_4KB":"partition-երը գծանշել 4KB-ով",
|
||||||
|
"STR_WEB_COMMUNICATION_ERR":"Համակցման սխալ․",
|
||||||
|
"STR_WEB_REMOTE_ABNORMAL":"Համակցման սխալ․ Հեռահար համակցումն չստացվեց",
|
||||||
|
"STR_WEB_REQUEST_TIMEOUT":"Համակցման սխալ․: Սպասման ժամանակը սպառվեց",
|
||||||
|
"STR_WEB_SERVICE_UNAVAILABLE":"Համակցման սխալ․: Ծառայությունը անհասանելի է",
|
||||||
|
"STR_WEB_TOKEN_MISMATCH":"Թարմացվել է Demon-ի կարգավիճակը, խնդրում եմ նորից փորձել ավելի ուշ:",
|
||||||
|
"STR_WEB_SERVICE_BUSY":"Ծառայությունը զբաղված է, խնդրում եմ նորից փորձել ավելի ուշ:",
|
||||||
|
"STR_MENU_VTSI_CREATE":"Ստեղծել VTSI ֆայլ",
|
||||||
|
"STR_VTSI_CREATE_TIP":"Այս անգամ չի գրվի կրիչի վրա, այլ միայն կստեղծվի VTSI ֆայլ#@Շարունակել?",
|
||||||
|
"STR_VTSI_CREATE_SUCCESS":"VTSI ֆայլը հաջողությամբ ստեղծվեց!#@Դուք կարող եք օգտագործել Rufus (3.15+) կրիչում ձայնագրելու համար, որպեսզի ավարտեք Ventoy-ի տեղադրումը:",
|
||||||
|
"STR_VTSI_CREATE_FAILED":"VTSI ֆայլի ստեղծումը ձախողվեց։",
|
||||||
|
"STRXXX":""
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@@ -16,7 +16,7 @@ You can copy many image files at a time and ventoy will give you a boot menu to
|
|||||||
x86 Legacy BIOS, IA32 UEFI, x86_64 UEFI, ARM64 UEFI and MIPS64EL UEFI are supported in the same way.<br/>
|
x86 Legacy BIOS, IA32 UEFI, x86_64 UEFI, ARM64 UEFI and MIPS64EL UEFI are supported in the same way.<br/>
|
||||||
Both MBR and GPT partition style are supported in the same way.<br/>
|
Both MBR and GPT partition style are supported in the same way.<br/>
|
||||||
Most type of OS supported(Windows/WinPE/Linux/Unix/Vmware/Xen...) <br/>
|
Most type of OS supported(Windows/WinPE/Linux/Unix/Vmware/Xen...) <br/>
|
||||||
700+ ISO files are tested (<a href="https://www.ventoy.net/en/isolist.html">List</a>). 90%+ distros in <a href="https://distrowatch.com/">distrowatch.com</a> supported. <br/>
|
720+ ISO files are tested (<a href="https://www.ventoy.net/en/isolist.html">List</a>). 90%+ distros in <a href="https://distrowatch.com/">distrowatch.com</a> supported. <br/>
|
||||||
<br/>Official Website: <a href=https://www.ventoy.net>https://www.ventoy.net</a>
|
<br/>Official Website: <a href=https://www.ventoy.net>https://www.ventoy.net</a>
|
||||||
</h4>
|
</h4>
|
||||||
|
|
||||||
@@ -36,7 +36,7 @@ Most type of OS supported(Windows/WinPE/Linux/Unix/Vmware/Xen...) <br/>
|
|||||||
* FAT32/exFAT/NTFS/UDF/XFS/Ext2(3)(4) supported for main partition
|
* FAT32/exFAT/NTFS/UDF/XFS/Ext2(3)(4) supported for main partition
|
||||||
* ISO files larger than 4GB supported
|
* ISO files larger than 4GB supported
|
||||||
* Native boot menu style for Legacy & UEFI
|
* Native boot menu style for Legacy & UEFI
|
||||||
* Most type of OS supported, 700+ iso files tested
|
* Most type of OS supported, 720+ iso files tested
|
||||||
* Linux vDisk boot supported
|
* Linux vDisk boot supported
|
||||||
* Not only boot but also complete installation process
|
* Not only boot but also complete installation process
|
||||||
* Menu dynamically switchable between List/TreeView mode
|
* Menu dynamically switchable between List/TreeView mode
|
||||||
@@ -57,7 +57,7 @@ Most type of OS supported(Windows/WinPE/Linux/Unix/Vmware/Xen...) <br/>
|
|||||||
See [https://www.ventoy.net/en/doc_start.html](https://www.ventoy.net/en/doc_start.html) for detail
|
See [https://www.ventoy.net/en/doc_start.html](https://www.ventoy.net/en/doc_start.html) for detail
|
||||||
|
|
||||||
# Compile Instructions
|
# Compile Instructions
|
||||||
Please refer to [BuildVentoyFromSource.txt](https://github.com/ventoy/Ventoy/blob/master/DOC/BuildVentoyFromSource.txt)
|
Please refer to [BuildVentoyFromSource.txt](DOC/BuildVentoyFromSource.txt)
|
||||||
|
|
||||||
# Document
|
# Document
|
||||||
Title | Link
|
Title | Link
|
||||||
|
@@ -230,19 +230,24 @@ BOOL DeletePartitions(DWORD DriveIndex, BOOL OnlyPart2)
|
|||||||
Log("* Partition %d (offset: %lld, size: %llu)", prop_array[i].ulPartitionNumber,
|
Log("* Partition %d (offset: %lld, size: %llu)", prop_array[i].ulPartitionNumber,
|
||||||
prop_array[i].ullOffset, (ULONGLONG)prop_array[i].ullSize);
|
prop_array[i].ullOffset, (ULONGLONG)prop_array[i].ullSize);
|
||||||
|
|
||||||
if (OnlyPart2 && prop_array[i].ullOffset == 2048*512)
|
if (OnlyPart2)
|
||||||
{
|
{
|
||||||
Log("Skip this partition...");
|
if (prop_array[i].ullOffset == 2048 * 512 || prop_array[i].ullSize != 32 * 1024 * 1024)
|
||||||
continue;
|
{
|
||||||
|
Log("Skip this partition...");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
hr = IVdsAdvancedDisk_DeletePartition(pAdvancedDisk, prop_array[i].ullOffset, TRUE, TRUE);
|
hr = IVdsAdvancedDisk_DeletePartition(pAdvancedDisk, prop_array[i].ullOffset, TRUE, TRUE);
|
||||||
if (hr != S_OK) {
|
if (hr != S_OK) {
|
||||||
r = FALSE;
|
r = FALSE;
|
||||||
VDS_SET_ERROR(hr);
|
VDS_SET_ERROR(hr);
|
||||||
Log("Could not delete partitions: %u", LASTERR);
|
Log("Could not delete partitions: %u", LASTERR);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
Log("Delete this partitions success");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
r = TRUE;
|
r = TRUE;
|
||||||
}
|
}
|
||||||
@@ -1592,8 +1597,14 @@ int InstallVentoy2FileImage(PHY_DRIVE_INFO *pPhyDrive, int PartStyle)
|
|||||||
unxz(ImgBuf, Len, NULL, NULL, pData, &dataLen, unxz_error);
|
unxz(ImgBuf, Len, NULL, NULL, pData, &dataLen, unxz_error);
|
||||||
SAFE_FREE(ImgBuf);
|
SAFE_FREE(ImgBuf);
|
||||||
|
|
||||||
|
Log("decompress %s len:%d", VENTOY_FILE_STG1_IMG, dataLen);
|
||||||
|
|
||||||
if (PartStyle)
|
if (PartStyle)
|
||||||
{
|
{
|
||||||
|
pData[500] = 35;//update blocklist
|
||||||
|
memmove(pData + 34 * 512, pData, SIZE_1MB - 512 * 34);
|
||||||
|
memset(pData, 0, 34 * 512);
|
||||||
|
|
||||||
pGptInfo = (VTOY_GPT_INFO *)pData;
|
pGptInfo = (VTOY_GPT_INFO *)pData;
|
||||||
memset(pGptInfo, 0, sizeof(VTOY_GPT_INFO));
|
memset(pGptInfo, 0, sizeof(VTOY_GPT_INFO));
|
||||||
VentoyFillGpt(pPhyDrive->SizeInBytes, pGptInfo);
|
VentoyFillGpt(pPhyDrive->SizeInBytes, pGptInfo);
|
||||||
@@ -1613,6 +1624,9 @@ int InstallVentoy2FileImage(PHY_DRIVE_INFO *pPhyDrive, int PartStyle)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
memmove(pData + 512, pData, SIZE_1MB - 512);
|
||||||
|
memset(pData, 0, 512);
|
||||||
|
|
||||||
pMBR = (MBR_HEAD *)pData;
|
pMBR = (MBR_HEAD *)pData;
|
||||||
VentoyFillMBR(pPhyDrive->SizeInBytes, pMBR, PartStyle);
|
VentoyFillMBR(pPhyDrive->SizeInBytes, pMBR, PartStyle);
|
||||||
Part1StartSector = pMBR->PartTbl[0].StartSectorId;
|
Part1StartSector = pMBR->PartTbl[0].StartSectorId;
|
||||||
@@ -1654,7 +1668,9 @@ int InstallVentoy2FileImage(PHY_DRIVE_INFO *pPhyDrive, int PartStyle)
|
|||||||
}
|
}
|
||||||
|
|
||||||
Log("Writing stage1 data ............................. ");
|
Log("Writing stage1 data ............................. ");
|
||||||
|
|
||||||
fwrite(pData, 1, SIZE_1MB, fp);
|
fwrite(pData, 1, SIZE_1MB, fp);
|
||||||
|
|
||||||
pSegment[0].disk_start_sector = 0;
|
pSegment[0].disk_start_sector = 0;
|
||||||
pSegment[0].sector_num = SIZE_1MB / 512;
|
pSegment[0].sector_num = SIZE_1MB / 512;
|
||||||
pSegment[0].data_offset = data_offset;
|
pSegment[0].data_offset = data_offset;
|
||||||
|
@@ -291,7 +291,7 @@ void disk_io_set_imghook(FILE *fp, VTSI_SEGMENT *segment, int maxseg, UINT64 dat
|
|||||||
void disk_io_reset_imghook(int *psegnum, UINT64 *pDataOffset);
|
void disk_io_reset_imghook(int *psegnum, UINT64 *pDataOffset);
|
||||||
|
|
||||||
|
|
||||||
#define VTSI_SUPPORT 0
|
#define VTSI_SUPPORT 1
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Binary file not shown.
@@ -202,7 +202,7 @@ DRESULT disk_write (
|
|||||||
LARGE_INTEGER liCurrentPosition;
|
LARGE_INTEGER liCurrentPosition;
|
||||||
VTSI_SEGMENT *CurSeg = NULL;
|
VTSI_SEGMENT *CurSeg = NULL;
|
||||||
|
|
||||||
Log("==== disk_write: sector:%ld count:%ld", (long)sector, (long)count);
|
//Log("==== disk_write: sector:%ld count:%ld", (long)sector, (long)count);
|
||||||
|
|
||||||
// skip MBR
|
// skip MBR
|
||||||
if (sector == 0)
|
if (sector == 0)
|
||||||
|
BIN
VtoyTool/vtoytool/01/vtoytool_64
Normal file
BIN
VtoyTool/vtoytool/01/vtoytool_64
Normal file
Binary file not shown.
@@ -33,6 +33,19 @@ static ventoy_windows_data g_windows_data;
|
|||||||
static UINT8 g_os_param_reserved[32];
|
static UINT8 g_os_param_reserved[32];
|
||||||
static BOOL g_64bit_system = FALSE;
|
static BOOL g_64bit_system = FALSE;
|
||||||
static ventoy_guid g_ventoy_guid = VENTOY_GUID;
|
static ventoy_guid g_ventoy_guid = VENTOY_GUID;
|
||||||
|
static HANDLE g_vtoylog_mutex = NULL;
|
||||||
|
static HANDLE g_vtoyins_mutex = NULL;
|
||||||
|
|
||||||
|
//Unicode "CmdLine"
|
||||||
|
static BOOL g_PecmdHasCmdLine = FALSE;
|
||||||
|
static UCHAR g_aucCmdLineHex[] =
|
||||||
|
{
|
||||||
|
0x43, 0x00, 0x6D, 0x00, 0x64, 0x00, 0x4C, 0x00, 0x69, 0x00, 0x6E, 0x00, 0x65, 0x00
|
||||||
|
};
|
||||||
|
|
||||||
|
#define VTOY_PID_FILE "X:\\Windows\\System32\\pidventoy"
|
||||||
|
#define MUTEX_LOCK(hmutex) if (hmutex != NULL) LockStatus = WaitForSingleObject(hmutex, INFINITE)
|
||||||
|
#define MUTEX_UNLOCK(hmutex) if (hmutex != NULL && WAIT_OBJECT_0 == LockStatus) ReleaseMutex(hmutex)
|
||||||
|
|
||||||
void Log(const char *Fmt, ...)
|
void Log(const char *Fmt, ...)
|
||||||
{
|
{
|
||||||
@@ -41,25 +54,31 @@ void Log(const char *Fmt, ...)
|
|||||||
FILE *File = NULL;
|
FILE *File = NULL;
|
||||||
SYSTEMTIME Sys;
|
SYSTEMTIME Sys;
|
||||||
char szBuf[1024];
|
char szBuf[1024];
|
||||||
|
DWORD LockStatus = 0;
|
||||||
|
DWORD PID = GetCurrentProcessId();
|
||||||
|
|
||||||
GetLocalTime(&Sys);
|
GetLocalTime(&Sys);
|
||||||
Len += sprintf_s(szBuf, sizeof(szBuf),
|
Len += sprintf_s(szBuf, sizeof(szBuf),
|
||||||
"[%4d/%02d/%02d %02d:%02d:%02d.%03d] ",
|
"[%4d/%02d/%02d %02d:%02d:%02d.%03d] [%u] ",
|
||||||
Sys.wYear, Sys.wMonth, Sys.wDay,
|
Sys.wYear, Sys.wMonth, Sys.wDay,
|
||||||
Sys.wHour, Sys.wMinute, Sys.wSecond,
|
Sys.wHour, Sys.wMinute, Sys.wSecond,
|
||||||
Sys.wMilliseconds);
|
Sys.wMilliseconds, PID);
|
||||||
|
|
||||||
va_start(Arg, Fmt);
|
va_start(Arg, Fmt);
|
||||||
Len += vsnprintf_s(szBuf + Len, sizeof(szBuf)-Len, sizeof(szBuf)-Len, Fmt, Arg);
|
Len += vsnprintf_s(szBuf + Len, sizeof(szBuf)-Len, sizeof(szBuf)-Len, Fmt, Arg);
|
||||||
va_end(Arg);
|
va_end(Arg);
|
||||||
|
|
||||||
fopen_s(&File, "ventoy.log", "a+");
|
MUTEX_LOCK(g_vtoylog_mutex);
|
||||||
if (File)
|
|
||||||
{
|
fopen_s(&File, "ventoy.log", "a+");
|
||||||
fwrite(szBuf, 1, Len, File);
|
if (File)
|
||||||
fwrite("\n", 1, 1, File);
|
{
|
||||||
fclose(File);
|
fwrite(szBuf, 1, Len, File);
|
||||||
}
|
fwrite("\n", 1, 1, File);
|
||||||
|
fclose(File);
|
||||||
|
}
|
||||||
|
|
||||||
|
MUTEX_UNLOCK(g_vtoylog_mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -760,23 +779,13 @@ int VentoyMountISOByImdisk(const char *IsoPath, DWORD PhyDrive)
|
|||||||
HANDLE hDrive;
|
HANDLE hDrive;
|
||||||
CHAR PhyPath[MAX_PATH];
|
CHAR PhyPath[MAX_PATH];
|
||||||
WCHAR PhyPathW[MAX_PATH];
|
WCHAR PhyPathW[MAX_PATH];
|
||||||
STARTUPINFOA Si;
|
|
||||||
PROCESS_INFORMATION Pi;
|
PROCESS_INFORMATION Pi;
|
||||||
GET_LENGTH_INFORMATION LengthInfo;
|
GET_LENGTH_INFORMATION LengthInfo;
|
||||||
|
|
||||||
Log("VentoyMountISOByImdisk %s", IsoPath);
|
Log("VentoyMountISOByImdisk %s", IsoPath);
|
||||||
|
|
||||||
sprintf_s(PhyPath, sizeof(PhyPath), "\\\\.\\PhysicalDrive%d", PhyDrive);
|
sprintf_s(PhyPath, sizeof(PhyPath), "\\\\.\\PhysicalDrive%d", PhyDrive);
|
||||||
if (IsUTF8Encode(PhyPath))
|
hDrive = CreateFileA(PhyPath, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, 0, OPEN_EXISTING, 0, 0);
|
||||||
{
|
|
||||||
Utf8ToUtf16(PhyPath, PhyPathW);
|
|
||||||
hDrive = CreateFileW(PhyPathW, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, 0, OPEN_EXISTING, 0, 0);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
hDrive = CreateFileA(PhyPath, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, 0, OPEN_EXISTING, 0, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (hDrive == INVALID_HANDLE_VALUE)
|
if (hDrive == INVALID_HANDLE_VALUE)
|
||||||
{
|
{
|
||||||
Log("Could not open the disk<%s>, error:%u", PhyPath, GetLastError());
|
Log("Could not open the disk<%s>, error:%u", PhyPath, GetLastError());
|
||||||
@@ -820,16 +829,33 @@ int VentoyMountISOByImdisk(const char *IsoPath, DWORD PhyDrive)
|
|||||||
rc = 0;
|
rc = 0;
|
||||||
|
|
||||||
Letter = GetMountLogicalDrive();
|
Letter = GetMountLogicalDrive();
|
||||||
sprintf_s(PhyPath, sizeof(PhyPath), "ventoy\\imdisk.exe -a -o ro -f %s -m %C:", IsoPath, Letter);
|
sprintf_s(PhyPath, sizeof(PhyPath), "ventoy\\imdisk.exe -a -o ro -f \"%s\" -m %C:", IsoPath, Letter);
|
||||||
|
Log("mount iso to %C: use imdisk cmd <%s>", Letter, PhyPath);
|
||||||
|
|
||||||
Log("mount iso to %C: use imdisk cmd <%s>", Letter, PhyPath);
|
if (IsUTF8Encode(IsoPath))
|
||||||
|
{
|
||||||
|
STARTUPINFOW Si;
|
||||||
|
GetStartupInfoW(&Si);
|
||||||
|
Si.dwFlags |= STARTF_USESHOWWINDOW;
|
||||||
|
Si.wShowWindow = SW_HIDE;
|
||||||
|
|
||||||
GetStartupInfoA(&Si);
|
Utf8ToUtf16(PhyPath, PhyPathW);
|
||||||
|
CreateProcessW(NULL, PhyPathW, NULL, NULL, FALSE, 0, NULL, NULL, &Si, &Pi);
|
||||||
|
|
||||||
Si.dwFlags |= STARTF_USESHOWWINDOW;
|
Log("This is UTF8 encoding");
|
||||||
Si.wShowWindow = SW_HIDE;
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
STARTUPINFOA Si;
|
||||||
|
GetStartupInfoA(&Si);
|
||||||
|
Si.dwFlags |= STARTF_USESHOWWINDOW;
|
||||||
|
Si.wShowWindow = SW_HIDE;
|
||||||
|
|
||||||
|
CreateProcessA(NULL, PhyPath, NULL, NULL, FALSE, 0, NULL, NULL, &Si, &Pi);
|
||||||
|
|
||||||
|
Log("This is ANSI encoding");
|
||||||
|
}
|
||||||
|
|
||||||
CreateProcessA(NULL, PhyPath, NULL, NULL, FALSE, 0, NULL, NULL, &Si, &Pi);
|
|
||||||
WaitForSingleObject(Pi.hProcess, INFINITE);
|
WaitForSingleObject(Pi.hProcess, INFINITE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1304,12 +1330,51 @@ End:
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int ventoy_check_create_directory(void)
|
||||||
|
{
|
||||||
|
if (IsDirExist("ventoy"))
|
||||||
|
{
|
||||||
|
Log("ventoy directory already exist");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Log("ventoy directory not exist, now create it.");
|
||||||
|
if (!CreateDirectoryA("ventoy", NULL))
|
||||||
|
{
|
||||||
|
Log("Failed to create ventoy directory err:%u", GetLastError());
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static BOOL VentoyFindCmdLineStr(BYTE *buf, DWORD size)
|
||||||
|
{
|
||||||
|
DWORD i = 0;
|
||||||
|
UINT32 uiDataChk;
|
||||||
|
UINT32 uiDataHex = *(UINT32 *)(g_aucCmdLineHex);
|
||||||
|
|
||||||
|
for (i = 0; i < size - sizeof(g_aucCmdLineHex); i += 16)
|
||||||
|
{
|
||||||
|
uiDataChk = *(UINT32 *)(buf + i);
|
||||||
|
if (uiDataChk == uiDataHex && memcmp(buf + i, g_aucCmdLineHex, sizeof(g_aucCmdLineHex)) == 0)
|
||||||
|
{
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
int VentoyJump(INT argc, CHAR **argv, CHAR *LunchFile)
|
int VentoyJump(INT argc, CHAR **argv, CHAR *LunchFile)
|
||||||
{
|
{
|
||||||
int rc = 1;
|
int rc = 1;
|
||||||
|
int stat = 0;
|
||||||
DWORD Pos;
|
DWORD Pos;
|
||||||
DWORD PeStart;
|
DWORD PeStart;
|
||||||
DWORD FileSize;
|
DWORD FileSize;
|
||||||
|
DWORD LockStatus = 0;
|
||||||
BYTE *Buffer = NULL;
|
BYTE *Buffer = NULL;
|
||||||
CHAR ExeFileName[MAX_PATH];
|
CHAR ExeFileName[MAX_PATH];
|
||||||
|
|
||||||
@@ -1330,19 +1395,14 @@ int VentoyJump(INT argc, CHAR **argv, CHAR *LunchFile)
|
|||||||
g_64bit_system = IsPe64(Buffer);
|
g_64bit_system = IsPe64(Buffer);
|
||||||
Log("VentoyJump %dbit", g_64bit_system ? 64 : 32);
|
Log("VentoyJump %dbit", g_64bit_system ? 64 : 32);
|
||||||
|
|
||||||
if (IsDirExist("ventoy"))
|
MUTEX_LOCK(g_vtoyins_mutex);
|
||||||
|
stat = ventoy_check_create_directory();
|
||||||
|
MUTEX_UNLOCK(g_vtoyins_mutex);
|
||||||
|
|
||||||
|
if (stat != 0)
|
||||||
{
|
{
|
||||||
Log("ventoy directory already exist");
|
goto End;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
Log("ventoy directory not exist, now create it.");
|
|
||||||
if (!CreateDirectoryA("ventoy", NULL))
|
|
||||||
{
|
|
||||||
Log("Failed to create ventoy directory err:%u", GetLastError());
|
|
||||||
goto End;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (PeStart = 0; PeStart < FileSize; PeStart += 16)
|
for (PeStart = 0; PeStart < FileSize; PeStart += 16)
|
||||||
{
|
{
|
||||||
@@ -1373,14 +1433,25 @@ int VentoyJump(INT argc, CHAR **argv, CHAR *LunchFile)
|
|||||||
PeStart += sizeof(ventoy_os_param) + sizeof(ventoy_windows_data);
|
PeStart += sizeof(ventoy_os_param) + sizeof(ventoy_windows_data);
|
||||||
sprintf_s(LunchFile, MAX_PATH, "ventoy\\%s", GetFileNameInPath(ExeFileName));
|
sprintf_s(LunchFile, MAX_PATH, "ventoy\\%s", GetFileNameInPath(ExeFileName));
|
||||||
|
|
||||||
|
MUTEX_LOCK(g_vtoyins_mutex);
|
||||||
if (IsFileExist("%s", LunchFile))
|
if (IsFileExist("%s", LunchFile))
|
||||||
{
|
{
|
||||||
Log("vtoyjump multiple call...");
|
Log("vtoyjump multiple call ...");
|
||||||
rc = 0;
|
rc = 0;
|
||||||
|
MUTEX_UNLOCK(g_vtoyins_mutex);
|
||||||
goto End;
|
goto End;
|
||||||
}
|
}
|
||||||
|
|
||||||
SaveBuffer2File(LunchFile, Buffer + PeStart, FileSize - PeStart);
|
SaveBuffer2File(LunchFile, Buffer + PeStart, FileSize - PeStart);
|
||||||
|
MUTEX_UNLOCK(g_vtoyins_mutex);
|
||||||
|
|
||||||
|
#ifdef VTOY_REJUMP_SUPPORTED
|
||||||
|
if (_stricmp(LunchFile, "ventoy\\PECMD.EXE") == 0)
|
||||||
|
{
|
||||||
|
g_PecmdHasCmdLine = VentoyFindCmdLineStr(Buffer + PeStart, FileSize - PeStart);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1410,150 +1481,131 @@ End:
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int GetPecmdParam(const char *argv, char *CallParamBuf, DWORD BufLen)
|
|
||||||
|
|
||||||
|
static int ventoy_append_process_id(const char *pidfile)
|
||||||
{
|
{
|
||||||
HKEY hKey;
|
DWORD PID = 0;
|
||||||
LSTATUS Ret;
|
FILE *fp = NULL;
|
||||||
DWORD dw;
|
|
||||||
DWORD Type;
|
|
||||||
CHAR *Pos = NULL;
|
|
||||||
CHAR CallParam[256] = { 0 };
|
|
||||||
CHAR FileName[MAX_PATH];
|
|
||||||
|
|
||||||
Log("GetPecmdParam <%s>", argv);
|
PID = GetCurrentProcessId();
|
||||||
|
|
||||||
*CallParamBuf = 0;
|
fopen_s(&fp, pidfile, "a+");
|
||||||
|
if (!fp)
|
||||||
strcpy_s(FileName, sizeof(FileName), argv);
|
|
||||||
for (dw = 0, Pos = FileName; *Pos; Pos++)
|
|
||||||
{
|
{
|
||||||
dw++;
|
|
||||||
*Pos = toupper(*Pos);
|
|
||||||
}
|
|
||||||
|
|
||||||
Log("dw=%lu argv=<%s>", dw, FileName);
|
|
||||||
|
|
||||||
if (dw >= 9 && strcmp(FileName + dw - 9, "PECMD.EXE") == 0)
|
|
||||||
{
|
|
||||||
Log("Get parameters for pecmd.exe");
|
|
||||||
Ret = RegCreateKeyEx(HKEY_LOCAL_MACHINE, "System\\Setup", 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, &dw);
|
|
||||||
if (ERROR_SUCCESS == Ret)
|
|
||||||
{
|
|
||||||
memset(FileName, 0, sizeof(FileName));
|
|
||||||
dw = sizeof(FileName);
|
|
||||||
Ret = RegQueryValueEx(hKey, "CmdLine", NULL, &Type, FileName, &dw);
|
|
||||||
if (ERROR_SUCCESS == Ret && Type == REG_SZ)
|
|
||||||
{
|
|
||||||
strcpy_s(CallParam, sizeof(CallParam), FileName);
|
|
||||||
Log("CmdLine:<%s>", CallParam);
|
|
||||||
|
|
||||||
if (_strnicmp(CallParam, "PECMD.EXE", 9) == 0)
|
|
||||||
{
|
|
||||||
Pos = CallParam + 9;
|
|
||||||
if (*Pos == ' ' || *Pos == '\t')
|
|
||||||
{
|
|
||||||
Pos++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Pos = CallParam;
|
|
||||||
}
|
|
||||||
|
|
||||||
Log("CmdLine2:<%s>", Pos);
|
|
||||||
sprintf_s(CallParamBuf, BufLen, " %s", Pos);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Log("Failed to RegQueryValueEx %lu %lu", Ret, Type);
|
|
||||||
}
|
|
||||||
|
|
||||||
RegCloseKey(hKey);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Log("Failed to create reg key %lu", Ret);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Log("This is NOT pecmd.exe");
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int GetWpeInitParam(char **argv, int argc, char *CallParamBuf, DWORD BufLen)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
DWORD dw;
|
|
||||||
CHAR *Pos = NULL;
|
|
||||||
CHAR FileName[MAX_PATH];
|
|
||||||
|
|
||||||
Log("GetWpeInitParam argc=%d", argc);
|
|
||||||
|
|
||||||
*CallParamBuf = 0;
|
|
||||||
|
|
||||||
strcpy_s(FileName, sizeof(FileName), argv[0]);
|
|
||||||
for (dw = 0, Pos = FileName; *Pos; Pos++)
|
|
||||||
{
|
|
||||||
dw++;
|
|
||||||
*Pos = toupper(*Pos);
|
|
||||||
}
|
|
||||||
|
|
||||||
Log("dw=%lu argv=<%s>", dw, FileName);
|
|
||||||
|
|
||||||
if (dw >= 11 && strcmp(FileName + dw - 11, "WPEINIT.EXE") == 0)
|
|
||||||
{
|
|
||||||
Log("Get parameters for WPEINIT.EXE");
|
|
||||||
for (i = 1; i < argc; i++)
|
|
||||||
{
|
|
||||||
strcat_s(CallParamBuf, BufLen, " ");
|
|
||||||
strcat_s(CallParamBuf, BufLen, argv[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
fprintf_s(fp, "%u\n", PID);
|
||||||
Log("This is NOT wpeinit.exe");
|
|
||||||
}
|
fclose(fp);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int ventoy_get_instance_id(const char *pidfile)
|
||||||
|
{
|
||||||
|
int instance = 0;
|
||||||
|
FILE *fp = NULL;
|
||||||
|
char line[256];
|
||||||
|
|
||||||
|
fopen_s(&fp, pidfile, "r");
|
||||||
|
if (!fp)
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
while (fgets(line, sizeof(line), fp))
|
||||||
|
{
|
||||||
|
instance++;
|
||||||
|
}
|
||||||
|
|
||||||
|
fclose(fp);
|
||||||
|
return instance + 1;
|
||||||
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
CHAR *Pos = NULL;
|
int id = 0;
|
||||||
CHAR CurDir[MAX_PATH];
|
BOOL ReJump = FALSE;
|
||||||
CHAR LunchFile[MAX_PATH];
|
CHAR *Pos = NULL;
|
||||||
|
CHAR CurDir[MAX_PATH];
|
||||||
|
CHAR LunchFile[MAX_PATH];
|
||||||
CHAR CallParam[1024] = { 0 };
|
CHAR CallParam[1024] = { 0 };
|
||||||
STARTUPINFOA Si;
|
DWORD LockStatus = 0;
|
||||||
PROCESS_INFORMATION Pi;
|
STARTUPINFOA Si;
|
||||||
|
PROCESS_INFORMATION Pi;
|
||||||
|
|
||||||
if (argv[0] && argv[0][0] && argv[0][1] == ':')
|
#ifdef VTOY_REJUMP_SUPPORTED
|
||||||
{
|
if (argv[0] && strcmp(argv[0], "ventoy\\WinLogon.exe") == 0)
|
||||||
GetCurrentDirectoryA(sizeof(CurDir), CurDir);
|
{
|
||||||
|
GetStartupInfoA(&Si);
|
||||||
|
Si.dwFlags |= STARTF_USESHOWWINDOW;
|
||||||
|
Si.wShowWindow = SW_HIDE;
|
||||||
|
|
||||||
strcpy_s(LunchFile, sizeof(LunchFile), argv[0]);
|
sprintf_s(LunchFile, sizeof(LunchFile), "PECMD.EXE");
|
||||||
Pos = (char *)GetFileNameInPath(LunchFile);
|
for (i = 1; i < argc; i++)
|
||||||
|
{
|
||||||
|
strcat_s(LunchFile, sizeof(LunchFile), " ");
|
||||||
|
strcat_s(LunchFile, sizeof(LunchFile), argv[i]);
|
||||||
|
}
|
||||||
|
|
||||||
strcat_s(CurDir, sizeof(CurDir), "\\");
|
CreateProcessA(NULL, LunchFile, NULL, NULL, FALSE, 0, NULL, NULL, &Si, &Pi);
|
||||||
strcat_s(CurDir, sizeof(CurDir), Pos);
|
WaitForSingleObject(Pi.hProcess, INFINITE);
|
||||||
|
return 0;
|
||||||
if (_stricmp(argv[0], CurDir) != 0)
|
}
|
||||||
{
|
#endif
|
||||||
*Pos = 0;
|
|
||||||
SetCurrentDirectoryA(LunchFile);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Log("######## VentoyJump ##########");
|
g_PecmdHasCmdLine = 0;
|
||||||
Log("argc = %d argv[0] = <%s>", argc, argv[0]);
|
g_vtoylog_mutex = CreateMutexA(NULL, FALSE, "VTOYLOG_LOCK");
|
||||||
|
g_vtoyins_mutex = CreateMutexA(NULL, FALSE, "VTOYINS_LOCK");
|
||||||
|
|
||||||
|
MUTEX_LOCK(g_vtoyins_mutex);
|
||||||
|
if (IsFileExist(VTOY_PID_FILE))
|
||||||
|
{
|
||||||
|
id = ventoy_get_instance_id(VTOY_PID_FILE);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
id = 1;
|
||||||
|
}
|
||||||
|
ventoy_append_process_id(VTOY_PID_FILE);
|
||||||
|
MUTEX_UNLOCK(g_vtoyins_mutex);
|
||||||
|
|
||||||
|
if (argv[0] && argv[0][0] && argv[0][1] == ':')
|
||||||
|
{
|
||||||
|
GetCurrentDirectoryA(sizeof(CurDir), CurDir);
|
||||||
|
|
||||||
|
strcpy_s(LunchFile, sizeof(LunchFile), argv[0]);
|
||||||
|
Pos = (char *)GetFileNameInPath(LunchFile);
|
||||||
|
|
||||||
|
strcat_s(CurDir, sizeof(CurDir), "\\");
|
||||||
|
strcat_s(CurDir, sizeof(CurDir), Pos);
|
||||||
|
|
||||||
|
if (_stricmp(argv[0], CurDir) != 0)
|
||||||
|
{
|
||||||
|
*Pos = 0;
|
||||||
|
SetCurrentDirectoryA(LunchFile);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef VTOY_32
|
||||||
|
Log("######## VentoyJump 32bit [%d] ##########", id);
|
||||||
|
#else
|
||||||
|
Log("######## VentoyJump 64bit [%d] ##########", id);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
Log("argc = %d", argc);
|
||||||
|
for (i = 0; i < argc; i++)
|
||||||
|
{
|
||||||
|
Log("argv[%d]=<%s>", i, argv[i]);
|
||||||
|
if (i > 0)
|
||||||
|
{
|
||||||
|
strcat_s(CallParam, sizeof(CallParam), " ");
|
||||||
|
strcat_s(CallParam, sizeof(CallParam), argv[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (Pos && *Pos == 0)
|
if (Pos && *Pos == 0)
|
||||||
{
|
{
|
||||||
@@ -1566,11 +1618,6 @@ int main(int argc, char **argv)
|
|||||||
Log("Current directory = <%s>", CurDir);
|
Log("Current directory = <%s>", CurDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (0 == GetWpeInitParam(argv, argc, CallParam, sizeof(CallParam)))
|
|
||||||
{
|
|
||||||
GetPecmdParam(argv[0], CallParam, sizeof(CallParam));
|
|
||||||
}
|
|
||||||
|
|
||||||
GetStartupInfoA(&Si);
|
GetStartupInfoA(&Si);
|
||||||
|
|
||||||
memset(LunchFile, 0, sizeof(LunchFile));
|
memset(LunchFile, 0, sizeof(LunchFile));
|
||||||
@@ -1584,7 +1631,36 @@ int main(int argc, char **argv)
|
|||||||
rc = VentoyJump(argc, argv, LunchFile);
|
rc = VentoyJump(argc, argv, LunchFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
Log("LunchFile=<%s> CallParam=<%s>", LunchFile, CallParam);
|
Log("id=%d LunchFile=<%s> CallParam=<%s>", id, LunchFile, CallParam);
|
||||||
|
|
||||||
|
if (id == 1 && _stricmp(argv[0], "PECMD.EXE") == 0 && _stricmp(LunchFile, "ventoy\\PECMD.EXE") == 0)
|
||||||
|
{
|
||||||
|
MUTEX_LOCK(g_vtoyins_mutex);
|
||||||
|
id = ventoy_get_instance_id(VTOY_PID_FILE);
|
||||||
|
MUTEX_UNLOCK(g_vtoyins_mutex);
|
||||||
|
|
||||||
|
Log("Current instance id is: %d", id);
|
||||||
|
|
||||||
|
if (id == 2)
|
||||||
|
{
|
||||||
|
#ifdef VTOY_REJUMP_SUPPORTED
|
||||||
|
if (g_PecmdHasCmdLine)
|
||||||
|
{
|
||||||
|
ReJump = TRUE;
|
||||||
|
CopyFileA("PECMD.EXE", "ventoy\\WinLogon.exe", TRUE);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
MoveFileA("PECMD.EXE", "PECMD_BACK.EXE");
|
||||||
|
CopyFileA("ventoy\\PECMD.EXE", "PECMD.EXE", TRUE);
|
||||||
|
sprintf_s(LunchFile, sizeof(LunchFile), "%s", "PECMD.EXE");
|
||||||
|
Log("Move original PECMD.EXE <%s>", LunchFile);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Log("%d instance started, don't move PECMD.EXE", id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (g_os_param_reserved[0] == 3)
|
if (g_os_param_reserved[0] == 3)
|
||||||
{
|
{
|
||||||
@@ -1609,10 +1685,32 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
Log("Now launch <%s> ...", LunchFile);
|
Log("Now launch <%s> ...", LunchFile);
|
||||||
|
|
||||||
//sprintf_s(LunchFile, sizeof(LunchFile), "%s", "cmd.exe");
|
if (g_os_param_reserved[0] == 4)
|
||||||
|
{
|
||||||
|
Log("Open cmd for debug ...");
|
||||||
|
sprintf_s(LunchFile, sizeof(LunchFile), "%s", "cmd.exe");
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef VTOY_REJUMP_SUPPORTED
|
||||||
|
if (ReJump)
|
||||||
|
{
|
||||||
|
sprintf_s(CallParam, sizeof(CallParam), "ventoy\\WinLogon.exe%s", LunchFile + strlen("PECMD.EXE"));
|
||||||
|
Log("Now rejump to pecmd.exe <%s> ...", CallParam);
|
||||||
|
|
||||||
|
CreateProcessA(NULL, CallParam, NULL, NULL, FALSE, 0, NULL, NULL, &Si, &Pi);
|
||||||
|
|
||||||
|
Log("Wait rejump process...");
|
||||||
|
WaitForSingleObject(Pi.hProcess, INFINITE);
|
||||||
|
Log("rejump finished");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
(void)ReJump;
|
||||||
|
#endif
|
||||||
|
|
||||||
CreateProcessA(NULL, LunchFile, NULL, NULL, FALSE, 0, NULL, NULL, &Si, &Pi);
|
CreateProcessA(NULL, LunchFile, NULL, NULL, FALSE, 0, NULL, NULL, &Si, &Pi);
|
||||||
|
|
||||||
for (i = 0; rc && i < 10; i++)
|
for (i = 0; rc && i < 1800; i++)
|
||||||
{
|
{
|
||||||
Log("Ventoy hook failed, now wait and retry ...");
|
Log("Ventoy hook failed, now wait and retry ...");
|
||||||
Sleep(1000);
|
Sleep(1000);
|
||||||
|
Reference in New Issue
Block a user