mirror of
https://github.com/ventoy/Ventoy.git
synced 2025-09-22 11:41:14 +00:00
Compare commits
54 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
b5a649f96f | ||
|
443a1344f2 | ||
|
d3de1a91f8 | ||
|
580ad598f6 | ||
|
0891e34d47 | ||
|
4d777090cb | ||
|
b0568922d2 | ||
|
69b6bb8fca | ||
|
3d686c27d7 | ||
|
90ba217ec7 | ||
|
fab070ef64 | ||
|
b3869b6894 | ||
|
563214ed40 | ||
|
b67f738b00 | ||
|
a9c539572b | ||
|
32602a79ab | ||
|
863eafd2cc | ||
|
0f135b6646 | ||
|
675c24ffa3 | ||
|
cd309eb663 | ||
|
5cdd6540a4 | ||
|
fde2e4430c | ||
|
9a471f4956 | ||
|
1f3b3afa35 | ||
|
6947f2a047 | ||
|
0a15e4e427 | ||
|
e763d7590f | ||
|
f842d46f90 | ||
|
cc1cc6c301 | ||
|
9f3d209798 | ||
|
fc742244ab | ||
|
3e66227dae | ||
|
f32d342f66 | ||
|
09d7ae68e7 | ||
|
68fefbc1fc | ||
|
8d893d4c94 | ||
|
84798a4f7a | ||
|
87f88eeb2b | ||
|
7b2615744c | ||
|
d7faff4438 | ||
|
f15dfd7409 | ||
|
09162e8d97 | ||
|
eb8fcc8f30 | ||
|
5fcb3971bc | ||
|
e47e4484ce | ||
|
7e26decb31 | ||
|
e713946fd0 | ||
|
a93b0f6656 | ||
|
836e1aa11e | ||
|
154bbc6e5f | ||
|
d151e74336 | ||
|
df87cafdfb | ||
|
09494a5b23 | ||
|
e15a1c5ece |
2
.github/FUNDING.yml
vendored
2
.github/FUNDING.yml
vendored
@@ -9,4 +9,4 @@ community_bridge: # Replace with a single Community Bridge project-name e.g., cl
|
|||||||
liberapay: # Replace with a single Liberapay username
|
liberapay: # Replace with a single Liberapay username
|
||||||
issuehunt: # Replace with a single IssueHunt username
|
issuehunt: # Replace with a single IssueHunt username
|
||||||
otechie: # Replace with a single Otechie username
|
otechie: # Replace with a single Otechie username
|
||||||
custom: ['https://www.ventoy.net/en/donation.html'] # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
custom: ['https://www.paypal.me/ventoy', 'https://www.ventoy.net/en/donation.html'] # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
||||||
|
2
.github/ISSUE_TEMPLATE/issue_template.yml
vendored
2
.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.56
|
placeholder: 1.0.61
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
- type: dropdown
|
- type: dropdown
|
||||||
|
101
.github/ISSUE_TEMPLATE/success_image_report.yml
vendored
Normal file
101
.github/ISSUE_TEMPLATE/success_image_report.yml
vendored
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
name: Success Image Report
|
||||||
|
description: To report an image file that boot successfully in Ventoy and is not yet listed in https://www.ventoy.net/en/isolist.html
|
||||||
|
title: "[Success Image Report]: "
|
||||||
|
assignees:
|
||||||
|
- octocat
|
||||||
|
body:
|
||||||
|
- type: markdown
|
||||||
|
attributes:
|
||||||
|
value: |
|
||||||
|
I list all the successfully tested image files in the official website: https://www.ventoy.net/en/isolist.html
|
||||||
|
If you successfully test an image file which is not listed in the above page, you can tell me and I will be very glad to add it to the tested list.
|
||||||
|
- type: checkboxes
|
||||||
|
id: faq
|
||||||
|
attributes:
|
||||||
|
label: Official Website List
|
||||||
|
description: Have you checked the list at [https://www.ventoy.net/en/isolist.html](https://www.ventoy.net/en/isolist.html) and the image file is not listed?
|
||||||
|
options:
|
||||||
|
- label: I have checked the list in official website and the image file is not listed there.
|
||||||
|
required: true
|
||||||
|
- type: input
|
||||||
|
id: version
|
||||||
|
attributes:
|
||||||
|
label: Ventoy Version
|
||||||
|
description: What version of ventoy did you test with the image file.
|
||||||
|
placeholder: 1.0.57
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: dropdown
|
||||||
|
id: bios
|
||||||
|
attributes:
|
||||||
|
label: BIOS Mode
|
||||||
|
description: In which BIOS mode did you successfully test the image file? (It's recommended to test in both mode)
|
||||||
|
options:
|
||||||
|
- Legacy BIOS Mode
|
||||||
|
- UEFI Mode
|
||||||
|
- Both
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: dropdown
|
||||||
|
id: partstyle
|
||||||
|
attributes:
|
||||||
|
label: Partition Style
|
||||||
|
description: Which partition style did you use with Ventoy?
|
||||||
|
options:
|
||||||
|
- MBR
|
||||||
|
- GPT
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: input
|
||||||
|
id: filename
|
||||||
|
attributes:
|
||||||
|
label: Image file name
|
||||||
|
description: The successfully tested image file name.
|
||||||
|
placeholder: xxxx.iso
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: dropdown
|
||||||
|
id: checksum
|
||||||
|
attributes:
|
||||||
|
label: Image file checksum type
|
||||||
|
description:
|
||||||
|
options:
|
||||||
|
- MD5
|
||||||
|
- SHA1
|
||||||
|
- SHA256
|
||||||
|
- SHA512
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: input
|
||||||
|
id: checkvalue
|
||||||
|
attributes:
|
||||||
|
label: Image file checksum value
|
||||||
|
description: What is the image file checksum value corresponding to the above checksum type?
|
||||||
|
placeholder: xxxx
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- 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: input
|
||||||
|
id: testenv
|
||||||
|
attributes:
|
||||||
|
label: Test envrionment
|
||||||
|
description: The manufacturer/model and other details about your computer (or VM).
|
||||||
|
placeholder: Lenovo Thinkpad T420 laptop
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
id: details
|
||||||
|
attributes:
|
||||||
|
label: More Details?
|
||||||
|
description: You can give more details here.
|
||||||
|
value: "This image file booted successfully in Ventoy."
|
||||||
|
validations:
|
||||||
|
required: false
|
||||||
|
|
@@ -59,6 +59,9 @@ static grub_env_set_pf grub_env_set = NULL;
|
|||||||
ventoy_grub_param_file_replace *g_file_replace_list = NULL;
|
ventoy_grub_param_file_replace *g_file_replace_list = NULL;
|
||||||
ventoy_efi_file_replace g_efi_file_replace;
|
ventoy_efi_file_replace g_efi_file_replace;
|
||||||
|
|
||||||
|
ventoy_grub_param_file_replace *g_img_replace_list = NULL;
|
||||||
|
ventoy_efi_file_replace g_img_file_replace;
|
||||||
|
|
||||||
CONST CHAR16 gIso9660EfiDriverPath[] = ISO9660_EFI_DRIVER_PATH;
|
CONST CHAR16 gIso9660EfiDriverPath[] = ISO9660_EFI_DRIVER_PATH;
|
||||||
CONST CHAR16 gUdfEfiDriverPath[] = UDF_EFI_DRIVER_PATH;
|
CONST CHAR16 gUdfEfiDriverPath[] = UDF_EFI_DRIVER_PATH;
|
||||||
|
|
||||||
@@ -707,6 +710,35 @@ STATIC EFI_STATUS EFIAPI ventoy_load_isoefi_driver(IN EFI_HANDLE ImageHandle)
|
|||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
STATIC EFI_STATUS ventoy_proc_img_replace_name(ventoy_grub_param_file_replace *replace)
|
||||||
|
{
|
||||||
|
UINT32 i;
|
||||||
|
char tmp[256];
|
||||||
|
|
||||||
|
if (replace->magic != GRUB_IMG_REPLACE_MAGIC)
|
||||||
|
{
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (replace->old_file_name[0][0] == 0)
|
||||||
|
{
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
AsciiStrCpyS(tmp, sizeof(tmp), replace->old_file_name[0]);
|
||||||
|
|
||||||
|
for (i = 0; i < 256 && tmp[i]; i++)
|
||||||
|
{
|
||||||
|
if (tmp[i] == '/')
|
||||||
|
{
|
||||||
|
tmp[i] = '\\';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
AsciiStrCpyS(replace->old_file_name[0], 256, tmp);
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
STATIC EFI_STATUS EFIAPI ventoy_parse_cmdline(IN EFI_HANDLE ImageHandle)
|
STATIC EFI_STATUS EFIAPI ventoy_parse_cmdline(IN EFI_HANDLE ImageHandle)
|
||||||
{
|
{
|
||||||
UINT32 i = 0;
|
UINT32 i = 0;
|
||||||
@@ -817,6 +849,19 @@ STATIC EFI_STATUS EFIAPI ventoy_parse_cmdline(IN EFI_HANDLE ImageHandle)
|
|||||||
old_cnt > 3 ? g_file_replace_list->old_file_name[3] : ""
|
old_cnt > 3 ? g_file_replace_list->old_file_name[3] : ""
|
||||||
);
|
);
|
||||||
|
|
||||||
|
g_img_replace_list = &pGrubParam->img_replace;
|
||||||
|
ventoy_proc_img_replace_name(g_img_replace_list);
|
||||||
|
old_cnt = g_img_replace_list->old_file_cnt;
|
||||||
|
debug("img replace: magic:0x%x virtid:%u name count:%u <%a> <%a> <%a> <%a>",
|
||||||
|
g_img_replace_list->magic,
|
||||||
|
g_img_replace_list->new_file_virtual_id,
|
||||||
|
old_cnt,
|
||||||
|
old_cnt > 0 ? g_img_replace_list->old_file_name[0] : "",
|
||||||
|
old_cnt > 1 ? g_img_replace_list->old_file_name[1] : "",
|
||||||
|
old_cnt > 2 ? g_img_replace_list->old_file_name[2] : "",
|
||||||
|
old_cnt > 3 ? g_img_replace_list->old_file_name[3] : ""
|
||||||
|
);
|
||||||
|
|
||||||
pPos = StrStr(pCmdLine, L"mem:");
|
pPos = StrStr(pCmdLine, L"mem:");
|
||||||
chain = (ventoy_chain_head *)StrHexToUintn(pPos + 4);
|
chain = (ventoy_chain_head *)StrHexToUintn(pPos + 4);
|
||||||
|
|
||||||
@@ -1050,7 +1095,8 @@ EFI_STATUS EFIAPI ventoy_boot(IN EFI_HANDLE ImageHandle)
|
|||||||
gST->ConIn->Reset(gST->ConIn, FALSE);
|
gST->ConIn->Reset(gST->ConIn, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_file_replace_list && g_file_replace_list->magic == GRUB_FILE_REPLACE_MAGIC)
|
if ((g_file_replace_list && g_file_replace_list->magic == GRUB_FILE_REPLACE_MAGIC) ||
|
||||||
|
(g_img_replace_list && g_img_replace_list->magic == GRUB_IMG_REPLACE_MAGIC))
|
||||||
{
|
{
|
||||||
ventoy_wrapper_push_openvolume(pFile->OpenVolume);
|
ventoy_wrapper_push_openvolume(pFile->OpenVolume);
|
||||||
pFile->OpenVolume = ventoy_wrapper_open_volume;
|
pFile->OpenVolume = ventoy_wrapper_open_volume;
|
||||||
|
@@ -243,6 +243,7 @@ typedef int (*grub_env_printf_pf)(const char *fmt, ...);
|
|||||||
#pragma pack(1)
|
#pragma pack(1)
|
||||||
|
|
||||||
#define GRUB_FILE_REPLACE_MAGIC 0x1258BEEF
|
#define GRUB_FILE_REPLACE_MAGIC 0x1258BEEF
|
||||||
|
#define GRUB_IMG_REPLACE_MAGIC 0x1259BEEF
|
||||||
|
|
||||||
typedef struct ventoy_efi_file_replace
|
typedef struct ventoy_efi_file_replace
|
||||||
{
|
{
|
||||||
@@ -267,6 +268,7 @@ typedef struct ventoy_grub_param
|
|||||||
grub_env_get_pf grub_env_get;
|
grub_env_get_pf grub_env_get;
|
||||||
grub_env_set_pf grub_env_set;
|
grub_env_set_pf grub_env_set;
|
||||||
ventoy_grub_param_file_replace file_replace;
|
ventoy_grub_param_file_replace file_replace;
|
||||||
|
ventoy_grub_param_file_replace img_replace;
|
||||||
grub_env_printf_pf grub_env_printf;
|
grub_env_printf_pf grub_env_printf;
|
||||||
}ventoy_grub_param;
|
}ventoy_grub_param;
|
||||||
|
|
||||||
@@ -396,6 +398,7 @@ extern ventoy_virt_chunk *g_virt_chunk;
|
|||||||
extern UINT32 g_virt_chunk_num;
|
extern UINT32 g_virt_chunk_num;
|
||||||
extern vtoy_block_data gBlockData;
|
extern vtoy_block_data gBlockData;
|
||||||
extern ventoy_efi_file_replace g_efi_file_replace;
|
extern ventoy_efi_file_replace g_efi_file_replace;
|
||||||
|
extern ventoy_efi_file_replace g_img_file_replace;
|
||||||
extern ventoy_sector_flag *g_sector_flag;
|
extern ventoy_sector_flag *g_sector_flag;
|
||||||
extern UINT32 g_sector_flag_num;
|
extern UINT32 g_sector_flag_num;
|
||||||
extern BOOLEAN gMemdiskMode;
|
extern BOOLEAN gMemdiskMode;
|
||||||
@@ -403,6 +406,7 @@ extern BOOLEAN gSector512Mode;
|
|||||||
extern UINTN g_iso_buf_size;
|
extern UINTN g_iso_buf_size;
|
||||||
extern UINT8 *g_iso_data_buf;
|
extern UINT8 *g_iso_data_buf;
|
||||||
extern ventoy_grub_param_file_replace *g_file_replace_list;
|
extern ventoy_grub_param_file_replace *g_file_replace_list;
|
||||||
|
extern ventoy_grub_param_file_replace *g_img_replace_list;
|
||||||
extern BOOLEAN g_fixup_iso9660_secover_enable;
|
extern BOOLEAN g_fixup_iso9660_secover_enable;
|
||||||
extern EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *g_con_simple_input_ex;
|
extern EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *g_con_simple_input_ex;
|
||||||
extern BOOLEAN g_fix_windows_1st_cdrom_issue;
|
extern BOOLEAN g_fix_windows_1st_cdrom_issue;
|
||||||
|
@@ -37,6 +37,9 @@
|
|||||||
#include <Protocol/DriverBinding.h>
|
#include <Protocol/DriverBinding.h>
|
||||||
#include <Ventoy.h>
|
#include <Ventoy.h>
|
||||||
|
|
||||||
|
#define ASSIGN_REPLACE(This, replace) \
|
||||||
|
replace = (This->FlushEx == ventoy_wrapper_file_flush_ex) ? &g_efi_file_replace : &g_img_file_replace
|
||||||
|
|
||||||
UINT8 *g_iso_data_buf = NULL;
|
UINT8 *g_iso_data_buf = NULL;
|
||||||
UINTN g_iso_buf_size = 0;
|
UINTN g_iso_buf_size = 0;
|
||||||
BOOLEAN gMemdiskMode = FALSE;
|
BOOLEAN gMemdiskMode = FALSE;
|
||||||
@@ -1245,6 +1248,15 @@ ventoy_wrapper_file_flush_ex(EFI_FILE_HANDLE This, EFI_FILE_IO_TOKEN *Token)
|
|||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Ex version */
|
||||||
|
STATIC EFI_STATUS EFIAPI
|
||||||
|
ventoy_wrapper_file_flush_ex_img(EFI_FILE_HANDLE This, EFI_FILE_IO_TOKEN *Token)
|
||||||
|
{
|
||||||
|
(VOID)This;
|
||||||
|
(VOID)Token;
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
STATIC EFI_STATUS EFIAPI
|
STATIC EFI_STATUS EFIAPI
|
||||||
ventoy_wrapper_file_write(EFI_FILE_HANDLE This, UINTN *Len, VOID *Data)
|
ventoy_wrapper_file_write(EFI_FILE_HANDLE This, UINTN *Len, VOID *Data)
|
||||||
@@ -1270,19 +1282,20 @@ ventoy_wrapper_file_close(EFI_FILE_HANDLE This)
|
|||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
STATIC EFI_STATUS EFIAPI
|
STATIC EFI_STATUS EFIAPI
|
||||||
ventoy_wrapper_file_set_pos(EFI_FILE_HANDLE This, UINT64 Position)
|
ventoy_wrapper_file_set_pos(EFI_FILE_HANDLE This, UINT64 Position)
|
||||||
{
|
{
|
||||||
(VOID)This;
|
ventoy_efi_file_replace *replace = NULL;
|
||||||
|
|
||||||
if (Position <= g_efi_file_replace.FileSizeBytes)
|
ASSIGN_REPLACE(This, replace);
|
||||||
|
|
||||||
|
if (Position <= replace->FileSizeBytes)
|
||||||
{
|
{
|
||||||
g_efi_file_replace.CurPos = Position;
|
replace->CurPos = Position;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
g_efi_file_replace.CurPos = g_efi_file_replace.FileSizeBytes;
|
replace->CurPos = replace->FileSizeBytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
@@ -1291,9 +1304,11 @@ ventoy_wrapper_file_set_pos(EFI_FILE_HANDLE This, UINT64 Position)
|
|||||||
STATIC EFI_STATUS EFIAPI
|
STATIC EFI_STATUS EFIAPI
|
||||||
ventoy_wrapper_file_get_pos(EFI_FILE_HANDLE This, UINT64 *Position)
|
ventoy_wrapper_file_get_pos(EFI_FILE_HANDLE This, UINT64 *Position)
|
||||||
{
|
{
|
||||||
(VOID)This;
|
ventoy_efi_file_replace *replace = NULL;
|
||||||
|
|
||||||
*Position = g_efi_file_replace.CurPos;
|
ASSIGN_REPLACE(This, replace);
|
||||||
|
|
||||||
|
*Position = replace->CurPos;
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
@@ -1303,6 +1318,9 @@ STATIC EFI_STATUS EFIAPI
|
|||||||
ventoy_wrapper_file_get_info(EFI_FILE_HANDLE This, EFI_GUID *Type, UINTN *Len, VOID *Data)
|
ventoy_wrapper_file_get_info(EFI_FILE_HANDLE This, EFI_GUID *Type, UINTN *Len, VOID *Data)
|
||||||
{
|
{
|
||||||
EFI_FILE_INFO *Info = (EFI_FILE_INFO *) Data;
|
EFI_FILE_INFO *Info = (EFI_FILE_INFO *) Data;
|
||||||
|
ventoy_efi_file_replace *replace = NULL;
|
||||||
|
|
||||||
|
ASSIGN_REPLACE(This, replace);
|
||||||
|
|
||||||
debug("ventoy_wrapper_file_get_info ... %u", *Len);
|
debug("ventoy_wrapper_file_get_info ... %u", *Len);
|
||||||
|
|
||||||
@@ -1320,8 +1338,8 @@ ventoy_wrapper_file_get_info(EFI_FILE_HANDLE This, EFI_GUID *Type, UINTN *Len, V
|
|||||||
ZeroMem(Data, sizeof(EFI_FILE_INFO));
|
ZeroMem(Data, sizeof(EFI_FILE_INFO));
|
||||||
|
|
||||||
Info->Size = sizeof(EFI_FILE_INFO);
|
Info->Size = sizeof(EFI_FILE_INFO);
|
||||||
Info->FileSize = g_efi_file_replace.FileSizeBytes;
|
Info->FileSize = replace->FileSizeBytes;
|
||||||
Info->PhysicalSize = g_efi_file_replace.FileSizeBytes;
|
Info->PhysicalSize = replace->FileSizeBytes;
|
||||||
Info->Attribute = EFI_FILE_READ_ONLY;
|
Info->Attribute = EFI_FILE_READ_ONLY;
|
||||||
//Info->FileName = EFI_FILE_READ_ONLY;
|
//Info->FileName = EFI_FILE_READ_ONLY;
|
||||||
|
|
||||||
@@ -1335,23 +1353,24 @@ ventoy_wrapper_file_read(EFI_FILE_HANDLE This, UINTN *Len, VOID *Data)
|
|||||||
{
|
{
|
||||||
EFI_LBA Lba;
|
EFI_LBA Lba;
|
||||||
UINTN ReadLen = *Len;
|
UINTN ReadLen = *Len;
|
||||||
|
ventoy_efi_file_replace *replace = NULL;
|
||||||
(VOID)This;
|
|
||||||
|
|
||||||
|
ASSIGN_REPLACE(This, replace);
|
||||||
|
|
||||||
debug("ventoy_wrapper_file_read ... %u", *Len);
|
debug("ventoy_wrapper_file_read ... %u", *Len);
|
||||||
|
|
||||||
if (g_efi_file_replace.CurPos + ReadLen > g_efi_file_replace.FileSizeBytes)
|
if (replace->CurPos + ReadLen > replace->FileSizeBytes)
|
||||||
{
|
{
|
||||||
ReadLen = g_efi_file_replace.FileSizeBytes - g_efi_file_replace.CurPos;
|
ReadLen = replace->FileSizeBytes - replace->CurPos;
|
||||||
}
|
}
|
||||||
|
|
||||||
Lba = g_efi_file_replace.CurPos / 2048 + g_efi_file_replace.BlockIoSectorStart;
|
Lba = replace->CurPos / 2048 + replace->BlockIoSectorStart;
|
||||||
|
|
||||||
ventoy_block_io_read(NULL, 0, Lba, ReadLen, Data);
|
ventoy_block_io_read(NULL, 0, Lba, ReadLen, Data);
|
||||||
|
|
||||||
*Len = ReadLen;
|
*Len = ReadLen;
|
||||||
|
|
||||||
g_efi_file_replace.CurPos += ReadLen;
|
replace->CurPos += ReadLen;
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
@@ -1362,7 +1381,7 @@ ventoy_wrapper_file_read_ex(IN EFI_FILE_PROTOCOL *This, IN OUT EFI_FILE_IO_TOKEN
|
|||||||
return ventoy_wrapper_file_read(This, &(Token->BufferSize), Token->Buffer);
|
return ventoy_wrapper_file_read(This, &(Token->BufferSize), Token->Buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
STATIC EFI_STATUS EFIAPI ventoy_wrapper_file_procotol(EFI_FILE_PROTOCOL *File)
|
STATIC EFI_STATUS EFIAPI ventoy_wrapper_file_procotol(EFI_FILE_PROTOCOL *File, BOOLEAN Img)
|
||||||
{
|
{
|
||||||
File->Revision = EFI_FILE_PROTOCOL_REVISION2;
|
File->Revision = EFI_FILE_PROTOCOL_REVISION2;
|
||||||
File->Open = ventoy_wrapper_fs_open;
|
File->Open = ventoy_wrapper_fs_open;
|
||||||
@@ -1378,7 +1397,7 @@ STATIC EFI_STATUS EFIAPI ventoy_wrapper_file_procotol(EFI_FILE_PROTOCOL *File)
|
|||||||
File->OpenEx = ventoy_wrapper_file_open_ex;
|
File->OpenEx = ventoy_wrapper_file_open_ex;
|
||||||
File->ReadEx = ventoy_wrapper_file_read_ex;
|
File->ReadEx = ventoy_wrapper_file_read_ex;
|
||||||
File->WriteEx = ventoy_wrapper_file_write_ex;
|
File->WriteEx = ventoy_wrapper_file_write_ex;
|
||||||
File->FlushEx = ventoy_wrapper_file_flush_ex;
|
File->FlushEx = Img ? ventoy_wrapper_file_flush_ex_img : ventoy_wrapper_file_flush_ex;
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
@@ -1397,6 +1416,7 @@ STATIC EFI_STATUS EFIAPI ventoy_wrapper_file_open
|
|||||||
UINT64 Sectors = 0;
|
UINT64 Sectors = 0;
|
||||||
EFI_STATUS Status = EFI_SUCCESS;
|
EFI_STATUS Status = EFI_SUCCESS;
|
||||||
CHAR8 TmpName[256];
|
CHAR8 TmpName[256];
|
||||||
|
CHAR8 OldName[256];
|
||||||
ventoy_virt_chunk *virt = NULL;
|
ventoy_virt_chunk *virt = NULL;
|
||||||
|
|
||||||
debug("## ventoy_wrapper_file_open <%s> ", Name);
|
debug("## ventoy_wrapper_file_open <%s> ", Name);
|
||||||
@@ -1417,6 +1437,7 @@ STATIC EFI_STATUS EFIAPI ventoy_wrapper_file_open
|
|||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (g_file_replace_list && g_file_replace_list->magic == GRUB_FILE_REPLACE_MAGIC &&
|
if (g_file_replace_list && g_file_replace_list->magic == GRUB_FILE_REPLACE_MAGIC &&
|
||||||
g_file_replace_list->new_file_virtual_id < g_virt_chunk_num)
|
g_file_replace_list->new_file_virtual_id < g_virt_chunk_num)
|
||||||
{
|
{
|
||||||
@@ -1427,7 +1448,7 @@ STATIC EFI_STATUS EFIAPI ventoy_wrapper_file_open
|
|||||||
{
|
{
|
||||||
g_original_fclose(*New);
|
g_original_fclose(*New);
|
||||||
*New = &g_efi_file_replace.WrapperHandle;
|
*New = &g_efi_file_replace.WrapperHandle;
|
||||||
ventoy_wrapper_file_procotol(*New);
|
ventoy_wrapper_file_procotol(*New, FALSE);
|
||||||
|
|
||||||
virt = g_virt_chunk + g_file_replace_list->new_file_virtual_id;
|
virt = g_virt_chunk + g_file_replace_list->new_file_virtual_id;
|
||||||
|
|
||||||
@@ -1453,6 +1474,49 @@ STATIC EFI_STATUS EFIAPI ventoy_wrapper_file_open
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (g_img_replace_list && g_img_replace_list->magic == GRUB_IMG_REPLACE_MAGIC &&
|
||||||
|
g_img_replace_list->new_file_virtual_id < g_virt_chunk_num)
|
||||||
|
{
|
||||||
|
AsciiSPrint(TmpName, sizeof(TmpName), "%s", Name);
|
||||||
|
for (j = 0; j < g_img_replace_list->old_file_cnt; j++)
|
||||||
|
{
|
||||||
|
AsciiStrCpyS(OldName, sizeof(OldName), g_img_replace_list[i].old_file_name[j]);
|
||||||
|
if ((0 == AsciiStrCmp(OldName, TmpName)) ||
|
||||||
|
(AsciiStrnCmp(OldName, "\\loader\\entries\\", 16) == 0 &&
|
||||||
|
AsciiStrCmp(OldName + 16, TmpName) == 0
|
||||||
|
)
|
||||||
|
)
|
||||||
|
{
|
||||||
|
g_original_fclose(*New);
|
||||||
|
*New = &g_img_file_replace.WrapperHandle;
|
||||||
|
ventoy_wrapper_file_procotol(*New, TRUE);
|
||||||
|
|
||||||
|
virt = g_virt_chunk + g_img_replace_list->new_file_virtual_id;
|
||||||
|
|
||||||
|
Sectors = (virt->mem_sector_end - virt->mem_sector_start) + (virt->remap_sector_end - virt->remap_sector_start);
|
||||||
|
|
||||||
|
g_img_file_replace.BlockIoSectorStart = virt->mem_sector_start;
|
||||||
|
g_img_file_replace.FileSizeBytes = Sectors * 2048;
|
||||||
|
|
||||||
|
if (gDebugPrint)
|
||||||
|
{
|
||||||
|
debug("## ventoy_wrapper_file_open2 <%s> BlockStart:%lu Sectors:%lu Bytes:%lu", Name,
|
||||||
|
g_img_file_replace.BlockIoSectorStart, Sectors, Sectors * 2048);
|
||||||
|
sleep(3);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (StrCmp(Name, L"\\loader\\entries") == 0)
|
||||||
|
{
|
||||||
|
(*New)->Open = ventoy_wrapper_file_open;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -41,6 +41,7 @@ typedef struct ventoy_grub_param
|
|||||||
grub_env_get_pf grub_env_get;
|
grub_env_get_pf grub_env_get;
|
||||||
grub_env_set_pf grub_env_set;
|
grub_env_set_pf grub_env_set;
|
||||||
ventoy_grub_param_file_replace file_replace;
|
ventoy_grub_param_file_replace file_replace;
|
||||||
|
ventoy_grub_param_file_replace img_replace;
|
||||||
grub_env_printf_pf grub_env_printf;
|
grub_env_printf_pf grub_env_printf;
|
||||||
}ventoy_grub_param;
|
}ventoy_grub_param;
|
||||||
#pragma pack()
|
#pragma pack()
|
||||||
|
@@ -94,7 +94,7 @@ hash_file (grub_file_t file, const gcry_md_spec_t *hash, void *result)
|
|||||||
{
|
{
|
||||||
total += r;
|
total += r;
|
||||||
div = grub_divmod64(total * 100, (grub_uint64_t)file->size, &ro);
|
div = grub_divmod64(total * 100, (grub_uint64_t)file->size, &ro);
|
||||||
grub_printf("\rCalculating %d%% ", (int)div);
|
grub_printf("\rCalculating %s %d%% ", hash->name, (int)div);
|
||||||
grub_refresh();
|
grub_refresh();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -105,7 +105,7 @@ hash_file (grub_file_t file, const gcry_md_spec_t *hash, void *result)
|
|||||||
grub_free (context);
|
grub_free (context);
|
||||||
if (progress)
|
if (progress)
|
||||||
{
|
{
|
||||||
grub_printf("\rCalculating 100%% \n\r\n");
|
grub_printf("\rCalculating %s 100%% \n\r\n", hash->name);
|
||||||
grub_refresh();
|
grub_refresh();
|
||||||
}
|
}
|
||||||
return GRUB_ERR_NONE;
|
return GRUB_ERR_NONE;
|
||||||
@@ -224,6 +224,8 @@ grub_cmd_hashsum (struct grub_extcmd_context *ctxt,
|
|||||||
int keep = state[3].set;
|
int keep = state[3].set;
|
||||||
int uncompress = state[4].set;
|
int uncompress = state[4].set;
|
||||||
unsigned unread = 0;
|
unsigned unread = 0;
|
||||||
|
int len = 0;
|
||||||
|
char hashsum[256];
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_SIZE (aliases); i++)
|
for (i = 0; i < ARRAY_SIZE (aliases); i++)
|
||||||
if (grub_strcmp (ctxt->extcmd->cmd->name, aliases[i].name) == 0)
|
if (grub_strcmp (ctxt->extcmd->cmd->name, aliases[i].name) == 0)
|
||||||
@@ -282,8 +284,12 @@ grub_cmd_hashsum (struct grub_extcmd_context *ctxt,
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
for (j = 0; j < hash->mdlen; j++)
|
for (j = 0; j < hash->mdlen; j++)
|
||||||
grub_printf ("%02x", ((grub_uint8_t *) result)[j]);
|
{
|
||||||
|
grub_printf ("%02x", ((grub_uint8_t *) result)[j]);
|
||||||
|
len += grub_snprintf(hashsum + len, sizeof(hashsum) - len, "%02x", ((grub_uint8_t *) result)[j]);
|
||||||
|
}
|
||||||
grub_printf (" %s\n", args[i]);
|
grub_printf (" %s\n", args[i]);
|
||||||
|
grub_env_set("VT_LAST_CHECK_SUM", hashsum);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (unread)
|
if (unread)
|
||||||
|
@@ -405,7 +405,9 @@ const char * g_ventoy_tip_msg2 = NULL;
|
|||||||
static const char *g_ventoy_cur_img_path = NULL;
|
static const char *g_ventoy_cur_img_path = NULL;
|
||||||
static void menu_set_chosen_tip(grub_menu_t menu, int entry)
|
static void menu_set_chosen_tip(grub_menu_t menu, int entry)
|
||||||
{
|
{
|
||||||
|
int i;
|
||||||
img_info *img;
|
img_info *img;
|
||||||
|
menu_tip *tip;
|
||||||
grub_menu_entry_t e = grub_menu_get_entry (menu, entry);
|
grub_menu_entry_t e = grub_menu_get_entry (menu, entry);
|
||||||
|
|
||||||
g_ventoy_tip_msg1 = g_ventoy_tip_msg2 = NULL;
|
g_ventoy_tip_msg1 = g_ventoy_tip_msg2 = NULL;
|
||||||
@@ -419,6 +421,26 @@ static void menu_set_chosen_tip(grub_menu_t menu, int entry)
|
|||||||
g_ventoy_cur_img_path = img->path;
|
g_ventoy_cur_img_path = img->path;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (e && e->id && grub_strncmp(e->id, "DIR_", 4) == 0)
|
||||||
|
{
|
||||||
|
for (i = 0; i < e->argc; i++)
|
||||||
|
{
|
||||||
|
if (e->args[i] && grub_strncmp(e->args[i], "_VTIP_", 6) == 0)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (i < e->argc)
|
||||||
|
{
|
||||||
|
tip = (menu_tip *)(void *)grub_strtoul(e->args[i] + 6, NULL, 16);
|
||||||
|
if (tip)
|
||||||
|
{
|
||||||
|
g_ventoy_tip_msg1 = tip->tip1;
|
||||||
|
g_ventoy_tip_msg2 = tip->tip2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -913,6 +935,7 @@ run_menu (grub_menu_t menu, int nested, int *auto_boot)
|
|||||||
goto refresh;
|
goto refresh;
|
||||||
|
|
||||||
case (GRUB_TERM_CTRL | 'h'):
|
case (GRUB_TERM_CTRL | 'h'):
|
||||||
|
case 'h':
|
||||||
{
|
{
|
||||||
cmdstr = grub_env_get("VTOY_HELP_CMD");
|
cmdstr = grub_env_get("VTOY_HELP_CMD");
|
||||||
if (cmdstr)
|
if (cmdstr)
|
||||||
@@ -926,6 +949,7 @@ run_menu (grub_menu_t menu, int nested, int *auto_boot)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case (GRUB_TERM_CTRL | 'm'):
|
case (GRUB_TERM_CTRL | 'm'):
|
||||||
|
case 'm':
|
||||||
{
|
{
|
||||||
if (g_ventoy_cur_img_path)
|
if (g_ventoy_cur_img_path)
|
||||||
{
|
{
|
||||||
|
113
GRUB2/MOD_SRC/grub-2.04/grub-core/script/function.c
Normal file
113
GRUB2/MOD_SRC/grub-2.04/grub-core/script/function.c
Normal file
@@ -0,0 +1,113 @@
|
|||||||
|
/*
|
||||||
|
* GRUB -- GRand Unified Bootloader
|
||||||
|
* Copyright (C) 2005,2007,2009,2010 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/misc.h>
|
||||||
|
#include <grub/script_sh.h>
|
||||||
|
#include <grub/parser.h>
|
||||||
|
#include <grub/mm.h>
|
||||||
|
#include <grub/charset.h>
|
||||||
|
|
||||||
|
grub_script_function_t grub_script_function_list;
|
||||||
|
|
||||||
|
grub_script_function_t
|
||||||
|
grub_script_function_create (struct grub_script_arg *functionname_arg,
|
||||||
|
struct grub_script *cmd)
|
||||||
|
{
|
||||||
|
grub_script_function_t func;
|
||||||
|
grub_script_function_t *p;
|
||||||
|
|
||||||
|
func = (grub_script_function_t) grub_malloc (sizeof (*func));
|
||||||
|
if (! func)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
func->name = grub_strdup (functionname_arg->str);
|
||||||
|
if (! func->name)
|
||||||
|
{
|
||||||
|
grub_free (func);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
func->func = cmd;
|
||||||
|
|
||||||
|
/* Keep the list sorted for simplicity. */
|
||||||
|
p = &grub_script_function_list;
|
||||||
|
while (*p)
|
||||||
|
{
|
||||||
|
if (grub_strcmp ((*p)->name, func->name) >= 0)
|
||||||
|
break;
|
||||||
|
|
||||||
|
p = &((*p)->next);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* If the function already exists, overwrite the old function. */
|
||||||
|
if (*p && grub_strcmp ((*p)->name, func->name) == 0)
|
||||||
|
{
|
||||||
|
grub_script_function_t q;
|
||||||
|
|
||||||
|
q = *p;
|
||||||
|
grub_script_free (q->func);
|
||||||
|
q->func = cmd;
|
||||||
|
grub_free (func);
|
||||||
|
func = q;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
func->next = *p;
|
||||||
|
*p = func;
|
||||||
|
}
|
||||||
|
|
||||||
|
return func;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
grub_script_function_remove (const char *name)
|
||||||
|
{
|
||||||
|
grub_script_function_t *p, q;
|
||||||
|
|
||||||
|
for (p = &grub_script_function_list, q = *p; q; p = &(q->next), q = q->next)
|
||||||
|
if (grub_strcmp (name, q->name) == 0)
|
||||||
|
{
|
||||||
|
*p = q->next;
|
||||||
|
grub_free (q->name);
|
||||||
|
grub_script_free (q->func);
|
||||||
|
grub_free (q);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
grub_script_function_t
|
||||||
|
grub_script_function_find (char *functionname)
|
||||||
|
{
|
||||||
|
grub_script_function_t func;
|
||||||
|
|
||||||
|
for (func = grub_script_function_list; func; func = func->next)
|
||||||
|
if (grub_strcmp (functionname, func->name) == 0)
|
||||||
|
break;
|
||||||
|
|
||||||
|
if (! func)
|
||||||
|
{
|
||||||
|
char tmp[64];
|
||||||
|
grub_strncpy (tmp, functionname, 63);
|
||||||
|
tmp[63] = 0;
|
||||||
|
/* Avoid truncating inside UTF-8 character. */
|
||||||
|
tmp[grub_getend (tmp, tmp + grub_strlen (tmp))] = 0;
|
||||||
|
grub_error (GRUB_ERR_UNKNOWN_COMMAND, N_("can't find command `%s'"), tmp);
|
||||||
|
}
|
||||||
|
|
||||||
|
return func;
|
||||||
|
}
|
@@ -918,6 +918,38 @@ static grub_err_t ventoy_cmd_strbegin(grub_extcmd_context_t ctxt, int argc, char
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static grub_err_t ventoy_cmd_strcasebegin(grub_extcmd_context_t ctxt, int argc, char **args)
|
||||||
|
{
|
||||||
|
char *c0, *c1;
|
||||||
|
|
||||||
|
(void)ctxt;
|
||||||
|
|
||||||
|
if (argc != 2)
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
c0 = args[0];
|
||||||
|
c1 = args[1];
|
||||||
|
|
||||||
|
while (*c0 && *c1)
|
||||||
|
{
|
||||||
|
if ((*c0 != *c1) && (*c0 != grub_toupper(*c1)))
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
c0++;
|
||||||
|
c1++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (*c1)
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static grub_err_t ventoy_cmd_incr(grub_extcmd_context_t ctxt, int argc, char **args)
|
static grub_err_t ventoy_cmd_incr(grub_extcmd_context_t ctxt, int argc, char **args)
|
||||||
{
|
{
|
||||||
long value_long = 0;
|
long value_long = 0;
|
||||||
@@ -1834,7 +1866,7 @@ static int ventoy_collect_img_files(const char *filename, const struct grub_dirh
|
|||||||
|
|
||||||
img->alias = ventoy_plugin_get_menu_alias(vtoy_alias_image_file, img->path);
|
img->alias = ventoy_plugin_get_menu_alias(vtoy_alias_image_file, img->path);
|
||||||
|
|
||||||
tip = ventoy_plugin_get_menu_tip(img->path);
|
tip = ventoy_plugin_get_menu_tip(vtoy_tip_image_file, img->path);
|
||||||
if (tip)
|
if (tip)
|
||||||
{
|
{
|
||||||
img->tip1 = tip->tip1;
|
img->tip1 = tip->tip1;
|
||||||
@@ -2035,7 +2067,8 @@ static int ventoy_dynamic_tree_menu(img_iterator_node *node)
|
|||||||
const char *dir_class = NULL;
|
const char *dir_class = NULL;
|
||||||
const char *dir_alias = NULL;
|
const char *dir_alias = NULL;
|
||||||
img_iterator_node *child = NULL;
|
img_iterator_node *child = NULL;
|
||||||
|
const menu_tip *tip = NULL;
|
||||||
|
|
||||||
if (node->isocnt == 0 || node->done == 1)
|
if (node->isocnt == 0 || node->done == 1)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
@@ -2075,20 +2108,22 @@ static int ventoy_dynamic_tree_menu(img_iterator_node *node)
|
|||||||
dir_class = "vtoydir";
|
dir_class = "vtoydir";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tip = ventoy_plugin_get_menu_tip(vtoy_tip_directory, node->dir);
|
||||||
|
|
||||||
dir_alias = ventoy_plugin_get_menu_alias(vtoy_alias_directory, node->dir);
|
dir_alias = ventoy_plugin_get_menu_alias(vtoy_alias_directory, node->dir);
|
||||||
if (dir_alias)
|
if (dir_alias)
|
||||||
{
|
{
|
||||||
if (g_tree_view_menu_style == 0)
|
if (g_tree_view_menu_style == 0)
|
||||||
{
|
{
|
||||||
vtoy_ssprintf(g_tree_script_buf, g_tree_script_pos,
|
vtoy_ssprintf(g_tree_script_buf, g_tree_script_pos,
|
||||||
"submenu \"%-10s %s\" --class=\"%s\" --id=\"DIR_%s\" {\n",
|
"submenu \"%-10s %s\" --class=\"%s\" --id=\"DIR_%s\" _VTIP_%p {\n",
|
||||||
"DIR", dir_alias, dir_class, node->dir + offset);
|
"DIR", dir_alias, dir_class, node->dir + offset, tip);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
vtoy_ssprintf(g_tree_script_buf, g_tree_script_pos,
|
vtoy_ssprintf(g_tree_script_buf, g_tree_script_pos,
|
||||||
"submenu \"%s\" --class=\"%s\" --id=\"DIR_%s\" {\n",
|
"submenu \"%s\" --class=\"%s\" --id=\"DIR_%s\" _VTIP_%p {\n",
|
||||||
dir_alias, dir_class, node->dir + offset);
|
dir_alias, dir_class, node->dir + offset, tip);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -2098,14 +2133,14 @@ static int ventoy_dynamic_tree_menu(img_iterator_node *node)
|
|||||||
if (g_tree_view_menu_style == 0)
|
if (g_tree_view_menu_style == 0)
|
||||||
{
|
{
|
||||||
vtoy_ssprintf(g_tree_script_buf, g_tree_script_pos,
|
vtoy_ssprintf(g_tree_script_buf, g_tree_script_pos,
|
||||||
"submenu \"%-10s [%s]\" --class=\"%s\" --id=\"DIR_%s\" {\n",
|
"submenu \"%-10s [%s]\" --class=\"%s\" --id=\"DIR_%s\" _VTIP_%p {\n",
|
||||||
"DIR", dir_alias, dir_class, node->dir + offset);
|
"DIR", dir_alias, dir_class, node->dir + offset, tip);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
vtoy_ssprintf(g_tree_script_buf, g_tree_script_pos,
|
vtoy_ssprintf(g_tree_script_buf, g_tree_script_pos,
|
||||||
"submenu \"[%s]\" --class=\"%s\" --id=\"DIR_%s\" {\n",
|
"submenu \"[%s]\" --class=\"%s\" --id=\"DIR_%s\" _VTIP_%p {\n",
|
||||||
dir_alias, dir_class, node->dir + offset);
|
dir_alias, dir_class, node->dir + offset, tip);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2669,6 +2704,22 @@ grub_uint32_t ventoy_get_iso_boot_catlog(grub_file_t file)
|
|||||||
return desc.sector;
|
return desc.sector;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static grub_uint32_t ventoy_get_bios_eltorito_rba(grub_file_t file, grub_uint32_t sector)
|
||||||
|
{
|
||||||
|
grub_uint8_t buf[512];
|
||||||
|
|
||||||
|
grub_file_seek(file, sector * 2048);
|
||||||
|
grub_file_read(file, buf, sizeof(buf));
|
||||||
|
|
||||||
|
if (buf[0] == 0x01 && buf[1] == 0x00 &&
|
||||||
|
buf[30] == 0x55 && buf[31] == 0xaa && buf[32] == 0x88)
|
||||||
|
{
|
||||||
|
return *((grub_uint32_t *)(buf + 40));
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int ventoy_has_efi_eltorito(grub_file_t file, grub_uint32_t sector)
|
int ventoy_has_efi_eltorito(grub_file_t file, grub_uint32_t sector)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
@@ -2946,6 +2997,7 @@ static grub_err_t ventoy_cmd_img_sector(grub_extcmd_context_t ctxt, int argc, ch
|
|||||||
}
|
}
|
||||||
|
|
||||||
grub_memset(&g_grub_param->file_replace, 0, sizeof(g_grub_param->file_replace));
|
grub_memset(&g_grub_param->file_replace, 0, sizeof(g_grub_param->file_replace));
|
||||||
|
grub_memset(&g_grub_param->img_replace, 0, sizeof(g_grub_param->img_replace));
|
||||||
VENTOY_CMD_RETURN(GRUB_ERR_NONE);
|
VENTOY_CMD_RETURN(GRUB_ERR_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2977,15 +3029,21 @@ static grub_err_t ventoy_select_conf_replace(grub_extcmd_context_t ctxt, int arg
|
|||||||
debug("Find conf replace for %s\n", args[1]);
|
debug("Find conf replace for %s\n", args[1]);
|
||||||
|
|
||||||
file = ventoy_grub_file_open(VENTOY_FILE_TYPE, "(loop)%s", node->orgconf);
|
file = ventoy_grub_file_open(VENTOY_FILE_TYPE, "(loop)%s", node->orgconf);
|
||||||
if (!file)
|
if (file)
|
||||||
|
{
|
||||||
|
offset = grub_iso9660_get_last_file_dirent_pos(file);
|
||||||
|
grub_file_close(file);
|
||||||
|
}
|
||||||
|
else if (node->img > 0)
|
||||||
|
{
|
||||||
|
offset = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
debug("<(loop)%s> NOT exist\n", node->orgconf);
|
debug("<(loop)%s> NOT exist\n", node->orgconf);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
offset = grub_iso9660_get_last_file_dirent_pos(file);
|
|
||||||
grub_file_close(file);
|
|
||||||
|
|
||||||
file = ventoy_grub_file_open(VENTOY_FILE_TYPE, "%s%s", args[0], node->newconf);
|
file = ventoy_grub_file_open(VENTOY_FILE_TYPE, "%s%s", args[0], node->newconf);
|
||||||
if (!file)
|
if (!file)
|
||||||
{
|
{
|
||||||
@@ -3008,6 +3066,13 @@ static grub_err_t ventoy_select_conf_replace(grub_extcmd_context_t ctxt, int arg
|
|||||||
g_conf_replace_node = node;
|
g_conf_replace_node = node;
|
||||||
g_conf_replace_offset = offset + 2;
|
g_conf_replace_offset = offset + 2;
|
||||||
|
|
||||||
|
if (node->img > 0)
|
||||||
|
{
|
||||||
|
g_grub_param->img_replace.magic = GRUB_IMG_REPLACE_MAGIC;
|
||||||
|
g_grub_param->img_replace.old_name_cnt = 1;
|
||||||
|
grub_snprintf(g_grub_param->img_replace.old_file_name[0], 256, "%s", node->orgconf);
|
||||||
|
}
|
||||||
|
|
||||||
debug("conf_replace OK: newlen: %d\n", g_conf_replace_new_len);
|
debug("conf_replace OK: newlen: %d\n", g_conf_replace_new_len);
|
||||||
|
|
||||||
end:
|
end:
|
||||||
@@ -4820,7 +4885,7 @@ static int ventoy_chk_case_file(const char *filename, const struct grub_dirhook_
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (0 == info->dir && grub_strncasecmp(filename, "ventoy.json", 11) == 0)
|
if (0 == info->dir && grub_strcasecmp(filename, "ventoy.json") == 0)
|
||||||
{
|
{
|
||||||
grub_snprintf(g_json_case_mis_path, 32, "%s/%s", (char *)data, filename);
|
grub_snprintf(g_json_case_mis_path, 32, "%s/%s", (char *)data, filename);
|
||||||
return 1;
|
return 1;
|
||||||
@@ -4840,7 +4905,7 @@ static int ventoy_chk_case_dir(const char *filename, const struct grub_dirhook_i
|
|||||||
|
|
||||||
if (info->dir && (filename[0] == 'v' || filename[0] == 'V'))
|
if (info->dir && (filename[0] == 'v' || filename[0] == 'V'))
|
||||||
{
|
{
|
||||||
if (grub_strncasecmp(filename, "ventoy", 6) == 0)
|
if (grub_strcasecmp(filename, "ventoy") == 0)
|
||||||
{
|
{
|
||||||
grub_snprintf(path, sizeof(path), "/%s", filename);
|
grub_snprintf(path, sizeof(path), "/%s", filename);
|
||||||
fs_dir->fs->fs_dir(fs_dir->dev, path, ventoy_chk_case_file, path);
|
fs_dir->fs->fs_dir(fs_dir->dev, path, ventoy_chk_case_file, path);
|
||||||
@@ -4961,26 +5026,71 @@ static grub_err_t grub_cmd_gptpriority(grub_extcmd_context_t ctxt, int argc, cha
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static grub_err_t grub_cmd_syslinux_nojoliet(grub_extcmd_context_t ctxt, int argc, char **args)
|
||||||
/* <BEGIN>: Deleted by longpanda, 20210916 PN:XX LABEL:XX */
|
|
||||||
#if 0
|
|
||||||
void ventoy_tip_set_menu_label(const char *vid)
|
|
||||||
{
|
{
|
||||||
img_info *node;
|
int ret = 1;
|
||||||
|
int joliet = 0;
|
||||||
|
grub_file_t file = NULL;
|
||||||
|
grub_uint32_t loadrba = 0;
|
||||||
|
grub_uint32_t boot_catlog = 0;
|
||||||
|
grub_uint8_t sector[512];
|
||||||
|
boot_info_table *info = NULL;
|
||||||
|
|
||||||
|
(void)ctxt;
|
||||||
|
(void)argc;
|
||||||
|
|
||||||
g_ventoy_tip_msg1 = g_ventoy_tip_msg2 = NULL;
|
/* This also trigger a iso9660 fs parse */
|
||||||
if (vid)
|
if (ventoy_check_file_exist("(loop)/isolinux/isolinux.cfg"))
|
||||||
{
|
{
|
||||||
node = (img_info *)(void *)grub_strtoul(vid + 4, NULL, 16);
|
return 0;
|
||||||
if (node)
|
|
||||||
{
|
|
||||||
g_ventoy_tip_msg1 = node->tip1;
|
|
||||||
g_ventoy_tip_msg2 = node->tip2;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
joliet = grub_iso9660_is_joliet();
|
||||||
|
if (joliet == 0)
|
||||||
|
{
|
||||||
|
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 %u\n", boot_catlog);
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
loadrba = ventoy_get_bios_eltorito_rba(file, boot_catlog);
|
||||||
|
if (loadrba == 0)
|
||||||
|
{
|
||||||
|
debug("no bios eltorito rba found %u\n", loadrba);
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
grub_file_seek(file, loadrba * 2048);
|
||||||
|
grub_file_read(file, sector, 512);
|
||||||
|
|
||||||
|
info = (boot_info_table *)sector;
|
||||||
|
if (info->bi_data0 == 0x7c6ceafa &&
|
||||||
|
info->bi_data1 == 0x90900000 &&
|
||||||
|
info->bi_PrimaryVolumeDescriptor == 16 &&
|
||||||
|
info->bi_BootFileLocation == loadrba)
|
||||||
|
{
|
||||||
|
debug("bootloader is syslinux, %u.\n", loadrba);
|
||||||
|
ret = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
out:
|
||||||
|
|
||||||
|
grub_file_close(file);
|
||||||
|
grub_errno = GRUB_ERR_NONE;
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
#endif /* #if 0 */
|
|
||||||
/* <END> : Deleted by longpanda, 20210916 PN:XX LABEL:XX */
|
|
||||||
|
|
||||||
int ventoy_env_init(void)
|
int ventoy_env_init(void)
|
||||||
{
|
{
|
||||||
@@ -5037,6 +5147,7 @@ static cmd_para ventoy_cmds[] =
|
|||||||
{ "vt_mod", ventoy_cmd_mod, 0, NULL, "{Int} {Int} {Var}", "mod integer variable", NULL },
|
{ "vt_mod", ventoy_cmd_mod, 0, NULL, "{Int} {Int} {Var}", "mod integer variable", NULL },
|
||||||
{ "vt_strstr", ventoy_cmd_strstr, 0, NULL, "", "", NULL },
|
{ "vt_strstr", ventoy_cmd_strstr, 0, NULL, "", "", NULL },
|
||||||
{ "vt_str_begin", ventoy_cmd_strbegin, 0, NULL, "", "", NULL },
|
{ "vt_str_begin", ventoy_cmd_strbegin, 0, NULL, "", "", NULL },
|
||||||
|
{ "vt_str_casebegin", ventoy_cmd_strcasebegin, 0, NULL, "", "", NULL },
|
||||||
{ "vt_debug", ventoy_cmd_debug, 0, NULL, "{on|off}", "turn debug on/off", NULL },
|
{ "vt_debug", ventoy_cmd_debug, 0, NULL, "{on|off}", "turn debug on/off", NULL },
|
||||||
{ "vtdebug", ventoy_cmd_debug, 0, NULL, "{on|off}", "turn debug on/off", NULL },
|
{ "vtdebug", ventoy_cmd_debug, 0, NULL, "{on|off}", "turn debug on/off", NULL },
|
||||||
{ "vtbreak", ventoy_cmd_break, 0, NULL, "{level}", "set debug break", NULL },
|
{ "vtbreak", ventoy_cmd_break, 0, NULL, "{level}", "set debug break", NULL },
|
||||||
@@ -5164,6 +5275,7 @@ static cmd_para ventoy_cmds[] =
|
|||||||
{ "vt_check_json_path_case", ventoy_cmd_chk_json_pathcase, 0, NULL, "", "", NULL },
|
{ "vt_check_json_path_case", ventoy_cmd_chk_json_pathcase, 0, NULL, "", "", NULL },
|
||||||
{ "vt_append_extra_sector", ventoy_cmd_append_ext_sector, 0, NULL, "", "", NULL },
|
{ "vt_append_extra_sector", ventoy_cmd_append_ext_sector, 0, NULL, "", "", NULL },
|
||||||
{ "gptpriority", grub_cmd_gptpriority, 0, NULL, "", "", NULL },
|
{ "gptpriority", grub_cmd_gptpriority, 0, NULL, "", "", NULL },
|
||||||
|
{ "vt_syslinux_need_nojoliet", grub_cmd_syslinux_nojoliet, 0, NULL, "", "", NULL },
|
||||||
};
|
};
|
||||||
|
|
||||||
int ventoy_register_all_cmd(void)
|
int ventoy_register_all_cmd(void)
|
||||||
|
@@ -199,6 +199,18 @@ typedef struct ventoy_iso9660_vd
|
|||||||
grub_uint32_t space;
|
grub_uint32_t space;
|
||||||
}ventoy_iso9660_vd;
|
}ventoy_iso9660_vd;
|
||||||
|
|
||||||
|
/* https://wiki.osdev.org/El-Torito */
|
||||||
|
typedef struct boot_info_table
|
||||||
|
{
|
||||||
|
grub_uint32_t bi_data0;
|
||||||
|
grub_uint32_t bi_data1;
|
||||||
|
grub_uint32_t bi_PrimaryVolumeDescriptor;
|
||||||
|
grub_uint32_t bi_BootFileLocation;
|
||||||
|
grub_uint32_t bi_BootFileLength;
|
||||||
|
grub_uint32_t bi_Checksum;
|
||||||
|
grub_uint8_t bi_Reserved[40];
|
||||||
|
}boot_info_table;
|
||||||
|
|
||||||
#pragma pack()
|
#pragma pack()
|
||||||
|
|
||||||
#define img_type_start 0
|
#define img_type_start 0
|
||||||
@@ -550,6 +562,7 @@ typedef struct plugin_entry
|
|||||||
const char *key;
|
const char *key;
|
||||||
ventoy_plugin_entry_pf entryfunc;
|
ventoy_plugin_entry_pf entryfunc;
|
||||||
ventoy_plugin_check_pf checkfunc;
|
ventoy_plugin_check_pf checkfunc;
|
||||||
|
int flag;
|
||||||
}plugin_entry;
|
}plugin_entry;
|
||||||
|
|
||||||
typedef struct replace_fs_dir
|
typedef struct replace_fs_dir
|
||||||
@@ -883,8 +896,11 @@ typedef struct menu_alias
|
|||||||
struct menu_alias *next;
|
struct menu_alias *next;
|
||||||
}menu_alias;
|
}menu_alias;
|
||||||
|
|
||||||
|
#define vtoy_tip_image_file 0
|
||||||
|
#define vtoy_tip_directory 1
|
||||||
typedef struct menu_tip
|
typedef struct menu_tip
|
||||||
{
|
{
|
||||||
|
int type;
|
||||||
int pathlen;
|
int pathlen;
|
||||||
char isopath[256];
|
char isopath[256];
|
||||||
char tip1[1024];
|
char tip1[1024];
|
||||||
@@ -925,6 +941,7 @@ typedef struct custom_boot
|
|||||||
typedef struct conf_replace
|
typedef struct conf_replace
|
||||||
{
|
{
|
||||||
int pathlen;
|
int pathlen;
|
||||||
|
int img;
|
||||||
char isopath[256];
|
char isopath[256];
|
||||||
char orgconf[256];
|
char orgconf[256];
|
||||||
char newconf[256];
|
char newconf[256];
|
||||||
@@ -1049,7 +1066,7 @@ int ventoy_fill_windows_rtdata(void *buf, char *isopath);
|
|||||||
int ventoy_plugin_get_persistent_chunklist(const char *isopath, int index, ventoy_img_chunk_list *chunk_list);
|
int ventoy_plugin_get_persistent_chunklist(const char *isopath, int index, ventoy_img_chunk_list *chunk_list);
|
||||||
const char * ventoy_plugin_get_injection(const char *isopath);
|
const char * ventoy_plugin_get_injection(const char *isopath);
|
||||||
const char * ventoy_plugin_get_menu_alias(int type, const char *isopath);
|
const char * ventoy_plugin_get_menu_alias(int type, const char *isopath);
|
||||||
const menu_tip * ventoy_plugin_get_menu_tip(const char *isopath);
|
const menu_tip * ventoy_plugin_get_menu_tip(int type, const char *isopath);
|
||||||
const char * ventoy_plugin_get_menu_class(int type, const char *name, const char *path);
|
const char * ventoy_plugin_get_menu_class(int type, const char *name, const char *path);
|
||||||
int ventoy_plugin_check_memdisk(const char *isopath);
|
int ventoy_plugin_check_memdisk(const char *isopath);
|
||||||
int ventoy_plugin_get_image_list_index(int type, const char *name);
|
int ventoy_plugin_get_image_list_index(int type, const char *name);
|
||||||
@@ -1109,5 +1126,7 @@ int ventoy_chain_file_read(const char *path, int offset, int len, void *buf);
|
|||||||
|
|
||||||
#define ret_goto_end(a) ret = a; goto end;
|
#define ret_goto_end(a) ret = a; goto end;
|
||||||
|
|
||||||
|
extern ventoy_grub_param *g_grub_param;
|
||||||
|
|
||||||
#endif /* __VENTOY_DEF_H__ */
|
#endif /* __VENTOY_DEF_H__ */
|
||||||
|
|
||||||
|
@@ -691,6 +691,7 @@ static grub_uint32_t ventoy_linux_get_virt_chunk_size(void)
|
|||||||
static void ventoy_linux_fill_virt_data( grub_uint64_t isosize, ventoy_chain_head *chain)
|
static void ventoy_linux_fill_virt_data( grub_uint64_t isosize, ventoy_chain_head *chain)
|
||||||
{
|
{
|
||||||
int id = 0;
|
int id = 0;
|
||||||
|
int virtid = 0;
|
||||||
initrd_info *node;
|
initrd_info *node;
|
||||||
grub_uint64_t sector;
|
grub_uint64_t sector;
|
||||||
grub_uint32_t offset;
|
grub_uint32_t offset;
|
||||||
@@ -738,6 +739,7 @@ static void ventoy_linux_fill_virt_data( grub_uint64_t isosize, ventoy_chain_
|
|||||||
offset += g_ventoy_cpio_size;
|
offset += g_ventoy_cpio_size;
|
||||||
sector += cpio_secs + initrd_secs;
|
sector += cpio_secs + initrd_secs;
|
||||||
cur++;
|
cur++;
|
||||||
|
virtid++;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Lenovo EasyStartup need an addional sector for boundary check */
|
/* Lenovo EasyStartup need an addional sector for boundary check */
|
||||||
@@ -759,6 +761,7 @@ static void ventoy_linux_fill_virt_data( grub_uint64_t isosize, ventoy_chain_
|
|||||||
offset += VTOY_APPEND_EXT_SIZE;
|
offset += VTOY_APPEND_EXT_SIZE;
|
||||||
sector += cpio_secs;
|
sector += cpio_secs;
|
||||||
cur++;
|
cur++;
|
||||||
|
virtid++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_conf_replace_offset > 0)
|
if (g_conf_replace_offset > 0)
|
||||||
@@ -776,9 +779,15 @@ static void ventoy_linux_fill_virt_data( grub_uint64_t isosize, ventoy_chain_
|
|||||||
|
|
||||||
chain->virt_img_size_in_bytes += g_conf_replace_new_len_align;
|
chain->virt_img_size_in_bytes += g_conf_replace_new_len_align;
|
||||||
|
|
||||||
|
if (g_grub_param->img_replace.magic == GRUB_IMG_REPLACE_MAGIC)
|
||||||
|
{
|
||||||
|
g_grub_param->img_replace.new_file_virtual_id = virtid;
|
||||||
|
}
|
||||||
|
|
||||||
offset += g_conf_replace_new_len_align;
|
offset += g_conf_replace_new_len_align;
|
||||||
sector += cpio_secs;
|
sector += cpio_secs;
|
||||||
cur++;
|
cur++;
|
||||||
|
virtid++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
@@ -1478,6 +1478,7 @@ static int ventoy_plugin_menualias_entry(VTOY_JSON *json, const char *isodisk)
|
|||||||
|
|
||||||
static int ventoy_plugin_menutip_check(VTOY_JSON *json, const char *isodisk)
|
static int ventoy_plugin_menutip_check(VTOY_JSON *json, const char *isodisk)
|
||||||
{
|
{
|
||||||
|
int type;
|
||||||
const char *path = NULL;
|
const char *path = NULL;
|
||||||
const char *tip = NULL;
|
const char *tip = NULL;
|
||||||
VTOY_JSON *pNode = NULL;
|
VTOY_JSON *pNode = NULL;
|
||||||
@@ -1511,20 +1512,41 @@ static int ventoy_plugin_menutip_check(VTOY_JSON *json, const char *isodisk)
|
|||||||
pNode = vtoy_json_find_item(json->pstChild, JSON_TYPE_ARRAY, "tips");
|
pNode = vtoy_json_find_item(json->pstChild, JSON_TYPE_ARRAY, "tips");
|
||||||
for (pNode = pNode->pstChild; pNode; pNode = pNode->pstNext)
|
for (pNode = pNode->pstChild; pNode; pNode = pNode->pstNext)
|
||||||
{
|
{
|
||||||
|
type = vtoy_tip_image_file;
|
||||||
path = vtoy_json_get_string_ex(pNode->pstChild, "image");
|
path = vtoy_json_get_string_ex(pNode->pstChild, "image");
|
||||||
|
if (!path)
|
||||||
|
{
|
||||||
|
path = vtoy_json_get_string_ex(pNode->pstChild, "dir");
|
||||||
|
type = vtoy_tip_directory;
|
||||||
|
}
|
||||||
|
|
||||||
if (path && path[0] == '/')
|
if (path && path[0] == '/')
|
||||||
{
|
{
|
||||||
if (grub_strchr(path, '*'))
|
if (vtoy_tip_image_file == type)
|
||||||
{
|
{
|
||||||
grub_printf("image: <%s> [ * ]\n", path);
|
if (grub_strchr(path, '*'))
|
||||||
}
|
{
|
||||||
else if (ventoy_check_file_exist("%s%s", isodisk, path))
|
grub_printf("image: <%s> [ * ]\n", path);
|
||||||
{
|
}
|
||||||
grub_printf("image: <%s> [ OK ]\n", path);
|
else if (ventoy_is_file_exist("%s%s", isodisk, path))
|
||||||
|
{
|
||||||
|
grub_printf("image: <%s> [ OK ]\n", path);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
grub_printf("image: <%s> [ NOT EXIST ]\n", path);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
grub_printf("image: <%s> [ NOT EXIST ]\n", path);
|
if (ventoy_is_dir_exist("%s%s", isodisk, path))
|
||||||
|
{
|
||||||
|
grub_printf("dir: <%s> [ OK ]\n", path);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
grub_printf("dir: <%s> [ NOT EXIST ]\n", path);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tip = vtoy_json_get_string_ex(pNode->pstChild, "tip");
|
tip = vtoy_json_get_string_ex(pNode->pstChild, "tip");
|
||||||
@@ -1558,6 +1580,7 @@ static int ventoy_plugin_menutip_check(VTOY_JSON *json, const char *isodisk)
|
|||||||
|
|
||||||
static int ventoy_plugin_menutip_entry(VTOY_JSON *json, const char *isodisk)
|
static int ventoy_plugin_menutip_entry(VTOY_JSON *json, const char *isodisk)
|
||||||
{
|
{
|
||||||
|
int type;
|
||||||
const char *path = NULL;
|
const char *path = NULL;
|
||||||
const char *tip = NULL;
|
const char *tip = NULL;
|
||||||
VTOY_JSON *pNode = NULL;
|
VTOY_JSON *pNode = NULL;
|
||||||
@@ -1610,12 +1633,20 @@ static int ventoy_plugin_menutip_entry(VTOY_JSON *json, const char *isodisk)
|
|||||||
|
|
||||||
for (pNode = pNode->pstChild; pNode; pNode = pNode->pstNext)
|
for (pNode = pNode->pstChild; pNode; pNode = pNode->pstNext)
|
||||||
{
|
{
|
||||||
|
type = vtoy_tip_image_file;
|
||||||
path = vtoy_json_get_string_ex(pNode->pstChild, "image");
|
path = vtoy_json_get_string_ex(pNode->pstChild, "image");
|
||||||
|
if (!path)
|
||||||
|
{
|
||||||
|
path = vtoy_json_get_string_ex(pNode->pstChild, "dir");
|
||||||
|
type = vtoy_tip_directory;
|
||||||
|
}
|
||||||
|
|
||||||
if (path && path[0] == '/')
|
if (path && path[0] == '/')
|
||||||
{
|
{
|
||||||
node = grub_zalloc(sizeof(menu_tip));
|
node = grub_zalloc(sizeof(menu_tip));
|
||||||
if (node)
|
if (node)
|
||||||
{
|
{
|
||||||
|
node->type = type;
|
||||||
node->pathlen = grub_snprintf(node->isopath, sizeof(node->isopath), "%s", path);
|
node->pathlen = grub_snprintf(node->isopath, sizeof(node->isopath), "%s", path);
|
||||||
|
|
||||||
tip = vtoy_json_get_string_ex(pNode->pstChild, "tip");
|
tip = vtoy_json_get_string_ex(pNode->pstChild, "tip");
|
||||||
@@ -2005,6 +2036,7 @@ static int ventoy_plugin_custom_boot_check(VTOY_JSON *json, const char *isodisk)
|
|||||||
|
|
||||||
static int ventoy_plugin_conf_replace_entry(VTOY_JSON *json, const char *isodisk)
|
static int ventoy_plugin_conf_replace_entry(VTOY_JSON *json, const char *isodisk)
|
||||||
{
|
{
|
||||||
|
int img = 0;
|
||||||
const char *isof = NULL;
|
const char *isof = NULL;
|
||||||
const char *orgf = NULL;
|
const char *orgf = NULL;
|
||||||
const char *newf = NULL;
|
const char *newf = NULL;
|
||||||
@@ -2042,6 +2074,11 @@ static int ventoy_plugin_conf_replace_entry(VTOY_JSON *json, const char *isodisk
|
|||||||
node = grub_zalloc(sizeof(conf_replace));
|
node = grub_zalloc(sizeof(conf_replace));
|
||||||
if (node)
|
if (node)
|
||||||
{
|
{
|
||||||
|
if (JSON_SUCCESS == vtoy_json_get_int(pNode->pstChild, "img", &img))
|
||||||
|
{
|
||||||
|
node->img = img;
|
||||||
|
}
|
||||||
|
|
||||||
node->pathlen = grub_snprintf(node->isopath, sizeof(node->isopath), "%s", isof);
|
node->pathlen = grub_snprintf(node->isopath, sizeof(node->isopath), "%s", isof);
|
||||||
grub_snprintf(node->orgconf, sizeof(node->orgconf), "%s", orgf);
|
grub_snprintf(node->orgconf, sizeof(node->orgconf), "%s", orgf);
|
||||||
grub_snprintf(node->newconf, sizeof(node->newconf), "%s", newf);
|
grub_snprintf(node->newconf, sizeof(node->newconf), "%s", newf);
|
||||||
@@ -2064,6 +2101,7 @@ static int ventoy_plugin_conf_replace_entry(VTOY_JSON *json, const char *isodisk
|
|||||||
|
|
||||||
static int ventoy_plugin_conf_replace_check(VTOY_JSON *json, const char *isodisk)
|
static int ventoy_plugin_conf_replace_check(VTOY_JSON *json, const char *isodisk)
|
||||||
{
|
{
|
||||||
|
int img = 0;
|
||||||
const char *isof = NULL;
|
const char *isof = NULL;
|
||||||
const char *orgf = NULL;
|
const char *orgf = NULL;
|
||||||
const char *newf = NULL;
|
const char *newf = NULL;
|
||||||
@@ -2133,7 +2171,7 @@ static int ventoy_plugin_conf_replace_check(VTOY_JSON *json, const char *isodisk
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
grub_printf("new:<%s> [OK]\n", newf);
|
grub_printf("new1:<%s> [OK]\n", newf);
|
||||||
}
|
}
|
||||||
grub_file_close(file);
|
grub_file_close(file);
|
||||||
}
|
}
|
||||||
@@ -2141,6 +2179,12 @@ static int ventoy_plugin_conf_replace_check(VTOY_JSON *json, const char *isodisk
|
|||||||
{
|
{
|
||||||
grub_printf("new:<%s> [NOT Exist]\n", newf);
|
grub_printf("new:<%s> [NOT Exist]\n", newf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (JSON_SUCCESS == vtoy_json_get_int(pNode->pstChild, "img", &img))
|
||||||
|
{
|
||||||
|
grub_printf("img:<%d>\n", img);
|
||||||
|
}
|
||||||
|
|
||||||
grub_printf("\n");
|
grub_printf("\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2325,45 +2369,59 @@ static int ventoy_plugin_image_list_check(VTOY_JSON *json, const char *isodisk)
|
|||||||
|
|
||||||
static plugin_entry g_plugin_entries[] =
|
static plugin_entry g_plugin_entries[] =
|
||||||
{
|
{
|
||||||
{ "control", ventoy_plugin_control_entry, ventoy_plugin_control_check },
|
{ "control", ventoy_plugin_control_entry, ventoy_plugin_control_check, 0 },
|
||||||
{ "theme", ventoy_plugin_theme_entry, ventoy_plugin_theme_check },
|
{ "theme", ventoy_plugin_theme_entry, ventoy_plugin_theme_check, 0 },
|
||||||
{ "auto_install", ventoy_plugin_auto_install_entry, ventoy_plugin_auto_install_check },
|
{ "auto_install", ventoy_plugin_auto_install_entry, ventoy_plugin_auto_install_check, 0 },
|
||||||
{ "persistence", ventoy_plugin_persistence_entry, ventoy_plugin_persistence_check },
|
{ "persistence", ventoy_plugin_persistence_entry, ventoy_plugin_persistence_check, 0 },
|
||||||
{ "menu_alias", ventoy_plugin_menualias_entry, ventoy_plugin_menualias_check },
|
{ "menu_alias", ventoy_plugin_menualias_entry, ventoy_plugin_menualias_check, 0 },
|
||||||
{ "menu_tip", ventoy_plugin_menutip_entry, ventoy_plugin_menutip_check },
|
{ "menu_tip", ventoy_plugin_menutip_entry, ventoy_plugin_menutip_check, 0 },
|
||||||
{ "menu_class", ventoy_plugin_menuclass_entry, ventoy_plugin_menuclass_check },
|
{ "menu_class", ventoy_plugin_menuclass_entry, ventoy_plugin_menuclass_check, 0 },
|
||||||
{ "injection", ventoy_plugin_injection_entry, ventoy_plugin_injection_check },
|
{ "injection", ventoy_plugin_injection_entry, ventoy_plugin_injection_check, 0 },
|
||||||
{ "auto_memdisk", ventoy_plugin_auto_memdisk_entry, ventoy_plugin_auto_memdisk_check },
|
{ "auto_memdisk", ventoy_plugin_auto_memdisk_entry, ventoy_plugin_auto_memdisk_check, 0 },
|
||||||
{ "image_list", ventoy_plugin_image_list_entry, ventoy_plugin_image_list_check },
|
{ "image_list", ventoy_plugin_image_list_entry, ventoy_plugin_image_list_check, 0 },
|
||||||
{ "image_blacklist", ventoy_plugin_image_list_entry, ventoy_plugin_image_list_check },
|
{ "image_blacklist", ventoy_plugin_image_list_entry, ventoy_plugin_image_list_check, 0 },
|
||||||
{ "conf_replace", ventoy_plugin_conf_replace_entry, ventoy_plugin_conf_replace_check },
|
{ "conf_replace", ventoy_plugin_conf_replace_entry, ventoy_plugin_conf_replace_check, 0 },
|
||||||
{ "dud", ventoy_plugin_dud_entry, ventoy_plugin_dud_check },
|
{ "dud", ventoy_plugin_dud_entry, ventoy_plugin_dud_check, 0 },
|
||||||
{ "password", ventoy_plugin_pwd_entry, ventoy_plugin_pwd_check },
|
{ "password", ventoy_plugin_pwd_entry, ventoy_plugin_pwd_check, 0 },
|
||||||
{ "custom_boot", ventoy_plugin_custom_boot_entry, ventoy_plugin_custom_boot_check },
|
{ "custom_boot", ventoy_plugin_custom_boot_entry, ventoy_plugin_custom_boot_check, 0 },
|
||||||
};
|
};
|
||||||
|
|
||||||
static int ventoy_parse_plugin_config(VTOY_JSON *json, const char *isodisk)
|
static int ventoy_parse_plugin_config(VTOY_JSON *json, const char *isodisk)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
char key[128];
|
char key[128];
|
||||||
VTOY_JSON *cur = json;
|
VTOY_JSON *cur = NULL;
|
||||||
|
|
||||||
grub_snprintf(g_iso_disk_name, sizeof(g_iso_disk_name), "%s", isodisk);
|
grub_snprintf(g_iso_disk_name, sizeof(g_iso_disk_name), "%s", isodisk);
|
||||||
|
|
||||||
while (cur)
|
for (cur = json; cur; cur = cur->pstNext)
|
||||||
{
|
{
|
||||||
for (i = 0; i < (int)ARRAY_SIZE(g_plugin_entries); i++)
|
for (i = 0; i < (int)ARRAY_SIZE(g_plugin_entries); i++)
|
||||||
{
|
{
|
||||||
grub_snprintf(key, sizeof(key), "%s_%s", g_plugin_entries[i].key, g_arch_mode_suffix);
|
grub_snprintf(key, sizeof(key), "%s_%s", g_plugin_entries[i].key, g_arch_mode_suffix);
|
||||||
if (grub_strcmp(g_plugin_entries[i].key, cur->pcName) == 0 || grub_strcmp(key, cur->pcName) == 0)
|
if (g_plugin_entries[i].flag == 0 && grub_strcmp(key, cur->pcName) == 0)
|
||||||
{
|
{
|
||||||
debug("Plugin entry for %s\n", g_plugin_entries[i].key);
|
debug("Plugin entry for %s\n", g_plugin_entries[i].key);
|
||||||
g_plugin_entries[i].entryfunc(cur, isodisk);
|
g_plugin_entries[i].entryfunc(cur, isodisk);
|
||||||
|
g_plugin_entries[i].flag = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
cur = cur->pstNext;
|
for (cur = json; cur; cur = cur->pstNext)
|
||||||
|
{
|
||||||
|
for (i = 0; i < (int)ARRAY_SIZE(g_plugin_entries); i++)
|
||||||
|
{
|
||||||
|
if (g_plugin_entries[i].flag == 0 && grub_strcmp(g_plugin_entries[i].key, cur->pcName) == 0)
|
||||||
|
{
|
||||||
|
debug("Plugin entry for %s\n", g_plugin_entries[i].key);
|
||||||
|
g_plugin_entries[i].entryfunc(cur, isodisk);
|
||||||
|
g_plugin_entries[i].flag = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@@ -2372,7 +2430,9 @@ static int ventoy_parse_plugin_config(VTOY_JSON *json, const char *isodisk)
|
|||||||
grub_err_t ventoy_cmd_load_plugin(grub_extcmd_context_t ctxt, int argc, char **args)
|
grub_err_t ventoy_cmd_load_plugin(grub_extcmd_context_t ctxt, int argc, char **args)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
int offset = 0;
|
||||||
char *buf = NULL;
|
char *buf = NULL;
|
||||||
|
grub_uint8_t *code = NULL;
|
||||||
grub_file_t file;
|
grub_file_t file;
|
||||||
VTOY_JSON *json = NULL;
|
VTOY_JSON *json = NULL;
|
||||||
|
|
||||||
@@ -2409,9 +2469,25 @@ grub_err_t ventoy_cmd_load_plugin(grub_extcmd_context_t ctxt, int argc, char **a
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
code = (grub_uint8_t *)buf;
|
||||||
|
if (code[0] == 0xef && code[1] == 0xbb && code[2] == 0xbf)
|
||||||
|
{
|
||||||
|
offset = 3; /* Skip UTF-8 BOM */
|
||||||
|
}
|
||||||
|
else if ((code[0] == 0xff && code[1] == 0xfe) || (code[0] == 0xfe && code[1] == 0xff))
|
||||||
|
{
|
||||||
|
grub_env_set("VTOY_PLUGIN_SYNTAX_ERROR", "1");
|
||||||
|
grub_env_export("VTOY_PLUGIN_SYNTAX_ERROR");
|
||||||
|
|
||||||
ret = vtoy_json_parse(json, buf);
|
grub_env_set("VTOY_PLUGIN_ENCODE_ERROR", "1");
|
||||||
|
grub_env_export("VTOY_PLUGIN_ENCODE_ERROR");
|
||||||
|
|
||||||
|
debug("Failed to parse json string %d\n", ret);
|
||||||
|
grub_free(buf);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = vtoy_json_parse(json, buf + offset);
|
||||||
if (ret)
|
if (ret)
|
||||||
{
|
{
|
||||||
grub_env_set("VTOY_PLUGIN_SYNTAX_ERROR", "1");
|
grub_env_set("VTOY_PLUGIN_SYNTAX_ERROR", "1");
|
||||||
@@ -2709,7 +2785,7 @@ const char * ventoy_plugin_get_menu_alias(int type, const char *isopath)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
const menu_tip * ventoy_plugin_get_menu_tip(const char *isopath)
|
const menu_tip * ventoy_plugin_get_menu_tip(int type, const char *isopath)
|
||||||
{
|
{
|
||||||
int len;
|
int len;
|
||||||
menu_tip *node = NULL;
|
menu_tip *node = NULL;
|
||||||
@@ -2722,7 +2798,8 @@ const menu_tip * ventoy_plugin_get_menu_tip(const char *isopath)
|
|||||||
len = (int)grub_strlen(isopath);
|
len = (int)grub_strlen(isopath);
|
||||||
for (node = g_menu_tip_head; node; node = node->next)
|
for (node = g_menu_tip_head; node; node = node->next)
|
||||||
{
|
{
|
||||||
if (node->pathlen == len && ventoy_strcmp(node->isopath, isopath) == 0)
|
if (node->type == type && node->pathlen &&
|
||||||
|
node->pathlen == len && ventoy_strcmp(node->isopath, isopath) == 0)
|
||||||
{
|
{
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
@@ -3157,7 +3234,7 @@ grub_err_t ventoy_cmd_plugin_check_json(grub_extcmd_context_t ctxt, int argc, ch
|
|||||||
grub_snprintf(key, sizeof(key), "%s_%s", args[1], g_arch_mode_suffix);
|
grub_snprintf(key, sizeof(key), "%s_%s", args[1], g_arch_mode_suffix);
|
||||||
for (node = json->pstChild; node; node = node->pstNext)
|
for (node = json->pstChild; node; node = node->pstNext)
|
||||||
{
|
{
|
||||||
if (grub_strcmp(node->pcName, args[1]) == 0 || grub_strcmp(node->pcName, key) == 0)
|
if (grub_strcmp(node->pcName, key) == 0)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -3165,8 +3242,19 @@ grub_err_t ventoy_cmd_plugin_check_json(grub_extcmd_context_t ctxt, int argc, ch
|
|||||||
|
|
||||||
if (!node)
|
if (!node)
|
||||||
{
|
{
|
||||||
grub_printf("%s is NOT found in ventoy.json\n", args[1]);
|
for (node = json->pstChild; node; node = node->pstNext)
|
||||||
goto end;
|
{
|
||||||
|
if (grub_strcmp(node->pcName, args[1]) == 0)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!node)
|
||||||
|
{
|
||||||
|
grub_printf("%s is NOT found in ventoy.json\n", args[1]);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < (int)ARRAY_SIZE(g_plugin_entries); i++)
|
for (i = 0; i < (int)ARRAY_SIZE(g_plugin_entries); i++)
|
||||||
|
@@ -242,6 +242,7 @@ typedef struct ventoy_img_chunk_list
|
|||||||
#pragma pack(1)
|
#pragma pack(1)
|
||||||
|
|
||||||
#define GRUB_FILE_REPLACE_MAGIC 0x1258BEEF
|
#define GRUB_FILE_REPLACE_MAGIC 0x1258BEEF
|
||||||
|
#define GRUB_IMG_REPLACE_MAGIC 0x1259BEEF
|
||||||
|
|
||||||
typedef const char * (*grub_env_get_pf)(const char *name);
|
typedef const char * (*grub_env_get_pf)(const char *name);
|
||||||
typedef int (*grub_env_set_pf)(const char *name, const char *val);
|
typedef int (*grub_env_set_pf)(const char *name, const char *val);
|
||||||
@@ -260,6 +261,7 @@ typedef struct ventoy_grub_param
|
|||||||
grub_env_get_pf grub_env_get;
|
grub_env_get_pf grub_env_get;
|
||||||
grub_env_set_pf grub_env_set;
|
grub_env_set_pf grub_env_set;
|
||||||
ventoy_grub_param_file_replace file_replace;
|
ventoy_grub_param_file_replace file_replace;
|
||||||
|
ventoy_grub_param_file_replace img_replace;
|
||||||
grub_env_printf_pf grub_env_printf;
|
grub_env_printf_pf grub_env_printf;
|
||||||
}ventoy_grub_param;
|
}ventoy_grub_param;
|
||||||
|
|
||||||
|
@@ -47,8 +47,29 @@ ventoy_os_install_dmsetup_by_fuse() {
|
|||||||
umount $VTOY_PATH/mnt/fuse
|
umount $VTOY_PATH/mnt/fuse
|
||||||
}
|
}
|
||||||
|
|
||||||
|
while [ -n "Y" ]; do
|
||||||
wait_for_usb_disk_ready
|
vtdiskname=$(get_ventoy_disk_name)
|
||||||
|
if [ "$vtdiskname" = "unknown" ]; then
|
||||||
|
vtlog "ventoy disk not found"
|
||||||
|
if [ -r /proc/sys/kernel/hotplug ]; then
|
||||||
|
echo /sbin/mdev > /proc/sys/kernel/hotplug
|
||||||
|
fi
|
||||||
|
mdev -s
|
||||||
|
sleep 1
|
||||||
|
else
|
||||||
|
if check_usb_disk_ready "$vtdiskname"; then
|
||||||
|
vtlog "check_usb_disk_ready $vtdiskname ok"
|
||||||
|
break
|
||||||
|
else
|
||||||
|
vtlog "check_usb_disk_ready $vtdiskname error"
|
||||||
|
if [ -r /proc/sys/kernel/hotplug ]; then
|
||||||
|
echo /sbin/mdev > /proc/sys/kernel/hotplug
|
||||||
|
fi
|
||||||
|
mdev -s
|
||||||
|
sleep 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
vtdiskname=$(get_ventoy_disk_name)
|
vtdiskname=$(get_ventoy_disk_name)
|
||||||
if [ "$vtdiskname" = "unknown" ]; then
|
if [ "$vtdiskname" = "unknown" ]; then
|
||||||
|
12
INSTALL/FOR_X64_ARM.txt
Normal file
12
INSTALL/FOR_X64_ARM.txt
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
============ Ventoy2Disk.exe for x86_64/ARM/ARM64 =================
|
||||||
|
Ventoy2Disk.exe is a x86_32 application and supports both 32-bit and 64-bit Windows PC with intel/amd processor.
|
||||||
|
Since 1.0.58, Ventoy also provides Ventoy2Disk_X64.exe/Ventoy2Disk_ARM.exe/Ventoy2Disk_ARM64.exe you can use them if needed.
|
||||||
|
These exe files are in altexe directory of the installation package.
|
||||||
|
You must copy them to the upper directory to use them. (The same location with Ventoy2Disk.exe)
|
||||||
|
|
||||||
|
|
||||||
|
============ x86_64/ARM/ARM64 版本 Ventoy2Disk.exe =================
|
||||||
|
默认的 Ventoy2Disk.exe 是32位x86程序,同时支持最常见的32位和64位Windows系统,绝大部分情况下使用它就可以。
|
||||||
|
从1.0.58版本开始,Ventoy还同时提供了 Ventoy2Disk_X64.exe/Ventoy2Disk_ARM.exe/Ventoy2Disk_ARM64.exe 可以根据需要使用。
|
||||||
|
这些文件位于安装包内的altexe目录下,使用时需要将其拷贝到上一层目录(即和 Ventoy2Disk.exe 同一位置)。
|
||||||
|
|
Binary file not shown.
@@ -23,6 +23,8 @@ else
|
|||||||
fi
|
fi
|
||||||
export PATH="./tool/$TOOLDIR:$PATH"
|
export PATH="./tool/$TOOLDIR:$PATH"
|
||||||
|
|
||||||
|
rm -f ./log.txt
|
||||||
|
|
||||||
|
|
||||||
echo ''
|
echo ''
|
||||||
echo '**********************************************'
|
echo '**********************************************'
|
||||||
|
BIN
INSTALL/Ventoy2Disk_ARM.exe
Normal file
BIN
INSTALL/Ventoy2Disk_ARM.exe
Normal file
Binary file not shown.
BIN
INSTALL/Ventoy2Disk_ARM64.exe
Normal file
BIN
INSTALL/Ventoy2Disk_ARM64.exe
Normal file
Binary file not shown.
BIN
INSTALL/Ventoy2Disk_X64.exe
Normal file
BIN
INSTALL/Ventoy2Disk_X64.exe
Normal file
Binary file not shown.
@@ -38,13 +38,10 @@ sh buildedk.sh >> $LOG 2>&1 || exit 1
|
|||||||
#cd $VTOY_PATH/VtoyTool
|
#cd $VTOY_PATH/VtoyTool
|
||||||
#sh build.sh || exit 1
|
#sh build.sh || exit 1
|
||||||
|
|
||||||
#cd $VTOY_PATH/vtoyfat/fat_io_lib
|
#cd $VTOY_PATH/vtoycli/fat_io_lib
|
||||||
#sh buildlib.sh
|
#sh buildlib.sh
|
||||||
|
|
||||||
#cd $VTOY_PATH/vtoyfat
|
#cd $VTOY_PATH/vtoycli
|
||||||
#sh build.sh || exit 1
|
|
||||||
|
|
||||||
#cd $VTOY_PATH/vtoygpt
|
|
||||||
#sh build.sh || exit 1
|
#sh build.sh || exit 1
|
||||||
|
|
||||||
#cd $VTOY_PATH/FUSEISO
|
#cd $VTOY_PATH/FUSEISO
|
||||||
|
@@ -1,30 +1,116 @@
|
|||||||
menuentry "Calculate md5sum" --class=checksum_md5 {
|
|
||||||
md5sum "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}"
|
|
||||||
|
|
||||||
echo -e "\n\npress ENTER to exit ..."
|
|
||||||
read vtInputKey
|
|
||||||
}
|
|
||||||
|
|
||||||
menuentry "Calculate sha1sum" --class=checksum_sha1 {
|
if [ -e "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}.md5" ]; then
|
||||||
sha1sum "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}"
|
set default=0
|
||||||
|
menuentry "Calculate and check md5sum" --class=checksum_md5 {
|
||||||
echo -e "\n\npress ENTER to exit ..."
|
md5sum "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}"
|
||||||
read vtInputKey
|
|
||||||
}
|
vt_1st_line "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}.md5" vtReadChecksum
|
||||||
|
|
||||||
|
if vt_str_casebegin "$vtReadChecksum" "$VT_LAST_CHECK_SUM"; then
|
||||||
|
echo -e "\n\nCheck MD5 value with .md5 file. [ OK ]"
|
||||||
|
else
|
||||||
|
echo -e "\n\nCheck MD5 value with .md5 file. [ FAIL ]"
|
||||||
|
echo "The MD5 value in .md5 file is:"
|
||||||
|
echo "$vtReadChecksum"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo -e "\n\npress ENTER to exit ..."
|
||||||
|
read vtInputKey
|
||||||
|
}
|
||||||
|
else
|
||||||
|
menuentry "Calculate md5sum" --class=checksum_md5 {
|
||||||
|
md5sum "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}"
|
||||||
|
|
||||||
|
echo -e "\n\npress ENTER to exit ..."
|
||||||
|
read vtInputKey
|
||||||
|
}
|
||||||
|
fi
|
||||||
|
|
||||||
menuentry "Calculate sha256sum" --class=checksum_sha256 {
|
if [ -e "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}.sha1" ]; then
|
||||||
sha256sum "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}"
|
set default=1
|
||||||
|
menuentry "Calculate and check sha1sum" --class=checksum_sha1 {
|
||||||
echo -e "\n\npress ENTER to exit ..."
|
sha1sum "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}"
|
||||||
read vtInputKey
|
|
||||||
}
|
vt_1st_line "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}.sha1" vtReadChecksum
|
||||||
|
|
||||||
|
if vt_str_casebegin "$vtReadChecksum" "$VT_LAST_CHECK_SUM"; then
|
||||||
|
echo -e "\n\nCheck SHA1 value with .sha1 file. [ OK ]"
|
||||||
|
else
|
||||||
|
echo -e "\n\nCheck SHA1 value with .sha1 file. [ FAIL ]"
|
||||||
|
echo "The SHA1 value in .sha1 file is:"
|
||||||
|
echo "$vtReadChecksum"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo -e "\n\npress ENTER to exit ..."
|
||||||
|
read vtInputKey
|
||||||
|
}
|
||||||
|
else
|
||||||
|
menuentry "Calculate sha1sum" --class=checksum_sha1 {
|
||||||
|
sha1sum "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}"
|
||||||
|
|
||||||
|
echo -e "\n\npress ENTER to exit ..."
|
||||||
|
read vtInputKey
|
||||||
|
}
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if [ -e "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}.sha256" ]; then
|
||||||
|
set default=2
|
||||||
|
menuentry "Calculate and check sha256sum" --class=checksum_sha256 {
|
||||||
|
sha256sum "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}"
|
||||||
|
|
||||||
|
vt_1st_line "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}.sha256" vtReadChecksum
|
||||||
|
|
||||||
|
if vt_str_casebegin "$vtReadChecksum" "$VT_LAST_CHECK_SUM"; then
|
||||||
|
echo -e "\n\nCheck SHA256 value with .sha256 file. [ OK ]"
|
||||||
|
else
|
||||||
|
echo -e "\n\nCheck SHA256 value with .sha256 file. [ FAIL ]"
|
||||||
|
echo "The SHA256 value in .sha256 file is:"
|
||||||
|
echo "$vtReadChecksum"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo -e "\n\npress ENTER to exit ..."
|
||||||
|
read vtInputKey
|
||||||
|
}
|
||||||
|
else
|
||||||
|
menuentry "Calculate sha256sum" --class=checksum_sha256 {
|
||||||
|
sha256sum "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}"
|
||||||
|
|
||||||
|
echo -e "\n\npress ENTER to exit ..."
|
||||||
|
read vtInputKey
|
||||||
|
}
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if [ -e "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}.sha512" ]; then
|
||||||
|
set default=3
|
||||||
|
menuentry "Calculate and check sha512sum" --class=checksum_sha512{
|
||||||
|
sha512sum "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}"
|
||||||
|
|
||||||
|
vt_1st_line "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}.sha512" vtReadChecksum
|
||||||
|
|
||||||
|
if vt_str_casebegin "$vtReadChecksum" "$VT_LAST_CHECK_SUM"; then
|
||||||
|
echo -e "\n\nCheck SHA512 value with .sha512 file. [ OK ]"
|
||||||
|
else
|
||||||
|
echo -e "\n\nCheck SHA512 value with .sha512 file. [ FAIL ]"
|
||||||
|
echo "The SHA512 value in .sha512 file is:"
|
||||||
|
echo "$vtReadChecksum"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo -e "\n\npress ENTER to exit ..."
|
||||||
|
read vtInputKey
|
||||||
|
}
|
||||||
|
else
|
||||||
|
menuentry "Calculate sha512sum" --class=checksum_sha512{
|
||||||
|
sha512sum "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}"
|
||||||
|
|
||||||
|
echo -e "\n\npress ENTER to exit ..."
|
||||||
|
read vtInputKey
|
||||||
|
}
|
||||||
|
fi
|
||||||
|
|
||||||
menuentry "Calculate sha512sum" --class=checksum_sha512{
|
|
||||||
sha512sum "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}"
|
|
||||||
|
|
||||||
echo -e "\n\npress ENTER to exit ..."
|
|
||||||
read vtInputKey
|
|
||||||
}
|
|
||||||
|
|
||||||
menuentry 'Return to previous menu [Esc]' --class=vtoyret VTOY_RET {
|
menuentry 'Return to previous menu [Esc]' --class=vtoyret VTOY_RET {
|
||||||
echo 'Return ...'
|
echo 'Return ...'
|
||||||
|
@@ -355,6 +355,8 @@ function distro_specify_initrd_file_phase2 {
|
|||||||
vt_linux_specify_initrd_file /porteus/initrd.xz
|
vt_linux_specify_initrd_file /porteus/initrd.xz
|
||||||
elif [ -f (loop)/pyabr/boot/initrfs.img ]; then
|
elif [ -f (loop)/pyabr/boot/initrfs.img ]; then
|
||||||
vt_linux_specify_initrd_file /pyabr/boot/initrfs.img
|
vt_linux_specify_initrd_file /pyabr/boot/initrfs.img
|
||||||
|
elif [ -f (loop)/initrd0.img ]; then
|
||||||
|
vt_linux_specify_initrd_file /initrd0.img
|
||||||
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@@ -1015,14 +1017,13 @@ function legacy_linux_menu_func {
|
|||||||
loopback loop "$1$2"
|
loopback loop "$1$2"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f (loop)/isolinux/isolinux.cfg ]; then
|
|
||||||
if vt_iso9660_isjoliet; then
|
if vt_syslinux_need_nojoliet "$1$2"; then
|
||||||
vt_iso9660_nojoliet 1
|
vt_iso9660_nojoliet 1
|
||||||
loopback -d loop
|
loopback -d loop
|
||||||
loopback loop "$1$2"
|
loopback loop "$1$2"
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
vt_load_cpio $vtoy_path "$2" "$1" "busybox=$ventoy_busybox_ver"
|
vt_load_cpio $vtoy_path "$2" "$1" "busybox=$ventoy_busybox_ver"
|
||||||
|
|
||||||
vt_linux_clear_initrd
|
vt_linux_clear_initrd
|
||||||
@@ -2009,7 +2010,7 @@ function img_unsupport_menuentry {
|
|||||||
#############################################################
|
#############################################################
|
||||||
#############################################################
|
#############################################################
|
||||||
|
|
||||||
set VENTOY_VERSION="1.0.56"
|
set VENTOY_VERSION="1.0.61"
|
||||||
|
|
||||||
#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
|
||||||
@@ -2123,10 +2124,10 @@ fi
|
|||||||
|
|
||||||
if [ $VTOY_DEFAULT_MENU_MODE -eq 0 ]; then
|
if [ $VTOY_DEFAULT_MENU_MODE -eq 0 ]; then
|
||||||
set VTOY_F3_CMD="vt_dynamic_menu 1 1"
|
set VTOY_F3_CMD="vt_dynamic_menu 1 1"
|
||||||
set VTOY_HOTKEY_TIP="F1:Memdisk F2:Power F3:TreeView F4:Localboot F5:Tools F6:ExMenu Ctrl+h:Help"
|
set VTOY_HOTKEY_TIP="h:Help F1:Memdisk F2:Power F3:TreeView F4:Localboot F5:Tools F6:ExMenu"
|
||||||
else
|
else
|
||||||
set VTOY_F3_CMD="vt_dynamic_menu 1 0"
|
set VTOY_F3_CMD="vt_dynamic_menu 1 0"
|
||||||
set VTOY_HOTKEY_TIP="F1:Memdisk F2:Power F3:ListView F4:Localboot F5:Tools F6:ExMenu Ctrl+h:Help"
|
set VTOY_HOTKEY_TIP="h:Help F1:Memdisk F2:Power F3:ListView F4:Localboot F5:Tools F6:ExMenu"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
@@ -2177,12 +2178,19 @@ fi
|
|||||||
|
|
||||||
if [ -n "$VTOY_PLUGIN_SYNTAX_ERROR" ]; then
|
if [ -n "$VTOY_PLUGIN_SYNTAX_ERROR" ]; then
|
||||||
clear
|
clear
|
||||||
echo -e "\n Syntax error detected in ventoy.json, please check! \n"
|
if [ -n "$VTOY_PLUGIN_ENCODE_ERROR" ]; then
|
||||||
echo -e " ventoy.json 文件中有语法错误,所有配置都不会生效,请检查!\n"
|
echo -e "\n Encoding type for ventoy.json is not supported, please convert to UTF-8.\n"
|
||||||
|
echo -e " ventoy.json 文件编码格式不支持,请转换为 UTF-8 编码格式!\n"
|
||||||
|
else
|
||||||
|
echo -e "\n Syntax error detected in ventoy.json, please check! \n"
|
||||||
|
echo -e " ventoy.json 文件中有语法错误,所有配置都不会生效,请检查!\n"
|
||||||
|
fi
|
||||||
|
|
||||||
echo -e "\n press ENTER to continue (请按 回车 键继续) ..."
|
echo -e "\n press ENTER to continue (请按 回车 键继续) ..."
|
||||||
read vtInputKey
|
read vtInputKey
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
for vtTFile in ventoy.json ventoy_grub.cfg; do
|
for vtTFile in ventoy.json ventoy_grub.cfg; do
|
||||||
if [ -f $vtoy_efi_part/ventoy/$vtTFile ]; then
|
if [ -f $vtoy_efi_part/ventoy/$vtTFile ]; then
|
||||||
clear
|
clear
|
||||||
|
18
INSTALL/grub/help/de_DE.txt
Normal file
18
INSTALL/grub/help/de_DE.txt
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
h - Zeigt dieses Hilfe Menu
|
||||||
|
F1 - Memdisk Modus (Nur für kleine WinPE/LiveCD ISO/IMG)
|
||||||
|
F2 - Neustarten/Herunterfahren
|
||||||
|
F3 - Menu wechsel zwischen Baum <-> Listen Ansicht
|
||||||
|
F4 - Windows/Linux vom lokalem Datenträger starten
|
||||||
|
F5 - Dienstprogramme
|
||||||
|
F6 - Benutzerdefiniertes Grub2-Menü laden
|
||||||
|
F7 - Wechseln zwischen GUI-Modus <-> TEXT-Modus
|
||||||
|
|
||||||
|
m - Prüfsummencheck Image Dateien (md5/sha1/sha256/sha512)
|
||||||
|
Ctrl+w - WIMBOOT Modus (Nur für Standard Windows ISO)
|
||||||
|
Ctrl+r - Grub2 Modus (Nur für einige Linux distros)
|
||||||
|
Ctrl+i - Kompatibilitäts Modus (Nur für Fehleranalyse)
|
||||||
|
Ctrl+u - Lade ISO efi Treiber (Nur für Fehleranalyse, darf nicht offiziel benutzt werden)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Drücke ESC für Zurück ......
|
@@ -1,4 +1,4 @@
|
|||||||
Ctrl+h - Display this help information
|
h - Display this help information
|
||||||
F1 - Memdisk Mode (Only for small WinPE/LiveCD ISO/IMG)
|
F1 - Memdisk Mode (Only for small WinPE/LiveCD ISO/IMG)
|
||||||
F2 - Reboot/Power off
|
F2 - Reboot/Power off
|
||||||
F3 - Switch menu mode between Treeview <-> ListView
|
F3 - Switch menu mode between Treeview <-> ListView
|
||||||
@@ -7,10 +7,12 @@ F5 - Utilities
|
|||||||
F6 - Load Custom Grub2 Menu
|
F6 - Load Custom Grub2 Menu
|
||||||
F7 - Switch between GUI Mode <-> TEXT Mode
|
F7 - Switch between GUI Mode <-> TEXT Mode
|
||||||
|
|
||||||
Ctrl+m - Checksum image files (md5/sha1/sha256/sha512)
|
m - Checksum image files (md5/sha1/sha256/sha512)
|
||||||
Ctrl+w - WIMBOOT Mode (Only for standard Windows ISO)
|
Ctrl+w - WIMBOOT Mode (Only for standard Windows ISO)
|
||||||
Ctrl+r - Grub2 Mode (Only for some Linux distros)
|
Ctrl+r - Grub2 Mode (Only for some Linux distros)
|
||||||
Ctrl+i - Compatible Mode (Just only for test)
|
Ctrl+i - Compatible Mode (Just only for debug)
|
||||||
|
Ctrl+u - Load ISO efi driver (Just only for debug, can not be used officially)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Press ESC to return ......
|
Press ESC to return ......
|
||||||
|
16
INSTALL/grub/help/fr_FR.txt
Normal file
16
INSTALL/grub/help/fr_FR.txt
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
h - Afficher cette aide
|
||||||
|
F1 - Mode Memdisk (Seulement pour WinPE/LiveCD ISO/IMG)
|
||||||
|
F2 - Redémarrer/arrêter
|
||||||
|
F3 - Basculer l'affichage 'Vue en arbre' <-> 'Vue en liste'
|
||||||
|
F4 - Démarrer le système Windows/Linux local
|
||||||
|
F5 - Utilitaires
|
||||||
|
F6 - Charger le menu Grub2 personnalisé
|
||||||
|
F7 - Basculer entre le mode graphique <-> mode texte
|
||||||
|
|
||||||
|
m - Somme de contrôle des images (md5/sha1/sha256/sha512)
|
||||||
|
Ctrl+w - Mode WIMBOOT (seulement pour les images standards Windows)
|
||||||
|
Ctrl+r - Mode Grub2 (seulement pour quelques Linux)
|
||||||
|
Ctrl+i - Mode Compatible (seulement à fins de tests)
|
||||||
|
Ctrl+u - Load ISO efi driver (Just only for debug, can not be used officially)
|
||||||
|
|
||||||
|
Appuyer sur Echap pour sortir ......
|
17
INSTALL/grub/help/hr_HR.txt
Normal file
17
INSTALL/grub/help/hr_HR.txt
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
h - Prikazuje ove informacije
|
||||||
|
F1 - Memdisk način rada (samo za male WinPE/LiveCD imidž fajlove)
|
||||||
|
F2 - Ponovno pokretanje/isključivanje
|
||||||
|
F3 - Mijenja meni između TreeView <-> ListView
|
||||||
|
F4 - Pokreće Windows/Linux na lokalnom disku
|
||||||
|
F5 - Postavke
|
||||||
|
F6 - Učitava prilagođen GRUB2 meni
|
||||||
|
F7 - Mijenja između GUI načina rada <-> TEXT načina rada
|
||||||
|
|
||||||
|
m - Generira kontrolnu sumu odabranog imidž fajla (md5/sha1/sha256/sha512)
|
||||||
|
Ctrl + w - WIMBOOT način rada (samo za standardne Windows imidž fajlove)
|
||||||
|
Ctrl + r - GRUB2 način rada (samo za neke Linux distribucije)
|
||||||
|
Ctrl + i - Kompatibilni način rada (samo za testiranje)
|
||||||
|
Ctrl + u - Load ISO efi driver (Just only for debug, can not be used officially)
|
||||||
|
|
||||||
|
|
||||||
|
Pritisnite ESC za povratak...
|
18
INSTALL/grub/help/id_ID.txt
Normal file
18
INSTALL/grub/help/id_ID.txt
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
h - Tampilkan bantuan informasi ini
|
||||||
|
F1 - Mode Memdisk (Hanya untuk ukuran WinPE/LiveCD ISO/IMG yang kecil)
|
||||||
|
F2 - Mulai ulang/Matikan
|
||||||
|
F3 - Beralih mode menu antara Treeview <-> ListView
|
||||||
|
F4 - Jalankan (boot) Windows/Linux pada disk lokal
|
||||||
|
F5 - Alat Utilitas
|
||||||
|
F6 - Memuat ubah suai Grub2 Menu
|
||||||
|
F7 - Beralih antara mode GUI <-> Mode TEXT
|
||||||
|
|
||||||
|
m - Periksa berkas files (md5/sha1/sha256/sha512)
|
||||||
|
Ctrl+w - Mode WIMBOOT (Hanya untuk berkas ISO Windows standar)
|
||||||
|
Ctrl+r - Mode Grub2 (Hanya untuk distro Linux tertentu)
|
||||||
|
Ctrl+i - Mode Kompatibel/Compatible (Hanya untuk debug saja)
|
||||||
|
Ctrl+u - Memuat ISO efi driver (Hanya untuk debug saja, tidak dapat dipakai secara umum)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Tekan ESC untuk kembali ......
|
17
INSTALL/grub/help/pt_PT.txt
Normal file
17
INSTALL/grub/help/pt_PT.txt
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
h - Mostra esta informação de ajuda
|
||||||
|
F1 - Modo Memdisk (Apenas para pequenos WinPE/LiveCD ISO/IMG)
|
||||||
|
F2 - Reiniciar/Desligar
|
||||||
|
F3 - Alternar o modo menu entre Vista de árvore <-> Vista de lista
|
||||||
|
F4 - Arrancar o Windows/Linux em disco local
|
||||||
|
F5 - Utilitários
|
||||||
|
F6 - Carregar menu Grub2 personalizado
|
||||||
|
F7 - Alternar entre Modo GUI <-> Modo TEXTO
|
||||||
|
|
||||||
|
m - Checksum ficheiros de imagem (md5/sha1/sha256/sha512)
|
||||||
|
Ctrl+w - Modo WIMBOOT (Apenas para Windows ISO padrão)
|
||||||
|
Ctrl+r - Modo Grub2 (Apenas para algumas distros Linux)
|
||||||
|
Ctrl+i - Modo Compatível (Apenas para depuração)
|
||||||
|
Ctrl+u - Carregar o controlador ISO efi (Apenas para depuração, não pode ser utilizado oficialmente)
|
||||||
|
|
||||||
|
|
||||||
|
Prima ESC para voltar ......
|
17
INSTALL/grub/help/sr_CY.txt
Normal file
17
INSTALL/grub/help/sr_CY.txt
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
h - Приказује ове информације
|
||||||
|
F1 - Memdisk начин рада (само за мале WinPE/LiveCD имиџ фајлове)
|
||||||
|
F2 - Поновно покретање/искључивање
|
||||||
|
F3 - Мијења мени између TreeView <-> ListView
|
||||||
|
F4 - Покреће Windows/Linux на локалном диску
|
||||||
|
F5 - Поставке
|
||||||
|
F6 - Учитава прилагођен GRUB2 мени
|
||||||
|
F7 - Мијења између GUI начина рада <-> TEXT начина рада
|
||||||
|
|
||||||
|
m - Генерира контролну суму одабраног имиџ фајла (md5/sha1/sha256/sha512)
|
||||||
|
Ctrl + w - WIMBOOT начин рада (само за стандардне Windows имиџ фајлове)
|
||||||
|
Ctrl + r - GRUB2 начин рада (само за неке Linux дистрибуције)
|
||||||
|
Ctrl + i - Компатибилни начин рада (само за тестиранје)
|
||||||
|
Ctrl + u - Load ISO efi driver (Just only for debug, can not be used officially)
|
||||||
|
|
||||||
|
|
||||||
|
Притисните ESC за повратак...
|
17
INSTALL/grub/help/sr_SR.txt
Normal file
17
INSTALL/grub/help/sr_SR.txt
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
h - Prikazuje ove informacije
|
||||||
|
F1 - Memdisk način rada (samo za male WinPE/LiveCD imidž fajlove)
|
||||||
|
F2 - Ponovno pokretanje/isključivanje
|
||||||
|
F3 - Mijenja meni između TreeView <-> ListView
|
||||||
|
F4 - Pokreće Windows/Linux na lokalnom disku
|
||||||
|
F5 - Postavke
|
||||||
|
F6 - Učitava prilagođen GRUB2 meni
|
||||||
|
F7 - Mijenja između GUI načina rada <-> TEXT načina rada
|
||||||
|
|
||||||
|
m - Generira kontrolnu sumu odabranog imidž fajla (md5/sha1/sha256/sha512)
|
||||||
|
Ctrl + w - WIMBOOT način rada (samo za standardne Windows imidž fajlove)
|
||||||
|
Ctrl + r - GRUB2 način rada (samo za neke Linux distribucije)
|
||||||
|
Ctrl + i - Kompatibilni način rada (samo za testiranje)
|
||||||
|
Ctrl+u - Load ISO efi driver (Just only for debug, can not be used officially)
|
||||||
|
|
||||||
|
|
||||||
|
Pritisnite ESC za povratak...
|
@@ -1,4 +1,4 @@
|
|||||||
Ctrl+h - Yardım bilgilerini göster
|
h - Yardım bilgilerini göster
|
||||||
F1 - Memdisk Modu başlatır(Yalnızca küçük WinPE/LiveCD ISO/IMG ler için bu modu kullanabilirsiniz)
|
F1 - Memdisk Modu başlatır(Yalnızca küçük WinPE/LiveCD ISO/IMG ler için bu modu kullanabilirsiniz)
|
||||||
F2 - Bilgisayarı Yeniden Başlat/Kapat
|
F2 - Bilgisayarı Yeniden Başlat/Kapat
|
||||||
F3 - Ventoy Menü modu olarak,Klasör görünümü(Treeview) ile Liste görünümü(ListView) arasında geçiş yapmayı sağlar.
|
F3 - Ventoy Menü modu olarak,Klasör görünümü(Treeview) ile Liste görünümü(ListView) arasında geçiş yapmayı sağlar.
|
||||||
@@ -7,10 +7,11 @@ F5 - Ventoy Araçlar menüsü
|
|||||||
F6 - Özelleştirilmiş Grub2 menüsünü yükler
|
F6 - Özelleştirilmiş Grub2 menüsünü yükler
|
||||||
F7 - Grafik Modu(GUI Mode) ile Metin Modu(Text Mode) arasında geçiş yapmayı sağlar
|
F7 - Grafik Modu(GUI Mode) ile Metin Modu(Text Mode) arasında geçiş yapmayı sağlar
|
||||||
|
|
||||||
Ctrl+m - İndirilen imaj dosyalarının hatasız indirildiğini teyit etmek için "md5/sha1/sha256/sha512" değerlerini kontrol etmeyi sağlar
|
m - İndirilen imaj dosyalarının hatasız indirildiğini teyit etmek için "md5/sha1/sha256/sha512" değerlerini kontrol etmeyi sağlar
|
||||||
Ctrl+w - WIMBOOT Modu çalıştırmayı sağlar(Sadece normal Windows ISO ları için)
|
Ctrl+w - WIMBOOT Modu çalıştırmayı sağlar(Sadece normal Windows ISO ları için)
|
||||||
Ctrl+r - Grub2 Modu çalıştırmayı sağlar (Sadece bazı Linux dağıtımları için)
|
Ctrl+r - Grub2 Modu çalıştırmayı sağlar (Sadece bazı Linux dağıtımları için)
|
||||||
Ctrl+i - Uyumluluk Modu'nu (Compatible Mode) çalıştırmayı sağlar (Sadece bazı çalışmayan ISO ları test etmek için bu modu kullanabilirsiniz)
|
Ctrl+i - Uyumluluk Modu'nu (Compatible Mode) çalıştırmayı sağlar (Sadece hata ayıklama için bu modu kullanabilirsiniz)
|
||||||
|
Ctrl+u - ISO efi sürücüsünü yükler(Sadece hata ayıklama için bu mod kullanılabilir, resmi olarak kullanılamaz)
|
||||||
|
|
||||||
|
|
||||||
Geriye dönmek için ESC tuşuna basınız......
|
Geriye dönmek için ESC tuşuna basınız......
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
Ctrl+h - 显示本帮助信息
|
h - 显示本帮助信息
|
||||||
F1 - 把文件加载到内存启动(只适用于文件很小的 WinPE/LiveCD等)
|
F1 - 把文件加载到内存启动(只适用于文件很小的 WinPE/LiveCD等)
|
||||||
F2 - 电源操作 (重启、关机)
|
F2 - 电源操作 (重启、关机)
|
||||||
F3 - 菜单显示模式切换。可在列表模式和目录模式之间自由切换。
|
F3 - 菜单显示模式切换。可在列表模式和目录模式之间自由切换。
|
||||||
@@ -7,9 +7,11 @@ F5 - 各类工具
|
|||||||
F6 - 加载自定义 GRUB2 菜单。
|
F6 - 加载自定义 GRUB2 菜单。
|
||||||
F7 - 界面在文本模式和图形模式之间切换。
|
F7 - 界面在文本模式和图形模式之间切换。
|
||||||
|
|
||||||
Ctrl+m - 计算文件校验值(md5/sha1/sha256/sha512)
|
m - 计算文件校验值(md5/sha1/sha256/sha512)
|
||||||
Ctrl+w - WIMBOOT 模式 (只适用于标准的 Windows ISO文件)
|
Ctrl+w - WIMBOOT 模式 (只适用于标准的 Windows ISO文件)
|
||||||
Ctrl+r - Grub2 模式 (只适用于常见的一些 Linux 系统ISO文件)
|
Ctrl+r - Grub2 模式 (只适用于常见的一些 Linux 系统ISO文件)
|
||||||
Ctrl+i - 兼容模式 (只用作调试目的,不能正式使用)
|
Ctrl+i - 兼容模式 (只用作调试目的,不能正式使用)
|
||||||
|
Ctrl+u - 加载 ISO efi 驱动(只用作调试目的,不能正式使用)
|
||||||
|
|
||||||
|
|
||||||
按 ESC 键返回 ......
|
按 ESC 键返回 ......
|
||||||
|
@@ -76,6 +76,11 @@ else
|
|||||||
terminal_output console
|
terminal_output console
|
||||||
chainloader /EFI/Microsoft/Boot/bootmgfw.efi
|
chainloader /EFI/Microsoft/Boot/bootmgfw.efi
|
||||||
boot
|
boot
|
||||||
|
elif [ -f ($vtoydev,$partid)/efi/Microsoft/Boot/bootmgfw.efi ]; then
|
||||||
|
set root=($vtoydev,$partid)
|
||||||
|
terminal_output console
|
||||||
|
chainloader /efi/Microsoft/Boot/bootmgfw.efi
|
||||||
|
boot
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
break
|
break
|
||||||
@@ -87,6 +92,10 @@ else
|
|||||||
terminal_output console
|
terminal_output console
|
||||||
chainloader /EFI/Microsoft/Boot/bootmgfw.efi
|
chainloader /EFI/Microsoft/Boot/bootmgfw.efi
|
||||||
boot
|
boot
|
||||||
|
elif search -n -s -f /efi/Microsoft/Boot/bootmgfw.efi; then
|
||||||
|
terminal_output console
|
||||||
|
chainloader /efi/Microsoft/Boot/bootmgfw.efi
|
||||||
|
boot
|
||||||
else
|
else
|
||||||
echo "Windows NOT found ..."
|
echo "Windows NOT found ..."
|
||||||
fi
|
fi
|
||||||
|
@@ -16,6 +16,7 @@ print_usage() {
|
|||||||
echo ' -s/-S enable/disable secure boot support (default is disabled)'
|
echo ' -s/-S enable/disable secure boot support (default is disabled)'
|
||||||
echo ' -g use GPT partition style, default is MBR (only for install)'
|
echo ' -g use GPT partition style, default is MBR (only for install)'
|
||||||
echo ' -L Label of the 1st exfat partition (default is Ventoy)'
|
echo ' -L Label of the 1st exfat partition (default is Ventoy)'
|
||||||
|
echo ' -n try non-destructive installation (only for install)'
|
||||||
echo ''
|
echo ''
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -28,6 +29,8 @@ while [ -n "$1" ]; do
|
|||||||
elif [ "$1" = "-I" ]; then
|
elif [ "$1" = "-I" ]; then
|
||||||
MODE="install"
|
MODE="install"
|
||||||
FORCE="Y"
|
FORCE="Y"
|
||||||
|
elif [ "$1" = "-n" ]; then
|
||||||
|
NONDESTRUCTIVE="Y"
|
||||||
elif [ "$1" = "-u" ]; then
|
elif [ "$1" = "-u" ]; then
|
||||||
MODE="update"
|
MODE="update"
|
||||||
elif [ "$1" = "-l" ]; then
|
elif [ "$1" = "-l" ]; then
|
||||||
@@ -162,7 +165,7 @@ if [ -d ./tmp_mnt ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [ "$MODE" = "install" ]; then
|
if [ "$MODE" = "install" -a -z "$NONDESTRUCTIVE" ]; then
|
||||||
vtdebug "install Ventoy ..."
|
vtdebug "install Ventoy ..."
|
||||||
|
|
||||||
if [ -n "$VTGPT" ]; then
|
if [ -n "$VTGPT" ]; then
|
||||||
@@ -255,7 +258,10 @@ if [ "$MODE" = "install" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! dd if=/dev/zero of=$DISK bs=1 count=512 status=none conv=fsync; then
|
# check and umount
|
||||||
|
check_umount_disk "$DISK"
|
||||||
|
|
||||||
|
if ! dd if=/dev/zero of=$DISK bs=64 count=512 status=none conv=fsync; then
|
||||||
vterr "Write data to $DISK failed, please check whether it's in use."
|
vterr "Write data to $DISK failed, please check whether it's in use."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@@ -281,10 +287,14 @@ if [ "$MODE" = "install" ]; then
|
|||||||
PART1=$(get_disk_part_name $DISK 1)
|
PART1=$(get_disk_part_name $DISK 1)
|
||||||
PART2=$(get_disk_part_name $DISK 2)
|
PART2=$(get_disk_part_name $DISK 2)
|
||||||
|
|
||||||
|
#clean part2
|
||||||
|
dd status=none conv=fsync if=/dev/zero of=$DISK bs=512 count=32 seek=$part2_start_sector
|
||||||
|
|
||||||
|
#format part1
|
||||||
|
vtinfo "Format partition 1 ..."
|
||||||
mkexfatfs -n "$VTNEW_LABEL" -s $cluster_sectors ${PART1}
|
mkexfatfs -n "$VTNEW_LABEL" -s $cluster_sectors ${PART1}
|
||||||
|
|
||||||
vtinfo "writing data to disk ..."
|
vtinfo "writing data to disk ..."
|
||||||
|
|
||||||
dd status=none conv=fsync if=./boot/boot.img of=$DISK bs=1 count=446
|
dd status=none conv=fsync if=./boot/boot.img of=$DISK bs=1 count=446
|
||||||
|
|
||||||
if [ -n "$VTGPT" ]; then
|
if [ -n "$VTGPT" ]; then
|
||||||
@@ -314,51 +324,181 @@ if [ "$MODE" = "install" ]; then
|
|||||||
sync
|
sync
|
||||||
|
|
||||||
vtinfo "esp partition processing ..."
|
vtinfo "esp partition processing ..."
|
||||||
|
if [ "$SECUREBOOT" != "YES" ]; then
|
||||||
sleep 1
|
sleep 2
|
||||||
check_umount_disk "$DISK"
|
check_umount_disk "$DISK"
|
||||||
|
vtoycli partresize -s $DISK $part2_start_sector
|
||||||
if [ "$SECUREBOOT" != "YES" ]; then
|
|
||||||
mkdir ./tmp_mnt
|
|
||||||
|
|
||||||
vtdebug "mounting part2 ...."
|
|
||||||
for tt in 1 2 3 4 5; do
|
|
||||||
if mount ${PART2} ./tmp_mnt > /dev/null 2>&1; then
|
|
||||||
vtdebug "mounting part2 success"
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
|
|
||||||
check_umount_disk "$DISK"
|
|
||||||
sleep 2
|
|
||||||
done
|
|
||||||
|
|
||||||
rm -f ./tmp_mnt/EFI/BOOT/BOOTX64.EFI
|
|
||||||
rm -f ./tmp_mnt/EFI/BOOT/grubx64.efi
|
|
||||||
rm -f ./tmp_mnt/EFI/BOOT/BOOTIA32.EFI
|
|
||||||
rm -f ./tmp_mnt/EFI/BOOT/grubia32.efi
|
|
||||||
rm -f ./tmp_mnt/EFI/BOOT/MokManager.efi
|
|
||||||
rm -f ./tmp_mnt/EFI/BOOT/mmia32.efi
|
|
||||||
rm -f ./tmp_mnt/ENROLL_THIS_KEY_IN_MOKMANAGER.cer
|
|
||||||
mv ./tmp_mnt/EFI/BOOT/grubx64_real.efi ./tmp_mnt/EFI/BOOT/BOOTX64.EFI
|
|
||||||
mv ./tmp_mnt/EFI/BOOT/grubia32_real.efi ./tmp_mnt/EFI/BOOT/BOOTIA32.EFI
|
|
||||||
|
|
||||||
sync
|
|
||||||
|
|
||||||
for tt in 1 2 3; do
|
|
||||||
if umount ./tmp_mnt; then
|
|
||||||
vtdebug "umount part2 success"
|
|
||||||
rm -rf ./tmp_mnt
|
|
||||||
break
|
|
||||||
else
|
|
||||||
vtdebug "umount part2 failed, now retry..."
|
|
||||||
sleep 1
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
vtinfo "Install Ventoy to $DISK successfully finished."
|
vtinfo "Install Ventoy to $DISK successfully finished."
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
|
elif [ "$MODE" = "install" -a -n "$NONDESTRUCTIVE" ]; then
|
||||||
|
vtdebug "non-destructive install Ventoy ..."
|
||||||
|
|
||||||
|
version=$(get_disk_ventoy_version $DISK)
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
if [ -z "$FORCE" ]; then
|
||||||
|
vtwarn "$DISK already contains a Ventoy with version $version."
|
||||||
|
vtwarn "You can not do and don not need non-destructive installation."
|
||||||
|
vtwarn ""
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
disk_sector_num=$(cat /sys/block/${DISK#/dev/}/size)
|
||||||
|
disk_size_gb=$(expr $disk_sector_num / 2097152)
|
||||||
|
|
||||||
|
if vtoycli partresize -t $DISK; then
|
||||||
|
OldStyle="GPT"
|
||||||
|
else
|
||||||
|
OldStyle="MBR"
|
||||||
|
fi
|
||||||
|
|
||||||
|
#Print disk info
|
||||||
|
echo "Disk : $DISK"
|
||||||
|
parted -s $DISK p 2>&1 | grep Model
|
||||||
|
echo "Size : $disk_size_gb GB"
|
||||||
|
echo "Style: $OldStyle"
|
||||||
|
echo ''
|
||||||
|
|
||||||
|
vtwarn "Attention:"
|
||||||
|
vtwarn "Ventoy will try non-destructive installation on $DISK if possible."
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
read -p 'Continue? (y/n) ' Answer
|
||||||
|
if [ "$Answer" != "y" ]; then
|
||||||
|
if [ "$Answer" != "Y" ]; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ $disk_sector_num -le $VENTOY_SECTOR_NUM ]; then
|
||||||
|
vterr "No enough space in disk $DISK"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
PART1=$(get_disk_part_name $DISK 1)
|
||||||
|
PART2=$(get_disk_part_name $DISK 2)
|
||||||
|
|
||||||
|
#Part1 size in MB aligned with 4KB
|
||||||
|
PART1_SECTORS=$(cat /sys/class/block/${PART1#/dev/}/size)
|
||||||
|
PART1_4K=$(expr $PART1_SECTORS / 8)
|
||||||
|
PART1_MB=$(expr $PART1_4K / 256)
|
||||||
|
PART1_NEW_MB=$(expr $PART1_MB - 32)
|
||||||
|
|
||||||
|
echo "$PART1 is ${PART1_MB}MB"
|
||||||
|
|
||||||
|
#check partition layout
|
||||||
|
echo "check partition layout ..."
|
||||||
|
vtoycli partresize -c $DISK
|
||||||
|
vtRet=$?
|
||||||
|
if [ $vtRet -eq 0 ]; then
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
# check and umount
|
||||||
|
check_umount_disk "$DISK"
|
||||||
|
sleep 1
|
||||||
|
check_umount_disk "$DISK"
|
||||||
|
|
||||||
|
if [ $vtRet -eq 1 ]; then
|
||||||
|
echo "Free space enough, start install..."
|
||||||
|
part2_start_sector=$(expr $PART1_SECTORS + 2048)
|
||||||
|
elif [ $vtRet -eq 2 ]; then
|
||||||
|
echo "We need to shrink partition 1 firstly ..."
|
||||||
|
|
||||||
|
PART1_BLKID=$(blkid $PART1)
|
||||||
|
blkid $PART1
|
||||||
|
|
||||||
|
if echo $PART1_BLKID | egrep -q -i 'TYPE=ntfs|TYPE=.ntfs'; then
|
||||||
|
echo "Partition 1 contains NTFS filesystem"
|
||||||
|
|
||||||
|
which ntfsresize
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "###[FAIL] ntfsresize not found. Please install ntfs-3g package."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "ntfsfix -b -d $PART1 ..."
|
||||||
|
ntfsfix -b -d $PART1
|
||||||
|
|
||||||
|
echo "ntfsresize --size ${PART1_NEW_MB}Mi $PART1 ..."
|
||||||
|
ntfsresize -f --size ${PART1_NEW_MB}Mi $PART1
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "###[FAIL] ntfsresize failed."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
elif echo $PART1_BLKID | egrep -q -i 'TYPE=ext[2-4]|TYPE=.ext[2-4]'; then
|
||||||
|
echo "Partition 1 contains EXT filesystem"
|
||||||
|
|
||||||
|
which resize2fs
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "###[FAIL] resize2fs not found. Please install e2fsprogs package."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "e2fsck -f $PART1 ..."
|
||||||
|
e2fsck -f $PART1
|
||||||
|
|
||||||
|
echo "resize2fs $PART1 ${PART1_NEW_MB}M ..."
|
||||||
|
resize2fs $PART1 ${PART1_NEW_MB}M
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "###[FAIL] resize2fs failed."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "###[FAIL] Unsupported filesystem in partition 1."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
sync
|
||||||
|
PART1_NEW_END_MB=$(expr $PART1_NEW_MB + 1)
|
||||||
|
part2_start_sector=$(expr $PART1_NEW_END_MB \* 2048)
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
vtinfo "writing data to disk part2_start=$part2_start_sector ..."
|
||||||
|
|
||||||
|
dd status=none conv=fsync if=./boot/boot.img of=$DISK bs=1 count=440
|
||||||
|
|
||||||
|
if [ "$OldStyle" = "GPT" ]; then
|
||||||
|
echo -en '\x22' | dd status=none of=$DISK conv=fsync bs=1 count=1 seek=92
|
||||||
|
xzcat ./boot/core.img.xz | dd status=none conv=fsync of=$DISK bs=512 count=2014 seek=34
|
||||||
|
echo -en '\x23' | dd of=$DISK conv=fsync bs=1 count=1 seek=17908 status=none
|
||||||
|
else
|
||||||
|
xzcat ./boot/core.img.xz | dd status=none conv=fsync of=$DISK bs=512 count=2047 seek=1
|
||||||
|
fi
|
||||||
|
|
||||||
|
xzcat ./ventoy/ventoy.disk.img.xz | dd status=none conv=fsync of=$DISK bs=512 count=$VENTOY_SECTOR_NUM seek=$part2_start_sector
|
||||||
|
|
||||||
|
#test UUID
|
||||||
|
testUUIDStr=$(vtoy_gen_uuid | hexdump -C)
|
||||||
|
vtdebug "test uuid: $testUUIDStr"
|
||||||
|
|
||||||
|
#disk uuid
|
||||||
|
vtoy_gen_uuid | dd status=none conv=fsync of=${DISK} seek=384 bs=1 count=16
|
||||||
|
|
||||||
|
vtinfo "sync data ..."
|
||||||
|
sync
|
||||||
|
|
||||||
|
vtinfo "esp partition processing ..."
|
||||||
|
if [ "$SECUREBOOT" != "YES" ]; then
|
||||||
|
vtoycli partresize -s $DISK $part2_start_sector
|
||||||
|
fi
|
||||||
|
|
||||||
|
vtinfo "update partition table $DISK $part2_start_sector ..."
|
||||||
|
vtoycli partresize -p $DISK $part2_start_sector
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
sync
|
||||||
|
echo ""
|
||||||
|
vtinfo "Ventoy non-destructive installation on $DISK successfully finished."
|
||||||
|
echo ""
|
||||||
|
else
|
||||||
|
echo ""
|
||||||
|
vterr "Ventoy non-destructive installation on $DISK failed."
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
|
||||||
else
|
else
|
||||||
vtdebug "update Ventoy ..."
|
vtdebug "update Ventoy ..."
|
||||||
@@ -441,47 +581,13 @@ else
|
|||||||
check_umount_disk "$DISK"
|
check_umount_disk "$DISK"
|
||||||
|
|
||||||
xzcat ./ventoy/ventoy.disk.img.xz | dd status=none conv=fsync of=$DISK bs=512 count=$VENTOY_SECTOR_NUM seek=$part2_start
|
xzcat ./ventoy/ventoy.disk.img.xz | dd status=none conv=fsync of=$DISK bs=512 count=$VENTOY_SECTOR_NUM seek=$part2_start
|
||||||
|
|
||||||
sync
|
sync
|
||||||
|
|
||||||
|
vtinfo "esp partition processing ..."
|
||||||
if [ "$SECUREBOOT" != "YES" ]; then
|
if [ "$SECUREBOOT" != "YES" ]; then
|
||||||
mkdir ./tmp_mnt
|
sleep 2
|
||||||
|
check_umount_disk "$DISK"
|
||||||
vtdebug "mounting part2 ...."
|
vtoycli partresize -s $DISK $part2_start
|
||||||
for tt in 1 2 3 4 5; do
|
|
||||||
check_umount_disk "$DISK"
|
|
||||||
|
|
||||||
if mount ${PART2} ./tmp_mnt > /dev/null 2>&1; then
|
|
||||||
vtdebug "mounting part2 success"
|
|
||||||
break
|
|
||||||
else
|
|
||||||
vtdebug "mounting part2 failed, now wait and retry..."
|
|
||||||
fi
|
|
||||||
sleep 2
|
|
||||||
done
|
|
||||||
|
|
||||||
rm -f ./tmp_mnt/EFI/BOOT/BOOTX64.EFI
|
|
||||||
rm -f ./tmp_mnt/EFI/BOOT/grubx64.efi
|
|
||||||
rm -f ./tmp_mnt/EFI/BOOT/BOOTIA32.EFI
|
|
||||||
rm -f ./tmp_mnt/EFI/BOOT/grubia32.efi
|
|
||||||
rm -f ./tmp_mnt/EFI/BOOT/MokManager.efi
|
|
||||||
rm -f ./tmp_mnt/EFI/BOOT/mmia32.efi
|
|
||||||
rm -f ./tmp_mnt/ENROLL_THIS_KEY_IN_MOKMANAGER.cer
|
|
||||||
mv ./tmp_mnt/EFI/BOOT/grubx64_real.efi ./tmp_mnt/EFI/BOOT/BOOTX64.EFI
|
|
||||||
mv ./tmp_mnt/EFI/BOOT/grubia32_real.efi ./tmp_mnt/EFI/BOOT/BOOTIA32.EFI
|
|
||||||
|
|
||||||
sync
|
|
||||||
|
|
||||||
for tt in 1 2 3; do
|
|
||||||
if umount ./tmp_mnt > /dev/null 2>&1; then
|
|
||||||
vtdebug "umount part2 success"
|
|
||||||
rm -rf ./tmp_mnt
|
|
||||||
break
|
|
||||||
else
|
|
||||||
vtdebug "umount part2 failed, now retry..."
|
|
||||||
sleep 1
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
INSTALL/tool/i386/vtoycli
Normal file
BIN
INSTALL/tool/i386/vtoycli
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
INSTALL/tool/mips64el/vtoycli
Normal file
BIN
INSTALL/tool/mips64el/vtoycli
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -68,10 +68,10 @@ check_tool_work_ok() {
|
|||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if vtoyfat -T; then
|
if vtoycli fat -T; then
|
||||||
vtdebug "vtoyfat test ok ..."
|
vtdebug "vtoycli fat test ok ..."
|
||||||
else
|
else
|
||||||
vtdebug "vtoyfat test fail ..."
|
vtdebug "vtoycli fat test fail ..."
|
||||||
ventoy_false
|
ventoy_false
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
@@ -183,7 +183,7 @@ check_disk_secure_boot() {
|
|||||||
|
|
||||||
PART2=$(get_disk_part_name $1 2)
|
PART2=$(get_disk_part_name $1 2)
|
||||||
|
|
||||||
vtoyfat -s $PART2
|
vtoycli fat -s $PART2
|
||||||
}
|
}
|
||||||
|
|
||||||
get_disk_ventoy_version() {
|
get_disk_ventoy_version() {
|
||||||
@@ -195,7 +195,7 @@ get_disk_ventoy_version() {
|
|||||||
|
|
||||||
PART2=$(get_disk_part_name $1 2)
|
PART2=$(get_disk_part_name $1 2)
|
||||||
|
|
||||||
ParseVer=$(vtoyfat $PART2)
|
ParseVer=$(vtoycli fat $PART2)
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
vtdebug "Ventoy version in $PART2 is $ParseVer"
|
vtdebug "Ventoy version in $PART2 is $ParseVer"
|
||||||
echo $ParseVer
|
echo $ParseVer
|
||||||
@@ -391,7 +391,7 @@ format_ventoy_disk_gpt() {
|
|||||||
|
|
||||||
sync
|
sync
|
||||||
|
|
||||||
vtoygpt -f $DISK
|
vtoycli gpt -f $DISK
|
||||||
sync
|
sync
|
||||||
|
|
||||||
udevadm trigger --name-match=$DISK >/dev/null 2>&1
|
udevadm trigger --name-match=$DISK >/dev/null 2>&1
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
INSTALL/tool/x86_64/vtoycli
Normal file
BIN
INSTALL/tool/x86_64/vtoycli
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -72,6 +72,13 @@ ls -1 ./grub/ | grep -v 'grub\.cfg' | while read line; do
|
|||||||
cp $OPT ./grub/$line $tmpmnt/grub/
|
cp $OPT ./grub/$line $tmpmnt/grub/
|
||||||
done
|
done
|
||||||
|
|
||||||
|
#tar help txt
|
||||||
|
cd $tmpmnt/grub/
|
||||||
|
tar czf help.tar.gz ./help/
|
||||||
|
rm -rf ./help
|
||||||
|
cd ../../
|
||||||
|
|
||||||
|
|
||||||
cp $OPT ./ventoy $tmpmnt/
|
cp $OPT ./ventoy $tmpmnt/
|
||||||
cp $OPT ./EFI $tmpmnt/
|
cp $OPT ./EFI $tmpmnt/
|
||||||
cp $OPT ./tool/ENROLL_THIS_KEY_IN_MOKMANAGER.cer $tmpmnt/
|
cp $OPT ./tool/ENROLL_THIS_KEY_IN_MOKMANAGER.cer $tmpmnt/
|
||||||
@@ -82,9 +89,9 @@ mkdir -p $tmpmnt/tool
|
|||||||
# cp $OPT ./tool/x86_64/mount.exfat-fuse $tmpmnt/tool/mount.exfat-fuse_x86_64
|
# cp $OPT ./tool/x86_64/mount.exfat-fuse $tmpmnt/tool/mount.exfat-fuse_x86_64
|
||||||
# cp $OPT ./tool/aarch64/mount.exfat-fuse $tmpmnt/tool/mount.exfat-fuse_aarch64
|
# cp $OPT ./tool/aarch64/mount.exfat-fuse $tmpmnt/tool/mount.exfat-fuse_aarch64
|
||||||
# to save space
|
# to save space
|
||||||
cp $OPT ./tool/i386/vtoygpt $tmpmnt/tool/mount.exfat-fuse_i386
|
dd status=none bs=1024 count=16 if=./tool/i386/vtoycli of=$tmpmnt/tool/mount.exfat-fuse_i386
|
||||||
cp $OPT ./tool/x86_64/vtoygpt $tmpmnt/tool/mount.exfat-fuse_x86_64
|
dd status=none bs=1024 count=16 if=./tool/x86_64/vtoycli of=$tmpmnt/tool/mount.exfat-fuse_x86_64
|
||||||
cp $OPT ./tool/aarch64/vtoygpt $tmpmnt/tool/mount.exfat-fuse_aarch64
|
dd status=none bs=1024 count=16 if=./tool/aarch64/vtoycli of=$tmpmnt/tool/mount.exfat-fuse_aarch64
|
||||||
|
|
||||||
|
|
||||||
rm -f $tmpmnt/grub/i386-pc/*.img
|
rm -f $tmpmnt/grub/i386-pc/*.img
|
||||||
@@ -165,7 +172,14 @@ tar -czvf ventoy-${curver}-linux.tar.gz $tmpdir
|
|||||||
|
|
||||||
|
|
||||||
rm -f ventoy-${curver}-windows.zip
|
rm -f ventoy-${curver}-windows.zip
|
||||||
cp $OPT Ventoy2Disk*.exe $tmpdir/
|
|
||||||
|
cp $OPT Ventoy2Disk.exe $tmpdir/
|
||||||
|
cp $OPT FOR_X64_ARM.txt $tmpdir/
|
||||||
|
mkdir -p $tmpdir/altexe
|
||||||
|
cp $OPT Ventoy2Disk_*.exe $tmpdir/altexe/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
cp $OPT $LANG_DIR/languages.json $tmpdir/ventoy/
|
cp $OPT $LANG_DIR/languages.json $tmpdir/ventoy/
|
||||||
rm -rf $tmpdir/tool
|
rm -rf $tmpdir/tool
|
||||||
rm -f $tmpdir/*.sh
|
rm -f $tmpdir/*.sh
|
||||||
|
@@ -48,6 +48,12 @@
|
|||||||
"STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
|
"STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
|
||||||
"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.",
|
||||||
|
"STR_MENU_PART_RESIZE":"Non-destructive Install",
|
||||||
|
"STR_PART_RESIZE_TIP":"Ventoy will try non-destructive installation if possible. #@Continue?",
|
||||||
|
"STR_PART_RESIZE_SUCCESS":"Congratulations!#@Ventoy non-destructive installation successfully finished.",
|
||||||
|
"STR_PART_RESIZE_FAILED":"Non-destructive installation failed, Check log.txt for details.",
|
||||||
|
"STR_PART_RESIZE_UNSUPPORTED":"Ventoy non-destructive installation stopped because some conditions cannot be met. Check log.txt for details.",
|
||||||
|
|
||||||
"STRXXX":""
|
"STRXXX":""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -71,9 +77,9 @@
|
|||||||
"STR_INSTALL_TIP":"디스크가 포맷되고 모든 데이터가 손실됩니다.#@계속하시겠습니까?",
|
"STR_INSTALL_TIP":"디스크가 포맷되고 모든 데이터가 손실됩니다.#@계속하시겠습니까?",
|
||||||
"STR_INSTALL_TIP2":"디스크가 포맷되고 모든 데이터가 손실됩니다.#@계속하시겠습니까? (다시 확인)",
|
"STR_INSTALL_TIP2":"디스크가 포맷되고 모든 데이터가 손실됩니다.#@계속하시겠습니까? (다시 확인)",
|
||||||
"STR_INSTALL_SUCCESS":"축하합니다!#@Ventoy가 장치에 성공적으로 설치되었습니다.",
|
"STR_INSTALL_SUCCESS":"축하합니다!#@Ventoy가 장치에 성공적으로 설치되었습니다.",
|
||||||
"STR_INSTALL_FAILED":"설치 중 오류가 발생했습니다. USB를 다시 연결하고 다시 시도할 수 있습니다. 자세한 내용은 log.txt를 확인하십시오.",
|
"STR_INSTALL_FAILED":"설치 중 오류가 발생했습니다. USB를 다시 삽입하고 다시 시도할 수 있습니다. 자세한 내용은 log.txt를 확인하십시오.",
|
||||||
"STR_UPDATE_SUCCESS":"축하합니다!#@Ventoy가 장치에 성공적으로 업데이트되었습니다.",
|
"STR_UPDATE_SUCCESS":"축하합니다!#@Ventoy가 장치에 성공적으로 업데이트되었습니다.",
|
||||||
"STR_UPDATE_FAILED":"업데이트 중에 오류가 발생했습니다. USB를 다시 연결하고 다시 시도할 수 있습니다. 자세한 내용은 log.txt를 확인하십시오.",
|
"STR_UPDATE_FAILED":"업데이트 중에 오류가 발생했습니다. USB를 다시 삽입하고 다시 시도할 수 있습니다. 자세한 내용은 log.txt를 확인하십시오.",
|
||||||
"STR_WAIT_PROCESS":"현재 작업이 실행 중입니다. 기다려 주십시오...",
|
"STR_WAIT_PROCESS":"현재 작업이 실행 중입니다. 기다려 주십시오...",
|
||||||
"STR_MENU_OPTION":"옵션",
|
"STR_MENU_OPTION":"옵션",
|
||||||
"STR_MENU_SECURE_BOOT":"보안 부트 (Secure Boot) 지원",
|
"STR_MENU_SECURE_BOOT":"보안 부트 (Secure Boot) 지원",
|
||||||
@@ -84,7 +90,7 @@
|
|||||||
"STR_SPACE_VAL_INVALID":"예약된 공간의 값이 잘못되었습니다",
|
"STR_SPACE_VAL_INVALID":"예약된 공간의 값이 잘못되었습니다",
|
||||||
"STR_MENU_CLEAR":"Ventoy 제거",
|
"STR_MENU_CLEAR":"Ventoy 제거",
|
||||||
"STR_CLEAR_SUCCESS":"Ventoy가 장치에서 성공적으로 제거되었습니다.",
|
"STR_CLEAR_SUCCESS":"Ventoy가 장치에서 성공적으로 제거되었습니다.",
|
||||||
"STR_CLEAR_FAILED":"디스크에서 Ventoy를 지울 때 오류가 발생했습니다. USB를 다시 연결하고 다시 시도할 수 있습니다. 자세한 내용은 log.txt를 확인하십시오.",
|
"STR_CLEAR_FAILED":"디스크에서 Ventoy를 지울 때 오류가 발생했습니다. USB를 다시 삽입하고 다시 시도할 수 있습니다. 자세한 내용은 log.txt를 확인하십시오.",
|
||||||
"STR_MENU_PART_STYLE":"파티션 유형",
|
"STR_MENU_PART_STYLE":"파티션 유형",
|
||||||
"STR_DISK_2TB_MBR_ERROR":"2TB 이상의 디스크는 GPT를 선택하십시오",
|
"STR_DISK_2TB_MBR_ERROR":"2TB 이상의 디스크는 GPT를 선택하십시오",
|
||||||
"STR_SHOW_ALL_DEV":"모든 장치 표시",
|
"STR_SHOW_ALL_DEV":"모든 장치 표시",
|
||||||
@@ -97,8 +103,14 @@
|
|||||||
"STR_WEB_SERVICE_BUSY":"서비스가 사용 중입니다. 나중에 다시 시도하십시오.",
|
"STR_WEB_SERVICE_BUSY":"서비스가 사용 중입니다. 나중에 다시 시도하십시오.",
|
||||||
"STR_MENU_VTSI_CREATE":"VTSI 파일 생성",
|
"STR_MENU_VTSI_CREATE":"VTSI 파일 생성",
|
||||||
"STR_VTSI_CREATE_TIP":"이번에는 장치에 쓰지 않고 VTSI 파일#@만 생성합니다.#@계속하시겠습니까?",
|
"STR_VTSI_CREATE_TIP":"이번에는 장치에 쓰지 않고 VTSI 파일#@만 생성합니다.#@계속하시겠습니까?",
|
||||||
"STR_VTSI_CREATE_SUCCESS":"VTSI 파일이 성공적으로 생성되었습니다!#@Rufus(3.15+)를 사용하여 장치에 기록하여 Ventoy 설치를 완료할 수 있습니다.",
|
"STR_VTSI_CREATE_SUCCESS":"VTSI 파일이 성공적으로 생성되었습니다!#@Rufus (3.15+)를 사용하여 장치에 기록하여 Ventoy 설치를 완료할 수 있습니다.",
|
||||||
"STR_VTSI_CREATE_FAILED":"VTSI 파일을 생성하지 못했습니다.",
|
"STR_VTSI_CREATE_FAILED":"VTSI 파일을 생성하지 못했습니다.",
|
||||||
|
"STR_MENU_PART_RESIZE":"비파괴 설치",
|
||||||
|
"STR_PART_RESIZE_TIP":"가능하면 Ventoy가 비파괴 설치를 시도합니다. #@계속하시겠습니까?",
|
||||||
|
"STR_PART_RESIZE_SUCCESS":"축하합니다!#@Ventoy 비파괴 설치가 완료되었습니다.",
|
||||||
|
"STR_PART_RESIZE_FAILED":"비파괴 설치에 실패했습니다. 자세한 내용은 log.txt를 확인하십시오.",
|
||||||
|
"STR_PART_RESIZE_UNSUPPORTED":"일부 조건을 충족할 수 없기 때문에 Ventoy 비파괴 설치가 중지되었습니다. 자세한 내용은 log.txt를 확인하십시오.",
|
||||||
|
|
||||||
"STRXXX":""
|
"STRXXX":""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -150,6 +162,12 @@
|
|||||||
"STR_VTSI_CREATE_TIP":"本操作不会向设备中写入数据,而只会生成一个 VTSI 文件#@是否继续?",
|
"STR_VTSI_CREATE_TIP":"本操作不会向设备中写入数据,而只会生成一个 VTSI 文件#@是否继续?",
|
||||||
"STR_VTSI_CREATE_SUCCESS":"VTSI 文件创建成功,你可以使用Rufus(3.15+)将其写入对应设备,从而完成Ventoy的安装",
|
"STR_VTSI_CREATE_SUCCESS":"VTSI 文件创建成功,你可以使用Rufus(3.15+)将其写入对应设备,从而完成Ventoy的安装",
|
||||||
"STR_VTSI_CREATE_FAILED":"VTSI 文件创建失败",
|
"STR_VTSI_CREATE_FAILED":"VTSI 文件创建失败",
|
||||||
|
"STR_MENU_PART_RESIZE":"无损安装",
|
||||||
|
"STR_PART_RESIZE_TIP":"Ventoy将尝试进行无损安装。注意:任何磁盘操作都有一定的风险,对于重要数据建议做好备份。#@是否继续?",
|
||||||
|
"STR_PART_RESIZE_SUCCESS":"恭喜你! Ventoy 成功完成了无损安装。",
|
||||||
|
"STR_PART_RESIZE_FAILED":"Ventoy 无损安装失败。详细信息请查阅 log.txt 文件。",
|
||||||
|
"STR_PART_RESIZE_UNSUPPORTED":"条件不满足,无法进行无损安装。详细信息请查阅 log.txt 文件。",
|
||||||
|
|
||||||
"STRXXX":""
|
"STRXXX":""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -201,6 +219,12 @@
|
|||||||
"STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
|
"STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
|
||||||
"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.",
|
||||||
|
"STR_MENU_PART_RESIZE":"Non-destructive Install",
|
||||||
|
"STR_PART_RESIZE_TIP":"Ventoy will try non-destructive installation if possible. #@Continue?",
|
||||||
|
"STR_PART_RESIZE_SUCCESS":"Congratulations!#@Ventoy non-destructive installation successfully finished.",
|
||||||
|
"STR_PART_RESIZE_FAILED":"Non-destructive installation failed, Check log.txt for details.",
|
||||||
|
"STR_PART_RESIZE_UNSUPPORTED":"Ventoy non-destructive installation stopped because some conditions cannot be met. Check log.txt for details.",
|
||||||
|
|
||||||
"STRXXX":""
|
"STRXXX":""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -252,6 +276,12 @@
|
|||||||
"STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
|
"STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
|
||||||
"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.",
|
||||||
|
"STR_MENU_PART_RESIZE":"Non-destructive Install",
|
||||||
|
"STR_PART_RESIZE_TIP":"Ventoy will try non-destructive installation if possible. #@Continue?",
|
||||||
|
"STR_PART_RESIZE_SUCCESS":"Congratulations!#@Ventoy non-destructive installation successfully finished.",
|
||||||
|
"STR_PART_RESIZE_FAILED":"Non-destructive installation failed, Check log.txt for details.",
|
||||||
|
"STR_PART_RESIZE_UNSUPPORTED":"Ventoy non-destructive installation stopped because some conditions cannot be met. Check log.txt for details.",
|
||||||
|
|
||||||
"STRXXX":""
|
"STRXXX":""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -299,10 +329,16 @@
|
|||||||
"STR_WEB_SERVICE_UNAVAILABLE":"Błąd komunikacji: usługa niedostępna",
|
"STR_WEB_SERVICE_UNAVAILABLE":"Błąd komunikacji: usługa niedostępna",
|
||||||
"STR_WEB_TOKEN_MISMATCH":"Stan daemona został zaktualizowany, spróbuj ponownie później.",
|
"STR_WEB_TOKEN_MISMATCH":"Stan daemona został zaktualizowany, spróbuj ponownie później.",
|
||||||
"STR_WEB_SERVICE_BUSY":"Usługa jest zajęta, spróbuj ponownie później.",
|
"STR_WEB_SERVICE_BUSY":"Usługa jest zajęta, spróbuj ponownie później.",
|
||||||
"STR_MENU_VTSI_CREATE":"Generate VTSI File",
|
"STR_MENU_VTSI_CREATE":"Wygeneruj plik VTSI",
|
||||||
"STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
|
"STR_VTSI_CREATE_TIP":"Tym razem nie napisze do urządzenia ale tylko wygeneruje plik VTSI#@Kontynuować?",
|
||||||
"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":"Pomyślnie wygenerowane plik VTSI!#@Możesz teraz użyć Rufus'a(3.15+) aby napisać go na urządzenie by dokończyć instlację Ventoy.",
|
||||||
"STR_VTSI_CREATE_FAILED":"VTSI file created failed.",
|
"STR_VTSI_CREATE_FAILED":"Generacja pliku VTSI nie powiodła się.",
|
||||||
|
"STR_MENU_PART_RESIZE":"Nieniszcząsa instalacja",
|
||||||
|
"STR_PART_RESIZE_TIP":"Ventoy spróbuje nieniszczącej instalacji jeśli jest możliwa. #@Kontynuować?",
|
||||||
|
"STR_PART_RESIZE_SUCCESS":"Gratulacje!#@Nieniszcząca instlacja Ventoy zakończyła się pomyślnie.",
|
||||||
|
"STR_PART_RESIZE_FAILED":"Nieniszcząca instalacja nie powiodła się, sprawdz log.txt po szczegóły.",
|
||||||
|
"STR_PART_RESIZE_UNSUPPORTED":"Nieniszcząca instalacja Ventoy została zatrzymana ponieważ niektóre wymagania nie zostały spełnione. Sprawdz log.txt po szczegóły.",
|
||||||
|
|
||||||
"STRXXX":""
|
"STRXXX":""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -354,6 +390,12 @@
|
|||||||
"STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
|
"STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
|
||||||
"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.",
|
||||||
|
"STR_MENU_PART_RESIZE":"Non-destructive Install",
|
||||||
|
"STR_PART_RESIZE_TIP":"Ventoy will try non-destructive installation if possible. #@Continue?",
|
||||||
|
"STR_PART_RESIZE_SUCCESS":"Congratulations!#@Ventoy non-destructive installation successfully finished.",
|
||||||
|
"STR_PART_RESIZE_FAILED":"Non-destructive installation failed, Check log.txt for details.",
|
||||||
|
"STR_PART_RESIZE_UNSUPPORTED":"Ventoy non-destructive installation stopped because some conditions cannot be met. Check log.txt for details.",
|
||||||
|
|
||||||
"STRXXX":""
|
"STRXXX":""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -405,6 +447,12 @@
|
|||||||
"STR_VTSI_CREATE_TIP":"Şu an aygıta yazılmayacak,sadece bir VTSI dosyası oluşturulacak#@Devam edilsin mi?",
|
"STR_VTSI_CREATE_TIP":"Şu an aygıta yazılmayacak,sadece bir VTSI dosyası oluşturulacak#@Devam edilsin mi?",
|
||||||
"STR_VTSI_CREATE_SUCCESS":"VTSI dosyası başarılı bir şekilde oluşturuldu!#@Ventoy'un aygıta kurulumunu tamamlamak için Rufus(3.15+) programını kullanabilirsiniz.",
|
"STR_VTSI_CREATE_SUCCESS":"VTSI dosyası başarılı bir şekilde oluşturuldu!#@Ventoy'un aygıta kurulumunu tamamlamak için Rufus(3.15+) programını kullanabilirsiniz.",
|
||||||
"STR_VTSI_CREATE_FAILED":"VTSI dosyası oluşturma başarısız oldu!",
|
"STR_VTSI_CREATE_FAILED":"VTSI dosyası oluşturma başarısız oldu!",
|
||||||
|
"STR_MENU_PART_RESIZE":"Tahribatsız Kurulum",
|
||||||
|
"STR_PART_RESIZE_TIP":"Ventoy,mümkünse tahribatsız kurulumu deneyecektir. . #@Devam edilsin mi?",
|
||||||
|
"STR_PART_RESIZE_SUCCESS":"Tebrikler!#@Ventoy Tahribatsız Kurulum, başarıyla tamamlandı.",
|
||||||
|
"STR_PART_RESIZE_FAILED":"Tahribatsız kurulum başarısız oldu, ayrıntılar için log.txt dosyasını kontrol edin.",
|
||||||
|
"STR_PART_RESIZE_UNSUPPORTED":"Ventoy Tahribatsız Kurulum, bazı koşullar sağlanmadığı için durduruldu. Ayrıntılı bilgi için log.txt dosyasını kontrol edin.",
|
||||||
|
|
||||||
"STRXXX":""
|
"STRXXX":""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -452,10 +500,16 @@
|
|||||||
"STR_WEB_SERVICE_UNAVAILABLE":"Kommunikationsfehler: Dienst nicht verfügbar",
|
"STR_WEB_SERVICE_UNAVAILABLE":"Kommunikationsfehler: Dienst nicht verfügbar",
|
||||||
"STR_WEB_TOKEN_MISMATCH":"Daemon-Status aktualisiert, bitte später erneut versuchen.",
|
"STR_WEB_TOKEN_MISMATCH":"Daemon-Status aktualisiert, bitte später erneut versuchen.",
|
||||||
"STR_WEB_SERVICE_BUSY":"Dienst ist ausgelastet, bitte später erneut versuchen.",
|
"STR_WEB_SERVICE_BUSY":"Dienst ist ausgelastet, bitte später erneut versuchen.",
|
||||||
"STR_MENU_VTSI_CREATE":"Generate VTSI File",
|
"STR_MENU_VTSI_CREATE":"VTSI-Datei erstellen",
|
||||||
"STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
|
"STR_VTSI_CREATE_TIP":"Es wird nur eine VTSI-Datei erstellt und nichts auf ein Gerät geschrieben.#@Fortfahren?",
|
||||||
"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-Datei erfolgreich erstellt!#@Sie können Rufus(3.15+) zum auf das Gerät schreiben verwenden um die Installation von Ventoy fertigzustellen.",
|
||||||
"STR_VTSI_CREATE_FAILED":"VTSI file created failed.",
|
"STR_VTSI_CREATE_FAILED":"VTSI-Datei konnte nicht erstellt werden.",
|
||||||
|
"STR_MENU_PART_RESIZE":"Non-destructive Install",
|
||||||
|
"STR_PART_RESIZE_TIP":"Ventoy wird eine Installation ohne vorherige Formatierung versuchen. #@Fortfahren?",
|
||||||
|
"STR_PART_RESIZE_SUCCESS":"Glückwunsch!#@Die Installation von Ventoy, ohne vorherige Formatierung, wurde erfolgreich abgeschlossen.",
|
||||||
|
"STR_PART_RESIZE_FAILED":"Installation ohne vorherige Formatierung fehlgeschlagen. Für Details die log.txt prüfen.",
|
||||||
|
"STR_PART_RESIZE_UNSUPPORTED":"Installation ohne vorherige Formatierung wurde auf Grund einiger nicht erfüllbarer Bedingungen gestoppt. Für Details die log.txt prüfen.",
|
||||||
|
|
||||||
"STRXXX":""
|
"STRXXX":""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -507,6 +561,12 @@
|
|||||||
"STR_VTSI_CREATE_TIP":"Aqueste còp cap d’escritura al disc, generacion del fichiet VTSI sonque#@Contunhar ?",
|
"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":"Fracàs de la creacion del fichièr VTSI.",
|
"STR_VTSI_CREATE_FAILED":"Fracàs de la creacion del fichièr VTSI.",
|
||||||
|
"STR_MENU_PART_RESIZE":"Non-destructive Install",
|
||||||
|
"STR_PART_RESIZE_TIP":"Ventoy will try non-destructive installation if possible. #@Continue?",
|
||||||
|
"STR_PART_RESIZE_SUCCESS":"Congratulations!#@Ventoy non-destructive installation successfully finished.",
|
||||||
|
"STR_PART_RESIZE_FAILED":"Non-destructive installation failed, Check log.txt for details.",
|
||||||
|
"STR_PART_RESIZE_UNSUPPORTED":"Ventoy non-destructive installation stopped because some conditions cannot be met. Check log.txt for details.",
|
||||||
|
|
||||||
"STRXXX":""
|
"STRXXX":""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -558,6 +618,12 @@
|
|||||||
"STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
|
"STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
|
||||||
"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.",
|
||||||
|
"STR_MENU_PART_RESIZE":"Non-destructive Install",
|
||||||
|
"STR_PART_RESIZE_TIP":"Ventoy will try non-destructive installation if possible. #@Continue?",
|
||||||
|
"STR_PART_RESIZE_SUCCESS":"Congratulations!#@Ventoy non-destructive installation successfully finished.",
|
||||||
|
"STR_PART_RESIZE_FAILED":"Non-destructive installation failed, Check log.txt for details.",
|
||||||
|
"STR_PART_RESIZE_UNSUPPORTED":"Ventoy non-destructive installation stopped because some conditions cannot be met. Check log.txt for details.",
|
||||||
|
|
||||||
"STRXXX":""
|
"STRXXX":""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -609,6 +675,12 @@
|
|||||||
"STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
|
"STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
|
||||||
"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.",
|
||||||
|
"STR_MENU_PART_RESIZE":"Non-destructive Install",
|
||||||
|
"STR_PART_RESIZE_TIP":"Ventoy will try non-destructive installation if possible. #@Continue?",
|
||||||
|
"STR_PART_RESIZE_SUCCESS":"Congratulations!#@Ventoy non-destructive installation successfully finished.",
|
||||||
|
"STR_PART_RESIZE_FAILED":"Non-destructive installation failed, Check log.txt for details.",
|
||||||
|
"STR_PART_RESIZE_UNSUPPORTED":"Ventoy non-destructive installation stopped because some conditions cannot be met. Check log.txt for details.",
|
||||||
|
|
||||||
"STRXXX":""
|
"STRXXX":""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -660,6 +732,12 @@
|
|||||||
"STR_VTSI_CREATE_TIP":"Esta vez no se escribirá al dispositivo, pero solo generará un archivo VTSI#@¿Continuar?",
|
"STR_VTSI_CREATE_TIP":"Esta vez no se escribirá al dispositivo, pero solo generará un archivo VTSI#@¿Continuar?",
|
||||||
"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_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":"Fallo en el archivo VTSI creado.",
|
"STR_VTSI_CREATE_FAILED":"Fallo en el archivo VTSI creado.",
|
||||||
|
"STR_MENU_PART_RESIZE":"Non-destructive Install",
|
||||||
|
"STR_PART_RESIZE_TIP":"Ventoy will try non-destructive installation if possible. #@Continue?",
|
||||||
|
"STR_PART_RESIZE_SUCCESS":"Congratulations!#@Ventoy non-destructive installation successfully finished.",
|
||||||
|
"STR_PART_RESIZE_FAILED":"Non-destructive installation failed, Check log.txt for details.",
|
||||||
|
"STR_PART_RESIZE_UNSUPPORTED":"Ventoy non-destructive installation stopped because some conditions cannot be met. Check log.txt for details.",
|
||||||
|
|
||||||
"STRXXX":""
|
"STRXXX":""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -711,6 +789,12 @@
|
|||||||
"STR_VTSI_CREATE_TIP":"На этот раз Ventoy не будет установлен на устройство, а будет только создан файл VTSI#@Продолжить?",
|
"STR_VTSI_CREATE_TIP":"На этот раз Ventoy не будет установлен на устройство, а будет только создан файл VTSI#@Продолжить?",
|
||||||
"STR_VTSI_CREATE_SUCCESS":"Файл VTSI создан успешно!#@Вы можете использовать Rufus(3.15+), чтобы записать его на устройство, для завершения установки Ventoy.",
|
"STR_VTSI_CREATE_SUCCESS":"Файл VTSI создан успешно!#@Вы можете использовать Rufus(3.15+), чтобы записать его на устройство, для завершения установки Ventoy.",
|
||||||
"STR_VTSI_CREATE_FAILED":"Ошибка создания файла VTSI.",
|
"STR_VTSI_CREATE_FAILED":"Ошибка создания файла VTSI.",
|
||||||
|
"STR_MENU_PART_RESIZE":"Non-destructive Install",
|
||||||
|
"STR_PART_RESIZE_TIP":"Ventoy will try non-destructive installation if possible. #@Continue?",
|
||||||
|
"STR_PART_RESIZE_SUCCESS":"Congratulations!#@Ventoy non-destructive installation successfully finished.",
|
||||||
|
"STR_PART_RESIZE_FAILED":"Non-destructive installation failed, Check log.txt for details.",
|
||||||
|
"STR_PART_RESIZE_UNSUPPORTED":"Ventoy non-destructive installation stopped because some conditions cannot be met. Check log.txt for details.",
|
||||||
|
|
||||||
"STRXXX":""
|
"STRXXX":""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -762,6 +846,12 @@
|
|||||||
"STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
|
"STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
|
||||||
"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.",
|
||||||
|
"STR_MENU_PART_RESIZE":"Non-destructive Install",
|
||||||
|
"STR_PART_RESIZE_TIP":"Ventoy will try non-destructive installation if possible. #@Continue?",
|
||||||
|
"STR_PART_RESIZE_SUCCESS":"Congratulations!#@Ventoy non-destructive installation successfully finished.",
|
||||||
|
"STR_PART_RESIZE_FAILED":"Non-destructive installation failed, Check log.txt for details.",
|
||||||
|
"STR_PART_RESIZE_UNSUPPORTED":"Ventoy non-destructive installation stopped because some conditions cannot be met. Check log.txt for details.",
|
||||||
|
|
||||||
"STRXXX":""
|
"STRXXX":""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -813,6 +903,12 @@
|
|||||||
"STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
|
"STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
|
||||||
"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.",
|
||||||
|
"STR_MENU_PART_RESIZE":"Non-destructive Install",
|
||||||
|
"STR_PART_RESIZE_TIP":"Ventoy will try non-destructive installation if possible. #@Continue?",
|
||||||
|
"STR_PART_RESIZE_SUCCESS":"Congratulations!#@Ventoy non-destructive installation successfully finished.",
|
||||||
|
"STR_PART_RESIZE_FAILED":"Non-destructive installation failed, Check log.txt for details.",
|
||||||
|
"STR_PART_RESIZE_UNSUPPORTED":"Ventoy non-destructive installation stopped because some conditions cannot be met. Check log.txt for details.",
|
||||||
|
|
||||||
"STRXXX":""
|
"STRXXX":""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -864,6 +960,12 @@
|
|||||||
"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_TIP":"Deze keer wordt er niet naar het apparaat geschreven, maar wordt er alleen een VTSI-bestand gegenereerd#@Doorgaan?",
|
||||||
"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_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":"Aanmaken van VTSI-bestand mislukt.",
|
"STR_VTSI_CREATE_FAILED":"Aanmaken van VTSI-bestand mislukt.",
|
||||||
|
"STR_MENU_PART_RESIZE":"Non-destructive Install",
|
||||||
|
"STR_PART_RESIZE_TIP":"Ventoy will try non-destructive installation if possible. #@Continue?",
|
||||||
|
"STR_PART_RESIZE_SUCCESS":"Congratulations!#@Ventoy non-destructive installation successfully finished.",
|
||||||
|
"STR_PART_RESIZE_FAILED":"Non-destructive installation failed, Check log.txt for details.",
|
||||||
|
"STR_PART_RESIZE_UNSUPPORTED":"Ventoy non-destructive installation stopped because some conditions cannot be met. Check log.txt for details.",
|
||||||
|
|
||||||
"STRXXX":""
|
"STRXXX":""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -915,6 +1017,12 @@
|
|||||||
"STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
|
"STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
|
||||||
"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.",
|
||||||
|
"STR_MENU_PART_RESIZE":"Non-destructive Install",
|
||||||
|
"STR_PART_RESIZE_TIP":"Ventoy will try non-destructive installation if possible. #@Continue?",
|
||||||
|
"STR_PART_RESIZE_SUCCESS":"Congratulations!#@Ventoy non-destructive installation successfully finished.",
|
||||||
|
"STR_PART_RESIZE_FAILED":"Non-destructive installation failed, Check log.txt for details.",
|
||||||
|
"STR_PART_RESIZE_UNSUPPORTED":"Ventoy non-destructive installation stopped because some conditions cannot be met. Check log.txt for details.",
|
||||||
|
|
||||||
"STRXXX":""
|
"STRXXX":""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -966,57 +1074,69 @@
|
|||||||
"STR_VTSI_CREATE_TIP":"VTSIファイルを生成し,記憶装置への書き込みは行いません。#@続行しますか?",
|
"STR_VTSI_CREATE_TIP":"VTSIファイルを生成し,記憶装置への書き込みは行いません。#@続行しますか?",
|
||||||
"STR_VTSI_CREATE_SUCCESS":"VTSIファイルが生成されました。#@Rufus(3.15以上の版)を使って記憶装置に書き込んで,Ventoyの導入を完遂しましょう。",
|
"STR_VTSI_CREATE_SUCCESS":"VTSIファイルが生成されました。#@Rufus(3.15以上の版)を使って記憶装置に書き込んで,Ventoyの導入を完遂しましょう。",
|
||||||
"STR_VTSI_CREATE_FAILED":"VTSIファイルを生成できませんでした。",
|
"STR_VTSI_CREATE_FAILED":"VTSIファイルを生成できませんでした。",
|
||||||
|
"STR_MENU_PART_RESIZE":"Non-destructive Install",
|
||||||
|
"STR_PART_RESIZE_TIP":"Ventoy will try non-destructive installation if possible. #@Continue?",
|
||||||
|
"STR_PART_RESIZE_SUCCESS":"Congratulations!#@Ventoy non-destructive installation successfully finished.",
|
||||||
|
"STR_PART_RESIZE_FAILED":"Non-destructive installation failed, Check log.txt for details.",
|
||||||
|
"STR_PART_RESIZE_UNSUPPORTED":"Ventoy non-destructive installation stopped because some conditions cannot be met. Check log.txt for details.",
|
||||||
|
|
||||||
"STRXXX":""
|
"STRXXX":""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name":"Italian (Italiano)",
|
"name":"Italian (Italiano)",
|
||||||
"FontFamily":"Courier New",
|
"FontFamily":"Courier New",
|
||||||
"FontSize":16,
|
"FontSize":16,
|
||||||
"Author":"AverageUser2,Albano Battistella",
|
"Author":"AverageUser2,Albano Battistella,bovirus",
|
||||||
|
|
||||||
"STR_ERROR":"Errore",
|
"STR_ERROR":"Errore",
|
||||||
"STR_WARNING":"Attenzione",
|
"STR_WARNING":"Attenzione",
|
||||||
"STR_INFO":"Info",
|
"STR_INFO":"Info",
|
||||||
"STR_INCORRECT_DIR":"Si prega di eseguire nella cartella corretta",
|
"STR_INCORRECT_DIR":"Eseguilo nella cartella corretta",
|
||||||
"STR_INCORRECT_TREE_DIR":"Non eseguire qui, scarica il pacchetto di installazione ed avvialo",
|
"STR_INCORRECT_TREE_DIR":"Non eseguirlo qui.#@Scarica il pacchetto di installazione ed avvialo.",
|
||||||
"STR_DEVICE":"Dispositivo",
|
"STR_DEVICE":"Dispositivo",
|
||||||
"STR_LOCAL_VER":"Versione locale di Ventoy",
|
"STR_LOCAL_VER":"Versione locale di Ventoy",
|
||||||
"STR_DISK_VER":"Ventoy nel dispositivo",
|
"STR_DISK_VER":"Ventoy nel dispositivo",
|
||||||
"STR_STATUS":"Stato - PRONTO",
|
"STR_STATUS":"Stato - PRONTO",
|
||||||
"STR_INSTALL":"Installa",
|
"STR_INSTALL":"Installa",
|
||||||
"STR_UPDATE":"Aggiorna",
|
"STR_UPDATE":"Aggiorna",
|
||||||
"STR_UPDATE_TIP":"L'aggiornamento è sicuro, i file presenti nel dispositivo rimarranno invariati.#@Continuare?",
|
"STR_UPDATE_TIP":"L'aggiornamento è sicuro, i file presenti nel dispositivo rimarranno invariati.#@Vuoi continuare?",
|
||||||
"STR_INSTALL_TIP":"Il disco verrà formattato e tutti i dati saranno persi.#@Continuare?",
|
"STR_INSTALL_TIP":"Il disco verrà formattato e tutti i dati saranno persi.#@Vuoi continuare?",
|
||||||
"STR_INSTALL_TIP2":"Il disco verrà formattato e tutti i dati saranno persi.#@Continuare?' (seconda verifica)",
|
"STR_INSTALL_TIP2":"Il disco verrà formattato e tutti i dati saranno persi.#@Vuoi continuare (seconda verifica)?",
|
||||||
"STR_INSTALL_SUCCESS":"Congratulazioni!#@Ventoy è stato installato con successo nel dispositivo",
|
"STR_INSTALL_SUCCESS":"Congratulazioni!#@Installazione di Ventoy nel dispositivo completata.",
|
||||||
"STR_INSTALL_FAILED":"Si è verificato un errore durante l'installazione. Riconnetti il dispostivo e riprova. Controlla il file log.txt per i dettagli.",
|
"STR_INSTALL_FAILED":"Si è verificato un errore durante l'installazione.#@Riconnetti il dispositivo e riprova.#@Per i dettagli controlla il file log.txt .",
|
||||||
"STR_UPDATE_SUCCESS":"Congratulazioni!#@Ventoy è stato aggiornato con successo nel dispositivo",
|
"STR_UPDATE_SUCCESS":"Congratulazioni!#@Aggiornamento di Ventoy nel dispositivo completato",
|
||||||
"STR_UPDATE_FAILED":"Si è verificato un errore durante l'aggiornamento. Riconnetti il dispostivo e riprova. Controlla il file log.txt per i dettagli.",
|
"STR_UPDATE_FAILED":"Si è verificato un errore durante l'aggiornamento.#@Riconnetti il dispositivo e riprova.#@Per i dettagli controlla il file log.txt.",
|
||||||
"STR_WAIT_PROCESS":"Un processo è in esecuzione, attendere prego...",
|
"STR_WAIT_PROCESS":"Un processo è in esecuzione. Attendi...",
|
||||||
"STR_MENU_OPTION":"Opzioni",
|
"STR_MENU_OPTION":"Opzioni",
|
||||||
"STR_MENU_SECURE_BOOT":"Avvio protetto (secure boot)",
|
"STR_MENU_SECURE_BOOT":"Avvio protetto (secure boot)",
|
||||||
"STR_MENU_PART_CFG":"Configurazione della partizione",
|
"STR_MENU_PART_CFG":"Configurazione partizione",
|
||||||
"STR_BTN_OK":"OK",
|
"STR_BTN_OK":"OK",
|
||||||
"STR_BTN_CANCEL":"Annulla",
|
"STR_BTN_CANCEL":"Annulla",
|
||||||
"STR_PRESERVE_SPACE":"Riserva spazio nella parte finale del disco",
|
"STR_PRESERVE_SPACE":"Riserva spazio nella parte finale del disco",
|
||||||
"STR_SPACE_VAL_INVALID":"Quantità di spazio da riservare non valida",
|
"STR_SPACE_VAL_INVALID":"Quantità di spazio da riservare non valida",
|
||||||
"STR_MENU_CLEAR":"Rimuovi Ventoy",
|
"STR_MENU_CLEAR":"Rimuovi Ventoy",
|
||||||
"STR_CLEAR_SUCCESS":"Ventoy è stato rimosso con successo dal dispositivo.",
|
"STR_CLEAR_SUCCESS":"Rimozione di Ventoy dal dispositivo completata.",
|
||||||
"STR_CLEAR_FAILED":"Si è verificato un errore durante la rimozione di Ventoy dal dispositivo. Riconnetti il dispositivo e riprova. Controlla il file log.txt per maggiori dettagli",
|
"STR_CLEAR_FAILED":"Si è verificato un errore durante la rimozione di Ventoy dal dispositivo.#@Riconnetti il dispositivo e riprova.#@Per i dettagli controlla il file log.txt.",
|
||||||
"STR_MENU_PART_STYLE":"Stile Tabella delle partizioni",
|
"STR_MENU_PART_STYLE":"Stile tabella partizioni",
|
||||||
"STR_DISK_2TB_MBR_ERROR":"Seleziona GPT per dischi con dimensioni maggiori di 2TB",
|
"STR_DISK_2TB_MBR_ERROR":"Seleziona GPT per dischi con dimensioni maggiori di 2TB",
|
||||||
"STR_SHOW_ALL_DEV":"Mostra tutti i dispositivi",
|
"STR_SHOW_ALL_DEV":"Visualizza tutti i dispositivi",
|
||||||
"STR_PART_ALIGN_4KB":"Allinea le partizioni con 4KB",
|
"STR_PART_ALIGN_4KB":"Allinea le partizioni con 4KB",
|
||||||
"STR_WEB_COMMUNICATION_ERR":"Errore di comunicazione:",
|
"STR_WEB_COMMUNICATION_ERR":"Errore di comunicazione:",
|
||||||
"STR_WEB_REMOTE_ABNORMAL":"Errore di comunicazione: remoto anormale",
|
"STR_WEB_REMOTE_ABNORMAL":"Errore di comunicazione: remoto anormale",
|
||||||
"STR_WEB_REQUEST_TIMEOUT":"Errore di comunicazione: richiesta scaduta",
|
"STR_WEB_REQUEST_TIMEOUT":"Errore di comunicazione: richiesta scaduta",
|
||||||
"STR_WEB_SERVICE_UNAVAILABLE":"Errore di comunicazione: servizio non disponibile",
|
"STR_WEB_SERVICE_UNAVAILABLE":"Errore di comunicazione: servizio non disponibile",
|
||||||
"STR_WEB_TOKEN_MISMATCH":"Stato del demone aggiornato, riprova più tardi.",
|
"STR_WEB_TOKEN_MISMATCH":"Stato del demone aggiornato. Riprova più tardi.",
|
||||||
"STR_WEB_SERVICE_BUSY":"Il servizio è occupato, riprova più tardi.",
|
"STR_WEB_SERVICE_BUSY":"Il servizio è occupato. Riprova più tardi.",
|
||||||
"STR_MENU_VTSI_CREATE":"Genera file VTSI",
|
"STR_MENU_VTSI_CREATE":"Genera file VTSI",
|
||||||
"STR_VTSI_CREATE_TIP":"Questa volta non scriverà sul dispositivo, ma genererà solo un file VTSI#@Continuare?",
|
"STR_VTSI_CREATE_TIP":"Questa volta non scriverà sul dispositivo, ma genererà solo un file VTSI#@Vuoi continuare?",
|
||||||
"STR_VTSI_CREATE_SUCCESS":"File VTSI creato con successo!#@Puoi usare Rufus (versione 3.15 o successiva) per scrivere sul dispositivo in modo da completare l'installazione di Ventoy.",
|
"STR_VTSI_CREATE_SUCCESS":"Creazione file VTSI completata!#@Per scrivere nel dispositivo in modo da completare l'installazione di Ventoy puoi usare Rufus (versione 3.15 o successiva).",
|
||||||
"STR_VTSI_CREATE_FAILED":"Creazione File VTSI non riuscito.",
|
"STR_VTSI_CREATE_FAILED":"Creazione file VTSI non riuscita.",
|
||||||
|
"STR_MENU_PART_RESIZE":"Installazione non distruttiva",
|
||||||
|
"STR_PART_RESIZE_TIP":"Ventoy proverà, se possibile, l'installazione non distruttiva.#@Vuoi continuare?",
|
||||||
|
"STR_PART_RESIZE_SUCCESS":"Congratulazioni!#@Installazione non distruttiva di Ventoy completata.",
|
||||||
|
"STR_PART_RESIZE_FAILED":"Installazione non distruttiva non riuscita.#@Per i dettagli controlla il file log.txt.",
|
||||||
|
"STR_PART_RESIZE_UNSUPPORTED":"L'installazione non distruttiva di Ventoy è stata interrotta perché alcune condizioni non possono essere soddisfatte.#@Per i dettagli controlla il file log.txt.",
|
||||||
|
|
||||||
"STRXXX":""
|
"STRXXX":""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -1068,6 +1188,12 @@
|
|||||||
"STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
|
"STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
|
||||||
"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.",
|
||||||
|
"STR_MENU_PART_RESIZE":"Non-destructive Install",
|
||||||
|
"STR_PART_RESIZE_TIP":"Ventoy will try non-destructive installation if possible. #@Continue?",
|
||||||
|
"STR_PART_RESIZE_SUCCESS":"Congratulations!#@Ventoy non-destructive installation successfully finished.",
|
||||||
|
"STR_PART_RESIZE_FAILED":"Non-destructive installation failed, Check log.txt for details.",
|
||||||
|
"STR_PART_RESIZE_UNSUPPORTED":"Ventoy non-destructive installation stopped because some conditions cannot be met. Check log.txt for details.",
|
||||||
|
|
||||||
"STRXXX":""
|
"STRXXX":""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -1119,6 +1245,12 @@
|
|||||||
"STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
|
"STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
|
||||||
"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.",
|
||||||
|
"STR_MENU_PART_RESIZE":"Non-destructive Install",
|
||||||
|
"STR_PART_RESIZE_TIP":"Ventoy will try non-destructive installation if possible. #@Continue?",
|
||||||
|
"STR_PART_RESIZE_SUCCESS":"Congratulations!#@Ventoy non-destructive installation successfully finished.",
|
||||||
|
"STR_PART_RESIZE_FAILED":"Non-destructive installation failed, Check log.txt for details.",
|
||||||
|
"STR_PART_RESIZE_UNSUPPORTED":"Ventoy non-destructive installation stopped because some conditions cannot be met. Check log.txt for details.",
|
||||||
|
|
||||||
"STRXXX":""
|
"STRXXX":""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -1170,6 +1302,12 @@
|
|||||||
"STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
|
"STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
|
||||||
"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.",
|
||||||
|
"STR_MENU_PART_RESIZE":"Non-destructive Install",
|
||||||
|
"STR_PART_RESIZE_TIP":"Ventoy will try non-destructive installation if possible. #@Continue?",
|
||||||
|
"STR_PART_RESIZE_SUCCESS":"Congratulations!#@Ventoy non-destructive installation successfully finished.",
|
||||||
|
"STR_PART_RESIZE_FAILED":"Non-destructive installation failed, Check log.txt for details.",
|
||||||
|
"STR_PART_RESIZE_UNSUPPORTED":"Ventoy non-destructive installation stopped because some conditions cannot be met. Check log.txt for details.",
|
||||||
|
|
||||||
"STRXXX":""
|
"STRXXX":""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -1221,6 +1359,12 @@
|
|||||||
"STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
|
"STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
|
||||||
"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.",
|
||||||
|
"STR_MENU_PART_RESIZE":"Non-destructive Install",
|
||||||
|
"STR_PART_RESIZE_TIP":"Ventoy will try non-destructive installation if possible. #@Continue?",
|
||||||
|
"STR_PART_RESIZE_SUCCESS":"Congratulations!#@Ventoy non-destructive installation successfully finished.",
|
||||||
|
"STR_PART_RESIZE_FAILED":"Non-destructive installation failed, Check log.txt for details.",
|
||||||
|
"STR_PART_RESIZE_UNSUPPORTED":"Ventoy non-destructive installation stopped because some conditions cannot be met. Check log.txt for details.",
|
||||||
|
|
||||||
"STRXXX":""
|
"STRXXX":""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -1272,6 +1416,12 @@
|
|||||||
"STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
|
"STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
|
||||||
"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.",
|
||||||
|
"STR_MENU_PART_RESIZE":"Non-destructive Install",
|
||||||
|
"STR_PART_RESIZE_TIP":"Ventoy will try non-destructive installation if possible. #@Continue?",
|
||||||
|
"STR_PART_RESIZE_SUCCESS":"Congratulations!#@Ventoy non-destructive installation successfully finished.",
|
||||||
|
"STR_PART_RESIZE_FAILED":"Non-destructive installation failed, Check log.txt for details.",
|
||||||
|
"STR_PART_RESIZE_UNSUPPORTED":"Ventoy non-destructive installation stopped because some conditions cannot be met. Check log.txt for details.",
|
||||||
|
|
||||||
"STRXXX":""
|
"STRXXX":""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -1323,6 +1473,12 @@
|
|||||||
"STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
|
"STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
|
||||||
"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.",
|
||||||
|
"STR_MENU_PART_RESIZE":"Non-destructive Install",
|
||||||
|
"STR_PART_RESIZE_TIP":"Ventoy will try non-destructive installation if possible. #@Continue?",
|
||||||
|
"STR_PART_RESIZE_SUCCESS":"Congratulations!#@Ventoy non-destructive installation successfully finished.",
|
||||||
|
"STR_PART_RESIZE_FAILED":"Non-destructive installation failed, Check log.txt for details.",
|
||||||
|
"STR_PART_RESIZE_UNSUPPORTED":"Ventoy non-destructive installation stopped because some conditions cannot be met. Check log.txt for details.",
|
||||||
|
|
||||||
"STRXXX":""
|
"STRXXX":""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -1374,6 +1530,12 @@
|
|||||||
"STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
|
"STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
|
||||||
"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.",
|
||||||
|
"STR_MENU_PART_RESIZE":"Non-destructive Install",
|
||||||
|
"STR_PART_RESIZE_TIP":"Ventoy will try non-destructive installation if possible. #@Continue?",
|
||||||
|
"STR_PART_RESIZE_SUCCESS":"Congratulations!#@Ventoy non-destructive installation successfully finished.",
|
||||||
|
"STR_PART_RESIZE_FAILED":"Non-destructive installation failed, Check log.txt for details.",
|
||||||
|
"STR_PART_RESIZE_UNSUPPORTED":"Ventoy non-destructive installation stopped because some conditions cannot be met. Check log.txt for details.",
|
||||||
|
|
||||||
"STRXXX":""
|
"STRXXX":""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -1421,10 +1583,16 @@
|
|||||||
"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":"Tạo tệp VTSI",
|
"STR_MENU_VTSI_CREATE":"Tạo tệp VTSI",
|
||||||
"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_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":"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_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":"Tạo tệp VTSI đã gặp lỗi.",
|
"STR_VTSI_CREATE_FAILED":"Tạo tệp VTSI đã gặp lỗi.",
|
||||||
|
"STR_MENU_PART_RESIZE":"Non-destructive Install",
|
||||||
|
"STR_PART_RESIZE_TIP":"Ventoy will try non-destructive installation if possible. #@Continue?",
|
||||||
|
"STR_PART_RESIZE_SUCCESS":"Congratulations!#@Ventoy non-destructive installation successfully finished.",
|
||||||
|
"STR_PART_RESIZE_FAILED":"Non-destructive installation failed, Check log.txt for details.",
|
||||||
|
"STR_PART_RESIZE_UNSUPPORTED":"Ventoy non-destructive installation stopped because some conditions cannot be met. Check log.txt for details.",
|
||||||
|
|
||||||
"STRXXX":""
|
"STRXXX":""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -1476,6 +1644,12 @@
|
|||||||
"STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
|
"STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
|
||||||
"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.",
|
||||||
|
"STR_MENU_PART_RESIZE":"Non-destructive Install",
|
||||||
|
"STR_PART_RESIZE_TIP":"Ventoy will try non-destructive installation if possible. #@Continue?",
|
||||||
|
"STR_PART_RESIZE_SUCCESS":"Congratulations!#@Ventoy non-destructive installation successfully finished.",
|
||||||
|
"STR_PART_RESIZE_FAILED":"Non-destructive installation failed, Check log.txt for details.",
|
||||||
|
"STR_PART_RESIZE_UNSUPPORTED":"Ventoy non-destructive installation stopped because some conditions cannot be met. Check log.txt for details.",
|
||||||
|
|
||||||
"STRXXX":""
|
"STRXXX":""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -1527,6 +1701,12 @@
|
|||||||
"STR_VTSI_CREATE_TIP":"Овој пат ништо нема да се запише на уредот туку само ќе се генерира VTSI датотека#@Продолжи?",
|
"STR_VTSI_CREATE_TIP":"Овој пат ништо нема да се запише на уредот туку само ќе се генерира VTSI датотека#@Продолжи?",
|
||||||
"STR_VTSI_CREATE_SUCCESS":"Успешно креирана VTSI датотека!#@Можете да го користите Rufus(3.15+) за да ја запишете на уредот како и да ја комплетирате инсталацијата на Ventoy.",
|
"STR_VTSI_CREATE_SUCCESS":"Успешно креирана VTSI датотека!#@Можете да го користите Rufus(3.15+) за да ја запишете на уредот како и да ја комплетирате инсталацијата на Ventoy.",
|
||||||
"STR_VTSI_CREATE_FAILED":"Креирањето на VTSI датотека е неуспешно.",
|
"STR_VTSI_CREATE_FAILED":"Креирањето на VTSI датотека е неуспешно.",
|
||||||
|
"STR_MENU_PART_RESIZE":"Non-destructive Install",
|
||||||
|
"STR_PART_RESIZE_TIP":"Ventoy will try non-destructive installation if possible. #@Continue?",
|
||||||
|
"STR_PART_RESIZE_SUCCESS":"Congratulations!#@Ventoy non-destructive installation successfully finished.",
|
||||||
|
"STR_PART_RESIZE_FAILED":"Non-destructive installation failed, Check log.txt for details.",
|
||||||
|
"STR_PART_RESIZE_UNSUPPORTED":"Ventoy non-destructive installation stopped because some conditions cannot be met. Check log.txt for details.",
|
||||||
|
|
||||||
"STRXXX":""
|
"STRXXX":""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -1578,19 +1758,25 @@
|
|||||||
"STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
|
"STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
|
||||||
"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.",
|
||||||
|
"STR_MENU_PART_RESIZE":"Non-destructive Install",
|
||||||
|
"STR_PART_RESIZE_TIP":"Ventoy will try non-destructive installation if possible. #@Continue?",
|
||||||
|
"STR_PART_RESIZE_SUCCESS":"Congratulations!#@Ventoy non-destructive installation successfully finished.",
|
||||||
|
"STR_PART_RESIZE_FAILED":"Non-destructive installation failed, Check log.txt for details.",
|
||||||
|
"STR_PART_RESIZE_UNSUPPORTED":"Ventoy non-destructive installation stopped because some conditions cannot be met. Check log.txt for details.",
|
||||||
|
|
||||||
"STRXXX":""
|
"STRXXX":""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name":"Portuguese (Português de Portugal)",
|
"name":"Portuguese (Português de Portugal)",
|
||||||
"FontFamily":"Courier New",
|
"FontFamily":"Courier New",
|
||||||
"FontSize":16,
|
"FontSize":16,
|
||||||
"Author":"Eskiso",
|
"Author":"Eskiso, Hugo Carvalho",
|
||||||
|
|
||||||
"STR_ERROR":"Erro",
|
"STR_ERROR":"Erro",
|
||||||
"STR_WARNING":"Aviso",
|
"STR_WARNING":"Aviso",
|
||||||
"STR_INFO":"Info",
|
"STR_INFO":"Info",
|
||||||
"STR_INCORRECT_DIR":"Por favor, execute na pasta correta!",
|
"STR_INCORRECT_DIR":"Execute na pasta correta!",
|
||||||
"STR_INCORRECT_TREE_DIR":"Não me execute aqui, por favor transfira o pacote de instalação, e execute lá.",
|
"STR_INCORRECT_TREE_DIR":"Não me execute aqui, transfira o pacote de instalação e execute lá.",
|
||||||
"STR_DEVICE":"Dispositivo",
|
"STR_DEVICE":"Dispositivo",
|
||||||
"STR_LOCAL_VER":"Ventoy em pacote",
|
"STR_LOCAL_VER":"Ventoy em pacote",
|
||||||
"STR_DISK_VER":"Ventoy no dispositivo",
|
"STR_DISK_VER":"Ventoy no dispositivo",
|
||||||
@@ -1601,34 +1787,40 @@
|
|||||||
"STR_INSTALL_TIP":"O disco será formatado e todos os dados serão perdidos.#@Continuar?",
|
"STR_INSTALL_TIP":"O disco será formatado e todos os dados serão perdidos.#@Continuar?",
|
||||||
"STR_INSTALL_TIP2":"O disco será formatado e todos os dados serão perdidos.#@Continuar? (Confirmação)",
|
"STR_INSTALL_TIP2":"O disco será formatado e todos os dados serão perdidos.#@Continuar? (Confirmação)",
|
||||||
"STR_INSTALL_SUCCESS":"Parabéns!#@Ventoy foi instalado com sucesso no dispositivo.",
|
"STR_INSTALL_SUCCESS":"Parabéns!#@Ventoy foi instalado com sucesso no dispositivo.",
|
||||||
"STR_INSTALL_FAILED":"Um erro ocorreu durante a instalação. Pode reconectar o dispositivo USB e tentar novamente. Verifique o ficheiro log.txt para mais detalhes.",
|
"STR_INSTALL_FAILED":"Ocorreu um erro durante a instalação. Pode voltar a ligar o dispositivo USB e tentar novamente. Verifique o ficheiro log.txt para mais detalhes.",
|
||||||
"STR_UPDATE_SUCCESS":"Parabéns!#@Ventoy foi atualizado com sucesso no dispositivo.",
|
"STR_UPDATE_SUCCESS":"Parabéns!#@Ventoy foi atualizado com sucesso no dispositivo.",
|
||||||
"STR_UPDATE_FAILED":"Um erro ocorreu durante a atualização. Pode reconectar o dispositivo USB e tentar novamente. Verifique o ficheiro log.txt para mais detalhes.",
|
"STR_UPDATE_FAILED":"Ocorreu um erro durante a atualização. Pode voltar a ligar o dispositivo USB e tentar novamente. Verifique o ficheiro log.txt para mais detalhes.",
|
||||||
"STR_WAIT_PROCESS":"Uma thread está em execução, por favor espere...",
|
"STR_WAIT_PROCESS":"Uma thread está em execução, aguarde...",
|
||||||
"STR_MENU_OPTION":"Opção",
|
"STR_MENU_OPTION":"Opção",
|
||||||
"STR_MENU_SECURE_BOOT":"Boot seguro",
|
"STR_MENU_SECURE_BOOT":"Arranque seguro",
|
||||||
"STR_MENU_PART_CFG":"Configuração da Partição",
|
"STR_MENU_PART_CFG":"Configuração da partição",
|
||||||
"STR_BTN_OK":"OK",
|
"STR_BTN_OK":"Aceitar",
|
||||||
"STR_BTN_CANCEL":"Cancelar",
|
"STR_BTN_CANCEL":"Cancelar",
|
||||||
"STR_PRESERVE_SPACE":"Preservar algum espaço no final do disco",
|
"STR_PRESERVE_SPACE":"Reservar algum espaço no final do disco",
|
||||||
"STR_SPACE_VAL_INVALID":"Valor invalido para o espaço reservado",
|
"STR_SPACE_VAL_INVALID":"Valor inválido para o espaço reservado",
|
||||||
"STR_MENU_CLEAR":"Remover o Ventoy",
|
"STR_MENU_CLEAR":"Remover o Ventoy",
|
||||||
"STR_CLEAR_SUCCESS":"O Ventoy foi removido deste dispositivo com sucesso.",
|
"STR_CLEAR_SUCCESS":"O Ventoy foi removido deste dispositivo com sucesso.",
|
||||||
"STR_CLEAR_FAILED":"Um erro ocorreu ao remover o Ventoy do disco. Pode reconectar o dispositivo USB e tentar novamente. Verifique o ficheiro log.txt para mais detalhes.",
|
"STR_CLEAR_FAILED":"Um erro ocorreu ao remover o Ventoy do disco. Pode voltar a ligar o dispositivo USB e tentar novamente. Verifique o ficheiro log.txt para mais detalhes.",
|
||||||
"STR_MENU_PART_STYLE":"Estilo de Partição",
|
"STR_MENU_PART_STYLE":"Estilo de partição",
|
||||||
"STR_DISK_2TB_MBR_ERROR":"Por favor selecione GPT para discos maiores que 2TB",
|
"STR_DISK_2TB_MBR_ERROR":"Selecione GPT para discos maiores que 2TB",
|
||||||
"STR_SHOW_ALL_DEV":"Show All Devices",
|
"STR_SHOW_ALL_DEV":"Mostrar todos os dispositivos",
|
||||||
"STR_PART_ALIGN_4KB":"Align partitions with 4KB",
|
"STR_PART_ALIGN_4KB":"Alinhar as partições com 4KB",
|
||||||
"STR_WEB_COMMUNICATION_ERR":"Communication error:",
|
"STR_WEB_COMMUNICATION_ERR":"Erro de comunicação:",
|
||||||
"STR_WEB_REMOTE_ABNORMAL":"Communication error: remote abnormal",
|
"STR_WEB_REMOTE_ABNORMAL":"Erro de comunicação: Anomalia remota",
|
||||||
"STR_WEB_REQUEST_TIMEOUT":"Communication error: Request timed out",
|
"STR_WEB_REQUEST_TIMEOUT":"Erro de comunicação: Pedido de tempo limite",
|
||||||
"STR_WEB_SERVICE_UNAVAILABLE":"Communication error: Service Unavailable",
|
"STR_WEB_SERVICE_UNAVAILABLE":"Erro de comunicação: Serviço indisponível",
|
||||||
"STR_WEB_TOKEN_MISMATCH":"Daemon status updated, please retry later.",
|
"STR_WEB_TOKEN_MISMATCH":"Estado do daemon atualizado, tente novamente mais tarde.",
|
||||||
"STR_WEB_SERVICE_BUSY":"Service is busy, please retry later.",
|
"STR_WEB_SERVICE_BUSY":"Serviço está ocupado, tente novamente mais tarde.",
|
||||||
"STR_MENU_VTSI_CREATE":"Generate VTSI File",
|
"STR_MENU_VTSI_CREATE":"Gerar ficheiro VTSI",
|
||||||
"STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
|
"STR_VTSI_CREATE_TIP":"Desta vez não irá gravar no dispositivo, mas apenas gerar um ficheiro 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":"Ficheiro VTSI criado com sucesso!#@Pode utilizar o Rufus(3.15+) para o gravar no dispositivo de modo a completar a instalação do Ventoy.",
|
||||||
"STR_VTSI_CREATE_FAILED":"VTSI file created failed.",
|
"STR_VTSI_CREATE_FAILED":"Falha no ficheiro VTSI criado.",
|
||||||
|
"STR_MENU_PART_RESIZE":"Non-destructive Install",
|
||||||
|
"STR_PART_RESIZE_TIP":"Ventoy will try non-destructive installation if possible. #@Continue?",
|
||||||
|
"STR_PART_RESIZE_SUCCESS":"Congratulations!#@Ventoy non-destructive installation successfully finished.",
|
||||||
|
"STR_PART_RESIZE_FAILED":"Non-destructive installation failed, Check log.txt for details.",
|
||||||
|
"STR_PART_RESIZE_UNSUPPORTED":"Ventoy non-destructive installation stopped because some conditions cannot be met. Check log.txt for details.",
|
||||||
|
|
||||||
"STRXXX":""
|
"STRXXX":""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -1668,7 +1860,7 @@
|
|||||||
"STR_CLEAR_FAILED":"Terjadi kesalahan ketika penghapusan berlangsung. Anda perlu mencabut-pasang ulang USB dan coba lagi. Cek log.txt untuk detil.",
|
"STR_CLEAR_FAILED":"Terjadi kesalahan ketika penghapusan berlangsung. Anda perlu mencabut-pasang ulang USB dan coba lagi. Cek log.txt untuk detil.",
|
||||||
"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":"Tampilkan semua perangkat",
|
||||||
"STR_PART_ALIGN_4KB":"Meluruskan dengan partisi 4KB",
|
"STR_PART_ALIGN_4KB":"Meluruskan dengan partisi 4KB",
|
||||||
"STR_WEB_COMMUNICATION_ERR":"Kesalahan komunikasi:",
|
"STR_WEB_COMMUNICATION_ERR":"Kesalahan komunikasi:",
|
||||||
"STR_WEB_REMOTE_ABNORMAL":"Kesalahan komunikasi: tidak normalnya kendali",
|
"STR_WEB_REMOTE_ABNORMAL":"Kesalahan komunikasi: tidak normalnya kendali",
|
||||||
@@ -1680,6 +1872,69 @@
|
|||||||
"STR_VTSI_CREATE_TIP":"Saat ini tidak akan menuliskan di perangkat, tetapi hanya membuat berkas VTSI #@Lanjutkan?",
|
"STR_VTSI_CREATE_TIP":"Saat ini tidak akan menuliskan di perangkat, tetapi hanya membuat berkas VTSI #@Lanjutkan?",
|
||||||
"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_SUCCESS":"Berkas VTSI berhasil dibuat#@Anda bisa menggunakan Rufus(3.15+) untuk menulisnya ke perangkat untuk menyelesaikan instalasi Ventoy.",
|
||||||
"STR_VTSI_CREATE_FAILED":"Berkas VTSI gagal dibuat.",
|
"STR_VTSI_CREATE_FAILED":"Berkas VTSI gagal dibuat.",
|
||||||
|
"STR_MENU_PART_RESIZE":"Non-destructive Install",
|
||||||
|
"STR_PART_RESIZE_TIP":"Ventoy will try non-destructive installation if possible. #@Continue?",
|
||||||
|
"STR_PART_RESIZE_SUCCESS":"Congratulations!#@Ventoy non-destructive installation successfully finished.",
|
||||||
|
"STR_PART_RESIZE_FAILED":"Non-destructive installation failed, Check log.txt for details.",
|
||||||
|
"STR_PART_RESIZE_UNSUPPORTED":"Ventoy non-destructive installation stopped because some conditions cannot be met. Check log.txt for details.",
|
||||||
|
|
||||||
|
"STRXXX":""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name":"Norwegian Bokmål (Norsk Bokmål)",
|
||||||
|
"FontFamily":"Courier New",
|
||||||
|
"FontSize":16,
|
||||||
|
"Author":"Allan Nordhøy",
|
||||||
|
|
||||||
|
"STR_ERROR":"Feil",
|
||||||
|
"STR_WARNING":"Advarsel",
|
||||||
|
"STR_INFO":"Info",
|
||||||
|
"STR_INCORRECT_DIR":"Start programmet i rett mappe først.",
|
||||||
|
"STR_INCORRECT_TREE_DIR":"Ikke kjør meg her. Last ned utgitt installasjonspakke og kjør det der.",
|
||||||
|
"STR_DEVICE":"Enhet",
|
||||||
|
"STR_LOCAL_VER":"Ventoy i pakke",
|
||||||
|
"STR_DISK_VER":"Ventoy i enhet",
|
||||||
|
"STR_STATUS":"Status — Klar",
|
||||||
|
"STR_INSTALL":"Installer",
|
||||||
|
"STR_UPDATE":"Updater",
|
||||||
|
"STR_UPDATE_TIP":"Oppgradering er trygt. ISO-filer vil forbli uendret.#@Fortsett?",
|
||||||
|
"STR_INSTALL_TIP":"Enheten vil bli formatert og all data på den vil gå tapt.#@Fortsett?",
|
||||||
|
"STR_INSTALL_TIP2":"Enheten vil bli formatert og all data på den vil gå tapt.#@Fortsett? (Dobbeltsjekk)",
|
||||||
|
"STR_INSTALL_SUCCESS":"Gratulerer!#@Ventoy har blitt installert på enheten.",
|
||||||
|
"STR_INSTALL_FAILED":"Noe gikk galt under installasjonen. Du kan plugge ut og inn USB-enheten og prøve igjen. Sjekk log.txt for detaljer. Hvis feilen vedvarer kan du sjekke O-S-S på nettsiden.",
|
||||||
|
"STR_UPDATE_SUCCESS":"Gratulerer!#@Ventoy har blitt installert på enheten.",
|
||||||
|
"STR_UPDATE_FAILED":"Noe gikk galt under oppdateringen. Du kan plugge ut og inn USB-enheten og prøve igjen. Sjekk log.txt for detaljer. Hvis feilen vedvarer kan du sjekke O-S-S på nettsiden.",
|
||||||
|
"STR_WAIT_PROCESS":"Vent mens en tråd kjører …",
|
||||||
|
"STR_MENU_OPTION":"Alternativ",
|
||||||
|
"STR_MENU_SECURE_BOOT":"Secure Boot-støtte",
|
||||||
|
"STR_MENU_PART_CFG":"Partisjonsoppsett",
|
||||||
|
"STR_BTN_OK":"OK",
|
||||||
|
"STR_BTN_CANCEL":"Avbryt",
|
||||||
|
"STR_PRESERVE_SPACE":"Hold av litt plass på slutten av disken",
|
||||||
|
"STR_SPACE_VAL_INVALID":"Ugyldig verdi for avholdt plass",
|
||||||
|
"STR_MENU_CLEAR":"Tøm Ventoy",
|
||||||
|
"STR_CLEAR_SUCCESS":"Ventoy har blitt fjernet fra enheten.",
|
||||||
|
"STR_CLEAR_FAILED":"Noe gikk galt ved fjerning av Ventoy fra disken. Du kan plugge ut og inn USB-enheten og prøve igjen. Sjekk log.txt for detaljer.",
|
||||||
|
"STR_MENU_PART_STYLE":"Partisjonsstil",
|
||||||
|
"STR_DISK_2TB_MBR_ERROR":"Velg «GPT» for enheter over 2 TB",
|
||||||
|
"STR_SHOW_ALL_DEV":"Vis alle enheter",
|
||||||
|
"STR_PART_ALIGN_4KB":"Juster partisjoner til 4 KB",
|
||||||
|
"STR_WEB_COMMUNICATION_ERR":"Kommunikasjonsfeil:",
|
||||||
|
"STR_WEB_REMOTE_ABNORMAL":"Kommunikasjonsfeil: Noe er galt annensteds hen",
|
||||||
|
"STR_WEB_REQUEST_TIMEOUT":"Kommunikasjonsfeil: Tidsavbrudd for forespørsel",
|
||||||
|
"STR_WEB_SERVICE_UNAVAILABLE":"Kommunikasjonsfeil: Utilgjengelig tjeneste",
|
||||||
|
"STR_WEB_TOKEN_MISMATCH":"Nisse-status oppdatert. Prøv igjen senere.",
|
||||||
|
"STR_WEB_SERVICE_BUSY":"Tjensten er opptatt. Prøv igjen senere.",
|
||||||
|
"STR_MENU_VTSI_CREATE":"Generer VTSI-fil",
|
||||||
|
"STR_VTSI_CREATE_TIP":"Dette vil ikke skrive til enheten, men kun generere en VTSIfil#@Fortsett?",
|
||||||
|
"STR_VTSI_CREATE_SUCCESS":"VTSI-fil opprettet.#@Du kan bruke Rufus(3.15+) til å skrive den til enheten for å fullføre installasjonen av Ventoy.",
|
||||||
|
"STR_VTSI_CREATE_FAILED":"Noe gikk galt under opprettelse av VTSI-fil.",
|
||||||
|
"STR_MENU_PART_RESIZE":"Non-destructive Install",
|
||||||
|
"STR_PART_RESIZE_TIP":"Ventoy will try non-destructive installation if possible. #@Continue?",
|
||||||
|
"STR_PART_RESIZE_SUCCESS":"Congratulations!#@Ventoy non-destructive installation successfully finished.",
|
||||||
|
"STR_PART_RESIZE_FAILED":"Non-destructive installation failed, Check log.txt for details.",
|
||||||
|
"STR_PART_RESIZE_UNSUPPORTED":"Ventoy non-destructive installation stopped because some conditions cannot be met. Check log.txt for details.",
|
||||||
|
|
||||||
"STRXXX":""
|
"STRXXX":""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -1731,6 +1986,12 @@
|
|||||||
"STR_VTSI_CREATE_TIP":"Цього разу Ventoy не буде встановлено на пристрій, а лише буде створено файл VTSI#@Продовжити?",
|
"STR_VTSI_CREATE_TIP":"Цього разу Ventoy не буде встановлено на пристрій, а лише буде створено файл VTSI#@Продовжити?",
|
||||||
"STR_VTSI_CREATE_SUCCESS":"Файл VTSI створено успішно!#@Ви можете використати Rufus(3.15+), щоб записати його на пристрій, для завершення встановлення Ventoy",
|
"STR_VTSI_CREATE_SUCCESS":"Файл VTSI створено успішно!#@Ви можете використати Rufus(3.15+), щоб записати його на пристрій, для завершення встановлення Ventoy",
|
||||||
"STR_VTSI_CREATE_FAILED":"Не вдалося створити файл VTSI.",
|
"STR_VTSI_CREATE_FAILED":"Не вдалося створити файл VTSI.",
|
||||||
|
"STR_MENU_PART_RESIZE":"Non-destructive Install",
|
||||||
|
"STR_PART_RESIZE_TIP":"Ventoy will try non-destructive installation if possible. #@Continue?",
|
||||||
|
"STR_PART_RESIZE_SUCCESS":"Congratulations!#@Ventoy non-destructive installation successfully finished.",
|
||||||
|
"STR_PART_RESIZE_FAILED":"Non-destructive installation failed, Check log.txt for details.",
|
||||||
|
"STR_PART_RESIZE_UNSUPPORTED":"Ventoy non-destructive installation stopped because some conditions cannot be met. Check log.txt for details.",
|
||||||
|
|
||||||
"STRXXX":""
|
"STRXXX":""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -1782,6 +2043,12 @@
|
|||||||
"STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
|
"STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
|
||||||
"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.",
|
||||||
|
"STR_MENU_PART_RESIZE":"Non-destructive Install",
|
||||||
|
"STR_PART_RESIZE_TIP":"Ventoy will try non-destructive installation if possible. #@Continue?",
|
||||||
|
"STR_PART_RESIZE_SUCCESS":"Congratulations!#@Ventoy non-destructive installation successfully finished.",
|
||||||
|
"STR_PART_RESIZE_FAILED":"Non-destructive installation failed, Check log.txt for details.",
|
||||||
|
"STR_PART_RESIZE_UNSUPPORTED":"Ventoy non-destructive installation stopped because some conditions cannot be met. Check log.txt for details.",
|
||||||
|
|
||||||
"STRXXX":""
|
"STRXXX":""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -1833,6 +2100,12 @@
|
|||||||
"STR_VTSI_CREATE_TIP":"Den här gången skrivs det inget till enheten, utan det skapas endast en VTSI-fil#@Fortsätta?",
|
"STR_VTSI_CREATE_TIP":"Den här gången skrivs det inget till enheten, utan det skapas endast en VTSI-fil#@Fortsätta?",
|
||||||
"STR_VTSI_CREATE_SUCCESS":"VTSI-filen skapad!#@Använd Rufus (3.15+) till att skriva till enheten för att slutföra installationen av Ventoy.",
|
"STR_VTSI_CREATE_SUCCESS":"VTSI-filen skapad!#@Använd Rufus (3.15+) till att skriva till enheten för att slutföra installationen av Ventoy.",
|
||||||
"STR_VTSI_CREATE_FAILED":"Misslyckades med att skapa VTSI-filen.",
|
"STR_VTSI_CREATE_FAILED":"Misslyckades med att skapa VTSI-filen.",
|
||||||
|
"STR_MENU_PART_RESIZE":"Non-destructive Install",
|
||||||
|
"STR_PART_RESIZE_TIP":"Ventoy will try non-destructive installation if possible. #@Continue?",
|
||||||
|
"STR_PART_RESIZE_SUCCESS":"Congratulations!#@Ventoy non-destructive installation successfully finished.",
|
||||||
|
"STR_PART_RESIZE_FAILED":"Non-destructive installation failed, Check log.txt for details.",
|
||||||
|
"STR_PART_RESIZE_UNSUPPORTED":"Ventoy non-destructive installation stopped because some conditions cannot be met. Check log.txt for details.",
|
||||||
|
|
||||||
"STRXXX":""
|
"STRXXX":""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -1884,6 +2157,12 @@
|
|||||||
"STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
|
"STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
|
||||||
"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.",
|
||||||
|
"STR_MENU_PART_RESIZE":"Non-destructive Install",
|
||||||
|
"STR_PART_RESIZE_TIP":"Ventoy will try non-destructive installation if possible. #@Continue?",
|
||||||
|
"STR_PART_RESIZE_SUCCESS":"Congratulations!#@Ventoy non-destructive installation successfully finished.",
|
||||||
|
"STR_PART_RESIZE_FAILED":"Non-destructive installation failed, Check log.txt for details.",
|
||||||
|
"STR_PART_RESIZE_UNSUPPORTED":"Ventoy non-destructive installation stopped because some conditions cannot be met. Check log.txt for details.",
|
||||||
|
|
||||||
"STRXXX":""
|
"STRXXX":""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -1935,6 +2214,12 @@
|
|||||||
"STR_VTSI_CREATE_TIP":"Сега няма да се записва на диска, само ще се генерира VTSI файл#@Продължаваме?",
|
"STR_VTSI_CREATE_TIP":"Сега няма да се записва на диска, само ще се генерира VTSI файл#@Продължаваме?",
|
||||||
"STR_VTSI_CREATE_SUCCESS":"VTSI файла бе създаден успешно!#@Може да използвате Rufus(3.15+) да го запишете на устройството за инсталацията с Ventoy.",
|
"STR_VTSI_CREATE_SUCCESS":"VTSI файла бе създаден успешно!#@Може да използвате Rufus(3.15+) да го запишете на устройството за инсталацията с Ventoy.",
|
||||||
"STR_VTSI_CREATE_FAILED":"VTSI файла създаване се провали.",
|
"STR_VTSI_CREATE_FAILED":"VTSI файла създаване се провали.",
|
||||||
|
"STR_MENU_PART_RESIZE":"Non-destructive Install",
|
||||||
|
"STR_PART_RESIZE_TIP":"Ventoy will try non-destructive installation if possible. #@Continue?",
|
||||||
|
"STR_PART_RESIZE_SUCCESS":"Congratulations!#@Ventoy non-destructive installation successfully finished.",
|
||||||
|
"STR_PART_RESIZE_FAILED":"Non-destructive installation failed, Check log.txt for details.",
|
||||||
|
"STR_PART_RESIZE_UNSUPPORTED":"Ventoy non-destructive installation stopped because some conditions cannot be met. Check log.txt for details.",
|
||||||
|
|
||||||
"STRXXX":""
|
"STRXXX":""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -1986,6 +2271,12 @@
|
|||||||
"STR_VTSI_CREATE_TIP":"Այս անգամ չի գրվի կրիչի վրա, այլ միայն կստեղծվի VTSI ֆայլ#@Շարունակել?",
|
"STR_VTSI_CREATE_TIP":"Այս անգամ չի գրվի կրիչի վրա, այլ միայն կստեղծվի VTSI ֆայլ#@Շարունակել?",
|
||||||
"STR_VTSI_CREATE_SUCCESS":"VTSI ֆայլը հաջողությամբ ստեղծվեց!#@Դուք կարող եք օգտագործել Rufus (3.15+) կրիչում ձայնագրելու համար, որպեսզի ավարտեք Ventoy-ի տեղադրումը:",
|
"STR_VTSI_CREATE_SUCCESS":"VTSI ֆայլը հաջողությամբ ստեղծվեց!#@Դուք կարող եք օգտագործել Rufus (3.15+) կրիչում ձայնագրելու համար, որպեսզի ավարտեք Ventoy-ի տեղադրումը:",
|
||||||
"STR_VTSI_CREATE_FAILED":"VTSI ֆայլի ստեղծումը ձախողվեց։",
|
"STR_VTSI_CREATE_FAILED":"VTSI ֆայլի ստեղծումը ձախողվեց։",
|
||||||
|
"STR_MENU_PART_RESIZE":"Non-destructive Install",
|
||||||
|
"STR_PART_RESIZE_TIP":"Ventoy will try non-destructive installation if possible. #@Continue?",
|
||||||
|
"STR_PART_RESIZE_SUCCESS":"Congratulations!#@Ventoy non-destructive installation successfully finished.",
|
||||||
|
"STR_PART_RESIZE_FAILED":"Non-destructive installation failed, Check log.txt for details.",
|
||||||
|
"STR_PART_RESIZE_UNSUPPORTED":"Ventoy non-destructive installation stopped because some conditions cannot be met. Check log.txt for details.",
|
||||||
|
|
||||||
"STRXXX":""
|
"STRXXX":""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -2037,6 +2328,12 @@
|
|||||||
"STR_VTSI_CREATE_TIP":"Tällä kerralla laitteeseen ei kirjoiteta, vaan luodaan ainoastaan VTSI -tiedosto#@Jatketaanko?",
|
"STR_VTSI_CREATE_TIP":"Tällä kerralla laitteeseen ei kirjoiteta, vaan luodaan ainoastaan VTSI -tiedosto#@Jatketaanko?",
|
||||||
"STR_VTSI_CREATE_SUCCESS":"VTSI -tiedosto luotiin onnistuneesti!#@Voit käyttää Rufus-ohjelmaa(3.15+) kirjoittaaksesi sen laitteeseen viimeistelläksesi Ventoy-asennuksen.",
|
"STR_VTSI_CREATE_SUCCESS":"VTSI -tiedosto luotiin onnistuneesti!#@Voit käyttää Rufus-ohjelmaa(3.15+) kirjoittaaksesi sen laitteeseen viimeistelläksesi Ventoy-asennuksen.",
|
||||||
"STR_VTSI_CREATE_FAILED":"VTSI -tiedoston luominen epäonnistui.",
|
"STR_VTSI_CREATE_FAILED":"VTSI -tiedoston luominen epäonnistui.",
|
||||||
|
"STR_MENU_PART_RESIZE":"Non-destructive Install",
|
||||||
|
"STR_PART_RESIZE_TIP":"Ventoy will try non-destructive installation if possible. #@Continue?",
|
||||||
|
"STR_PART_RESIZE_SUCCESS":"Congratulations!#@Ventoy non-destructive installation successfully finished.",
|
||||||
|
"STR_PART_RESIZE_FAILED":"Non-destructive installation failed, Check log.txt for details.",
|
||||||
|
"STR_PART_RESIZE_UNSUPPORTED":"Ventoy non-destructive installation stopped because some conditions cannot be met. Check log.txt for details.",
|
||||||
|
|
||||||
"STRXXX":""
|
"STRXXX":""
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@@ -157,7 +157,9 @@ if [ "$1" = "VENTOY_I386_QT_BUILD" ]; then
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ ! -f /opt/CentOS8/LinuxGUI/build.sh ]; then
|
||||||
|
mount --bind /home/share/Ventoy/LinuxGUI /opt/CentOS8/LinuxGUI
|
||||||
|
fi
|
||||||
|
|
||||||
chroot /opt/CentOS8 sh /buildqt.sh
|
chroot /opt/CentOS8 sh /buildqt.sh
|
||||||
force_copy ./Ventoy2Disk.qt5_32 ../INSTALL/tool/i386/Ventoy2Disk.qt5
|
force_copy ./Ventoy2Disk.qt5_32 ../INSTALL/tool/i386/Ventoy2Disk.qt5
|
||||||
|
34
README.md
34
README.md
@@ -16,19 +16,19 @@ 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/ChromeOS/Vmware/Xen...) <br/>
|
Most type of OS supported(Windows/WinPE/Linux/Unix/ChromeOS/Vmware/Xen...) <br/>
|
||||||
760+ 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 (<a href="https://www.ventoy.net/en/distrowatch.html">Details</a>). <br/>
|
770+ 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 (<a href="https://www.ventoy.net/en/distrowatch.html">Details</a>). <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>
|
||||||
|
|
||||||
# Tested OS
|
# Tested OS
|
||||||
**Windows**
|
**Windows**
|
||||||
Windows 7, Windows 8, Windows 8.1, Windows 10, Windows Server 2012, Windows Server 2012 R2, Windows Server 2016, Windows Server 2019, WinPE
|
Windows 7, Windows 8, Windows 8.1, Windows 10, Windows 11, Windows Server 2012, Windows Server 2012 R2, Windows Server 2016, Windows Server 2019, Windows Server 2022, WinPE
|
||||||
|
|
||||||
**Linux**
|
**Linux**
|
||||||
Debian, Ubuntu, CentOS, RHEL, Deepin, Fedora, Rocky Linux, SLES, openSUSE, MX Linux, Manjaro, Linux Mint, Endless OS, openEuler, Elementary OS, Solus, Linx, Zorin, antiX, PClinuxOS, Arch, ArcoLinux, ArchLabs, BackArch, Obarun, Artix Linux, Puppy Linux, Tails, Slax, Kali, Mageia, Slackware, Q4OS, Archman, Gentoo, Pentoo, NixOS, Ubuntu Kylin, Lubuntu, Xubuntu, Kubuntu, Ubuntu MATE, Ubuntu Budgie, Ubuntu Studio, Bluestar, OpenMandriva, ExTiX, Netrunner, ALT Linux, Nitrux, Peppermint, KDE neon, Linux Lite, Parrot OS, Qubes, Pop OS, ROSA, Void Linux, Star Linux, EndeavourOS, MakuluLinux, Voyager, Feren, ArchBang, LXLE, Knoppix, Robolinux, Calculate Linux, Clear Linux, Pure OS, Oracle Linux, Trident, Septor, Porteus, Devuan, GoboLinux, 4MLinux, Simplicity Linux, Zeroshell, Android-x86, netboot.xyz, Slitaz, SuperGrub2Disk, Proxmox VE, Kaspersky Rescue, SystemRescueCD, MemTest86, MiniTool Partition Wizard, Parted Magic, veket, Sabayon, Scientific, alpine, ClearOS, CloneZilla, Berry Linux, Trisquel, Ataraxia Linux, Minimal Linux Live, BackBox Linux, Emmabuntüs, ESET SysRescue Live,Nova Linux, AV Linux, RoboLinux, NuTyX, IPFire, SELKS, ZStack, Enso Linux, Security Onion, Network Security Toolkit, Absolute Linux, TinyCore, Springdale Linux, Frost Linux, Shark Linux, LinuxFX, Snail Linux, Astra Linux, Namib Linux, Resilient Linux, Virage Linux, Blackweb Security OS, R-DriveImage, O-O.DiskImage, Macrium, ToOpPy LINUX, GNU Guix, YunoHost, foxclone, siduction, Adelie Linux, Elive, Pardus, CDlinux, AcademiX, Austrumi, Zenwalk, Anarchy, DuZeru, BigLinux, OpenMediaVault, Ubuntu DP, Exe GNU/Linux, 3CX Phone System, KANOTIX, Grml, Karoshi, PrimTux, ArchStrike, CAELinux, Refracta, Cucumber, Fatdog, ForLEx, Hanthana, Kwort, MiniNo, Redcore, Runtu, Asianux, Clu Linux Live, Uruk, OB2D, BlueOnyx, Finnix, HamoniKR, Parabola, LinHES, LinuxConsole, BEE free, Untangle, Pearl, Thinstation, TurnKey, tuxtrans, Neptune, HefftorLinux, GeckoLinux, Mabox Linux, Zentyal, Maui, Reborn OS, SereneLinux , SkyWave Linux, Kaisen Linux, Regata OS, TROM-Jaro, DRBL Linux, Chalet OS, Chapeau, Desa OS, BlankOn, OpenMamba, Frugalware, Kibojoe Linux, Revenge OS, Tsurugi Linux, Drauger OS, Hash Linux, gNewSense, Ikki Boot, SteamOS, Hyperbola, VyOS, EasyNAS, SuperGamer, Live Raizo, Swift Linux, RebeccaBlackOS, Daphile, CRUX, Univention, Ufficio Zero, Rescuezilla, Phoenix OS, Garuda Linux, Mll, NethServer, OSGeoLive, Easy OS, Volumio, FreedomBox, paldo, UBOS, Recalbox, batocera, Lakka, LibreELEC, Pardus Topluluk, Pinguy, KolibriOS, Elastix, Arya, Omoikane, Omarine, Endian Firewall, Hamara, Rocks Cluster, MorpheusArch, Redo, Slackel, SME Server, APODIO, Smoothwall, Dragora, Linspire, Secure-K OS, Peach OSI, Photon, Plamo, SuperX, Bicom, Ploplinux, HP SPP, LliureX, Freespire, DietPi, BOSS, Webconverger, Lunar, TENS, Source Mage, RancherOS, T2, Vine, Pisi, blackPanther, mAid, Acronis, Active.Boot, AOMEI, Boot.Repair, CAINE, DaRT, EasyUEFI, R-Drive, PrimeOS, Avira Rescue System, bitdefender, Checkra1n Linux, Lenovo Diagnostics, Clover, Bliss-OS, Lenovo BIOS Update, Arcabit Rescue Disk, MiyoLinux, TeLOS, Kerio Control, RED OS, OpenWrt, MocaccinoOS, EasyStartup, ......
|
Debian, Ubuntu, CentOS, RHEL, Deepin, Fedora, Rocky Linux, SLES, openSUSE, MX Linux, Manjaro, Linux Mint, Endless OS, openEuler, Elementary OS, Solus, Linx, Zorin, antiX, PClinuxOS, Arch, ArcoLinux, ArchLabs, BackArch, Obarun, Artix Linux, Puppy Linux, Tails, Slax, Kali, Mageia, Slackware, Q4OS, Archman, Gentoo, Pentoo, NixOS, Ubuntu Kylin, Lubuntu, Xubuntu, Kubuntu, Ubuntu MATE, Ubuntu Budgie, Ubuntu Studio, Bluestar, OpenMandriva, ExTiX, Netrunner, ALT Linux, Nitrux, Peppermint, KDE neon, Linux Lite, Parrot OS, Qubes, Pop OS, ROSA, Void Linux, Star Linux, EndeavourOS, MakuluLinux, Voyager, Feren, ArchBang, LXLE, Knoppix, Robolinux, Calculate Linux, Clear Linux, Pure OS, Oracle Linux, Trident, Septor, Porteus, Devuan, GoboLinux, 4MLinux, Simplicity Linux, Zeroshell, Android-x86, netboot.xyz, Slitaz, SuperGrub2Disk, Proxmox VE, Kaspersky Rescue, SystemRescueCD, MemTest86, MiniTool Partition Wizard, Parted Magic, veket, Sabayon, Scientific, alpine, ClearOS, CloneZilla, Berry Linux, Trisquel, Ataraxia Linux, Minimal Linux Live, BackBox Linux, Emmabuntüs, ESET SysRescue Live,Nova Linux, AV Linux, RoboLinux, NuTyX, IPFire, SELKS, ZStack, Enso Linux, Security Onion, Network Security Toolkit, Absolute Linux, TinyCore, Springdale Linux, Frost Linux, Shark Linux, LinuxFX, Snail Linux, Astra Linux, Namib Linux, Resilient Linux, Virage Linux, Blackweb Security OS, R-DriveImage, O-O.DiskImage, Macrium, ToOpPy LINUX, GNU Guix, YunoHost, foxclone, siduction, Adelie Linux, Elive, Pardus, CDlinux, AcademiX, Austrumi, Zenwalk, Anarchy, DuZeru, BigLinux, OpenMediaVault, Ubuntu DP, Exe GNU/Linux, 3CX Phone System, KANOTIX, Grml, Karoshi, PrimTux, ArchStrike, CAELinux, Refracta, Cucumber, Fatdog, ForLEx, Hanthana, Kwort, MiniNo, Redcore, Runtu, Asianux, Clu Linux Live, Uruk, OB2D, BlueOnyx, Finnix, HamoniKR, Parabola, LinHES, LinuxConsole, BEE free, Untangle, Pearl, Thinstation, TurnKey, tuxtrans, Neptune, HefftorLinux, GeckoLinux, Mabox Linux, Zentyal, Maui, Reborn OS, SereneLinux , SkyWave Linux, Kaisen Linux, Regata OS, TROM-Jaro, DRBL Linux, Chalet OS, Chapeau, Desa OS, BlankOn, OpenMamba, Frugalware, Kibojoe Linux, Revenge OS, Tsurugi Linux, Drauger OS, Hash Linux, gNewSense, Ikki Boot, SteamOS, Hyperbola, VyOS, EasyNAS, SuperGamer, Live Raizo, Swift Linux, RebeccaBlackOS, Daphile, CRUX, Univention, Ufficio Zero, Rescuezilla, Phoenix OS, Garuda Linux, Mll, NethServer, OSGeoLive, Easy OS, Volumio, FreedomBox, paldo, UBOS, Recalbox, batocera, Lakka, LibreELEC, Pardus Topluluk, Pinguy, KolibriOS, Elastix, Arya, Omoikane, Omarine, Endian Firewall, Hamara, Rocks Cluster, MorpheusArch, Redo, Slackel, SME Server, APODIO, Smoothwall, Dragora, Linspire, Secure-K OS, Peach OSI, Photon, Plamo, SuperX, Bicom, Ploplinux, HP SPP, LliureX, Freespire, DietPi, BOSS, Webconverger, Lunar, TENS, Source Mage, RancherOS, T2, Vine, Pisi, blackPanther, mAid, Acronis, Active.Boot, AOMEI, Boot.Repair, CAINE, DaRT, EasyUEFI, R-Drive, PrimeOS, Avira Rescue System, bitdefender, Checkra1n Linux, Lenovo Diagnostics, Clover, Bliss-OS, Lenovo BIOS Update, Arcabit Rescue Disk, MiyoLinux, TeLOS, Kerio Control, RED OS, OpenWrt, MocaccinoOS, EasyStartup, Pyabr, Refracta, Eset SysRescue, Linpack Xtreme, Archcraft, ......
|
||||||
|
|
||||||
**Unix**
|
**Unix**
|
||||||
DragonFly FreeBSD pfSense GhostBSD FreeNAS TrueNAS XigmaNAS FuryBSD OPNsense HardenedBSD MidnightBSD ClonOS
|
DragonFly FreeBSD pfSense GhostBSD FreeNAS TrueNAS XigmaNAS FuryBSD OPNsense HardenedBSD MidnightBSD ClonOS EmergencyBootKit
|
||||||
|
|
||||||
**ChromeOS**
|
**ChromeOS**
|
||||||
FydeOS, CloudReady
|
FydeOS, CloudReady
|
||||||
@@ -36,6 +36,10 @@ FydeOS, CloudReady
|
|||||||
**Other**
|
**Other**
|
||||||
VMware ESXi, Citrix XenServer, Xen XCP-ng
|
VMware ESXi, Citrix XenServer, Xen XCP-ng
|
||||||
|
|
||||||
|
# Tested Image Report
|
||||||
|
[【How to report a successfully tested image file】](https://github.com/ventoy/Ventoy/issues/1195)
|
||||||
|
|
||||||
|
|
||||||
# Features
|
# Features
|
||||||
* 100% open source
|
* 100% open source
|
||||||
* Simple to use
|
* Simple to use
|
||||||
@@ -52,7 +56,7 @@ VMware ESXi, Citrix XenServer, Xen XCP-ng
|
|||||||
* 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, 760+ iso files tested
|
* Most type of OS supported, 770+ 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
|
||||||
@@ -109,4 +113,24 @@ See [https://www.ventoy.net/en/faq.html](https://www.ventoy.net/en/faq.html) for
|
|||||||
# Forum
|
# Forum
|
||||||
[https://forums.ventoy.net](https://forums.ventoy.net)
|
[https://forums.ventoy.net](https://forums.ventoy.net)
|
||||||
|
|
||||||
|
# Donation
|
||||||
|
It would be much appreciated if you want to make a small donation to support my work!
|
||||||
|
Alipay, WeChat Pay, PayPal and Bitcoin are avaliable for donation. You can chose any of them.
|
||||||
|
|
||||||
|
Alipay | WeChat Pay
|
||||||
|
-|-
|
||||||
|
<img src="https://www.ventoy.net/static/img/AliPay.png" width="250" height="250">|<img src="https://www.ventoy.net/static/img/WeChatPay.png" width="250" height="250">
|
||||||
|
|
||||||
|
**PayPal**
|
||||||
|
You can transfer to my paypal account `admin@ventoy.net` or just click [https://www.paypal.me/ventoy](https://www.paypal.me/ventoy)
|
||||||
|
|
||||||
|
**Bitcoin**
|
||||||
|
Bitcoin Address `19mZDWzZgzkHCi9YX9H3fYCUuCHq3W6wfT`
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,22 +1,43 @@
|
|||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
# Visual Studio 2013
|
# Visual Studio Version 16
|
||||||
VisualStudioVersion = 12.0.21005.1
|
VisualStudioVersion = 16.0.31729.503
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Ventoy2Disk", "Ventoy2Disk\Ventoy2Disk.vcxproj", "{8D231B30-65B1-48A2-A720-F659E61DD390}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Ventoy2Disk", "Ventoy2Disk\Ventoy2Disk.vcxproj", "{8D231B30-65B1-48A2-A720-F659E61DD390}"
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Win32 = Debug|Win32
|
Debug|ARM = Debug|ARM
|
||||||
Release|Win32 = Release|Win32
|
Debug|ARM64 = Debug|ARM64
|
||||||
EndGlobalSection
|
Debug|Win32 = Debug|Win32
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
Debug|x64 = Debug|x64
|
||||||
{8D231B30-65B1-48A2-A720-F659E61DD390}.Debug|Win32.ActiveCfg = Debug|Win32
|
Release|ARM = Release|ARM
|
||||||
{8D231B30-65B1-48A2-A720-F659E61DD390}.Debug|Win32.Build.0 = Debug|Win32
|
Release|ARM64 = Release|ARM64
|
||||||
{8D231B30-65B1-48A2-A720-F659E61DD390}.Release|Win32.ActiveCfg = Release|Win32
|
Release|Win32 = Release|Win32
|
||||||
{8D231B30-65B1-48A2-A720-F659E61DD390}.Release|Win32.Build.0 = Release|Win32
|
Release|x64 = Release|x64
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
HideSolutionNode = FALSE
|
{8D231B30-65B1-48A2-A720-F659E61DD390}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||||
EndGlobalSection
|
{8D231B30-65B1-48A2-A720-F659E61DD390}.Debug|ARM.Build.0 = Debug|ARM
|
||||||
EndGlobal
|
{8D231B30-65B1-48A2-A720-F659E61DD390}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||||
|
{8D231B30-65B1-48A2-A720-F659E61DD390}.Debug|ARM64.Build.0 = Debug|ARM64
|
||||||
|
{8D231B30-65B1-48A2-A720-F659E61DD390}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||||
|
{8D231B30-65B1-48A2-A720-F659E61DD390}.Debug|Win32.Build.0 = Debug|Win32
|
||||||
|
{8D231B30-65B1-48A2-A720-F659E61DD390}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
|
{8D231B30-65B1-48A2-A720-F659E61DD390}.Debug|x64.Build.0 = Debug|x64
|
||||||
|
{8D231B30-65B1-48A2-A720-F659E61DD390}.Release|ARM.ActiveCfg = Release|ARM
|
||||||
|
{8D231B30-65B1-48A2-A720-F659E61DD390}.Release|ARM.Build.0 = Release|ARM
|
||||||
|
{8D231B30-65B1-48A2-A720-F659E61DD390}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||||
|
{8D231B30-65B1-48A2-A720-F659E61DD390}.Release|ARM64.Build.0 = Release|ARM64
|
||||||
|
{8D231B30-65B1-48A2-A720-F659E61DD390}.Release|Win32.ActiveCfg = Release|Win32
|
||||||
|
{8D231B30-65B1-48A2-A720-F659E61DD390}.Release|Win32.Build.0 = Release|Win32
|
||||||
|
{8D231B30-65B1-48A2-A720-F659E61DD390}.Release|x64.ActiveCfg = Release|x64
|
||||||
|
{8D231B30-65B1-48A2-A720-F659E61DD390}.Release|x64.Build.0 = Release|x64
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
|
SolutionGuid = {46BA90D6-AD88-4760-A9BF-5B05B7941467}
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
||||||
|
111
Ventoy2Disk/Ventoy2Disk/DiskService.c
Normal file
111
Ventoy2Disk/Ventoy2Disk/DiskService.c
Normal file
@@ -0,0 +1,111 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* DiskService.c
|
||||||
|
*
|
||||||
|
* Copyright (c) 2021, 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 <Windows.h>
|
||||||
|
#include <winternl.h>
|
||||||
|
#include <commctrl.h>
|
||||||
|
#include <initguid.h>
|
||||||
|
#include <vds.h>
|
||||||
|
#include "Ventoy2Disk.h"
|
||||||
|
#include "DiskService.h"
|
||||||
|
|
||||||
|
BOOL DISK_CleanDisk(int DriveIndex)
|
||||||
|
{
|
||||||
|
BOOL ret;
|
||||||
|
|
||||||
|
ret = VDS_CleanDisk(DriveIndex);
|
||||||
|
if (!ret)
|
||||||
|
{
|
||||||
|
ret = PSHELL_CleanDisk(DriveIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BOOL DISK_DeleteVtoyEFIPartition(int DriveIndex, UINT64 EfiPartOffset)
|
||||||
|
{
|
||||||
|
BOOL ret;
|
||||||
|
|
||||||
|
ret = VDS_DeleteVtoyEFIPartition(DriveIndex, EfiPartOffset);
|
||||||
|
if (!ret)
|
||||||
|
{
|
||||||
|
ret = PSHELL_DeleteVtoyEFIPartition(DriveIndex, EfiPartOffset);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOL DISK_ChangeVtoyEFI2ESP(int DriveIndex, UINT64 Offset)
|
||||||
|
{
|
||||||
|
BOOL ret;
|
||||||
|
|
||||||
|
ret = VDS_ChangeVtoyEFI2ESP(DriveIndex, Offset);
|
||||||
|
if (!ret)
|
||||||
|
{
|
||||||
|
ret = PSHELL_ChangeVtoyEFI2ESP(DriveIndex, Offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BOOL DISK_ChangeVtoyEFI2Basic(int DriveIndex, UINT64 Offset)
|
||||||
|
{
|
||||||
|
BOOL ret;
|
||||||
|
|
||||||
|
ret = VDS_ChangeVtoyEFI2Basic(DriveIndex, Offset);
|
||||||
|
if (!ret)
|
||||||
|
{
|
||||||
|
ret = PSHELL_ChangeVtoyEFI2Basic(DriveIndex, Offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOL DISK_ChangeVtoyEFIAttr(int DriveIndex, UINT64 Offset, UINT64 Attr)
|
||||||
|
{
|
||||||
|
BOOL ret;
|
||||||
|
|
||||||
|
ret = VDS_ChangeVtoyEFIAttr(DriveIndex, Offset, Attr);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOL DISK_ShrinkVolume(int DriveIndex, const char* VolumeGuid, CHAR DriveLetter, UINT64 OldBytes, UINT64 ReduceBytes)
|
||||||
|
{
|
||||||
|
BOOL ret;
|
||||||
|
|
||||||
|
ret = VDS_ShrinkVolume(DriveIndex, VolumeGuid, DriveLetter, OldBytes, ReduceBytes);
|
||||||
|
if (!ret)
|
||||||
|
{
|
||||||
|
if (LASTERR == VDS_E_SHRINK_DIRTY_VOLUME)
|
||||||
|
{
|
||||||
|
Log("VDS shrink return dirty, no need to run powershell.");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ret = PSHELL_ShrinkVolume(DriveIndex, VolumeGuid, DriveLetter, OldBytes, ReduceBytes);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
@@ -29,23 +29,39 @@ typedef struct VDS_PARA
|
|||||||
WCHAR Name[36];
|
WCHAR Name[36];
|
||||||
ULONG NameLen;
|
ULONG NameLen;
|
||||||
ULONGLONG Offset;
|
ULONGLONG Offset;
|
||||||
|
CHAR DriveLetter;
|
||||||
}VDS_PARA;
|
}VDS_PARA;
|
||||||
|
|
||||||
|
//DISK API
|
||||||
|
BOOL DISK_CleanDisk(int DriveIndex);
|
||||||
|
BOOL DISK_DeleteVtoyEFIPartition(int DriveIndex, UINT64 EfiPartOffset);
|
||||||
|
BOOL DISK_ChangeVtoyEFIAttr(int DriveIndex, UINT64 Offset, UINT64 Attr);
|
||||||
|
BOOL DISK_ChangeVtoyEFI2ESP(int DriveIndex, UINT64 Offset);
|
||||||
|
BOOL DISK_ChangeVtoyEFI2Basic(int DriveIndex, UINT64 Offset);
|
||||||
|
BOOL DISK_ShrinkVolume(int DriveIndex, const char* VolumeGuid, CHAR DriveLetter, UINT64 OldBytes, UINT64 ReduceBytes);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//VDS com
|
//VDS com
|
||||||
int VDS_Init(void);
|
|
||||||
BOOL VDS_CleanDisk(int DriveIndex);
|
BOOL VDS_CleanDisk(int DriveIndex);
|
||||||
BOOL VDS_DeleteAllPartitions(int DriveIndex);
|
BOOL VDS_DeleteAllPartitions(int DriveIndex);
|
||||||
BOOL VDS_DeleteVtoyEFIPartition(int DriveIndex);
|
BOOL VDS_DeleteVtoyEFIPartition(int DriveIndex, UINT64 EfiPartOffset);
|
||||||
BOOL VDS_ChangeVtoyEFIAttr(int DriveIndex, UINT64 Attr);
|
BOOL VDS_ChangeVtoyEFIAttr(int DriveIndex, UINT64 Offset, UINT64 Attr);
|
||||||
BOOL VDS_CreateVtoyEFIPart(int DriveIndex, UINT64 Offset);
|
|
||||||
BOOL VDS_ChangeVtoyEFI2ESP(int DriveIndex, UINT64 Offset);
|
BOOL VDS_ChangeVtoyEFI2ESP(int DriveIndex, UINT64 Offset);
|
||||||
BOOL VDS_ChangeVtoyEFI2Basic(int DriveIndex, UINT64 Offset);
|
BOOL VDS_ChangeVtoyEFI2Basic(int DriveIndex, UINT64 Offset);
|
||||||
BOOL VDS_FormatVtoyEFIPart(int DriveIndex, UINT64 Offset);
|
BOOL VDS_ShrinkVolume(int DriveIndex, const char* VolumeGuid, CHAR DriveLetter, UINT64 OldBytes, UINT64 ReduceBytes);
|
||||||
|
BOOL VDS_IsLastAvaliable(void);
|
||||||
|
|
||||||
|
|
||||||
//diskpart.exe
|
//diskpart.exe
|
||||||
BOOL DSPT_CleanDisk(int DriveIndex);
|
BOOL DSPT_CleanDisk(int DriveIndex);
|
||||||
|
|
||||||
|
//powershell.exe
|
||||||
|
BOOL PSHELL_CleanDisk(int DriveIndex);
|
||||||
|
BOOL PSHELL_DeleteVtoyEFIPartition(int DriveIndex, UINT64 EfiPartOffset);
|
||||||
|
BOOL PSHELL_ChangeVtoyEFI2ESP(int DriveIndex, UINT64 Offset);
|
||||||
|
BOOL PSHELL_ChangeVtoyEFI2Basic(int DriveIndex, UINT64 Offset);
|
||||||
|
BOOL PSHELL_ShrinkVolume(int DriveIndex, const char* VolumeGuid, CHAR DriveLetter, UINT64 OldBytes, UINT64 ReduceBytes);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Internel define
|
// Internel define
|
||||||
|
@@ -49,7 +49,7 @@ STATIC BOOL DSPT_CommProc(const char *Cmd)
|
|||||||
GetCurrentDirectoryA(sizeof(CmdBuf), CmdBuf);
|
GetCurrentDirectoryA(sizeof(CmdBuf), CmdBuf);
|
||||||
sprintf_s(CmdFile, sizeof(CmdFile), "%s\\ventoy\\diskpart_%u.txt", CmdBuf, GetCurrentProcessId());
|
sprintf_s(CmdFile, sizeof(CmdFile), "%s\\ventoy\\diskpart_%u.txt", CmdBuf, GetCurrentProcessId());
|
||||||
|
|
||||||
SaveBufToFile(CmdFile, Cmd, strlen(Cmd));
|
SaveBufToFile(CmdFile, Cmd, (int)strlen(Cmd));
|
||||||
|
|
||||||
GetStartupInfoA(&Si);
|
GetStartupInfoA(&Si);
|
||||||
Si.dwFlags |= STARTF_USESHOWWINDOW;
|
Si.dwFlags |= STARTF_USESHOWWINDOW;
|
||||||
@@ -64,6 +64,9 @@ STATIC BOOL DSPT_CommProc(const char *Cmd)
|
|||||||
WaitForSingleObject(Pi.hProcess, INFINITE);
|
WaitForSingleObject(Pi.hProcess, INFINITE);
|
||||||
Log("Process finished...");
|
Log("Process finished...");
|
||||||
|
|
||||||
|
CHECK_CLOSE_HANDLE(Pi.hProcess);
|
||||||
|
CHECK_CLOSE_HANDLE(Pi.hThread);
|
||||||
|
|
||||||
DeleteFileA(CmdFile);
|
DeleteFileA(CmdFile);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@@ -36,6 +36,10 @@
|
|||||||
// 3. Filter out the crap we don't need.
|
// 3. Filter out the crap we don't need.
|
||||||
static const char *GetVdsError(DWORD error_code)
|
static const char *GetVdsError(DWORD error_code)
|
||||||
{
|
{
|
||||||
|
static char code[32];
|
||||||
|
|
||||||
|
sprintf_s(code, sizeof(code), "[0x%08x]", error_code);
|
||||||
|
|
||||||
switch (error_code) {
|
switch (error_code) {
|
||||||
case 0x80042400: // VDS_E_NOT_SUPPORTED
|
case 0x80042400: // VDS_E_NOT_SUPPORTED
|
||||||
return "The operation is not supported by the object.";
|
return "The operation is not supported by the object.";
|
||||||
@@ -386,6 +390,10 @@ static const char *GetVdsError(DWORD error_code)
|
|||||||
return "The offline operation failed.";
|
return "The offline operation failed.";
|
||||||
case 0x80042598: // VDS_E_BAD_REVISION_NUMBER
|
case 0x80042598: // VDS_E_BAD_REVISION_NUMBER
|
||||||
return "The operation could not be completed because the specified revision number is not supported.";
|
return "The operation could not be completed because the specified revision number is not supported.";
|
||||||
|
case 0x80042599: // VDS_E_SHRINK_USER_CANCELLED
|
||||||
|
return "The shrink operation was cancelled by the user.";
|
||||||
|
case 0x8004259a: // VDS_E_SHRINK_DIRTY_VOLUME
|
||||||
|
return "The volume you have selected to shrink may be corrupted. Use Chkdsk to fix the corruption problem, and then try again.";
|
||||||
case 0x00042700: // VDS_S_NAME_TRUNCATED
|
case 0x00042700: // VDS_S_NAME_TRUNCATED
|
||||||
return "The name was set successfully but had to be truncated.";
|
return "The name was set successfully but had to be truncated.";
|
||||||
case 0x80042701: // VDS_E_NAME_NOT_UNIQUE
|
case 0x80042701: // VDS_E_NAME_NOT_UNIQUE
|
||||||
@@ -450,7 +458,7 @@ static const char *GetVdsError(DWORD error_code)
|
|||||||
case 0x80042918: // VDS_E_COMPRESSION_NOT_SUPPORTED
|
case 0x80042918: // VDS_E_COMPRESSION_NOT_SUPPORTED
|
||||||
return "The specified file system does not support compression.";
|
return "The specified file system does not support compression.";
|
||||||
default:
|
default:
|
||||||
return NULL;
|
return code;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -537,6 +545,8 @@ const char *WindowsErrorString(DWORD error_code)
|
|||||||
#define INTF_ADVANCEDDISK2 2
|
#define INTF_ADVANCEDDISK2 2
|
||||||
#define INTF_CREATEPARTITIONEX 3
|
#define INTF_CREATEPARTITIONEX 3
|
||||||
#define INTF_PARTITIONMF 4
|
#define INTF_PARTITIONMF 4
|
||||||
|
#define INTF_VOLUME 5
|
||||||
|
#define INTF_VOLUME_MF3 6
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Some code and functions in the file are copied from rufus.
|
* Some code and functions in the file are copied from rufus.
|
||||||
@@ -588,11 +598,20 @@ const char *WindowsErrorString(DWORD error_code)
|
|||||||
#define IVdsAsync_Wait(This,pHrResult,pAsyncOut) (This)->lpVtbl->Wait(This,pHrResult,pAsyncOut)
|
#define IVdsAsync_Wait(This,pHrResult,pAsyncOut) (This)->lpVtbl->Wait(This,pHrResult,pAsyncOut)
|
||||||
#define IVdsAsync_Release(This) (This)->lpVtbl->Release(This)
|
#define IVdsAsync_Release(This) (This)->lpVtbl->Release(This)
|
||||||
|
|
||||||
|
#define IVdsVolume_Shrink(This, ullNumberOfBytesToRemove, ppAsync) (This)->lpVtbl->Shrink(This, ullNumberOfBytesToRemove, ppAsync)
|
||||||
|
|
||||||
#define IUnknown_QueryInterface(This, a, b) (This)->lpVtbl->QueryInterface(This,a,b)
|
#define IUnknown_QueryInterface(This, a, b) (This)->lpVtbl->QueryInterface(This,a,b)
|
||||||
#define IUnknown_Release(This) (This)->lpVtbl->Release(This)
|
#define IUnknown_Release(This) (This)->lpVtbl->Release(This)
|
||||||
|
|
||||||
typedef BOOL(*VDS_Callback_PF)(void *pInterface, VDS_DISK_PROP *pDiskProp, UINT64 data);
|
typedef BOOL(*VDS_Callback_PF)(void *pInterface, VDS_DISK_PROP *pDiskProp, UINT64 data);
|
||||||
|
|
||||||
|
static BOOL g_vds_available = TRUE;
|
||||||
|
|
||||||
|
BOOL VDS_IsLastAvaliable(void)
|
||||||
|
{
|
||||||
|
return g_vds_available;
|
||||||
|
}
|
||||||
|
|
||||||
STATIC IVdsService * VDS_InitService(void)
|
STATIC IVdsService * VDS_InitService(void)
|
||||||
{
|
{
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
@@ -608,7 +627,7 @@ STATIC IVdsService * VDS_InitService(void)
|
|||||||
if (hr != S_OK)
|
if (hr != S_OK)
|
||||||
{
|
{
|
||||||
VDS_SET_ERROR(hr);
|
VDS_SET_ERROR(hr);
|
||||||
Log("Could not create VDS Loader Instance: %u", LASTERR);
|
Log("Could not create VDS Loader Instance: 0x%x", LASTERR);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -618,7 +637,8 @@ STATIC IVdsService * VDS_InitService(void)
|
|||||||
if (hr != S_OK)
|
if (hr != S_OK)
|
||||||
{
|
{
|
||||||
VDS_SET_ERROR(hr);
|
VDS_SET_ERROR(hr);
|
||||||
Log("Could not load VDS Service: %u", LASTERR);
|
Log("Could not load VDS Service: 0x%x", LASTERR);
|
||||||
|
g_vds_available = FALSE;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -627,14 +647,171 @@ STATIC IVdsService * VDS_InitService(void)
|
|||||||
if (hr != S_OK)
|
if (hr != S_OK)
|
||||||
{
|
{
|
||||||
VDS_SET_ERROR(hr);
|
VDS_SET_ERROR(hr);
|
||||||
Log("VDS Service is not ready: %u", LASTERR);
|
Log("VDS Service is not ready: 0x%x", LASTERR);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
Log("VDS init OK, service %p", pService);
|
Log("VDS init OK, service %p", pService);
|
||||||
|
g_vds_available = TRUE;
|
||||||
return pService;
|
return pService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
STATIC BOOL VDS_VolumeCommProc(int intf, const WCHAR* wVolumeGuid, VDS_Callback_PF callback, UINT64 data)
|
||||||
|
{
|
||||||
|
int Pos = 0;
|
||||||
|
BOOL Find = FALSE;
|
||||||
|
BOOL r = FALSE;
|
||||||
|
HRESULT hr;
|
||||||
|
ULONG ulFetched;
|
||||||
|
IUnknown* pUnk = NULL;
|
||||||
|
IEnumVdsObject* pEnum = NULL;
|
||||||
|
IVdsService* pService = NULL;
|
||||||
|
|
||||||
|
pService = VDS_InitService();
|
||||||
|
if (!pService)
|
||||||
|
{
|
||||||
|
Log("Could not query VDS Service");
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Query the VDS Service Providers
|
||||||
|
hr = IVdsService_QueryProviders(pService, VDS_QUERY_SOFTWARE_PROVIDERS, &pEnum);
|
||||||
|
if (hr != S_OK)
|
||||||
|
{
|
||||||
|
VDS_SET_ERROR(hr);
|
||||||
|
Log("Could not query VDS Service Providers: 0x%lx %u", hr, LASTERR);
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
while (IEnumVdsObject_Next(pEnum, 1, &pUnk, &ulFetched) == S_OK)
|
||||||
|
{
|
||||||
|
IVdsProvider* pProvider;
|
||||||
|
IVdsSwProvider* pSwProvider;
|
||||||
|
IEnumVdsObject* pEnumPack;
|
||||||
|
IUnknown* pPackUnk;
|
||||||
|
|
||||||
|
// Get VDS Provider
|
||||||
|
hr = IUnknown_QueryInterface(pUnk, &IID_IVdsProvider, (void**)&pProvider);
|
||||||
|
IUnknown_Release(pUnk);
|
||||||
|
if (hr != S_OK)
|
||||||
|
{
|
||||||
|
VDS_SET_ERROR(hr);
|
||||||
|
Log("Could not get VDS Provider: %u", LASTERR);
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get VDS Software Provider
|
||||||
|
hr = IVdsSwProvider_QueryInterface(pProvider, &IID_IVdsSwProvider, (void**)&pSwProvider);
|
||||||
|
IVdsProvider_Release(pProvider);
|
||||||
|
if (hr != S_OK)
|
||||||
|
{
|
||||||
|
VDS_SET_ERROR(hr);
|
||||||
|
Log("Could not get VDS Software Provider: %u", LASTERR);
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get VDS Software Provider Packs
|
||||||
|
hr = IVdsSwProvider_QueryPacks(pSwProvider, &pEnumPack);
|
||||||
|
IVdsSwProvider_Release(pSwProvider);
|
||||||
|
if (hr != S_OK)
|
||||||
|
{
|
||||||
|
VDS_SET_ERROR(hr);
|
||||||
|
Log("Could not get VDS Software Provider Packs: %u", LASTERR);
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Enumerate Provider Packs
|
||||||
|
while (IEnumVdsObject_Next(pEnumPack, 1, &pPackUnk, &ulFetched) == S_OK)
|
||||||
|
{
|
||||||
|
IVdsPack* pPack;
|
||||||
|
IEnumVdsObject* pEnumVolume;
|
||||||
|
IUnknown* pVolumeUnk;
|
||||||
|
|
||||||
|
hr = IUnknown_QueryInterface(pPackUnk, &IID_IVdsPack, (void**)&pPack);
|
||||||
|
IUnknown_Release(pPackUnk);
|
||||||
|
if (hr != S_OK)
|
||||||
|
{
|
||||||
|
VDS_SET_ERROR(hr);
|
||||||
|
Log("Could not query VDS Software Provider Pack: %u", LASTERR);
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Use the pack interface to access the volume
|
||||||
|
hr = IVdsPack_QueryVolumes(pPack, &pEnumVolume);;
|
||||||
|
if (hr != S_OK) {
|
||||||
|
VDS_SET_ERROR(hr);
|
||||||
|
Log("Could not query VDS volume: %u", LASTERR);
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
// List disks
|
||||||
|
while (IEnumVdsObject_Next(pEnumVolume, 1, &pVolumeUnk, &ulFetched) == S_OK)
|
||||||
|
{
|
||||||
|
IVdsVolume* pVolume;
|
||||||
|
IVdsVolumeMF3* pVolumeMF3;
|
||||||
|
LPWSTR* wszPathArray;
|
||||||
|
ULONG ulNumberOfPaths;
|
||||||
|
|
||||||
|
// Get the disk interface.
|
||||||
|
hr = IUnknown_QueryInterface(pVolumeUnk, &IID_IVdsVolumeMF3, (void**)&pVolumeMF3);
|
||||||
|
if (hr != S_OK) {
|
||||||
|
VDS_SET_ERROR(hr);
|
||||||
|
Log("Could not query VDS Volume Interface: %u", LASTERR);
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get the volume properties
|
||||||
|
hr = IVdsVolumeMF3_QueryVolumeGuidPathnames(pVolumeMF3, &wszPathArray, &ulNumberOfPaths);
|
||||||
|
if ((hr != S_OK) && (hr != VDS_S_PROPERTIES_INCOMPLETE))
|
||||||
|
{
|
||||||
|
Log("Could not query VDS VolumeMF3 GUID PathNames: %s", GetVdsError(hr));
|
||||||
|
IVdsVolume_Release(pVolumeMF3);
|
||||||
|
IUnknown_Release(pVolumeUnk);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
Log("Get Volume %d %lu <%S>", intf, ulNumberOfPaths, wszPathArray[0]);
|
||||||
|
|
||||||
|
if ((ulNumberOfPaths >= 1) && wcsstr(wszPathArray[0], wVolumeGuid))
|
||||||
|
{
|
||||||
|
Find = TRUE;
|
||||||
|
Log("Call back for this Volume %d <%S>", intf, wVolumeGuid);
|
||||||
|
|
||||||
|
if (INTF_VOLUME_MF3 == intf)
|
||||||
|
{
|
||||||
|
r = callback(pVolumeMF3, NULL, data);
|
||||||
|
}
|
||||||
|
else if (INTF_VOLUME == intf)
|
||||||
|
{
|
||||||
|
// Get the disk interface.
|
||||||
|
hr = IUnknown_QueryInterface(pVolumeUnk, &IID_IVdsVolume, (void**)&pVolume);
|
||||||
|
if (hr != S_OK) {
|
||||||
|
VDS_SET_ERROR(hr);
|
||||||
|
Log("Could not query VDS Volume Interface: %u", LASTERR);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
r = callback(pVolume, NULL, data);
|
||||||
|
IVdsVolume_Release(pVolume);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
CoTaskMemFree(wszPathArray);
|
||||||
|
IVdsVolume_Release(pVolumeMF3);
|
||||||
|
IUnknown_Release(pVolumeUnk);
|
||||||
|
|
||||||
|
if (Find)
|
||||||
|
{
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
out:
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
STATIC BOOL VDS_DiskCommProc(int intf, int DriveIndex, VDS_Callback_PF callback, UINT64 data)
|
STATIC BOOL VDS_DiskCommProc(int intf, int DriveIndex, VDS_Callback_PF callback, UINT64 data)
|
||||||
{
|
{
|
||||||
@@ -887,7 +1064,7 @@ STATIC BOOL VDS_CallBack_CleanDisk(void *pInterface, VDS_DISK_PROP *pDiskProp, U
|
|||||||
BOOL VDS_CleanDisk(int DriveIndex)
|
BOOL VDS_CleanDisk(int DriveIndex)
|
||||||
{
|
{
|
||||||
BOOL ret = VDS_DiskCommProc(INTF_ADVANCEDDISK, DriveIndex, VDS_CallBack_CleanDisk, 0);
|
BOOL ret = VDS_DiskCommProc(INTF_ADVANCEDDISK, DriveIndex, VDS_CallBack_CleanDisk, 0);
|
||||||
Log("VDS_CleanDisk %d ret:%d", DriveIndex, ret);
|
Log("VDS_CleanDisk %d ret:%d (%s)", DriveIndex, ret, ret ? "SUCCESS" : "FAIL");
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -897,16 +1074,16 @@ STATIC BOOL VDS_CallBack_DeletePartition(void *pInterface, VDS_DISK_PROP *pDiskP
|
|||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
VDS_PARTITION_PROP* prop_array = NULL;
|
VDS_PARTITION_PROP* prop_array = NULL;
|
||||||
LONG i, prop_array_size;
|
LONG i, prop_array_size;
|
||||||
ULONG PartNumber = (ULONG)data;
|
UINT64 PartOffset = data;
|
||||||
IVdsAdvancedDisk *pAdvancedDisk = (IVdsAdvancedDisk *)pInterface;
|
IVdsAdvancedDisk *pAdvancedDisk = (IVdsAdvancedDisk *)pInterface;
|
||||||
|
|
||||||
if (PartNumber == 0)
|
if (PartOffset == 0)
|
||||||
{
|
{
|
||||||
Log("Deleting ALL partitions from disk '%S':", pDiskProp->pwszName);
|
Log("Deleting ALL partitions from disk '%S':", pDiskProp->pwszName);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Log("Deleting partition(%ld) from disk '%S':", PartNumber, pDiskProp->pwszName);
|
Log("Deleting partition(offset=%llu) from disk '%S':", PartOffset, pDiskProp->pwszName);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Query the partition data, so we can get the start offset, which we need for deletion
|
// Query the partition data, so we can get the start offset, which we need for deletion
|
||||||
@@ -916,7 +1093,7 @@ STATIC BOOL VDS_CallBack_DeletePartition(void *pInterface, VDS_DISK_PROP *pDiskP
|
|||||||
r = TRUE;
|
r = TRUE;
|
||||||
for (i = 0; i < prop_array_size; i++)
|
for (i = 0; i < prop_array_size; i++)
|
||||||
{
|
{
|
||||||
if (PartNumber == 0 || PartNumber == prop_array[i].ulPartitionNumber)
|
if (PartOffset == 0 || PartOffset == prop_array[i].ullOffset)
|
||||||
{
|
{
|
||||||
Log("* Partition %d (offset: %lld, size: %llu) delete it.",
|
Log("* Partition %d (offset: %lld, size: %llu) delete it.",
|
||||||
prop_array[i].ulPartitionNumber, prop_array[i].ullOffset, (ULONGLONG)prop_array[i].ullSize);
|
prop_array[i].ulPartitionNumber, prop_array[i].ullOffset, (ULONGLONG)prop_array[i].ullSize);
|
||||||
@@ -958,15 +1135,15 @@ STATIC BOOL VDS_CallBack_DeletePartition(void *pInterface, VDS_DISK_PROP *pDiskP
|
|||||||
|
|
||||||
BOOL VDS_DeleteAllPartitions(int DriveIndex)
|
BOOL VDS_DeleteAllPartitions(int DriveIndex)
|
||||||
{
|
{
|
||||||
BOOL ret = VDS_DiskCommProc(INTF_ADVANCEDDISK, DriveIndex, VDS_CallBack_DeletePartition, 0);
|
BOOL ret = VDS_DiskCommProc(INTF_ADVANCEDDISK, DriveIndex, VDS_CallBack_DeletePartition, 0);
|
||||||
Log("VDS_DeleteAllPartitions %d ret:%d", DriveIndex, ret);
|
Log("VDS_DeleteAllPartitions %d ret:%d (%s)", DriveIndex, ret, ret ? "SUCCESS" : "FAIL");
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL VDS_DeleteVtoyEFIPartition(int DriveIndex)
|
BOOL VDS_DeleteVtoyEFIPartition(int DriveIndex, UINT64 EfiPartOffset)
|
||||||
{
|
{
|
||||||
BOOL ret = VDS_DiskCommProc(INTF_ADVANCEDDISK, DriveIndex, VDS_CallBack_DeletePartition, 2);
|
BOOL ret = VDS_DiskCommProc(INTF_ADVANCEDDISK, DriveIndex, VDS_CallBack_DeletePartition, EfiPartOffset);
|
||||||
Log("VDS_DeleteVtoyEFIPartition %d ret:%d", DriveIndex, ret);
|
Log("VDS_DeleteVtoyEFIPartition %d ret:%d (%s)", DriveIndex, ret, ret ? "SUCCESS" : "FAIL");
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -974,6 +1151,7 @@ STATIC BOOL VDS_CallBack_ChangeEFIAttr(void *pInterface, VDS_DISK_PROP *pDiskPro
|
|||||||
{
|
{
|
||||||
BOOL r = FALSE;
|
BOOL r = FALSE;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
VDS_PARA *VdsPara = (VDS_PARA *)data;
|
||||||
VDS_PARTITION_PROP* prop_array = NULL;
|
VDS_PARTITION_PROP* prop_array = NULL;
|
||||||
LONG i, prop_array_size;
|
LONG i, prop_array_size;
|
||||||
CHANGE_ATTRIBUTES_PARAMETERS AttrPara;
|
CHANGE_ATTRIBUTES_PARAMETERS AttrPara;
|
||||||
@@ -987,12 +1165,13 @@ STATIC BOOL VDS_CallBack_ChangeEFIAttr(void *pInterface, VDS_DISK_PROP *pDiskPro
|
|||||||
{
|
{
|
||||||
if (prop_array[i].ullSize == VENTOY_EFI_PART_SIZE &&
|
if (prop_array[i].ullSize == VENTOY_EFI_PART_SIZE &&
|
||||||
prop_array[i].PartitionStyle == VDS_PST_GPT &&
|
prop_array[i].PartitionStyle == VDS_PST_GPT &&
|
||||||
memcmp(prop_array[i].Gpt.name, L"VTOYEFI", 7 * 2) == 0)
|
memcmp(prop_array[i].Gpt.name, L"VTOYEFI", 7 * 2) == 0 &&
|
||||||
|
VdsPara->Offset == prop_array[i].ullOffset)
|
||||||
{
|
{
|
||||||
Log("* Partition %d (offset: %lld, size: %llu, Attr:0x%llx)", prop_array[i].ulPartitionNumber,
|
Log("** Partition %d (offset: %lld, size: %llu, Attr:0x%llx)", prop_array[i].ulPartitionNumber,
|
||||||
prop_array[i].ullOffset, (ULONGLONG)prop_array[i].ullSize, prop_array[i].Gpt.attributes);
|
prop_array[i].ullOffset, (ULONGLONG)prop_array[i].ullSize, prop_array[i].Gpt.attributes);
|
||||||
|
|
||||||
if (prop_array[i].Gpt.attributes == data)
|
if (prop_array[i].Gpt.attributes == VdsPara->Attr)
|
||||||
{
|
{
|
||||||
Log("Attribute match, No need to change.");
|
Log("Attribute match, No need to change.");
|
||||||
r = TRUE;
|
r = TRUE;
|
||||||
@@ -1000,7 +1179,7 @@ STATIC BOOL VDS_CallBack_ChangeEFIAttr(void *pInterface, VDS_DISK_PROP *pDiskPro
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
AttrPara.style = VDS_PST_GPT;
|
AttrPara.style = VDS_PST_GPT;
|
||||||
AttrPara.GptPartInfo.attributes = data;
|
AttrPara.GptPartInfo.attributes = VdsPara->Attr;
|
||||||
hr = IVdsAdvancedDisk_ChangeAttributes(pAdvancedDisk, prop_array[i].ullOffset, &AttrPara);
|
hr = IVdsAdvancedDisk_ChangeAttributes(pAdvancedDisk, prop_array[i].ullOffset, &AttrPara);
|
||||||
if (hr == S_OK)
|
if (hr == S_OK)
|
||||||
{
|
{
|
||||||
@@ -1027,10 +1206,15 @@ STATIC BOOL VDS_CallBack_ChangeEFIAttr(void *pInterface, VDS_DISK_PROP *pDiskPro
|
|||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL VDS_ChangeVtoyEFIAttr(int DriveIndex, UINT64 Attr)
|
BOOL VDS_ChangeVtoyEFIAttr(int DriveIndex, UINT64 Offset, UINT64 Attr)
|
||||||
{
|
{
|
||||||
BOOL ret = VDS_DiskCommProc(INTF_ADVANCEDDISK, DriveIndex, VDS_CallBack_ChangeEFIAttr, Attr);
|
VDS_PARA Para;
|
||||||
Log("VDS_ChangeVtoyEFIAttr %d ret:%d", DriveIndex, ret);
|
|
||||||
|
Para.Attr = Attr;
|
||||||
|
Para.Offset = Offset;
|
||||||
|
|
||||||
|
BOOL ret = VDS_DiskCommProc(INTF_ADVANCEDDISK, DriveIndex, VDS_CallBack_ChangeEFIAttr, (UINT64)&Para);
|
||||||
|
Log("VDS_ChangeVtoyEFIAttr %d (offset:%llu) ret:%d (%s)", DriveIndex, Offset, ret, ret ? "SUCCESS" : "FAIL");
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1041,7 +1225,7 @@ STATIC BOOL VDS_CallBack_ChangeEFIType(void *pInterface, VDS_DISK_PROP *pDiskPro
|
|||||||
BOOL r = FALSE;
|
BOOL r = FALSE;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
IVdsAdvancedDisk2 *pAdvancedDisk2 = (IVdsAdvancedDisk2 *)pInterface;
|
IVdsAdvancedDisk2 *pAdvancedDisk2 = (IVdsAdvancedDisk2 *)pInterface;
|
||||||
VDS_PARA *VdsPara = (VDS_PARA *)(ULONG)data;
|
VDS_PARA *VdsPara = (VDS_PARA *)data;
|
||||||
CHANGE_PARTITION_TYPE_PARAMETERS para;
|
CHANGE_PARTITION_TYPE_PARAMETERS para;
|
||||||
|
|
||||||
para.style = VDS_PST_GPT;
|
para.style = VDS_PST_GPT;
|
||||||
@@ -1069,11 +1253,12 @@ BOOL VDS_ChangeVtoyEFI2ESP(int DriveIndex, UINT64 Offset)
|
|||||||
memcpy(&(Para.Type), &EspPartType, sizeof(GUID));
|
memcpy(&(Para.Type), &EspPartType, sizeof(GUID));
|
||||||
Para.Offset = Offset;
|
Para.Offset = Offset;
|
||||||
|
|
||||||
BOOL ret = VDS_DiskCommProc(INTF_ADVANCEDDISK2, DriveIndex, VDS_CallBack_ChangeEFIType, (ULONG)&Para);
|
BOOL ret = VDS_DiskCommProc(INTF_ADVANCEDDISK2, DriveIndex, VDS_CallBack_ChangeEFIType, (UINT64)&Para);
|
||||||
Log("VDS_ChangeVtoyEFI2ESP %d ret:%d", DriveIndex, ret);
|
Log("VDS_ChangeVtoyEFI2ESP %d ret:%d (%s)", DriveIndex, ret, ret ? "SUCCESS" : "FAIL");
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
BOOL VDS_ChangeVtoyEFI2Basic(int DriveIndex, UINT64 Offset)
|
BOOL VDS_ChangeVtoyEFI2Basic(int DriveIndex, UINT64 Offset)
|
||||||
{
|
{
|
||||||
VDS_PARA Para;
|
VDS_PARA Para;
|
||||||
@@ -1082,98 +1267,75 @@ BOOL VDS_ChangeVtoyEFI2Basic(int DriveIndex, UINT64 Offset)
|
|||||||
memcpy(&(Para.Type), &WindowsDataPartType, sizeof(GUID));
|
memcpy(&(Para.Type), &WindowsDataPartType, sizeof(GUID));
|
||||||
Para.Offset = Offset;
|
Para.Offset = Offset;
|
||||||
|
|
||||||
BOOL ret = VDS_DiskCommProc(INTF_ADVANCEDDISK2, DriveIndex, VDS_CallBack_ChangeEFIType, (ULONG)&Para);
|
BOOL ret = VDS_DiskCommProc(INTF_ADVANCEDDISK2, DriveIndex, VDS_CallBack_ChangeEFIType, (UINT64)&Para);
|
||||||
Log("VDS_ChangeVtoyEFI2ESP %d ret:%d", DriveIndex, ret);
|
Log("VDS_ChangeVtoyEFI2Basic %d ret:%d (%s)", DriveIndex, ret, ret ? "SUCCESS" : "FAIL");
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
STATIC BOOL CHKDSK_Volume(CHAR LogicalDrive)
|
||||||
STATIC BOOL VDS_CallBack_CreateVtoyEFI(void *pInterface, VDS_DISK_PROP *pDiskProp, UINT64 data)
|
|
||||||
{
|
{
|
||||||
HRESULT hr, hr2;
|
CHAR CmdBuf[1024];
|
||||||
ULONG completed;
|
STARTUPINFOA Si;
|
||||||
IVdsAsync* pAsync;
|
PROCESS_INFORMATION Pi;
|
||||||
CREATE_PARTITION_PARAMETERS para;
|
|
||||||
IVdsCreatePartitionEx *pCreatePartitionEx = (IVdsCreatePartitionEx *)pInterface;
|
|
||||||
VDS_PARA *VdsPara = (VDS_PARA *)(ULONG)data;
|
|
||||||
|
|
||||||
(void)pDiskProp;
|
if ((!IsFileExist("C:\\Windows\\System32\\chkdsk.exe")) || (LogicalDrive == 0))
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
memset(¶, 0, sizeof(para));
|
GetStartupInfoA(&Si);
|
||||||
para.style = VDS_PST_GPT;
|
Si.dwFlags |= STARTF_USESHOWWINDOW;
|
||||||
memcpy(&(para.GptPartInfo.partitionType), &VdsPara->Type, sizeof(GUID));
|
Si.wShowWindow = SW_HIDE;
|
||||||
memcpy(&(para.GptPartInfo.partitionId), &VdsPara->Id, sizeof(GUID));
|
|
||||||
para.GptPartInfo.attributes = VdsPara->Attr;
|
|
||||||
memcpy(para.GptPartInfo.name, VdsPara->Name, sizeof(WCHAR)* VdsPara->NameLen);
|
|
||||||
|
|
||||||
hr = IVdsCreatePartitionEx_CreatePartitionEx(pCreatePartitionEx, VdsPara->Offset, VENTOY_EFI_PART_SIZE, 512, ¶, &pAsync);
|
sprintf_s(CmdBuf, sizeof(CmdBuf), "C:\\Windows\\System32\\chkdsk.exe %C: /f", LogicalDrive);
|
||||||
while (SUCCEEDED(hr))
|
|
||||||
{
|
|
||||||
hr = IVdsAsync_QueryStatus(pAsync, &hr2, &completed);
|
|
||||||
if (SUCCEEDED(hr))
|
|
||||||
{
|
|
||||||
hr = hr2;
|
|
||||||
if (hr == S_OK)
|
|
||||||
{
|
|
||||||
Log("Disk create partition QueryStatus OK, %lu%%", completed);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
else if (hr == VDS_E_OPERATION_PENDING)
|
|
||||||
{
|
|
||||||
Log("Disk partition finish: %lu%%", completed);
|
|
||||||
hr = S_OK;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Log("QueryStatus invalid status:0x%lx", hr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Sleep(1000);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (hr != S_OK)
|
Log("CreateProcess <%s>", CmdBuf);
|
||||||
{
|
CreateProcessA(NULL, CmdBuf, NULL, NULL, FALSE, 0, NULL, NULL, &Si, &Pi);
|
||||||
VDS_SET_ERROR(hr);
|
|
||||||
Log("Could not create partition, err:0x%lx(%s)", LASTERR, WindowsErrorString(hr));
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
return TRUE;
|
Log("Wair process ...");
|
||||||
}
|
WaitForSingleObject(Pi.hProcess, INFINITE);
|
||||||
|
Log("Process finished...");
|
||||||
|
|
||||||
BOOL VDS_CreateVtoyEFIPart(int DriveIndex, UINT64 Offset)
|
CHECK_CLOSE_HANDLE(Pi.hProcess);
|
||||||
{
|
CHECK_CLOSE_HANDLE(Pi.hThread);
|
||||||
VDS_PARA Para;
|
|
||||||
GUID WindowsDataPartType = { 0xebd0a0a2, 0xb9e5, 0x4433, { 0x87, 0xc0, 0x68, 0xb6, 0xb7, 0x26, 0x99, 0xc7 } };
|
|
||||||
GUID EspPartType = { 0xc12a7328, 0xf81f, 0x11d2, { 0xba, 0x4b, 0x00, 0xa0, 0xc9, 0x3e, 0xc9, 0x3b } };
|
|
||||||
|
|
||||||
Log("VDS_CreateVtoyEFIPart %u Offset:%llu Sector:%llu", DriveIndex, Offset, Offset / 512);
|
return TRUE;
|
||||||
|
|
||||||
memset(&Para, 0, sizeof(Para));
|
|
||||||
Para.Attr = 0x8000000000000000ULL;
|
|
||||||
Para.Offset = Offset;
|
|
||||||
memcpy(Para.Name, L"VTOYEFI", 7 * 2);
|
|
||||||
Para.NameLen = 7;
|
|
||||||
memcpy(&(Para.Type), &EspPartType, sizeof(GUID));
|
|
||||||
CoCreateGuid(&(Para.Id));
|
|
||||||
|
|
||||||
BOOL ret = VDS_DiskCommProc(INTF_CREATEPARTITIONEX, DriveIndex, VDS_CallBack_CreateVtoyEFI, (ULONG)&Para);
|
|
||||||
Log("VDS_CreateVtoyEFIPart %d ret:%d", DriveIndex, ret);
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
STATIC BOOL VDS_CallBack_FormatVtoyEFI(void *pInterface, VDS_DISK_PROP *pDiskProp, UINT64 data)
|
STATIC BOOL VDS_CallBack_ShrinkVolume(void* pInterface, VDS_DISK_PROP* pDiskProp, UINT64 data)
|
||||||
{
|
{
|
||||||
|
int i;
|
||||||
HRESULT hr, hr2;
|
HRESULT hr, hr2;
|
||||||
|
IVdsVolume* pVolume = (IVdsVolume*)pInterface;
|
||||||
ULONG completed;
|
ULONG completed;
|
||||||
IVdsAsync* pAsync;
|
IVdsAsync* pAsync;
|
||||||
IVdsDiskPartitionMF *pPartitionMF = (IVdsDiskPartitionMF *)pInterface;
|
VDS_PARA *VdsPara = (VDS_PARA *)data;
|
||||||
VDS_PARA *VdsPara = (VDS_PARA *)(ULONG)data;
|
|
||||||
|
|
||||||
(void)pDiskProp;
|
(void)pDiskProp;
|
||||||
|
|
||||||
hr = IVdsPartitionMF_FormatPartitionEx(pPartitionMF, VdsPara->Offset, L"FAT", 0x0100, 0, VdsPara->Name, TRUE, TRUE, FALSE, &pAsync);
|
Log("VDS_CallBack_ShrinkVolume (%C:) (%llu) ...", VdsPara->DriveLetter, (ULONGLONG)VdsPara->Offset);
|
||||||
|
|
||||||
|
hr = IVdsVolume_Shrink(pVolume, (ULONGLONG)VdsPara->Offset, &pAsync);
|
||||||
|
if (hr == VDS_E_SHRINK_DIRTY_VOLUME)
|
||||||
|
{
|
||||||
|
Log("Volume %C: is dirty, run chkdsk and retry.", VdsPara->DriveLetter);
|
||||||
|
CHKDSK_Volume(VdsPara->DriveLetter);
|
||||||
|
|
||||||
|
hr = IVdsVolume_Shrink(pVolume, (ULONGLONG)VdsPara->Offset, &pAsync);
|
||||||
|
if (hr == VDS_E_SHRINK_DIRTY_VOLUME)
|
||||||
|
{
|
||||||
|
Log("################################################################");
|
||||||
|
Log("################################################################");
|
||||||
|
for (i = 0; i < 20; i++)
|
||||||
|
{
|
||||||
|
Log("###### Volume dirty, Please run \"chkdsk /f %C:\" and retry. ######", VdsPara->Name[0]);
|
||||||
|
}
|
||||||
|
Log("################################################################");
|
||||||
|
Log("################################################################");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
while (SUCCEEDED(hr))
|
while (SUCCEEDED(hr))
|
||||||
{
|
{
|
||||||
hr = IVdsAsync_QueryStatus(pAsync, &hr2, &completed);
|
hr = IVdsAsync_QueryStatus(pAsync, &hr2, &completed);
|
||||||
@@ -1182,17 +1344,17 @@ STATIC BOOL VDS_CallBack_FormatVtoyEFI(void *pInterface, VDS_DISK_PROP *pDiskPro
|
|||||||
hr = hr2;
|
hr = hr2;
|
||||||
if (hr == S_OK)
|
if (hr == S_OK)
|
||||||
{
|
{
|
||||||
Log("Disk format partition QueryStatus OK, %lu%%", completed);
|
Log("ShrinkVolume QueryStatus OK, %lu%%", completed);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if (hr == VDS_E_OPERATION_PENDING)
|
else if (hr == VDS_E_OPERATION_PENDING)
|
||||||
{
|
{
|
||||||
Log("Disk format finish: %lu%%", completed);
|
Log("ShrinkVolume: %lu%%", completed);
|
||||||
hr = S_OK;
|
hr = S_OK;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Log("QueryStatus invalid status:0x%lx", hr);
|
Log("ShrinkVolume invalid status:0x%lx", hr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Sleep(1000);
|
Sleep(1000);
|
||||||
@@ -1201,23 +1363,41 @@ STATIC BOOL VDS_CallBack_FormatVtoyEFI(void *pInterface, VDS_DISK_PROP *pDiskPro
|
|||||||
if (hr != S_OK)
|
if (hr != S_OK)
|
||||||
{
|
{
|
||||||
VDS_SET_ERROR(hr);
|
VDS_SET_ERROR(hr);
|
||||||
Log("Could not format partition, err:0x%lx (%s)", LASTERR, WindowsErrorString(hr));
|
Log("Could not ShrinkVolume, 0x%x err:0x%lx (%s)", hr, LASTERR, WindowsErrorString(hr));
|
||||||
|
|
||||||
|
VDS_SET_ERROR(hr);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Not supported for removable disk
|
BOOL VDS_ShrinkVolume(int DriveIndex, const char* VolumeGuid, CHAR DriveLetter, UINT64 OldBytes, UINT64 ReduceBytes)
|
||||||
BOOL VDS_FormatVtoyEFIPart(int DriveIndex, UINT64 Offset)
|
|
||||||
{
|
{
|
||||||
|
int i;
|
||||||
|
BOOL ret = FALSE;
|
||||||
|
WCHAR wGuid[128] = { 0 };
|
||||||
|
const char *guid = NULL;
|
||||||
VDS_PARA Para;
|
VDS_PARA Para;
|
||||||
|
|
||||||
memset(&Para, 0, sizeof(Para));
|
(VOID)DriveIndex;
|
||||||
Para.Offset = Offset;
|
(VOID)OldBytes;
|
||||||
memcpy(Para.Name, L"VTOYEFI", 7 * 2);
|
|
||||||
|
|
||||||
BOOL ret = VDS_DiskCommProc(INTF_PARTITIONMF, DriveIndex, VDS_CallBack_FormatVtoyEFI, (ULONG)&Para);
|
guid = strstr(VolumeGuid, "{");
|
||||||
Log("VDS_FormatVtoyEFIPart %d ret:%d", DriveIndex, ret);
|
if (!guid)
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < 128 && guid[i]; i++)
|
||||||
|
{
|
||||||
|
wGuid[i] = guid[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
Para.Offset = ReduceBytes;
|
||||||
|
Para.DriveLetter = DriveLetter;
|
||||||
|
|
||||||
|
ret = VDS_VolumeCommProc(INTF_VOLUME, wGuid, VDS_CallBack_ShrinkVolume, (UINT64)&Para);
|
||||||
|
Log("VDS_ShrinkVolume %C: ret:%d (%s)", DriveLetter, ret, ret ? "SUCCESS" : "FAIL");
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
@@ -23,5 +23,235 @@
|
|||||||
#include <commctrl.h>
|
#include <commctrl.h>
|
||||||
#include <initguid.h>
|
#include <initguid.h>
|
||||||
#include <vds.h>
|
#include <vds.h>
|
||||||
|
#include <VersionHelpers.h>
|
||||||
#include "Ventoy2Disk.h"
|
#include "Ventoy2Disk.h"
|
||||||
#include "DiskService.h"
|
#include "DiskService.h"
|
||||||
|
|
||||||
|
STATIC BOOL IsPowershellExist(void)
|
||||||
|
{
|
||||||
|
BOOL ret;
|
||||||
|
|
||||||
|
if (!IsWindows8OrGreater())
|
||||||
|
{
|
||||||
|
Log("This is before Windows8 powershell disk not supported.");
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = IsFileExist("C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\powershell.exe");
|
||||||
|
if (!ret)
|
||||||
|
{
|
||||||
|
Log("powershell.exe not exist");
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
int PSHELL_GetPartitionNumber(int PhyDrive, UINT64 Offset)
|
||||||
|
{
|
||||||
|
int partnum = -1;
|
||||||
|
DWORD i = 0;
|
||||||
|
DWORD BufLen = 0;
|
||||||
|
DWORD dwBytes = 0;
|
||||||
|
BOOL bRet;
|
||||||
|
HANDLE hDrive;
|
||||||
|
LONGLONG PartStart;
|
||||||
|
DRIVE_LAYOUT_INFORMATION_EX *pDriveLayout = NULL;
|
||||||
|
|
||||||
|
Log("PSHELL_GetPartitionNumber PhyDrive:%d Offset:%llu", PhyDrive, Offset);
|
||||||
|
|
||||||
|
hDrive = GetPhysicalHandle(PhyDrive, FALSE, FALSE, FALSE);
|
||||||
|
if (hDrive == INVALID_HANDLE_VALUE)
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
BufLen = (DWORD)(sizeof(PARTITION_INFORMATION_EX)* 256);
|
||||||
|
|
||||||
|
pDriveLayout = malloc(BufLen);
|
||||||
|
if (!pDriveLayout)
|
||||||
|
{
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
memset(pDriveLayout, 0, BufLen);
|
||||||
|
|
||||||
|
bRet = DeviceIoControl(hDrive,
|
||||||
|
IOCTL_DISK_GET_DRIVE_LAYOUT_EX, NULL,
|
||||||
|
0,
|
||||||
|
pDriveLayout,
|
||||||
|
BufLen,
|
||||||
|
&dwBytes,
|
||||||
|
NULL);
|
||||||
|
if (!bRet)
|
||||||
|
{
|
||||||
|
Log("Failed to ioctrl get drive layout ex %u", LASTERR);
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
Log("PhyDrive:%d PartitionStyle=%s PartitionCount=%u", PhyDrive,
|
||||||
|
(pDriveLayout->PartitionStyle == PARTITION_STYLE_MBR) ? "MBR" : "GPT", pDriveLayout->PartitionCount);
|
||||||
|
|
||||||
|
for (i = 0; i < pDriveLayout->PartitionCount; i++)
|
||||||
|
{
|
||||||
|
PartStart = pDriveLayout->PartitionEntry[i].StartingOffset.QuadPart;
|
||||||
|
if (PartStart == (LONGLONG)Offset)
|
||||||
|
{
|
||||||
|
Log("[*] [%d] PartitionNumber=%u Offset=%lld Length=%lld ",
|
||||||
|
i,
|
||||||
|
pDriveLayout->PartitionEntry[i].PartitionNumber,
|
||||||
|
pDriveLayout->PartitionEntry[i].StartingOffset.QuadPart,
|
||||||
|
pDriveLayout->PartitionEntry[i].PartitionLength.QuadPart
|
||||||
|
);
|
||||||
|
partnum = (int)pDriveLayout->PartitionEntry[i].PartitionNumber;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Log("[ ] [%d] PartitionNumber=%u Offset=%lld Length=%lld ",
|
||||||
|
i,
|
||||||
|
pDriveLayout->PartitionEntry[i].PartitionNumber,
|
||||||
|
pDriveLayout->PartitionEntry[i].StartingOffset.QuadPart,
|
||||||
|
pDriveLayout->PartitionEntry[i].PartitionLength.QuadPart
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
out:
|
||||||
|
|
||||||
|
CHECK_CLOSE_HANDLE(hDrive);
|
||||||
|
CHECK_FREE(pDriveLayout);
|
||||||
|
|
||||||
|
return partnum;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
STATIC BOOL PSHELL_CommProc(const char *Cmd)
|
||||||
|
{
|
||||||
|
CHAR CmdBuf[4096];
|
||||||
|
STARTUPINFOA Si;
|
||||||
|
PROCESS_INFORMATION Pi;
|
||||||
|
|
||||||
|
if (!IsPowershellExist())
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
GetStartupInfoA(&Si);
|
||||||
|
Si.dwFlags |= STARTF_USESHOWWINDOW;
|
||||||
|
Si.wShowWindow = SW_HIDE;
|
||||||
|
|
||||||
|
sprintf_s(CmdBuf, sizeof(CmdBuf), "C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\powershell.exe -Command \"&{ %s }\"", Cmd);
|
||||||
|
|
||||||
|
Log("CreateProcess <%s>", CmdBuf);
|
||||||
|
CreateProcessA(NULL, CmdBuf, NULL, NULL, FALSE, 0, NULL, NULL, &Si, &Pi);
|
||||||
|
|
||||||
|
Log("Wair process ...");
|
||||||
|
WaitForSingleObject(Pi.hProcess, INFINITE);
|
||||||
|
Log("Process finished...");
|
||||||
|
|
||||||
|
CHECK_CLOSE_HANDLE(Pi.hProcess);
|
||||||
|
CHECK_CLOSE_HANDLE(Pi.hThread);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BOOL PSHELL_CleanDisk(int DriveIndex)
|
||||||
|
{
|
||||||
|
BOOL ret;
|
||||||
|
CHAR CmdBuf[512];
|
||||||
|
|
||||||
|
sprintf_s(CmdBuf, sizeof(CmdBuf), "Clear-Disk -Number %d -RemoveData -RemoveOEM -Confirm:$false", DriveIndex);
|
||||||
|
ret = PSHELL_CommProc(CmdBuf);
|
||||||
|
Log("CleanDiskByPowershell<%d> ret:%d (%s)", DriveIndex, ret, ret ? "SUCCESS" : "FAIL");
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BOOL PSHELL_DeleteVtoyEFIPartition(int DriveIndex, UINT64 EfiPartOffset)
|
||||||
|
{
|
||||||
|
int Part;
|
||||||
|
BOOL ret;
|
||||||
|
CHAR CmdBuf[512];
|
||||||
|
|
||||||
|
Part = PSHELL_GetPartitionNumber(DriveIndex, EfiPartOffset);
|
||||||
|
if (Part < 0)
|
||||||
|
{
|
||||||
|
ret = FALSE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sprintf_s(CmdBuf, sizeof(CmdBuf), "Remove-Partition -DiskNumber %d -PartitionNumber %d -Confirm:$false", DriveIndex, Part);
|
||||||
|
ret = PSHELL_CommProc(CmdBuf);
|
||||||
|
}
|
||||||
|
|
||||||
|
Log("PSHELL_DeleteVtoyEFIPartition<%d> ret:%d (%s)", DriveIndex, ret, ret ? "SUCCESS" : "FAIL");
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BOOL PSHELL_ChangeVtoyEFI2ESP(int DriveIndex, UINT64 Offset)
|
||||||
|
{
|
||||||
|
int Part;
|
||||||
|
BOOL ret;
|
||||||
|
CHAR CmdBuf[512];
|
||||||
|
|
||||||
|
Part = PSHELL_GetPartitionNumber(DriveIndex, Offset);
|
||||||
|
if (Part < 0)
|
||||||
|
{
|
||||||
|
ret = FALSE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sprintf_s(CmdBuf, sizeof(CmdBuf), "Set-Partition -DiskNumber %d -PartitionNumber %d -gpttype '{C12A7328-F81F-11D2-BA4B-00A0C93EC93B}' -Confirm:$false", DriveIndex, Part);
|
||||||
|
ret = PSHELL_CommProc(CmdBuf);
|
||||||
|
}
|
||||||
|
|
||||||
|
Log("PSHELL_ChangeVtoyEFI2ESP<%d> ret:%d (%s)", DriveIndex, ret, ret ? "SUCCESS" : "FAIL");
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BOOL PSHELL_ChangeVtoyEFI2Basic(int DriveIndex, UINT64 Offset)
|
||||||
|
{
|
||||||
|
int Part;
|
||||||
|
BOOL ret;
|
||||||
|
CHAR CmdBuf[512];
|
||||||
|
|
||||||
|
Part = PSHELL_GetPartitionNumber(DriveIndex, Offset);
|
||||||
|
if (Part < 0)
|
||||||
|
{
|
||||||
|
ret = FALSE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sprintf_s(CmdBuf, sizeof(CmdBuf), "Set-Partition -DiskNumber %d -PartitionNumber %d -gpttype '{ebd0a0a2-b9e5-4433-87c0-68b6b72699c7}' -Confirm:$false", DriveIndex, Part);
|
||||||
|
ret = PSHELL_CommProc(CmdBuf);
|
||||||
|
}
|
||||||
|
|
||||||
|
Log("PSHELL_ChangeVtoyEFI2Basic<%d> ret:%d (%s)", DriveIndex, ret, ret ? "SUCCESS" : "FAIL");
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOL PSHELL_ShrinkVolume(int DriveIndex, const char* VolumeGuid, CHAR DriveLetter, UINT64 OldBytes, UINT64 ReduceBytes)
|
||||||
|
{
|
||||||
|
int Part;
|
||||||
|
BOOL ret;
|
||||||
|
CHAR CmdBuf[512];
|
||||||
|
|
||||||
|
(void)VolumeGuid;
|
||||||
|
|
||||||
|
Part = PSHELL_GetPartitionNumber(DriveIndex, SIZE_1MB);
|
||||||
|
if (Part < 0)
|
||||||
|
{
|
||||||
|
ret = FALSE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sprintf_s(CmdBuf, sizeof(CmdBuf), "Resize-Partition -DiskNumber %d -PartitionNumber %d -Size %llu -Confirm:$false",
|
||||||
|
DriveIndex, Part, OldBytes - ReduceBytes);
|
||||||
|
ret = PSHELL_CommProc(CmdBuf);
|
||||||
|
}
|
||||||
|
|
||||||
|
Log("PSHELL_ShrinkVolume<%d> %C: ret:%d (%s)", DriveIndex, DriveLetter, ret, ret ? "SUCCESS" : "FAIL");
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
@@ -77,6 +77,12 @@ typedef enum STR_ID
|
|||||||
STR_VTSI_CREATE_SUCCESS, //41
|
STR_VTSI_CREATE_SUCCESS, //41
|
||||||
STR_VTSI_CREATE_FAILED, //42
|
STR_VTSI_CREATE_FAILED, //42
|
||||||
|
|
||||||
|
STR_MENU_PART_RESIZE,//43
|
||||||
|
STR_PART_RESIZE_TIP,//44
|
||||||
|
STR_PART_RESIZE_SUCCESS,//45
|
||||||
|
STR_PART_RESIZE_FAILED,//46
|
||||||
|
STR_PART_RESIZE_UNSUPPORTED,//47
|
||||||
|
|
||||||
STR_ID_MAX
|
STR_ID_MAX
|
||||||
}STR_ID;
|
}STR_ID;
|
||||||
|
|
||||||
@@ -90,6 +96,7 @@ extern BOOL g_SecureBoot;
|
|||||||
#define VTOY_MENU_PART_GPT 0xA005
|
#define VTOY_MENU_PART_GPT 0xA005
|
||||||
#define VTOY_MENU_ALL_DEV 0xA006
|
#define VTOY_MENU_ALL_DEV 0xA006
|
||||||
#define VTOY_MENU_VTSI 0xA007
|
#define VTOY_MENU_VTSI 0xA007
|
||||||
|
#define VTOY_MENU_PART_RESIZE 0xA008
|
||||||
|
|
||||||
|
|
||||||
typedef enum OPT_SUBMENU
|
typedef enum OPT_SUBMENU
|
||||||
@@ -100,6 +107,7 @@ typedef enum OPT_SUBMENU
|
|||||||
OPT_SUBMENU_CLEAR,
|
OPT_SUBMENU_CLEAR,
|
||||||
OPT_SUBMENU_ALL_DEV,
|
OPT_SUBMENU_ALL_DEV,
|
||||||
OPT_SUBMENU_VTSI,
|
OPT_SUBMENU_VTSI,
|
||||||
|
OPT_SUBMENU_PART_RESIZE,
|
||||||
|
|
||||||
OPT_SUBMENU_MAX
|
OPT_SUBMENU_MAX
|
||||||
}OPT_SUBMENU;
|
}OPT_SUBMENU;
|
||||||
@@ -123,8 +131,8 @@ typedef enum OPT_SUBMENU
|
|||||||
|
|
||||||
typedef struct VENTOY_LANGUAGE
|
typedef struct VENTOY_LANGUAGE
|
||||||
{
|
{
|
||||||
WCHAR Name[128];
|
WCHAR Name[256];
|
||||||
WCHAR FontFamily[64];
|
WCHAR FontFamily[128];
|
||||||
int FontSize;
|
int FontSize;
|
||||||
|
|
||||||
WCHAR StrId[STR_ID_MAX][64];
|
WCHAR StrId[STR_ID_MAX][64];
|
||||||
|
@@ -31,6 +31,36 @@
|
|||||||
#include "ff.h"
|
#include "ff.h"
|
||||||
#include "DiskService.h"
|
#include "DiskService.h"
|
||||||
|
|
||||||
|
static int g_backup_bin_index = 0;
|
||||||
|
|
||||||
|
|
||||||
|
static BOOL WriteDataToPhyDisk(HANDLE hDrive, UINT64 Offset, VOID *buffer, DWORD len)
|
||||||
|
{
|
||||||
|
BOOL bRet;
|
||||||
|
DWORD dwSize = 0;
|
||||||
|
LARGE_INTEGER liCurPosition;
|
||||||
|
LARGE_INTEGER liNewPosition;
|
||||||
|
|
||||||
|
liCurPosition.QuadPart = (LONGLONG)Offset;
|
||||||
|
liNewPosition.QuadPart = 0;
|
||||||
|
if (0 == SetFilePointerEx(hDrive, liCurPosition, &liNewPosition, FILE_BEGIN) ||
|
||||||
|
liNewPosition.QuadPart != liCurPosition.QuadPart)
|
||||||
|
{
|
||||||
|
Log("SetFilePointerEx Failed %u", LASTERR);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bRet = WriteFile(hDrive, buffer, len, &dwSize, NULL);
|
||||||
|
if (bRet == FALSE || dwSize != len)
|
||||||
|
{
|
||||||
|
Log("Write file error %u %u", dwSize, LASTERR);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static DWORD GetVentoyVolumeName(int PhyDrive, UINT64 StartSectorId, CHAR *NameBuf, UINT32 BufLen, BOOL DelSlash)
|
static DWORD GetVentoyVolumeName(int PhyDrive, UINT64 StartSectorId, CHAR *NameBuf, UINT32 BufLen, BOOL DelSlash)
|
||||||
{
|
{
|
||||||
size_t len;
|
size_t len;
|
||||||
@@ -127,7 +157,7 @@ static int GetLettersBelongPhyDrive(int PhyDrive, char *DriveLetters, size_t Len
|
|||||||
|
|
||||||
for (Pos = StringBuf; *Pos; Pos += strlen(Pos) + 1)
|
for (Pos = StringBuf; *Pos; Pos += strlen(Pos) + 1)
|
||||||
{
|
{
|
||||||
if (n < (int)Length && PhyDrive == GetPhyDriveByLogicalDrive(Pos[0]))
|
if (n < (int)Length && PhyDrive == GetPhyDriveByLogicalDrive(Pos[0], NULL))
|
||||||
{
|
{
|
||||||
Log("%C: is belong to phydrive%d", Pos[0], PhyDrive);
|
Log("%C: is belong to phydrive%d", Pos[0], PhyDrive);
|
||||||
DriveLetters[n++] = Pos[0];
|
DriveLetters[n++] = Pos[0];
|
||||||
@@ -138,7 +168,7 @@ static int GetLettersBelongPhyDrive(int PhyDrive, char *DriveLetters, size_t Len
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HANDLE GetPhysicalHandle(int Drive, BOOLEAN bLockDrive, BOOLEAN bWriteAccess, BOOLEAN bWriteShare)
|
HANDLE GetPhysicalHandle(int Drive, BOOLEAN bLockDrive, BOOLEAN bWriteAccess, BOOLEAN bWriteShare)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
DWORD dwSize;
|
DWORD dwSize;
|
||||||
@@ -258,7 +288,7 @@ End:
|
|||||||
return hDrive;
|
return hDrive;
|
||||||
}
|
}
|
||||||
|
|
||||||
int GetPhyDriveByLogicalDrive(int DriveLetter)
|
int GetPhyDriveByLogicalDrive(int DriveLetter, UINT64 *Offset)
|
||||||
{
|
{
|
||||||
BOOL Ret;
|
BOOL Ret;
|
||||||
DWORD dwSize;
|
DWORD dwSize;
|
||||||
@@ -299,6 +329,11 @@ int GetPhyDriveByLogicalDrive(int DriveLetter)
|
|||||||
DiskExtents.Extents[0].ExtentLength.QuadPart
|
DiskExtents.Extents[0].ExtentLength.QuadPart
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (Offset)
|
||||||
|
{
|
||||||
|
*Offset = (UINT64)(DiskExtents.Extents[0].StartingOffset.QuadPart);
|
||||||
|
}
|
||||||
|
|
||||||
return (int)DiskExtents.Extents[0].DiskNumber;
|
return (int)DiskExtents.Extents[0].DiskNumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -333,7 +368,7 @@ int GetAllPhysicalDriveInfo(PHY_DRIVE_INFO *pDriveList, DWORD *pDriveCount)
|
|||||||
{
|
{
|
||||||
if (dwBytes & 0x01)
|
if (dwBytes & 0x01)
|
||||||
{
|
{
|
||||||
id = GetPhyDriveByLogicalDrive(Letter);
|
id = GetPhyDriveByLogicalDrive(Letter, NULL);
|
||||||
Log("%C --> %d", Letter, id);
|
Log("%C --> %d", Letter, id);
|
||||||
if (id >= 0)
|
if (id >= 0)
|
||||||
{
|
{
|
||||||
@@ -840,7 +875,7 @@ static int FormatPart2Fat(HANDLE hDrive, UINT64 StartSectorId)
|
|||||||
LARGE_INTEGER liNewPosition;
|
LARGE_INTEGER liNewPosition;
|
||||||
BYTE *CheckBuf = NULL;
|
BYTE *CheckBuf = NULL;
|
||||||
|
|
||||||
Log("FormatPart2Fat %llu...", StartSectorId);
|
Log("FormatPart2Fat %llu...", (ULONGLONG)StartSectorId);
|
||||||
|
|
||||||
CheckBuf = malloc(SIZE_1MB);
|
CheckBuf = malloc(SIZE_1MB);
|
||||||
if (!CheckBuf)
|
if (!CheckBuf)
|
||||||
@@ -1092,9 +1127,17 @@ static int FormatPart1exFAT(UINT64 DiskSizeBytes)
|
|||||||
|
|
||||||
Log("Formatting Part1 exFAT ...");
|
Log("Formatting Part1 exFAT ...");
|
||||||
|
|
||||||
|
disk_io_reset_write_error();
|
||||||
|
|
||||||
Ret = f_mkfs(TEXT("0:"), &Option, 0, 8 * 1024 * 1024);
|
Ret = f_mkfs(TEXT("0:"), &Option, 0, 8 * 1024 * 1024);
|
||||||
if (FR_OK == Ret)
|
if (FR_OK == Ret)
|
||||||
{
|
{
|
||||||
|
if (disk_io_is_write_error())
|
||||||
|
{
|
||||||
|
Log("Formatting Part1 exFAT failed, write error.");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
Log("Formatting Part1 exFAT success");
|
Log("Formatting Part1 exFAT success");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -1589,9 +1632,11 @@ int InstallVentoy2PhyDrive(PHY_DRIVE_INFO *pPhyDrive, int PartStyle, int TryId)
|
|||||||
UINT64 Part1SectorCount = 0;
|
UINT64 Part1SectorCount = 0;
|
||||||
UINT64 Part2StartSector = 0;
|
UINT64 Part2StartSector = 0;
|
||||||
|
|
||||||
|
Log("#####################################################");
|
||||||
Log("InstallVentoy2PhyDrive try%d %s PhyDrive%d <<%s %s %dGB>>", TryId,
|
Log("InstallVentoy2PhyDrive try%d %s PhyDrive%d <<%s %s %dGB>>", TryId,
|
||||||
PartStyle ? "GPT" : "MBR", pPhyDrive->PhyDrive, pPhyDrive->VendorId, pPhyDrive->ProductId,
|
PartStyle ? "GPT" : "MBR", pPhyDrive->PhyDrive, pPhyDrive->VendorId, pPhyDrive->ProductId,
|
||||||
GetHumanReadableGBSize(pPhyDrive->SizeInBytes));
|
GetHumanReadableGBSize(pPhyDrive->SizeInBytes));
|
||||||
|
Log("#####################################################");
|
||||||
|
|
||||||
if (PartStyle)
|
if (PartStyle)
|
||||||
{
|
{
|
||||||
@@ -1658,9 +1703,7 @@ int InstallVentoy2PhyDrive(PHY_DRIVE_INFO *pPhyDrive, int PartStyle, int TryId)
|
|||||||
|
|
||||||
if (!VDS_DeleteAllPartitions(pPhyDrive->PhyDrive))
|
if (!VDS_DeleteAllPartitions(pPhyDrive->PhyDrive))
|
||||||
{
|
{
|
||||||
Log("Notice: Could not delete partitions: 0x%x", GetLastError());
|
Log("Notice: Could not delete partitions: 0x%x, but we continue.", GetLastError());
|
||||||
rc = 1;
|
|
||||||
goto End;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Log("Deleting all partitions ......................... OK");
|
Log("Deleting all partitions ......................... OK");
|
||||||
@@ -1816,7 +1859,18 @@ End:
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
PROGRESS_BAR_SET_POS(PT_LOCK_FOR_CLEAN);
|
||||||
|
|
||||||
FindProcessOccupyDisk(hDrive, pPhyDrive);
|
FindProcessOccupyDisk(hDrive, pPhyDrive);
|
||||||
|
|
||||||
|
if (!VDS_IsLastAvaliable())
|
||||||
|
{
|
||||||
|
Log("###### [Error:] Virtual Disk Service (VDS) Unavailable ######");
|
||||||
|
Log("###### [Error:] Virtual Disk Service (VDS) Unavailable ######");
|
||||||
|
Log("###### [Error:] Virtual Disk Service (VDS) Unavailable ######");
|
||||||
|
Log("###### [Error:] Virtual Disk Service (VDS) Unavailable ######");
|
||||||
|
Log("###### [Error:] Virtual Disk Service (VDS) Unavailable ######");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pGptInfo)
|
if (pGptInfo)
|
||||||
@@ -1828,6 +1882,324 @@ End:
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int PartitionResizeForVentoy(PHY_DRIVE_INFO *pPhyDrive)
|
||||||
|
{
|
||||||
|
int i, j;
|
||||||
|
int rc = 1;
|
||||||
|
int PhyDrive;
|
||||||
|
int PartStyle;
|
||||||
|
INT64 ReservedValue;
|
||||||
|
UINT64 RecudeBytes;
|
||||||
|
GUID Guid;
|
||||||
|
MBR_HEAD MBR;
|
||||||
|
VTOY_GPT_INFO *pGPT;
|
||||||
|
MBR_HEAD *pMBR;
|
||||||
|
DWORD dwSize = 0;
|
||||||
|
VTOY_GPT_HDR BackupHead;
|
||||||
|
HANDLE hDrive = INVALID_HANDLE_VALUE;
|
||||||
|
GUID ZeroGuid = { 0 };
|
||||||
|
static GUID WindowsDataPartType = { 0xebd0a0a2, 0xb9e5, 0x4433, { 0x87, 0xc0, 0x68, 0xb6, 0xb7, 0x26, 0x99, 0xc7 } };
|
||||||
|
static GUID EspPartType = { 0xc12a7328, 0xf81f, 0x11d2, { 0xba, 0x4b, 0x00, 0xa0, 0xc9, 0x3e, 0xc9, 0x3b } };
|
||||||
|
static GUID BiosGrubPartType = { 0x21686148, 0x6449, 0x6e6f, { 0x74, 0x4e, 0x65, 0x65, 0x64, 0x45, 0x46, 0x49 } };
|
||||||
|
|
||||||
|
Log("#####################################################");
|
||||||
|
Log("PartitionResizeForVentoy PhyDrive%d <<%s %s %dGB>>",
|
||||||
|
pPhyDrive->PhyDrive, pPhyDrive->VendorId, pPhyDrive->ProductId,
|
||||||
|
GetHumanReadableGBSize(pPhyDrive->SizeInBytes));
|
||||||
|
Log("#####################################################");
|
||||||
|
|
||||||
|
pGPT = &(pPhyDrive->Gpt);
|
||||||
|
pMBR = &(pPhyDrive->Gpt.MBR);
|
||||||
|
Log("Disksize:%llu Part2Start:%llu", pPhyDrive->SizeInBytes, pPhyDrive->ResizePart2StartSector * 512);
|
||||||
|
|
||||||
|
if (pMBR->PartTbl[0].FsFlag == 0xEE && memcmp(pGPT->Head.Signature, "EFI PART", 8) == 0)
|
||||||
|
{
|
||||||
|
PartStyle = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
PartStyle = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
PROGRESS_BAR_SET_POS(PT_LOCK_FOR_CLEAN);
|
||||||
|
|
||||||
|
RecudeBytes = VENTOY_EFI_PART_SIZE;
|
||||||
|
ReservedValue = GetReservedSpaceInMB();
|
||||||
|
if (ReservedValue > 0)
|
||||||
|
{
|
||||||
|
Log("Reduce add reserved space %lldMB", (LONGLONG)ReservedValue);
|
||||||
|
RecudeBytes += (UINT64)(ReservedValue * SIZE_1MB);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (pPhyDrive->ResizeNoShrink == FALSE)
|
||||||
|
{
|
||||||
|
Log("Need to shrink the volume");
|
||||||
|
if (DISK_ShrinkVolume(pPhyDrive->PhyDrive, pPhyDrive->ResizeVolumeGuid, pPhyDrive->Part1DriveLetter, pPhyDrive->ResizeOldPart1Size, RecudeBytes))
|
||||||
|
{
|
||||||
|
Log("Shrink volume success, now check again");
|
||||||
|
|
||||||
|
hDrive = GetPhysicalHandle(pPhyDrive->PhyDrive, TRUE, TRUE, FALSE);
|
||||||
|
if (hDrive == INVALID_HANDLE_VALUE)
|
||||||
|
{
|
||||||
|
Log("Failed to GetPhysicalHandle for update.");
|
||||||
|
goto End;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Refresh Drive Layout
|
||||||
|
DeviceIoControl(hDrive, IOCTL_DISK_UPDATE_PROPERTIES, NULL, 0, NULL, 0, &dwSize, NULL);
|
||||||
|
|
||||||
|
CHECK_CLOSE_HANDLE(hDrive);
|
||||||
|
|
||||||
|
|
||||||
|
if (PartResizePreCheck(NULL) && pPhyDrive->ResizeNoShrink)
|
||||||
|
{
|
||||||
|
Log("Recheck after Shrink volume success");
|
||||||
|
Log("After shrink Disksize:%llu Part2Start:%llu", pPhyDrive->SizeInBytes, pPhyDrive->ResizePart2StartSector * 512);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Log("Recheck after Shrink volume failed %u", pPhyDrive->ResizeNoShrink);
|
||||||
|
goto End;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Log("Shrink volume failed");
|
||||||
|
goto End;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//Now try write data
|
||||||
|
hDrive = GetPhysicalHandle(pPhyDrive->PhyDrive, TRUE, TRUE, FALSE);
|
||||||
|
if (hDrive == INVALID_HANDLE_VALUE)
|
||||||
|
{
|
||||||
|
Log("Failed to GetPhysicalHandle for update.");
|
||||||
|
goto End;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//Write partition 2 data
|
||||||
|
PROGRESS_BAR_SET_POS(PT_FORMAT_PART2);
|
||||||
|
if (0 != FormatPart2Fat(hDrive, pPhyDrive->ResizePart2StartSector))
|
||||||
|
{
|
||||||
|
Log("FormatPart2Fat failed.");
|
||||||
|
goto End;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Write grub stage2 gap
|
||||||
|
PROGRESS_BAR_SET_POS(PT_WRITE_STG1_IMG);
|
||||||
|
Log("Writing Boot Image ............................. ");
|
||||||
|
if (WriteGrubStage1ToPhyDrive(hDrive, PartStyle) != 0)
|
||||||
|
{
|
||||||
|
Log("WriteGrubStage1ToPhyDrive failed.");
|
||||||
|
goto End;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//Write partition table
|
||||||
|
PROGRESS_BAR_SET_POS(PT_WRITE_PART_TABLE);
|
||||||
|
Log("Writing partition table ............................. ");
|
||||||
|
|
||||||
|
VentoyGetLocalBootImg(&MBR);
|
||||||
|
CoCreateGuid(&Guid);
|
||||||
|
memcpy(MBR.BootCode + 0x180, &Guid, 16);
|
||||||
|
memcpy(pMBR->BootCode, MBR.BootCode, 440);
|
||||||
|
|
||||||
|
if (PartStyle == 0)
|
||||||
|
{
|
||||||
|
for (i = 1; i < 4; i++)
|
||||||
|
{
|
||||||
|
if (pMBR->PartTbl[i].SectorCount == 0)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (i >= 4)
|
||||||
|
{
|
||||||
|
Log("Can not find MBR free partition table");
|
||||||
|
goto End;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (j = i - 1; j > 0; j--)
|
||||||
|
{
|
||||||
|
Log("Move MBR partition table %d --> %d", j + 1, j + 2);
|
||||||
|
memcpy(pMBR->PartTbl + (j + 1), pMBR->PartTbl + j, sizeof(PART_TABLE));
|
||||||
|
}
|
||||||
|
|
||||||
|
memset(pMBR->PartTbl + 1, 0, sizeof(PART_TABLE));
|
||||||
|
VentoyFillMBRLocation(pPhyDrive->SizeInBytes, (UINT32)pPhyDrive->ResizePart2StartSector, VENTOY_EFI_PART_SIZE / 512, pMBR->PartTbl + 1);
|
||||||
|
pMBR->PartTbl[0].Active = 0x80; // bootable
|
||||||
|
pMBR->PartTbl[1].Active = 0x00;
|
||||||
|
pMBR->PartTbl[1].FsFlag = 0xEF; // EFI System Partition
|
||||||
|
|
||||||
|
if (!WriteDataToPhyDisk(hDrive, 0, pMBR, 512))
|
||||||
|
{
|
||||||
|
Log("Legacy BIOS write MBR failed");
|
||||||
|
goto End;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (i = 1; i < 128; i++)
|
||||||
|
{
|
||||||
|
if (memcmp(&(pGPT->PartTbl[i].PartGuid), &ZeroGuid, sizeof(GUID)) == 0)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (i >= 128)
|
||||||
|
{
|
||||||
|
Log("Can not find GPT free partition table");
|
||||||
|
goto End;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (j = i - 1; j > 0; j--)
|
||||||
|
{
|
||||||
|
Log("Move GPT partition table %d --> %d", j + 1, j + 2);
|
||||||
|
memcpy(pGPT->PartTbl + (j + 1), pGPT->PartTbl + j, sizeof(VTOY_GPT_PART_TBL));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
pMBR->BootCode[92] = 0x22;
|
||||||
|
|
||||||
|
// to fix windows issue
|
||||||
|
memset(pGPT->PartTbl + 1, 0, sizeof(VTOY_GPT_PART_TBL));
|
||||||
|
memcpy(&(pGPT->PartTbl[1].PartType), &WindowsDataPartType, sizeof(GUID));
|
||||||
|
CoCreateGuid(&(pGPT->PartTbl[1].PartGuid));
|
||||||
|
|
||||||
|
pGPT->PartTbl[1].StartLBA = pGPT->PartTbl[0].LastLBA + 1;
|
||||||
|
pGPT->PartTbl[1].LastLBA = pGPT->PartTbl[1].StartLBA + VENTOY_EFI_PART_SIZE / 512 - 1;
|
||||||
|
pGPT->PartTbl[1].Attr = 0xC000000000000001ULL;
|
||||||
|
memcpy(pGPT->PartTbl[1].Name, L"VTOYEFI", 7 * 2);
|
||||||
|
|
||||||
|
//Update CRC
|
||||||
|
pGPT->Head.PartTblCrc = VentoyCrc32(pGPT->PartTbl, sizeof(pGPT->PartTbl));
|
||||||
|
pGPT->Head.Crc = 0;
|
||||||
|
pGPT->Head.Crc = VentoyCrc32(&(pGPT->Head), pGPT->Head.Length);
|
||||||
|
|
||||||
|
Log("pGPT->Head.EfiStartLBA=%llu", (ULONGLONG)pGPT->Head.EfiStartLBA);
|
||||||
|
Log("pGPT->Head.EfiBackupLBA=%llu", (ULONGLONG)pGPT->Head.EfiBackupLBA);
|
||||||
|
|
||||||
|
VentoyFillBackupGptHead(pGPT, &BackupHead);
|
||||||
|
if (!WriteDataToPhyDisk(hDrive, pGPT->Head.EfiBackupLBA * 512, &BackupHead, 512))
|
||||||
|
{
|
||||||
|
Log("UEFI write backup head failed");
|
||||||
|
goto End;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!WriteDataToPhyDisk(hDrive, (pGPT->Head.EfiBackupLBA - 32) * 512, pGPT->PartTbl, 512 * 32))
|
||||||
|
{
|
||||||
|
Log("UEFI write backup partition table failed");
|
||||||
|
goto End;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!WriteDataToPhyDisk(hDrive, 0, pGPT, 512 * 34))
|
||||||
|
{
|
||||||
|
Log("UEFI write MBR & Main partition table failed");
|
||||||
|
goto End;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Refresh Drive Layout
|
||||||
|
DeviceIoControl(hDrive, IOCTL_DISK_UPDATE_PROPERTIES, NULL, 0, NULL, 0, &dwSize, NULL);
|
||||||
|
|
||||||
|
//We must close handle here, because it will block the refresh bellow
|
||||||
|
CHECK_CLOSE_HANDLE(hDrive);
|
||||||
|
|
||||||
|
Sleep(2000);
|
||||||
|
|
||||||
|
//Refresh disk list
|
||||||
|
PhyDrive = pPhyDrive->PhyDrive;
|
||||||
|
|
||||||
|
Log("#### Now Refresh PhyDrive ####");
|
||||||
|
Ventoy2DiskDestroy();
|
||||||
|
Ventoy2DiskInit();
|
||||||
|
|
||||||
|
pPhyDrive = GetPhyDriveInfoByPhyDrive(PhyDrive);
|
||||||
|
if (pPhyDrive)
|
||||||
|
{
|
||||||
|
if (pPhyDrive->VentoyVersion[0] == 0)
|
||||||
|
{
|
||||||
|
Log("After process the Ventoy version is still invalid");
|
||||||
|
goto End;
|
||||||
|
}
|
||||||
|
|
||||||
|
Log("### Ventoy non-destructive installation successfully finished <%s>", pPhyDrive->VentoyVersion);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Log("### Ventoy non-destructive installation successfully finished <not found>");
|
||||||
|
}
|
||||||
|
|
||||||
|
InitComboxCtrl(g_DialogHwnd, PhyDrive);
|
||||||
|
|
||||||
|
rc = 0;
|
||||||
|
|
||||||
|
End:
|
||||||
|
CHECK_CLOSE_HANDLE(hDrive);
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static BOOL DiskCheckWriteAccess(HANDLE hDrive)
|
||||||
|
{
|
||||||
|
DWORD dwSize;
|
||||||
|
BOOL ret = FALSE;
|
||||||
|
BOOL bRet = FALSE;
|
||||||
|
BYTE Buffer[512];
|
||||||
|
LARGE_INTEGER liCurPosition;
|
||||||
|
LARGE_INTEGER liNewPosition;
|
||||||
|
|
||||||
|
liCurPosition.QuadPart = 2039 * 512;
|
||||||
|
liNewPosition.QuadPart = 0;
|
||||||
|
if (0 == SetFilePointerEx(hDrive, liCurPosition, &liNewPosition, FILE_BEGIN) ||
|
||||||
|
liNewPosition.QuadPart != liCurPosition.QuadPart)
|
||||||
|
{
|
||||||
|
Log("SetFilePointer1 Failed %u", LASTERR);
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
dwSize = 0;
|
||||||
|
ret = ReadFile(hDrive, Buffer, 512, &dwSize, NULL);
|
||||||
|
if ((!ret) || (dwSize != 512))
|
||||||
|
{
|
||||||
|
Log("Failed to read %d %u 0x%x", ret, dwSize, LASTERR);
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
liCurPosition.QuadPart = 2039 * 512;
|
||||||
|
liNewPosition.QuadPart = 0;
|
||||||
|
if (0 == SetFilePointerEx(hDrive, liCurPosition, &liNewPosition, FILE_BEGIN) ||
|
||||||
|
liNewPosition.QuadPart != liCurPosition.QuadPart)
|
||||||
|
{
|
||||||
|
Log("SetFilePointer2 Failed %u", LASTERR);
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
dwSize = 0;
|
||||||
|
ret = WriteFile(hDrive, Buffer, 512, &dwSize, NULL);
|
||||||
|
if ((!ret) || dwSize != 512)
|
||||||
|
{
|
||||||
|
Log("Failed to write %d %u %u", ret, dwSize, LASTERR);
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
bRet = TRUE;
|
||||||
|
|
||||||
|
out:
|
||||||
|
|
||||||
|
return bRet;
|
||||||
|
}
|
||||||
|
|
||||||
static BOOL BackupDataBeforeCleanDisk(int PhyDrive, UINT64 DiskSize, BYTE **pBackup)
|
static BOOL BackupDataBeforeCleanDisk(int PhyDrive, UINT64 DiskSize, BYTE **pBackup)
|
||||||
{
|
{
|
||||||
DWORD dwSize;
|
DWORD dwSize;
|
||||||
@@ -1835,13 +2207,35 @@ static BOOL BackupDataBeforeCleanDisk(int PhyDrive, UINT64 DiskSize, BYTE **pBac
|
|||||||
BOOL Return = FALSE;
|
BOOL Return = FALSE;
|
||||||
BOOL ret = FALSE;
|
BOOL ret = FALSE;
|
||||||
BYTE *backup = NULL;
|
BYTE *backup = NULL;
|
||||||
|
UINT64 offset;
|
||||||
HANDLE hDrive = INVALID_HANDLE_VALUE;
|
HANDLE hDrive = INVALID_HANDLE_VALUE;
|
||||||
LARGE_INTEGER liCurPosition;
|
LARGE_INTEGER liCurPosition;
|
||||||
LARGE_INTEGER liNewPosition;
|
LARGE_INTEGER liNewPosition;
|
||||||
|
VTOY_GPT_INFO *pGPT = NULL;
|
||||||
|
|
||||||
Log("BackupDataBeforeCleanDisk %d", PhyDrive);
|
Log("BackupDataBeforeCleanDisk %d", PhyDrive);
|
||||||
|
|
||||||
backup = malloc(SIZE_1MB * 3);
|
// step1: check write access
|
||||||
|
hDrive = GetPhysicalHandle(PhyDrive, TRUE, TRUE, FALSE);
|
||||||
|
if (hDrive == INVALID_HANDLE_VALUE)
|
||||||
|
{
|
||||||
|
Log("Failed to GetPhysicalHandle for write.");
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (DiskCheckWriteAccess(hDrive))
|
||||||
|
{
|
||||||
|
Log("DiskCheckWriteAccess success");
|
||||||
|
CHECK_CLOSE_HANDLE(hDrive);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Log("DiskCheckWriteAccess failed");
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
//step2 backup 4MB data
|
||||||
|
backup = malloc(SIZE_1MB * 4);
|
||||||
if (!backup)
|
if (!backup)
|
||||||
{
|
{
|
||||||
goto out;
|
goto out;
|
||||||
@@ -1853,7 +2247,7 @@ static BOOL BackupDataBeforeCleanDisk(int PhyDrive, UINT64 DiskSize, BYTE **pBac
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
//read first 1MB
|
//read first 2MB
|
||||||
dwStatus = SetFilePointer(hDrive, 0, NULL, FILE_BEGIN);
|
dwStatus = SetFilePointer(hDrive, 0, NULL, FILE_BEGIN);
|
||||||
if (dwStatus != 0)
|
if (dwStatus != 0)
|
||||||
{
|
{
|
||||||
@@ -1861,14 +2255,27 @@ static BOOL BackupDataBeforeCleanDisk(int PhyDrive, UINT64 DiskSize, BYTE **pBac
|
|||||||
}
|
}
|
||||||
|
|
||||||
dwSize = 0;
|
dwSize = 0;
|
||||||
ret = ReadFile(hDrive, backup, SIZE_1MB, &dwSize, NULL);
|
ret = ReadFile(hDrive, backup, SIZE_2MB, &dwSize, NULL);
|
||||||
if ((!ret) || (dwSize != SIZE_1MB))
|
if ((!ret) || (dwSize != SIZE_2MB))
|
||||||
{
|
{
|
||||||
Log("Failed to read %d %u 0x%x", ret, dwSize, LASTERR);
|
Log("Failed to read %d %u 0x%x", ret, dwSize, LASTERR);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
liCurPosition.QuadPart = DiskSize - (SIZE_1MB * 2);
|
pGPT = (VTOY_GPT_INFO *)backup;
|
||||||
|
offset = pGPT->Head.EfiBackupLBA * 512;
|
||||||
|
if (offset >= (DiskSize - SIZE_2MB) && offset < DiskSize)
|
||||||
|
{
|
||||||
|
Log("EFI partition table check success");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Log("Backup EFI LBA not in last 2MB range: %llu", pGPT->Head.EfiBackupLBA);
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
//read last 2MB
|
||||||
|
liCurPosition.QuadPart = DiskSize - SIZE_2MB;
|
||||||
liNewPosition.QuadPart = 0;
|
liNewPosition.QuadPart = 0;
|
||||||
if (0 == SetFilePointerEx(hDrive, liCurPosition, &liNewPosition, FILE_BEGIN) ||
|
if (0 == SetFilePointerEx(hDrive, liCurPosition, &liNewPosition, FILE_BEGIN) ||
|
||||||
liNewPosition.QuadPart != liCurPosition.QuadPart)
|
liNewPosition.QuadPart != liCurPosition.QuadPart)
|
||||||
@@ -1877,8 +2284,8 @@ static BOOL BackupDataBeforeCleanDisk(int PhyDrive, UINT64 DiskSize, BYTE **pBac
|
|||||||
}
|
}
|
||||||
|
|
||||||
dwSize = 0;
|
dwSize = 0;
|
||||||
ret = ReadFile(hDrive, backup + SIZE_1MB, 2 * SIZE_1MB, &dwSize, NULL);
|
ret = ReadFile(hDrive, backup + SIZE_2MB, SIZE_2MB, &dwSize, NULL);
|
||||||
if ((!ret) || (dwSize != 2 * SIZE_1MB))
|
if ((!ret) || (dwSize != SIZE_2MB))
|
||||||
{
|
{
|
||||||
Log("Failed to read %d %u 0x%x", ret, dwSize, LASTERR);
|
Log("Failed to read %d %u 0x%x", ret, dwSize, LASTERR);
|
||||||
goto out;
|
goto out;
|
||||||
@@ -1930,11 +2337,13 @@ int UpdateVentoy2PhyDrive(PHY_DRIVE_INFO *pPhyDrive, int TryId)
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
int MaxRetry = 3;
|
int MaxRetry = 4;
|
||||||
BOOL ForceMBR = FALSE;
|
BOOL ForceMBR = FALSE;
|
||||||
BOOL Esp2Basic = FALSE;
|
BOOL Esp2Basic = FALSE;
|
||||||
BOOL ChangeAttr = FALSE;
|
BOOL ChangeAttr = FALSE;
|
||||||
BOOL CleanDisk = FALSE;
|
BOOL CleanDisk = FALSE;
|
||||||
|
BOOL DelEFI = FALSE;
|
||||||
|
BOOL bWriteBack = TRUE;
|
||||||
HANDLE hVolume;
|
HANDLE hVolume;
|
||||||
HANDLE hDrive;
|
HANDLE hDrive;
|
||||||
DWORD Status;
|
DWORD Status;
|
||||||
@@ -1942,17 +2351,21 @@ int UpdateVentoy2PhyDrive(PHY_DRIVE_INFO *pPhyDrive, int TryId)
|
|||||||
BOOL bRet;
|
BOOL bRet;
|
||||||
CHAR DriveName[] = "?:\\";
|
CHAR DriveName[] = "?:\\";
|
||||||
CHAR DriveLetters[MAX_PATH] = { 0 };
|
CHAR DriveLetters[MAX_PATH] = { 0 };
|
||||||
|
CHAR BackBinFile[MAX_PATH];
|
||||||
UINT64 StartSector;
|
UINT64 StartSector;
|
||||||
UINT64 ReservedMB = 0;
|
UINT64 ReservedMB = 0;
|
||||||
MBR_HEAD BootImg;
|
MBR_HEAD BootImg;
|
||||||
MBR_HEAD MBR;
|
MBR_HEAD MBR;
|
||||||
BYTE *pBackup = NULL;
|
BYTE *pBackup = NULL;
|
||||||
VTOY_GPT_INFO *pGptInfo = NULL;
|
VTOY_GPT_INFO *pGptInfo = NULL;
|
||||||
|
VTOY_GPT_INFO *pGptBkup = NULL;
|
||||||
UINT8 ReservedData[4096];
|
UINT8 ReservedData[4096];
|
||||||
|
|
||||||
|
Log("#####################################################");
|
||||||
Log("UpdateVentoy2PhyDrive try%d %s PhyDrive%d <<%s %s %dGB>>", TryId,
|
Log("UpdateVentoy2PhyDrive try%d %s PhyDrive%d <<%s %s %dGB>>", TryId,
|
||||||
pPhyDrive->PartStyle ? "GPT" : "MBR", pPhyDrive->PhyDrive, pPhyDrive->VendorId, pPhyDrive->ProductId,
|
pPhyDrive->PartStyle ? "GPT" : "MBR", pPhyDrive->PhyDrive, pPhyDrive->VendorId, pPhyDrive->ProductId,
|
||||||
GetHumanReadableGBSize(pPhyDrive->SizeInBytes));
|
GetHumanReadableGBSize(pPhyDrive->SizeInBytes));
|
||||||
|
Log("#####################################################");
|
||||||
|
|
||||||
PROGRESS_BAR_SET_POS(PT_LOCK_FOR_CLEAN);
|
PROGRESS_BAR_SET_POS(PT_LOCK_FOR_CLEAN);
|
||||||
|
|
||||||
@@ -1967,17 +2380,19 @@ int UpdateVentoy2PhyDrive(PHY_DRIVE_INFO *pPhyDrive, int TryId)
|
|||||||
|
|
||||||
if (pPhyDrive->PartStyle)
|
if (pPhyDrive->PartStyle)
|
||||||
{
|
{
|
||||||
pGptInfo = malloc(sizeof(VTOY_GPT_INFO));
|
pGptInfo = malloc(2 * sizeof(VTOY_GPT_INFO));
|
||||||
if (!pGptInfo)
|
if (!pGptInfo)
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(pGptInfo, 0, sizeof(VTOY_GPT_INFO));
|
memset(pGptInfo, 0, 2 * sizeof(VTOY_GPT_INFO));
|
||||||
|
pGptBkup = pGptInfo + 1;
|
||||||
|
|
||||||
// Read GPT Info
|
// Read GPT Info
|
||||||
SetFilePointer(hDrive, 0, NULL, FILE_BEGIN);
|
SetFilePointer(hDrive, 0, NULL, FILE_BEGIN);
|
||||||
ReadFile(hDrive, pGptInfo, sizeof(VTOY_GPT_INFO), &dwSize, NULL);
|
ReadFile(hDrive, pGptInfo, sizeof(VTOY_GPT_INFO), &dwSize, NULL);
|
||||||
|
memcpy(pGptBkup, pGptInfo, sizeof(VTOY_GPT_INFO));
|
||||||
|
|
||||||
//MBR will be used to compare with local boot image
|
//MBR will be used to compare with local boot image
|
||||||
memcpy(&MBR, &pGptInfo->MBR, sizeof(MBR_HEAD));
|
memcpy(&MBR, &pGptInfo->MBR, sizeof(MBR_HEAD));
|
||||||
@@ -2041,30 +2456,40 @@ int UpdateVentoy2PhyDrive(PHY_DRIVE_INFO *pPhyDrive, int TryId)
|
|||||||
if (TryId == 1)
|
if (TryId == 1)
|
||||||
{
|
{
|
||||||
Log("Change GPT partition type to ESP");
|
Log("Change GPT partition type to ESP");
|
||||||
if (VDS_ChangeVtoyEFI2ESP(pPhyDrive->PhyDrive, StartSector * 512))
|
if (DISK_ChangeVtoyEFI2ESP(pPhyDrive->PhyDrive, StartSector * 512ULL))
|
||||||
{
|
{
|
||||||
Esp2Basic = TRUE;
|
Esp2Basic = TRUE;
|
||||||
Sleep(1000);
|
Sleep(3000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (TryId == 2)
|
else if (TryId == 2)
|
||||||
{
|
{
|
||||||
Log("Change GPT partition attribute");
|
Log("Change GPT partition attribute");
|
||||||
if (VDS_ChangeVtoyEFIAttr(pPhyDrive->PhyDrive, 0x8000000000000001))
|
if (DISK_ChangeVtoyEFIAttr(pPhyDrive->PhyDrive, StartSector * 512ULL, 0x8000000000000001))
|
||||||
{
|
{
|
||||||
ChangeAttr = TRUE;
|
ChangeAttr = TRUE;
|
||||||
Sleep(1000);
|
Sleep(2000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (TryId == 3)
|
else if (TryId == 3)
|
||||||
|
{
|
||||||
|
DISK_DeleteVtoyEFIPartition(pPhyDrive->PhyDrive, StartSector * 512ULL);
|
||||||
|
DelEFI = TRUE;
|
||||||
|
}
|
||||||
|
else if (TryId == 4)
|
||||||
{
|
{
|
||||||
Log("Clean disk GPT partition table");
|
Log("Clean disk GPT partition table");
|
||||||
if (BackupDataBeforeCleanDisk(pPhyDrive->PhyDrive, pPhyDrive->SizeInBytes, &pBackup))
|
if (BackupDataBeforeCleanDisk(pPhyDrive->PhyDrive, pPhyDrive->SizeInBytes, &pBackup))
|
||||||
{
|
{
|
||||||
|
sprintf_s(BackBinFile, sizeof(BackBinFile), ".\\ventoy\\phydrive%d_%u_%d.bin",
|
||||||
|
pPhyDrive->PhyDrive, GetCurrentProcessId(), g_backup_bin_index++);
|
||||||
|
SaveBufToFile(BackBinFile, pBackup, 4 * SIZE_1MB);
|
||||||
|
Log("Save backup data to %s", BackBinFile);
|
||||||
|
|
||||||
Log("Success to backup data before clean");
|
Log("Success to backup data before clean");
|
||||||
CleanDisk = TRUE;
|
CleanDisk = TRUE;
|
||||||
VDS_CleanDisk(pPhyDrive->PhyDrive);
|
DISK_CleanDisk(pPhyDrive->PhyDrive);
|
||||||
Sleep(1000);
|
Sleep(3000);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -2092,7 +2517,22 @@ int UpdateVentoy2PhyDrive(PHY_DRIVE_INFO *pPhyDrive, int TryId)
|
|||||||
//If we change VTOYEFI to ESP, it can not have s volume name, so don't try to get it.
|
//If we change VTOYEFI to ESP, it can not have s volume name, so don't try to get it.
|
||||||
if (CleanDisk)
|
if (CleanDisk)
|
||||||
{
|
{
|
||||||
WriteBackupDataToDisk(hDrive, pPhyDrive->SizeInBytes - (2 * SIZE_1MB), pBackup + SIZE_1MB, 2 * SIZE_1MB);
|
//writeback the last 2MB
|
||||||
|
if (!WriteBackupDataToDisk(hDrive, pPhyDrive->SizeInBytes - SIZE_2MB, pBackup + SIZE_2MB, SIZE_2MB))
|
||||||
|
{
|
||||||
|
bWriteBack = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
//write the first 2MB except parttable
|
||||||
|
if (!WriteBackupDataToDisk(hDrive, 34 * 512, pBackup + 34 * 512, SIZE_2MB - 34 * 512))
|
||||||
|
{
|
||||||
|
bWriteBack = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
Status = ERROR_NOT_FOUND;
|
||||||
|
}
|
||||||
|
else if (DelEFI)
|
||||||
|
{
|
||||||
Status = ERROR_NOT_FOUND;
|
Status = ERROR_NOT_FOUND;
|
||||||
}
|
}
|
||||||
else if (Esp2Basic)
|
else if (Esp2Basic)
|
||||||
@@ -2164,24 +2604,41 @@ int UpdateVentoy2PhyDrive(PHY_DRIVE_INFO *pPhyDrive, int TryId)
|
|||||||
goto End;
|
goto End;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!TryWritePart2(hDrive, StartSector))
|
bRet = TryWritePart2(hDrive, StartSector);
|
||||||
|
if (FALSE == bRet && Esp2Basic)
|
||||||
|
{
|
||||||
|
Log("TryWritePart2 agagin ...");
|
||||||
|
Sleep(3000);
|
||||||
|
bRet = TryWritePart2(hDrive, StartSector);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!bRet)
|
||||||
{
|
{
|
||||||
if (pPhyDrive->PartStyle == 0)
|
if (pPhyDrive->PartStyle == 0)
|
||||||
{
|
{
|
||||||
ForceMBR = TRUE;
|
if (DiskCheckWriteAccess(hDrive))
|
||||||
|
|
||||||
Log("Try write failed, now delete partition 2 for MBR...");
|
|
||||||
CHECK_CLOSE_HANDLE(hDrive);
|
|
||||||
|
|
||||||
Log("Now delete partition 2...");
|
|
||||||
VDS_DeleteVtoyEFIPartition(pPhyDrive->PhyDrive);
|
|
||||||
|
|
||||||
hDrive = GetPhysicalHandle(pPhyDrive->PhyDrive, TRUE, TRUE, FALSE);
|
|
||||||
if (hDrive == INVALID_HANDLE_VALUE)
|
|
||||||
{
|
{
|
||||||
Log("Failed to GetPhysicalHandle for write.");
|
Log("MBR DiskCheckWriteAccess success");
|
||||||
rc = 1;
|
|
||||||
goto End;
|
ForceMBR = TRUE;
|
||||||
|
|
||||||
|
Log("Try write failed, now delete partition 2 for MBR...");
|
||||||
|
CHECK_CLOSE_HANDLE(hDrive);
|
||||||
|
|
||||||
|
Log("Now delete partition 2...");
|
||||||
|
DISK_DeleteVtoyEFIPartition(pPhyDrive->PhyDrive, StartSector * 512ULL);
|
||||||
|
|
||||||
|
hDrive = GetPhysicalHandle(pPhyDrive->PhyDrive, TRUE, TRUE, FALSE);
|
||||||
|
if (hDrive == INVALID_HANDLE_VALUE)
|
||||||
|
{
|
||||||
|
Log("Failed to GetPhysicalHandle for write.");
|
||||||
|
rc = 1;
|
||||||
|
goto End;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Log("MBR DiskCheckWriteAccess failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -2262,9 +2719,55 @@ int UpdateVentoy2PhyDrive(PHY_DRIVE_INFO *pPhyDrive, int TryId)
|
|||||||
|
|
||||||
if (CleanDisk)
|
if (CleanDisk)
|
||||||
{
|
{
|
||||||
WriteBackupDataToDisk(hDrive, 4 * 512, pBackup + 4 * 512, SIZE_1MB - 4 * 512);
|
if (!WriteBackupDataToDisk(hDrive, 0, pBackup, 34 * 512))
|
||||||
WriteBackupDataToDisk(hDrive, 0, pBackup, 4 * 512);
|
{
|
||||||
|
bWriteBack = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
free(pBackup);
|
free(pBackup);
|
||||||
|
|
||||||
|
if (bWriteBack)
|
||||||
|
{
|
||||||
|
Log("Write backup data success, now delete %s", BackBinFile);
|
||||||
|
DeleteFileA(BackBinFile);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Log("Write backup data failed");
|
||||||
|
}
|
||||||
|
|
||||||
|
Sleep(1000);
|
||||||
|
}
|
||||||
|
else if (DelEFI)
|
||||||
|
{
|
||||||
|
VTOY_GPT_HDR BackupHdr;
|
||||||
|
|
||||||
|
VentoyFillBackupGptHead(pGptBkup, &BackupHdr);
|
||||||
|
if (!WriteBackupDataToDisk(hDrive, 512 * pGptBkup->Head.EfiBackupLBA, (BYTE*)(&BackupHdr), 512))
|
||||||
|
{
|
||||||
|
bWriteBack = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!WriteBackupDataToDisk(hDrive, 512 * (pGptBkup->Head.EfiBackupLBA - 32), (BYTE*)(pGptBkup->PartTbl), 32 * 512))
|
||||||
|
{
|
||||||
|
bWriteBack = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!WriteBackupDataToDisk(hDrive, 512, (BYTE*)pGptBkup + 512, 33 * 512))
|
||||||
|
{
|
||||||
|
bWriteBack = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (bWriteBack)
|
||||||
|
{
|
||||||
|
Log("Write backup partition table success");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Log("Write backup partition table failed");
|
||||||
|
}
|
||||||
|
|
||||||
|
Sleep(1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Refresh Drive Layout
|
//Refresh Drive Layout
|
||||||
@@ -2272,12 +2775,20 @@ int UpdateVentoy2PhyDrive(PHY_DRIVE_INFO *pPhyDrive, int TryId)
|
|||||||
|
|
||||||
End:
|
End:
|
||||||
|
|
||||||
|
if (hVolume != INVALID_HANDLE_VALUE)
|
||||||
|
{
|
||||||
|
bRet = DeviceIoControl(hVolume, FSCTL_UNLOCK_VOLUME, NULL, 0, NULL, 0, &dwSize, NULL);
|
||||||
|
Log("FSCTL_UNLOCK_VOLUME bRet:%u code:%u", bRet, LASTERR);
|
||||||
|
CHECK_CLOSE_HANDLE(hVolume);
|
||||||
|
}
|
||||||
|
|
||||||
if (rc == 0)
|
if (rc == 0)
|
||||||
{
|
{
|
||||||
Log("OK");
|
Log("OK");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
PROGRESS_BAR_SET_POS(PT_LOCK_FOR_CLEAN);
|
||||||
FindProcessOccupyDisk(hDrive, pPhyDrive);
|
FindProcessOccupyDisk(hDrive, pPhyDrive);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2286,24 +2797,24 @@ End:
|
|||||||
if (Esp2Basic)
|
if (Esp2Basic)
|
||||||
{
|
{
|
||||||
Log("Recover GPT partition type to basic");
|
Log("Recover GPT partition type to basic");
|
||||||
VDS_ChangeVtoyEFI2Basic(pPhyDrive->PhyDrive, StartSector * 512);
|
DISK_ChangeVtoyEFI2Basic(pPhyDrive->PhyDrive, StartSector * 512);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pPhyDrive->PartStyle == 1)
|
if (pPhyDrive->PartStyle == 1)
|
||||||
{
|
{
|
||||||
if (ChangeAttr || ((pPhyDrive->Part2GPTAttr >> 56) != 0xC0))
|
if (ChangeAttr || ((pPhyDrive->Part2GPTAttr >> 56) != 0xC0))
|
||||||
{
|
|
||||||
Log("Change EFI partition attr %u <0x%llx> to <0x%llx>", ChangeAttr, pPhyDrive->Part2GPTAttr, 0xC000000000000001ULL);
|
|
||||||
if (VDS_ChangeVtoyEFIAttr(pPhyDrive->PhyDrive, 0xC000000000000001ULL))
|
|
||||||
{
|
{
|
||||||
Log("Change EFI partition attr success");
|
Log("Change EFI partition attr %u <0x%llx> to <0x%llx>", ChangeAttr, pPhyDrive->Part2GPTAttr, 0xC000000000000001ULL);
|
||||||
pPhyDrive->Part2GPTAttr = 0xC000000000000001ULL;
|
if (DISK_ChangeVtoyEFIAttr(pPhyDrive->PhyDrive, StartSector * 512ULL, 0xC000000000000001ULL))
|
||||||
|
{
|
||||||
|
Log("Change EFI partition attr success");
|
||||||
|
pPhyDrive->Part2GPTAttr = 0xC000000000000001ULL;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Log("Change EFI partition attr failed");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
Log("Change EFI partition attr failed");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pGptInfo)
|
if (pGptInfo)
|
||||||
|
@@ -73,6 +73,17 @@ void Log(const char *Fmt, ...)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char* GUID2String(void *guid, char *buf, int len)
|
||||||
|
{
|
||||||
|
GUID* pGUID = (GUID*)guid;
|
||||||
|
sprintf_s(buf, len, "{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
|
||||||
|
pGUID->Data1, pGUID->Data2, pGUID->Data3,
|
||||||
|
pGUID->Data4[0], pGUID->Data4[1],
|
||||||
|
pGUID->Data4[2], pGUID->Data4[3], pGUID->Data4[4], pGUID->Data4[5], pGUID->Data4[6], pGUID->Data4[7]
|
||||||
|
);
|
||||||
|
return buf;
|
||||||
|
}
|
||||||
|
|
||||||
BOOL IsPathExist(BOOL Dir, const char *Fmt, ...)
|
BOOL IsPathExist(BOOL Dir, const char *Fmt, ...)
|
||||||
{
|
{
|
||||||
va_list Arg;
|
va_list Arg;
|
||||||
@@ -231,6 +242,7 @@ BOOL IsWow64(void)
|
|||||||
typedef BOOL(WINAPI *LPFN_ISWOW64PROCESS)(HANDLE, PBOOL);
|
typedef BOOL(WINAPI *LPFN_ISWOW64PROCESS)(HANDLE, PBOOL);
|
||||||
LPFN_ISWOW64PROCESS fnIsWow64Process;
|
LPFN_ISWOW64PROCESS fnIsWow64Process;
|
||||||
BOOL bIsWow64 = FALSE;
|
BOOL bIsWow64 = FALSE;
|
||||||
|
CHAR Wow64Dir[MAX_PATH];
|
||||||
|
|
||||||
fnIsWow64Process = (LPFN_ISWOW64PROCESS)GetProcAddress(GetModuleHandleA("kernel32"), "IsWow64Process");
|
fnIsWow64Process = (LPFN_ISWOW64PROCESS)GetProcAddress(GetModuleHandleA("kernel32"), "IsWow64Process");
|
||||||
if (NULL != fnIsWow64Process)
|
if (NULL != fnIsWow64Process)
|
||||||
@@ -238,6 +250,15 @@ BOOL IsWow64(void)
|
|||||||
fnIsWow64Process(GetCurrentProcess(), &bIsWow64);
|
fnIsWow64Process(GetCurrentProcess(), &bIsWow64);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!bIsWow64)
|
||||||
|
{
|
||||||
|
if (GetSystemWow64DirectoryA(Wow64Dir, sizeof(Wow64Dir)))
|
||||||
|
{
|
||||||
|
Log("GetSystemWow64DirectoryA=<%s>", Wow64Dir);
|
||||||
|
bIsWow64 = TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return bIsWow64;
|
return bIsWow64;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -267,69 +288,93 @@ static const char* GetEdition(DWORD ProductType)
|
|||||||
// From: https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getproductinfo
|
// From: https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getproductinfo
|
||||||
// These values can be found in the winnt.h header.
|
// These values can be found in the winnt.h header.
|
||||||
switch (ProductType) {
|
switch (ProductType) {
|
||||||
case 0x00000000: return ""; // Undefined
|
case 0x00000000: return ""; // Undefined
|
||||||
case 0x00000001: return "Ultimate";
|
case 0x00000001: return "Ultimate";
|
||||||
case 0x00000002: return "Home Basic";
|
case 0x00000002: return "Home Basic";
|
||||||
case 0x00000003: return "Home Premium";
|
case 0x00000003: return "Home Premium";
|
||||||
case 0x00000004: return "Enterprise";
|
case 0x00000004: return "Enterprise";
|
||||||
case 0x00000005: return "Home Basic N";
|
case 0x00000005: return "Home Basic N";
|
||||||
case 0x00000006: return "Business";
|
case 0x00000006: return "Business";
|
||||||
case 0x00000007: return "Standard Server";
|
case 0x00000007: return "Server Standard";
|
||||||
case 0x00000008: return "Datacenter Server";
|
case 0x00000008: return "Server Datacenter";
|
||||||
case 0x00000009: return "Smallbusiness Server";
|
case 0x00000009: return "Smallbusiness Server";
|
||||||
case 0x0000000A: return "Enterprise Server";
|
case 0x0000000A: return "Server Enterprise";
|
||||||
case 0x0000000B: return "Starter";
|
case 0x0000000B: return "Starter";
|
||||||
case 0x00000010: return "Business N";
|
case 0x0000000C: return "Server Datacenter (Core)";
|
||||||
case 0x00000011: return "Web Server";
|
case 0x0000000D: return "Server Standard (Core)";
|
||||||
case 0x00000012: return "Cluster Server";
|
case 0x0000000E: return "Server Enterprise (Core)";
|
||||||
case 0x00000013: return "Home Server";
|
case 0x00000010: return "Business N";
|
||||||
case 0x0000001A: return "Home Premium N";
|
case 0x00000011: return "Web Server";
|
||||||
case 0x0000001B: return "Enterprise N";
|
case 0x00000012: return "HPC Edition";
|
||||||
case 0x0000001C: return "Ultimate N";
|
case 0x00000013: return "Storage Server (Essentials)";
|
||||||
case 0x00000022: return "Home Premium Server";
|
case 0x0000001A: return "Home Premium N";
|
||||||
case 0x0000002F: return "Starter N";
|
case 0x0000001B: return "Enterprise N";
|
||||||
case 0x00000030: return "Pro";
|
case 0x0000001C: return "Ultimate N";
|
||||||
case 0x00000031: return "Pro N";
|
case 0x00000022: return "Home Server";
|
||||||
case 0x00000042: return "Starter E";
|
case 0x00000024: return "Server Standard without Hyper-V";
|
||||||
case 0x00000043: return "Home Basic E";
|
case 0x00000025: return "Server Datacenter without Hyper-V";
|
||||||
case 0x00000044: return "Premium E";
|
case 0x00000026: return "Server Enterprise without Hyper-V";
|
||||||
case 0x00000045: return "Pro E";
|
case 0x00000027: return "Server Datacenter without Hyper-V (Core)";
|
||||||
case 0x00000046: return "Enterprise E";
|
case 0x00000028: return "Server Standard without Hyper-V (Core)";
|
||||||
case 0x00000047: return "Ultimate E";
|
case 0x00000029: return "Server Enterprise without Hyper-V (Core)";
|
||||||
case 0x00000048: return "Enterprise Eval";
|
case 0x0000002A: return "Hyper-V Server";
|
||||||
case 0x00000054: return "Enterprise N Eval";
|
case 0x0000002F: return "Starter N";
|
||||||
case 0x00000057: return "Thin PC";
|
case 0x00000030: return "Pro";
|
||||||
case 0x0000006F: return "Core Connected";
|
case 0x00000031: return "Pro N";
|
||||||
case 0x00000070: return "Pro Student";
|
case 0x00000034: return "Server Solutions Premium";
|
||||||
case 0x00000071: return "Core Connected N";
|
case 0x00000035: return "Server Solutions Premium (Core)";
|
||||||
case 0x00000072: return "Pro Student N";
|
case 0x00000040: return "Server Hyper Core V";
|
||||||
case 0x00000073: return "Core Connected Single Language";
|
case 0x00000042: return "Starter E";
|
||||||
case 0x00000074: return "Core Connected China";
|
case 0x00000043: return "Home Basic E";
|
||||||
case 0x00000079: return "Edu";
|
case 0x00000044: return "Premium E";
|
||||||
case 0x0000007A: return "Edu N";
|
case 0x00000045: return "Pro E";
|
||||||
case 0x0000007D: return "Enterprise S";
|
case 0x00000046: return "Enterprise E";
|
||||||
case 0x0000007E: return "Enterprise S N";
|
case 0x00000047: return "Ultimate E";
|
||||||
case 0x0000007F: return "Pro S";
|
case 0x00000048: return "Enterprise (Eval)";
|
||||||
case 0x00000080: return "Pro S N";
|
case 0x0000004F: return "Server Standard (Eval)";
|
||||||
case 0x00000081: return "Enterprise S Eval";
|
case 0x00000050: return "Server Datacenter (Eval)";
|
||||||
case 0x00000082: return "Enterprise S N Eval";
|
case 0x00000054: return "Enterprise N (Eval)";
|
||||||
case 0x0000008A: return "Pro Single Language";
|
case 0x00000057: return "Thin PC";
|
||||||
case 0x0000008B: return "Pro China";
|
case 0x00000058: case 0x00000059: case 0x0000005A: case 0x0000005B: case 0x0000005C: return "Embedded";
|
||||||
case 0x0000008C: return "Enterprise Subscription";
|
case 0x00000062: return "Home N";
|
||||||
case 0x0000008D: return "Enterprise Subscription N";
|
case 0x00000063: return "Home China";
|
||||||
case 0x00000095: return "Utility VM";
|
case 0x00000064: return "Home Single Language";
|
||||||
case 0x000000A1: return "Pro Workstation";
|
case 0x00000065: return "Home";
|
||||||
case 0x000000A2: return "Pro Workstation N";
|
case 0x00000067: return "Pro with Media Center";
|
||||||
case 0x000000A4: return "Pro for Education";
|
case 0x00000069: case 0x0000006A: case 0x0000006B: case 0x0000006C: return "Embedded";
|
||||||
case 0x000000A5: return "Pro for Education N";
|
case 0x0000006F: return "Home Connected";
|
||||||
case 0x000000AB: return "Enterprise G"; // I swear Microsoft are just making up editions...
|
case 0x00000070: return "Pro Student";
|
||||||
case 0x000000AC: return "Enterprise G N";
|
case 0x00000071: return "Home Connected N";
|
||||||
case 0x000000B6: return "Core OS";
|
case 0x00000072: return "Pro Student N";
|
||||||
case 0x000000B7: return "Cloud E";
|
case 0x00000073: return "Home Connected Single Language";
|
||||||
case 0x000000B8: return "Cloud E N";
|
case 0x00000074: return "Home Connected China";
|
||||||
case 0x000000BD: return "Lite";
|
case 0x00000079: return "Education";
|
||||||
case 0xABCDABCD: return "(Unlicensed)";
|
case 0x0000007A: return "Education N";
|
||||||
default: return "(Unknown Edition)";
|
case 0x0000007D: return "Enterprise LTSB";
|
||||||
|
case 0x0000007E: return "Enterprise LTSB N";
|
||||||
|
case 0x0000007F: return "Pro S";
|
||||||
|
case 0x00000080: return "Pro S N";
|
||||||
|
case 0x00000081: return "Enterprise LTSB (Eval)";
|
||||||
|
case 0x00000082: return "Enterprise LTSB N (Eval)";
|
||||||
|
case 0x0000008A: return "Pro Single Language";
|
||||||
|
case 0x0000008B: return "Pro China";
|
||||||
|
case 0x0000008C: return "Enterprise Subscription";
|
||||||
|
case 0x0000008D: return "Enterprise Subscription N";
|
||||||
|
case 0x00000091: return "Server Datacenter SA (Core)";
|
||||||
|
case 0x00000092: return "Server Standard SA (Core)";
|
||||||
|
case 0x00000095: return "Utility VM";
|
||||||
|
case 0x000000A1: return "Pro for Workstations";
|
||||||
|
case 0x000000A2: return "Pro for Workstations N";
|
||||||
|
case 0x000000A4: return "Pro for Education";
|
||||||
|
case 0x000000A5: return "Pro for Education N";
|
||||||
|
case 0x000000AB: return "Enterprise G"; // I swear Microsoft are just making up editions...
|
||||||
|
case 0x000000AC: return "Enterprise G N";
|
||||||
|
case 0x000000B6: return "Home OS";
|
||||||
|
case 0x000000B7: return "Cloud E";
|
||||||
|
case 0x000000B8: return "Cloud E N";
|
||||||
|
case 0x000000BD: return "Lite";
|
||||||
|
case 0xABCDABCD: return "(Unlicensed)";
|
||||||
|
default: return "(Unknown Edition)";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -559,6 +604,7 @@ void DumpWindowsVersion(void)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
BOOL IsVentoyLogicalDrive(CHAR DriveLetter)
|
BOOL IsVentoyLogicalDrive(CHAR DriveLetter)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
@@ -642,6 +688,7 @@ int VentoyFillMBR(UINT64 DiskSizeBytes, MBR_HEAD *pMBR, int PartStyle)
|
|||||||
Log("Disk signature: 0x%08x", DiskSignature);
|
Log("Disk signature: 0x%08x", DiskSignature);
|
||||||
|
|
||||||
*((UINT32 *)(pMBR->BootCode + 0x1B8)) = DiskSignature;
|
*((UINT32 *)(pMBR->BootCode + 0x1B8)) = DiskSignature;
|
||||||
|
memcpy(pMBR->BootCode + 0x180, &Guid, 16);
|
||||||
|
|
||||||
if (DiskSizeBytes / 512 > 0xFFFFFFFF)
|
if (DiskSizeBytes / 512 > 0xFFFFFFFF)
|
||||||
{
|
{
|
||||||
@@ -718,6 +765,7 @@ static int VentoyFillProtectMBR(UINT64 DiskSizeBytes, MBR_HEAD *pMBR)
|
|||||||
Log("Disk signature: 0x%08x", DiskSignature);
|
Log("Disk signature: 0x%08x", DiskSignature);
|
||||||
|
|
||||||
*((UINT32 *)(pMBR->BootCode + 0x1B8)) = DiskSignature;
|
*((UINT32 *)(pMBR->BootCode + 0x1B8)) = DiskSignature;
|
||||||
|
memcpy(pMBR->BootCode + 0x180, &Guid, 16);
|
||||||
|
|
||||||
DiskSectorCount = DiskSizeBytes / 512 - 1;
|
DiskSectorCount = DiskSizeBytes / 512 - 1;
|
||||||
if (DiskSectorCount > 0xFFFFFFFF)
|
if (DiskSectorCount > 0xFFFFFFFF)
|
||||||
|
Binary file not shown.
@@ -81,6 +81,8 @@ static BOOL IsVentoyPhyDrive(int PhyDrive, UINT64 SizeBytes, MBR_HEAD *pMBR, UIN
|
|||||||
UINT32 PartStartSector;
|
UINT32 PartStartSector;
|
||||||
UINT32 PartSectorCount;
|
UINT32 PartSectorCount;
|
||||||
CHAR PhyDrivePath[128];
|
CHAR PhyDrivePath[128];
|
||||||
|
CHAR GUIDStr[128];
|
||||||
|
GUID ZeroGuid = { 0 };
|
||||||
VTOY_GPT_INFO *pGpt = NULL;
|
VTOY_GPT_INFO *pGpt = NULL;
|
||||||
|
|
||||||
safe_sprintf(PhyDrivePath, "\\\\.\\PhysicalDrive%d", PhyDrive);
|
safe_sprintf(PhyDrivePath, "\\\\.\\PhysicalDrive%d", PhyDrive);
|
||||||
@@ -108,20 +110,7 @@ static BOOL IsVentoyPhyDrive(int PhyDrive, UINT64 SizeBytes, MBR_HEAD *pMBR, UIN
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < 4; i++)
|
|
||||||
{
|
|
||||||
Log("=========== Partition Table %d ============", i + 1);
|
|
||||||
Log("PartTbl.Active = 0x%x", MBR.PartTbl[i].Active);
|
|
||||||
Log("PartTbl.FsFlag = 0x%x", MBR.PartTbl[i].FsFlag);
|
|
||||||
Log("PartTbl.StartSectorId = %u", MBR.PartTbl[i].StartSectorId);
|
|
||||||
Log("PartTbl.SectorCount = %u", MBR.PartTbl[i].SectorCount);
|
|
||||||
Log("PartTbl.StartHead = %u", MBR.PartTbl[i].StartHead);
|
|
||||||
Log("PartTbl.StartSector = %u", MBR.PartTbl[i].StartSector);
|
|
||||||
Log("PartTbl.StartCylinder = %u", MBR.PartTbl[i].StartCylinder);
|
|
||||||
Log("PartTbl.EndHead = %u", MBR.PartTbl[i].EndHead);
|
|
||||||
Log("PartTbl.EndSector = %u", MBR.PartTbl[i].EndSector);
|
|
||||||
Log("PartTbl.EndCylinder = %u", MBR.PartTbl[i].EndCylinder);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (MBR.PartTbl[0].FsFlag == 0xEE)
|
if (MBR.PartTbl[0].FsFlag == 0xEE)
|
||||||
{
|
{
|
||||||
@@ -147,6 +136,23 @@ static BOOL IsVentoyPhyDrive(int PhyDrive, UINT64 SizeBytes, MBR_HEAD *pMBR, UIN
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < 128; i++)
|
||||||
|
{
|
||||||
|
if (memcmp(&(pGpt->PartTbl[i].PartGuid), &ZeroGuid, sizeof(GUID)) == 0)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
Log("=========== Disk%d GPT Partition %d ============", PhyDrive, i + 1);
|
||||||
|
|
||||||
|
Log("PartTbl.PartType = %s", GUID2String(&pGpt->PartTbl[i].PartType, GUIDStr, sizeof(GUIDStr)));
|
||||||
|
Log("PartTbl.PartGuid = %s", GUID2String(&pGpt->PartTbl[i].PartGuid, GUIDStr, sizeof(GUIDStr)));
|
||||||
|
Log("PartTbl.StartLBA = %llu", (ULONGLONG)pGpt->PartTbl[i].StartLBA);
|
||||||
|
Log("PartTbl.LastLBA = %llu", (ULONGLONG)pGpt->PartTbl[i].LastLBA);
|
||||||
|
Log("PartTbl.Attribute = 0x%llx", pGpt->PartTbl[i].Attr);
|
||||||
|
Log("PartTbl.Name = %S", pGpt->PartTbl[i].Name);
|
||||||
|
}
|
||||||
|
|
||||||
if (memcmp(pGpt->PartTbl[1].Name, L"VTOYEFI", 7 * 2))
|
if (memcmp(pGpt->PartTbl[1].Name, L"VTOYEFI", 7 * 2))
|
||||||
{
|
{
|
||||||
if (pGpt->PartTbl[1].Name[0])
|
if (pGpt->PartTbl[1].Name[0])
|
||||||
@@ -187,6 +193,21 @@ static BOOL IsVentoyPhyDrive(int PhyDrive, UINT64 SizeBytes, MBR_HEAD *pMBR, UIN
|
|||||||
{
|
{
|
||||||
CHECK_CLOSE_HANDLE(hDrive);
|
CHECK_CLOSE_HANDLE(hDrive);
|
||||||
|
|
||||||
|
for (i = 0; i < 4; i++)
|
||||||
|
{
|
||||||
|
Log("=========== Disk%d MBR Partition %d ============", PhyDrive, i + 1);
|
||||||
|
Log("PartTbl.Active = 0x%x", MBR.PartTbl[i].Active);
|
||||||
|
Log("PartTbl.FsFlag = 0x%x", MBR.PartTbl[i].FsFlag);
|
||||||
|
Log("PartTbl.StartSectorId = %u", MBR.PartTbl[i].StartSectorId);
|
||||||
|
Log("PartTbl.SectorCount = %u", MBR.PartTbl[i].SectorCount);
|
||||||
|
Log("PartTbl.StartHead = %u", MBR.PartTbl[i].StartHead);
|
||||||
|
Log("PartTbl.StartSector = %u", MBR.PartTbl[i].StartSector);
|
||||||
|
Log("PartTbl.StartCylinder = %u", MBR.PartTbl[i].StartCylinder);
|
||||||
|
Log("PartTbl.EndHead = %u", MBR.PartTbl[i].EndHead);
|
||||||
|
Log("PartTbl.EndSector = %u", MBR.PartTbl[i].EndSector);
|
||||||
|
Log("PartTbl.EndCylinder = %u", MBR.PartTbl[i].EndCylinder);
|
||||||
|
}
|
||||||
|
|
||||||
if (MBR.PartTbl[0].StartSectorId != 2048)
|
if (MBR.PartTbl[0].StartSectorId != 2048)
|
||||||
{
|
{
|
||||||
Log("Part1 not match %u", MBR.PartTbl[0].StartSectorId);
|
Log("Part1 not match %u", MBR.PartTbl[0].StartSectorId);
|
||||||
@@ -246,7 +267,7 @@ static int FilterPhysicalDrive(PHY_DRIVE_INFO *pDriveList, DWORD DriveCount)
|
|||||||
if (LogDrive & 0x01)
|
if (LogDrive & 0x01)
|
||||||
{
|
{
|
||||||
LogLetter[LetterCount] = Letter;
|
LogLetter[LetterCount] = Letter;
|
||||||
PhyDriveId[LetterCount] = GetPhyDriveByLogicalDrive(Letter);
|
PhyDriveId[LetterCount] = GetPhyDriveByLogicalDrive(Letter, NULL);
|
||||||
|
|
||||||
Log("Logical Drive:%C ===> PhyDrive:%d", LogLetter[LetterCount], PhyDriveId[LetterCount]);
|
Log("Logical Drive:%C ===> PhyDrive:%d", LogLetter[LetterCount], PhyDriveId[LetterCount]);
|
||||||
LetterCount++;
|
LetterCount++;
|
||||||
@@ -332,6 +353,23 @@ PHY_DRIVE_INFO * GetPhyDriveInfoById(int Id)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
PHY_DRIVE_INFO * GetPhyDriveInfoByPhyDrive(int PhyDrive)
|
||||||
|
{
|
||||||
|
DWORD i;
|
||||||
|
for (i = 0; i < g_PhyDriveCount; i++)
|
||||||
|
{
|
||||||
|
if (g_PhyDriveList[i].PhyDrive == PhyDrive)
|
||||||
|
{
|
||||||
|
return g_PhyDriveList + i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int SortPhysicalDrive(PHY_DRIVE_INFO *pDriveList, DWORD DriveCount)
|
int SortPhysicalDrive(PHY_DRIVE_INFO *pDriveList, DWORD DriveCount)
|
||||||
{
|
{
|
||||||
DWORD i, j;
|
DWORD i, j;
|
||||||
@@ -398,5 +436,8 @@ int Ventoy2DiskInit(void)
|
|||||||
int Ventoy2DiskDestroy(void)
|
int Ventoy2DiskDestroy(void)
|
||||||
{
|
{
|
||||||
free(g_PhyDriveList);
|
free(g_PhyDriveList);
|
||||||
|
g_PhyDriveList = NULL;
|
||||||
|
g_PhyDriveCount = 0;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@@ -23,6 +23,7 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#define SIZE_1GB (1024 * 1024 * 1024)
|
||||||
#define SIZE_1MB (1024 * 1024)
|
#define SIZE_1MB (1024 * 1024)
|
||||||
#define SIZE_2MB (2048 * 1024)
|
#define SIZE_2MB (2048 * 1024)
|
||||||
#define VENTOY_EFI_PART_SIZE (32 * SIZE_1MB)
|
#define VENTOY_EFI_PART_SIZE (32 * SIZE_1MB)
|
||||||
@@ -43,6 +44,15 @@
|
|||||||
#define safe_sprintf(dst, fmt, ...) sprintf_s(dst, sizeof(dst), fmt, __VA_ARGS__)
|
#define safe_sprintf(dst, fmt, ...) sprintf_s(dst, sizeof(dst), fmt, __VA_ARGS__)
|
||||||
#define safe_strcpy(dst, src) strcpy_s(dst, sizeof(dst), src)
|
#define safe_strcpy(dst, src) strcpy_s(dst, sizeof(dst), src)
|
||||||
|
|
||||||
|
#define CHECK_FREE(p) \
|
||||||
|
{\
|
||||||
|
if (p)\
|
||||||
|
{\
|
||||||
|
free(p); \
|
||||||
|
(p) = NULL; \
|
||||||
|
}\
|
||||||
|
}
|
||||||
|
|
||||||
#define CHECK_CLOSE_HANDLE(Handle) \
|
#define CHECK_CLOSE_HANDLE(Handle) \
|
||||||
{\
|
{\
|
||||||
if (Handle != INVALID_HANDLE_VALUE) \
|
if (Handle != INVALID_HANDLE_VALUE) \
|
||||||
@@ -155,6 +165,15 @@ typedef struct PHY_DRIVE_INFO
|
|||||||
BOOL SecureBootSupport;
|
BOOL SecureBootSupport;
|
||||||
MBR_HEAD MBR;
|
MBR_HEAD MBR;
|
||||||
UINT64 Part2GPTAttr;
|
UINT64 Part2GPTAttr;
|
||||||
|
|
||||||
|
BOOL ResizeNoShrink;
|
||||||
|
UINT64 ResizeOldPart1Size;
|
||||||
|
CHAR Part1DriveLetter;
|
||||||
|
CHAR ResizeVolumeGuid[64];
|
||||||
|
CHAR FsName[64];
|
||||||
|
UINT64 ResizePart2StartSector;
|
||||||
|
VTOY_GPT_INFO Gpt;
|
||||||
|
|
||||||
}PHY_DRIVE_INFO;
|
}PHY_DRIVE_INFO;
|
||||||
|
|
||||||
typedef enum PROGRESS_POINT
|
typedef enum PROGRESS_POINT
|
||||||
@@ -187,6 +206,8 @@ extern HFONT g_language_normal_font;
|
|||||||
extern HFONT g_language_bold_font;
|
extern HFONT g_language_bold_font;
|
||||||
extern int g_FilterUSB;
|
extern int g_FilterUSB;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void TraceOut(const char *Fmt, ...);
|
void TraceOut(const char *Fmt, ...);
|
||||||
void Log(const char *Fmt, ...);
|
void Log(const char *Fmt, ...);
|
||||||
BOOL IsPathExist(BOOL Dir, const char *Fmt, ...);
|
BOOL IsPathExist(BOOL Dir, const char *Fmt, ...);
|
||||||
@@ -204,13 +225,15 @@ BOOL IsVentoyLogicalDrive(CHAR DriveLetter);
|
|||||||
int GetRegDwordValue(HKEY Key, LPCSTR SubKey, LPCSTR ValueName, DWORD *pValue);
|
int GetRegDwordValue(HKEY Key, LPCSTR SubKey, LPCSTR ValueName, DWORD *pValue);
|
||||||
int GetPhysicalDriveCount(void);
|
int GetPhysicalDriveCount(void);
|
||||||
int GetAllPhysicalDriveInfo(PHY_DRIVE_INFO *pDriveList, DWORD *pDriveCount);
|
int GetAllPhysicalDriveInfo(PHY_DRIVE_INFO *pDriveList, DWORD *pDriveCount);
|
||||||
int GetPhyDriveByLogicalDrive(int DriveLetter);
|
int GetPhyDriveByLogicalDrive(int DriveLetter, UINT64*Offset);
|
||||||
int GetVentoyVerInPhyDrive(const PHY_DRIVE_INFO *pDriveInfo, UINT64 Part2StartSector, CHAR *VerBuf, size_t BufLen, BOOL *pSecureBoot);
|
int GetVentoyVerInPhyDrive(const PHY_DRIVE_INFO *pDriveInfo, UINT64 Part2StartSector, CHAR *VerBuf, size_t BufLen, BOOL *pSecureBoot);
|
||||||
int Ventoy2DiskInit(void);
|
int Ventoy2DiskInit(void);
|
||||||
int Ventoy2DiskDestroy(void);
|
int Ventoy2DiskDestroy(void);
|
||||||
PHY_DRIVE_INFO * GetPhyDriveInfoById(int Id);
|
PHY_DRIVE_INFO * GetPhyDriveInfoById(int Id);
|
||||||
|
PHY_DRIVE_INFO * GetPhyDriveInfoByPhyDrive(int PhyDrive);
|
||||||
int ParseCmdLineOption(LPSTR lpCmdLine);
|
int ParseCmdLineOption(LPSTR lpCmdLine);
|
||||||
int InstallVentoy2PhyDrive(PHY_DRIVE_INFO *pPhyDrive, int PartStyle, int TryId);
|
int InstallVentoy2PhyDrive(PHY_DRIVE_INFO *pPhyDrive, int PartStyle, int TryId);
|
||||||
|
int PartitionResizeForVentoy(PHY_DRIVE_INFO *pPhyDrive);
|
||||||
int UpdateVentoy2PhyDrive(PHY_DRIVE_INFO *pPhyDrive, int TryId);
|
int UpdateVentoy2PhyDrive(PHY_DRIVE_INFO *pPhyDrive, int TryId);
|
||||||
int VentoyFillBackupGptHead(VTOY_GPT_INFO *pInfo, VTOY_GPT_HDR *pHead);
|
int VentoyFillBackupGptHead(VTOY_GPT_INFO *pInfo, VTOY_GPT_HDR *pHead);
|
||||||
int VentoyFillWholeGpt(UINT64 DiskSizeBytes, VTOY_GPT_INFO *pInfo);
|
int VentoyFillWholeGpt(UINT64 DiskSizeBytes, VTOY_GPT_INFO *pInfo);
|
||||||
@@ -230,6 +253,7 @@ int FindProcessOccupyDisk(HANDLE hDrive, PHY_DRIVE_INFO *pPhyDrive);
|
|||||||
int VentoyFillMBRLocation(UINT64 DiskSizeInBytes, UINT32 StartSectorId, UINT32 SectorCount, PART_TABLE *Table);
|
int VentoyFillMBRLocation(UINT64 DiskSizeInBytes, UINT32 StartSectorId, UINT32 SectorCount, PART_TABLE *Table);
|
||||||
int ClearVentoyFromPhyDrive(HWND hWnd, PHY_DRIVE_INFO *pPhyDrive, char *pDrvLetter);
|
int ClearVentoyFromPhyDrive(HWND hWnd, PHY_DRIVE_INFO *pPhyDrive, char *pDrvLetter);
|
||||||
UINT32 VentoyCrc32(void *Buffer, UINT32 Length);
|
UINT32 VentoyCrc32(void *Buffer, UINT32 Length);
|
||||||
|
BOOL PartResizePreCheck(PHY_DRIVE_INFO** ppPhyDrive);
|
||||||
|
|
||||||
#define SET_FILE_POS(pos) \
|
#define SET_FILE_POS(pos) \
|
||||||
liCurrentPosition.QuadPart = pos; \
|
liCurrentPosition.QuadPart = pos; \
|
||||||
@@ -288,12 +312,18 @@ typedef struct {
|
|||||||
#pragma pack()
|
#pragma pack()
|
||||||
extern int __static_assert__[sizeof(VTSI_FOOTER) == 512 ? 1 : -1];
|
extern int __static_assert__[sizeof(VTSI_FOOTER) == 512 ? 1 : -1];
|
||||||
|
|
||||||
|
extern HWND g_DialogHwnd;
|
||||||
|
|
||||||
#define SAFE_FREE(ptr) if (ptr) { free(ptr); (ptr) = NULL; }
|
#define SAFE_FREE(ptr) if (ptr) { free(ptr); (ptr) = NULL; }
|
||||||
int InstallVentoy2FileImage(PHY_DRIVE_INFO *pPhyDrive, int PartStyle);
|
int InstallVentoy2FileImage(PHY_DRIVE_INFO *pPhyDrive, int PartStyle);
|
||||||
void disk_io_set_imghook(FILE *fp, VTSI_SEGMENT *segment, int maxseg, UINT64 data_offset);
|
void disk_io_set_imghook(FILE *fp, VTSI_SEGMENT *segment, int maxseg, UINT64 data_offset);
|
||||||
void disk_io_reset_imghook(int *psegnum, UINT64 *pDataOffset);
|
void disk_io_reset_imghook(int *psegnum, UINT64 *pDataOffset);
|
||||||
|
|
||||||
|
HANDLE GetPhysicalHandle(int Drive, BOOLEAN bLockDrive, BOOLEAN bWriteAccess, BOOLEAN bWriteShare);
|
||||||
|
void InitComboxCtrl(HWND hWnd, int PhyDrive);
|
||||||
|
int disk_io_is_write_error(void);
|
||||||
|
void disk_io_reset_write_error(void);
|
||||||
|
const char* GUID2String(void* guid, char* buf, int len);
|
||||||
|
|
||||||
#define VTSI_SUPPORT 1
|
#define VTSI_SUPPORT 1
|
||||||
|
|
||||||
|
@@ -1,31 +1,95 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<ItemGroup Label="ProjectConfigurations">
|
<ItemGroup Label="ProjectConfigurations">
|
||||||
|
<ProjectConfiguration Include="Debug|ARM">
|
||||||
|
<Configuration>Debug</Configuration>
|
||||||
|
<Platform>ARM</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Debug|ARM64">
|
||||||
|
<Configuration>Debug</Configuration>
|
||||||
|
<Platform>ARM64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
<ProjectConfiguration Include="Debug|Win32">
|
<ProjectConfiguration Include="Debug|Win32">
|
||||||
<Configuration>Debug</Configuration>
|
<Configuration>Debug</Configuration>
|
||||||
<Platform>Win32</Platform>
|
<Platform>Win32</Platform>
|
||||||
</ProjectConfiguration>
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Debug|x64">
|
||||||
|
<Configuration>Debug</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Release|ARM">
|
||||||
|
<Configuration>Release</Configuration>
|
||||||
|
<Platform>ARM</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Release|ARM64">
|
||||||
|
<Configuration>Release</Configuration>
|
||||||
|
<Platform>ARM64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
<ProjectConfiguration Include="Release|Win32">
|
<ProjectConfiguration Include="Release|Win32">
|
||||||
<Configuration>Release</Configuration>
|
<Configuration>Release</Configuration>
|
||||||
<Platform>Win32</Platform>
|
<Platform>Win32</Platform>
|
||||||
</ProjectConfiguration>
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Release|x64">
|
||||||
|
<Configuration>Release</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<PropertyGroup Label="Globals">
|
<PropertyGroup Label="Globals">
|
||||||
<ProjectGuid>{8D231B30-65B1-48A2-A720-F659E61DD390}</ProjectGuid>
|
<ProjectGuid>{8D231B30-65B1-48A2-A720-F659E61DD390}</ProjectGuid>
|
||||||
<Keyword>Win32Proj</Keyword>
|
<Keyword>Win32Proj</Keyword>
|
||||||
<RootNamespace>Ventoy2Disk</RootNamespace>
|
<RootNamespace>Ventoy2Disk</RootNamespace>
|
||||||
|
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||||
<ConfigurationType>Application</ConfigurationType>
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
<UseDebugLibraries>true</UseDebugLibraries>
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
<PlatformToolset>v120</PlatformToolset>
|
<PlatformToolset>v142</PlatformToolset>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v142</PlatformToolset>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v142</PlatformToolset>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v142</PlatformToolset>
|
||||||
<CharacterSet>Unicode</CharacterSet>
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||||
<ConfigurationType>Application</ConfigurationType>
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
<UseDebugLibraries>false</UseDebugLibraries>
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
<PlatformToolset>v120</PlatformToolset>
|
<PlatformToolset>v142</PlatformToolset>
|
||||||
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v142</PlatformToolset>
|
||||||
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v142</PlatformToolset>
|
||||||
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v142</PlatformToolset>
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
<CharacterSet>Unicode</CharacterSet>
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
@@ -35,18 +99,71 @@
|
|||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="PropertySheets">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="PropertySheets">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="PropertySheets">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
<PropertyGroup Label="UserMacros" />
|
<PropertyGroup Label="UserMacros" />
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
<LinkIncremental>true</LinkIncremental>
|
<LinkIncremental>true</LinkIncremental>
|
||||||
<EmbedManifest>true</EmbedManifest>
|
<EmbedManifest>true</EmbedManifest>
|
||||||
<IncludePath>$(ProjectDir)\fat_io_lib\;$(ProjectDir)\xz-embedded-20130513\linux\include;$(ProjectDir)\xz-embedded-20130513\linux\include\linux;$(ProjectDir)\xz-embedded-20130513\userspace;$(ProjectDir)\ff14\source;$(IncludePath)</IncludePath>
|
<IncludePath>$(ProjectDir)\fat_io_lib\;$(ProjectDir)\xz-embedded-20130513\linux\include;$(ProjectDir)\xz-embedded-20130513\linux\include\linux;$(ProjectDir)\xz-embedded-20130513\userspace;$(ProjectDir)\ff14\source;$(IncludePath)</IncludePath>
|
||||||
|
<TargetName>Ventoy2Disk</TargetName>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
||||||
|
<LinkIncremental>true</LinkIncremental>
|
||||||
|
<EmbedManifest>true</EmbedManifest>
|
||||||
|
<IncludePath>$(ProjectDir)\fat_io_lib\;$(ProjectDir)\xz-embedded-20130513\linux\include;$(ProjectDir)\xz-embedded-20130513\linux\include\linux;$(ProjectDir)\xz-embedded-20130513\userspace;$(ProjectDir)\ff14\source;$(IncludePath)</IncludePath>
|
||||||
|
<TargetName>Ventoy2Disk_ARM</TargetName>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
|
||||||
|
<LinkIncremental>true</LinkIncremental>
|
||||||
|
<EmbedManifest>true</EmbedManifest>
|
||||||
|
<IncludePath>$(ProjectDir)\fat_io_lib\;$(ProjectDir)\xz-embedded-20130513\linux\include;$(ProjectDir)\xz-embedded-20130513\linux\include\linux;$(ProjectDir)\xz-embedded-20130513\userspace;$(ProjectDir)\ff14\source;$(IncludePath)</IncludePath>
|
||||||
|
<TargetName>Ventoy2Disk_ARM64</TargetName>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<LinkIncremental>true</LinkIncremental>
|
||||||
|
<EmbedManifest>true</EmbedManifest>
|
||||||
|
<IncludePath>$(ProjectDir)\fat_io_lib\;$(ProjectDir)\xz-embedded-20130513\linux\include;$(ProjectDir)\xz-embedded-20130513\linux\include\linux;$(ProjectDir)\xz-embedded-20130513\userspace;$(ProjectDir)\ff14\source;$(IncludePath)</IncludePath>
|
||||||
|
<TargetName>Ventoy2Disk_X64</TargetName>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
<LinkIncremental>false</LinkIncremental>
|
<LinkIncremental>false</LinkIncremental>
|
||||||
<IncludePath>$(ProjectDir)\fat_io_lib\;$(ProjectDir)\xz-embedded-20130513\linux\include;$(ProjectDir)\xz-embedded-20130513\linux\include\linux;$(ProjectDir)\xz-embedded-20130513\userspace;$(ProjectDir)\ff14\source;$(IncludePath)</IncludePath>
|
<IncludePath>$(ProjectDir)\fat_io_lib\;$(ProjectDir)\xz-embedded-20130513\linux\include;$(ProjectDir)\xz-embedded-20130513\linux\include\linux;$(ProjectDir)\xz-embedded-20130513\userspace;$(ProjectDir)\ff14\source;$(IncludePath)</IncludePath>
|
||||||
|
<TargetName>Ventoy2Disk</TargetName>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||||
|
<LinkIncremental>false</LinkIncremental>
|
||||||
|
<IncludePath>$(ProjectDir)\fat_io_lib\;$(ProjectDir)\xz-embedded-20130513\linux\include;$(ProjectDir)\xz-embedded-20130513\linux\include\linux;$(ProjectDir)\xz-embedded-20130513\userspace;$(ProjectDir)\ff14\source;$(IncludePath)</IncludePath>
|
||||||
|
<TargetName>Ventoy2Disk_ARM</TargetName>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
|
||||||
|
<LinkIncremental>false</LinkIncremental>
|
||||||
|
<IncludePath>$(ProjectDir)\fat_io_lib\;$(ProjectDir)\xz-embedded-20130513\linux\include;$(ProjectDir)\xz-embedded-20130513\linux\include\linux;$(ProjectDir)\xz-embedded-20130513\userspace;$(ProjectDir)\ff14\source;$(IncludePath)</IncludePath>
|
||||||
|
<TargetName>Ventoy2Disk_ARM64</TargetName>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<LinkIncremental>false</LinkIncremental>
|
||||||
|
<IncludePath>$(ProjectDir)\fat_io_lib\;$(ProjectDir)\xz-embedded-20130513\linux\include;$(ProjectDir)\xz-embedded-20130513\linux\include\linux;$(ProjectDir)\xz-embedded-20130513\userspace;$(ProjectDir)\ff14\source;$(IncludePath)</IncludePath>
|
||||||
|
<TargetName>Ventoy2Disk_X64</TargetName>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
@@ -54,7 +171,7 @@
|
|||||||
</PrecompiledHeader>
|
</PrecompiledHeader>
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<Optimization>Disabled</Optimization>
|
<Optimization>Disabled</Optimization>
|
||||||
<PreprocessorDefinitions>FATFS_INC_FORMAT_SUPPORT=0;STATIC=static;INIT=;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>VTARCH_X86;VTBIT=32;FATFS_INC_FORMAT_SUPPORT=0;STATIC=static;INIT=;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
@@ -64,7 +181,64 @@
|
|||||||
<AdditionalDependencies>version.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>version.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
</Link>
|
</Link>
|
||||||
<Manifest>
|
<Manifest>
|
||||||
<AdditionalManifestFiles>$(ProjectDir)\Res\Ventoy2Disk.manifest %(AdditionalManifestFiles)</AdditionalManifestFiles>
|
<AdditionalManifestFiles>$(ProjectDir)\Res\Ventoy2Disk32.manifest %(AdditionalManifestFiles)</AdditionalManifestFiles>
|
||||||
|
</Manifest>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
||||||
|
<ClCompile>
|
||||||
|
<PrecompiledHeader>
|
||||||
|
</PrecompiledHeader>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<PreprocessorDefinitions>VTARCH_ARM;VTBIT=32;FATFS_INC_FORMAT_SUPPORT=0;STATIC=static;INIT=;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<UACExecutionLevel>RequireAdministrator</UACExecutionLevel>
|
||||||
|
<AdditionalDependencies>version.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
</Link>
|
||||||
|
<Manifest>
|
||||||
|
<AdditionalManifestFiles>$(ProjectDir)\Res\Ventoy2DiskArm.manifest %(AdditionalManifestFiles)</AdditionalManifestFiles>
|
||||||
|
</Manifest>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
|
||||||
|
<ClCompile>
|
||||||
|
<PrecompiledHeader>
|
||||||
|
</PrecompiledHeader>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<PreprocessorDefinitions>VTARCH_ARM64;VTBIT=64;FATFS_INC_FORMAT_SUPPORT=0;STATIC=static;INIT=;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<UACExecutionLevel>RequireAdministrator</UACExecutionLevel>
|
||||||
|
<AdditionalDependencies>version.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
</Link>
|
||||||
|
<Manifest>
|
||||||
|
<AdditionalManifestFiles>$(ProjectDir)\Res\Ventoy2DiskArm64.manifest %(AdditionalManifestFiles)</AdditionalManifestFiles>
|
||||||
|
</Manifest>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<PrecompiledHeader>
|
||||||
|
</PrecompiledHeader>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<PreprocessorDefinitions>VTARCH_X64;VTBIT=64;FATFS_INC_FORMAT_SUPPORT=0;STATIC=static;INIT=;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<UACExecutionLevel>RequireAdministrator</UACExecutionLevel>
|
||||||
|
<AdditionalDependencies>version.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
</Link>
|
||||||
|
<Manifest>
|
||||||
|
<AdditionalManifestFiles>$(ProjectDir)\Res\Ventoy2Disk64.manifest %(AdditionalManifestFiles)</AdditionalManifestFiles>
|
||||||
</Manifest>
|
</Manifest>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
@@ -75,7 +249,7 @@
|
|||||||
<Optimization>MaxSpeed</Optimization>
|
<Optimization>MaxSpeed</Optimization>
|
||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
<PreprocessorDefinitions>FATFS_INC_FORMAT_SUPPORT=0;STATIC=static;INIT=;WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>VTARCH_X86;VTBIT=32;FATFS_INC_FORMAT_SUPPORT=0;STATIC=static;INIT=;WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
@@ -87,11 +261,81 @@
|
|||||||
<AdditionalDependencies>version.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>version.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
</Link>
|
</Link>
|
||||||
<Manifest>
|
<Manifest>
|
||||||
<AdditionalManifestFiles>$(ProjectDir)\Res\Ventoy2Disk.manifest %(AdditionalManifestFiles)</AdditionalManifestFiles>
|
<AdditionalManifestFiles>$(ProjectDir)\Res\Ventoy2Disk32.manifest %(AdditionalManifestFiles)</AdditionalManifestFiles>
|
||||||
|
</Manifest>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<PrecompiledHeader>
|
||||||
|
</PrecompiledHeader>
|
||||||
|
<Optimization>MaxSpeed</Optimization>
|
||||||
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<PreprocessorDefinitions>VTARCH_ARM;VTBIT=32;FATFS_INC_FORMAT_SUPPORT=0;STATIC=static;INIT=;WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<UACExecutionLevel>RequireAdministrator</UACExecutionLevel>
|
||||||
|
<AdditionalDependencies>version.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
</Link>
|
||||||
|
<Manifest>
|
||||||
|
<AdditionalManifestFiles>$(ProjectDir)\Res\Ventoy2DiskArm.manifest %(AdditionalManifestFiles)</AdditionalManifestFiles>
|
||||||
|
</Manifest>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<PrecompiledHeader>
|
||||||
|
</PrecompiledHeader>
|
||||||
|
<Optimization>MaxSpeed</Optimization>
|
||||||
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<PreprocessorDefinitions>VTARCH_ARM64;VTBIT=64;FATFS_INC_FORMAT_SUPPORT=0;STATIC=static;INIT=;WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<UACExecutionLevel>RequireAdministrator</UACExecutionLevel>
|
||||||
|
<AdditionalDependencies>version.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
</Link>
|
||||||
|
<Manifest>
|
||||||
|
<AdditionalManifestFiles>$(ProjectDir)\Res\Ventoy2DiskArm64.manifest %(AdditionalManifestFiles)</AdditionalManifestFiles>
|
||||||
|
</Manifest>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<PrecompiledHeader>
|
||||||
|
</PrecompiledHeader>
|
||||||
|
<Optimization>MaxSpeed</Optimization>
|
||||||
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<PreprocessorDefinitions>VTARCH_X64;VTBIT=64;FATFS_INC_FORMAT_SUPPORT=0;STATIC=static;INIT=;WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<UACExecutionLevel>RequireAdministrator</UACExecutionLevel>
|
||||||
|
<AdditionalDependencies>version.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
</Link>
|
||||||
|
<Manifest>
|
||||||
|
<AdditionalManifestFiles>$(ProjectDir)\Res\Ventoy2Disk64.manifest %(AdditionalManifestFiles)</AdditionalManifestFiles>
|
||||||
</Manifest>
|
</Manifest>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="crc32.c" />
|
<ClCompile Include="crc32.c" />
|
||||||
|
<ClCompile Include="DiskService.c" />
|
||||||
<ClCompile Include="DiskService_diskpart.c" />
|
<ClCompile Include="DiskService_diskpart.c" />
|
||||||
<ClCompile Include="DiskService_vds.c" />
|
<ClCompile Include="DiskService_vds.c" />
|
||||||
<ClCompile Include="DiskService_wmsa.c" />
|
<ClCompile Include="DiskService_wmsa.c" />
|
||||||
|
@@ -90,6 +90,9 @@
|
|||||||
<ClCompile Include="DiskService_wmsa.c">
|
<ClCompile Include="DiskService_wmsa.c">
|
||||||
<Filter>源文件</Filter>
|
<Filter>源文件</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="DiskService.c">
|
||||||
|
<Filter>源文件</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="Ventoy2Disk.h">
|
<ClInclude Include="Ventoy2Disk.h">
|
||||||
|
@@ -6,10 +6,40 @@
|
|||||||
<LocalDebuggerCommandArguments>
|
<LocalDebuggerCommandArguments>
|
||||||
</LocalDebuggerCommandArguments>
|
</LocalDebuggerCommandArguments>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
||||||
<LocalDebuggerWorkingDirectory>C:\share\ventoy-1.0.03</LocalDebuggerWorkingDirectory>
|
<LocalDebuggerWorkingDirectory>C:\share\ventoy-1.0.03</LocalDebuggerWorkingDirectory>
|
||||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||||
|
<LocalDebuggerCommandArguments />
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
|
||||||
|
<LocalDebuggerWorkingDirectory>C:\share\ventoy-1.0.03</LocalDebuggerWorkingDirectory>
|
||||||
|
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||||
|
<LocalDebuggerCommandArguments />
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<LocalDebuggerWorkingDirectory>C:\share\ventoy-1.0.03</LocalDebuggerWorkingDirectory>
|
||||||
|
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||||
|
<LocalDebuggerCommandArguments />
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<LocalDebuggerWorkingDirectory>K:\test\ventoy\ventoy-1.0.57</LocalDebuggerWorkingDirectory>
|
||||||
|
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||||
<LocalDebuggerCommandArguments>
|
<LocalDebuggerCommandArguments>
|
||||||
</LocalDebuggerCommandArguments>
|
</LocalDebuggerCommandArguments>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||||
|
<LocalDebuggerWorkingDirectory>C:\share\ventoy-1.0.03</LocalDebuggerWorkingDirectory>
|
||||||
|
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||||
|
<LocalDebuggerCommandArguments />
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
|
||||||
|
<LocalDebuggerWorkingDirectory>C:\share\ventoy-1.0.03</LocalDebuggerWorkingDirectory>
|
||||||
|
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||||
|
<LocalDebuggerCommandArguments />
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<LocalDebuggerWorkingDirectory>K:\test\ventoy\ventoy-1.0.57</LocalDebuggerWorkingDirectory>
|
||||||
|
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||||
|
<LocalDebuggerCommandArguments />
|
||||||
|
</PropertyGroup>
|
||||||
</Project>
|
</Project>
|
@@ -403,7 +403,7 @@ int vtoy_json_parse(VTOY_JSON *pstJson, const char *szJsonData)
|
|||||||
char *pcNewBuf = NULL;
|
char *pcNewBuf = NULL;
|
||||||
const char *pcEnd = NULL;
|
const char *pcEnd = NULL;
|
||||||
|
|
||||||
uiMemSize = strlen(szJsonData) + 1;
|
uiMemSize = (UINT32)strlen(szJsonData) + 1;
|
||||||
pcNewBuf = (char *)malloc(uiMemSize);
|
pcNewBuf = (char *)malloc(uiMemSize);
|
||||||
if (NULL == pcNewBuf)
|
if (NULL == pcNewBuf)
|
||||||
{
|
{
|
||||||
|
Binary file not shown.
@@ -30,6 +30,20 @@ VTSI_SEGMENT *g_VentoySegment = NULL;
|
|||||||
int g_VentoyMaxSeg = 0;
|
int g_VentoyMaxSeg = 0;
|
||||||
int g_VentoyCurSeg = -1;
|
int g_VentoyCurSeg = -1;
|
||||||
UINT64 g_VentoyDataOffset = 0;
|
UINT64 g_VentoyDataOffset = 0;
|
||||||
|
int g_write_error = 0;
|
||||||
|
int g_error_print_cnt = 0;
|
||||||
|
|
||||||
|
void disk_io_reset_write_error(void)
|
||||||
|
{
|
||||||
|
g_write_error = 0;
|
||||||
|
g_error_print_cnt = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int disk_io_is_write_error(void)
|
||||||
|
{
|
||||||
|
return g_write_error;
|
||||||
|
}
|
||||||
|
|
||||||
void disk_io_set_param(HANDLE Handle, UINT64 SectorCount)
|
void disk_io_set_param(HANDLE Handle, UINT64 SectorCount)
|
||||||
{
|
{
|
||||||
@@ -248,9 +262,15 @@ DRESULT disk_write (
|
|||||||
|
|
||||||
bRet = WriteFile(g_hPhyDrive, buff, count * 512, &dwSize, NULL);
|
bRet = WriteFile(g_hPhyDrive, buff, count * 512, &dwSize, NULL);
|
||||||
|
|
||||||
if (dwSize != count * 512)
|
if ((!bRet) || (dwSize != count * 512))
|
||||||
{
|
{
|
||||||
Log("WriteFile error bRet:%u WriteSize:%u dwSize:%u ErrCode:%u", bRet, count * 512, dwSize, GetLastError());
|
g_write_error = 1;
|
||||||
|
g_error_print_cnt++;
|
||||||
|
|
||||||
|
if (g_error_print_cnt <= 10)
|
||||||
|
{
|
||||||
|
Log("WriteFile error bRet:%u WriteSize:%u dwSize:%u ErrCode:%u", bRet, count * 512, dwSize, GetLastError());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return RES_OK;
|
return RES_OK;
|
||||||
|
@@ -365,11 +365,12 @@ if ((pf##proc == NULL) && (NT_SUCCESS(status))) status = STATUS_NOT_IMPLEMENTED;
|
|||||||
#define GB 1073741824LL
|
#define GB 1073741824LL
|
||||||
#define TB 1099511627776LL
|
#define TB 1099511627776LL
|
||||||
|
|
||||||
|
#ifndef _WINTERNL_
|
||||||
typedef struct _CLIENT_ID {
|
typedef struct _CLIENT_ID {
|
||||||
HANDLE UniqueProcess;
|
HANDLE UniqueProcess;
|
||||||
HANDLE UniqueThread;
|
HANDLE UniqueThread;
|
||||||
} CLIENT_ID;
|
} CLIENT_ID;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -302,7 +302,7 @@ int INIT unxz(unsigned char *in, int in_size,
|
|||||||
do {
|
do {
|
||||||
if (b.in_pos == b.in_size && fill != NULL) {
|
if (b.in_pos == b.in_size && fill != NULL) {
|
||||||
if (in_used != NULL)
|
if (in_used != NULL)
|
||||||
*in_used += b.in_pos;
|
*in_used += (int)(b.in_pos);
|
||||||
|
|
||||||
b.in_pos = 0;
|
b.in_pos = 0;
|
||||||
|
|
||||||
@@ -329,7 +329,7 @@ int INIT unxz(unsigned char *in, int in_size,
|
|||||||
* returned by xz_dec_run(), but probably
|
* returned by xz_dec_run(), but probably
|
||||||
* it's not too bad.
|
* it's not too bad.
|
||||||
*/
|
*/
|
||||||
if (flush(b.out, b.out_pos) != (int)b.out_pos)
|
if (flush(b.out, (unsigned int)(b.out_pos)) != (int)b.out_pos)
|
||||||
ret = XZ_BUF_ERROR;
|
ret = XZ_BUF_ERROR;
|
||||||
|
|
||||||
b.out_pos = 0;
|
b.out_pos = 0;
|
||||||
@@ -344,7 +344,7 @@ int INIT unxz(unsigned char *in, int in_size,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (in_used != NULL)
|
if (in_used != NULL)
|
||||||
*in_used += b.in_pos;
|
*in_used += (int)(b.in_pos);
|
||||||
|
|
||||||
xz_dec_end(s);
|
xz_dec_end(s);
|
||||||
|
|
||||||
|
@@ -351,7 +351,7 @@ static bool dict_repeat(struct dictionary *dict, uint32_t *len, uint32_t dist)
|
|||||||
if (dist >= dict->full || dist >= dict->size)
|
if (dist >= dict->full || dist >= dict->size)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
left = min_t(size_t, dict->limit - dict->pos, *len);
|
left = (uint32_t)min_t(size_t, dict->limit - dict->pos, *len);
|
||||||
*len -= left;
|
*len -= left;
|
||||||
|
|
||||||
back = dict->pos - dist - 1;
|
back = dict->pos - dist - 1;
|
||||||
@@ -385,7 +385,7 @@ static void dict_uncompressed(struct dictionary *dict, struct xz_buf *b,
|
|||||||
if (copy_size > *left)
|
if (copy_size > *left)
|
||||||
copy_size = *left;
|
copy_size = *left;
|
||||||
|
|
||||||
*left -= copy_size;
|
*left -= (uint32_t)copy_size;
|
||||||
|
|
||||||
memcpy(dict->buf + dict->pos, b->in + b->in_pos, copy_size);
|
memcpy(dict->buf + dict->pos, b->in + b->in_pos, copy_size);
|
||||||
dict->pos += copy_size;
|
dict->pos += copy_size;
|
||||||
@@ -427,7 +427,7 @@ static uint32_t dict_flush(struct dictionary *dict, struct xz_buf *b)
|
|||||||
|
|
||||||
dict->start = dict->pos;
|
dict->start = dict->pos;
|
||||||
b->out_pos += copy_size;
|
b->out_pos += copy_size;
|
||||||
return copy_size;
|
return (uint32_t)copy_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************
|
/*****************
|
||||||
@@ -854,7 +854,7 @@ static bool lzma2_lzma(struct xz_dec_lzma2 *s, struct xz_buf *b)
|
|||||||
if (tmp > s->lzma2.compressed - s->temp.size)
|
if (tmp > s->lzma2.compressed - s->temp.size)
|
||||||
tmp = s->lzma2.compressed - s->temp.size;
|
tmp = s->lzma2.compressed - s->temp.size;
|
||||||
if (tmp > in_avail)
|
if (tmp > in_avail)
|
||||||
tmp = in_avail;
|
tmp = (uint32_t)in_avail;
|
||||||
|
|
||||||
memcpy(s->temp.buf + s->temp.size, b->in + b->in_pos, tmp);
|
memcpy(s->temp.buf + s->temp.size, b->in + b->in_pos, tmp);
|
||||||
|
|
||||||
@@ -877,10 +877,10 @@ static bool lzma2_lzma(struct xz_dec_lzma2 *s, struct xz_buf *b)
|
|||||||
if (!lzma_main(s) || s->rc.in_pos > s->temp.size + tmp)
|
if (!lzma_main(s) || s->rc.in_pos > s->temp.size + tmp)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
s->lzma2.compressed -= s->rc.in_pos;
|
s->lzma2.compressed -= (uint32_t)(s->rc.in_pos);
|
||||||
|
|
||||||
if (s->rc.in_pos < s->temp.size) {
|
if (s->rc.in_pos < s->temp.size) {
|
||||||
s->temp.size -= s->rc.in_pos;
|
s->temp.size -= (uint32_t)(s->rc.in_pos);
|
||||||
memmove(s->temp.buf, s->temp.buf + s->rc.in_pos,
|
memmove(s->temp.buf, s->temp.buf + s->rc.in_pos,
|
||||||
s->temp.size);
|
s->temp.size);
|
||||||
return true;
|
return true;
|
||||||
@@ -907,7 +907,7 @@ static bool lzma2_lzma(struct xz_dec_lzma2 *s, struct xz_buf *b)
|
|||||||
if (in_avail > s->lzma2.compressed)
|
if (in_avail > s->lzma2.compressed)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
s->lzma2.compressed -= in_avail;
|
s->lzma2.compressed -= (uint32_t)in_avail;
|
||||||
b->in_pos = s->rc.in_pos;
|
b->in_pos = s->rc.in_pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -917,7 +917,7 @@ static bool lzma2_lzma(struct xz_dec_lzma2 *s, struct xz_buf *b)
|
|||||||
in_avail = s->lzma2.compressed;
|
in_avail = s->lzma2.compressed;
|
||||||
|
|
||||||
memcpy(s->temp.buf, b->in + b->in_pos, in_avail);
|
memcpy(s->temp.buf, b->in + b->in_pos, in_avail);
|
||||||
s->temp.size = in_avail;
|
s->temp.size = (uint32_t)in_avail;
|
||||||
b->in_pos += in_avail;
|
b->in_pos += in_avail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
37
vtoycli/build.sh
Normal file
37
vtoycli/build.sh
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
rm -f vtoycli_64
|
||||||
|
rm -f vtoycli_32
|
||||||
|
rm -f vtoycli_aa64
|
||||||
|
rm -f vtoycli_m64e
|
||||||
|
|
||||||
|
SRCS="vtoycli.c vtoyfat.c vtoygpt.c crc32.c partresize.c"
|
||||||
|
|
||||||
|
gcc -specs "/usr/local/musl/lib/musl-gcc.specs" -Os -static -D_FILE_OFFSET_BITS=64 $SRCS -Ifat_io_lib/include fat_io_lib/lib/libfat_io_64.a -o vtoycli_64
|
||||||
|
|
||||||
|
/opt/diet32/bin/diet -Os gcc -D_FILE_OFFSET_BITS=64 -m32 $SRCS -Ifat_io_lib/include fat_io_lib/lib/libfat_io_32.a -o vtoycli_32
|
||||||
|
|
||||||
|
|
||||||
|
#gcc -O2 -D_FILE_OFFSET_BITS=64 $SRCS -Ifat_io_lib/include fat_io_lib/lib/libfat_io_64.a -o vtoycli_64
|
||||||
|
#gcc -m32 -O2 -D_FILE_OFFSET_BITS=64 $SRCS -Ifat_io_lib/include fat_io_lib/lib/libfat_io_32.a -o vtoycli_32
|
||||||
|
|
||||||
|
aarch64-buildroot-linux-uclibc-gcc -static -O2 -D_FILE_OFFSET_BITS=64 $SRCS -Ifat_io_lib/include fat_io_lib/lib/libfat_io_aa64.a -o vtoycli_aa64
|
||||||
|
mips64el-linux-musl-gcc -mips64r2 -mabi=64 -static -O2 -D_FILE_OFFSET_BITS=64 $SRCS -Ifat_io_lib/include fat_io_lib/lib/libfat_io_m64e.a -o vtoycli_m64e
|
||||||
|
|
||||||
|
|
||||||
|
if [ -e vtoycli_64 ] && [ -e vtoycli_32 ] && [ -e vtoycli_aa64 ] && [ -e vtoycli_m64e ]; then
|
||||||
|
echo -e "\n===== success $name =======\n"
|
||||||
|
|
||||||
|
strip --strip-all vtoycli_32
|
||||||
|
strip --strip-all vtoycli_64
|
||||||
|
aarch64-buildroot-linux-uclibc-strip --strip-all vtoycli_aa64
|
||||||
|
mips64el-linux-musl-strip --strip-all vtoycli_m64e
|
||||||
|
|
||||||
|
[ -d ../INSTALL/tool/i386/ ] && mv vtoycli_32 ../INSTALL/tool/i386/vtoycli
|
||||||
|
[ -d ../INSTALL/tool/x86_64/ ] && mv vtoycli_64 ../INSTALL/tool/x86_64/vtoycli
|
||||||
|
[ -d ../INSTALL/tool/aarch64/ ] && mv vtoycli_aa64 ../INSTALL/tool/aarch64/vtoycli
|
||||||
|
[ -d ../INSTALL/tool/mips64el/ ] && mv vtoycli_m64e ../INSTALL/tool/mips64el/vtoycli
|
||||||
|
else
|
||||||
|
echo -e "\n===== failed =======\n"
|
||||||
|
exit 1
|
||||||
|
fi
|
305
vtoycli/crc32.c
Normal file
305
vtoycli/crc32.c
Normal file
@@ -0,0 +1,305 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* vtoygpt.c ---- ventoy gpt util
|
||||||
|
*
|
||||||
|
* 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 <stdio.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
#define VOID void
|
||||||
|
#define CHAR char
|
||||||
|
#define UINT64 unsigned long long
|
||||||
|
#define UINT32 unsigned int
|
||||||
|
#define UINT16 unsigned short
|
||||||
|
#define CHAR16 unsigned short
|
||||||
|
#define UINT8 unsigned char
|
||||||
|
|
||||||
|
UINT32 g_crc_table[256] = {
|
||||||
|
0x00000000,
|
||||||
|
0x77073096,
|
||||||
|
0xEE0E612C,
|
||||||
|
0x990951BA,
|
||||||
|
0x076DC419,
|
||||||
|
0x706AF48F,
|
||||||
|
0xE963A535,
|
||||||
|
0x9E6495A3,
|
||||||
|
0x0EDB8832,
|
||||||
|
0x79DCB8A4,
|
||||||
|
0xE0D5E91E,
|
||||||
|
0x97D2D988,
|
||||||
|
0x09B64C2B,
|
||||||
|
0x7EB17CBD,
|
||||||
|
0xE7B82D07,
|
||||||
|
0x90BF1D91,
|
||||||
|
0x1DB71064,
|
||||||
|
0x6AB020F2,
|
||||||
|
0xF3B97148,
|
||||||
|
0x84BE41DE,
|
||||||
|
0x1ADAD47D,
|
||||||
|
0x6DDDE4EB,
|
||||||
|
0xF4D4B551,
|
||||||
|
0x83D385C7,
|
||||||
|
0x136C9856,
|
||||||
|
0x646BA8C0,
|
||||||
|
0xFD62F97A,
|
||||||
|
0x8A65C9EC,
|
||||||
|
0x14015C4F,
|
||||||
|
0x63066CD9,
|
||||||
|
0xFA0F3D63,
|
||||||
|
0x8D080DF5,
|
||||||
|
0x3B6E20C8,
|
||||||
|
0x4C69105E,
|
||||||
|
0xD56041E4,
|
||||||
|
0xA2677172,
|
||||||
|
0x3C03E4D1,
|
||||||
|
0x4B04D447,
|
||||||
|
0xD20D85FD,
|
||||||
|
0xA50AB56B,
|
||||||
|
0x35B5A8FA,
|
||||||
|
0x42B2986C,
|
||||||
|
0xDBBBC9D6,
|
||||||
|
0xACBCF940,
|
||||||
|
0x32D86CE3,
|
||||||
|
0x45DF5C75,
|
||||||
|
0xDCD60DCF,
|
||||||
|
0xABD13D59,
|
||||||
|
0x26D930AC,
|
||||||
|
0x51DE003A,
|
||||||
|
0xC8D75180,
|
||||||
|
0xBFD06116,
|
||||||
|
0x21B4F4B5,
|
||||||
|
0x56B3C423,
|
||||||
|
0xCFBA9599,
|
||||||
|
0xB8BDA50F,
|
||||||
|
0x2802B89E,
|
||||||
|
0x5F058808,
|
||||||
|
0xC60CD9B2,
|
||||||
|
0xB10BE924,
|
||||||
|
0x2F6F7C87,
|
||||||
|
0x58684C11,
|
||||||
|
0xC1611DAB,
|
||||||
|
0xB6662D3D,
|
||||||
|
0x76DC4190,
|
||||||
|
0x01DB7106,
|
||||||
|
0x98D220BC,
|
||||||
|
0xEFD5102A,
|
||||||
|
0x71B18589,
|
||||||
|
0x06B6B51F,
|
||||||
|
0x9FBFE4A5,
|
||||||
|
0xE8B8D433,
|
||||||
|
0x7807C9A2,
|
||||||
|
0x0F00F934,
|
||||||
|
0x9609A88E,
|
||||||
|
0xE10E9818,
|
||||||
|
0x7F6A0DBB,
|
||||||
|
0x086D3D2D,
|
||||||
|
0x91646C97,
|
||||||
|
0xE6635C01,
|
||||||
|
0x6B6B51F4,
|
||||||
|
0x1C6C6162,
|
||||||
|
0x856530D8,
|
||||||
|
0xF262004E,
|
||||||
|
0x6C0695ED,
|
||||||
|
0x1B01A57B,
|
||||||
|
0x8208F4C1,
|
||||||
|
0xF50FC457,
|
||||||
|
0x65B0D9C6,
|
||||||
|
0x12B7E950,
|
||||||
|
0x8BBEB8EA,
|
||||||
|
0xFCB9887C,
|
||||||
|
0x62DD1DDF,
|
||||||
|
0x15DA2D49,
|
||||||
|
0x8CD37CF3,
|
||||||
|
0xFBD44C65,
|
||||||
|
0x4DB26158,
|
||||||
|
0x3AB551CE,
|
||||||
|
0xA3BC0074,
|
||||||
|
0xD4BB30E2,
|
||||||
|
0x4ADFA541,
|
||||||
|
0x3DD895D7,
|
||||||
|
0xA4D1C46D,
|
||||||
|
0xD3D6F4FB,
|
||||||
|
0x4369E96A,
|
||||||
|
0x346ED9FC,
|
||||||
|
0xAD678846,
|
||||||
|
0xDA60B8D0,
|
||||||
|
0x44042D73,
|
||||||
|
0x33031DE5,
|
||||||
|
0xAA0A4C5F,
|
||||||
|
0xDD0D7CC9,
|
||||||
|
0x5005713C,
|
||||||
|
0x270241AA,
|
||||||
|
0xBE0B1010,
|
||||||
|
0xC90C2086,
|
||||||
|
0x5768B525,
|
||||||
|
0x206F85B3,
|
||||||
|
0xB966D409,
|
||||||
|
0xCE61E49F,
|
||||||
|
0x5EDEF90E,
|
||||||
|
0x29D9C998,
|
||||||
|
0xB0D09822,
|
||||||
|
0xC7D7A8B4,
|
||||||
|
0x59B33D17,
|
||||||
|
0x2EB40D81,
|
||||||
|
0xB7BD5C3B,
|
||||||
|
0xC0BA6CAD,
|
||||||
|
0xEDB88320,
|
||||||
|
0x9ABFB3B6,
|
||||||
|
0x03B6E20C,
|
||||||
|
0x74B1D29A,
|
||||||
|
0xEAD54739,
|
||||||
|
0x9DD277AF,
|
||||||
|
0x04DB2615,
|
||||||
|
0x73DC1683,
|
||||||
|
0xE3630B12,
|
||||||
|
0x94643B84,
|
||||||
|
0x0D6D6A3E,
|
||||||
|
0x7A6A5AA8,
|
||||||
|
0xE40ECF0B,
|
||||||
|
0x9309FF9D,
|
||||||
|
0x0A00AE27,
|
||||||
|
0x7D079EB1,
|
||||||
|
0xF00F9344,
|
||||||
|
0x8708A3D2,
|
||||||
|
0x1E01F268,
|
||||||
|
0x6906C2FE,
|
||||||
|
0xF762575D,
|
||||||
|
0x806567CB,
|
||||||
|
0x196C3671,
|
||||||
|
0x6E6B06E7,
|
||||||
|
0xFED41B76,
|
||||||
|
0x89D32BE0,
|
||||||
|
0x10DA7A5A,
|
||||||
|
0x67DD4ACC,
|
||||||
|
0xF9B9DF6F,
|
||||||
|
0x8EBEEFF9,
|
||||||
|
0x17B7BE43,
|
||||||
|
0x60B08ED5,
|
||||||
|
0xD6D6A3E8,
|
||||||
|
0xA1D1937E,
|
||||||
|
0x38D8C2C4,
|
||||||
|
0x4FDFF252,
|
||||||
|
0xD1BB67F1,
|
||||||
|
0xA6BC5767,
|
||||||
|
0x3FB506DD,
|
||||||
|
0x48B2364B,
|
||||||
|
0xD80D2BDA,
|
||||||
|
0xAF0A1B4C,
|
||||||
|
0x36034AF6,
|
||||||
|
0x41047A60,
|
||||||
|
0xDF60EFC3,
|
||||||
|
0xA867DF55,
|
||||||
|
0x316E8EEF,
|
||||||
|
0x4669BE79,
|
||||||
|
0xCB61B38C,
|
||||||
|
0xBC66831A,
|
||||||
|
0x256FD2A0,
|
||||||
|
0x5268E236,
|
||||||
|
0xCC0C7795,
|
||||||
|
0xBB0B4703,
|
||||||
|
0x220216B9,
|
||||||
|
0x5505262F,
|
||||||
|
0xC5BA3BBE,
|
||||||
|
0xB2BD0B28,
|
||||||
|
0x2BB45A92,
|
||||||
|
0x5CB36A04,
|
||||||
|
0xC2D7FFA7,
|
||||||
|
0xB5D0CF31,
|
||||||
|
0x2CD99E8B,
|
||||||
|
0x5BDEAE1D,
|
||||||
|
0x9B64C2B0,
|
||||||
|
0xEC63F226,
|
||||||
|
0x756AA39C,
|
||||||
|
0x026D930A,
|
||||||
|
0x9C0906A9,
|
||||||
|
0xEB0E363F,
|
||||||
|
0x72076785,
|
||||||
|
0x05005713,
|
||||||
|
0x95BF4A82,
|
||||||
|
0xE2B87A14,
|
||||||
|
0x7BB12BAE,
|
||||||
|
0x0CB61B38,
|
||||||
|
0x92D28E9B,
|
||||||
|
0xE5D5BE0D,
|
||||||
|
0x7CDCEFB7,
|
||||||
|
0x0BDBDF21,
|
||||||
|
0x86D3D2D4,
|
||||||
|
0xF1D4E242,
|
||||||
|
0x68DDB3F8,
|
||||||
|
0x1FDA836E,
|
||||||
|
0x81BE16CD,
|
||||||
|
0xF6B9265B,
|
||||||
|
0x6FB077E1,
|
||||||
|
0x18B74777,
|
||||||
|
0x88085AE6,
|
||||||
|
0xFF0F6A70,
|
||||||
|
0x66063BCA,
|
||||||
|
0x11010B5C,
|
||||||
|
0x8F659EFF,
|
||||||
|
0xF862AE69,
|
||||||
|
0x616BFFD3,
|
||||||
|
0x166CCF45,
|
||||||
|
0xA00AE278,
|
||||||
|
0xD70DD2EE,
|
||||||
|
0x4E048354,
|
||||||
|
0x3903B3C2,
|
||||||
|
0xA7672661,
|
||||||
|
0xD06016F7,
|
||||||
|
0x4969474D,
|
||||||
|
0x3E6E77DB,
|
||||||
|
0xAED16A4A,
|
||||||
|
0xD9D65ADC,
|
||||||
|
0x40DF0B66,
|
||||||
|
0x37D83BF0,
|
||||||
|
0xA9BCAE53,
|
||||||
|
0xDEBB9EC5,
|
||||||
|
0x47B2CF7F,
|
||||||
|
0x30B5FFE9,
|
||||||
|
0xBDBDF21C,
|
||||||
|
0xCABAC28A,
|
||||||
|
0x53B39330,
|
||||||
|
0x24B4A3A6,
|
||||||
|
0xBAD03605,
|
||||||
|
0xCDD70693,
|
||||||
|
0x54DE5729,
|
||||||
|
0x23D967BF,
|
||||||
|
0xB3667A2E,
|
||||||
|
0xC4614AB8,
|
||||||
|
0x5D681B02,
|
||||||
|
0x2A6F2B94,
|
||||||
|
0xB40BBE37,
|
||||||
|
0xC30C8EA1,
|
||||||
|
0x5A05DF1B,
|
||||||
|
0x2D02EF8D
|
||||||
|
};
|
||||||
|
|
||||||
|
UINT32 VtoyCrc32(VOID *Buffer, UINT32 Length)
|
||||||
|
{
|
||||||
|
UINT32 i;
|
||||||
|
UINT8 *Ptr = Buffer;
|
||||||
|
UINT32 Crc = 0xFFFFFFFF;
|
||||||
|
|
||||||
|
for (i = 0; i < Length; i++, Ptr++)
|
||||||
|
{
|
||||||
|
Crc = (Crc >> 8) ^ g_crc_table[(UINT8) Crc ^ *Ptr];
|
||||||
|
}
|
||||||
|
|
||||||
|
return Crc ^ 0xffffffff;
|
||||||
|
}
|
||||||
|
|
35
vtoycli/fat_io_lib/buildlib.sh
Normal file
35
vtoycli/fat_io_lib/buildlib.sh
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
rm -rf include
|
||||||
|
rm -rf lib
|
||||||
|
|
||||||
|
cd release
|
||||||
|
#/opt/diet64/bin/diet -Os gcc -O2 -D_FILE_OFFSET_BITS=64 fat*.c -c
|
||||||
|
gcc -specs "/usr/local/musl/lib/musl-gcc.specs" -O2 -D_FILE_OFFSET_BITS=64 fat*.c -c
|
||||||
|
ar -rc libfat_io_64.a *.o
|
||||||
|
rm -f *.o
|
||||||
|
|
||||||
|
|
||||||
|
gcc -m32 -O2 -D_FILE_OFFSET_BITS=64 fat*.c -c
|
||||||
|
ar -rc libfat_io_32.a *.o
|
||||||
|
rm -f *.o
|
||||||
|
|
||||||
|
|
||||||
|
aarch64-linux-gnu-gcc -O2 -D_FILE_OFFSET_BITS=64 fat*.c -c
|
||||||
|
ar -rc libfat_io_aa64.a *.o
|
||||||
|
rm -f *.o
|
||||||
|
|
||||||
|
|
||||||
|
mips64el-linux-musl-gcc -mips64r2 -mabi=64 -O2 -D_FILE_OFFSET_BITS=64 fat*.c -c
|
||||||
|
ar -rc libfat_io_m64e.a *.o
|
||||||
|
rm -f *.o
|
||||||
|
|
||||||
|
cd -
|
||||||
|
|
||||||
|
|
||||||
|
mkdir lib
|
||||||
|
mkdir include
|
||||||
|
|
||||||
|
mv release/*.a lib/
|
||||||
|
cp -a release/*.h include/
|
||||||
|
|
133
vtoycli/fat_io_lib/include/fat_access.h
Normal file
133
vtoycli/fat_io_lib/include/fat_access.h
Normal file
@@ -0,0 +1,133 @@
|
|||||||
|
#ifndef __FAT_ACCESS_H__
|
||||||
|
#define __FAT_ACCESS_H__
|
||||||
|
|
||||||
|
#include "fat_defs.h"
|
||||||
|
#include "fat_opts.h"
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// Defines
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
#define FAT_INIT_OK 0
|
||||||
|
#define FAT_INIT_MEDIA_ACCESS_ERROR (-1)
|
||||||
|
#define FAT_INIT_INVALID_SECTOR_SIZE (-2)
|
||||||
|
#define FAT_INIT_INVALID_SIGNATURE (-3)
|
||||||
|
#define FAT_INIT_ENDIAN_ERROR (-4)
|
||||||
|
#define FAT_INIT_WRONG_FILESYS_TYPE (-5)
|
||||||
|
#define FAT_INIT_WRONG_PARTITION_TYPE (-6)
|
||||||
|
#define FAT_INIT_STRUCT_PACKING (-7)
|
||||||
|
|
||||||
|
#define FAT_DIR_ENTRIES_PER_SECTOR (FAT_SECTOR_SIZE / FAT_DIR_ENTRY_SIZE)
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// Function Pointers
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
typedef int (*fn_diskio_read) (uint32 sector, uint8 *buffer, uint32 sector_count);
|
||||||
|
typedef int (*fn_diskio_write)(uint32 sector, uint8 *buffer, uint32 sector_count);
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// Structures
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
struct disk_if
|
||||||
|
{
|
||||||
|
// User supplied function pointers for disk IO
|
||||||
|
fn_diskio_read read_media;
|
||||||
|
fn_diskio_write write_media;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Forward declaration
|
||||||
|
struct fat_buffer;
|
||||||
|
|
||||||
|
struct fat_buffer
|
||||||
|
{
|
||||||
|
uint8 sector[FAT_SECTOR_SIZE * FAT_BUFFER_SECTORS];
|
||||||
|
uint32 address;
|
||||||
|
int dirty;
|
||||||
|
uint8 * ptr;
|
||||||
|
|
||||||
|
// Next in chain of sector buffers
|
||||||
|
struct fat_buffer *next;
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef enum eFatType
|
||||||
|
{
|
||||||
|
FAT_TYPE_16,
|
||||||
|
FAT_TYPE_32
|
||||||
|
} tFatType;
|
||||||
|
|
||||||
|
struct fatfs
|
||||||
|
{
|
||||||
|
// Filesystem globals
|
||||||
|
uint8 sectors_per_cluster;
|
||||||
|
uint32 cluster_begin_lba;
|
||||||
|
uint32 rootdir_first_cluster;
|
||||||
|
uint32 rootdir_first_sector;
|
||||||
|
uint32 rootdir_sectors;
|
||||||
|
uint32 fat_begin_lba;
|
||||||
|
uint16 fs_info_sector;
|
||||||
|
uint32 lba_begin;
|
||||||
|
uint32 fat_sectors;
|
||||||
|
uint32 next_free_cluster;
|
||||||
|
uint16 root_entry_count;
|
||||||
|
uint16 reserved_sectors;
|
||||||
|
uint8 num_of_fats;
|
||||||
|
tFatType fat_type;
|
||||||
|
|
||||||
|
// Disk/Media API
|
||||||
|
struct disk_if disk_io;
|
||||||
|
|
||||||
|
// [Optional] Thread Safety
|
||||||
|
void (*fl_lock)(void);
|
||||||
|
void (*fl_unlock)(void);
|
||||||
|
|
||||||
|
// Working buffer
|
||||||
|
struct fat_buffer currentsector;
|
||||||
|
|
||||||
|
// FAT Buffer
|
||||||
|
struct fat_buffer *fat_buffer_head;
|
||||||
|
struct fat_buffer fat_buffers[FAT_BUFFERS];
|
||||||
|
};
|
||||||
|
|
||||||
|
struct fs_dir_list_status
|
||||||
|
{
|
||||||
|
uint32 sector;
|
||||||
|
uint32 cluster;
|
||||||
|
uint8 offset;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct fs_dir_ent
|
||||||
|
{
|
||||||
|
char filename[FATFS_MAX_LONG_FILENAME];
|
||||||
|
uint8 is_dir;
|
||||||
|
uint32 cluster;
|
||||||
|
uint32 size;
|
||||||
|
|
||||||
|
#if FATFS_INC_TIME_DATE_SUPPORT
|
||||||
|
uint16 access_date;
|
||||||
|
uint16 write_time;
|
||||||
|
uint16 write_date;
|
||||||
|
uint16 create_date;
|
||||||
|
uint16 create_time;
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// Prototypes
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
int fatfs_init(struct fatfs *fs);
|
||||||
|
uint32 fatfs_lba_of_cluster(struct fatfs *fs, uint32 Cluster_Number);
|
||||||
|
int fatfs_sector_reader(struct fatfs *fs, uint32 Startcluster, uint32 offset, uint8 *target);
|
||||||
|
int fatfs_sector_read(struct fatfs *fs, uint32 lba, uint8 *target, uint32 count);
|
||||||
|
int fatfs_sector_write(struct fatfs *fs, uint32 lba, uint8 *target, uint32 count);
|
||||||
|
int fatfs_read_sector(struct fatfs *fs, uint32 cluster, uint32 sector, uint8 *target);
|
||||||
|
int fatfs_write_sector(struct fatfs *fs, uint32 cluster, uint32 sector, uint8 *target);
|
||||||
|
void fatfs_show_details(struct fatfs *fs);
|
||||||
|
uint32 fatfs_get_root_cluster(struct fatfs *fs);
|
||||||
|
uint32 fatfs_get_file_entry(struct fatfs *fs, uint32 Cluster, char *nametofind, struct fat_dir_entry *sfEntry);
|
||||||
|
int fatfs_sfn_exists(struct fatfs *fs, uint32 Cluster, char *shortname);
|
||||||
|
int fatfs_update_file_length(struct fatfs *fs, uint32 Cluster, char *shortname, uint32 fileLength);
|
||||||
|
int fatfs_mark_file_deleted(struct fatfs *fs, uint32 Cluster, char *shortname);
|
||||||
|
void fatfs_list_directory_start(struct fatfs *fs, struct fs_dir_list_status *dirls, uint32 StartCluster);
|
||||||
|
int fatfs_list_directory_next(struct fatfs *fs, struct fs_dir_list_status *dirls, struct fs_dir_ent *entry);
|
||||||
|
int fatfs_update_timestamps(struct fat_dir_entry *directoryEntry, int create, int modify, int access);
|
||||||
|
|
||||||
|
#endif
|
13
vtoycli/fat_io_lib/include/fat_cache.h
Normal file
13
vtoycli/fat_io_lib/include/fat_cache.h
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
#ifndef __FAT_CACHE_H__
|
||||||
|
#define __FAT_CACHE_H__
|
||||||
|
|
||||||
|
#include "fat_filelib.h"
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// Prototypes
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
int fatfs_cache_init(struct fatfs *fs, FL_FILE *file);
|
||||||
|
int fatfs_cache_get_next_cluster(struct fatfs *fs, FL_FILE *file, uint32 clusterIdx, uint32 *pNextCluster);
|
||||||
|
int fatfs_cache_set_next_cluster(struct fatfs *fs, FL_FILE *file, uint32 clusterIdx, uint32 nextCluster);
|
||||||
|
|
||||||
|
#endif
|
128
vtoycli/fat_io_lib/include/fat_defs.h
Normal file
128
vtoycli/fat_io_lib/include/fat_defs.h
Normal file
@@ -0,0 +1,128 @@
|
|||||||
|
#ifndef __FAT_DEFS_H__
|
||||||
|
#define __FAT_DEFS_H__
|
||||||
|
|
||||||
|
#include "fat_opts.h"
|
||||||
|
#include "fat_types.h"
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// FAT32 Offsets
|
||||||
|
// Name Offset
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// Boot Sector
|
||||||
|
#define BS_JMPBOOT 0 // Length = 3
|
||||||
|
#define BS_OEMNAME 3 // Length = 8
|
||||||
|
#define BPB_BYTSPERSEC 11 // Length = 2
|
||||||
|
#define BPB_SECPERCLUS 13 // Length = 1
|
||||||
|
#define BPB_RSVDSECCNT 14 // Length = 2
|
||||||
|
#define BPB_NUMFATS 16 // Length = 1
|
||||||
|
#define BPB_ROOTENTCNT 17 // Length = 2
|
||||||
|
#define BPB_TOTSEC16 19 // Length = 2
|
||||||
|
#define BPB_MEDIA 21 // Length = 1
|
||||||
|
#define BPB_FATSZ16 22 // Length = 2
|
||||||
|
#define BPB_SECPERTRK 24 // Length = 2
|
||||||
|
#define BPB_NUMHEADS 26 // Length = 2
|
||||||
|
#define BPB_HIDDSEC 28 // Length = 4
|
||||||
|
#define BPB_TOTSEC32 32 // Length = 4
|
||||||
|
|
||||||
|
// FAT 12/16
|
||||||
|
#define BS_FAT_DRVNUM 36 // Length = 1
|
||||||
|
#define BS_FAT_BOOTSIG 38 // Length = 1
|
||||||
|
#define BS_FAT_VOLID 39 // Length = 4
|
||||||
|
#define BS_FAT_VOLLAB 43 // Length = 11
|
||||||
|
#define BS_FAT_FILSYSTYPE 54 // Length = 8
|
||||||
|
|
||||||
|
// FAT 32
|
||||||
|
#define BPB_FAT32_FATSZ32 36 // Length = 4
|
||||||
|
#define BPB_FAT32_EXTFLAGS 40 // Length = 2
|
||||||
|
#define BPB_FAT32_FSVER 42 // Length = 2
|
||||||
|
#define BPB_FAT32_ROOTCLUS 44 // Length = 4
|
||||||
|
#define BPB_FAT32_FSINFO 48 // Length = 2
|
||||||
|
#define BPB_FAT32_BKBOOTSEC 50 // Length = 2
|
||||||
|
#define BS_FAT32_DRVNUM 64 // Length = 1
|
||||||
|
#define BS_FAT32_BOOTSIG 66 // Length = 1
|
||||||
|
#define BS_FAT32_VOLID 67 // Length = 4
|
||||||
|
#define BS_FAT32_VOLLAB 71 // Length = 11
|
||||||
|
#define BS_FAT32_FILSYSTYPE 82 // Length = 8
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// FAT Types
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
#define FAT_TYPE_FAT12 1
|
||||||
|
#define FAT_TYPE_FAT16 2
|
||||||
|
#define FAT_TYPE_FAT32 3
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// FAT32 Specific Statics
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
#define SIGNATURE_POSITION 510
|
||||||
|
#define SIGNATURE_VALUE 0xAA55
|
||||||
|
#define PARTITION1_TYPECODE_LOCATION 450
|
||||||
|
#define FAT32_TYPECODE1 0x0B
|
||||||
|
#define FAT32_TYPECODE2 0x0C
|
||||||
|
#define PARTITION1_LBA_BEGIN_LOCATION 454
|
||||||
|
#define PARTITION1_SIZE_LOCATION 458
|
||||||
|
|
||||||
|
#define FAT_DIR_ENTRY_SIZE 32
|
||||||
|
#define FAT_SFN_SIZE_FULL 11
|
||||||
|
#define FAT_SFN_SIZE_PARTIAL 8
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// FAT32 File Attributes and Types
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
#define FILE_ATTR_READ_ONLY 0x01
|
||||||
|
#define FILE_ATTR_HIDDEN 0x02
|
||||||
|
#define FILE_ATTR_SYSTEM 0x04
|
||||||
|
#define FILE_ATTR_SYSHID 0x06
|
||||||
|
#define FILE_ATTR_VOLUME_ID 0x08
|
||||||
|
#define FILE_ATTR_DIRECTORY 0x10
|
||||||
|
#define FILE_ATTR_ARCHIVE 0x20
|
||||||
|
#define FILE_ATTR_LFN_TEXT 0x0F
|
||||||
|
#define FILE_HEADER_BLANK 0x00
|
||||||
|
#define FILE_HEADER_DELETED 0xE5
|
||||||
|
#define FILE_TYPE_DIR 0x10
|
||||||
|
#define FILE_TYPE_FILE 0x20
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// Time / Date details
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
#define FAT_TIME_HOURS_SHIFT 11
|
||||||
|
#define FAT_TIME_HOURS_MASK 0x1F
|
||||||
|
#define FAT_TIME_MINUTES_SHIFT 5
|
||||||
|
#define FAT_TIME_MINUTES_MASK 0x3F
|
||||||
|
#define FAT_TIME_SECONDS_SHIFT 0
|
||||||
|
#define FAT_TIME_SECONDS_MASK 0x1F
|
||||||
|
#define FAT_TIME_SECONDS_SCALE 2
|
||||||
|
#define FAT_DATE_YEAR_SHIFT 9
|
||||||
|
#define FAT_DATE_YEAR_MASK 0x7F
|
||||||
|
#define FAT_DATE_MONTH_SHIFT 5
|
||||||
|
#define FAT_DATE_MONTH_MASK 0xF
|
||||||
|
#define FAT_DATE_DAY_SHIFT 0
|
||||||
|
#define FAT_DATE_DAY_MASK 0x1F
|
||||||
|
#define FAT_DATE_YEAR_OFFSET 1980
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// Other Defines
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
#define FAT32_LAST_CLUSTER 0xFFFFFFFF
|
||||||
|
#define FAT32_INVALID_CLUSTER 0xFFFFFFFF
|
||||||
|
|
||||||
|
STRUCT_PACK_BEGIN
|
||||||
|
struct fat_dir_entry STRUCT_PACK
|
||||||
|
{
|
||||||
|
uint8 Name[11];
|
||||||
|
uint8 Attr;
|
||||||
|
uint8 NTRes;
|
||||||
|
uint8 CrtTimeTenth;
|
||||||
|
uint8 CrtTime[2];
|
||||||
|
uint8 CrtDate[2];
|
||||||
|
uint8 LstAccDate[2];
|
||||||
|
uint16 FstClusHI;
|
||||||
|
uint8 WrtTime[2];
|
||||||
|
uint8 WrtDate[2];
|
||||||
|
uint16 FstClusLO;
|
||||||
|
uint32 FileSize;
|
||||||
|
} STRUCT_PACKED;
|
||||||
|
STRUCT_PACK_END
|
||||||
|
|
||||||
|
#endif
|
146
vtoycli/fat_io_lib/include/fat_filelib.h
Normal file
146
vtoycli/fat_io_lib/include/fat_filelib.h
Normal file
@@ -0,0 +1,146 @@
|
|||||||
|
#ifndef __FAT_FILELIB_H__
|
||||||
|
#define __FAT_FILELIB_H__
|
||||||
|
|
||||||
|
#include "fat_opts.h"
|
||||||
|
#include "fat_access.h"
|
||||||
|
#include "fat_list.h"
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// Defines
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
#ifndef SEEK_CUR
|
||||||
|
#define SEEK_CUR 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef SEEK_END
|
||||||
|
#define SEEK_END 2
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef SEEK_SET
|
||||||
|
#define SEEK_SET 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef EOF
|
||||||
|
#define EOF (-1)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// Structures
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
struct sFL_FILE;
|
||||||
|
|
||||||
|
struct cluster_lookup
|
||||||
|
{
|
||||||
|
uint32 ClusterIdx;
|
||||||
|
uint32 CurrentCluster;
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct sFL_FILE
|
||||||
|
{
|
||||||
|
uint32 parentcluster;
|
||||||
|
uint32 startcluster;
|
||||||
|
uint32 bytenum;
|
||||||
|
uint32 filelength;
|
||||||
|
int filelength_changed;
|
||||||
|
char path[FATFS_MAX_LONG_FILENAME];
|
||||||
|
char filename[FATFS_MAX_LONG_FILENAME];
|
||||||
|
uint8 shortfilename[11];
|
||||||
|
|
||||||
|
#ifdef FAT_CLUSTER_CACHE_ENTRIES
|
||||||
|
uint32 cluster_cache_idx[FAT_CLUSTER_CACHE_ENTRIES];
|
||||||
|
uint32 cluster_cache_data[FAT_CLUSTER_CACHE_ENTRIES];
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Cluster Lookup
|
||||||
|
struct cluster_lookup last_fat_lookup;
|
||||||
|
|
||||||
|
// Read/Write sector buffer
|
||||||
|
uint8 file_data_sector[FAT_SECTOR_SIZE];
|
||||||
|
uint32 file_data_address;
|
||||||
|
int file_data_dirty;
|
||||||
|
|
||||||
|
// File fopen flags
|
||||||
|
uint8 flags;
|
||||||
|
#define FILE_READ (1 << 0)
|
||||||
|
#define FILE_WRITE (1 << 1)
|
||||||
|
#define FILE_APPEND (1 << 2)
|
||||||
|
#define FILE_BINARY (1 << 3)
|
||||||
|
#define FILE_ERASE (1 << 4)
|
||||||
|
#define FILE_CREATE (1 << 5)
|
||||||
|
|
||||||
|
struct fat_node list_node;
|
||||||
|
} FL_FILE;
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// Prototypes
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// External
|
||||||
|
void fl_init(void);
|
||||||
|
void fl_attach_locks(void (*lock)(void), void (*unlock)(void));
|
||||||
|
int fl_attach_media(fn_diskio_read rd, fn_diskio_write wr);
|
||||||
|
void fl_shutdown(void);
|
||||||
|
|
||||||
|
// Standard API
|
||||||
|
void* fl_fopen(const char *path, const char *modifiers);
|
||||||
|
void fl_fclose(void *file);
|
||||||
|
int fl_fflush(void *file);
|
||||||
|
int fl_fgetc(void *file);
|
||||||
|
char * fl_fgets(char *s, int n, void *f);
|
||||||
|
int fl_fputc(int c, void *file);
|
||||||
|
int fl_fputs(const char * str, void *file);
|
||||||
|
int fl_fwrite(const void * data, int size, int count, void *file );
|
||||||
|
int fl_fread(void * data, int size, int count, void *file );
|
||||||
|
int fl_fseek(void *file , long offset , int origin );
|
||||||
|
int fl_fgetpos(void *file , uint32 * position);
|
||||||
|
long fl_ftell(void *f);
|
||||||
|
int fl_feof(void *f);
|
||||||
|
int fl_remove(const char * filename);
|
||||||
|
|
||||||
|
// Equivelant dirent.h
|
||||||
|
typedef struct fs_dir_list_status FL_DIR;
|
||||||
|
typedef struct fs_dir_ent fl_dirent;
|
||||||
|
|
||||||
|
FL_DIR* fl_opendir(const char* path, FL_DIR *dir);
|
||||||
|
int fl_readdir(FL_DIR *dirls, fl_dirent *entry);
|
||||||
|
int fl_closedir(FL_DIR* dir);
|
||||||
|
|
||||||
|
// Extensions
|
||||||
|
void fl_listdirectory(const char *path);
|
||||||
|
int fl_createdirectory(const char *path);
|
||||||
|
int fl_is_dir(const char *path);
|
||||||
|
|
||||||
|
int fl_format(uint32 volume_sectors, const char *name);
|
||||||
|
|
||||||
|
// Test hooks
|
||||||
|
#ifdef FATFS_INC_TEST_HOOKS
|
||||||
|
struct fatfs* fl_get_fs(void);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// Stdio file I/O names
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
#ifdef USE_FILELIB_STDIO_COMPAT_NAMES
|
||||||
|
|
||||||
|
#define FILE FL_FILE
|
||||||
|
|
||||||
|
#define fopen(a,b) fl_fopen(a, b)
|
||||||
|
#define fclose(a) fl_fclose(a)
|
||||||
|
#define fflush(a) fl_fflush(a)
|
||||||
|
#define fgetc(a) fl_fgetc(a)
|
||||||
|
#define fgets(a,b,c) fl_fgets(a, b, c)
|
||||||
|
#define fputc(a,b) fl_fputc(a, b)
|
||||||
|
#define fputs(a,b) fl_fputs(a, b)
|
||||||
|
#define fwrite(a,b,c,d) fl_fwrite(a, b, c, d)
|
||||||
|
#define fread(a,b,c,d) fl_fread(a, b, c, d)
|
||||||
|
#define fseek(a,b,c) fl_fseek(a, b, c)
|
||||||
|
#define fgetpos(a,b) fl_fgetpos(a, b)
|
||||||
|
#define ftell(a) fl_ftell(a)
|
||||||
|
#define feof(a) fl_feof(a)
|
||||||
|
#define remove(a) fl_remove(a)
|
||||||
|
#define mkdir(a) fl_createdirectory(a)
|
||||||
|
#define rmdir(a) 0
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
15
vtoycli/fat_io_lib/include/fat_format.h
Normal file
15
vtoycli/fat_io_lib/include/fat_format.h
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
#ifndef __FAT_FORMAT_H__
|
||||||
|
#define __FAT_FORMAT_H__
|
||||||
|
|
||||||
|
#include "fat_defs.h"
|
||||||
|
#include "fat_opts.h"
|
||||||
|
#include "fat_access.h"
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// Prototypes
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
int fatfs_format(struct fatfs *fs, uint32 volume_sectors, const char *name);
|
||||||
|
int fatfs_format_fat16(struct fatfs *fs, uint32 volume_sectors, const char *name);
|
||||||
|
int fatfs_format_fat32(struct fatfs *fs, uint32 volume_sectors, const char *name);
|
||||||
|
|
||||||
|
#endif
|
161
vtoycli/fat_io_lib/include/fat_list.h
Normal file
161
vtoycli/fat_io_lib/include/fat_list.h
Normal file
@@ -0,0 +1,161 @@
|
|||||||
|
#ifndef __FAT_LIST_H__
|
||||||
|
#define __FAT_LIST_H__
|
||||||
|
|
||||||
|
#ifndef FAT_ASSERT
|
||||||
|
#define FAT_ASSERT(x)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef FAT_INLINE
|
||||||
|
#define FAT_INLINE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------
|
||||||
|
// Types
|
||||||
|
//-----------------------------------------------------------------
|
||||||
|
struct fat_list;
|
||||||
|
|
||||||
|
struct fat_node
|
||||||
|
{
|
||||||
|
struct fat_node *previous;
|
||||||
|
struct fat_node *next;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct fat_list
|
||||||
|
{
|
||||||
|
struct fat_node *head;
|
||||||
|
struct fat_node *tail;
|
||||||
|
};
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------
|
||||||
|
// Macros
|
||||||
|
//-----------------------------------------------------------------
|
||||||
|
#define fat_list_entry(p, t, m) p ? ((t *)((char *)(p)-(char*)(&((t *)0)->m))) : 0
|
||||||
|
#define fat_list_next(l, p) (p)->next
|
||||||
|
#define fat_list_prev(l, p) (p)->previous
|
||||||
|
#define fat_list_first(l) (l)->head
|
||||||
|
#define fat_list_last(l) (l)->tail
|
||||||
|
#define fat_list_for_each(l, p) for ((p) = (l)->head; (p); (p) = (p)->next)
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------
|
||||||
|
// Inline Functions
|
||||||
|
//-----------------------------------------------------------------
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------
|
||||||
|
// fat_list_init:
|
||||||
|
//-----------------------------------------------------------------
|
||||||
|
static FAT_INLINE void fat_list_init(struct fat_list *list)
|
||||||
|
{
|
||||||
|
FAT_ASSERT(list);
|
||||||
|
|
||||||
|
list->head = list->tail = 0;
|
||||||
|
}
|
||||||
|
//-----------------------------------------------------------------
|
||||||
|
// fat_list_remove:
|
||||||
|
//-----------------------------------------------------------------
|
||||||
|
static FAT_INLINE void fat_list_remove(struct fat_list *list, struct fat_node *node)
|
||||||
|
{
|
||||||
|
FAT_ASSERT(list);
|
||||||
|
FAT_ASSERT(node);
|
||||||
|
|
||||||
|
if(!node->previous)
|
||||||
|
list->head = node->next;
|
||||||
|
else
|
||||||
|
node->previous->next = node->next;
|
||||||
|
|
||||||
|
if(!node->next)
|
||||||
|
list->tail = node->previous;
|
||||||
|
else
|
||||||
|
node->next->previous = node->previous;
|
||||||
|
}
|
||||||
|
//-----------------------------------------------------------------
|
||||||
|
// fat_list_insert_after:
|
||||||
|
//-----------------------------------------------------------------
|
||||||
|
static FAT_INLINE void fat_list_insert_after(struct fat_list *list, struct fat_node *node, struct fat_node *new_node)
|
||||||
|
{
|
||||||
|
FAT_ASSERT(list);
|
||||||
|
FAT_ASSERT(node);
|
||||||
|
FAT_ASSERT(new_node);
|
||||||
|
|
||||||
|
new_node->previous = node;
|
||||||
|
new_node->next = node->next;
|
||||||
|
if (!node->next)
|
||||||
|
list->tail = new_node;
|
||||||
|
else
|
||||||
|
node->next->previous = new_node;
|
||||||
|
node->next = new_node;
|
||||||
|
}
|
||||||
|
//-----------------------------------------------------------------
|
||||||
|
// fat_list_insert_before:
|
||||||
|
//-----------------------------------------------------------------
|
||||||
|
static FAT_INLINE void fat_list_insert_before(struct fat_list *list, struct fat_node *node, struct fat_node *new_node)
|
||||||
|
{
|
||||||
|
FAT_ASSERT(list);
|
||||||
|
FAT_ASSERT(node);
|
||||||
|
FAT_ASSERT(new_node);
|
||||||
|
|
||||||
|
new_node->previous = node->previous;
|
||||||
|
new_node->next = node;
|
||||||
|
if (!node->previous)
|
||||||
|
list->head = new_node;
|
||||||
|
else
|
||||||
|
node->previous->next = new_node;
|
||||||
|
node->previous = new_node;
|
||||||
|
}
|
||||||
|
//-----------------------------------------------------------------
|
||||||
|
// fat_list_insert_first:
|
||||||
|
//-----------------------------------------------------------------
|
||||||
|
static FAT_INLINE void fat_list_insert_first(struct fat_list *list, struct fat_node *node)
|
||||||
|
{
|
||||||
|
FAT_ASSERT(list);
|
||||||
|
FAT_ASSERT(node);
|
||||||
|
|
||||||
|
if (!list->head)
|
||||||
|
{
|
||||||
|
list->head = node;
|
||||||
|
list->tail = node;
|
||||||
|
node->previous = 0;
|
||||||
|
node->next = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
fat_list_insert_before(list, list->head, node);
|
||||||
|
}
|
||||||
|
//-----------------------------------------------------------------
|
||||||
|
// fat_list_insert_last:
|
||||||
|
//-----------------------------------------------------------------
|
||||||
|
static FAT_INLINE void fat_list_insert_last(struct fat_list *list, struct fat_node *node)
|
||||||
|
{
|
||||||
|
FAT_ASSERT(list);
|
||||||
|
FAT_ASSERT(node);
|
||||||
|
|
||||||
|
if (!list->tail)
|
||||||
|
fat_list_insert_first(list, node);
|
||||||
|
else
|
||||||
|
fat_list_insert_after(list, list->tail, node);
|
||||||
|
}
|
||||||
|
//-----------------------------------------------------------------
|
||||||
|
// fat_list_is_empty:
|
||||||
|
//-----------------------------------------------------------------
|
||||||
|
static FAT_INLINE int fat_list_is_empty(struct fat_list *list)
|
||||||
|
{
|
||||||
|
FAT_ASSERT(list);
|
||||||
|
|
||||||
|
return !list->head;
|
||||||
|
}
|
||||||
|
//-----------------------------------------------------------------
|
||||||
|
// fat_list_pop_head:
|
||||||
|
//-----------------------------------------------------------------
|
||||||
|
static FAT_INLINE struct fat_node * fat_list_pop_head(struct fat_list *list)
|
||||||
|
{
|
||||||
|
struct fat_node * node;
|
||||||
|
|
||||||
|
FAT_ASSERT(list);
|
||||||
|
|
||||||
|
node = fat_list_first(list);
|
||||||
|
if (node)
|
||||||
|
fat_list_remove(list, node);
|
||||||
|
|
||||||
|
return node;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
63
vtoycli/fat_io_lib/include/fat_misc.h
Normal file
63
vtoycli/fat_io_lib/include/fat_misc.h
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
#ifndef __FAT_MISC_H__
|
||||||
|
#define __FAT_MISC_H__
|
||||||
|
|
||||||
|
#include "fat_defs.h"
|
||||||
|
#include "fat_opts.h"
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// Defines
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
#define MAX_LONGFILENAME_ENTRIES 20
|
||||||
|
#define MAX_LFN_ENTRY_LENGTH 13
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// Macros
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
#define GET_32BIT_WORD(buffer, location) ( ((uint32)buffer[location+3]<<24) + ((uint32)buffer[location+2]<<16) + ((uint32)buffer[location+1]<<8) + (uint32)buffer[location+0] )
|
||||||
|
#define GET_16BIT_WORD(buffer, location) ( ((uint16)buffer[location+1]<<8) + (uint16)buffer[location+0] )
|
||||||
|
|
||||||
|
#define SET_32BIT_WORD(buffer, location, value) { buffer[location+0] = (uint8)((value)&0xFF); \
|
||||||
|
buffer[location+1] = (uint8)((value>>8)&0xFF); \
|
||||||
|
buffer[location+2] = (uint8)((value>>16)&0xFF); \
|
||||||
|
buffer[location+3] = (uint8)((value>>24)&0xFF); }
|
||||||
|
|
||||||
|
#define SET_16BIT_WORD(buffer, location, value) { buffer[location+0] = (uint8)((value)&0xFF); \
|
||||||
|
buffer[location+1] = (uint8)((value>>8)&0xFF); }
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// Structures
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
struct lfn_cache
|
||||||
|
{
|
||||||
|
#if FATFS_INC_LFN_SUPPORT
|
||||||
|
// Long File Name Structure (max 260 LFN length)
|
||||||
|
uint8 String[MAX_LONGFILENAME_ENTRIES][MAX_LFN_ENTRY_LENGTH];
|
||||||
|
uint8 Null;
|
||||||
|
#endif
|
||||||
|
uint8 no_of_strings;
|
||||||
|
};
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// Prototypes
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
void fatfs_lfn_cache_init(struct lfn_cache *lfn, int wipeTable);
|
||||||
|
void fatfs_lfn_cache_entry(struct lfn_cache *lfn, uint8 *entryBuffer);
|
||||||
|
char* fatfs_lfn_cache_get(struct lfn_cache *lfn);
|
||||||
|
int fatfs_entry_lfn_text(struct fat_dir_entry *entry);
|
||||||
|
int fatfs_entry_lfn_invalid(struct fat_dir_entry *entry);
|
||||||
|
int fatfs_entry_lfn_exists(struct lfn_cache *lfn, struct fat_dir_entry *entry);
|
||||||
|
int fatfs_entry_sfn_only(struct fat_dir_entry *entry);
|
||||||
|
int fatfs_entry_is_dir(struct fat_dir_entry *entry);
|
||||||
|
int fatfs_entry_is_file(struct fat_dir_entry *entry);
|
||||||
|
int fatfs_lfn_entries_required(char *filename);
|
||||||
|
void fatfs_filename_to_lfn(char *filename, uint8 *buffer, int entry, uint8 sfnChk);
|
||||||
|
void fatfs_sfn_create_entry(char *shortfilename, uint32 size, uint32 startCluster, struct fat_dir_entry *entry, int dir);
|
||||||
|
int fatfs_lfn_create_sfn(char *sfn_output, char *filename);
|
||||||
|
int fatfs_lfn_generate_tail(char *sfn_output, char *sfn_input, uint32 tailNum);
|
||||||
|
void fatfs_convert_from_fat_time(uint16 fat_time, int *hours, int *minutes, int *seconds);
|
||||||
|
void fatfs_convert_from_fat_date(uint16 fat_date, int *day, int *month, int *year);
|
||||||
|
uint16 fatfs_convert_to_fat_time(int hours, int minutes, int seconds);
|
||||||
|
uint16 fatfs_convert_to_fat_date(int day, int month, int year);
|
||||||
|
void fatfs_print_sector(uint32 sector, uint8 *data);
|
||||||
|
|
||||||
|
#endif
|
90
vtoycli/fat_io_lib/include/fat_opts.h
Normal file
90
vtoycli/fat_io_lib/include/fat_opts.h
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
#ifndef __FAT_OPTS_H__
|
||||||
|
#define __FAT_OPTS_H__
|
||||||
|
|
||||||
|
#ifdef FATFS_USE_CUSTOM_OPTS_FILE
|
||||||
|
#include "fat_custom.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//-------------------------------------------------------------
|
||||||
|
// Configuration
|
||||||
|
//-------------------------------------------------------------
|
||||||
|
|
||||||
|
// Is the processor little endian (1) or big endian (0)
|
||||||
|
#ifndef FATFS_IS_LITTLE_ENDIAN
|
||||||
|
#define FATFS_IS_LITTLE_ENDIAN 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Max filename Length
|
||||||
|
#ifndef FATFS_MAX_LONG_FILENAME
|
||||||
|
#define FATFS_MAX_LONG_FILENAME 260
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Max open files (reduce to lower memory requirements)
|
||||||
|
#ifndef FATFS_MAX_OPEN_FILES
|
||||||
|
#define FATFS_MAX_OPEN_FILES 2
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Number of sectors per FAT_BUFFER (min 1)
|
||||||
|
#ifndef FAT_BUFFER_SECTORS
|
||||||
|
#define FAT_BUFFER_SECTORS 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Max FAT sectors to buffer (min 1)
|
||||||
|
// (mem used is FAT_BUFFERS * FAT_BUFFER_SECTORS * FAT_SECTOR_SIZE)
|
||||||
|
#ifndef FAT_BUFFERS
|
||||||
|
#define FAT_BUFFERS 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Size of cluster chain cache (can be undefined)
|
||||||
|
// Mem used = FAT_CLUSTER_CACHE_ENTRIES * 4 * 2
|
||||||
|
// Improves access speed considerably
|
||||||
|
//#define FAT_CLUSTER_CACHE_ENTRIES 128
|
||||||
|
|
||||||
|
// Include support for writing files (1 / 0)?
|
||||||
|
#ifndef FATFS_INC_WRITE_SUPPORT
|
||||||
|
#define FATFS_INC_WRITE_SUPPORT 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Support long filenames (1 / 0)?
|
||||||
|
// (if not (0) only 8.3 format is supported)
|
||||||
|
#ifndef FATFS_INC_LFN_SUPPORT
|
||||||
|
#define FATFS_INC_LFN_SUPPORT 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Support directory listing (1 / 0)?
|
||||||
|
#ifndef FATFS_DIR_LIST_SUPPORT
|
||||||
|
#define FATFS_DIR_LIST_SUPPORT 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Support time/date (1 / 0)?
|
||||||
|
#ifndef FATFS_INC_TIME_DATE_SUPPORT
|
||||||
|
#define FATFS_INC_TIME_DATE_SUPPORT 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Include support for formatting disks (1 / 0)?
|
||||||
|
#ifndef FATFS_INC_FORMAT_SUPPORT
|
||||||
|
#define FATFS_INC_FORMAT_SUPPORT 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Sector size used
|
||||||
|
#define FAT_SECTOR_SIZE 512
|
||||||
|
|
||||||
|
// Printf output (directory listing / debug)
|
||||||
|
#ifndef FAT_PRINTF
|
||||||
|
// Don't include stdio, but there is a printf function available
|
||||||
|
#ifdef FAT_PRINTF_NOINC_STDIO
|
||||||
|
extern int printf(const char* ctrl1, ... );
|
||||||
|
#define FAT_PRINTF(a) printf a
|
||||||
|
// Include stdio to use printf
|
||||||
|
#else
|
||||||
|
#include <stdio.h>
|
||||||
|
#define FAT_PRINTF(a) printf a
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Time/Date support requires time.h
|
||||||
|
#if FATFS_INC_TIME_DATE_SUPPORT
|
||||||
|
#include <time.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
20
vtoycli/fat_io_lib/include/fat_string.h
Normal file
20
vtoycli/fat_io_lib/include/fat_string.h
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
#ifndef __FILESTRING_H__
|
||||||
|
#define __FILESTRING_H__
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// Prototypes
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
int fatfs_total_path_levels(char *path);
|
||||||
|
int fatfs_get_substring(char *Path, int levelreq, char *output, int max_len);
|
||||||
|
int fatfs_split_path(char *FullPath, char *Path, int max_path, char *FileName, int max_filename);
|
||||||
|
int fatfs_compare_names(char* strA, char* strB);
|
||||||
|
int fatfs_string_ends_with_slash(char *path);
|
||||||
|
int fatfs_get_sfn_display_name(char* out, char* in);
|
||||||
|
int fatfs_get_extension(char* filename, char* out, int maxlen);
|
||||||
|
int fatfs_create_path_string(char* path, char *filename, char* out, int maxlen);
|
||||||
|
|
||||||
|
#ifndef NULL
|
||||||
|
#define NULL 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user