diff --git a/.github/ISSUE_TEMPLATE/issue_template.yml b/.github/ISSUE_TEMPLATE/issue_template.yml index 8c0dd60e25e..caca810bbbc 100644 --- a/.github/ISSUE_TEMPLATE/issue_template.yml +++ b/.github/ISSUE_TEMPLATE/issue_template.yml @@ -14,7 +14,7 @@ body: label: Official FAQ description: Have you checked the official FAQ at [https://www.ventoy.net/en/faq.html](https://www.ventoy.net/en/faq.html) ? options: - - label: I have checked the official FAQ. + - label: I have checked the official FAQ. required: true - type: input id: version @@ -77,7 +77,7 @@ body: id: vendor attributes: label: Disk Manufacturer - description: What is the manufacturer of the disk installed with Ventoy? (e.g. SanDisk/Kingston...) + description: What is the manufacturer of the disk installed with Ventoy? (e.g. SanDisk/Kingston...) validations: required: false - type: dropdown @@ -87,7 +87,7 @@ body: description: Have you checked the image file in Ventoy's menu as [https://www.ventoy.net/en/faq.html#faq_boot_checksum](https://www.ventoy.net/en/faq.html#faq_boot_checksum) ? options: - Yes. - - No. + - No. validations: required: false - type: input diff --git a/.github/ISSUE_TEMPLATE/success_image_report.yml b/.github/ISSUE_TEMPLATE/success_image_report.yml index 7dda0ef350b..3bd16011a84 100644 --- a/.github/ISSUE_TEMPLATE/success_image_report.yml +++ b/.github/ISSUE_TEMPLATE/success_image_report.yml @@ -7,7 +7,7 @@ body: - type: markdown attributes: value: | - I list all the successfully tested image files in the official website: https://www.ventoy.net/en/isolist.html + 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 @@ -15,7 +15,7 @@ body: 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. + - label: I have checked the list in official website and the image file is not listed there. required: true - type: input id: version @@ -58,12 +58,12 @@ body: id: checksum attributes: label: Image file checksum type - description: + description: options: - MD5 - - SHA1 - - SHA256 - - SHA512 + - SHA1 + - SHA256 + - SHA512 validations: required: true - type: input diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c626a91c0f6..61062806ff7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,7 +5,7 @@ on: branches: [ master ] pull_request: branches: [ master ] - + workflow_dispatch: jobs: diff --git a/BLOB_List.md b/BLOB_List.md index b5c82f6a335..b30c902990a 100644 --- a/BLOB_List.md +++ b/BLOB_List.md @@ -45,13 +45,13 @@ ./IMG/cpio_x86/ventoy/tool/lz4cat64 build Build Instructions:
./LZIP/buildlz4.txt ./IMG/cpio_x86/ventoy/tool/zstdcat build Same with ./ZSTD/zstdcat
Check the file hash to confirm ./IMG/cpio_x86/ventoy/tool/zstdcat64 build Same with ./ZSTD/zstdcat64
Check the file hash to confirm - ./INSTALL/EFI/BOOT/BOOTAA64.EFI build Build Instructions:
./DOC/BuildVentoyFromSource.txt 4.1-Build grub2 - ./INSTALL/EFI/BOOT/BOOTMIPS.EFI + ./INSTALL/EFI/BOOT/BOOTAA64.EFI build Build Instructions:
./DOC/BuildVentoyFromSource.txt 4.1-Build grub2 + ./INSTALL/EFI/BOOT/BOOTMIPS.EFI ./INSTALL/EFI/BOOT/grubia32_real.efi ./INSTALL/EFI/BOOT/grubx64_real.efi - ./INSTALL/EFI/BOOT/grub.efi upstream https://github.com/ValdikSS/Super-UEFIinSecureBoot-Disk - ./INSTALL/EFI/BOOT/BOOTIA32.EFI - ./INSTALL/EFI/BOOT/BOOTX64.EFI + ./INSTALL/EFI/BOOT/grub.efi upstream https://github.com/ValdikSS/Super-UEFIinSecureBoot-Disk + ./INSTALL/EFI/BOOT/BOOTIA32.EFI + ./INSTALL/EFI/BOOT/BOOTX64.EFI ./INSTALL/EFI/BOOT/grubia32.efi ./INSTALL/EFI/BOOT/mmia32.efi ./INSTALL/EFI/BOOT/MokManager.efi @@ -92,7 +92,7 @@ ./INSTALL/tool/mips64el/mkexfatfs ./INSTALL/tool/mips64el/mount.exfat-fuse ./INSTALL/tool/x86_64/mkexfatfs - ./INSTALL/tool/x86_64/mount.exfat-fuse + ./INSTALL/tool/x86_64/mount.exfat-fuse ./INSTALL/tool/aarch64/vlnk build Build Instructions:
./Vlnk/build.sh ./INSTALL/tool/i386/vlnk ./INSTALL/tool/mips64el/vlnk @@ -130,7 +130,7 @@ ./INSTALL/ventoy/vtoyutil_ia32.efi ./INSTALL/ventoy/vtoyutil_x64.efi ./INSTALL/ventoy/ipxe.krn build Build Instructions:
./IPXE/buildipxe.sh - ./INSTALL/ventoy/memdisk upstream Download from syslinux project.
URL & File Hash documented in
./DOC/BuildVentoyFromSource.txt 5.9 + ./INSTALL/ventoy/memdisk upstream Download from syslinux project.
URL & File Hash documented in
./DOC/BuildVentoyFromSource.txt 5.9 ./LiveCD/ISO/EFI/boot/vmlinuz64 upstream Download from TinyLinux website.
URL & File Hash documented in
./DOC/BuildVentoyFromSource.txt 5.14 ./LiveCDGUI/EXT/busybox-x86_64 build Same with ./IMG/cpio_x86/ventoy/busybox/busybox64
Check the file hash to confirm ./LiveCDGUI/GRUB/bootx64.efi build ./DOC/BuildVentoyFromSource.txt 4.1-Build grub2 @@ -166,11 +166,11 @@ ./IMG/cpio_x86/ventoy/busybox/xzcat32_musl ./IMG/cpio_x86/ventoy/busybox/xzcat64_musl ./IMG/cpio_arm64/ventoy/busybox/busyboxaa64 - ./IMG/cpio_mips64/ventoy/busybox/busyboxm64e + ./IMG/cpio_mips64/ventoy/busybox/busyboxm64e ISNTALL/ventoy/7z/64/7za.exe upstream Download from 7z project.
URL & File Hash documented in
./DOC/BuildVentoyFromSource.txt 5.12 - ISNTALL/ventoy/7z/32/7za.exe + ISNTALL/ventoy/7z/32/7za.exe ./INSTALL/ventoy/wimboot.i386.efi build Build Instructions:
./wimboot/build.sh - ./INSTALL/ventoy/wimboot.x86_64 + ./INSTALL/ventoy/wimboot.x86_64 ./Unix/ventoy_unix/ClonOS/geom_ventoy_ko/13.x/64/geom_ventoy.ko build Build Instructions:
./Unix/BuildUnixKmod.txt ./Unix/ventoy_unix/FreeBSD/geom_ventoy_ko/10.x/32/geom_ventoy.ko ./Unix/ventoy_unix/FreeBSD/geom_ventoy_ko/10.x/64/geom_ventoy.ko diff --git a/BUSYBOX/chmod/vtchmod.c b/BUSYBOX/chmod/vtchmod.c index ad10d0e8291..c2f80c62831 100644 --- a/BUSYBOX/chmod/vtchmod.c +++ b/BUSYBOX/chmod/vtchmod.c @@ -1,6 +1,6 @@ #include #include -#include +#include #include #include @@ -20,7 +20,7 @@ int main(int argc, char **argv) { return 0; } - + if (strstr(buf.machine, "x86_64")) { return 0; diff --git a/DMPATCH/dmpatch.c b/DMPATCH/dmpatch.c index d711a3a00d5..573ff53ceda 100644 --- a/DMPATCH/dmpatch.c +++ b/DMPATCH/dmpatch.c @@ -7,12 +7,12 @@ * 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 . * @@ -70,7 +70,7 @@ static set_memory_attr_pf set_mem_rw = NULL; static kprobe_reg_pf reg_kprobe = NULL; static kprobe_unreg_pf unreg_kprobe = NULL; -static volatile ko_param g_ko_param = +static volatile ko_param g_ko_param = { { magic_sig }, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 @@ -84,7 +84,7 @@ static volatile ko_param g_ko_param = #define PATCH_OP_POS2 1 #define CODE_MATCH2(code, i) \ (code[i] == 0x0C && code[i + 1] == 0x80 && code[i + 2] == 0x89 && code[i + 3] == 0xC6) - + #define PATCH_OP_POS3 4 #define CODE_MATCH3(code, i) \ (code[i] == 0x44 && code[i + 1] == 0x89 && code[i + 2] == 0xe8 && code[i + 3] == 0x0c && code[i + 4] == 0x80) @@ -190,23 +190,23 @@ static void notrace dmpatch_restore_code(int bytes, unsigned char *opCode, unsig set_mem_rw(align, 1); if (bytes == 1) { - *opCode = (unsigned char)code; + *opCode = (unsigned char)code; } else { *(unsigned int *)opCode = code; } - set_mem_ro(align, 1); + set_mem_ro(align, 1); } } static int notrace dmpatch_replace_code ( int style, - unsigned long addr, - unsigned long size, - int expect, - const char *desc, + unsigned long addr, + unsigned long size, + int expect, + const char *desc, unsigned char **patch ) { @@ -277,7 +277,7 @@ static unsigned long notrace dmpatch_find_call_offset(unsigned long addr, unsign unsigned char aucOffset[8] = { 0, 0, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF }; opCode = (unsigned char *)addr; - + for (i = 0; i + 4 < size; i++) { if (opCode[i] == 0xE8) @@ -328,7 +328,7 @@ static unsigned int notrace dmpatch_patch_claim_ptr(void) vdebug("Get addr: 0x%lx %lu file_open 0x%lx\n", g_ko_param.sym_get_addr, g_ko_param.sym_get_size, g_ko_param.bdev_file_open_addr); offset1 = dmpatch_find_call_offset(g_ko_param.sym_get_addr, g_ko_param.sym_get_size, g_ko_param.bdev_file_open_addr); if (offset1 == 0) - { + { vdebug("call bdev_file_open_addr Not found\n"); return 1; } @@ -337,7 +337,7 @@ static unsigned int notrace dmpatch_patch_claim_ptr(void) else { vdebug("Get addr: 0x%lx %lu 0x%lx\n", g_ko_param.sym_get_addr, g_ko_param.sym_get_size, g_ko_param.blkdev_get_addr); - vdebug("Put addr: 0x%lx %lu 0x%lx\n", g_ko_param.sym_put_addr, g_ko_param.sym_put_size, g_ko_param.blkdev_put_addr); + vdebug("Put addr: 0x%lx %lu 0x%lx\n", g_ko_param.sym_put_addr, g_ko_param.sym_put_size, g_ko_param.blkdev_put_addr); offset1 = dmpatch_find_call_offset(g_ko_param.sym_get_addr, g_ko_param.sym_get_size, g_ko_param.blkdev_get_addr); offset2 = dmpatch_find_call_offset(g_ko_param.sym_put_addr, g_ko_param.sym_put_size, g_ko_param.blkdev_put_addr); @@ -348,11 +348,11 @@ static unsigned int notrace dmpatch_patch_claim_ptr(void) } } - - vdebug("call addr1:0x%lx call addr2:0x%lx\n", - g_ko_param.sym_get_addr + offset1, + + vdebug("call addr1:0x%lx call addr2:0x%lx\n", + g_ko_param.sym_get_addr + offset1, g_ko_param.sym_put_addr + offset2); - + opCode = (unsigned char *)g_ko_param.sym_get_addr; for (i = offset1 - 1, t = 0; (i > 0) && (t < 24); i--, t++) { @@ -372,15 +372,15 @@ static unsigned int notrace dmpatch_patch_claim_ptr(void) return 1; } - + align = (unsigned long)g_get_patch[0] / g_ko_param.pgsize * g_ko_param.pgsize; set_mem_rw(align, 1); *(unsigned int *)(g_get_patch[0]) = 0; - set_mem_ro(align, 1); + set_mem_ro(align, 1); if (offset2 > 0) - { + { opCode = (unsigned char *)g_ko_param.sym_put_addr; for (i = offset2 - 1, t = 0; (i > 0) && (t < 24); i--, t++) { @@ -391,21 +391,21 @@ static unsigned int notrace dmpatch_patch_claim_ptr(void) { vdebug("claim_ptr found at put addr 0x%lx\n", g_ko_param.sym_put_addr + i + 3); g_put_patch[0] = opCode + i + 3; - break; + break; } } - } + } if (g_put_patch[0] == 0) { vdebug("Claim_ptr not found in put\n"); return 1; } - + align = (unsigned long)g_put_patch[0] / g_ko_param.pgsize * g_ko_param.pgsize; set_mem_rw(align, 1); *(unsigned int *)(g_put_patch[0]) = 0; - set_mem_ro(align, 1); + set_mem_ro(align, 1); } return 0; @@ -477,7 +477,7 @@ static int notrace dmpatch_process(unsigned long a, unsigned long b, unsigned lo g_ko_param.kv_major = a; g_ko_param.kv_minor = b; g_ko_param.kv_subminor = c; - + if (dmpatch_kv_above(6, 5, 0)) /* >= kernel 6.5 */ { vdebug("new interface patch dm_get_table_device...\n"); @@ -512,7 +512,7 @@ static int notrace dmpatch_process(unsigned long a, unsigned long b, unsigned lo } else { - r = dmpatch_replace_code(1, g_ko_param.sym_put_addr, g_ko_param.sym_put_size, 1, "dm_put_table_device", g_put_patch); + r = dmpatch_replace_code(1, g_ko_param.sym_put_addr, g_ko_param.sym_put_size, 1, "dm_put_table_device", g_put_patch); if (r) { rc = -EFAULT; @@ -538,24 +538,24 @@ static int notrace dmpatch_init(void) { int rc = 0; u64 msr = 0; - + if (g_ko_param.ibt == 0x8888) { msr = dmpatch_ibt_save(); } - - kprintf = (printk_pf)(g_ko_param.printk_addr); - vdebug("dmpatch_init start pagesize=%lu kernel=%lu.%lu.%lu ...\n", + kprintf = (printk_pf)(g_ko_param.printk_addr); + + vdebug("dmpatch_init start pagesize=%lu kernel=%lu.%lu.%lu ...\n", g_ko_param.pgsize, g_ko_param.kv_major, g_ko_param.kv_minor, g_ko_param.kv_subminor); - + if (g_ko_param.struct_size != sizeof(ko_param)) { vdebug("Invalid struct size %d %d\n", (int)g_ko_param.struct_size, (int)sizeof(ko_param)); return -EINVAL; } - - if (g_ko_param.sym_get_addr == 0 || g_ko_param.sym_put_addr == 0 || + + if (g_ko_param.sym_get_addr == 0 || g_ko_param.sym_put_addr == 0 || g_ko_param.ro_addr == 0 || g_ko_param.rw_addr == 0) { return -EINVAL; @@ -606,7 +606,7 @@ static void notrace dmpatch_exit(void) } } else - { + { for (i = 0; i < MAX_PATCH; i++) { dmpatch_restore_code(1, g_get_patch[i], 0x80); diff --git a/DOC/LoopExBuild.txt b/DOC/LoopExBuild.txt index 2f5a39e7f98..6d692990930 100644 --- a/DOC/LoopExBuild.txt +++ b/DOC/LoopExBuild.txt @@ -26,4 +26,3 @@ get drivers\md\dm-mod.ko - \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 0813189788d..947da9f7274 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,4 +12,4 @@ RUN sed -i \ libvirt* vte* NetworkManager-bluetooth brlapi fuse-devel dejavu* gnu-efi* pesign shim \ iscsi-initiator-utils grub2-tools zip nasm acpica-tools glibc-static zlib-static xorriso lz4 squashfs-tools -CMD cd /ventoy/INSTALL && ls -la && sh docker_ci_build.sh +CMD cd /ventoy/INSTALL && ls -la && sh docker_ci_build.sh diff --git a/EDK2/build.sh b/EDK2/build.sh index 92244db3d60..8d4c0b31795 100644 --- a/EDK2/build.sh +++ b/EDK2/build.sh @@ -38,7 +38,7 @@ rm -f $VTEFI_PATH3 unset WORKSPACE source ./edksetup.sh -if [ "$EDKARCH" = "AARCH64" ]; then +if [ "$EDKARCH" = "AARCH64" ]; then GCC48_AARCH64_PREFIX=aarch64-linux-gnu- \ build -p MdeModulePkg/MdeModulePkg.dsc -a $EDKARCH -b RELEASE -t GCC48 else @@ -46,7 +46,7 @@ else fi if [ -e $VTEFI_PATH ] && [ -e $VTEFI_PATH2 ] && [ -e $VTEFI_PATH3 ]; then - echo -e '\n\n====================== SUCCESS ========================\n\n' + echo -e '\n\n====================== SUCCESS ========================\n\n' cp -a $VTEFI_PATH $DST_PATH cp -a $VTEFI_PATH2 $DST_PATH2 [ -d ../../VDiskChain ] && cp -a $VTEFI_PATH3 $DST_PATH3 diff --git a/EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/VDiskChain/VDiskChain.c b/EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/VDiskChain/VDiskChain.c index cc978a1bde2..63b8ee71463 100644 --- a/EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/VDiskChain/VDiskChain.c +++ b/EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/VDiskChain/VDiskChain.c @@ -7,12 +7,12 @@ * 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 . * @@ -41,7 +41,7 @@ BOOLEAN gVDiskDebugPrint = FALSE; vdisk_block_data gVDiskBlockData; /* Boot filename */ -CONST CHAR16 *gEfiBootFileName[] = +CONST CHAR16 *gEfiBootFileName[] = { L"@", EFI_REMOVABLE_MEDIA_FILE_NAME, @@ -66,7 +66,7 @@ CONST CHAR16 *gEfiBootFileName[] = L"\\EFI\\BOOT\\bootaa64.efi", L"\\efi\\boot\\bootaa64.efi", #endif - + }; UINT8 *g_disk_buf_addr = NULL; @@ -83,14 +83,14 @@ VOID EFIAPI VDiskDebug(IN CONST CHAR8 *Format, ...) VA_START (Marker, Format); UnicodeVSPrintAsciiFormat(Buffer, sizeof(Buffer), Format, Marker); VA_END (Marker); - + gST->ConOut->OutputString(gST->ConOut, Buffer); } VOID EFIAPI vdisk_clear_input(VOID) { EFI_INPUT_KEY Key; - + gST->ConIn->Reset(gST->ConIn, FALSE); while (EFI_SUCCESS == gST->ConIn->ReadKeyStroke(gST->ConIn, &Key)) { @@ -119,19 +119,19 @@ STATIC EFI_STATUS EFIAPI vdisk_load_image pFilePath->Header.Length[0] = FileNameLen + sizeof(EFI_DEVICE_PATH_PROTOCOL); pFilePath->Header.Length[1] = 0; CopyMem(pFilePath->PathName, FileName, FileNameLen); - + pImgPath = AppendDevicePathNode(pDevicePath, (EFI_DEVICE_PATH_PROTOCOL *)pFilePath); if (!pImgPath) { return EFI_NOT_FOUND; } - + Status = gBS->LoadImage(FALSE, ImageHandle, pImgPath, NULL, 0, Image); - + debug("Load Image File %r DP: <%s>", Status, ConvertDevicePathToText(pImgPath, FALSE, FALSE)); FreePool(pImgPath); - + return Status; } @@ -153,12 +153,12 @@ STATIC EFI_STATUS EFIAPI vdisk_decompress_vdisk(IN EFI_LOADED_IMAGE_PROTOCOL *pI g_disk_buf_size = DestinationSize; g_disk_buf_addr = AllocatePool(DestinationSize); ScratchBuf = AllocatePool(ScratchSize); - + Status = UefiDecompress(buf + VDISK_MAGIC_LEN, g_disk_buf_addr, ScratchBuf); FreePool(ScratchBuf); debug("Status:%r %p %u", Status, g_disk_buf_addr, (UINT32)g_disk_buf_size); - + return EFI_SUCCESS; } @@ -168,7 +168,7 @@ STATIC EFI_STATUS vdisk_patch_vdisk_path(CHAR16 *pos) UINTN j; CHAR16 *end; CHAR8 *buf = (char *)g_disk_buf_addr; - + if (*pos == L'\"') { pos++; @@ -176,7 +176,7 @@ STATIC EFI_STATUS vdisk_patch_vdisk_path(CHAR16 *pos) end = StrStr(pos, L".vtoy"); end += 5;//string length - + for (i = 0; i < g_disk_buf_size; i++) { if (*(UINT32 *)(buf + i) == 0x59595959) @@ -191,7 +191,7 @@ STATIC EFI_STATUS vdisk_patch_vdisk_path(CHAR16 *pos) if (j >= 300) { - break; + break; } } } @@ -202,7 +202,7 @@ STATIC EFI_STATUS vdisk_patch_vdisk_path(CHAR16 *pos) return 0; } - debug("Fill vdisk path at %d", i); + debug("Fill vdisk path at %d", i); while (pos != end) { @@ -210,14 +210,14 @@ STATIC EFI_STATUS vdisk_patch_vdisk_path(CHAR16 *pos) } buf[i++] = '\"'; - + while (buf[i] == 'Y' || buf[i] == '\"') { buf[i] = ' '; i++; - } + } - return 0; + return 0; } EFI_STATUS EFIAPI vdisk_get_variable_wrapper @@ -230,7 +230,7 @@ EFI_STATUS EFIAPI vdisk_get_variable_wrapper ) { EFI_STATUS Status = EFI_SUCCESS; - + Status = g_org_get_variable(VariableName, VendorGuid, Attributes, DataSize, Data); if (StrCmp(VariableName, L"SecureBoot") == 0) { @@ -262,12 +262,12 @@ STATIC EFI_STATUS EFIAPI vdisk_disable_secure_boot(IN EFI_HANDLE ImageHandle) { /* step1: wrapper security protocol. */ /* Do we still need it since we have been loaded ? */ - - + + /* step2: fake SecureBoot variable */ g_org_exit_boot_service = gBS->ExitBootServices; gBS->ExitBootServices = vdisk_exit_boot_service_wrapper; - + g_org_get_variable = gRT->GetVariable; gRT->GetVariable = vdisk_get_variable_wrapper; @@ -275,7 +275,7 @@ STATIC EFI_STATUS EFIAPI vdisk_disable_secure_boot(IN EFI_HANDLE ImageHandle) } STATIC EFI_STATUS EFIAPI vdisk_parse_cmdline(IN EFI_HANDLE ImageHandle) -{ +{ CHAR16 *Pos = NULL; CHAR16 *pCmdLine = NULL; EFI_STATUS Status = EFI_SUCCESS; @@ -296,7 +296,7 @@ STATIC EFI_STATUS EFIAPI vdisk_parse_cmdline(IN EFI_HANDLE ImageHandle) { gVDiskDebugPrint = TRUE; } - + debug("cmdline:<%s>", pCmdLine); vdisk_debug_pause(); @@ -338,7 +338,7 @@ EFI_STATUS EFIAPI vdisk_boot(IN EFI_HANDLE ImageHandle) Count = 0; Handles = NULL; - Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiSimpleFileSystemProtocolGuid, + Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiSimpleFileSystemProtocolGuid, NULL, &Count, &Handles); if (EFI_ERROR(Status)) { @@ -357,7 +357,7 @@ EFI_STATUS EFIAPI vdisk_boot(IN EFI_HANDLE ImageHandle) debug("FS:%u Protocol:%p OpenVolume:%p", i, pFile, pFile->OpenVolume); - Status = gBS->OpenProtocol(Handles[i], &gEfiDevicePathProtocolGuid, + Status = gBS->OpenProtocol(Handles[i], &gEfiDevicePathProtocolGuid, (VOID **)&pDevPath, ImageHandle, Handles[i], @@ -377,7 +377,7 @@ EFI_STATUS EFIAPI vdisk_boot(IN EFI_HANDLE ImageHandle) for (j = 1; j < ARRAY_SIZE(gEfiBootFileName); j++) { - Status = vdisk_load_image(ImageHandle, pDevPath, gEfiBootFileName[j], + Status = vdisk_load_image(ImageHandle, pDevPath, gEfiBootFileName[j], StrSize(gEfiBootFileName[j]), &Image); if (EFI_SUCCESS == Status) { @@ -450,7 +450,7 @@ EFI_STATUS EFIAPI VDiskChainEfiMain vdisk_debug_pause(); Status = vdisk_boot(ImageHandle); - + gBS->DisconnectController(gVDiskBlockData.Handle, NULL, NULL); gBS->UninstallMultipleProtocolInterfaces(gVDiskBlockData.Handle, &gEfiBlockIoProtocolGuid, &gVDiskBlockData.BlockIo, @@ -463,7 +463,7 @@ EFI_STATUS EFIAPI VDiskChainEfiMain gST->ConOut->OutputString(gST->ConOut, L"Maybe the image does not support " VENTOY_UEFI_DESC L"!\r\n"); sleep(30); } - + vdisk_clear_input(); gST->ConOut->ClearScreen(gST->ConOut); diff --git a/EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/VDiskChain/VDiskChain.h b/EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/VDiskChain/VDiskChain.h index d4d21d00c59..f0a2e6b24f4 100644 --- a/EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/VDiskChain/VDiskChain.h +++ b/EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/VDiskChain/VDiskChain.h @@ -7,17 +7,17 @@ * 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 . * */ - + #ifndef __VENTOY_H__ #define __VENTOY_H__ @@ -41,7 +41,7 @@ #error Unknown Processor Type #endif -typedef struct vdisk_block_data +typedef struct vdisk_block_data { EFI_HANDLE Handle; EFI_BLOCK_IO_MEDIA Media; /* Media descriptor */ @@ -78,7 +78,7 @@ if (gVDiskDebugPrint) \ extern BOOLEAN gVDiskDebugPrint; VOID EFIAPI VDiskDebug(IN CONST CHAR8 *Format, ...); -EFI_STATUS EFIAPI vdisk_block_io_read +EFI_STATUS EFIAPI vdisk_block_io_read ( IN EFI_BLOCK_IO_PROTOCOL *This, IN UINT32 MediaId, diff --git a/EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/VDiskChain/VDiskChainProtocol.c b/EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/VDiskChain/VDiskChainProtocol.c index a6a6ad0b50d..c1fc55b49ed 100644 --- a/EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/VDiskChain/VDiskChainProtocol.c +++ b/EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/VDiskChain/VDiskChainProtocol.c @@ -7,12 +7,12 @@ * 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 . * @@ -39,11 +39,11 @@ /* EFI block device vendor device path GUID */ EFI_GUID gVDiskBlockDevicePathGuid = VDISK_BLOCK_DEVICE_PATH_GUID; -EFI_STATUS EFIAPI vdisk_block_io_reset +EFI_STATUS EFIAPI vdisk_block_io_reset ( IN EFI_BLOCK_IO_PROTOCOL *This, IN BOOLEAN ExtendedVerification -) +) { (VOID)This; (VOID)ExtendedVerification; @@ -105,7 +105,7 @@ EFI_STATUS EFIAPI vdisk_fill_device_path(VOID) venPath->Header.Length[1] = 0; CopyMem(&venPath->Guid, &gVDiskBlockDevicePathGuid, sizeof(EFI_GUID)); CopyMem(venPath + 1, VDISK_BLOCK_DEVICE_PATH_NAME, NameLen); - + gVDiskBlockData.Path = AppendDevicePathNode(NULL, (EFI_DEVICE_PATH_PROTOCOL *)TmpBuf); gVDiskBlockData.DevicePathCompareLen = sizeof(VENDOR_DEVICE_PATH) + NameLen; @@ -127,7 +127,7 @@ EFI_STATUS EFIAPI vdisk_connect_driver(IN EFI_HANDLE ControllerHandle, IN CONST debug("vdisk_connect_driver <%s>...", DrvName); - Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiComponentName2ProtocolGuid, + Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiComponentName2ProtocolGuid, NULL, &Count, &Handles); if (EFI_ERROR(Status)) { @@ -169,7 +169,7 @@ EFI_STATUS EFIAPI vdisk_connect_driver(IN EFI_HANDLE ControllerHandle, IN CONST FreePool(Handles); Handles = NULL; - Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiComponentNameProtocolGuid, + Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiComponentNameProtocolGuid, NULL, &Count, &Handles); if (EFI_ERROR(Status)) { @@ -206,18 +206,18 @@ EFI_STATUS EFIAPI vdisk_connect_driver(IN EFI_HANDLE ControllerHandle, IN CONST } Status = EFI_NOT_FOUND; - + end: FreePool(Handles); - + return Status; } EFI_STATUS EFIAPI vdisk_install_blockio(IN EFI_HANDLE ImageHandle, IN UINT64 ImgSize) -{ +{ EFI_STATUS Status = EFI_SUCCESS; EFI_BLOCK_IO_PROTOCOL *pBlockIo = &(gVDiskBlockData.BlockIo); - + vdisk_fill_device_path(); debug("install block io protocol %p", ImageHandle); diff --git a/EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/Ventoy/Ventoy.c b/EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/Ventoy/Ventoy.c index 0682c74c522..c63e8e9b156 100644 --- a/EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/Ventoy/Ventoy.c +++ b/EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/Ventoy/Ventoy.c @@ -7,12 +7,12 @@ * 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 . * @@ -76,7 +76,7 @@ STATIC EFI_EXIT_BOOT_SERVICES g_org_exit_boot_service = NULL; /* Boot filename */ UINTN gBootFileStartIndex = 1; -CONST CHAR16 *gEfiBootFileName[] = +CONST CHAR16 *gEfiBootFileName[] = { L"@", EFI_REMOVABLE_MEDIA_FILE_NAME, @@ -101,7 +101,7 @@ CONST CHAR16 *gEfiBootFileName[] = L"\\EFI\\BOOT\\bootaa64.efi", L"\\efi\\boot\\bootaa64.efi", #endif - + }; VOID EFIAPI VtoyDebug(IN CONST CHAR8 *Format, ...) @@ -112,14 +112,14 @@ VOID EFIAPI VtoyDebug(IN CONST CHAR8 *Format, ...) VA_START (Marker, Format); UnicodeVSPrintAsciiFormat(Buffer, sizeof(Buffer), Format, Marker); VA_END (Marker); - + gST->ConOut->OutputString(gST->ConOut, Buffer); } VOID EFIAPI ventoy_clear_input(VOID) { EFI_INPUT_KEY Key; - + gST->ConIn->Reset(gST->ConIn, FALSE); while (EFI_SUCCESS == gST->ConIn->ReadKeyStroke(gST->ConIn, &Key)) { @@ -142,7 +142,7 @@ static void EFIAPI ventoy_dump_img_chunk(ventoy_chain_head *chain) for (i = 0; i < chain->img_chunk_num; i++) { debug("%2u: [ %u - %u ] <==> [ %llu - %llu ]", - i, chunk[i].img_start_sector, chunk[i].img_end_sector, + i, chunk[i].img_start_sector, chunk[i].img_end_sector, chunk[i].disk_start_sector, chunk[i].disk_end_sector); if (i > 0 && (chunk[i].img_start_sector != chunk[i - 1].img_end_sector + 1)) @@ -161,7 +161,7 @@ static void EFIAPI ventoy_dump_img_chunk(ventoy_chain_head *chain) { debug("image chunk size check failed %d", errcnt); } - + ventoy_debug_pause(); } @@ -169,7 +169,7 @@ static void EFIAPI ventoy_dump_override_chunk(ventoy_chain_head *chain) { UINT32 i; ventoy_override_chunk *chunk; - + chunk = (ventoy_override_chunk *)((char *)chain + chain->override_chunk_offset); debug("##################### ventoy_dump_override_chunk #######################"); @@ -186,7 +186,7 @@ static void EFIAPI ventoy_dump_virt_chunk(ventoy_chain_head *chain) { UINT32 i; ventoy_virt_chunk *node; - + debug("##################### ventoy_dump_virt_chunk #######################"); debug("virt_chunk_offset=%u", chain->virt_chunk_offset); debug("virt_chunk_num=%u", chain->virt_chunk_num); @@ -194,7 +194,7 @@ static void EFIAPI ventoy_dump_virt_chunk(ventoy_chain_head *chain) node = (ventoy_virt_chunk *)((char *)chain + chain->virt_chunk_offset); for (i = 0; i < chain->virt_chunk_num; i++, node++) { - debug("%2u: mem:[ %u, %u, %u ] remap:[ %u, %u, %u ]", i, + debug("%2u: mem:[ %u, %u, %u ] remap:[ %u, %u, %u ]", i, node->mem_sector_start, node->mem_sector_end, node->mem_sector_offset, @@ -202,7 +202,7 @@ static void EFIAPI ventoy_dump_virt_chunk(ventoy_chain_head *chain) node->remap_sector_end, node->org_sector_start); } - + ventoy_debug_pause(); } @@ -211,7 +211,7 @@ static void EFIAPI ventoy_dump_chain(ventoy_chain_head *chain) UINT32 i = 0; UINT8 chksum = 0; UINT8 *guid; - + guid = chain->os_param.vtoy_disk_guid; for (i = 0; i < sizeof(ventoy_os_param); i++) { @@ -229,10 +229,10 @@ static void EFIAPI ventoy_dump_chain(ventoy_chain_head *chain) debug("os_param->vtoy_img_size=<%llu>", chain->os_param.vtoy_img_size); debug("os_param->vtoy_img_location_addr=<0x%llx>", chain->os_param.vtoy_img_location_addr); debug("os_param->vtoy_img_location_len=<%u>", chain->os_param.vtoy_img_location_len); - debug("os_param->vtoy_reserved=<%u %u %u %u %u %u %u>", - g_os_param_reserved[0], - g_os_param_reserved[1], - g_os_param_reserved[2], + debug("os_param->vtoy_reserved=<%u %u %u %u %u %u %u>", + g_os_param_reserved[0], + g_os_param_reserved[1], + g_os_param_reserved[2], g_os_param_reserved[3], g_os_param_reserved[4], g_os_param_reserved[5], @@ -240,7 +240,7 @@ static void EFIAPI ventoy_dump_chain(ventoy_chain_head *chain) ); ventoy_debug_pause(); - + debug("chain->disk_drive=0x%x", chain->disk_drive); debug("chain->disk_sector_size=%u", chain->disk_sector_size); debug("chain->real_img_size_in_bytes=%llu", chain->real_img_size_in_bytes); @@ -252,7 +252,7 @@ static void EFIAPI ventoy_dump_chain(ventoy_chain_head *chain) debug("chain->override_chunk_num=%u", chain->override_chunk_num); ventoy_debug_pause(); - + ventoy_dump_img_chunk(chain); ventoy_dump_override_chunk(chain); ventoy_dump_virt_chunk(chain); @@ -344,7 +344,7 @@ EFI_HANDLE EFIAPI ventoy_get_parent_handle(IN EFI_DEVICE_PATH_PROTOCOL *pDevPath EFI_DEVICE_PATH_PROTOCOL *pLastNode = NULL; EFI_DEVICE_PATH_PROTOCOL *pCurNode = NULL; EFI_DEVICE_PATH_PROTOCOL *pTmpDevPath = NULL; - + pTmpDevPath = DuplicateDevicePath(pDevPath); if (!pTmpDevPath) { @@ -387,8 +387,8 @@ EFI_STATUS EFIAPI ventoy_save_ramdisk_param(VOID) { debug("find previous ramdisk variable <%llu>", g_backup_ramdisk_param.DiskSize); } - - Status = gRT->SetVariable(L"VentoyRamDisk", &VarGuid, + + Status = gRT->SetVariable(L"VentoyRamDisk", &VarGuid, EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS, sizeof(g_ramdisk_param), &(g_ramdisk_param)); debug("set ramdisk variable %r", Status); @@ -403,14 +403,14 @@ EFI_STATUS EFIAPI ventoy_delete_ramdisk_param(VOID) if (g_backup_ramdisk_param.DiskSize > 0 && g_backup_ramdisk_param.PhyAddr > 0) { - Status = gRT->SetVariable(L"VentoyRamDisk", &VarGuid, + Status = gRT->SetVariable(L"VentoyRamDisk", &VarGuid, EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS, sizeof(g_backup_ramdisk_param), &g_backup_ramdisk_param); debug("resotre ramdisk variable %r", Status); } else { - Status = gRT->SetVariable(L"VentoyRamDisk", &VarGuid, + Status = gRT->SetVariable(L"VentoyRamDisk", &VarGuid, EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS, 0, NULL); debug("delete ramdisk variable %r", Status); @@ -432,7 +432,7 @@ EFI_STATUS EFIAPI ventoy_save_variable(VOID) debug("find previous efi variable <%a>", g_backup_os_param_var.vtoy_img_path); } - Status = gRT->SetVariable(L"VentoyOsParam", &VarGuid, + Status = gRT->SetVariable(L"VentoyOsParam", &VarGuid, EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS, sizeof(g_chain->os_param), &(g_chain->os_param)); debug("set efi variable %r", Status); @@ -447,14 +447,14 @@ EFI_STATUS EFIAPI ventoy_delete_variable(VOID) if (0 == CompareMem(&(g_backup_os_param_var.guid), &VarGuid, sizeof(EFI_GUID))) { - Status = gRT->SetVariable(L"VentoyOsParam", &VarGuid, + Status = gRT->SetVariable(L"VentoyOsParam", &VarGuid, EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS, sizeof(g_backup_os_param_var), &(g_backup_os_param_var)); debug("restore efi variable %r", Status); } else { - Status = gRT->SetVariable(L"VentoyOsParam", &VarGuid, + Status = gRT->SetVariable(L"VentoyOsParam", &VarGuid, EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS, 0, NULL); debug("delete efi variable %r", Status); @@ -481,7 +481,7 @@ STATIC VOID ventoy_warn_invalid_device(VOID) gST->ConOut->OutputString(gST->ConOut, L"This is NOT a standard Ventoy device and is NOT supported.\r\n\r\n"); gST->ConOut->OutputString(gST->ConOut, L"You should follow the official instructions in https://www.ventoy.net\r\n"); - + gST->ConOut->OutputString(gST->ConOut, L"\r\n\r\nWill exit after 10 seconds ...... "); sleep(10); @@ -489,7 +489,7 @@ STATIC VOID ventoy_warn_invalid_device(VOID) #else STATIC VOID ventoy_warn_invalid_device(VOID) { - + } #endif @@ -513,19 +513,19 @@ STATIC EFI_STATUS EFIAPI ventoy_load_image pFilePath->Header.Length[0] = FileNameLen + sizeof(EFI_DEVICE_PATH_PROTOCOL); pFilePath->Header.Length[1] = 0; CopyMem(pFilePath->PathName, FileName, FileNameLen); - + pImgPath = AppendDevicePathNode(pDevicePath, (EFI_DEVICE_PATH_PROTOCOL *)pFilePath); if (!pImgPath) { return EFI_NOT_FOUND; } - + Status = gBS->LoadImage(FALSE, ImageHandle, pImgPath, NULL, 0, Image); - + debug("Load Image File %r DP: <%s>", Status, ConvertDevicePathToText(pImgPath, FALSE, FALSE)); FreePool(pImgPath); - + return Status; } @@ -547,7 +547,7 @@ STATIC EFI_STATUS EFIAPI ventoy_find_iso_disk(IN EFI_HANDLE ImageHandle) return EFI_OUT_OF_RESOURCES; } - Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiBlockIoProtocolGuid, + Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiBlockIoProtocolGuid, NULL, &Count, &Handles); if (EFI_ERROR(Status)) { @@ -591,16 +591,16 @@ STATIC EFI_STATUS EFIAPI ventoy_find_iso_disk(IN EFI_HANDLE ImageHandle) ventoy_warn_invalid_device(); } } - + gBlockData.RawBlockIoHandle = Handles[i]; gBlockData.pRawBlockIo = pBlockIo; - gBS->OpenProtocol(Handles[i], &gEfiDevicePathProtocolGuid, + gBS->OpenProtocol(Handles[i], &gEfiDevicePathProtocolGuid, (VOID **)&(gBlockData.pDiskDevPath), ImageHandle, Handles[i], EFI_OPEN_PROTOCOL_GET_PROTOCOL); - - debug("Find Ventoy Disk Sig Handle:%p DP:%s", Handles[i], + + debug("Find Ventoy Disk Sig Handle:%p DP:%s", Handles[i], ConvertDevicePathToText(gBlockData.pDiskDevPath, FALSE, FALSE)); break; } @@ -629,7 +629,7 @@ STATIC EFI_STATUS EFIAPI ventoy_find_iso_disk_fs(IN EFI_HANDLE ImageHandle) EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *pFile = NULL; EFI_DEVICE_PATH_PROTOCOL *pDevPath = NULL; - Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiSimpleFileSystemProtocolGuid, + Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiSimpleFileSystemProtocolGuid, NULL, &Count, &Handles); if (EFI_ERROR(Status)) { @@ -646,7 +646,7 @@ STATIC EFI_STATUS EFIAPI ventoy_find_iso_disk_fs(IN EFI_HANDLE ImageHandle) continue; } - Status = gBS->OpenProtocol(Handles[i], &gEfiDevicePathProtocolGuid, + Status = gBS->OpenProtocol(Handles[i], &gEfiDevicePathProtocolGuid, (VOID **)&pDevPath, ImageHandle, Handles[i], @@ -683,29 +683,29 @@ STATIC EFI_STATUS EFIAPI ventoy_load_isoefi_driver(IN EFI_HANDLE ImageHandle) if (gIsoUdf) { - Status = ventoy_load_image(ImageHandle, gBlockData.pDiskFsDevPath, - gUdfEfiDriverPath, - sizeof(gUdfEfiDriverPath), + Status = ventoy_load_image(ImageHandle, gBlockData.pDiskFsDevPath, + gUdfEfiDriverPath, + sizeof(gUdfEfiDriverPath), &Image); debug("load iso UDF efi driver status:%r", Status); } else { - Status = ventoy_load_image(ImageHandle, gBlockData.pDiskFsDevPath, - gIso9660EfiDriverPath, - sizeof(gIso9660EfiDriverPath), + Status = ventoy_load_image(ImageHandle, gBlockData.pDiskFsDevPath, + gIso9660EfiDriverPath, + sizeof(gIso9660EfiDriverPath), &Image); - debug("load iso 9660 efi driver status:%r", Status); + debug("load iso 9660 efi driver status:%r", Status); } if (gDebugPrint) { - gRT->SetVariable(L"FS_LOGGING", &gShellVariableGuid, + gRT->SetVariable(L"FS_LOGGING", &gShellVariableGuid, EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS, sizeof(LogVar), LogVar); } - gRT->SetVariable(L"FS_NAME_NOCASE", &gShellVariableGuid, + gRT->SetVariable(L"FS_NAME_NOCASE", &gShellVariableGuid, EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS, sizeof(LogVar), LogVar); @@ -732,7 +732,7 @@ STATIC EFI_STATUS ventoy_proc_img_replace_name(ventoy_grub_param_file_replace *r } AsciiStrCpyS(tmp, sizeof(tmp), replace->old_file_name[0]); - + for (i = 0; i < 256 && tmp[i]; i++) { if (tmp[i] == '/') @@ -755,7 +755,7 @@ EFI_STATUS EFIAPI ventoy_get_variable_wrapper ) { EFI_STATUS Status = EFI_SUCCESS; - + Status = g_org_get_variable(VariableName, VendorGuid, Attributes, DataSize, Data); if (StrCmp(VariableName, L"SecureBoot") == 0) { @@ -779,7 +779,7 @@ EFI_STATUS EFIAPI ventoy_exit_boot_service_wrapper gRT->GetVariable = g_org_get_variable; g_org_get_variable = NULL; } - + return g_org_exit_boot_service(ImageHandle, MapKey); } @@ -803,12 +803,12 @@ STATIC EFI_STATUS EFIAPI ventoy_disable_secure_boot(IN EFI_HANDLE ImageHandle) /* step1: wrapper security protocol. */ /* Do we still need it since we have been loaded ? */ - - + + /* step2: fake SecureBoot variable */ g_org_exit_boot_service = gBS->ExitBootServices; gBS->ExitBootServices = ventoy_exit_boot_service_wrapper; - + g_org_get_variable = gRT->GetVariable; gRT->GetVariable = ventoy_get_variable_wrapper; @@ -817,7 +817,7 @@ STATIC EFI_STATUS EFIAPI ventoy_disable_secure_boot(IN EFI_HANDLE ImageHandle) STATIC EFI_STATUS EFIAPI ventoy_parse_cmdline(IN EFI_HANDLE ImageHandle) -{ +{ UINT32 i = 0; UINT32 old_cnt = 0; UINTN size = 0; @@ -846,12 +846,12 @@ STATIC EFI_STATUS EFIAPI ventoy_parse_cmdline(IN EFI_HANDLE ImageHandle) { gDebugPrint = TRUE; } - + if (StrStr(pCmdLine, L"fallback")) { gBootFallBack = TRUE; } - + if (StrStr(pCmdLine, L"dotefi")) { gDotEfiBoot = TRUE; @@ -861,7 +861,7 @@ STATIC EFI_STATUS EFIAPI ventoy_parse_cmdline(IN EFI_HANDLE ImageHandle) { gLoadIsoEfi = TRUE; } - + if (StrStr(pCmdLine, L"iso_udf")) { gIsoUdf = TRUE; @@ -899,7 +899,7 @@ STATIC EFI_STATUS EFIAPI ventoy_parse_cmdline(IN EFI_HANDLE ImageHandle) { return EFI_INVALID_PARAMETER; } - + pGrubParam = (ventoy_grub_param *)StrHexToUintn(pPos + StrLen(L"env_param=")); grub_env_set = pGrubParam->grub_env_set; grub_env_get = pGrubParam->grub_env_get; @@ -914,7 +914,7 @@ STATIC EFI_STATUS EFIAPI ventoy_parse_cmdline(IN EFI_HANDLE ImageHandle) ventoy_warn_invalid_device(); return EFI_INVALID_PARAMETER; } - + g_file_replace_list = &pGrubParam->file_replace; old_cnt = g_file_replace_list->old_file_cnt; debug("file replace: magic:0x%x virtid:%u name count:%u <%a> <%a> <%a> <%a>", @@ -927,7 +927,7 @@ STATIC EFI_STATUS EFIAPI ventoy_parse_cmdline(IN EFI_HANDLE ImageHandle) old_cnt > 3 ? g_file_replace_list->old_file_name[3] : "" ); - + for (i = 0; i < VTOY_MAX_CONF_REPLACE; i++) { replace = pGrubParam->img_replace + i; @@ -948,7 +948,7 @@ STATIC EFI_STATUS EFIAPI ventoy_parse_cmdline(IN EFI_HANDLE ImageHandle) } } - + pPos = StrStr(pCmdLine, L"mem:"); chain = (ventoy_chain_head *)StrHexToUintn(pPos + 4); @@ -977,7 +977,7 @@ STATIC EFI_STATUS EFIAPI ventoy_parse_cmdline(IN EFI_HANDLE ImageHandle) debug("This is normal mode"); g_chain = AllocatePool(size); CopyMem(g_chain, chain, size); - + g_chunk = (ventoy_img_chunk *)((char *)g_chain + g_chain->img_chunk_offset); g_img_chunk_num = g_chain->img_chunk_num; g_override_chunk = (ventoy_override_chunk *)((char *)g_chain + g_chain->override_chunk_offset); @@ -997,7 +997,7 @@ STATIC EFI_STATUS EFIAPI ventoy_parse_cmdline(IN EFI_HANDLE ImageHandle) { g_hook_keyboard = TRUE; } - + if (g_os_param_reserved[5] == 1 && g_os_param_reserved[2] == ventoy_chain_linux) { ventoy_disable_secure_boot(ImageHandle); @@ -1024,7 +1024,7 @@ STATIC EFI_STATUS EFIAPI ventoy_parse_cmdline(IN EFI_HANDLE ImageHandle) } g_fix_windows_1st_cdrom_issue = FALSE; - if (ventoy_chain_windows == g_os_param_reserved[2] || + if (ventoy_chain_windows == g_os_param_reserved[2] || ventoy_chain_wim == g_os_param_reserved[2]) { if (ventoy_is_cdrom_dp_exist()) @@ -1066,7 +1066,7 @@ EFI_STATUS EFIAPI ventoy_clean_env(VOID) if (!gMemdiskMode) { - FreePool(g_chain); + FreePool(g_chain); } return EFI_SUCCESS; @@ -1126,7 +1126,7 @@ EFI_STATUS EFIAPI ventoy_boot(IN EFI_HANDLE ImageHandle) Count = 0; Handles = NULL; - Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiSimpleFileSystemProtocolGuid, + Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiSimpleFileSystemProtocolGuid, NULL, &Count, &Handles); if (EFI_ERROR(Status)) { @@ -1145,7 +1145,7 @@ EFI_STATUS EFIAPI ventoy_boot(IN EFI_HANDLE ImageHandle) debug("FS:%u Protocol:%p OpenVolume:%p", i, pFile, pFile->OpenVolume); - Status = gBS->OpenProtocol(Handles[i], &gEfiDevicePathProtocolGuid, + Status = gBS->OpenProtocol(Handles[i], &gEfiDevicePathProtocolGuid, (VOID **)&pDevPath, ImageHandle, Handles[i], @@ -1165,7 +1165,7 @@ EFI_STATUS EFIAPI ventoy_boot(IN EFI_HANDLE ImageHandle) for (j = gBootFileStartIndex; j < ARRAY_SIZE(gEfiBootFileName); j++) { - Status = ventoy_load_image(ImageHandle, pDevPath, gEfiBootFileName[j], + Status = ventoy_load_image(ImageHandle, pDevPath, gEfiBootFileName[j], StrSize(gEfiBootFileName[j]), &Image); if (EFI_SUCCESS == Status) { @@ -1187,7 +1187,7 @@ EFI_STATUS EFIAPI ventoy_boot(IN EFI_HANDLE ImageHandle) { gST->ConIn->Reset(gST->ConIn, FALSE); } - + if ((g_file_replace_list && g_file_replace_list->magic == GRUB_FILE_REPLACE_MAGIC) || g_img_replace_list) { ventoy_wrapper_push_openvolume(pFile->OpenVolume); @@ -1199,7 +1199,7 @@ EFI_STATUS EFIAPI ventoy_boot(IN EFI_HANDLE ImageHandle) //ventoy_wrapper_system(); Status = gBS->StartImage(Image, NULL, NULL); ventoy_hook_stop(); - + if (EFI_ERROR(Status)) { debug("Failed to start image %r", Status); @@ -1217,7 +1217,7 @@ EFI_STATUS EFIAPI ventoy_boot(IN EFI_HANDLE ImageHandle) { break; } - + debug("Fs not found, now wait and retry..."); sleep(1); } @@ -1239,7 +1239,7 @@ EFI_STATUS EFIAPI VentoyEfiMain { EFI_STATUS Status = EFI_SUCCESS; EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *Protocol; - + g_sector_flag_num = 512; /* initial value */ g_sector_flag = AllocatePool(g_sector_flag_num * sizeof(ventoy_sector_flag)); @@ -1278,12 +1278,12 @@ EFI_STATUS EFIAPI VentoyEfiMain ventoy_find_iso_disk_fs(ImageHandle); ventoy_load_isoefi_driver(ImageHandle); } - + ventoy_install_blockio(ImageHandle, g_iso_buf_size); ventoy_debug_pause(); Status = ventoy_boot(ImageHandle); - + ventoy_delete_ramdisk_param(); if (gLoadIsoEfi && gBlockData.IsoDriverImage) @@ -1310,14 +1310,14 @@ EFI_STATUS EFIAPI VentoyEfiMain } ventoy_debug_pause(); - + ventoy_install_blockio(ImageHandle, g_chain->virt_img_size_in_bytes); ventoy_debug_pause(); Status = ventoy_boot(ImageHandle); } - + ventoy_clean_env(); } @@ -1330,13 +1330,13 @@ EFI_STATUS EFIAPI VentoyEfiMain sleep(30); } } - + ventoy_clear_input(); gST->ConOut->ClearScreen(gST->ConOut); if (gDotEfiBoot && (EFI_NOT_FOUND == Status)) { - grub_env_set("vtoy_dotefi_retry", "YES"); + grub_env_set("vtoy_dotefi_retry", "YES"); } ventoy_enable_ex_filesystem(); diff --git a/EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/Ventoy/Ventoy.h b/EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/Ventoy/Ventoy.h index 8de03516cab..b8924990cc3 100644 --- a/EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/Ventoy/Ventoy.h +++ b/EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/Ventoy/Ventoy.h @@ -7,17 +7,17 @@ * 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 . * */ - + #ifndef __VENTOY_H__ #define __VENTOY_H__ @@ -54,7 +54,7 @@ typedef struct ventoy_image_disk_region typedef struct ventoy_image_location { ventoy_guid guid; - + /* image sector size, currently this value is always 2048 */ UINT32 image_sector_size; @@ -62,10 +62,10 @@ typedef struct ventoy_image_location UINT32 disk_sector_size; UINT32 region_count; - + /* * disk region data - * If the image file has more than one fragments in disk, + * If the image file has more than one fragments in disk, * there will be more than one region data here. * */ @@ -86,7 +86,7 @@ typedef struct ventoy_os_param char vtoy_img_path[384]; // It seems to be enough, utf-8 format UINT64 vtoy_img_size; // image file size in bytes - /* + /* * Ventoy will write a copy of ventoy_image_location data into runtime memory * this is the physically address and length of that memory. * Address 0 means no such data exist. @@ -95,7 +95,7 @@ typedef struct ventoy_os_param */ UINT64 vtoy_img_location_addr; UINT32 vtoy_img_location_len; - + UINT64 vtoy_reserved[4]; // Internal use by ventoy UINT8 vtoy_disk_signature[4]; @@ -124,7 +124,7 @@ typedef struct ventoy_chain_head UINT64 virt_img_size_in_bytes; UINT32 boot_catalog; UINT8 boot_catalog_sector[2048]; - + UINT32 img_chunk_offset; UINT32 img_chunk_num; @@ -199,11 +199,11 @@ typedef struct ventoy_virt_chunk typedef struct ventoy_sector_flag { UINT8 flag; // 0:init 1:mem 2:remap - UINT64 remap_lba; + UINT64 remap_lba; }ventoy_sector_flag; -typedef struct vtoy_block_data +typedef struct vtoy_block_data { EFI_HANDLE Handle; EFI_BLOCK_IO_MEDIA Media; /* Media descriptor */ @@ -272,7 +272,7 @@ typedef struct ventoy_grub_param grub_env_set_pf grub_env_set; ventoy_grub_param_file_replace file_replace; ventoy_grub_param_file_replace img_replace[VTOY_MAX_CONF_REPLACE]; - grub_env_printf_pf grub_env_printf; + grub_env_printf_pf grub_env_printf; }ventoy_grub_param; typedef struct ventoy_ram_disk @@ -318,7 +318,7 @@ typedef struct MBR_HEAD #pragma pack() -typedef struct well_known_guid +typedef struct well_known_guid { EFI_GUID *guid; const char *name; @@ -331,7 +331,7 @@ typedef struct ventoy_system_wrapper EFI_HANDLE_PROTOCOL NewHandleProtocol; EFI_HANDLE_PROTOCOL OriHandleProtocol; - + EFI_OPEN_PROTOCOL NewOpenProtocol; EFI_OPEN_PROTOCOL OriOpenProtocol; @@ -382,7 +382,7 @@ typedef struct DriverBindWrapper extern BOOLEAN gDebugPrint; VOID EFIAPI VtoyDebug(IN CONST CHAR8 *Format, ...); EFI_STATUS EFIAPI ventoy_wrapper_system(VOID); -EFI_STATUS EFIAPI ventoy_block_io_read +EFI_STATUS EFIAPI ventoy_block_io_read ( IN EFI_BLOCK_IO_PROTOCOL *This, IN UINT32 MediaId, diff --git a/EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/Ventoy/VentoyDebug.c b/EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/Ventoy/VentoyDebug.c index 9bdfaaa9efa..2f68b2f515e 100644 --- a/EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/Ventoy/VentoyDebug.c +++ b/EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/Ventoy/VentoyDebug.c @@ -7,12 +7,12 @@ * 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 . * @@ -43,7 +43,7 @@ STATIC ventoy_system_wrapper g_system_wrapper; -static struct well_known_guid g_efi_well_known_guids[] = +static struct well_known_guid g_efi_well_known_guids[] = { { &gEfiAbsolutePointerProtocolGuid, "AbsolutePointer" }, { &gEfiAcpiTableProtocolGuid, "AcpiTable" }, @@ -97,7 +97,7 @@ STATIC EFI_STATUS EFIAPI ventoy_handle_protocol ) { EFI_STATUS Status = EFI_SUCCESS; - + debug("ventoy_handle_protocol:%a", ventoy_get_guid_name(Protocol)); debug_sleep(); Status = g_system_wrapper.OriHandleProtocol(Handle, Protocol, Interface); @@ -105,11 +105,11 @@ STATIC EFI_STATUS EFIAPI ventoy_handle_protocol { EFI_FILE_PROTOCOL *FileProtocol = NULL; EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *pFile = *((EFI_SIMPLE_FILE_SYSTEM_PROTOCOL **)(Interface)); - + pFile->OpenVolume(pFile, &FileProtocol); - - trace("Handle FS Protocol: %p OpenVolume:%p, FileProtocol:%p, Open:%p", - pFile, pFile->OpenVolume, FileProtocol, FileProtocol->Open); + + trace("Handle FS Protocol: %p OpenVolume:%p, FileProtocol:%p, Open:%p", + pFile, pFile->OpenVolume, FileProtocol, FileProtocol->Open); sleep(3); } @@ -178,8 +178,8 @@ EFI_STATUS EFIAPI ventoy_locate_handle UINTN i; EFI_HANDLE Handle; EFI_STATUS Status = EFI_SUCCESS; - - debug("ventoy_locate_handle: %d %a %p", SearchType, ventoy_get_guid_name(Protocol), SearchKey); + + debug("ventoy_locate_handle: %d %a %p", SearchType, ventoy_get_guid_name(Protocol), SearchKey); Status = g_system_wrapper.OriLocateHandle(SearchType, Protocol, SearchKey, BufferSize, Buffer); debug("ventoy_locate_handle: %r Handle Count:%u", Status, *BufferSize/sizeof(EFI_HANDLE)); diff --git a/EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/Ventoy/VentoyProtocol.c b/EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/Ventoy/VentoyProtocol.c index c0c1fc3bb78..a0be9023793 100644 --- a/EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/Ventoy/VentoyProtocol.c +++ b/EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/Ventoy/VentoyProtocol.c @@ -7,12 +7,12 @@ * 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 . * @@ -85,7 +85,7 @@ BOOLEAN ventoy_is_cdrom_dp_exist(VOID) EFI_STATUS Status = EFI_SUCCESS; EFI_DEVICE_PATH_PROTOCOL *DevicePath = NULL; - Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiDevicePathProtocolGuid, + Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiDevicePathProtocolGuid, NULL, &Count, &Handles); if (EFI_ERROR(Status)) { @@ -107,24 +107,24 @@ BOOLEAN ventoy_is_cdrom_dp_exist(VOID) FreePool(Handles); return TRUE; } - + DevicePath = NextDevicePathNode(DevicePath); } } FreePool(Handles); - return FALSE; + return FALSE; } #if 0 /* Block IO procotol */ #endif -EFI_STATUS EFIAPI ventoy_block_io_reset +EFI_STATUS EFIAPI ventoy_block_io_reset ( IN EFI_BLOCK_IO_PROTOCOL *This, IN BOOLEAN ExtendedVerification -) +) { (VOID)This; (VOID)ExtendedVerification; @@ -151,8 +151,8 @@ STATIC EFI_STATUS EFIAPI ventoy_read_iso_sector ventoy_img_chunk *pchunk = g_chunk; ventoy_override_chunk *pOverride = g_override_chunk; EFI_BLOCK_IO_PROTOCOL *pRawBlockIo = gBlockData.pRawBlockIo; - - debug("read iso sector %lu count %u Buffer:%p Align:%u blk:%u", + + debug("read iso sector %lu count %u Buffer:%p Align:%u blk:%u", Sector, Count, Buffer, pRawBlockIo->Media->IoAlign, pRawBlockIo->Media->BlockSize); ReadStart = Sector * 2048; @@ -207,7 +207,7 @@ STATIC EFI_STATUS EFIAPI ventoy_read_iso_sector { OverrideStart = pOverride->img_offset; OverrideEnd = pOverride->img_offset + pOverride->override_size; - + if (OverrideStart >= ReadEnd || ReadStart >= OverrideEnd) { continue; @@ -217,7 +217,7 @@ STATIC EFI_STATUS EFIAPI ventoy_read_iso_sector { if (ReadEnd <= OverrideEnd) { - CopyMem(pCurBuf + OverrideStart - ReadStart, pOverride->override_data, ReadEnd - OverrideStart); + CopyMem(pCurBuf + OverrideStart - ReadStart, pOverride->override_data, ReadEnd - OverrideStart); } else { @@ -228,7 +228,7 @@ STATIC EFI_STATUS EFIAPI ventoy_read_iso_sector { if (ReadEnd <= OverrideEnd) { - CopyMem(pCurBuf, pOverride->override_data + ReadStart - OverrideStart, ReadEnd - ReadStart); + CopyMem(pCurBuf, pOverride->override_data + ReadStart - OverrideStart, ReadEnd - ReadStart); } else { @@ -236,7 +236,7 @@ STATIC EFI_STATUS EFIAPI ventoy_read_iso_sector } } - if (g_fixup_iso9660_secover_enable && (!g_fixup_iso9660_secover_start) && + if (g_fixup_iso9660_secover_enable && (!g_fixup_iso9660_secover_start) && pOverride->override_size == sizeof(ventoy_iso9660_override)) { ventoy_iso9660_override *dirent = (ventoy_iso9660_override *)pOverride->override_data; @@ -256,7 +256,7 @@ STATIC EFI_STATUS EFIAPI ventoy_read_iso_sector } } - return EFI_SUCCESS; + return EFI_SUCCESS; } STATIC EFI_STATUS EFIAPI ventoy_write_iso_sector @@ -276,7 +276,7 @@ STATIC EFI_STATUS EFIAPI ventoy_write_iso_sector UINT8 *pCurBuf = (UINT8 *)Buffer; ventoy_img_chunk *pchunk = g_chunk; EFI_BLOCK_IO_PROTOCOL *pRawBlockIo = gBlockData.pRawBlockIo; - + debug("write iso sector %lu count %u", Sector, Count); ReadStart = Sector * 2048; @@ -321,17 +321,17 @@ STATIC EFI_STATUS EFIAPI ventoy_write_iso_sector } } - return EFI_SUCCESS; + return EFI_SUCCESS; } -EFI_STATUS EFIAPI ventoy_block_io_ramdisk_write +EFI_STATUS EFIAPI ventoy_block_io_ramdisk_write ( IN EFI_BLOCK_IO_PROTOCOL *This, IN UINT32 MediaId, IN EFI_LBA Lba, IN UINTN BufferSize, IN VOID *Buffer -) +) { (VOID)This; (VOID)MediaId; @@ -349,14 +349,14 @@ EFI_STATUS EFIAPI ventoy_block_io_ramdisk_write return EFI_SUCCESS; } -EFI_STATUS EFIAPI ventoy_block_io_ramdisk_read +EFI_STATUS EFIAPI ventoy_block_io_ramdisk_read ( IN EFI_BLOCK_IO_PROTOCOL *This, IN UINT32 MediaId, IN EFI_LBA Lba, IN UINTN BufferSize, OUT VOID *Buffer -) +) { //debug("### ventoy_block_io_ramdisk_read sector:%u count:%u", (UINT32)Lba, (UINT32)BufferSize / 2048); @@ -364,12 +364,12 @@ EFI_STATUS EFIAPI ventoy_block_io_ramdisk_read (VOID)MediaId; CopyMem(Buffer, g_iso_data_buf + (Lba * 2048), BufferSize); - + if (g_blockio_start_record_bcd && FALSE == g_blockio_bcd_read_done) { if (*(UINT32 *)Buffer == 0x66676572) { - g_blockio_bcd_read_done = TRUE; + g_blockio_bcd_read_done = TRUE; } } @@ -429,14 +429,14 @@ EFI_LBA EFIAPI ventoy_fixup_iso9660_sector(IN EFI_LBA Lba, UINT32 secNum) return Lba; } -EFI_STATUS EFIAPI ventoy_block_io_read_real +EFI_STATUS EFIAPI ventoy_block_io_read_real ( IN EFI_BLOCK_IO_PROTOCOL *This, IN UINT32 MediaId, IN EFI_LBA Lba, IN UINTN BufferSize, OUT VOID *Buffer -) +) { UINT32 i = 0; UINT32 j = 0; @@ -450,7 +450,7 @@ EFI_STATUS EFIAPI ventoy_block_io_read_real UINT8 *lastbuffer; ventoy_sector_flag *cur_flag; ventoy_virt_chunk *node; - + debug("### block_io_read_real sector:%u count:%u Buffer:%p", (UINT32)Lba, (UINT32)BufferSize / 2048, Buffer); secNum = BufferSize / 2048; @@ -510,7 +510,7 @@ EFI_STATUS EFIAPI ventoy_block_io_read_real { if (curlba >= node->mem_sector_start && curlba < node->mem_sector_end) { - CopyMem((UINT8 *)Buffer + j * 2048, + CopyMem((UINT8 *)Buffer + j * 2048, (char *)g_virt_chunk + node->mem_sector_offset + (curlba - node->mem_sector_start) * 2048, 2048); cur_flag->flag = 1; @@ -564,7 +564,7 @@ EFI_STATUS EFIAPI ventoy_block_io_read IN EFI_LBA Lba, IN UINTN BufferSize, OUT VOID *Buffer -) +) { UINT32 IoAlign = 0; VOID *NewBuf = NULL; @@ -593,18 +593,18 @@ EFI_STATUS EFIAPI ventoy_block_io_read return Status; } -EFI_STATUS EFIAPI ventoy_block_io_write +EFI_STATUS EFIAPI ventoy_block_io_write ( IN EFI_BLOCK_IO_PROTOCOL *This, IN UINT32 MediaId, IN EFI_LBA Lba, IN UINTN BufferSize, IN VOID *Buffer -) +) { UINT32 secNum = 0; UINT64 offset = 0; - + (VOID)This; (VOID)MediaId; @@ -636,8 +636,8 @@ STATIC UINTN ventoy_get_current_device_path_id(VOID) EFI_STATUS Status = EFI_SUCCESS; EFI_DEVICE_PATH_PROTOCOL *DevicePath = NULL; VENDOR_DEVICE_PATH *venPath = NULL; - - Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiDevicePathProtocolGuid, + + Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiDevicePathProtocolGuid, NULL, &Count, &Handles); if (EFI_ERROR(Status)) { @@ -688,7 +688,7 @@ EFI_STATUS EFIAPI ventoy_fill_device_path(VOID) venPath->Header.Length[1] = 0; CopyMem(&venPath->Guid, &gVtoyBlockDevicePathGuid, sizeof(EFI_GUID)); CopyMem(venPath + 1, VtoyDpName, NameLen); - + gBlockData.Path = AppendDevicePathNode(NULL, (EFI_DEVICE_PATH_PROTOCOL *)TmpBuf); gBlockData.DevicePathCompareLen = sizeof(VENDOR_DEVICE_PATH) + NameLen; @@ -710,7 +710,7 @@ EFI_STATUS EFIAPI ventoy_connect_driver(IN EFI_HANDLE ControllerHandle, IN CONST debug("ventoy_connect_driver <%s>...", DrvName); - Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiComponentName2ProtocolGuid, + Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiComponentName2ProtocolGuid, NULL, &Count, &Handles); if (EFI_ERROR(Status)) { @@ -748,7 +748,7 @@ EFI_STATUS EFIAPI ventoy_connect_driver(IN EFI_HANDLE ControllerHandle, IN CONST FreePool(Handles); Handles = NULL; - Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiComponentNameProtocolGuid, + Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiComponentNameProtocolGuid, NULL, &Count, &Handles); if (EFI_ERROR(Status)) { @@ -781,10 +781,10 @@ EFI_STATUS EFIAPI ventoy_connect_driver(IN EFI_HANDLE ControllerHandle, IN CONST } Status = EFI_NOT_FOUND; - + end: FreePool(Handles); - + return Status; } @@ -805,11 +805,11 @@ STATIC BOOLEAN ventoy_filesystem_need_wrapper(IN CONST CHAR16 *DrvName) } /* - * suppress some file system drivers + * suppress some file system drivers * 1. rEFInd File System Driver * */ - + if (StrStr(UpperDrvName, L"REFIND") && StrStr(UpperDrvName, L"FILE SYSTEM")) { return TRUE; @@ -820,7 +820,7 @@ STATIC BOOLEAN ventoy_filesystem_need_wrapper(IN CONST CHAR16 *DrvName) STATIC VOID ventoy_add_filesystem_wrapper ( - IN EFI_DRIVER_BINDING_PROTOCOL *DriverBindProtocol, + IN EFI_DRIVER_BINDING_PROTOCOL *DriverBindProtocol, IN CONST CHAR16 *DriverName ) { @@ -865,10 +865,10 @@ STATIC EFI_STATUS ventoy_find_filesystem_driverbind(VOID) EFI_COMPONENT_NAME_PROTOCOL *NameProtocol = NULL; EFI_COMPONENT_NAME2_PROTOCOL *Name2Protocol = NULL; EFI_DRIVER_BINDING_PROTOCOL *DriverBindProtocol = NULL; - + debug("ventoy_find_filesystem_driverbind..."); - Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiComponentName2ProtocolGuid, + Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiComponentName2ProtocolGuid, NULL, &Count, &Handles); if (EFI_ERROR(Status)) { @@ -899,7 +899,7 @@ STATIC EFI_STATUS ventoy_find_filesystem_driverbind(VOID) FreePool(Handles); Handles = NULL; - Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiComponentNameProtocolGuid, + Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiComponentNameProtocolGuid, NULL, &Count, &Handles); if (EFI_ERROR(Status)) { @@ -927,7 +927,7 @@ STATIC EFI_STATUS ventoy_find_filesystem_driverbind(VOID) } FreePool(Handles); - + return EFI_SUCCESS; } @@ -988,7 +988,7 @@ EFI_STATUS ventoy_disable_ex_filesystem(VOID) debug("Wrapper Ex Driver Binding %lu", g_DriverBindWrapperCnt); ventoy_debug_pause(); - + return EFI_SUCCESS; } @@ -1046,10 +1046,10 @@ EFI_STATUS EFIAPI ventoy_block_io_read_512 if (BufferSize >= 2048) { ReadSize = BufferSize / 2048 * 2048; - + Status |= g_sector_2048_read(This, MediaId, Lba / 4, ReadSize, CurBuf); CurBuf += ReadSize; - + Lba += ReadSize / 512; BufferSize -= ReadSize; } @@ -1096,7 +1096,7 @@ EFI_STATUS EFIAPI ventoy_block_io_write_512 ReadSize = (4 - Mod) * 512; CopyMem(g_sector_buf + Mod * 512, CurBuf, ReadSize); g_sector_2048_write(This, MediaId, Lba / 4, 2048, g_sector_buf); - + CurBuf += ReadSize; Lba += (4 - Mod); BufferSize -= ReadSize; @@ -1106,10 +1106,10 @@ EFI_STATUS EFIAPI ventoy_block_io_write_512 if (BufferSize >= 2048) { ReadSize = BufferSize / 2048 * 2048; - + Status |= g_sector_2048_write(This, MediaId, Lba / 4, ReadSize, CurBuf); CurBuf += ReadSize; - + Lba += ReadSize / 512; BufferSize -= ReadSize; } @@ -1117,7 +1117,7 @@ EFI_STATUS EFIAPI ventoy_block_io_write_512 if (BufferSize > 0) { Status |= g_sector_2048_read(This, MediaId, Lba / 4, 2048, g_sector_buf); - + CopyMem(g_sector_buf, CurBuf, BufferSize); g_sector_2048_write(This, MediaId, Lba / 4, 2048, g_sector_buf); } @@ -1126,10 +1126,10 @@ EFI_STATUS EFIAPI ventoy_block_io_write_512 } EFI_STATUS EFIAPI ventoy_install_blockio(IN EFI_HANDLE ImageHandle, IN UINT64 ImgSize) -{ +{ EFI_STATUS Status = EFI_SUCCESS; EFI_BLOCK_IO_PROTOCOL *pBlockIo = &(gBlockData.BlockIo); - + ventoy_fill_device_path(); debug("install block io protocol %p", ImageHandle); @@ -1144,10 +1144,10 @@ EFI_STATUS EFIAPI ventoy_install_blockio(IN EFI_HANDLE ImageHandle, IN UINT64 Im else { gBlockData.Media.BlockSize = 2048; - gBlockData.Media.LastBlock = ImgSize / 2048 - 1; + gBlockData.Media.LastBlock = ImgSize / 2048 - 1; gBlockData.Media.ReadOnly = TRUE; } - + gBlockData.Media.MediaPresent = 1; gBlockData.Media.LogicalBlocksPerPhysicalBlock = 1; @@ -1164,10 +1164,10 @@ EFI_STATUS EFIAPI ventoy_install_blockio(IN EFI_HANDLE ImageHandle, IN UINT64 Im } else { - pBlockIo->ReadBlocks = gMemdiskMode ? ventoy_block_io_ramdisk_read : ventoy_block_io_read; + pBlockIo->ReadBlocks = gMemdiskMode ? ventoy_block_io_ramdisk_read : ventoy_block_io_read; pBlockIo->WriteBlocks = ventoy_block_io_write; } - + pBlockIo->FlushBlocks = ventoy_block_io_flush; Status = gBS->InstallMultipleProtocolInterfaces(&gBlockData.Handle, @@ -1295,7 +1295,7 @@ DEF_WRAP_FUNC(7); #error "VTOY_MAX_CONF_REPLACE overflow" #endif -static EFI_FILE_FLUSH_EX g_img_flush_func[VTOY_MAX_CONF_REPLACE] = +static EFI_FILE_FLUSH_EX g_img_flush_func[VTOY_MAX_CONF_REPLACE] = { ventoy_wrapper_file_flush_ex_img0, ventoy_wrapper_file_flush_ex_img1, @@ -1335,7 +1335,7 @@ STATIC ventoy_efi_file_replace *ventoy_wrapper_get_replace(EFI_FILE_HANDLE This) return g_img_file_replace + i; } } - + return NULL; } @@ -1369,7 +1369,7 @@ ventoy_wrapper_file_set_pos(EFI_FILE_HANDLE This, UINT64 Position) ventoy_efi_file_replace *replace = NULL; replace = ventoy_wrapper_get_replace(This); - + if (Position <= replace->FileSizeBytes) { replace->CurPos = Position; @@ -1378,7 +1378,7 @@ ventoy_wrapper_file_set_pos(EFI_FILE_HANDLE This, UINT64 Position) { replace->CurPos = replace->FileSizeBytes; } - + return EFI_SUCCESS; } @@ -1425,7 +1425,7 @@ ventoy_wrapper_file_get_info(EFI_FILE_HANDLE This, EFI_GUID *Type, UINTN *Len, V //Info->FileName = EFI_FILE_READ_ONLY; *Len = Info->Size; - + return EFI_SUCCESS; } @@ -1437,7 +1437,7 @@ ventoy_wrapper_file_read(EFI_FILE_HANDLE This, UINTN *Len, VOID *Data) ventoy_efi_file_replace *replace = NULL; replace = ventoy_wrapper_get_replace(This); - + debug("ventoy_wrapper_file_read ... %u", *Len); if (replace->CurPos + ReadLen > replace->FileSizeBytes) @@ -1494,7 +1494,7 @@ STATIC EFI_STATUS EFIAPI ventoy_wrapper_file_procotol(EFI_FILE_PROTOCOL *File, B STATIC BOOLEAN EFIAPI ventoy_replace_name_match(CHAR8 *pReplace, CHAR8 *pName) { UINTN Len1, Len2; - + Len1 = AsciiStrLen(pReplace); Len2 = AsciiStrLen(pName); @@ -1521,10 +1521,10 @@ STATIC BOOLEAN EFIAPI ventoy_replace_name_match(CHAR8 *pReplace, CHAR8 *pName) STATIC EFI_STATUS EFIAPI ventoy_wrapper_file_open ( - EFI_FILE_HANDLE This, + EFI_FILE_HANDLE This, EFI_FILE_HANDLE *New, - CHAR16 *Name, - UINT64 Mode, + CHAR16 *Name, + UINT64 Mode, UINT64 Attributes ) { @@ -1571,7 +1571,7 @@ STATIC EFI_STATUS EFIAPI ventoy_wrapper_file_open virt = g_virt_chunk + g_file_replace_list->new_file_virtual_id; Sectors = (virt->mem_sector_end - virt->mem_sector_start) + (virt->remap_sector_end - virt->remap_sector_start); - + g_efi_file_replace.BlockIoSectorStart = virt->mem_sector_start; g_efi_file_replace.FileSizeBytes = Sectors * 2048; @@ -1581,7 +1581,7 @@ STATIC EFI_STATUS EFIAPI ventoy_wrapper_file_open g_efi_file_replace.BlockIoSectorStart, Sectors, Sectors * 2048); sleep(3); } - + return Status; } } @@ -1605,9 +1605,9 @@ STATIC EFI_STATUS EFIAPI ventoy_wrapper_file_open { AsciiStrCpyS(OldName, sizeof(OldName), replace->old_file_name[j]); if ((0 == AsciiStrCmp(OldName, TmpName)) || - (AsciiStrnCmp(OldName, "\\loader\\entries\\", 16) == 0 && + (AsciiStrnCmp(OldName, "\\loader\\entries\\", 16) == 0 && AsciiStrCmp(OldName + 16, TmpName) == 0 - ) + ) ) { g_original_fclose(*New); @@ -1617,7 +1617,7 @@ STATIC EFI_STATUS EFIAPI ventoy_wrapper_file_open virt = g_virt_chunk + replace->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[i].BlockIoSectorStart = virt->mem_sector_start; g_img_file_replace[i].FileSizeBytes = Sectors * 2048; @@ -1627,7 +1627,7 @@ STATIC EFI_STATUS EFIAPI ventoy_wrapper_file_open g_img_file_replace[i].BlockIoSectorStart, Sectors, Sectors * 2048); sleep(3); } - + return Status; } } @@ -1648,7 +1648,7 @@ EFI_STATUS EFIAPI ventoy_wrapper_open_volume ) { EFI_STATUS Status = EFI_SUCCESS; - + Status = g_original_open_volume(This, Root); if (!EFI_ERROR(Status)) { @@ -1685,10 +1685,10 @@ STATIC EFI_STATUS EFIAPI ventoy_wrapper_read_key_ex KeyData->Key.UnicodeChar = 0; KeyData->KeyState.KeyShiftState = 0; KeyData->KeyState.KeyToggleState = 0; - + return EFI_SUCCESS; } - + return g_org_read_key_ex(This, KeyData); } @@ -1725,7 +1725,7 @@ EFI_STATUS ventoy_hook_keyboard_start(VOID) g_org_read_key = gST->ConIn->ReadKeyStroke; gST->ConIn->ReadKeyStroke = ventoy_wrapper_read_key; - + return EFI_SUCCESS; } @@ -1763,7 +1763,7 @@ STATIC EFI_STATUS EFIAPI ventoy_wrapper_locate_handle EFI_STATUS Status = EFI_SUCCESS; Status = g_org_locate_handle(SearchType, Protocol, SearchKey, BufferSize, Buffer); - + if (EFI_SUCCESS == Status && Protocol && CompareGuid(&gEfiBlockIoProtocolGuid, Protocol)) { for (i = 0; i < (*BufferSize) / sizeof(EFI_HANDLE); i++) @@ -1785,7 +1785,7 @@ EFI_STATUS ventoy_hook_1st_cdrom_start(VOID) { g_org_locate_handle = gBS->LocateHandle; gBS->LocateHandle = ventoy_wrapper_locate_handle; - + return EFI_SUCCESS; } @@ -1793,7 +1793,7 @@ EFI_STATUS ventoy_hook_1st_cdrom_stop(VOID) { gBS->LocateHandle = g_org_locate_handle; g_org_locate_handle = NULL; - + return EFI_SUCCESS; } diff --git a/EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/VtoyUtil/Memhole.c b/EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/VtoyUtil/Memhole.c index 715d7bcee65..4dbe89c8195 100644 --- a/EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/VtoyUtil/Memhole.c +++ b/EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/VtoyUtil/Memhole.c @@ -7,12 +7,12 @@ * 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 . * @@ -71,7 +71,7 @@ STATIC EFI_MEMORY_DESCRIPTOR* GetMemDesc ( OUT UINTN *pSize, OUT UINTN *pItemSize, - OUT UINTN *pDescCount + OUT UINTN *pDescCount ) { UINTN Size = 0; @@ -136,7 +136,7 @@ EFI_STATUS FixWindowsMemhole(IN EFI_HANDLE ImageHandle, IN CONST CHAR16 *CmdL EFI_MEMORY_DESCRIPTOR *Prev = NULL; EFI_MEMORY_DESCRIPTOR *Next = NULL; EFI_MEMORY_DESCRIPTOR *Curr = NULL; - + (VOID)ImageHandle; (VOID)CmdLine; @@ -173,7 +173,7 @@ EFI_STATUS FixWindowsMemhole(IN EFI_HANDLE ImageHandle, IN CONST CHAR16 *CmdL } Printf("Fixup Windows mmap issue OK (%lu)\n", TotalMem); - + return EFI_SUCCESS; } diff --git a/EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/VtoyUtil/VtoyDrv.c b/EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/VtoyUtil/VtoyDrv.c index 7886d66f962..d2fc191e5e8 100644 --- a/EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/VtoyUtil/VtoyDrv.c +++ b/EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/VtoyUtil/VtoyDrv.c @@ -7,12 +7,12 @@ * 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 . * @@ -74,11 +74,11 @@ EFI_STATUS ShowEfiDrivers(IN EFI_HANDLE ImageHandle, IN CONST CHAR16 *CmdLine EFI_STATUS Status = EFI_SUCCESS; EFI_COMPONENT_NAME_PROTOCOL *NameProtocol = NULL; EFI_COMPONENT_NAME2_PROTOCOL *Name2Protocol = NULL; - + (VOID)ImageHandle; (VOID)CmdLine; - Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiComponentName2ProtocolGuid, + Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiComponentName2ProtocolGuid, NULL, &Count, &Handles); if (EFI_ERROR(Status)) { @@ -105,7 +105,7 @@ EFI_STATUS ShowEfiDrivers(IN EFI_HANDLE ImageHandle, IN CONST CHAR16 *CmdLine FreePool(Handles); Handles = NULL; - Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiComponentNameProtocolGuid, + Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiComponentNameProtocolGuid, NULL, &Count, &Handles); if (EFI_ERROR(Status)) { @@ -134,7 +134,7 @@ EFI_STATUS ShowEfiDrivers(IN EFI_HANDLE ImageHandle, IN CONST CHAR16 *CmdLine { Printf("%2d %s\n", i, g_EfiDriverNameList[i]); } - + return EFI_SUCCESS; } diff --git a/EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/VtoyUtil/VtoyUtil.c b/EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/VtoyUtil/VtoyUtil.c index 65212c23cc9..9b1b14a3c9e 100644 --- a/EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/VtoyUtil/VtoyUtil.c +++ b/EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/VtoyUtil/VtoyUtil.c @@ -7,12 +7,12 @@ * 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 . * @@ -41,7 +41,7 @@ STATIC CONST CHAR16 *gCurFeature= NULL; STATIC CHAR16 *gCmdLine = NULL; STATIC grub_env_printf_pf g_env_printf = NULL; -STATIC VtoyUtilFeature gFeatureList[] = +STATIC VtoyUtilFeature gFeatureList[] = { { L"fix_windows_mmap", FixWindowsMemhole }, { L"show_efi_drivers", ShowEfiDrivers }, @@ -93,7 +93,7 @@ VOID EFIAPI VtoyUtilDebug(IN CONST CHAR8 *Format, ...) } STATIC EFI_STATUS ParseCmdline(IN EFI_HANDLE ImageHandle) -{ +{ CHAR16 *pPos = NULL; CHAR16 *pCmdLine = NULL; EFI_STATUS Status = EFI_SUCCESS; @@ -117,7 +117,7 @@ STATIC EFI_STATUS ParseCmdline(IN EFI_HANDLE ImageHandle) gST->ConOut->OutputString(gST->ConOut, L"\r\n##########################"); return EFI_SUCCESS; } - + if (StrStr(pCmdLine, L"debug")) { gVtoyDebugPrint = TRUE; @@ -139,9 +139,9 @@ STATIC EFI_STATUS ParseCmdline(IN EFI_HANDLE ImageHandle) } gCurFeature = pPos + StrLen(L"feature="); - + gCmdLine = pCmdLine; - + return EFI_SUCCESS; } @@ -153,7 +153,7 @@ EFI_STATUS EFIAPI VtoyUtilEfiMain { UINTN i; UINTN Len; - + ParseCmdline(ImageHandle); for (i = 0; gCurFeature && i < ARRAY_SIZE(gFeatureList); i++) @@ -170,7 +170,7 @@ EFI_STATUS EFIAPI VtoyUtilEfiMain if (gCmdLine) { FreePool(gCmdLine); - gCmdLine = NULL; + gCmdLine = NULL; } return EFI_SUCCESS; diff --git a/EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/VtoyUtil/VtoyUtil.h b/EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/VtoyUtil/VtoyUtil.h index f0c9b2586ce..bfa80b13d3e 100644 --- a/EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/VtoyUtil/VtoyUtil.h +++ b/EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/VtoyUtil/VtoyUtil.h @@ -7,17 +7,17 @@ * 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 . * */ - + #ifndef __VTOYUTIL_H__ #define __VTOYUTIL_H__ @@ -44,14 +44,14 @@ typedef struct ventoy_grub_param grub_env_set_pf grub_env_set; ventoy_grub_param_file_replace file_replace; ventoy_grub_param_file_replace img_replace[VTOY_MAX_CONF_REPLACE]; - grub_env_printf_pf grub_env_printf; + grub_env_printf_pf grub_env_printf; }ventoy_grub_param; #pragma pack() typedef struct VtoyUtilFeature { - CONST CHAR16 *Cmd; + CONST CHAR16 *Cmd; VTOY_UTIL_PROC_PF MainProc; }VtoyUtilFeature; diff --git a/EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/VtoyUtil/VtoyUtil.inf b/EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/VtoyUtil/VtoyUtil.inf index c422b7d13b4..8db336b837f 100644 --- a/EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/VtoyUtil/VtoyUtil.inf +++ b/EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/VtoyUtil/VtoyUtil.inf @@ -1,19 +1,19 @@ #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ [Defines] @@ -45,7 +45,7 @@ gShellVariableGuid gEfiVirtualCdGuid gEfiFileInfoGuid - + [Protocols] gEfiLoadedImageProtocolGuid gEfiBlockIoProtocolGuid @@ -73,9 +73,9 @@ gEfiSimpleTextInProtocolGuid gEfiSimpleTextInputExProtocolGuid gEfiSimpleTextOutProtocolGuid - - - - - - + + + + + + diff --git a/EDK2/efiffs/mod/grub/grub-core/fs/iso9660.c b/EDK2/efiffs/mod/grub/grub-core/fs/iso9660.c index bae3f621445..e407afb6f0c 100644 --- a/EDK2/efiffs/mod/grub/grub-core/fs/iso9660.c +++ b/EDK2/efiffs/mod/grub/grub-core/fs/iso9660.c @@ -193,7 +193,7 @@ static grub_err_t iso9660_to_unixtime (const struct grub_iso9660_date *i, grub_int32_t *nix) { struct grub_datetime datetime; - + if (! i->year[0] && ! i->year[1] && ! i->year[2] && ! i->year[3] && ! i->month[0] && ! i->month[1] @@ -210,7 +210,7 @@ iso9660_to_unixtime (const struct grub_iso9660_date *i, grub_int32_t *nix) datetime.hour = (i->hour[0] - '0') * 10 + (i->hour[1] - '0'); datetime.minute = (i->minute[0] - '0') * 10 + (i->minute[1] - '0'); datetime.second = (i->second[0] - '0') * 10 + (i->second[1] - '0'); - + if (!grub_datetime2unixtime (&datetime, nix)) return grub_error (GRUB_ERR_BAD_NUMBER, "incorrect date"); *nix -= i->offset * 60 * 15; @@ -228,7 +228,7 @@ iso9660_to_unixtime2 (const struct grub_iso9660_date2 *i, grub_int32_t *nix) datetime.hour = i->hour; datetime.minute = i->minute; datetime.second = i->second; - + if (!grub_datetime2unixtime (&datetime, nix)) return 0; *nix -= i->offset * 60 * 15; @@ -511,7 +511,7 @@ grub_iso9660_mount (grub_disk_t disk) static char * grub_iso9660_read_symlink (grub_fshelp_node_t node) { - return node->have_symlink + return node->have_symlink ? grub_strdup (node->symlink + (node->have_dirents) * sizeof (node->dirents[0]) - sizeof (node->dirents)) : grub_strdup (""); @@ -550,7 +550,7 @@ add_part (struct iterate_dir_ctx *ctx, return; grub_memcpy (ctx->symlink + size, part, len2); - ctx->symlink[size + len2] = 0; + ctx->symlink[size + len2] = 0; } static grub_err_t @@ -793,7 +793,7 @@ grub_iso9660_iterate_dir (grub_fshelp_node_t dir, { struct grub_fshelp_node *new_node; node->alloc_dirents *= 2; - new_node = grub_realloc (node, + new_node = grub_realloc (node, sizeof (struct grub_fshelp_node) + ((node->alloc_dirents - ARRAY_SIZE (node->dirents)) @@ -1085,7 +1085,7 @@ grub_iso9660_uuid (grub_device_t device, char **uuid) } /* Get writing time of filesystem. */ -static grub_err_t +static grub_err_t grub_iso9660_mtime (grub_device_t device, grub_int32_t *timebuf) { struct grub_iso9660_data *data; diff --git a/EDK2/efiffs/org/grub/grub-core/fs/iso9660.c b/EDK2/efiffs/org/grub/grub-core/fs/iso9660.c index 7ff140ef8fe..1c6b43e505d 100644 --- a/EDK2/efiffs/org/grub/grub-core/fs/iso9660.c +++ b/EDK2/efiffs/org/grub/grub-core/fs/iso9660.c @@ -192,7 +192,7 @@ static grub_err_t iso9660_to_unixtime (const struct grub_iso9660_date *i, grub_int32_t *nix) { struct grub_datetime datetime; - + if (! i->year[0] && ! i->year[1] && ! i->year[2] && ! i->year[3] && ! i->month[0] && ! i->month[1] @@ -209,7 +209,7 @@ iso9660_to_unixtime (const struct grub_iso9660_date *i, grub_int32_t *nix) datetime.hour = (i->hour[0] - '0') * 10 + (i->hour[1] - '0'); datetime.minute = (i->minute[0] - '0') * 10 + (i->minute[1] - '0'); datetime.second = (i->second[0] - '0') * 10 + (i->second[1] - '0'); - + if (!grub_datetime2unixtime (&datetime, nix)) return grub_error (GRUB_ERR_BAD_NUMBER, "incorrect date"); *nix -= i->offset * 60 * 15; @@ -227,7 +227,7 @@ iso9660_to_unixtime2 (const struct grub_iso9660_date2 *i, grub_int32_t *nix) datetime.hour = i->hour; datetime.minute = i->minute; datetime.second = i->second; - + if (!grub_datetime2unixtime (&datetime, nix)) return 0; *nix -= i->offset * 60 * 15; @@ -510,7 +510,7 @@ grub_iso9660_mount (grub_disk_t disk) static char * grub_iso9660_read_symlink (grub_fshelp_node_t node) { - return node->have_symlink + return node->have_symlink ? grub_strdup (node->symlink + (node->have_dirents) * sizeof (node->dirents[0]) - sizeof (node->dirents)) : grub_strdup (""); @@ -549,7 +549,7 @@ add_part (struct iterate_dir_ctx *ctx, return; grub_memcpy (ctx->symlink + size, part, len2); - ctx->symlink[size + len2] = 0; + ctx->symlink[size + len2] = 0; } static grub_err_t @@ -789,7 +789,7 @@ grub_iso9660_iterate_dir (grub_fshelp_node_t dir, { struct grub_fshelp_node *new_node; node->alloc_dirents *= 2; - new_node = grub_realloc (node, + new_node = grub_realloc (node, sizeof (struct grub_fshelp_node) + ((node->alloc_dirents - ARRAY_SIZE (node->dirents)) @@ -1081,7 +1081,7 @@ grub_iso9660_uuid (grub_device_t device, char **uuid) } /* Get writing time of filesystem. */ -static grub_err_t +static grub_err_t grub_iso9660_mtime (grub_device_t device, grub_int32_t *timebuf) { struct grub_iso9660_data *data; diff --git a/EfiISO/mkefiiso.sh b/EfiISO/mkefiiso.sh index b5abaa6054b..0635e63c270 100644 --- a/EfiISO/mkefiiso.sh +++ b/EfiISO/mkefiiso.sh @@ -3,7 +3,7 @@ rm -f ventoy_efiboot.img.* cd ISO -mkisofs -R -D -sysid VENTOY -V VENTOY -P "longpanda admin@ventoy.net" -p 'https://www.ventoy.net' -o ../ventoy_efiboot.img ./ +mkisofs -R -D -sysid VENTOY -V VENTOY -P "longpanda admin@ventoy.net" -p 'https://www.ventoy.net' -o ../ventoy_efiboot.img ./ cd .. xz --check=crc32 ventoy_efiboot.img diff --git a/ExFAT/buidexfat.sh b/ExFAT/buidexfat.sh index 53d0e0ca336..c19d74e7341 100644 --- a/ExFAT/buidexfat.sh +++ b/ExFAT/buidexfat.sh @@ -1,6 +1,6 @@ #!/bin/bash -# -# For 32bit, for example CentOS 6.10 i386 +# +# For 32bit, for example CentOS 6.10 i386 # automake 1.11.1 must update to automake 1.11.2 # pkg-config must be installed # diff --git a/FUSEISO/vtoy_fuse_iso.c b/FUSEISO/vtoy_fuse_iso.c index 0178c8d9c41..112776b5854 100644 --- a/FUSEISO/vtoy_fuse_iso.c +++ b/FUSEISO/vtoy_fuse_iso.c @@ -7,12 +7,12 @@ * 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 . * @@ -71,16 +71,16 @@ static int ventoy_iso_getattr(const char *path, struct stat *statinfo) ret = 0; } } - + return ret; } static int ventoy_iso_readdir ( - const char *path, - void *buf, + const char *path, + void *buf, fuse_fill_dir_t filler, - off_t offset, + off_t offset, struct fuse_file_info *file ) { @@ -121,7 +121,7 @@ static int ventoy_read_iso_sector(uint32_t sector, uint32_t num, char *buf) uint32_t readSec = 0; off_t offset = 0; dmtable_entry *entry = NULL; - + for (i = 0; i < g_disk_entry_num && num > 0; i++) { entry = g_disk_entry_list + i; @@ -146,7 +146,7 @@ static int ventoy_read_iso_sector(uint32_t sector, uint32_t num, char *buf) static int ventoy_iso_read ( - const char *path, char *buf, + const char *path, char *buf, size_t size, off_t offset, struct fuse_file_info *file ) @@ -157,12 +157,12 @@ static int ventoy_iso_read uint32_t number = 0; size_t leftsize = 0; char secbuf[512]; - + (void)file; - + if(strcmp(path, g_iso_file_name) != 0) { - return -ENOENT; + return -ENOENT; } if (offset >= g_iso_file_size) @@ -174,7 +174,7 @@ static int ventoy_iso_read { size = g_iso_file_size - offset; } - + leftsize = size; sector = offset / 512; @@ -213,7 +213,7 @@ static int ventoy_iso_read return size; } -static struct fuse_operations ventoy_op = +static struct fuse_operations ventoy_op = { .getattr = ventoy_iso_getattr, .readdir = ventoy_iso_readdir, @@ -238,8 +238,8 @@ static int ventoy_parse_dmtable(const char *filename) /* read untill the last line */ while (fgets(line, sizeof(line), fp) && g_disk_entry_num < MAX_ENTRY_NUM) { - sscanf(line, "%u %u linear %s %llu", - &entry->isoSector, &entry->sectorNum, + sscanf(line, "%u %u linear %s %llu", + &entry->isoSector, &entry->sectorNum, diskname, &entry->diskSector); g_iso_file_size += (uint64_t)entry->sectorNum * 512ULL; @@ -274,12 +274,12 @@ int main(int argc, char **argv) /* Avoid to be killed by systemd */ if (access("/etc/initrd-release", F_OK) >= 0) - { + { argv[0][0] = '@'; } g_iso_file_name[0] = '/'; - + while ((ch = getopt(argc, argv, "f:s:m:v::t::")) != -1) { if (ch == 'f') diff --git a/GRUB2/MOD_SRC/grub-2.04/gentpl.py b/GRUB2/MOD_SRC/grub-2.04/gentpl.py index fcdb8adcfb1..5df976c3a6b 100644 --- a/GRUB2/MOD_SRC/grub-2.04/gentpl.py +++ b/GRUB2/MOD_SRC/grub-2.04/gentpl.py @@ -458,7 +458,7 @@ def gvar_add(var, value): output(var + " += " + value + "\n") # -# Per PROGRAM/SCRIPT variables +# Per PROGRAM/SCRIPT variables # seen_vars = set() diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/Makefile.core.def b/GRUB2/MOD_SRC/grub-2.04/grub-core/Makefile.core.def index c76386f66af..3efc2bbb431 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/Makefile.core.def +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/Makefile.core.def @@ -459,7 +459,7 @@ image = { i386_pc = boot/i386/pc/boot.S; cppflags = '-DHYBRID_BOOT=1'; - + i386_pc_ldflags = '$(TARGET_IMG_LDFLAGS)'; i386_pc_ldflags = '$(TARGET_IMG_BASE_LDOPT),0x7C00'; diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/boot/i386/pc/boot.S b/GRUB2/MOD_SRC/grub-2.04/grub-core/boot/i386/pc/boot.S index bc544f783a1..bc7ac332fc2 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/boot/i386/pc/boot.S +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/boot/i386/pc/boot.S @@ -217,7 +217,7 @@ boot_drive_check: /* Ignore %dl different from 0-0x0f and 0x80-0x8f. */ testb $0x70, %dl jz 1f -2: +2: movb $0x80, %dl 1: /* @@ -540,6 +540,6 @@ nt_magic: #endif .org GRUB_BOOT_MACHINE_PART_END - + /* the last 2 bytes in the sector 0 contain the signature */ .word GRUB_BOOT_MACHINE_SIGNATURE diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/commands/hashsum.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/commands/hashsum.c index f38c18c2770..cb676bd13cc 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/commands/hashsum.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/commands/hashsum.c @@ -39,7 +39,7 @@ static const struct grub_arg_option options[] = { {0, 0, 0, 0, 0, 0} }; -static struct { const char *name; const char *hashname; } aliases[] = +static struct { const char *name; const char *hashname; } aliases[] = { {"sha256sum", "sha256"}, {"sha512sum", "sha512"}, @@ -106,7 +106,7 @@ hash_file (grub_file_t file, const gcry_md_spec_t *hash, void *result) if (progress) { grub_printf("\rCalculating %s 100%% \n\r\n", hash->name); - grub_refresh(); + grub_refresh(); } return GRUB_ERR_NONE; @@ -134,7 +134,7 @@ check_list (const gcry_md_spec_t *hash, const char *hashfilename, hashlist = grub_file_open (hashfilename, GRUB_FILE_TYPE_HASHLIST); if (!hashlist) return grub_errno; - + while (grub_free (buf), (buf = grub_file_getline (hashlist))) { const char *p = buf; @@ -155,7 +155,7 @@ check_list (const gcry_md_spec_t *hash, const char *hashfilename, if (prefix) { char *filename; - + filename = grub_xasprintf ("%s/%s", prefix, p); if (!filename) return grub_errno; @@ -201,7 +201,7 @@ check_list (const gcry_md_spec_t *hash, const char *hashfilename, "hash of '%s' mismatches", p); } mismatch++; - continue; + continue; } grub_printf_ (N_("%s: OK\n"), p); } diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/commands/legacycfg.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/commands/legacycfg.c index 891eac5a33f..aae5e009525 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/commands/legacycfg.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/commands/legacycfg.c @@ -104,7 +104,7 @@ legacy_file (const char *filename) if (newsuffix) { char *t; - + t = suffix; suffix = grub_realloc (suffix, grub_strlen (suffix) + grub_strlen (newsuffix) + 1); @@ -239,8 +239,8 @@ grub_cmd_legacy_source (struct grub_command *cmd, } static enum - { - GUESS_IT, LINUX, MULTIBOOT, KFREEBSD, KNETBSD, KOPENBSD + { + GUESS_IT, LINUX, MULTIBOOT, KFREEBSD, KNETBSD, KOPENBSD } kernel_type; static grub_err_t @@ -255,7 +255,7 @@ grub_cmd_legacy_kernel (struct grub_command *mycmd __attribute__ ((unused)), char **cutargs; int cutargc; grub_err_t err = GRUB_ERR_NONE; - + for (i = 0; i < 2; i++) { /* FIXME: really support this. */ @@ -392,7 +392,7 @@ grub_cmd_legacy_kernel (struct grub_command *mycmd __attribute__ ((unused)), if (dev) grub_device_close (dev); } - + /* k*BSD didn't really work well with grub-legacy. */ if (kernel_type == GUESS_IT || kernel_type == KFREEBSD) { @@ -614,7 +614,7 @@ check_password_md5_real (const char *entered, digest = GRUB_MD_MD5->read (ctx); GRUB_MD_MD5->final (ctx); grub_memcpy (alt_result, digest, MD5_HASHLEN); - + GRUB_MD_MD5->init (ctx); GRUB_MD_MD5->write (ctx, entered, enteredlen); GRUB_MD_MD5->write (ctx, pw->salt, pw->saltlen); /* include the $1$ header */ @@ -636,7 +636,7 @@ check_password_md5_real (const char *entered, GRUB_MD_MD5->write (ctx, entered, enteredlen); else GRUB_MD_MD5->write (ctx, alt_result, 16); - + if (i % 3 != 0) GRUB_MD_MD5->write (ctx, pw->salt + 3, pw->saltlen - 3); diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/commands/search.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/commands/search.c index 70d0fce200d..8d54ab1a334 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/commands/search.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/commands/search.c @@ -189,14 +189,14 @@ part_hook (grub_disk_t disk, const grub_partition_t partition, void *data) if (!devname) return 1; ret = iterate_device (devname, ctx); - grub_free (devname); + grub_free (devname); return ret; } /* Helper for FUNC_NAME. */ static void -try (struct search_ctx *ctx) +try (struct search_ctx *ctx) { unsigned i; struct cache_entry **prev; diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/commands/test.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/commands/test.c index 9669a482105..6dc356293e9 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/commands/test.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/commands/test.c @@ -382,7 +382,7 @@ test_parse (char **args, int *argn, int argc) (*argn) += 2; continue; } - + if (grub_strcmp (args[*argn], "-D") == 0) { g_test_case_insensitive = 1; @@ -400,7 +400,7 @@ test_parse (char **args, int *argn, int argc) (*argn) += 2; continue; } - + if (grub_strcmp (args[*argn], "-E") == 0) { g_test_case_insensitive = 1; diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/disk/i386/pc/biosdisk.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/disk/i386/pc/biosdisk.c index a5146ff1aa2..16028c9ec7d 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/disk/i386/pc/biosdisk.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/disk/i386/pc/biosdisk.c @@ -71,7 +71,7 @@ static int grub_biosdisk_get_num_floppies (void) * non-zero, otherwise zero. */ -static int +static int grub_biosdisk_rw_int13_extensions (int ah, int drive, void *dap) { struct grub_bios_int_registers regs; @@ -91,7 +91,7 @@ grub_biosdisk_rw_int13_extensions (int ah, int drive, void *dap) * NSEC sectors from COFF/HOFF/SOFF into SEGMENT. If an error occurs, * return non-zero, otherwise zero. */ -static int +static int grub_biosdisk_rw_standard (int ah, int drive, int coff, int hoff, int soff, int nsec, int segment) { @@ -110,7 +110,7 @@ grub_biosdisk_rw_standard (int ah, int drive, int coff, int hoff, /* set bits 0-5 of %cl to sector */ regs.ecx |= soff & 0x3f; - /* set %dh to head and %dl to drive */ + /* set %dh to head and %dl to drive */ regs.edx = (drive & 0xff) | ((hoff << 8) & 0xff00); /* set %ah to AH */ regs.eax = (ah << 8) & 0xff00; @@ -153,7 +153,7 @@ grub_biosdisk_check_int13_extensions (int drive) regs.ebx = 0x55aa; regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; grub_bios_interrupt (0x13, ®s); - + if (regs.flags & GRUB_CPU_INT_FLAGS_CARRY) return 0; @@ -171,7 +171,7 @@ grub_biosdisk_check_int13_extensions (int drive) * Return the geometry of DRIVE in CYLINDERS, HEADS and SECTORS. If an * error occurs, then return non-zero, otherwise zero. */ -static int +static int grub_biosdisk_get_diskinfo_standard (int drive, unsigned long *cylinders, unsigned long *heads, @@ -185,12 +185,12 @@ grub_biosdisk_get_diskinfo_standard (int drive, regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; grub_bios_interrupt (0x13, ®s); - /* Check if unsuccessful. Ignore return value if carry isn't set to + /* Check if unsuccessful. Ignore return value if carry isn't set to workaround some buggy BIOSes. */ if ((regs.flags & GRUB_CPU_INT_FLAGS_CARRY) && ((regs.eax & 0xff00) != 0)) return (regs.eax & 0xff00) >> 8; - /* bogus BIOSes may not return an error number */ + /* bogus BIOSes may not return an error number */ /* 0 sectors means no disk */ if (!(regs.ecx & 0x3f)) /* XXX 0x60 is one of the unused error numbers */ @@ -218,7 +218,7 @@ grub_biosdisk_get_diskinfo_real (int drive, void *drp, grub_uint16_t ax) regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; grub_bios_interrupt (0x13, ®s); - /* Check if unsuccessful. Ignore return value if carry isn't set to + /* Check if unsuccessful. Ignore return value if carry isn't set to workaround some buggy BIOSes. */ if ((regs.flags & GRUB_CPU_INT_FLAGS_CARRY) && ((regs.eax & 0xff00) != 0)) return (regs.eax & 0xff00) >> 8; @@ -365,11 +365,11 @@ grub_biosdisk_rw (int cmd, grub_disk_t disk, static int ventoy_is_mbr_match(ventoy_mbr_head *head) { grub_uint32_t PartStartSector; - + if (head->Byte55 != 0x55 || head->ByteAA != 0xAA) { return 0; } - + if (head->PartTbl[2].SectorCount > 0 || head->PartTbl[3].SectorCount > 0) { return 0; } @@ -503,7 +503,7 @@ grub_biosdisk_open (const char *name, grub_disk_t disk) disk->data = data; //fixup some buggy bios - if (total_sectors > (16434495 - 2097152) && total_sectors < (16434495 + 2097152) && + if (total_sectors > (16434495 - 2097152) && total_sectors < (16434495 + 2097152) && (data->flags & GRUB_BIOSDISK_FLAG_LBA) > 0 && (data->flags & GRUB_BIOSDISK_FLAG_CDROM) == 0) { if (grub_biosdisk_rw(0, disk, 0, 1, GRUB_MEMORY_MACHINE_SCRATCH_SEG) == 0) { ventoy_mbr_head *mbr = (ventoy_mbr_head *)GRUB_MEMORY_MACHINE_SCRATCH_ADDR; diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/font/font.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/font/font.c index b12fb6b97af..3d1ec8b50f2 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/font/font.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/font/font.c @@ -928,7 +928,7 @@ grub_font_get_height (grub_font_t font) } /* Get the glyph for FONT corresponding to the Unicode code point CODE. - Returns the ASCII glyph for the code if no other fonts are available. + Returns the ASCII glyph for the code if no other fonts are available. The glyphs are cached once loaded. */ struct grub_font_glyph * grub_font_get_glyph (grub_font_t font, grub_uint32_t code) diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/fs/ext2.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/fs/ext2.c index 0a69a96e6f9..bbb885179e3 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/fs/ext2.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/fs/ext2.c @@ -1105,8 +1105,8 @@ int grub_ext_get_file_chunk(grub_uint64_t part_start, grub_file_t file, ventoy_i { return 0; } - - i += g_ventoy_block_count; + + i += g_ventoy_block_count; blknr = blknr << log2blocksize; grub_disk_blocklist_read(chunk_list, blknr, g_ventoy_block_count * blocksize, disk->log_sector_size); } diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/fs/fat.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/fs/fat.c index 439ec41000c..1abcf3c1f61 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/fs/fat.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/fs/fat.c @@ -247,7 +247,7 @@ grub_fat_mount (grub_disk_t disk) #ifdef MODE_EXFAT if (grub_memcmp ((const char *) bpb.oem_name, "EXFAT ", sizeof (bpb.oem_name)) != 0) - goto fail; + goto fail; #endif /* Get the sizes of logical sectors and clusters. */ @@ -322,7 +322,7 @@ grub_fat_mount (grub_disk_t disk) #endif #ifdef MODE_EXFAT - data->cluster_sector = (grub_le_to_cpu32 (bpb.cluster_offset) + data->cluster_sector = (grub_le_to_cpu32 (bpb.cluster_offset) << data->logical_sector_bits); data->num_clusters = (grub_le_to_cpu32 (bpb.cluster_count) << data->logical_sector_bits); @@ -694,7 +694,7 @@ grub_fat_iterate_dir_next (grub_fshelp_node_t node, { int j; for (j = 0; j < 15; j++) - ctxt->unibuf[slots * 15 + j] + ctxt->unibuf[slots * 15 + j] = grub_le_to_cpu16 (sec.type_specific.file_name.str[j]); slots++; } @@ -967,7 +967,7 @@ grub_fat_dir (grub_device_t device, const char *path, grub_fs_dir_hook_t hook, if (!info.dir) info.size = ctxt.dir.file_size; - + #ifdef MODE_EXFAT if (!ctxt.dir.have_stream) continue; @@ -1335,12 +1335,12 @@ int grub_fat_get_file_chunk(grub_uint64_t part_start, grub_file_t file, ventoy_i break; } - /* Read the FAT. */ + /* Read the FAT. */ if (grub_disk_read (disk, node->data->fat_sector, fat_offset, (node->data->fat_size + 7) >> 3, (char *) &next_cluster)) { - return -1; + return -1; } next_cluster = grub_le_to_cpu32 (next_cluster); diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/fs/fshelp.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/fs/fshelp.c index 53a65ec2e46..0dff5bd6e8a 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/fs/fshelp.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/fs/fshelp.c @@ -222,7 +222,7 @@ find_file (char *currpath, break; push_node (ctx, foundnode, foundtype); - + /* Read in the symlink and follow it. */ if (ctx->currnode->type == GRUB_FSHELP_SYMLINK) { @@ -333,7 +333,7 @@ grub_fshelp_find_file (const char *path, grub_fshelp_node_t rootnode, enum grub_fshelp_filetype expecttype) { return grub_fshelp_find_file_real (path, rootnode, foundnode, - iterate_dir, NULL, + iterate_dir, NULL, read_symlink, expecttype); } @@ -346,7 +346,7 @@ grub_fshelp_find_file_lookup (const char *path, grub_fshelp_node_t rootnode, enum grub_fshelp_filetype expecttype) { return grub_fshelp_find_file_real (path, rootnode, foundnode, - NULL, lookup_file, + NULL, lookup_file, read_symlink, expecttype); } diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/fs/iso9660.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/fs/iso9660.c index 9a26bb21ab5..7e2b243f79d 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/fs/iso9660.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/fs/iso9660.c @@ -190,7 +190,7 @@ static grub_err_t iso9660_to_unixtime (const struct grub_iso9660_date *i, grub_int32_t *nix) { struct grub_datetime datetime; - + if (! i->year[0] && ! i->year[1] && ! i->year[2] && ! i->year[3] && ! i->month[0] && ! i->month[1] @@ -207,7 +207,7 @@ iso9660_to_unixtime (const struct grub_iso9660_date *i, grub_int32_t *nix) datetime.hour = (i->hour[0] - '0') * 10 + (i->hour[1] - '0'); datetime.minute = (i->minute[0] - '0') * 10 + (i->minute[1] - '0'); datetime.second = (i->second[0] - '0') * 10 + (i->second[1] - '0'); - + if (!grub_datetime2unixtime (&datetime, nix)) return grub_error (GRUB_ERR_BAD_NUMBER, "incorrect date"); *nix -= i->offset * 60 * 15; @@ -225,7 +225,7 @@ iso9660_to_unixtime2 (const struct grub_iso9660_date2 *i, grub_int32_t *nix) datetime.hour = i->hour; datetime.minute = i->minute; datetime.second = i->second; - + if (!grub_datetime2unixtime (&datetime, nix)) return 0; *nix -= i->offset * 60 * 15; @@ -512,7 +512,7 @@ grub_iso9660_mount (grub_disk_t disk) static char * grub_iso9660_read_symlink (grub_fshelp_node_t node) { - return node->have_symlink + return node->have_symlink ? grub_strdup (node->symlink + (node->have_dirents) * sizeof (node->dirents[0]) - sizeof (node->dirents)) : grub_strdup (""); @@ -551,7 +551,7 @@ add_part (struct iterate_dir_ctx *ctx, return; grub_memcpy (ctx->symlink + size, part, len2); - ctx->symlink[size + len2] = 0; + ctx->symlink[size + len2] = 0; } static grub_err_t @@ -798,7 +798,7 @@ grub_iso9660_iterate_dir (grub_fshelp_node_t dir, { struct grub_fshelp_node *new_node; node->alloc_dirents *= 2; - new_node = grub_realloc (node, + new_node = grub_realloc (node, sizeof (struct grub_fshelp_node) + ((node->alloc_dirents - ARRAY_SIZE (node->dirents)) @@ -1092,7 +1092,7 @@ grub_iso9660_uuid (grub_device_t device, char **uuid) } /* Get writing time of filesystem. */ -static grub_err_t +static grub_err_t grub_iso9660_mtime (grub_device_t device, grub_int32_t *timebuf) { struct grub_iso9660_data *data; diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/fs/ntfs.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/fs/ntfs.c index 986ef755d18..843047d6da8 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/fs/ntfs.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/fs/ntfs.c @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -#define grub_fshelp_node grub_ntfs_file +#define grub_fshelp_node grub_ntfs_file #include #include @@ -32,7 +32,7 @@ GRUB_MOD_LICENSE ("GPLv3+"); static grub_dl_t my_mod; -#define grub_fshelp_node grub_ntfs_file +#define grub_fshelp_node grub_ntfs_file static inline grub_uint16_t u16at (void *ptr, grub_size_t ofs) @@ -725,7 +725,7 @@ grub_ntfs_read_symlink (grub_fshelp_node_t node) && grub_isalpha (buf[4])) { grub_memmove (buf, buf + 6, end - buf + 1 - 6); - end -= 6; + end -= 6; } return buf; } @@ -997,10 +997,10 @@ grub_ntfs_dir_iter (const char *filename, enum grub_fshelp_filetype filetype, grub_memset (&info, 0, sizeof (info)); info.dir = ((filetype & GRUB_FSHELP_TYPE_MASK) == GRUB_FSHELP_DIR); info.mtimeset = 1; - info.mtime = grub_divmod64 (node->mtime, 10000000, 0) + info.mtime = grub_divmod64 (node->mtime, 10000000, 0) - 86400ULL * 365 * (1970 - 1601) - 86400ULL * ((1970 - 1601) / 4) + 86400ULL * ((1970 - 1601) / 100); - if (!info.dir) + if (!info.dir) info.size = node->size; grub_free (node); return ctx->hook (filename, &info, ctx->hook_data); diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/fs/squash4.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/fs/squash4.c index 06a4a3c0536..fdb5c56a906 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/fs/squash4.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/fs/squash4.c @@ -212,7 +212,7 @@ struct grub_fshelp_node struct grub_squash_data *data; struct grub_squash_inode ino; grub_size_t stsize; - struct + struct { grub_disk_addr_t ino_chunk; grub_uint16_t ino_offset; @@ -245,7 +245,7 @@ read_chunk (struct grub_squash_data *data, void *buf, grub_size_t len, csize = SQUASH_CHUNK_SIZE - offset; if (csize > len) csize = len; - + if (grub_le_to_cpu16 (d) & SQUASH_CHUNK_UNCOMPRESSED) { grub_disk_addr_t a = chunk_start + 2 + offset; @@ -258,7 +258,7 @@ read_chunk (struct grub_squash_data *data, void *buf, grub_size_t len, else { char *tmp; - grub_size_t bsize = grub_le_to_cpu16 (d) & ~SQUASH_CHUNK_FLAGS; + grub_size_t bsize = grub_le_to_cpu16 (d) & ~SQUASH_CHUNK_FLAGS; grub_disk_addr_t a = chunk_start + 2; tmp = grub_malloc (bsize); if (!tmp) @@ -341,7 +341,7 @@ xz_decompress (char *inbuf, grub_size_t insize, grub_off_t off, while (len) { enum xz_ret xzret; - + buf.out_pos = 0; xzret = xz_dec_run (data->xzdec, &buf); @@ -381,7 +381,7 @@ xz_decompress (char *inbuf, grub_size_t insize, grub_off_t off, } int LZ4_uncompress_unknownOutputSize(const char *source, char *dest, int isize, int maxOutputSize); -static grub_ssize_t lz4_decompress_wrap(char *inbuf, grub_size_t insize, grub_off_t off, +static grub_ssize_t lz4_decompress_wrap(char *inbuf, grub_size_t insize, grub_off_t off, char *outbuf, grub_size_t len, struct grub_squash_data *data) { char *udata = NULL; @@ -400,7 +400,7 @@ static grub_ssize_t lz4_decompress_wrap(char *inbuf, grub_size_t insize, grub_of return len; } -static grub_ssize_t zstd_decompress_wrap(char *inbuf, grub_size_t insize, grub_off_t off, +static grub_ssize_t zstd_decompress_wrap(char *inbuf, grub_size_t insize, grub_off_t off, char *outbuf, grub_size_t len, struct grub_squash_data *data) { char *udata = NULL; @@ -411,11 +411,11 @@ static grub_ssize_t zstd_decompress_wrap(char *inbuf, grub_size_t insize, grub_o udata = grub_malloc (usize); if (!udata) return -1; - - ZSTD_decompress(udata, usize, inbuf, insize); + + ZSTD_decompress(udata, usize, inbuf, insize); grub_memcpy(outbuf, udata + off, len); grub_free(udata); - + return len; } @@ -440,9 +440,9 @@ squash_mount (grub_disk_t disk) return NULL; } - err = grub_disk_read (disk, + err = grub_disk_read (disk, grub_le_to_cpu64 (sb.unk1offset) - >> GRUB_DISK_SECTOR_BITS, + >> GRUB_DISK_SECTOR_BITS, grub_le_to_cpu64 (sb.unk1offset) & (GRUB_DISK_SECTOR_SIZE - 1), sizeof (frag), &frag); if (grub_errno == GRUB_ERR_OUT_OF_RANGE) @@ -495,7 +495,7 @@ squash_mount (grub_disk_t disk) } data->blksz = grub_le_to_cpu32 (data->sb.block_size); - for (data->log2_blksz = 0; + for (data->log2_blksz = 0; (1U << data->log2_blksz) < data->blksz; data->log2_blksz++); @@ -668,7 +668,7 @@ make_root_node (struct grub_squash_data *data, struct grub_fshelp_node *root) root->stack[0].ino_chunk = grub_le_to_cpu32 (data->sb.root_ino_chunk); root->stack[0].ino_offset = grub_cpu_to_le16 (data->sb.root_ino_offset); return read_chunk (data, &root->ino, sizeof (root->ino), - grub_le_to_cpu64 (data->sb.inodeoffset) + grub_le_to_cpu64 (data->sb.inodeoffset) + root->stack[0].ino_chunk, root->stack[0].ino_offset); } @@ -790,7 +790,7 @@ grub_squash_open (struct grub_file *file, const char *name) } static grub_ssize_t -direct_read (struct grub_squash_data *data, +direct_read (struct grub_squash_data *data, struct grub_squash_cache_inode *ino, grub_off_t off, char *buf, grub_size_t len) { @@ -907,7 +907,7 @@ direct_read (struct grub_squash_data *data, grub_free (block); } else - err = grub_disk_read (data->disk, + err = grub_disk_read (data->disk, (ino->cumulated_block_sizes[i] + a + boff) >> GRUB_DISK_SECTOR_BITS, (ino->cumulated_block_sizes[i] + a + boff) @@ -971,7 +971,7 @@ grub_squash_read (grub_file_t file, char *buf, grub_size_t len) } else off -= direct_len; - + err = read_chunk (data, &frag, sizeof (frag), data->fragments, sizeof (frag) * fragment); if (err) @@ -982,7 +982,7 @@ grub_squash_read (grub_file_t file, char *buf, grub_size_t len) b = grub_le_to_cpu32 (ino->ino.long_file.offset) + off; else b = grub_le_to_cpu32 (ino->ino.file.offset) + off; - + /* FIXME: cache uncompressed chunks. */ if (compressed) { @@ -1038,7 +1038,7 @@ grub_squash_mtime (grub_device_t dev, grub_int32_t *tm) *tm = grub_le_to_cpu32 (data->sb.creation_time); squash_unmount (data); return GRUB_ERR_NONE; -} +} static struct grub_fs grub_squash_fs = { diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/fs/udf.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/fs/udf.c index dab046b6ead..e75de288967 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/fs/udf.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/fs/udf.c @@ -581,7 +581,7 @@ grub_udf_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) (buf + sizeof (struct grub_udf_aed)); continue; } - + if (filebytes < adlen) { grub_uint32_t ad_block_num = ad->block.block_num; @@ -1371,9 +1371,9 @@ grub_uint64_t grub_udf_get_file_offset(grub_file_t file) { grub_disk_addr_t sector; struct grub_fshelp_node *node = (struct grub_fshelp_node *)file->data; - + sector = grub_udf_read_block(node, 0); - + return 512 * (sector << node->data->lbshift); } @@ -1384,7 +1384,7 @@ grub_uint64_t grub_udf_get_last_pd_size_offset(void) grub_uint64_t grub_udf_get_last_file_attr_offset ( - grub_file_t file, + grub_file_t file, grub_uint32_t *startBlock, grub_uint64_t *fe_entry_size_offset ) @@ -1399,7 +1399,7 @@ grub_uint64_t grub_udf_get_last_file_attr_offset *startBlock = data->pds[data->pms[0]->type1.part_num].start; attr_offset = g_last_fileattr_read_sector * 2048 + g_last_fileattr_offset; - + if (GRUB_UDF_TAG_IDENT_FE == g_last_fileattr_read_sector_tag_ident) { *fe_entry_size_offset = g_last_fileattr_read_sector * 2048 + OFFSET_OF(struct grub_udf_file_entry, file_size); diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/gfxmenu/gfxmenu.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/gfxmenu/gfxmenu.c index 1e2d4e5a147..9ce202b8bfe 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/gfxmenu/gfxmenu.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/gfxmenu/gfxmenu.c @@ -45,7 +45,7 @@ extern int g_ventoy_menu_refresh; static grub_gfxmenu_view_t cached_view; -static void +static void grub_gfxmenu_viewer_fini (void *data __attribute__ ((unused))) { } diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/gfxmenu/gui_label.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/gfxmenu/gui_label.c index 32e79f29885..79cb94680fd 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/gfxmenu/gui_label.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/gfxmenu/gui_label.c @@ -181,7 +181,7 @@ static void label_set_state (void *vself, int visible, int start __attribute__ ((unused)), int current, int end __attribute__ ((unused))) { - grub_gui_label_t self = vself; + grub_gui_label_t self = vself; self->value = -current; self->visible = visible; grub_free (self->text); @@ -214,7 +214,7 @@ label_set_property (void *vself, const char *name, const char *value) else if (grub_strcmp (value, "@KEYMAP_SHORT@") == 0) value = _("enter: boot, `e': options, `c': cmd-line"); /* FIXME: Add more templates here if needed. */ - + else if (grub_strcmp (value, "@VTOY_MEM_DISK@") == 0) { value = g_ventoy_memdisk_mode ? grub_env_get("VTOY_MEM_DISK_STR") : " "; } @@ -237,7 +237,7 @@ label_set_property (void *vself, const char *name, const char *value) if (!value) value = " "; } - + self->template = grub_strdup (value); self->text = grub_xasprintf (value, self->value); } diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/gfxmenu/gui_list.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/gfxmenu/gui_list.c index 6b257502dbc..f817df0da3d 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/gfxmenu/gui_list.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/gfxmenu/gui_list.c @@ -119,7 +119,7 @@ get_num_shown_items (list_impl_t self) int boxpad = self->item_padding; int item_vspace = self->item_spacing; int item_height = self->item_height; - + grub_gfxmenu_box_t box = self->menu_box; int box_top_pad = box->get_top_pad (box); int box_bottom_pad = box->get_bottom_pad (box); @@ -354,7 +354,7 @@ draw_menu (list_impl_t self, int num_shown_items) grub_video_get_viewport (&oviewport.x, &oviewport.y, &oviewport.width, &oviewport.height); - grub_video_set_viewport (oviewport.x + boxpad, + grub_video_set_viewport (oviewport.x + boxpad, oviewport.y + boxpad, oviewport.width - 2 * boxpad, oviewport.height - 2 * boxpad); diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/gfxmenu/theme_loader.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/gfxmenu/theme_loader.c index af90ce457c3..7a218cecd86 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/gfxmenu/theme_loader.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/gfxmenu/theme_loader.c @@ -428,7 +428,7 @@ read_expression (struct parsebuf *p) skip_whitespace (p); if (peek_char (p) == '"') { - /* Read as a quoted string. + /* Read as a quoted string. The quotation marks are not included in the expression value. */ /* Skip opening quotation mark. */ read_char (p); @@ -734,7 +734,7 @@ read_property (struct parsebuf *p) "%s:%d:%d property value invalid; " "enclose literal values in quotes (\")", p->filename, p->line_num, p->col_num); - + grub_printf("File: %s\nLine:%d Column:%d\n" "property value invalid; enclose literal values in quotes (\")\n\n", p->filename, p->line_num, p->col_num); @@ -794,7 +794,7 @@ grub_gfxmenu_view_load_theme (grub_gfxmenu_view_t view, const char *theme_path) { p.len += grub_snprintf(p.buf + p.len, 4096, "\n+ hbox{\n left = 1%%\n top = 90%%\n" " + label {text = \"[Unofficial Ventoy]\" color = \"red\" align = \"left\"}\n" - "}\n"); + "}\n"); } } @@ -810,7 +810,7 @@ grub_gfxmenu_view_load_theme (grub_gfxmenu_view_t view, const char *theme_path) ->ops->set_bounds ((grub_gui_component_t) view->canvas, &view->screen); -parse: +parse: while (has_more (&p)) { /* Skip comments (lines beginning with #). */ @@ -849,9 +849,9 @@ if (flag == 0) grub_memset(tmpmsg, 'w', 500); tmpmsg[500] = 0; - + g_menu_update_mode = 1; - p.len += grub_snprintf(p.buf + p.len, 4096, + p.len += grub_snprintf(p.buf + p.len, 4096, "\n+ vbox{\n left = %s\n top = %s\n" "+ label { id=\"VTOY_MENU_TIP_1\" text = \"%s\" color = \"%s\" align = \"%s\"}\n" "+ label { id=\"VTOY_MENU_TIP_2\" text = \"%s\" color = \"%s\" align = \"%s\"}\n" diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/gfxmenu/view.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/gfxmenu/view.c index b69f0991c7a..6b0010f8b51 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/gfxmenu/view.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/gfxmenu/view.c @@ -221,7 +221,7 @@ redraw_timeouts (struct grub_gfxmenu_view *view) } } -void +void grub_gfxmenu_print_timeout (int timeout, void *data) { struct grub_gfxmenu_view *view = data; @@ -236,7 +236,7 @@ grub_gfxmenu_print_timeout (int timeout, void *data) redraw_timeouts (view); } -void +void grub_gfxmenu_clear_timeout (void *data) { struct grub_gfxmenu_view *view = data; @@ -407,7 +407,7 @@ grub_gfxmenu_redraw_menu (grub_gfxmenu_view_t view) else grub_gui_iterate_recursively ((grub_gui_component_t) view->canvas, redraw_menu_visit, view); - + grub_video_swap_buffers (); if (view->double_repaint) { @@ -420,7 +420,7 @@ grub_gfxmenu_redraw_menu (grub_gfxmenu_view_t view) } -void +void grub_gfxmenu_set_chosen_entry (int entry, void *data) { grub_gfxmenu_view_t view = data; @@ -428,7 +428,7 @@ grub_gfxmenu_set_chosen_entry (int entry, void *data) view->selected = entry; grub_gfxmenu_redraw_menu (view); - + } void @@ -470,7 +470,7 @@ grub_gfxmenu_draw_terminal_box (void) term_box->set_content_size (term_box, term_view->terminal_rect.width, term_view->terminal_rect.height); - + term_box->draw (term_box, term_view->terminal_rect.x - term_box->get_left_pad (term_box), term_view->terminal_rect.y - term_box->get_top_pad (term_box)); diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/kern/disk.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/kern/disk.c index f583b56b901..4f5af5059c1 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/kern/disk.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/kern/disk.c @@ -377,7 +377,7 @@ grub_disk_read_small_real (grub_disk_t disk, grub_disk_addr_t sector, tmp_buf = grub_malloc (num << disk->log_sector_size); if (!tmp_buf) return grub_errno; - + if ((disk->dev->disk_read) (disk, transform_sector (disk, aligned_sector), num, tmp_buf)) { @@ -409,7 +409,7 @@ grub_disk_read_small (grub_disk_t disk, grub_disk_addr_t sector, return GRUB_ERR_NONE; } -grub_err_t grub_disk_blocklist_read(void *chunklist, grub_uint64_t sector, +grub_err_t grub_disk_blocklist_read(void *chunklist, grub_uint64_t sector, grub_uint64_t size, grub_uint32_t log_sector_size) { grub_uint64_t sizeshift; @@ -553,7 +553,7 @@ grub_disk_read (grub_disk_t disk, grub_disk_addr_t sector, buf); if (err) return err; - + for (i = 0; i < agglomerate; i ++) grub_disk_cache_store (disk->dev->id, disk->id, sector + (i << GRUB_DISK_CACHE_BITS), @@ -568,7 +568,7 @@ grub_disk_read (grub_disk_t disk, grub_disk_addr_t sector, sector += agglomerate << GRUB_DISK_CACHE_BITS; size -= agglomerate << (GRUB_DISK_CACHE_BITS + GRUB_DISK_SECTOR_BITS); - buf = (char *) buf + buf = (char *) buf + (agglomerate << (GRUB_DISK_CACHE_BITS + GRUB_DISK_SECTOR_BITS)); } diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/kern/efi/efi.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/kern/efi/efi.c index a93da19962d..c3e0e403b56 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/kern/efi/efi.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/kern/efi/efi.c @@ -210,7 +210,7 @@ grub_efi_set_variable(const char *var, const grub_efi_guid_t *guid, r = grub_efi_system_table->runtime_services; - status = efi_call_5 (r->set_variable, var16, guid, + status = efi_call_5 (r->set_variable, var16, guid, (GRUB_EFI_VARIABLE_NON_VOLATILE | GRUB_EFI_VARIABLE_BOOTSERVICE_ACCESS | GRUB_EFI_VARIABLE_RUNTIME_ACCESS), @@ -961,7 +961,7 @@ void * grub_efi_allocate_iso_buf(grub_uint64_t size) { return NULL; } - + return (void *)(unsigned long)address; } @@ -978,6 +978,6 @@ void * grub_efi_allocate_chain_buf(grub_uint64_t size) { return NULL; } - + return (void *)(unsigned long)address; } diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/kern/efi/mm.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/kern/efi/mm.c index 5a70e0984f0..541e5577b00 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/kern/efi/mm.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/kern/efi/mm.c @@ -503,7 +503,7 @@ add_memory_regions (grub_efi_memory_descriptor_t *memory_map, addr = grub_efi_allocate_pages_real (start, pages, GRUB_EFI_ALLOCATE_ADDRESS, - GRUB_EFI_LOADER_CODE); + GRUB_EFI_LOADER_CODE); if (! addr) grub_fatal ("cannot allocate conventional memory %p with %u pages", (void *) ((grub_addr_t) start), @@ -629,7 +629,7 @@ grub_efi_mm_init (void) if (g_new_required_pages >= 8192) { required_pages = g_new_required_pages; - } + } } } diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/kern/env.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/kern/env.c index 896f4385028..502952c0420 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/kern/env.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/kern/env.c @@ -238,12 +238,12 @@ grub_env_export (const char *name) if (! var) { grub_err_t err; - + err = grub_env_set (name, ""); if (err) return err; var = grub_env_find (name); - } + } var->global = 1; return GRUB_ERR_NONE; diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/kern/file.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/kern/file.c index b328d214b21..d4475080f4f 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/kern/file.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/kern/file.c @@ -66,7 +66,7 @@ grub_file_t grub_memfile_open(const char *name) { char *size = NULL; grub_file_t file = 0; - + file = (grub_file_t)grub_zalloc(sizeof(*file)); if (NULL == file) { @@ -127,7 +127,7 @@ int grub_file_is_vlnk_suffix(const char *name, int len) if (grub_strncmp(name + len - 9, ".vlnk.", 6) == 0) { /* .iso .wim .img .vhd .efi .dat */ - if (suffix == 0x6F73692E || suffix == 0x6D69772E || + if (suffix == 0x6F73692E || suffix == 0x6D69772E || suffix == 0x676D692E || suffix == 0x6468762E || suffix == 0x6966652E || suffix == 0x7461642E) { @@ -153,7 +153,7 @@ int grub_file_vtoy_vlnk(const char *src, const char *dst) { g_vtoy_vlnk.srclen = (int)grub_strlen(src); grub_strncpy(g_vtoy_vlnk.src, src, sizeof(g_vtoy_vlnk.src) - 1); - grub_strncpy(g_vtoy_vlnk.dst, dst, sizeof(g_vtoy_vlnk.dst) - 1); + grub_strncpy(g_vtoy_vlnk.dst, dst, sizeof(g_vtoy_vlnk.dst) - 1); } else { @@ -167,10 +167,10 @@ int grub_file_vtoy_vlnk(const char *src, const char *dst) int grub_file_add_vlnk(const char *src, const char *dst) { grub_vlnk *node = NULL; - + if (src && dst) { - node = grub_zalloc(sizeof(grub_vlnk)); + node = grub_zalloc(sizeof(grub_vlnk)); if (node) { node->srclen = (int)grub_strlen(src); @@ -179,7 +179,7 @@ int grub_file_add_vlnk(const char *src, const char *dst) node->next = g_vlnk_list; g_vlnk_list = node; - return 0; + return 0; } } @@ -202,9 +202,9 @@ const char *grub_file_get_vlnk(const char *name, int *vlnk) { if (vlnk) *vlnk = 1; - return g_vtoy_vlnk.dst; + return g_vtoy_vlnk.dst; } - + while (node) { if (node->srclen == len && grub_strcmp(name, node->src) == 0) @@ -349,7 +349,7 @@ grub_file_read (grub_file_t file, void *buf, grub_size_t len) return len; } } - + read_hook = file->read_hook; read_hook_data = file->read_hook_data; if (!file->read_hook) @@ -391,9 +391,9 @@ grub_file_seek (grub_file_t file, grub_off_t offset) N_("attempt to seek outside of the file")); return -1; } - + old = file->offset; file->offset = offset; - + return old; } diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/kern/fs.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/kern/fs.c index 2736259e266..7cd9f3c14d1 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/kern/fs.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/kern/fs.c @@ -50,9 +50,9 @@ grub_fs_t grub_fs_list_probe(grub_device_t device, const char **list) if (!device->disk) return 0; - for (p = grub_fs_list; p; p = p->next) + for (p = grub_fs_list; p; p = p->next) { - for (i = 0; list[i]; i++) + for (i = 0; list[i]; i++) { if (grub_strcmp(p->name, list[i]) == 0) break; @@ -60,7 +60,7 @@ grub_fs_t grub_fs_list_probe(grub_device_t device, const char **list) if (list[i] == NULL) continue; - + grub_dprintf("fs", "Detecting %s...\n", p->name); (p->fs_dir) (device, "/", probe_dummy_iter, NULL); diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/kern/main.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/kern/main.c index 42bc22f7175..d1940663606 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/kern/main.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/kern/main.c @@ -121,7 +121,7 @@ ventoy_env_write_root (struct grub_env_var *var __attribute__ ((unused)), { const char *pos = val; char buf[256]; - + if (g_ventoy_hook_root == 0) { return grub_env_write_root(var, val); @@ -253,7 +253,7 @@ grub_set_prefix_and_root (void) if (device) { char *prefix_set; - + prefix_set = grub_xasprintf ("(%s)%s", device, path ? : ""); if (prefix_set) { @@ -330,9 +330,9 @@ static int ventoy_legacy_limit_workaround(void) if (pos) { grub_file_read(file, pos, file->size); - grub_snprintf(buf, sizeof(buf), "loopback ventoydisk mem:0x%lx:size:%lu", + grub_snprintf(buf, sizeof(buf), "loopback ventoydisk mem:0x%lx:size:%lu", (unsigned long)pos, (unsigned long)file->size); - + grub_parser_execute(buf); grub_env_set("prefix", "(ventoydisk)/grub"); } @@ -340,7 +340,7 @@ static int ventoy_legacy_limit_workaround(void) grub_file_close(file); } - grub_free(root); + grub_free(root); return 0; } #endif @@ -367,7 +367,7 @@ grub_main (void) grub_register_exported_symbols (); #ifdef GRUB_LINKER_HAVE_INIT grub_arch_dl_init_linker (); -#endif +#endif grub_load_modules (); grub_boot_time ("After loading embedded modules."); diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/kern/mips64/efi/init.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/kern/mips64/efi/init.c index f9f846e99a9..f5d5364acee 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/kern/mips64/efi/init.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/kern/mips64/efi/init.c @@ -51,7 +51,7 @@ grub_machine_init (void) grub_efi_boot_services_t *b; grub_efi_init (); - + b = grub_efi_system_table->boot_services; efi_call_5 (b->create_event, GRUB_EFI_EVT_TIMER | GRUB_EFI_EVT_NOTIFY_SIGNAL, GRUB_EFI_TPL_CALLBACK, grub_loongson_increment_timer, NULL, &tmr_evt); diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/lib/mips64/efi/loongson.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/lib/mips64/efi/loongson.c index 42e2b2804a9..0e8dac49266 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/lib/mips64/efi/loongson.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/lib/mips64/efi/loongson.c @@ -373,10 +373,10 @@ grub_efi_loongson_free_boot_params (void) void * grub_efi_loongson_get_smbios_table (void) { - static grub_efi_loongson_smbios_table *smbios_table; + static grub_efi_loongson_smbios_table *smbios_table; grub_efi_loongson_boot_params *old_boot_params; struct bootparamsinterface* boot_params; - void * tmp_boot_params = NULL; + void * tmp_boot_params = NULL; char * p = NULL; if(smbios_table) return smbios_table; @@ -387,7 +387,7 @@ grub_efi_loongson_get_smbios_table (void) grub_dprintf("loongson", "tmp_boot_params is NULL\n"); return tmp_boot_params; } - + boot_params = (struct bootparamsinterface *)tmp_boot_params; p = (char *)&(boot_params->signature); if(grub_strncmp(p, "BPI", 3) == 0) @@ -457,7 +457,7 @@ grub_efi_loongson_grub_calculatechecksum8 (const grub_uint8_t *buffer, grub_efi_ } -grub_uint32_t +grub_uint32_t grub_efi_loongson_memmap_sort(struct memmap array[], grub_uint32_t length, mem_map * bpmem, grub_uint32_t index, grub_uint32_t memtype) { grub_uint64_t tempmemsize = 0; @@ -469,12 +469,12 @@ grub_efi_loongson_memmap_sort(struct memmap array[], grub_uint32_t length, mem_m tempmemsize = array[j].memsize; for(t = j + 1; t < length; t++) { - if(array[j].memstart + tempmemsize == array[t].memstart) + if(array[j].memstart + tempmemsize == array[t].memstart) { tempmemsize += array[t].memsize; } else - { + { break; } } diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/lib/relocator.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/lib/relocator.c index 0ee1cb57f8c..0446211996d 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/lib/relocator.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/lib/relocator.c @@ -108,7 +108,7 @@ grub_relocator_new (void) ret = grub_zalloc (sizeof (struct grub_relocator)); if (!ret) return NULL; - + ret->postchunks = ~(grub_phys_addr_t) 0; ret->relocators_size = grub_relocator_jumper_size; grub_dprintf ("relocator", "relocators_size=%lu\n", @@ -139,7 +139,7 @@ allocate_regstart (grub_phys_addr_t addr, grub_size_t size, grub_mm_region_t rb, grub_mm_header_t new_header; grub_mm_header_t hb = (grub_mm_header_t) (rb + 1); -#ifdef DEBUG_RELOCATOR_NOMEM_DPRINTF +#ifdef DEBUG_RELOCATOR_NOMEM_DPRINTF grub_dprintf ("relocator", "ra = %p, rb = %p\n", regancestor, rb); #endif newreg_start = ALIGN_UP (newreg_raw_start, GRUB_MM_ALIGN); @@ -163,7 +163,7 @@ allocate_regstart (grub_phys_addr_t addr, grub_size_t size, grub_mm_region_t rb, { new_header = hb->next; if (new_header == hb) - new_header = (void *) (newreg_start + sizeof (*rb)); + new_header = (void *) (newreg_start + sizeof (*rb)); } { struct grub_mm_header *newregfirst = rb->first; @@ -212,7 +212,7 @@ allocate_inreg (grub_phys_addr_t paddr, grub_size_t size, (unsigned long) paddr, (unsigned long) size, hb, hbp, rb, (unsigned long) vaddr); #endif - + if (ALIGN_UP (vaddr + size, GRUB_MM_ALIGN) + GRUB_MM_ALIGN <= (grub_addr_t) (hb + hb->size)) { @@ -246,7 +246,7 @@ allocate_inreg (grub_phys_addr_t paddr, grub_size_t size, } else foll = hb->next; - + hbp->next = foll; if (rb->first == hb) { @@ -409,7 +409,7 @@ free_subchunk (const struct grub_relocator_subchunk *subchu) } break; #endif - } + } } static int @@ -439,7 +439,7 @@ malloc_in_range (struct grub_relocator *rel, if (end < start + size) return 0; - /* We have to avoid any allocations when filling scanline events. + /* We have to avoid any allocations when filling scanline events. Hence 2-stages. */ for (r = grub_mm_base; r; r = r->next) @@ -527,7 +527,7 @@ malloc_in_range (struct grub_relocator *rel, { #ifdef DEBUG_RELOCATOR_NOMEM_DPRINTF grub_dprintf ("relocator", "Blocking at 0x%lx-0x%lx\n", - (unsigned long) r - r->pre_size, + (unsigned long) r - r->pre_size, (unsigned long) (r + 1) + r->size); #endif events[N].type = FIRMWARE_BLOCK_START; @@ -596,7 +596,7 @@ malloc_in_range (struct grub_relocator *rel, p = pa->next; if (p->magic == GRUB_MM_ALLOC_MAGIC) continue; - do + do { if (p->magic != GRUB_MM_FREE_MAGIC) grub_fatal ("%s:%d free magic broken at %p (0x%x)\n", @@ -654,12 +654,12 @@ malloc_in_range (struct grub_relocator *rel, { grub_memset (counter, 0, (1 + (1 << DIGITSORT_BITS)) * sizeof (counter[0])); for (j = 0; j < N; j++) - counter[((events[j].pos >> (DIGITSORT_BITS * i)) + counter[((events[j].pos >> (DIGITSORT_BITS * i)) & DIGITSORT_MASK) + 1]++; for (j = 0; j <= DIGITSORT_MASK; j++) counter[j+1] += counter[j]; for (j = 0; j < N; j++) - eventt[counter[((events[j].pos >> (DIGITSORT_BITS * i)) + eventt[counter[((events[j].pos >> (DIGITSORT_BITS * i)) & DIGITSORT_MASK)]++] = events[j]; t = eventt; eventt = events; @@ -680,7 +680,7 @@ malloc_in_range (struct grub_relocator *rel, const int nlefto = 0; #endif grub_addr_t starta = 0; - for (j = from_low_priv ? 0 : N - 1; from_low_priv ? j < N : (j + 1); + for (j = from_low_priv ? 0 : N - 1; from_low_priv ? j < N : (j + 1); from_low_priv ? j++ : j--) { int isinsidebefore, isinsideafter; @@ -734,7 +734,7 @@ malloc_in_range (struct grub_relocator *rel, nstarted--; break; } - isinsideafter = (!ncollisions && (nstarted || ((nlefto || nstartedfw) + isinsideafter = (!ncollisions && (nstarted || ((nlefto || nstartedfw) && !nblockfw))); if (from_low_priv) { if (!isinsidebefore && isinsideafter) @@ -847,13 +847,13 @@ malloc_in_range (struct grub_relocator *rel, fend = ALIGN_UP (alloc_end, GRUB_RELOCATOR_FIRMWARE_REQUESTS_QUANT); -#ifdef DEBUG_RELOCATOR_NOMEM_DPRINTF +#ifdef DEBUG_RELOCATOR_NOMEM_DPRINTF grub_dprintf ("relocator", "requesting %lx-%lx\n", (unsigned long) fstart, (unsigned long) fend); #endif /* The failure here can be very expensive. */ - if (!grub_relocator_firmware_alloc_region (fstart, + if (!grub_relocator_firmware_alloc_region (fstart, fend - fstart)) { if (from_low_priv) @@ -889,7 +889,7 @@ malloc_in_range (struct grub_relocator *rel, nallocs++; } } - + switch (events[j].type) { case REG_BEG_START: @@ -1201,7 +1201,7 @@ malloc_in_range (struct grub_relocator *rel, } static void -adjust_limits (struct grub_relocator *rel, +adjust_limits (struct grub_relocator *rel, grub_phys_addr_t *min_addr, grub_phys_addr_t *max_addr, grub_phys_addr_t in_min, grub_phys_addr_t in_max) { @@ -1299,9 +1299,9 @@ grub_relocator_alloc_chunk_addr (struct grub_relocator *rel, { if (rel->highestnonpostaddr < target + size) rel->highestnonpostaddr = target + size; - + if (rel->highestnonpostaddr < chunk->src + size) - rel->highestnonpostaddr = chunk->src + size; + rel->highestnonpostaddr = chunk->src + size; } grub_dprintf ("relocator", "relocators_size=%ld\n", @@ -1511,7 +1511,7 @@ grub_relocator_unload (struct grub_relocator *rel) for (chunk = rel->chunks; chunk; chunk = next) { unsigned i; - for (i = 0; i < chunk->nsubchunks; i++) + for (i = 0; i < chunk->nsubchunks; i++) free_subchunk (&chunk->subchunks[i]); grub_unmap_memory (chunk->srcv, chunk->size); next = chunk->next; @@ -1546,7 +1546,7 @@ grub_relocator_prepare_relocs (struct grub_relocator *rel, grub_addr_t addr, *relsize = rel->relocators_size; grub_dprintf ("relocator", "Relocs allocated at %p\n", movers_chunk.srcv); - + { unsigned i; grub_size_t count[257]; @@ -1558,7 +1558,7 @@ grub_relocator_prepare_relocs (struct grub_relocator *rel, grub_addr_t addr, struct grub_relocator_chunk *chunk; for (chunk = rel->chunks; chunk; chunk = chunk->next) { - grub_dprintf ("relocator", "chunk %p->%p, 0x%lx\n", + grub_dprintf ("relocator", "chunk %p->%p, 0x%lx\n", (void *) chunk->src, (void *) chunk->target, (unsigned long) chunk->size); nchunks++; @@ -1602,7 +1602,7 @@ grub_relocator_prepare_relocs (struct grub_relocator *rel, grub_addr_t addr, for (j = 0; j < nchunks; j++) { - grub_dprintf ("relocator", "sorted chunk %p->%p, 0x%lx\n", + grub_dprintf ("relocator", "sorted chunk %p->%p, 0x%lx\n", (void *) sorted[j].src, (void *) sorted[j].target, (unsigned long) sorted[j].size); if (sorted[j].src < sorted[j].target) @@ -1644,7 +1644,7 @@ grub_mm_check_real (const char *file, int line) p = pa->next; if (p->magic == GRUB_MM_ALLOC_MAGIC) continue; - do + do { if ((grub_addr_t) p < (grub_addr_t) (r + 1) || (grub_addr_t) p >= (grub_addr_t) (r + 1) + r->size) diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/lib/syslinux_parse.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/lib/syslinux_parse.c index 8c63c7a5ed0..054fb3cb686 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/lib/syslinux_parse.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/lib/syslinux_parse.c @@ -51,8 +51,8 @@ struct syslinux_menuentry char hotkey; int make_default; struct syslinux_say *say; - - enum { KERNEL_NO_KERNEL, KERNEL_LINUX, KERNEL_CHAINLOADER, + + enum { KERNEL_NO_KERNEL, KERNEL_LINUX, KERNEL_CHAINLOADER, KERNEL_BIN, KERNEL_PXE, KERNEL_CHAINLOADER_BPB, KERNEL_COM32, KERNEL_COM, KERNEL_IMG, KERNEL_CONFIG, LOCALBOOT } entry_type; @@ -170,7 +170,7 @@ print_num (struct output_buffer *outbuf, int n) { char buf[20]; grub_snprintf (buf, sizeof (buf), "%d", n); - return print (outbuf, buf, grub_strlen (buf)); + return print (outbuf, buf, grub_strlen (buf)); } static grub_err_t @@ -233,7 +233,7 @@ kernel (const char *line, struct syslinux_menu *menu) if (end - line >= 4 && grub_strcasecmp (end - 4, ".img") == 0) menu->entries->entry_type = KERNEL_IMG; - + return GRUB_ERR_NONE; } @@ -247,7 +247,7 @@ cmd_linux (const char *line, struct syslinux_menu *menu) if (!menu->entries->kernel_file) return grub_errno; menu->entries->entry_type = KERNEL_LINUX; - + return GRUB_ERR_NONE; } @@ -261,7 +261,7 @@ cmd_boot (const char *line, struct syslinux_menu *menu) if (!menu->entries->kernel_file) return grub_errno; menu->entries->entry_type = KERNEL_CHAINLOADER; - + return GRUB_ERR_NONE; } @@ -275,7 +275,7 @@ cmd_bss (const char *line, struct syslinux_menu *menu) if (!menu->entries->kernel_file) return grub_errno; menu->entries->entry_type = KERNEL_CHAINLOADER_BPB; - + return GRUB_ERR_NONE; } @@ -289,7 +289,7 @@ cmd_pxe (const char *line, struct syslinux_menu *menu) if (!menu->entries->kernel_file) return grub_errno; menu->entries->entry_type = KERNEL_PXE; - + return GRUB_ERR_NONE; } @@ -303,7 +303,7 @@ cmd_fdimage (const char *line, struct syslinux_menu *menu) if (!menu->entries->kernel_file) return grub_errno; menu->entries->entry_type = KERNEL_IMG; - + return GRUB_ERR_NONE; } @@ -317,7 +317,7 @@ cmd_comboot (const char *line, struct syslinux_menu *menu) if (!menu->entries->kernel_file) return grub_errno; menu->entries->entry_type = KERNEL_COM; - + return GRUB_ERR_NONE; } @@ -331,7 +331,7 @@ cmd_com32 (const char *line, struct syslinux_menu *menu) if (!menu->entries->kernel_file) return grub_errno; menu->entries->entry_type = KERNEL_COM32; - + return GRUB_ERR_NONE; } @@ -354,7 +354,7 @@ cmd_config (const char *line, struct syslinux_menu *menu) return grub_errno; } menu->entries->entry_type = KERNEL_CONFIG; - + return GRUB_ERR_NONE; } @@ -368,7 +368,7 @@ cmd_append (const char *line, struct syslinux_menu *menu) menu->entries->append = grub_strdup (line); if (!menu->entries->append) return grub_errno; - + return GRUB_ERR_NONE; } @@ -406,7 +406,7 @@ cmd_initrd (const char *line, struct syslinux_menu *menu) while (*line == ',') line++; } - + return GRUB_ERR_NONE; } @@ -416,7 +416,7 @@ cmd_default (const char *line, struct syslinux_menu *menu) menu->def = grub_strdup (line); if (!menu->def) return grub_errno; - + return GRUB_ERR_NONE; } @@ -434,7 +434,7 @@ cmd_menudefault (const char *line __attribute__ ((unused)), if (!menu->entries) return grub_error (GRUB_ERR_BAD_ARGUMENT, "kernel without label"); - menu->entries->make_default = 1; + menu->entries->make_default = 1; return GRUB_ERR_NONE; } @@ -457,7 +457,7 @@ cmd_localboot (const char *line, if (!menu->entries->kernel_file) return grub_errno; menu->entries->entry_type = LOCALBOOT; - + return GRUB_ERR_NONE; } @@ -485,7 +485,7 @@ cmd_extlabel (const char *line, struct syslinux_menu *menu) *out++ = *in++; } *out = 0; - + return GRUB_ERR_NONE; } @@ -548,7 +548,7 @@ syslinux_parse (const char *filename, ret = syslinux_parse_real (menu); if (ret == GRUB_ERR_FILE_NOT_FOUND || ret == GRUB_ERR_BAD_FILENAME) - { + { grub_errno = ret = GRUB_ERR_NONE; add_comment (menu, "# File ", 0); add_comment (menu, nf, 0); @@ -761,7 +761,7 @@ syslinux_parse_real (struct syslinux_menu *menu) } static grub_err_t -print_escaped (struct output_buffer *outbuf, +print_escaped (struct output_buffer *outbuf, const char *from, const char *to) { const char *ptr; @@ -1037,7 +1037,7 @@ write_entry (struct output_buffer *outbuf, case KERNEL_COM: { char *basename = NULL; - + { char *ptr; for (ptr = curentry->kernel_file; *ptr; ptr++) @@ -1244,8 +1244,8 @@ write_entry (struct output_buffer *outbuf, if (grub_strcasecmp (basename, "whichsys.c32") == 0) { grub_syslinux_flavour_t flavour = GRUB_SYSLINUX_ISOLINUX; - const char *flav[] = - { + const char *flav[] = + { [GRUB_SYSLINUX_ISOLINUX] = "iso", [GRUB_SYSLINUX_PXELINUX] = "pxe", [GRUB_SYSLINUX_SYSLINUX] = "sys" @@ -1416,7 +1416,7 @@ free_menu (struct syslinux_menu *menu) grub_free (initrd->file); grub_free (initrd); } - + grub_free (entry->comments); grub_free (entry->kernel_file); grub_free (entry->label); @@ -1455,7 +1455,7 @@ config_file (struct output_buffer *outbuf, { menu.timeout = 100; } - + err = syslinux_parse_real (&menu); if (err) return err; @@ -1512,7 +1512,7 @@ config_file (struct output_buffer *outbuf, print_string ("\n"); } for (curentry = lentry; curentry; curentry = curentry->prev) - { + { print_string ("menuentry "); err = print_escaped (outbuf, curentry->extlabel ? : curentry->label, NULL); diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/loader/arm64/linux.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/loader/arm64/linux.c index f2c40d016f1..1fc72d31b63 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/loader/arm64/linux.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/loader/arm64/linux.c @@ -185,11 +185,11 @@ static void ventoy_debug_pause(void) { char key; - if (0 == ventoy_debug) + if (0 == ventoy_debug) { return; } - + grub_printf("press Enter to continue ......\n"); while (1) { @@ -198,7 +198,7 @@ static void ventoy_debug_pause(void) { break; } - } + } } static int ventoy_preboot(void) @@ -207,7 +207,7 @@ static int ventoy_preboot(void) const char *file; char buf[128]; - if (ventoy_debug) + if (ventoy_debug) { grub_printf("ventoy_preboot %d %d\n", ventoy_linux_argc, ventoy_initrd_called); ventoy_debug_pause(); @@ -234,7 +234,7 @@ static int ventoy_preboot(void) ventoy_extra_initrd_list[ventoy_extra_initrd_num++] = grub_strdup(file); } - if (ventoy_debug) + if (ventoy_debug) { grub_printf("========== initrd list ==========\n"); for (i = 0; i < ventoy_extra_initrd_num; i++) @@ -242,7 +242,7 @@ static int ventoy_preboot(void) grub_printf("%s\n", ventoy_extra_initrd_list[i]); } grub_printf("=================================\n"); - + ventoy_debug_pause(); } @@ -272,14 +272,14 @@ static int ventoy_boot_opt_filter(char *opt) } return 0; } - + if (grub_strncmp(opt, "init=", 5) == 0) { opt[0] = 'v'; opt[1] = 't'; return 0; } - + if (grub_strncmp(opt, "dm=", 3) == 0) { opt[0] = 'D'; @@ -293,12 +293,12 @@ static int ventoy_boot_opt_filter(char *opt) { return 1; } - + if (grub_strncmp(opt, "loglevel=", 9) == 0) { return 1; } - + if (grub_strcmp(opt, "splash") == 0) { return 1; @@ -345,7 +345,7 @@ static int ventoy_bootopt_hook(int argc, char *argv[]) { ventoy_linux_args[count] = ventoy_linux_args[i + (LINUX_MAX_ARGC / 2)]; ventoy_linux_args[i + (LINUX_MAX_ARGC / 2)] = NULL; - + if (ventoy_linux_args[count][0] == '@') { env = grub_env_get(ventoy_linux_args[count] + 1); @@ -391,7 +391,7 @@ static int ventoy_bootopt_hook(int argc, char *argv[]) { if (0 == ventoy_boot_opt_filter(last)) { - ventoy_linux_args[count++] = grub_strdup(last); + ventoy_linux_args[count++] = grub_strdup(last); } break; } @@ -406,7 +406,7 @@ static int ventoy_bootopt_hook(int argc, char *argv[]) } else { - count++; + count++; } } @@ -434,10 +434,10 @@ static int ventoy_bootopt_hook(int argc, char *argv[]) for (i = 0; i < count; i++) { grub_printf("%s ", ventoy_linux_args[i]); - } + } grub_printf("\n================================\n"); } - + return 0; } @@ -470,7 +470,7 @@ grub_cmd_unset_boot_opt (grub_command_t cmd __attribute__ ((unused)), int argc, char *argv[]) { int i; - + (void)argc; (void)argv; @@ -497,7 +497,7 @@ grub_cmd_extra_initrd_append (grub_command_t cmd __attribute__ ((unused)), char *pos = NULL; char *end = NULL; char buf[256] = {0}; - + if (argc != 1) { return 1; @@ -523,10 +523,10 @@ grub_cmd_extra_initrd_append (grub_command_t cmd __attribute__ ((unused)), { grub_snprintf(buf, sizeof(buf), "newc:%s:%s", end + 1, argv[0]); } - + if (ventoy_extra_initrd_num < 256) { - ventoy_extra_initrd_list[ventoy_extra_initrd_num++] = grub_strdup(buf); + ventoy_extra_initrd_list[ventoy_extra_initrd_num++] = grub_strdup(buf); } } @@ -538,7 +538,7 @@ grub_cmd_extra_initrd_reset (grub_command_t cmd __attribute__ ((unused)), int argc, char *argv[]) { int i; - + (void)argc; (void)argv; @@ -741,7 +741,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), cmdline_size, GRUB_VERIFY_KERNEL_CMDLINE); } else - { + { err = grub_create_loader_cmdline (argc, argv, linux_args + sizeof (LINUX_IMAGE) - 1, cmdline_size, @@ -789,7 +789,7 @@ ventoy_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), if (ventoy_linux_argc == 0) { - return grub_cmd_initrd(cmd, argc, argv); + return grub_cmd_initrd(cmd, argc, argv); } grub_snprintf(buf, sizeof(buf), "mem:%s:size:%s", grub_env_get("ventoy_cpio_addr"), grub_env_get("ventoy_cpio_size")); @@ -820,7 +820,7 @@ ventoy_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), } grub_printf("=================================\n"); } - + return grub_cmd_initrd(cmd, ventoy_extra_initrd_num, ventoy_extra_initrd_list); } @@ -843,12 +843,12 @@ GRUB_MOD_INIT (linux) cmd_set_bootopt = grub_register_command ("vt_set_boot_opt", grub_cmd_set_boot_opt, 0, N_("set ext boot opt")); cmd_unset_bootopt = grub_register_command ("vt_unset_boot_opt", grub_cmd_unset_boot_opt, 0, N_("unset ext boot opt")); - + cmd_extra_initrd_append = grub_register_command ("vt_img_extra_initrd_append", grub_cmd_extra_initrd_append, 0, N_("")); cmd_extra_initrd_reset = grub_register_command ("vt_img_extra_initrd_reset", grub_cmd_extra_initrd_reset, 0, N_("")); ventoy_linux_args = grub_zalloc(sizeof(char *) * LINUX_MAX_ARGC); - + my_mod = mod; } diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/loader/i386/linux.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/loader/i386/linux.c index d5e1a800ca9..44983c10703 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/loader/i386/linux.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/loader/i386/linux.c @@ -297,7 +297,7 @@ grub_linux_setup_video (struct linux_kernel_params *params) params->lfb_size >>= 16; params->have_vga = GRUB_VIDEO_LINUX_TYPE_VESA; break; - + case GRUB_VIDEO_DRIVER_EFI_UGA: case GRUB_VIDEO_DRIVER_EFI_GOP: params->have_vga = GRUB_VIDEO_LINUX_TYPE_EFIFB; @@ -413,11 +413,11 @@ static void ventoy_debug_pause(void) { char key; - if (0 == ventoy_debug) + if (0 == ventoy_debug) { return; } - + grub_printf("press Enter to continue ......\n"); while (1) { @@ -426,7 +426,7 @@ static void ventoy_debug_pause(void) { break; } - } + } } static int ventoy_preboot(void) @@ -435,7 +435,7 @@ static int ventoy_preboot(void) const char *file; char buf[128]; - if (ventoy_debug) + if (ventoy_debug) { grub_printf("ventoy_preboot %d %d\n", ventoy_linux_argc, ventoy_initrd_called); ventoy_debug_pause(); @@ -462,7 +462,7 @@ static int ventoy_preboot(void) ventoy_extra_initrd_list[ventoy_extra_initrd_num++] = grub_strdup(file); } - if (ventoy_debug) + if (ventoy_debug) { grub_printf("========== initrd list ==========\n"); for (i = 0; i < ventoy_extra_initrd_num; i++) @@ -470,7 +470,7 @@ static int ventoy_preboot(void) grub_printf("%s\n", ventoy_extra_initrd_list[i]); } grub_printf("=================================\n"); - + ventoy_debug_pause(); } @@ -500,7 +500,7 @@ static int ventoy_boot_opt_filter(char *opt) } return 0; } - + if (grub_strncmp(opt, "init=", 5) == 0) { opt[0] = 'v'; @@ -521,12 +521,12 @@ static int ventoy_boot_opt_filter(char *opt) { return 1; } - + if (grub_strncmp(opt, "loglevel=", 9) == 0) { return 1; } - + if (grub_strcmp(opt, "splash") == 0) { return 1; @@ -573,7 +573,7 @@ static int ventoy_bootopt_hook(int argc, char *argv[]) { ventoy_linux_args[count] = ventoy_linux_args[i + (LINUX_MAX_ARGC / 2)]; ventoy_linux_args[i + (LINUX_MAX_ARGC / 2)] = NULL; - + if (ventoy_linux_args[count][0] == '@') { env = grub_env_get(ventoy_linux_args[count] + 1); @@ -619,7 +619,7 @@ static int ventoy_bootopt_hook(int argc, char *argv[]) { if (0 == ventoy_boot_opt_filter(last)) { - ventoy_linux_args[count++] = grub_strdup(last); + ventoy_linux_args[count++] = grub_strdup(last); } break; } @@ -634,7 +634,7 @@ static int ventoy_bootopt_hook(int argc, char *argv[]) } else { - count++; + count++; } } @@ -662,10 +662,10 @@ static int ventoy_bootopt_hook(int argc, char *argv[]) for (i = 0; i < count; i++) { grub_printf("%s ", ventoy_linux_args[i]); - } + } grub_printf("\n================================\n"); } - + return 0; } @@ -677,7 +677,7 @@ grub_cmd_extra_initrd_append (grub_command_t cmd __attribute__ ((unused)), char *pos = NULL; char *end = NULL; char buf[256] = {0}; - + if (argc != 1) { return 1; @@ -703,10 +703,10 @@ grub_cmd_extra_initrd_append (grub_command_t cmd __attribute__ ((unused)), { grub_snprintf(buf, sizeof(buf), "newc:%s:%s", end + 1, argv[0]); } - + if (ventoy_extra_initrd_num < 256) { - ventoy_extra_initrd_list[ventoy_extra_initrd_num++] = grub_strdup(buf); + ventoy_extra_initrd_list[ventoy_extra_initrd_num++] = grub_strdup(buf); } } @@ -718,7 +718,7 @@ grub_cmd_extra_initrd_reset (grub_command_t cmd __attribute__ ((unused)), int argc, char *argv[]) { int i; - + (void)argc; (void)argv; @@ -924,9 +924,9 @@ grub_linux_boot (void) &efi_desc_size, &efi_desc_version); if (err) return err; - + /* Note that no boot services are available from here. */ - efi_mmap_target = ctx.real_mode_target + efi_mmap_target = ctx.real_mode_target + ((grub_uint8_t *) efi_mmap_buf - (grub_uint8_t *) real_mode_mem); /* Pass EFI parameters. */ if (grub_le_to_cpu16 (ctx.params->version) >= 0x0208) @@ -1008,7 +1008,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), if (tip) { grub_printf("%s\n", tip); - grub_refresh(); + grub_refresh(); } } @@ -1086,7 +1086,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), align = 0; relocatable = 0; } - + if (grub_le_to_cpu16 (lh.version) >= 0x020a) { min_align = lh.min_alignment; @@ -1361,7 +1361,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), - (sizeof (LINUX_IMAGE) - 1), GRUB_VERIFY_KERNEL_CMDLINE); } - + if (err) goto fail; } @@ -1495,7 +1495,7 @@ ventoy_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), if (ventoy_linux_argc == 0) { - return grub_cmd_initrd(cmd, argc, argv); + return grub_cmd_initrd(cmd, argc, argv); } grub_snprintf(buf, sizeof(buf), "mem:%s:size:%s", grub_env_get("ventoy_cpio_addr"), grub_env_get("ventoy_cpio_size")); @@ -1526,7 +1526,7 @@ ventoy_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), } grub_printf("=================================\n"); } - + return grub_cmd_initrd(cmd, ventoy_extra_initrd_num, ventoy_extra_initrd_list); } @@ -1537,7 +1537,7 @@ grub_cmd_set_boot_opt (grub_command_t cmd __attribute__ ((unused)), int i; const char *vtdebug; grub_command_t regcmd; - + for (i = 0; i < argc; i++) { ventoy_linux_args[ventoy_linux_argc + (LINUX_MAX_ARGC / 2) ] = grub_strdup(argv[i]); @@ -1559,7 +1559,7 @@ grub_cmd_set_boot_opt (grub_command_t cmd __attribute__ ((unused)), ventoy_linux16_func = regcmd->func; regcmd->func = grub_cmd_linux; } - + regcmd = grub_command_find("initrd16"); if (regcmd) { @@ -1576,7 +1576,7 @@ grub_cmd_unset_boot_opt (grub_command_t cmd __attribute__ ((unused)), { int i; grub_command_t regcmd; - + (void)argc; (void)argv; @@ -1612,7 +1612,7 @@ grub_cmd_unset_boot_opt (grub_command_t cmd __attribute__ ((unused)), } ventoy_initrd16_func = NULL; } - + return 0; } @@ -1633,7 +1633,7 @@ GRUB_MOD_INIT(linux) 0, N_("Load initrd.")); cmd_set_bootopt = grub_register_command ("vt_set_boot_opt", grub_cmd_set_boot_opt, 0, N_("set ext boot opt")); cmd_unset_bootopt = grub_register_command ("vt_unset_boot_opt", grub_cmd_unset_boot_opt, 0, N_("unset ext boot opt")); - + cmd_extra_initrd_append = grub_register_command ("vt_img_extra_initrd_append", grub_cmd_extra_initrd_append, 0, N_("")); cmd_extra_initrd_reset = grub_register_command ("vt_img_extra_initrd_reset", grub_cmd_extra_initrd_reset, 0, N_("")); diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/loader/linux.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/loader/linux.c index b23e07190ef..f7d49092c3e 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/loader/linux.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/loader/linux.c @@ -232,7 +232,7 @@ grub_initrd_init (int argc, char *argv[], free_dir (root); root = 0; } - + return GRUB_ERR_NONE; } @@ -269,7 +269,7 @@ grub_initrd_load (struct grub_linux_initrd_context *initrd_ctx, struct dir *root = 0; grub_ssize_t cursize = 0; grub_ssize_t readsize = 0; - + for (i = 0; i < initrd_ctx->nfiles; i++) { grub_memset (ptr, 0, ALIGN_UP_OVERHEAD (cursize, 4)); @@ -295,7 +295,7 @@ grub_initrd_load (struct grub_linux_initrd_context *initrd_ctx, } cursize = initrd_ctx->components[i].size; - if (ventoy_need_prompt_load_file() && initrd_ctx->components[i].newc_name && + if (ventoy_need_prompt_load_file() && initrd_ctx->components[i].newc_name && grub_strcmp(initrd_ctx->components[i].newc_name, "boot.wim") == 0) { readsize = ventoy_load_file_with_prompt(initrd_ctx->components[i].file, ptr, cursize); diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/loader/mips64/linux.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/loader/mips64/linux.c index d81cc3c849b..e43f4debfa4 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/loader/mips64/linux.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/loader/mips64/linux.c @@ -64,7 +64,7 @@ grub_uint64_t tempMemsize = 0; grub_uint32_t free_index = 0; grub_uint32_t reserve_index = 0; grub_uint32_t acpi_table_index = 0; -grub_uint32_t acpi_nvs_index = 0; +grub_uint32_t acpi_nvs_index = 0; #define LINUX_MAX_ARGC 1024 static int ventoy_debug = 0; @@ -133,11 +133,11 @@ static void ventoy_debug_pause(void) { char key; - if (0 == ventoy_debug) + if (0 == ventoy_debug) { return; } - + grub_printf("press Enter to continue ......\n"); while (1) { @@ -146,7 +146,7 @@ static void ventoy_debug_pause(void) { break; } - } + } } static int ventoy_preboot(void) @@ -155,7 +155,7 @@ static int ventoy_preboot(void) const char *file; char buf[128]; - if (ventoy_debug) + if (ventoy_debug) { grub_printf("ventoy_preboot %d %d\n", ventoy_linux_argc, ventoy_initrd_called); ventoy_debug_pause(); @@ -182,7 +182,7 @@ static int ventoy_preboot(void) ventoy_extra_initrd_list[ventoy_extra_initrd_num++] = grub_strdup(file); } - if (ventoy_debug) + if (ventoy_debug) { grub_printf("========== initrd list ==========\n"); for (i = 0; i < ventoy_extra_initrd_num; i++) @@ -190,7 +190,7 @@ static int ventoy_preboot(void) grub_printf("%s\n", ventoy_extra_initrd_list[i]); } grub_printf("=================================\n"); - + ventoy_debug_pause(); } @@ -220,7 +220,7 @@ static int ventoy_boot_opt_filter(char *opt) } return 0; } - + if (grub_strncmp(opt, "init=", 5) == 0) { opt[0] = 'v'; @@ -241,12 +241,12 @@ static int ventoy_boot_opt_filter(char *opt) { return 1; } - + if (grub_strncmp(opt, "loglevel=", 9) == 0) { return 1; } - + if (grub_strcmp(opt, "splash") == 0) { return 1; @@ -293,7 +293,7 @@ static int ventoy_bootopt_hook(int argc, char *argv[]) { ventoy_linux_args[count] = ventoy_linux_args[i + (LINUX_MAX_ARGC / 2)]; ventoy_linux_args[i + (LINUX_MAX_ARGC / 2)] = NULL; - + if (ventoy_linux_args[count][0] == '@') { env = grub_env_get(ventoy_linux_args[count] + 1); @@ -339,7 +339,7 @@ static int ventoy_bootopt_hook(int argc, char *argv[]) { if (0 == ventoy_boot_opt_filter(last)) { - ventoy_linux_args[count++] = grub_strdup(last); + ventoy_linux_args[count++] = grub_strdup(last); } break; } @@ -354,7 +354,7 @@ static int ventoy_bootopt_hook(int argc, char *argv[]) } else { - count++; + count++; } } @@ -382,10 +382,10 @@ static int ventoy_bootopt_hook(int argc, char *argv[]) for (i = 0; i < count; i++) { grub_printf("%s ", ventoy_linux_args[i]); - } + } grub_printf("\n================================\n"); } - + return 0; } @@ -418,7 +418,7 @@ grub_cmd_unset_boot_opt (grub_command_t cmd __attribute__ ((unused)), int argc, char *argv[]) { int i; - + (void)argc; (void)argv; @@ -445,7 +445,7 @@ grub_cmd_extra_initrd_append (grub_command_t cmd __attribute__ ((unused)), char *pos = NULL; char *end = NULL; char buf[256] = {0}; - + if (argc != 1) { return 1; @@ -471,10 +471,10 @@ grub_cmd_extra_initrd_append (grub_command_t cmd __attribute__ ((unused)), { grub_snprintf(buf, sizeof(buf), "newc:%s:%s", end + 1, argv[0]); } - + if (ventoy_extra_initrd_num < 256) { - ventoy_extra_initrd_list[ventoy_extra_initrd_num++] = grub_strdup(buf); + ventoy_extra_initrd_list[ventoy_extra_initrd_num++] = grub_strdup(buf); } } @@ -486,7 +486,7 @@ grub_cmd_extra_initrd_reset (grub_command_t cmd __attribute__ ((unused)), int argc, char *argv[]) { int i; - + (void)argc; (void)argv; @@ -539,7 +539,7 @@ grub_linux_boot (void) struct memmap free_mem[GRUB_EFI_LOONGSON_MMAP_MAX]; struct memmap acpi_table_mem[GRUB_EFI_LOONGSON_MMAP_MAX]; struct memmap acpi_nvs_mem[GRUB_EFI_LOONGSON_MMAP_MAX]; - + grub_memset(reserve_mem, 0, sizeof(struct memmap) * GRUB_EFI_LOONGSON_MMAP_MAX); grub_memset(free_mem, 0, sizeof(struct memmap) * GRUB_EFI_LOONGSON_MMAP_MAX); grub_memset(acpi_table_mem, 0, sizeof(struct memmap) * GRUB_EFI_LOONGSON_MMAP_MAX); @@ -573,7 +573,7 @@ grub_linux_boot (void) }else{ new_interface_flag = 0; grub_dprintf("loongson", "get old parameter interface\n"); - + } state.gpr[6] = (grub_uint64_t)tmp_boot_params; grub_dprintf("loongson", "boot_params is 0x%llx\n", (_ull)state.gpr[6]); @@ -600,7 +600,7 @@ grub_linux_boot (void) /* According to UEFI SPEC,mmap_buf is the accurate Memory Map array \ - now we can fill platform specific memory structure. + now we can fill platform specific memory structure. */ for(lsdesc = mmap_buf; lsdesc < (grub_efi_memory_descriptor_t *)((char *)mmap_buf + mmap_size); lsdesc = (grub_efi_memory_descriptor_t *)((char *)lsdesc + desc_size)) { @@ -610,7 +610,7 @@ grub_linux_boot (void) (lsdesc->type != GRUB_EFI_RUNTIME_SERVICES_DATA) && \ (lsdesc->type != GRUB_EFI_RUNTIME_SERVICES_CODE) && \ (lsdesc->type != GRUB_EFI_RESERVED_MEMORY_TYPE) && \ - (lsdesc->type != GRUB_EFI_PAL_CODE)) + (lsdesc->type != GRUB_EFI_PAL_CODE)) { free_mem[free_index].memtype = GRUB_EFI_LOONGSON_SYSTEM_RAM_LOW; @@ -631,7 +631,7 @@ grub_linux_boot (void) acpi_nvs_index++; /* Reserve */ - }else{ + }else{ reserve_mem[reserve_index].memtype = GRUB_EFI_LOONGSON_MEMORY_RESERVED; reserve_mem[reserve_index].memstart = (lsdesc->physical_start) & 0xffffffffffff; reserve_mem[reserve_index].memsize = lsdesc->num_pages * 4096; @@ -645,12 +645,12 @@ grub_linux_boot (void) tempMemsize = free_mem[j].memsize; for(t = j + 1; t < free_index; t++) { - if((free_mem[j].memstart + tempMemsize == free_mem[t].memstart) && (free_mem[j].memtype == free_mem[t].memtype)) + if((free_mem[j].memstart + tempMemsize == free_mem[t].memstart) && (free_mem[j].memtype == free_mem[t].memtype)) { tempMemsize += free_mem[t].memsize; - }else{ + }else{ break; - } + } } if(free_mem[j].memstart >= 0x10000000) /*HIGH MEM*/ new_interface_mem->map[tmp_index].memtype = GRUB_EFI_LOONGSON_SYSTEM_RAM_HIGH; @@ -978,7 +978,7 @@ ventoy_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), if (ventoy_linux_argc == 0) { - return grub_cmd_initrd(cmd, argc, argv); + return grub_cmd_initrd(cmd, argc, argv); } grub_snprintf(buf, sizeof(buf), "mem:%s:size:%s", grub_env_get("ventoy_cpio_addr"), grub_env_get("ventoy_cpio_size")); @@ -1009,10 +1009,10 @@ ventoy_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), } grub_printf("=================================\n"); } - + return grub_cmd_initrd(cmd, ventoy_extra_initrd_num, ventoy_extra_initrd_list); } - + static grub_command_t cmd_linux, cmd_initrd; static grub_command_t cmd_set_bootopt, cmd_unset_bootopt, cmd_extra_initrd_append, cmd_extra_initrd_reset; @@ -1025,7 +1025,7 @@ GRUB_MOD_INIT(linux) cmd_set_bootopt = grub_register_command ("vt_set_boot_opt", grub_cmd_set_boot_opt, 0, N_("set ext boot opt")); cmd_unset_bootopt = grub_register_command ("vt_unset_boot_opt", grub_cmd_unset_boot_opt, 0, N_("unset ext boot opt")); - + cmd_extra_initrd_append = grub_register_command ("vt_img_extra_initrd_append", grub_cmd_extra_initrd_append, 0, N_("")); cmd_extra_initrd_reset = grub_register_command ("vt_img_extra_initrd_reset", grub_cmd_extra_initrd_reset, 0, N_("")); diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/normal/charset.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/normal/charset.c index ef9f046d390..97a67dfd1f0 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/normal/charset.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/normal/charset.c @@ -17,7 +17,7 @@ */ /* - Current problems with Unicode rendering: + Current problems with Unicode rendering: - B and BN bidi type characters (ignored) - Mc type characters with combining class 0 (poorly combined) - Mn type characters with combining class 0 (poorly combined) @@ -141,7 +141,7 @@ grub_get_num_of_utf8_bytes (const grub_uint32_t *src, grub_size_t size) while (remaining--) { grub_uint32_t code = *ptr++; - + if (code <= 0x007F) cnt++; else if (code <= 0x07FF) @@ -204,7 +204,7 @@ grub_utf8_to_ucs4_alloc (const char *msg, grub_uint32_t **unicode_msg, grub_size_t msg_len = grub_strlen (msg); *unicode_msg = grub_malloc (msg_len * sizeof (grub_uint32_t)); - + if (!*unicode_msg) return -1; @@ -407,11 +407,11 @@ is_type_after (enum grub_comb_type a, enum grub_comb_type b) { /* Shadda is numerically higher than most of Arabic diacritics but has to be rendered before them. */ - if (a == GRUB_UNICODE_COMB_ARABIC_SHADDA + if (a == GRUB_UNICODE_COMB_ARABIC_SHADDA && b <= GRUB_UNICODE_COMB_ARABIC_KASRA && b >= GRUB_UNICODE_COMB_ARABIC_FATHATAN) return 0; - if (b == GRUB_UNICODE_COMB_ARABIC_SHADDA + if (b == GRUB_UNICODE_COMB_ARABIC_SHADDA && a <= GRUB_UNICODE_COMB_ARABIC_KASRA && a >= GRUB_UNICODE_COMB_ARABIC_FATHATAN) return 1; @@ -440,7 +440,7 @@ grub_unicode_aglomerate_comb (const grub_uint32_t *in, grub_size_t inlen, for (ptr = in; ptr < in + inlen; ptr++) { - /* Variation selectors >= 17 are outside of BMP and SMP. + /* Variation selectors >= 17 are outside of BMP and SMP. Handle variation selectors first to avoid potentially costly lookups. */ if (*ptr >= GRUB_UNICODE_VARIATION_SELECTOR_1 @@ -457,7 +457,7 @@ grub_unicode_aglomerate_comb (const grub_uint32_t *in, grub_size_t inlen, out->variant = *ptr - GRUB_UNICODE_VARIATION_SELECTOR_17 + 17; continue; } - + enum grub_comb_type comb_type; comb_type = grub_unicode_get_comb_type (*ptr); if (comb_type) @@ -592,7 +592,7 @@ bidi_line_wrap (struct grub_unicode_glyph *visual_out, for (k = 0; k <= visual_len; k++) { grub_ssize_t last_width = 0; - + if (pos && k != visual_len) { pos[visual[k].orig_pos].x = line_width; @@ -618,9 +618,9 @@ bidi_line_wrap (struct grub_unicode_glyph *visual_out, last_space_width = line_width; } - if (((grub_ssize_t) maxwidth > 0 + if (((grub_ssize_t) maxwidth > 0 && line_width > (grub_ssize_t) maxwidth) || k == visual_len) - { + { unsigned min_odd_level = 0xffffffff; unsigned max_level = 0; unsigned kk = k; @@ -654,7 +654,7 @@ bidi_line_wrap (struct grub_unicode_glyph *visual_out, } { - unsigned j; + unsigned j; /* FIXME: can be optimized. */ for (j = max_level; j > min_odd_level - 1; j--) { @@ -671,7 +671,7 @@ bidi_line_wrap (struct grub_unicode_glyph *visual_out, } } } - + { unsigned i; for (i = line_start; i < kk; i++) @@ -683,10 +683,10 @@ bidi_line_wrap (struct grub_unicode_glyph *visual_out, { int left, right; left = visual[i].attributes - & (GRUB_UNICODE_GLYPH_ATTRIBUTE_LEFT_JOINED + & (GRUB_UNICODE_GLYPH_ATTRIBUTE_LEFT_JOINED | GRUB_UNICODE_GLYPH_ATTRIBUTE_LEFT_JOINED_EXPLICIT); right = visual[i].attributes - & (GRUB_UNICODE_GLYPH_ATTRIBUTE_RIGHT_JOINED + & (GRUB_UNICODE_GLYPH_ATTRIBUTE_RIGHT_JOINED | GRUB_UNICODE_GLYPH_ATTRIBUTE_RIGHT_JOINED_EXPLICIT); visual[i].attributes &= ~GRUB_UNICODE_GLYPH_ATTRIBUTES_JOIN; left <<= GRUB_UNICODE_GLYPH_ATTRIBUTES_JOIN_LEFT_TO_RIGHT_SHIFT; @@ -751,7 +751,7 @@ bidi_line_wrap (struct grub_unicode_glyph *visual_out, || join_type == GRUB_JOIN_TYPE_CAUSING) right_join = 1; } - } + } grub_memcpy (outptr, &visual[line_start], (kk - line_start) * sizeof (visual[0])); @@ -857,7 +857,7 @@ grub_bidi_line_logical_to_visual (const grub_uint32_t *logical, base_level = 1; else base_level = 0; - + cur_level = base_level; cur_override = OVERRIDE_NEUTRAL; { @@ -888,7 +888,7 @@ grub_bidi_line_logical_to_visual (const grub_uint32_t *logical, { visual[visual_len - 1].attributes |= GRUB_UNICODE_GLYPH_ATTRIBUTE_RIGHT_JOINED_EXPLICIT; - visual[visual_len - 1].attributes + visual[visual_len - 1].attributes &= ~GRUB_UNICODE_GLYPH_ATTRIBUTE_RIGHT_JOINED; } zwj_propagate_to_previous = 0; @@ -901,7 +901,7 @@ grub_bidi_line_logical_to_visual (const grub_uint32_t *logical, if (*lptr >= GRUB_UNICODE_TAG_START && *lptr <= GRUB_UNICODE_TAG_END) continue; - p = grub_unicode_aglomerate_comb (lptr, logical + logical_len - lptr, + p = grub_unicode_aglomerate_comb (lptr, logical + logical_len - lptr, &visual[visual_len]); visual[visual_len].orig_pos = lptr - logical; type = get_bidi_type (visual[visual_len].base); @@ -938,7 +938,7 @@ grub_bidi_line_logical_to_visual (const grub_uint32_t *logical, |= GRUB_UNICODE_GLYPH_ATTRIBUTE_LEFT_JOINED_EXPLICIT | GRUB_UNICODE_GLYPH_ATTRIBUTE_LEFT_JOINED; } - + if (join_state == NOJOIN) { visual[visual_len].attributes @@ -952,7 +952,7 @@ grub_bidi_line_logical_to_visual (const grub_uint32_t *logical, visual[visual_len].bidi_level = cur_level; if (cur_override != OVERRIDE_NEUTRAL) - visual[visual_len].bidi_type = + visual[visual_len].bidi_type = (cur_override == OVERRIDE_L) ? GRUB_BIDI_TYPE_L : GRUB_BIDI_TYPE_R; else @@ -1003,7 +1003,7 @@ grub_bidi_line_logical_to_visual (const grub_uint32_t *logical, break; case GRUB_BIDI_TYPE_ES: if (last_type == GRUB_BIDI_TYPE_EN - && i + 1 < run_end + && i + 1 < run_end && visual[i + 1].bidi_type == GRUB_BIDI_TYPE_EN) visual[i].bidi_type = GRUB_BIDI_TYPE_EN; else @@ -1031,19 +1031,19 @@ grub_bidi_line_logical_to_visual (const grub_uint32_t *logical, && visual[i].bidi_type == GRUB_BIDI_TYPE_ET; i++) visual[i].bidi_type = GRUB_BIDI_TYPE_ON; i--; - break; + break; } break; case GRUB_BIDI_TYPE_CS: if (last_type == GRUB_BIDI_TYPE_EN - && i + 1 < run_end + && i + 1 < run_end && visual[i + 1].bidi_type == GRUB_BIDI_TYPE_EN) { visual[i].bidi_type = GRUB_BIDI_TYPE_EN; break; } if (last_type == GRUB_BIDI_TYPE_AN - && i + 1 < run_end + && i + 1 < run_end && (visual[i + 1].bidi_type == GRUB_BIDI_TYPE_AN || (visual[i + 1].bidi_type == GRUB_BIDI_TYPE_EN && last_strong_type == GRUB_BIDI_TYPE_AL))) @@ -1257,7 +1257,7 @@ grub_unicode_shape_code (grub_uint32_t in, grub_uint8_t attr) } const grub_uint32_t * -grub_unicode_get_comb_start (const grub_uint32_t *str, +grub_unicode_get_comb_start (const grub_uint32_t *str, const grub_uint32_t *cur) { const grub_uint32_t *ptr; @@ -1270,7 +1270,7 @@ grub_unicode_get_comb_start (const grub_uint32_t *str, if (*ptr >= GRUB_UNICODE_VARIATION_SELECTOR_17 && *ptr <= GRUB_UNICODE_VARIATION_SELECTOR_256) continue; - + enum grub_comb_type comb_type; comb_type = grub_unicode_get_comb_type (*ptr); if (comb_type) @@ -1281,7 +1281,7 @@ grub_unicode_get_comb_start (const grub_uint32_t *str, } const grub_uint32_t * -grub_unicode_get_comb_end (const grub_uint32_t *end, +grub_unicode_get_comb_end (const grub_uint32_t *end, const grub_uint32_t *cur) { const grub_uint32_t *ptr; @@ -1294,7 +1294,7 @@ grub_unicode_get_comb_end (const grub_uint32_t *end, if (*ptr >= GRUB_UNICODE_VARIATION_SELECTOR_17 && *ptr <= GRUB_UNICODE_VARIATION_SELECTOR_256) continue; - + enum grub_comb_type comb_type; comb_type = grub_unicode_get_comb_type (*ptr); if (comb_type) diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/normal/context.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/normal/context.c index 9ed3c8d27f0..5719cf9d45e 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/normal/context.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/normal/context.c @@ -168,11 +168,11 @@ grub_env_extractor_close (int source) { grub_menu_t menu2; menu2 = grub_env_get_menu (); - + last = &menu2->entry_list; while (*last) last = &(*last)->next; - + *last = menu->entry_list; menu2->size += menu->size; } diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/normal/main.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/normal/main.c index bc29d3bee44..9007f26918b 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/normal/main.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/normal/main.c @@ -211,17 +211,17 @@ grub_normal_init_page (struct grub_term_output *term, char *msg_formatted; grub_uint32_t *unicode_msg; grub_uint32_t *last_position; - + grub_term_cls (term); msg_formatted = grub_xasprintf (_("GNU GRUB version %s"), PACKAGE_VERSION); if (!msg_formatted) return; - + msg_len = grub_utf8_to_ucs4_alloc (msg_formatted, &unicode_msg, &last_position); grub_free (msg_formatted); - + if (msg_len < 0) { return; @@ -387,7 +387,7 @@ grub_normal_reader_init (int nested) grub_putcode ('\n', term); } grub_free (msg_formatted); - + return 0; } @@ -419,7 +419,7 @@ grub_normal_read_line_real (char **line, int cont, int nested) return grub_errno; } } - + } static grub_err_t diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/normal/menu.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/normal/menu.c index e839634014e..2ff08a048f4 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/normal/menu.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/normal/menu.c @@ -438,11 +438,11 @@ static void menu_set_chosen_tip(grub_menu_t menu, int entry) if (g_ventoy_theme_path[0]) { - grub_env_set("theme", g_ventoy_theme_path); + grub_env_set("theme", g_ventoy_theme_path); } g_ventoy_tip_msg1 = g_ventoy_tip_msg2 = NULL; - if (e && e->id && grub_strncmp(e->id, "VID_", 4) == 0) + if (e && e->id && grub_strncmp(e->id, "VID_", 4) == 0) { g_ventoy_theme_path[0] = 0; img = (img_info *)(void *)grub_strtoul(e->id + 4, NULL, 16); @@ -480,7 +480,7 @@ static void menu_set_chosen_entry (grub_menu_t menu, int entry) { struct grub_menu_viewer *cur; - + menu_set_chosen_tip(menu, entry); for (cur = viewers; cur; cur = cur->next) cur->set_chosen_entry (entry, cur->data); @@ -972,7 +972,7 @@ run_menu (grub_menu_t menu, int nested, int *auto_boot) ; menu_fini (); goto refresh; - } + } } break; case (GRUB_TERM_CTRL | 'd'): @@ -981,7 +981,7 @@ run_menu (grub_menu_t menu, int nested, int *auto_boot) { menu_fini (); g_ventoy_memdisk_mode = 1 - g_ventoy_memdisk_mode; - g_ventoy_menu_refresh = 1; + g_ventoy_menu_refresh = 1; goto refresh; } break; @@ -992,7 +992,7 @@ run_menu (grub_menu_t menu, int nested, int *auto_boot) menu_fini (); g_ventoy_iso_raw = 1 - g_ventoy_iso_raw; g_ventoy_menu_refresh = 1; - goto refresh; + goto refresh; } break; case (GRUB_TERM_CTRL | 'r'): @@ -1001,10 +1001,10 @@ run_menu (grub_menu_t menu, int nested, int *auto_boot) { menu_fini (); g_ventoy_grub2_mode = 1 - g_ventoy_grub2_mode; - g_ventoy_menu_refresh = 1; + g_ventoy_menu_refresh = 1; goto refresh; } - break; + break; case (GRUB_TERM_CTRL | 'w'): case 'w': if (0 == g_ventoy_secondary_menu_on) @@ -1039,7 +1039,7 @@ run_menu (grub_menu_t menu, int nested, int *auto_boot) case 'm': { if (0 == g_ventoy_secondary_menu_on) - { + { if (g_ventoy_cur_img_path) { grub_env_set("VTOY_CHKSUM_FILE_PATH", g_ventoy_cur_img_path); @@ -1128,16 +1128,16 @@ static struct grub_menu_execute_callback execution_callback = static grub_err_t show_menu (grub_menu_t menu, int nested, int autobooted) { - const char *def; + const char *def; def = grub_env_get("VTOY_DEFAULT_IMAGE"); - + while (1) { int ndown; int boot_entry; grub_menu_entry_t e; int auto_boot; - + boot_entry = run_menu (menu, nested, &auto_boot); if (boot_entry < 0) break; @@ -1149,7 +1149,7 @@ show_menu (grub_menu_t menu, int nested, int autobooted) if (autobooted == 0 && auto_boot == 0) { g_ventoy_last_entry = boot_entry; if (g_ventoy_menu_esc) - break; + break; } if (autobooted == 0 && g_ventoy_menu_esc && auto_boot) { @@ -1162,7 +1162,7 @@ show_menu (grub_menu_t menu, int nested, int autobooted) continue; /* Menu is empty. */ if (2 == e->argc && e->args && e->args[1] && grub_strncmp(e->args[1], "VTOY_RET", 8) == 0) - break; + break; grub_cls (); @@ -1175,8 +1175,8 @@ show_menu (grub_menu_t menu, int nested, int autobooted) break; if (2 == e->argc && e->args && e->args[1] && grub_strncmp(e->args[1], "VTOY_RUN_RET", 12) == 0) - break; - else if (2 == e->argc && e->args && e->args[1] && grub_strncmp(e->args[1], "VTOY_RUN_SET", 12) == 0) { + break; + else if (2 == e->argc && e->args && e->args[1] && grub_strncmp(e->args[1], "VTOY_RUN_SET", 12) == 0) { ndown = (int)grub_strtol(e->args[1] + 12, NULL, 10); while (ndown > 0) { @@ -1184,7 +1184,7 @@ show_menu (grub_menu_t menu, int nested, int autobooted) ndown--; } ventoy_menu_push_key('\n'); - break; + break; } } diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/normal/menu_text.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/normal/menu_text.c index 549d90294f6..8dc613ba5c4 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/normal/menu_text.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/normal/menu_text.c @@ -37,8 +37,8 @@ struct menu_viewer_data { int first, offset; struct grub_term_screen_geometry geo; - enum { - TIMEOUT_UNKNOWN, + enum { + TIMEOUT_UNKNOWN, TIMEOUT_NORMAL, TIMEOUT_TERSE, TIMEOUT_TERSE_NO_MARGIN @@ -82,13 +82,13 @@ grub_print_message_indented_real (const char *msg, int margin_left, int ret = 0; unicode_msg = grub_malloc (msg_len * sizeof (grub_uint32_t)); - + if (!unicode_msg) return 0; msg_len = grub_utf8_to_ucs4 (unicode_msg, msg_len, (grub_uint8_t *) msg, -1, 0); - + last_position = unicode_msg + msg_len; *last_position = 0; @@ -200,15 +200,15 @@ command-line or ESC to discard edits and return to the GRUB menu."), } else { grub_snprintf(szLine, sizeof(szLine), "%s", grub_env_get("VTOY_TEXT_MENU_VER")); } - + ret += grub_print_message_indented_real("\n", STANDARD_MARGIN, STANDARD_MARGIN, term, dry_run); ret += grub_print_message_indented_real(szLine, STANDARD_MARGIN, STANDARD_MARGIN, term, dry_run); - + ret += grub_print_message_indented_real("\n", STANDARD_MARGIN, STANDARD_MARGIN, term, dry_run); ret += grub_print_message_indented_real(g_ventoy_hotkey_tip, 3, 6, term, dry_run); - } + } } return ret; } @@ -248,7 +248,7 @@ print_entry (int y, int highlight, grub_menu_entry_t entry, ? GRUB_TERM_COLOR_HIGHLIGHT : GRUB_TERM_COLOR_NORMAL); - grub_term_gotoxy (data->term, (struct grub_term_coordinate) { + grub_term_gotoxy (data->term, (struct grub_term_coordinate) { data->geo.first_entry_x, y }); for (i = 0; i < len; i++) @@ -268,7 +268,7 @@ print_entry (int y, int highlight, grub_menu_entry_t entry, grub_term_setcolorstate (data->term, GRUB_TERM_COLOR_NORMAL); grub_term_gotoxy (data->term, - (struct grub_term_coordinate) { + (struct grub_term_coordinate) { grub_term_cursor_x (&data->geo), y }); grub_term_normal_color = old_color_normal; @@ -285,7 +285,7 @@ print_entries (grub_menu_t menu, const struct menu_viewer_data *data) int i; grub_term_gotoxy (data->term, - (struct grub_term_coordinate) { + (struct grub_term_coordinate) { data->geo.first_entry_x + data->geo.entry_width + data->geo.border + 1, data->geo.first_entry_y }); @@ -487,7 +487,7 @@ menu_text_print_timeout (int timeout, void *dataptr) grub_free (msg_translated); grub_term_gotoxy (data->term, - (struct grub_term_coordinate) { + (struct grub_term_coordinate) { grub_term_cursor_x (&data->geo), data->geo.first_entry_y + data->offset }); grub_term_refresh (data->term); @@ -585,7 +585,7 @@ menu_text_clear_timeout (void *dataptr) if (data->geo.num_entries <= 5 && !data->geo.border) { grub_term_gotoxy (data->term, - (struct grub_term_coordinate) { + (struct grub_term_coordinate) { data->geo.first_entry_x + data->geo.entry_width + data->geo.border + 1, data->geo.first_entry_y + data->geo.num_entries - 1 @@ -603,8 +603,8 @@ menu_text_clear_timeout (void *dataptr) grub_term_refresh (data->term); } -grub_err_t -grub_menu_try_text (struct grub_term_output *term, +grub_err_t +grub_menu_try_text (struct grub_term_output *term, int entry, grub_menu_t menu, int nested) { struct menu_viewer_data *data; diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/normal/misc.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/normal/misc.c index 56629a80002..82e6accb73c 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/normal/misc.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/normal/misc.c @@ -39,7 +39,7 @@ static const char *grub_human_sizes[3][6] = /* TRANSLATORS: that's the list of binary unit prefixes. */ { "", N_("KB"), N_("MB"), N_("GB"), N_("TB"), N_("PB") }, /* TRANSLATORS: that's the list of binary unit prefixes. */ - { N_("B/s"), N_("KiB/s"), N_("MiB/s"), N_("GiB/s"), N_("TiB/s"), N_("PiB/s"), }, + { N_("B/s"), N_("KiB/s"), N_("MiB/s"), N_("GiB/s"), N_("TiB/s"), N_("PiB/s"), }, }; const char * diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/term/efi/mouse.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/term/efi/mouse.c index 0d39817ad59..033dc48ccad 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/term/efi/mouse.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/term/efi/mouse.c @@ -136,8 +136,8 @@ grub_efi_mouse_prot_init (void) mouse_input->mouse[i]->mode->y, mouse_input->mouse[i]->mode->z); #endif } - -end: + +end: efi_call_1(b->free_pool, buf); return mouse_input; @@ -174,7 +174,7 @@ grub_mouse_getkey (struct grub_term_input *term) env = grub_env_get("mouse_delta"); if (env) delta = (int)grub_strtol(env, NULL, 10); - + for (i = 0; i < mouse->count; i++) { efi_call_2 (mouse->mouse[i]->get_state, mouse->mouse[i], &cur); diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/term/keyboard_layout.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/term/keyboard_layout.c index 8d139b5fe31..aa68041ae16 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/term/keyboard_layout.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/term/keyboard_layout.c @@ -7,54 +7,54 @@ static void ventoy_keyboard_layout_QWERTY_USA(void) { } static void ventoy_keyboard_layout_AZERTY(void) { grub_keymap_reset(); -grub_keymap_add_by_string("a", "q"); -grub_keymap_add_by_string("A", "Q"); -grub_keymap_add_by_string("z", "w"); -grub_keymap_add_by_string("Z", "W"); -grub_keymap_add_by_string("q", "a"); -grub_keymap_add_by_string("Q", "A"); -grub_keymap_add_by_string("m", "semicolon"); -grub_keymap_add_by_string("M", "colon"); -grub_keymap_add_by_string("w", "z"); -grub_keymap_add_by_string("W", "Z"); -grub_keymap_add_by_string("comma", "m"); -grub_keymap_add_by_string("question", "M"); -grub_keymap_add_by_string("semicolon", "comma"); -grub_keymap_add_by_string("period", "less"); -grub_keymap_add_by_string("colon", "period"); -grub_keymap_add_by_string("slash", "greater"); -grub_keymap_add_by_string("exclam", "slash"); -grub_keymap_add_by_string("dollar", "bracketright"); -grub_keymap_add_by_string("asterisk", "backslash"); -grub_keymap_add_by_string("percent", "doublequote"); -grub_keymap_add_by_string("ampersand", "1"); -grub_keymap_add_by_string("1", "exclam"); -grub_keymap_add_by_string("tilde", "2"); -grub_keymap_add_by_string("2", "at"); -grub_keymap_add_by_string("doublequote", "3"); -grub_keymap_add_by_string("3", "numbersign"); -grub_keymap_add_by_string("quote", "4"); -grub_keymap_add_by_string("4", "dollar"); -grub_keymap_add_by_string("parenleft", "5"); -grub_keymap_add_by_string("5", "percent"); -grub_keymap_add_by_string("minus", "6"); -grub_keymap_add_by_string("6", "caret"); -grub_keymap_add_by_string("backquote", "7"); -grub_keymap_add_by_string("7", "ampersand"); -grub_keymap_add_by_string("underscore", "8"); -grub_keymap_add_by_string("8", "asterisk"); -grub_keymap_add_by_string("caret", "9"); -grub_keymap_add_by_string("9", "parenleft"); -grub_keymap_add_by_string("at", "0"); -grub_keymap_add_by_string("0", "parenright"); -grub_keymap_add_by_string("parenright", "minus"); -grub_keymap_add_by_string("less", "backquote"); -grub_keymap_add_by_string("greater", "tilde"); -grub_keymap_add_by_string("numbersign", "braceright"); -grub_keymap_add_by_string("backslash", "question"); -grub_keymap_add_by_string("bracketright", "braceleft"); -grub_keymap_add_by_string("braceleft", "quote"); -grub_keymap_add_by_string("braceright", "underscore"); +grub_keymap_add_by_string("a", "q"); +grub_keymap_add_by_string("A", "Q"); +grub_keymap_add_by_string("z", "w"); +grub_keymap_add_by_string("Z", "W"); +grub_keymap_add_by_string("q", "a"); +grub_keymap_add_by_string("Q", "A"); +grub_keymap_add_by_string("m", "semicolon"); +grub_keymap_add_by_string("M", "colon"); +grub_keymap_add_by_string("w", "z"); +grub_keymap_add_by_string("W", "Z"); +grub_keymap_add_by_string("comma", "m"); +grub_keymap_add_by_string("question", "M"); +grub_keymap_add_by_string("semicolon", "comma"); +grub_keymap_add_by_string("period", "less"); +grub_keymap_add_by_string("colon", "period"); +grub_keymap_add_by_string("slash", "greater"); +grub_keymap_add_by_string("exclam", "slash"); +grub_keymap_add_by_string("dollar", "bracketright"); +grub_keymap_add_by_string("asterisk", "backslash"); +grub_keymap_add_by_string("percent", "doublequote"); +grub_keymap_add_by_string("ampersand", "1"); +grub_keymap_add_by_string("1", "exclam"); +grub_keymap_add_by_string("tilde", "2"); +grub_keymap_add_by_string("2", "at"); +grub_keymap_add_by_string("doublequote", "3"); +grub_keymap_add_by_string("3", "numbersign"); +grub_keymap_add_by_string("quote", "4"); +grub_keymap_add_by_string("4", "dollar"); +grub_keymap_add_by_string("parenleft", "5"); +grub_keymap_add_by_string("5", "percent"); +grub_keymap_add_by_string("minus", "6"); +grub_keymap_add_by_string("6", "caret"); +grub_keymap_add_by_string("backquote", "7"); +grub_keymap_add_by_string("7", "ampersand"); +grub_keymap_add_by_string("underscore", "8"); +grub_keymap_add_by_string("8", "asterisk"); +grub_keymap_add_by_string("caret", "9"); +grub_keymap_add_by_string("9", "parenleft"); +grub_keymap_add_by_string("at", "0"); +grub_keymap_add_by_string("0", "parenright"); +grub_keymap_add_by_string("parenright", "minus"); +grub_keymap_add_by_string("less", "backquote"); +grub_keymap_add_by_string("greater", "tilde"); +grub_keymap_add_by_string("numbersign", "braceright"); +grub_keymap_add_by_string("backslash", "question"); +grub_keymap_add_by_string("bracketright", "braceleft"); +grub_keymap_add_by_string("braceleft", "quote"); +grub_keymap_add_by_string("braceright", "underscore"); grub_keymap_enable(); } static void ventoy_keyboard_layout_CZECH_QWERTY(void) { @@ -118,9 +118,9 @@ grub_keymap_enable(); } static void ventoy_keyboard_layout_CZECH_QWERTZ(void) { grub_keymap_reset(); -grub_keymap_add_by_string("y", "z"); -grub_keymap_add_by_string("z", "y"); -grub_keymap_add_by_string("Y", "Z"); +grub_keymap_add_by_string("y", "z"); +grub_keymap_add_by_string("z", "y"); +grub_keymap_add_by_string("Y", "Z"); grub_keymap_add_by_string("Z", "Y"); grub_keymap_add_by_string("semicolon", "backquote"); grub_keymap_add_by_string("plus", "1"); @@ -204,22 +204,22 @@ static void ventoy_keyboard_layout_DVORAK_USA(void) { grub_keymap_reset(); grub_keymap_add_by_string("[", "minus"); grub_keymap_add_by_string("braceleft", "underscore"); -grub_keymap_add_by_string("quote", "q"); -grub_keymap_add_by_string("doublequote", "Q"); -grub_keymap_add_by_string("comma", "w"); -grub_keymap_add_by_string("less", "W"); -grub_keymap_add_by_string("s", "semicolon"); -grub_keymap_add_by_string("S", "colon"); -grub_keymap_add_by_string("semicolon", "z"); -grub_keymap_add_by_string("colon", "Z"); -grub_keymap_add_by_string("w", "comma"); -grub_keymap_add_by_string("W", "less"); -grub_keymap_add_by_string("v", "period"); -grub_keymap_add_by_string("z", "greater"); -grub_keymap_add_by_string("z", "slash"); -grub_keymap_add_by_string("equal", "bracketright"); -grub_keymap_add_by_string("backslash", "backslash"); -grub_keymap_add_by_string("underscore", "doublequote"); +grub_keymap_add_by_string("quote", "q"); +grub_keymap_add_by_string("doublequote", "Q"); +grub_keymap_add_by_string("comma", "w"); +grub_keymap_add_by_string("less", "W"); +grub_keymap_add_by_string("s", "semicolon"); +grub_keymap_add_by_string("S", "colon"); +grub_keymap_add_by_string("semicolon", "z"); +grub_keymap_add_by_string("colon", "Z"); +grub_keymap_add_by_string("w", "comma"); +grub_keymap_add_by_string("W", "less"); +grub_keymap_add_by_string("v", "period"); +grub_keymap_add_by_string("z", "greater"); +grub_keymap_add_by_string("z", "slash"); +grub_keymap_add_by_string("equal", "bracketright"); +grub_keymap_add_by_string("backslash", "backslash"); +grub_keymap_add_by_string("underscore", "doublequote"); grub_keymap_add_by_string("quote", "q"); grub_keymap_add_by_string("doublequote", "Q"); grub_keymap_add_by_string("comma", "w"); @@ -546,17 +546,17 @@ grub_keymap_add_by_string("backquote", "equal"); grub_keymap_add_by_string("numbersign", "backslash"); grub_keymap_add_by_string("parenright", "parenleft"); grub_keymap_add_by_string("parenleft", "asterisk"); -grub_keymap_add_by_string("percent", "caret"); -grub_keymap_add_by_string("less", "numbersign"); -grub_keymap_add_by_string("greater", "bar"); +grub_keymap_add_by_string("percent", "caret"); +grub_keymap_add_by_string("less", "numbersign"); +grub_keymap_add_by_string("greater", "bar"); grub_keymap_enable(); } static void ventoy_keyboard_layout_QWERTZ_HUN(void) { grub_keymap_reset(); -grub_keymap_add_by_string("y", "z"); -grub_keymap_add_by_string("z", "y"); -grub_keymap_add_by_string("Y", "Z"); -grub_keymap_add_by_string("Z", "Y"); +grub_keymap_add_by_string("y", "z"); +grub_keymap_add_by_string("z", "y"); +grub_keymap_add_by_string("Y", "Z"); +grub_keymap_add_by_string("Z", "Y"); grub_keymap_add_by_string("0", "backquote"); grub_keymap_add_by_string("quote", "exclam"); grub_keymap_add_by_string("doublequote", "at"); @@ -564,17 +564,17 @@ grub_keymap_add_by_string("plus", "numbersign"); grub_keymap_add_by_string("exclam", "dollar"); grub_keymap_add_by_string("slash", "caret"); grub_keymap_add_by_string("equal", "ampersand"); -grub_keymap_add_by_string("parenleft", "asterisk"); +grub_keymap_add_by_string("parenleft", "asterisk"); grub_keymap_add_by_string("parenright", "parenleft"); grub_keymap_add_by_string("backslash", "Aq"); grub_keymap_add_by_string("bar", "Aw"); -grub_keymap_add_by_string("bracketleft", "Af"); +grub_keymap_add_by_string("bracketleft", "Af"); grub_keymap_add_by_string("bracketright", "Ag"); grub_keymap_add_by_string("greater", "Az"); grub_keymap_add_by_string("numbersign", "Ax"); grub_keymap_add_by_string("ampersand", "Ac"); grub_keymap_add_by_string("at", "Av"); -grub_keymap_add_by_string("braceleft", "Ab"); +grub_keymap_add_by_string("braceleft", "Ab"); grub_keymap_add_by_string("braceright", "An"); grub_keymap_add_by_string("less", "Am"); grub_keymap_add_by_string("dollar", "colon"); diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/term/serial.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/term/serial.c index 3b2e01c9364..ff25e31290c 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/term/serial.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/term/serial.c @@ -79,7 +79,7 @@ struct grub_serial_input_state struct grub_serial_port *port; }; -static void +static void serial_put (grub_term_output_t term, const int c) { struct grub_serial_output_state *data = term->data; @@ -214,7 +214,7 @@ grub_cmd_serial (grub_extcmd_context_t ctxt, int argc, char **args) port = grub_serial_find (name); if (!port) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("serial port `%s' isn't found"), name); @@ -400,7 +400,7 @@ grub_serial_unregister (struct grub_serial_port *port) { if (port->driver->fini) port->driver->fini (port); - + if (port->term_in) grub_term_unregister_input (port->term_in); if (port->term_out) diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/term/setkey.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/term/setkey.c index a09635291ae..9ebc1afd203 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/term/setkey.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/term/setkey.c @@ -352,13 +352,13 @@ static void grub_keymap_add_by_string(const char *src, const char *dst) { int in = 0; int out = 0; - + in = parse_key(dst); out = parse_key(src); if (in && out) { - grub_keymap_add (in, out); + grub_keymap_add (in, out); } } diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy.c index 38927df8978..c937a1bb50d 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy.c @@ -1,5 +1,5 @@ /****************************************************************************** - * ventoy.c + * ventoy.c * * Copyright (c) 2020, longpanda * @@ -7,12 +7,12 @@ * 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 . * @@ -137,7 +137,7 @@ int ventoy_str_len_alnum(const char *str, int len) { int i; int slen; - + if (NULL == str || 0 == *str) { return 0; @@ -168,7 +168,7 @@ int ventoy_str_len_alnum(const char *str, int len) char * ventoy_str_basename(char *path) { char *pos = NULL; - + pos = grub_strrchr(path, '/'); if (pos) { @@ -185,17 +185,17 @@ char * ventoy_str_basename(char *path) int ventoy_str_chrcnt(const char *str, char c) { int n = 0; - + if (str) { while (*str) { if (*str == c) { - n++; + n++; } str++; - } + } } return n; @@ -235,7 +235,7 @@ int ventoy_strncmp (const char *pattern, const char *str, grub_size_t n) grub_err_t ventoy_env_int_set(const char *name, int value) { char buf[16]; - + grub_snprintf(buf, sizeof(buf), "%d", value); return grub_env_set(name, buf); } @@ -248,13 +248,13 @@ void ventoy_debug_dump_guid(const char *prefix, grub_uint8_t *guid) { return; } - + debug("%s", prefix); for (i = 0; i < 16; i++) { grub_printf("%02x ", guid[i]); } - grub_printf("\n"); + grub_printf("\n"); } int ventoy_is_efi_os(void) @@ -290,7 +290,7 @@ void ventoy_memfile_env_set(const char *prefix, const void *buf, unsigned long l grub_snprintf(name, sizeof(name), "%s_addr", prefix); grub_snprintf(val, sizeof(val), "0x%llx", (ulonglong)(ulong)buf); grub_env_set(name, val); - + grub_snprintf(name, sizeof(name), "%s_size", prefix); grub_snprintf(val, sizeof(val), "%llu", len); grub_env_set(name, val); @@ -374,7 +374,7 @@ static int ventoy_hwinfo_init(void) return 0; } -static global_var_cfg g_global_vars[] = +static global_var_cfg g_global_vars[] = { { "gfxmode", "1024x768", NULL }, { ventoy_left_key, "5%", NULL }, @@ -422,14 +422,14 @@ int ventoy_global_var_init(void) for (i = 0; g_global_vars[i].name; i++) { g_global_vars[i].value = grub_strdup(g_global_vars[i].defval); - ventoy_env_export(g_global_vars[i].name, g_global_vars[i].defval); + ventoy_env_export(g_global_vars[i].name, g_global_vars[i].defval); grub_register_variable_hook(g_global_vars[i].name, ventoy_global_var_read_hook, ventoy_global_var_write_hook); } return 0; } -static ctrl_var_cfg g_ctrl_vars[] = +static ctrl_var_cfg g_ctrl_vars[] = { { "VTOY_WIN11_BYPASS_CHECK", 1 }, { "VTOY_WIN11_BYPASS_NRO", 1 }, diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_browser.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_browser.c index 6224a64d452..1edad1f7b5e 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_browser.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_browser.c @@ -1,5 +1,5 @@ /****************************************************************************** - * ventoy_browser.c + * ventoy_browser.c * * Copyright (c) 2022, longpanda * @@ -7,12 +7,12 @@ * 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 . * @@ -65,7 +65,7 @@ static int ventoy_browser_strcmp(char *str1, char *str2) { c1 = c1 - 'a' + 'A'; } - + if (grub_islower(c2)) { c2 = c2 - 'a' + 'A'; @@ -134,7 +134,7 @@ static browser_node * ventoy_browser_find_top_node(int dir) } } } - + return sel; } @@ -178,16 +178,16 @@ static int ventoy_browser_iterate_partition(struct grub_disk *disk, const grub_p if (g_tree_view_menu_style == 0) { - grub_snprintf(title, sizeof(title), "%-10s (%s,%s%d) [%s] %s %s", - "DISK", disk->name, partition->msdostype == 0xee ? "gpt" : "msdos", - partition->number + 1, (Label ? Label : ""), fs->name, + grub_snprintf(title, sizeof(title), "%-10s (%s,%s%d) [%s] %s %s", + "DISK", disk->name, partition->msdostype == 0xee ? "gpt" : "msdos", + partition->number + 1, (Label ? Label : ""), fs->name, grub_get_human_size(partition->len << disk->log_sector_size, GRUB_HUMAN_SIZE_SHORT)); } else { - grub_snprintf(title, sizeof(title), "(%s,%s%d) [%s] %s %s", - disk->name, partition->msdostype == 0xee ? "gpt" : "msdos", - partition->number + 1, (Label ? Label : ""), fs->name, + grub_snprintf(title, sizeof(title), "(%s,%s%d) [%s] %s %s", + disk->name, partition->msdostype == 0xee ? "gpt" : "msdos", + partition->number + 1, (Label ? Label : ""), fs->name, grub_get_human_size(partition->len << disk->log_sector_size, GRUB_HUMAN_SIZE_SHORT)); } @@ -285,7 +285,7 @@ static int ventoy_browser_valid_filename(const char *filename, int len, int *typ { *type = img_type_wim; } - else if (FILE_FLT(VHD) && g_vhdboot_enable && (0 == grub_strcasecmp(filename + len - 4, ".vhd") || + else if (FILE_FLT(VHD) && g_vhdboot_enable && (0 == grub_strcasecmp(filename + len - 4, ".vhd") || (len >= 5 && 0 == grub_strcasecmp(filename + len - 5, ".vhdx")))) { *type = img_type_vhd; @@ -353,7 +353,7 @@ static int ventoy_browser_iterate_dir(const char *filename, const struct grub_di (void)data; len = grub_strlen(filename); - + if (info->dir) { if (!ventoy_browser_valid_dirname(filename, len)) @@ -395,7 +395,7 @@ static int ventoy_browser_iterate_dir(const char *filename, const struct grub_di else { grub_uint64_t fsize = info->size; - + if (!ventoy_browser_valid_filename(filename, len, &type)) { return 0; @@ -425,7 +425,7 @@ static int ventoy_browser_iterate_dir(const char *filename, const struct grub_di g_menu_fs->fs_close(&file); } } - + node->dir = 0; grub_strncpy(node->filename, filename, sizeof(node->filename)); @@ -485,12 +485,12 @@ static grub_err_t ventoy_browser_iso_part(void) if (g_tree_view_menu_style == 0) { pos = grub_snprintf(buffer, buflen, "menuentry \"%-10s [../]\" --class=\"vtoyret\" VTOY_RET {\n " - " echo 'return ...' \n}\n", "<--"); + " echo 'return ...' \n}\n", "<--"); } else { pos = grub_snprintf(buffer, buflen, "menuentry \"[../]\" --class=\"vtoyret\" VTOY_RET {\n " - " echo 'return ...' \n}\n"); + " echo 'return ...' \n}\n"); } grub_memcpy(buffer + pos, g_tree_script_buf + g_tree_script_pre, cfglen); @@ -535,14 +535,14 @@ grub_err_t ventoy_cmd_browser_dir(grub_extcmd_context_t ctxt, int argc, char **a debug("Invalid fs %s\n", args[1]); return 1; } - + dev = grub_device_open(args[0]); if (!dev) { debug("Failed to open device %s\n", args[0]); return 1; } - + g_menu_fs = fs; g_menu_device = args[0]; g_menu_dev = dev; @@ -552,24 +552,24 @@ grub_err_t ventoy_cmd_browser_dir(grub_extcmd_context_t ctxt, int argc, char **a { g_menu_path_len = 0; g_menu_path_buf[0] = 0; - fs->fs_dir(dev, "/", ventoy_browser_iterate_dir, NULL); + fs->fs_dir(dev, "/", ventoy_browser_iterate_dir, NULL); } else { g_menu_path_len = grub_snprintf(g_menu_path_buf, sizeof(g_menu_path_buf), "%s", args[2]); - fs->fs_dir(dev, g_menu_path_buf, ventoy_browser_iterate_dir, NULL); + fs->fs_dir(dev, g_menu_path_buf, ventoy_browser_iterate_dir, NULL); } grub_device_close(dev); if (g_tree_view_menu_style == 0) { browser_ssprintf(&mbuf, "menuentry \"%-10s [(%s)%s/..]\" --class=\"vtoyret\" VTOY_RET {\n " - " echo 'return ...' \n}\n", "<--", args[0], g_menu_path_buf); + " echo 'return ...' \n}\n", "<--", args[0], g_menu_path_buf); } else { browser_ssprintf(&mbuf, "menuentry \"[(%s)%s/..]\" --class=\"vtoyret\" VTOY_RET {\n " - " echo 'return ...' \n}\n", args[0], g_menu_path_buf); + " echo 'return ...' \n}\n", args[0], g_menu_path_buf); } for (i = 1; i >= 0; i--) @@ -581,7 +581,7 @@ grub_err_t ventoy_cmd_browser_dir(grub_extcmd_context_t ctxt, int argc, char **a { browser_ssprintf(&mbuf, "%s", node->menuentry); ventoy_browser_mbuf_extend(&mbuf); - + if (node->prev) { node->prev->next = node->next; @@ -604,7 +604,7 @@ grub_err_t ventoy_cmd_browser_dir(grub_extcmd_context_t ctxt, int argc, char **a } } g_browser_list = NULL; - + grub_snprintf(cfgfile, sizeof(cfgfile), "configfile mem:0x%lx:size:%d", (ulong)mbuf.buf, mbuf.pos); grub_script_execute_sourcecode(cfgfile); @@ -616,7 +616,7 @@ grub_err_t ventoy_cmd_browser_disk(grub_extcmd_context_t ctxt, int argc, char ** { char cfgfile[64]; browser_mbuf mbuf; - + (void)ctxt; (void)argc; (void)args; @@ -631,14 +631,14 @@ grub_err_t ventoy_cmd_browser_disk(grub_extcmd_context_t ctxt, int argc, char ** if (g_tree_view_menu_style == 0) { browser_ssprintf(&mbuf, "menuentry \"%-10s [%s]\" --class=\"vtoyret\" VTOY_RET {\n " - " echo 'return ...' \n}\n", "<--", - ventoy_get_vmenu_title("VTLANG_BROWER_RETURN")); + " echo 'return ...' \n}\n", "<--", + ventoy_get_vmenu_title("VTLANG_BROWER_RETURN")); } else { browser_ssprintf(&mbuf, "menuentry \"[%s]\" --class=\"vtoyret\" VTOY_RET {\n " - " echo 'return ...' \n}\n", - ventoy_get_vmenu_title("VTLANG_BROWER_RETURN")); + " echo 'return ...' \n}\n", + ventoy_get_vmenu_title("VTLANG_BROWER_RETURN")); } grub_disk_dev_iterate(ventoy_browser_iterate_disk, &mbuf); diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_cmd.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_cmd.c index 889ec678556..f3b8a5e4a34 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_cmd.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_cmd.c @@ -1,5 +1,5 @@ /****************************************************************************** - * ventoy_cmd.c + * ventoy_cmd.c * * Copyright (c) 2021, longpanda * @@ -7,12 +7,12 @@ * 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 . * @@ -55,7 +55,7 @@ GRUB_MOD_LICENSE ("GPLv3+"); static grub_uint8_t g_check_mbr_data[] = { 0xEB, 0x63, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x54, 0x00, 0x47, 0x65, 0x00, 0x48, 0x44, 0x00, 0x52, 0x64, 0x00, 0x20, 0x45, 0x72, 0x0D, }; @@ -149,12 +149,12 @@ static char g_iso_vd_id_application[130]; static int g_pager_flag = 0; static char g_old_pager[32]; -const char *g_menu_class[img_type_max] = +const char *g_menu_class[img_type_max] = { "vtoyiso", "vtoywim", "vtoyefi", "vtoyimg", "vtoyvhd", "vtoyvtoy" }; - -const char *g_menu_prefix[img_type_max] = + +const char *g_menu_prefix[img_type_max] = { "iso", "wim", "efi", "img", "vhd", "vtoy" }; @@ -212,7 +212,7 @@ static int ventoy_string_check(const char *str, grub_char_check_func check) { return 0; } - + for ( ; *str; str++) { if (!check(*str)) @@ -234,7 +234,7 @@ static grub_ssize_t ventoy_fs_read(grub_file_t file, char *buf, grub_size_t len) static int ventoy_control_get_flag(const char *key) { const char *val = ventoy_get_env(key); - + if (val && val[0] == '1' && val[1] == 0) { return 1; @@ -263,10 +263,10 @@ static int ventoy_video_hook(const struct grub_video_mode_info *info, void *hook { return 0; } - + for (i = 0; i < g_video_mode_num; i++) { - if (g_video_mode_list[i].width == info->width && + if (g_video_mode_list[i].width == info->width && g_video_mode_list[i].height == info->height && g_video_mode_list[i].bpp == info->bpp) { @@ -320,7 +320,7 @@ static int ventoy_enum_video_mode(void) grub_video_adapter_t adapter; grub_video_driver_id_t id; ventoy_video_mode mode; - + g_video_mode_num = 0; g_video_mode_max = 1024; g_video_mode_list = grub_malloc(sizeof(ventoy_video_mode) * g_video_mode_max); @@ -363,7 +363,7 @@ static int ventoy_enum_video_mode(void) grub_memcpy(g_video_mode_list + j, &mode, sizeof(ventoy_video_mode)); } } - + VENTOY_CMD_RETURN(GRUB_ERR_NONE); } @@ -392,15 +392,15 @@ static int ventoy_pre_parse_data(char *src, int size) goto end; } - grub_snprintf(buf, sizeof(buf), - "regexp -s 1:%s -s 2:%s -s 3:%s \"@([^@]*)@([^@]*)@([^@]*)@\" \"%s\"", + grub_snprintf(buf, sizeof(buf), + "regexp -s 1:%s -s 2:%s -s 3:%s \"@([^@]*)@([^@]*)@([^@]*)@\" \"%s\"", ventoy_left_key, ventoy_top_key, ventoy_color_key, src); grub_script_execute_sourcecode(buf); -end: +end: *pos = c; - return 0; + return 0; } static grub_file_t ventoy_wrapper_open(grub_file_t rawFile, enum grub_file_type type) @@ -440,7 +440,7 @@ static grub_file_t ventoy_wrapper_open(grub_file_t rawFile, enum grub_file_type len = ventoy_fill_data(4096, (char *)file->data + rawFile->size); g_old_file = rawFile; - + file->size = rawFile->size + len; file->device = rawFile->device; file->fs = &vtoy_fs; @@ -452,7 +452,7 @@ static grub_file_t ventoy_wrapper_open(grub_file_t rawFile, enum grub_file_type static int ventoy_check_decimal_var(const char *name, long *value) { const char *value_str = NULL; - + value_str = grub_env_get(name); if (NULL == value_str) { @@ -472,7 +472,7 @@ static int ventoy_check_decimal_var(const char *name, long *value) grub_uint64_t ventoy_get_vtoy_partsize(int part) { grub_uint64_t sectors; - + if (grub_strncmp(g_ventoy_part_info->Head.Signature, "EFI PART", 8) == 0) { sectors = g_ventoy_part_info->PartTbl[part].LastLBA + 1 - g_ventoy_part_info->PartTbl[part].StartLBA; @@ -501,23 +501,23 @@ static int ventoy_load_efiboot_template(char **buf, int *datalen, int *direntoff } len = (int)file->size; - + data = (char *)grub_malloc(file->size); if (!data) { return 1; } - + grub_file_read(file, data, file->size); - grub_file_close(file); + grub_file_close(file); grub_snprintf(exec, sizeof(exec), "loopback efiboot mem:0x%llx:size:%d", (ulonglong)(ulong)data, len); grub_script_execute_sourcecode(exec); - file = grub_file_open("(efiboot)/EFI/BOOT/BOOTX64.EFI", GRUB_FILE_TYPE_LINUX_INITRD); + file = grub_file_open("(efiboot)/EFI/BOOT/BOOTX64.EFI", GRUB_FILE_TYPE_LINUX_INITRD); offset = (grub_uint32_t)grub_iso9660_get_last_file_dirent_pos(file); grub_file_close(file); - + grub_script_execute_sourcecode("loopback -d efiboot"); *buf = data; @@ -530,7 +530,7 @@ static int ventoy_load_efiboot_template(char **buf, int *datalen, int *direntoff static int ventoy_set_check_result(int ret, const char *msg) { char buf[32]; - + grub_snprintf(buf, sizeof(buf), "%d", (ret & 0x7FFF)); grub_env_set("VTOY_CHKDEV_RESULT_STRING", buf); grub_env_export("VTOY_CHKDEV_RESULT_STRING"); @@ -541,7 +541,7 @@ static int ventoy_set_check_result(int ret, const char *msg) grub_printf(VTOY_WARNING"\n"); grub_printf(VTOY_WARNING"\n"); grub_printf(VTOY_WARNING"\n\n\n"); - + grub_printf("This is NOT a standard Ventoy device and is NOT supported (%d).\n", ret); grub_printf("Error message: <%s>\n\n", msg); grub_printf("You should follow the instructions in https://www.ventoy.net to use Ventoy.\n"); @@ -563,7 +563,7 @@ static int ventoy_check_official_device(grub_device_t dev) grub_device_t dev2; char *label = NULL; struct grub_partition *partition; - + if (dev->disk == NULL || dev->disk->partition == NULL) { return ventoy_set_check_result(1 | 0x1000, "Internal Error"); @@ -600,7 +600,7 @@ static int ventoy_check_official_device(grub_device_t dev) } else { - file = ventoy_grub_file_open(VENTOY_FILE_TYPE, "(%s,2)/ventoy/ventoy.cpio", dev->disk->name); + file = ventoy_grub_file_open(VENTOY_FILE_TYPE, "(%s,2)/ventoy/ventoy.cpio", dev->disk->name); } if (!file) { @@ -678,7 +678,7 @@ static int ventoy_check_official_device(grub_device_t dev) return ventoy_set_check_result(10, "Partition name is not VTOYEFI"); } - grub_device_close(dev2); + grub_device_close(dev2); } /* MBR check */ @@ -691,7 +691,7 @@ static int ventoy_check_official_device(grub_device_t dev) grub_memset(mbr, 0, 512); grub_disk_read(disk, 0, 0, 512, mbr); grub_disk_close(disk); - + if (grub_memcmp(g_check_mbr_data, mbr, 0x30) || grub_memcmp(g_check_mbr_data + 0x30, mbr + 0x190, 16)) { return ventoy_set_check_result(12, "MBR check failed"); @@ -724,7 +724,7 @@ grub_uint64_t ventoy_grub_get_file_size(const char *fmt, ...) va_start (ap, fmt); grub_vsnprintf(fullpath, 255, fmt, ap); va_end (ap); - + file = grub_file_open(fullpath, VENTOY_FILE_TYPE); if (!file) { @@ -788,7 +788,7 @@ int ventoy_gzip_compress(void *mem_in, int mem_in_len, void *mem_out, int mem_ou { mz_stream s; grub_uint8_t *outbuf; - grub_uint8_t gzHdr[10] = + grub_uint8_t gzHdr[10] = { 0x1F, 0x8B, /* magic */ 8, /* z method */ @@ -801,7 +801,7 @@ int ventoy_gzip_compress(void *mem_in, int mem_in_len, void *mem_out, int mem_ou grub_memset(&s, 0, sizeof(mz_stream)); mz_deflateInit2(&s, 1, MZ_DEFLATED, -MZ_DEFAULT_WINDOW_BITS, 6, MZ_DEFAULT_STRATEGY); - + outbuf = (grub_uint8_t *)mem_out; mem_out_len -= sizeof(gzHdr) + 8; @@ -822,7 +822,7 @@ int ventoy_gzip_compress(void *mem_in, int mem_in_len, void *mem_out, int mem_ou *(grub_uint32_t *)outbuf = grub_getcrc32c(0, outbuf, s.total_out); *(grub_uint32_t *)(outbuf + 4) = (grub_uint32_t)(s.total_out); - return s.total_out + sizeof(gzHdr) + 8; + return s.total_out + sizeof(gzHdr) + 8; } @@ -895,7 +895,7 @@ static grub_err_t ventoy_cmd_strstr(grub_extcmd_context_t ctxt, int argc, char * static grub_err_t ventoy_cmd_strbegin(grub_extcmd_context_t ctxt, int argc, char **args) { char *c0, *c1; - + (void)ctxt; if (argc != 2) @@ -927,7 +927,7 @@ static grub_err_t ventoy_cmd_strbegin(grub_extcmd_context_t ctxt, int argc, char static grub_err_t ventoy_cmd_strcasebegin(grub_extcmd_context_t ctxt, int argc, char **args) { char *c0, *c1; - + (void)ctxt; if (argc != 2) @@ -960,7 +960,7 @@ static grub_err_t ventoy_cmd_incr(grub_extcmd_context_t ctxt, int argc, char **a { long value_long = 0; char buf[32]; - + if ((argc != 2) || (!ventoy_is_decimal(args[1]))) { return grub_error(GRUB_ERR_BAD_ARGUMENT, "Usage: %s {Variable} {Int}", cmd_raw_name); @@ -984,7 +984,7 @@ static grub_err_t ventoy_cmd_mod(grub_extcmd_context_t ctxt, int argc, char **ar ulonglong value1 = 0; ulonglong value2 = 0; char buf[32]; - + if (argc != 3) { return grub_error(GRUB_ERR_BAD_ARGUMENT, "Usage: %s {Int} {Int} {Variable}", cmd_raw_name); @@ -1004,7 +1004,7 @@ static grub_err_t ventoy_cmd_file_size(grub_extcmd_context_t ctxt, int argc, cha int rc = 1; char buf[32]; grub_file_t file; - + (void)ctxt; (void)argc; (void)args; @@ -1025,16 +1025,16 @@ static grub_err_t ventoy_cmd_file_size(grub_extcmd_context_t ctxt, int argc, cha grub_env_set(args[1], buf); - grub_file_close(file); + grub_file_close(file); rc = 0; - + return rc; } static grub_err_t ventoy_cmd_load_wimboot(grub_extcmd_context_t ctxt, int argc, char **args) { grub_file_t file; - + (void)ctxt; (void)argc; (void)args; @@ -1056,7 +1056,7 @@ static grub_err_t ventoy_cmd_load_wimboot(grub_extcmd_context_t ctxt, int argc, { return grub_error(GRUB_ERR_OUT_OF_MEMORY, "Can't allocate image chunk memoty\n"); } - + g_wimiso_chunk_list.max_chunk = DEFAULT_CHUNK_NUM; g_wimiso_chunk_list.cur_chunk = 0; @@ -1079,7 +1079,7 @@ static grub_err_t ventoy_cmd_concat_efi_iso(grub_extcmd_context_t ctxt, int argc char *buf = NULL; char *data = NULL; ventoy_iso9660_override *dirent; - + (void)ctxt; if (argc != 2) @@ -1096,7 +1096,7 @@ static grub_err_t ventoy_cmd_concat_efi_iso(grub_extcmd_context_t ctxt, int argc } totlen += len; - + debug("efiboot template len:%d offset:%d\n", len, offset); file = ventoy_grub_file_open(GRUB_FILE_TYPE_LINUX_INITRD, "%s", args[0]); @@ -1125,7 +1125,7 @@ static grub_err_t ventoy_cmd_concat_efi_iso(grub_extcmd_context_t ctxt, int argc data = (char *)grub_efi_allocate_iso_buf(totlen); #else data = (char *)grub_malloc(totlen); -#endif +#endif ventoy_fill_os_param(file, (ventoy_os_param *)data); @@ -1133,7 +1133,7 @@ static grub_err_t ventoy_cmd_concat_efi_iso(grub_extcmd_context_t ctxt, int argc grub_check_free(buf); grub_file_read(file, data + sizeof(ventoy_chain_head) + len, file->size); - grub_file_close(file); + grub_file_close(file); ventoy_memfile_env_set(args[1], data, (ulonglong)totlen); @@ -1148,7 +1148,7 @@ grub_err_t ventoy_cmd_set_wim_prompt(grub_extcmd_context_t ctxt, int argc, char g_vtoy_load_prompt = 0; grub_memset(g_vtoy_prompt_msg, 0, sizeof(g_vtoy_prompt_msg)); - + if (argc == 2 && args[0][0] == '1') { g_vtoy_load_prompt = 1; @@ -1170,7 +1170,7 @@ grub_ssize_t ventoy_load_file_with_prompt(grub_file_t file, void *buf, grub_ssiz grub_ssize_t left = size; char *cur = (char *)buf; - grub_printf("\r%s 1%% ", g_vtoy_prompt_msg); + grub_printf("\r%s 1%% ", g_vtoy_prompt_msg); grub_refresh(); while (left >= VTOY_SIZE_2MB) @@ -1185,7 +1185,7 @@ grub_ssize_t ventoy_load_file_with_prompt(grub_file_t file, void *buf, grub_ssiz div = 1; } grub_printf("\r%s %d%% ", g_vtoy_prompt_msg, (int)div); - grub_refresh(); + grub_refresh(); } if (left > 0) @@ -1194,7 +1194,7 @@ grub_ssize_t ventoy_load_file_with_prompt(grub_file_t file, void *buf, grub_ssiz } grub_printf("\r%s 100%% \n", g_vtoy_prompt_msg); - grub_refresh(); + grub_refresh(); return size; } @@ -1205,7 +1205,7 @@ static grub_err_t ventoy_cmd_load_file_to_mem(grub_extcmd_context_t ctxt, int ar char *buf = NULL; grub_file_t file; enum grub_file_type type; - + (void)ctxt; (void)argc; (void)args; @@ -1235,7 +1235,7 @@ static grub_err_t ventoy_cmd_load_file_to_mem(grub_extcmd_context_t ctxt, int ar buf = (char *)grub_efi_allocate_chain_buf(file->size); #else buf = (char *)grub_malloc(file->size); -#endif +#endif if (!buf) { @@ -1254,9 +1254,9 @@ static grub_err_t ventoy_cmd_load_file_to_mem(grub_extcmd_context_t ctxt, int ar ventoy_memfile_env_set(args[2], buf, (ulonglong)(file->size)); - grub_file_close(file); + grub_file_close(file); rc = 0; - + return rc; } @@ -1266,7 +1266,7 @@ static grub_err_t ventoy_cmd_load_img_memdisk(grub_extcmd_context_t ctxt, int ar int headlen; char *buf = NULL; grub_file_t file; - + (void)ctxt; (void)argc; (void)args; @@ -1289,7 +1289,7 @@ static grub_err_t ventoy_cmd_load_img_memdisk(grub_extcmd_context_t ctxt, int ar buf = (char *)grub_efi_allocate_iso_buf(headlen + file->size); #else buf = (char *)grub_malloc(headlen + file->size); -#endif +#endif ventoy_fill_os_param(file, (ventoy_os_param *)buf); @@ -1297,9 +1297,9 @@ static grub_err_t ventoy_cmd_load_img_memdisk(grub_extcmd_context_t ctxt, int ar ventoy_memfile_env_set(args[1], buf, (ulonglong)(file->size)); - grub_file_close(file); + grub_file_close(file); rc = 0; - + return rc; } @@ -1308,7 +1308,7 @@ static grub_err_t ventoy_cmd_iso9660_is_joliet(grub_extcmd_context_t ctxt, int a (void)ctxt; (void)argc; (void)args; - + if (grub_iso9660_is_joliet()) { debug("This time has joliet process\n"); @@ -1347,7 +1347,7 @@ static grub_err_t ventoy_cmd_is_udf(grub_extcmd_context_t ctxt, int argc, char * int rc = 1; grub_file_t file; grub_uint8_t buf[32]; - + (void)ctxt; (void)argc; (void)args; @@ -1391,10 +1391,10 @@ static grub_err_t ventoy_cmd_is_udf(grub_extcmd_context_t ctxt, int argc, char * } } - grub_file_close(file); + grub_file_close(file); debug("ISO UDF: %s\n", rc ? "NO" : "YES"); - + return rc; } @@ -1402,7 +1402,7 @@ static grub_err_t ventoy_cmd_cmp(grub_extcmd_context_t ctxt, int argc, char **ar { long value_long1 = 0; long value_long2 = 0; - + if ((argc != 3) || (!ventoy_is_decimal(args[0])) || (!ventoy_is_decimal(args[2]))) { return grub_error(GRUB_ERR_BAD_ARGUMENT, "Usage: %s {Int1} { eq|ne|gt|lt|ge|le } {Int2}", cmd_raw_name); @@ -1439,7 +1439,7 @@ static grub_err_t ventoy_cmd_cmp(grub_extcmd_context_t ctxt, int argc, char **ar { return grub_error(GRUB_ERR_BAD_ARGUMENT, "Usage: %s {Int1} { eq ne gt lt ge le } {Int2}", cmd_raw_name); } - + return grub_errno; } @@ -1447,7 +1447,7 @@ static grub_err_t ventoy_cmd_device(grub_extcmd_context_t ctxt, int argc, char * { char *pos = NULL; char buf[128] = {0}; - + if (argc != 2) { return grub_error(GRUB_ERR_BAD_ARGUMENT, "Usage: %s path var", cmd_raw_name); @@ -1461,7 +1461,7 @@ static grub_err_t ventoy_cmd_device(grub_extcmd_context_t ctxt, int argc, char * } grub_env_set(args[1], buf); - + VENTOY_CMD_RETURN(GRUB_ERR_NONE); } @@ -1474,7 +1474,7 @@ static grub_err_t ventoy_cmd_check_compatible(grub_extcmd_context_t ctxt, int ar const char *files[] = { "ventoy.dat", "VENTOY.DAT" }; (void)ctxt; - + if (argc != 1) { return grub_error(GRUB_ERR_BAD_ARGUMENT, "Usage: %s (loop)", cmd_raw_name); @@ -1494,7 +1494,7 @@ static grub_err_t ventoy_cmd_check_compatible(grub_extcmd_context_t ctxt, int ar debug("file %s NOT exist\n", buf); } } - + grub_snprintf(buf, sizeof(buf) - 1, "%s", args[0][0] == '(' ? (args[0] + 1) : args[0]); pos = grub_strstr(buf, ")"); if (pos) @@ -1507,7 +1507,7 @@ static grub_err_t ventoy_cmd_check_compatible(grub_extcmd_context_t ctxt, int ar { grub_disk_read(disk, 16 << 2, 0, 1024, g_img_swap_tmp_buf); grub_disk_close(disk); - + g_img_swap_tmp_buf[703] = 0; for (i = 318; i < 703; i++) { @@ -1551,7 +1551,7 @@ int ventoy_cmp_img(img_info *img1, img_info *img2) { c1 = c1 - 'a' + 'A'; } - + if (grub_islower(c2)) { c2 = c2 - 'a' + 'A'; @@ -1589,7 +1589,7 @@ static int ventoy_cmp_subdir(img_iterator_node *node1, img_iterator_node *node2) { c1 = c1 - 'a' + 'A'; } - + if (grub_islower(c2)) { c2 = c2 - 'a' + 'A'; @@ -1608,7 +1608,7 @@ static int ventoy_cmp_subdir(img_iterator_node *node1, img_iterator_node *node2) void ventoy_swap_img(img_info *img1, img_info *img2) { grub_memcpy(&g_img_swap_tmp, img1, sizeof(img_info)); - + grub_memcpy(img1, img2, sizeof(img_info)); img1->next = g_img_swap_tmp.next; img1->prev = g_img_swap_tmp.prev; @@ -1621,7 +1621,7 @@ void ventoy_swap_img(img_info *img1, img_info *img2) int ventoy_img_name_valid(const char *filename, grub_size_t namelen) { (void)namelen; - + if (g_filt_dot_underscore_file && filename[0] == '.' && filename[1] == '_') { return 0; @@ -1678,7 +1678,7 @@ static int ventoy_vlnk_iterate_disk(const char *name, void *data) static int ventoy_vlnk_probe_fs(ventoy_vlnk_part *cur) { - const char *fs[ventoy_fs_max + 1] = + const char *fs[ventoy_fs_max + 1] = { "exfat", "ntfs", "ext2", "xfs", "udf", "fat", NULL }; @@ -1705,7 +1705,7 @@ static int ventoy_check_vlnk_data(ventoy_vlnk *vlnk, int print, char *dst, int s grub_uint32_t readcrc, calccrc; ventoy_vlnk_part *cur; grub_fs_t fs = NULL; - + if (grub_memcmp(&(vlnk->guid), &g_ventoy_guid, sizeof(ventoy_guid))) { if (print) @@ -1750,12 +1750,12 @@ static int ventoy_check_vlnk_data(ventoy_vlnk *vlnk, int print, char *dst, int s cur->probe = 1; ventoy_vlnk_probe_fs(cur); } - + if (!fs) { fs = cur->fs; } - + if (cur->fs) { struct grub_file file; @@ -1793,7 +1793,7 @@ static int ventoy_check_vlnk_data(ventoy_vlnk *vlnk, int print, char *dst, int s { grub_printf("Disk Find: [ NO ]\n"); } - + if (partfind) { grub_printf("Part Find: [ YES ] [ %s ] [ %s ]\n", device, fs ? fs->name : "N/A"); @@ -1807,7 +1807,7 @@ static int ventoy_check_vlnk_data(ventoy_vlnk *vlnk, int print, char *dst, int s { grub_printf("VLNK File: <%s>\n", dst); } - + grub_printf("\n"); grub_refresh(); } @@ -1848,7 +1848,7 @@ int ventoy_add_vlnk_file(char *dir, const char *name) if (ventoy_check_vlnk_data(&vlnk, 0, dst, sizeof(dst)) == 0) { - rc = grub_file_add_vlnk(src, dst); + rc = grub_file_add_vlnk(src, dst); } return rc; @@ -1878,18 +1878,18 @@ static int ventoy_collect_img_files(const char *filename, const struct grub_dirh grub_printf("\n\n Ventoy scanning files, please wait...\n"); grub_refresh(); g_enumerate_time_checked = 1; - } + } } len = grub_strlen(filename); - + if (info->dir) { if (node->level + 1 > g_img_max_search_level) { return 0; } - + if ((len == 1 && filename[0] == '.') || (len == 2 && filename[0] == '.' && filename[1] == '.')) { @@ -1918,7 +1918,7 @@ static int ventoy_collect_img_files(const char *filename, const struct grub_dirh if (index == 0) { debug("Directory %s not found in image_list plugin config...\n", g_img_swap_tmp_buf); - return 0; + return 0; } } @@ -1973,7 +1973,7 @@ static int ventoy_collect_img_files(const char *filename, const struct grub_dirh { type = img_type_wim; } - else if (FILE_FLT(VHD) && g_vhdboot_enable && (0 == grub_strcasecmp(filename + len - 4, ".vhd") || + else if (FILE_FLT(VHD) && g_vhdboot_enable && (0 == grub_strcasecmp(filename + len - 4, ".vhd") || (len >= 5 && 0 == grub_strcasecmp(filename + len - 5, ".vhdx")))) { type = img_type_vhd; @@ -2026,12 +2026,12 @@ static int ventoy_collect_img_files(const char *filename, const struct grub_dirh if (VENTOY_IMG_WHITE_LIST == g_plugin_image_list && index == 0) { debug("File %s not found in image_list plugin config...\n", g_img_swap_tmp_buf); - return 0; + return 0; } else if (VENTOY_IMG_BLACK_LIST == g_plugin_image_list && index > 0) { debug("File %s found in image_blacklist plugin config %d ...\n", g_img_swap_tmp_buf, index); - return 0; + return 0; } } @@ -2046,7 +2046,7 @@ static int ventoy_collect_img_files(const char *filename, const struct grub_dirh } } } - + img = grub_zalloc(sizeof(img_info)); if (img) { @@ -2061,11 +2061,11 @@ static int ventoy_collect_img_files(const char *filename, const struct grub_dirh { if (node->dir[0] == '/') { - img->size = ventoy_grub_get_file_size("%s%s%s", g_iso_path, node->dir, filename); + img->size = ventoy_grub_get_file_size("%s%s%s", g_iso_path, node->dir, filename); } else { - img->size = ventoy_grub_get_file_size("%s/%s%s", g_iso_path, node->dir, filename); + img->size = ventoy_grub_get_file_size("%s/%s%s", g_iso_path, node->dir, filename); } } @@ -2075,7 +2075,7 @@ static int ventoy_collect_img_files(const char *filename, const struct grub_dirh grub_free(img); return 0; } - + if (g_ventoy_img_list) { tail = *(node->tail); @@ -2086,7 +2086,7 @@ static int ventoy_collect_img_files(const char *filename, const struct grub_dirh { g_ventoy_img_list = img; } - + img->id = g_ventoy_img_count; img->parent = node; if (node && NULL == node->firstiso) @@ -2101,7 +2101,7 @@ static int ventoy_collect_img_files(const char *filename, const struct grub_dirh tmp->isocnt++; tmp = tmp->parent; } - + *((img_info **)(node->tail)) = img; g_ventoy_img_count++; @@ -2113,7 +2113,7 @@ static int ventoy_collect_img_files(const char *filename, const struct grub_dirh img->tip1 = tip->tip1; img->tip2 = tip->tip2; } - + img->class = ventoy_plugin_get_menu_class(vtoy_class_image_file, img->name, img->path); if (!img->class) { @@ -2153,7 +2153,7 @@ int ventoy_fill_data(grub_uint32_t buflen, char *buffer) ventoy_guid guid = VENTOY_GUID; const char *fmt1 = NULL; const char *fmt2 = NULL; - const char *fmt3 = NULL; + const char *fmt3 = NULL; grub_uint32_t *puint = (grub_uint32_t *)name; grub_uint32_t *puint2 = (grub_uint32_t *)plat; const char fmtdata[]={ 0x39, 0x35, 0x25, 0x00, 0x35, 0x00, 0x23, 0x30, 0x30, 0x30, 0x30, 0x66, 0x66, 0x00 }; @@ -2181,12 +2181,12 @@ int ventoy_fill_data(grub_uint32_t buflen, char *buffer) { fmt1 = fmtdata; } - + grub_memset(name, 0, sizeof(name)); puint[1] = grub_swap_bytes32(0x5f4c4654); puint[0] = grub_swap_bytes32(0x56544c45); fmt2 = ventoy_get_env(name); - + grub_memset(name, 0, sizeof(name)); puint[1] = grub_swap_bytes32(0x5f434c52); puint[0] = grub_swap_bytes32(0x56544c45); @@ -2194,15 +2194,15 @@ int ventoy_fill_data(grub_uint32_t buflen, char *buffer) grub_memcpy(guidstr, &guid, sizeof(guid)); - puint2[0] = grub_swap_bytes32(g_ventoy_plat_data); + puint2[0] = grub_swap_bytes32(g_ventoy_plat_data); /* Easter egg :) It will be appreciated if you reserve it, but NOT mandatory. */ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wformat-nonliteral" - len = grub_snprintf(buffer, buflen, fmtcode, - fmt1 ? fmt1 : fmtdata, - fmt2 ? fmt2 : fmtdata + 4, - value ? value : "", plat, guidstr, + len = grub_snprintf(buffer, buflen, fmtcode, + fmt1 ? fmt1 : fmtdata, + fmt2 ? fmt2 : fmtdata + 4, + value ? value : "", plat, guidstr, fmt3 ? fmt3 : fmtdata + 6); #pragma GCC diagnostic pop @@ -2224,7 +2224,7 @@ ventoy_password_get (char buf[], unsigned buf_size) while (1) { - key = grub_getkey (); + key = grub_getkey (); if (key == '\n' || key == '\r') break; @@ -2295,7 +2295,7 @@ int ventoy_check_password(const vtoy_password *pwd, int retry) grub_printf("Enter password: "); grub_refresh(); - + if (pwd->type == VTOY_PASSWORD_TXT) { ventoy_get_password(input, 128); @@ -2317,14 +2317,14 @@ int ventoy_check_password(const vtoy_password *pwd, int retry) { offset = (int)grub_snprintf(input, 128, "%s", pwd->salt); ventoy_get_password(input + offset, 128); - + grub_crypto_hash(GRUB_MD_MD5, md5, input, grub_strlen(input)); if (grub_memcmp(pwd->md5, md5, 16) == 0) { return 0; } } - + grub_printf("Invalid password!\n\n"); grub_refresh(); } @@ -2384,7 +2384,7 @@ static int ventoy_dynamic_tree_menu(img_iterator_node *node) const char *dir_alias = NULL; img_iterator_node *child = NULL; const menu_tip *tip = NULL; - + if (node->isocnt == 0 || node->done == 1) { return 0; @@ -2401,14 +2401,14 @@ static int ventoy_dynamic_tree_menu(img_iterator_node *node) { 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, "menuentry \"%-10s [%s]\" --class=\"vtoyret\" VTOY_RET {\n " " echo 'return ...' \n" "}\n", "<--", ventoy_get_vmenu_title("VTLANG_RET_TO_LISTVIEW")); } else { - vtoy_ssprintf(g_tree_script_buf, g_tree_script_pos, + vtoy_ssprintf(g_tree_script_buf, g_tree_script_pos, "menuentry \"[%s]\" --class=\"vtoyret\" VTOY_RET {\n " " echo 'return ...' \n" "}\n", ventoy_get_vmenu_title("VTLANG_RET_TO_LISTVIEW")); @@ -2433,14 +2433,14 @@ static int ventoy_dynamic_tree_menu(img_iterator_node *node) { if (g_tree_view_menu_style == 0) { - vtoy_ssprintf(g_tree_script_buf, g_tree_script_pos, - "submenu \"%-10s %s\" --class=\"%s\" --id=\"DIR_%s\" _VTIP_%p {\n", + vtoy_ssprintf(g_tree_script_buf, g_tree_script_pos, + "submenu \"%-10s %s\" --class=\"%s\" --id=\"DIR_%s\" _VTIP_%p {\n", "DIR", dir_alias, dir_class, node->dir + offset, tip); } else { - vtoy_ssprintf(g_tree_script_buf, g_tree_script_pos, - "submenu \"%s\" --class=\"%s\" --id=\"DIR_%s\" _VTIP_%p {\n", + vtoy_ssprintf(g_tree_script_buf, g_tree_script_pos, + "submenu \"%s\" --class=\"%s\" --id=\"DIR_%s\" _VTIP_%p {\n", dir_alias, dir_class, node->dir + offset, tip); } } @@ -2450,28 +2450,28 @@ static int ventoy_dynamic_tree_menu(img_iterator_node *node) if (g_tree_view_menu_style == 0) { - vtoy_ssprintf(g_tree_script_buf, g_tree_script_pos, - "submenu \"%-10s [%s]\" --class=\"%s\" --id=\"DIR_%s\" _VTIP_%p {\n", + vtoy_ssprintf(g_tree_script_buf, g_tree_script_pos, + "submenu \"%-10s [%s]\" --class=\"%s\" --id=\"DIR_%s\" _VTIP_%p {\n", "DIR", dir_alias, dir_class, node->dir + offset, tip); } else { - vtoy_ssprintf(g_tree_script_buf, g_tree_script_pos, - "submenu \"[%s]\" --class=\"%s\" --id=\"DIR_%s\" _VTIP_%p {\n", + vtoy_ssprintf(g_tree_script_buf, g_tree_script_pos, + "submenu \"[%s]\" --class=\"%s\" --id=\"DIR_%s\" _VTIP_%p {\n", dir_alias, dir_class, node->dir + offset, tip); } } 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, "menuentry \"%-10s [%s/..]\" --class=\"vtoyret\" VTOY_RET {\n " " echo 'return ...' \n" "}\n", "<--", node->dir); } else { - vtoy_ssprintf(g_tree_script_buf, g_tree_script_pos, + vtoy_ssprintf(g_tree_script_buf, g_tree_script_pos, "menuentry \"[%s/..]\" --class=\"vtoyret\" VTOY_RET {\n " " echo 'return ...' \n" "}\n", node->dir); @@ -2487,23 +2487,23 @@ static int ventoy_dynamic_tree_menu(img_iterator_node *node) { 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, "menuentry \"%-10s %s%s\" --class=\"%s\" --id=\"VID_%p\" {\n" - " %s_%s \n" - "}\n", - grub_get_human_size(img->size, GRUB_HUMAN_SIZE_SHORT), - img->unsupport ? "[***********] " : "", + " %s_%s \n" + "}\n", + grub_get_human_size(img->size, GRUB_HUMAN_SIZE_SHORT), + img->unsupport ? "[***********] " : "", img->alias ? img->alias : img->name, img->class, img, img->menu_prefix, img->unsupport ? "unsupport_menuentry" : "common_menuentry"); } else { - vtoy_ssprintf(g_tree_script_buf, g_tree_script_pos, + vtoy_ssprintf(g_tree_script_buf, g_tree_script_pos, "menuentry \"%s%s\" --class=\"%s\" --id=\"VID_%p\" {\n" - " %s_%s \n" - "}\n", - img->unsupport ? "[***********] " : "", + " %s_%s \n" + "}\n", + img->unsupport ? "[***********] " : "", img->alias ? img->alias : img->name, img->class, img, img->menu_prefix, img->unsupport ? "unsupport_menuentry" : "common_menuentry"); @@ -2516,7 +2516,7 @@ static int ventoy_dynamic_tree_menu(img_iterator_node *node) } node->done = 1; - return 0; + return 0; } static int ventoy_set_default_menu(void) @@ -2530,7 +2530,7 @@ static int ventoy_set_default_menu(void) img_info *default_node = NULL; const char *default_image = NULL; - default_image = ventoy_get_env("VTOY_DEFAULT_IMAGE"); + default_image = ventoy_get_env("VTOY_DEFAULT_IMAGE"); if (default_image && default_image[0] == '/') { img_len = grub_strlen(default_image); @@ -2579,7 +2579,7 @@ static int ventoy_set_default_menu(void) while ((end = grub_strchr(pos, '/')) != NULL) { - *end = 0; + *end = 0; vtoy_ssprintf(g_tree_script_buf, g_tree_script_pos, "DIR_%s>", pos); pos = end + 1; } @@ -2607,10 +2607,10 @@ static grub_err_t ventoy_cmd_clear_img(grub_extcmd_context_t ctxt, int argc, cha grub_free(cur); cur = next; } - + g_ventoy_img_list = NULL; g_ventoy_img_count = 0; - + VENTOY_CMD_RETURN(GRUB_ERR_NONE); } @@ -2620,7 +2620,7 @@ static grub_err_t ventoy_cmd_img_name(grub_extcmd_context_t ctxt, int argc, char img_info *cur = g_ventoy_img_list; (void)ctxt; - + if (argc != 2 || (!ventoy_is_decimal(args[0]))) { return grub_error(GRUB_ERR_BAD_ARGUMENT, "Usage: %s {imageID} {var}", cmd_raw_name); @@ -2648,7 +2648,7 @@ static grub_err_t ventoy_cmd_img_name(grub_extcmd_context_t ctxt, int argc, char debug("image name is %s\n", cur->name); grub_env_set(args[1], cur->name); - + VENTOY_CMD_RETURN(GRUB_ERR_NONE); } @@ -2659,7 +2659,7 @@ static grub_err_t ventoy_cmd_ext_select_img_path(grub_extcmd_context_t ctxt, int img_info *cur = g_ventoy_img_list; (void)ctxt; - + if (argc != 1) { return grub_error(GRUB_ERR_BAD_ARGUMENT, "Usage: %s {var}", cmd_raw_name); @@ -2717,7 +2717,7 @@ static grub_err_t ventoy_cmd_reset_fake_vlnk(grub_extcmd_context_t ctxt, int arg g_fake_vlnk_dst[0] = 0; g_fake_vlnk_size = 0; grub_file_vtoy_vlnk(NULL, NULL); - + VENTOY_CMD_RETURN(GRUB_ERR_NONE); } @@ -2731,7 +2731,7 @@ static grub_err_t ventoy_cmd_chosen_img_path(grub_extcmd_context_t ctxt, int arg img_info *cur = NULL; (void)ctxt; - + if (argc < 1 || argc > 3) { return grub_error(GRUB_ERR_BAD_ARGUMENT, "Usage: %s {var}", cmd_raw_name); @@ -2744,9 +2744,9 @@ static grub_err_t ventoy_cmd_chosen_img_path(grub_extcmd_context_t ctxt, int arg if (argc > 1) { grub_snprintf(value, sizeof(value), "%llu", (ulonglong)(g_fake_vlnk_size)); - grub_env_set(args[1], value); + grub_env_set(args[1], value); } - + if (argc > 2) { for (last = pos; *pos; pos++) @@ -2784,9 +2784,9 @@ static grub_err_t ventoy_cmd_chosen_img_path(grub_extcmd_context_t ctxt, int arg if (argc > 1) { grub_snprintf(value, sizeof(value), "%llu", (ulonglong)(cur->size)); - grub_env_set(args[1], value); + grub_env_set(args[1], value); } - + if (argc > 2) { grub_snprintf(value, sizeof(value), "%llu", (ulonglong)(cur->size)); @@ -2837,7 +2837,7 @@ static grub_err_t ventoy_cmd_list_img(grub_extcmd_context_t ctxt, int argc, char { g_filt_dot_underscore_file = 1; } - + strdata = ventoy_get_env("VTOY_FILT_TRASH_DIR"); if (strdata && strdata[0] == '0' && strdata[1] == 0) { @@ -2859,7 +2859,7 @@ static grub_err_t ventoy_cmd_list_img(grub_extcmd_context_t ctxt, int argc, char g_enum_dev = dev = grub_device_open(device_name); if (!dev) { - goto fail; + goto fail; } g_enum_fs = fs = grub_fs_probe(dev); @@ -2900,7 +2900,7 @@ static grub_err_t ventoy_cmd_list_img(grub_extcmd_context_t ctxt, int argc, char else { g_img_iterator_head.dirlen = 1; - grub_strcpy(g_img_iterator_head.dir, "/"); + grub_strcpy(g_img_iterator_head.dir, "/"); } g_img_iterator_head.tail = &tail; @@ -2924,7 +2924,7 @@ static grub_err_t ventoy_cmd_list_img(grub_extcmd_context_t ctxt, int argc, char for (node = &g_img_iterator_head; node; node = node->next) { - fs->fs_dir(dev, node->dir, ventoy_collect_img_files, node); + fs->fs_dir(dev, node->dir, ventoy_collect_img_files, node); } strdata = ventoy_get_env("VTOY_TREE_VIEW_MENU_STYLE"); @@ -2941,14 +2941,14 @@ static grub_err_t ventoy_cmd_list_img(grub_extcmd_context_t ctxt, int argc, char } /* free node */ - node = g_img_iterator_head.next; + node = g_img_iterator_head.next; while (node) { tmp = node->next; grub_free(node); node = tmp; } - + /* sort image list by image name */ while (g_ventoy_img_list) { @@ -2963,9 +2963,9 @@ static grub_err_t ventoy_cmd_list_img(grub_extcmd_context_t ctxt, int argc, char if (min->prev) { - min->prev->next = min->next; + min->prev->next = min->next; } - + if (min->next) { min->next->prev = min->prev; @@ -2995,7 +2995,7 @@ static grub_err_t ventoy_cmd_list_img(grub_extcmd_context_t ctxt, int argc, char if (g_default_menu_mode == 1) { - vtoy_ssprintf(g_list_script_buf, g_list_script_pos, + vtoy_ssprintf(g_list_script_buf, g_list_script_pos, "menuentry \"%s [%s]\" --class=\"vtoyret\" VTOY_RET {\n " " echo 'return ...' \n" "}\n", "<--", ventoy_get_vmenu_title("VTLANG_RET_TO_TREEVIEW")); @@ -3005,9 +3005,9 @@ static grub_err_t ventoy_cmd_list_img(grub_extcmd_context_t ctxt, int argc, char { vtoy_ssprintf(g_list_script_buf, g_list_script_pos, "menuentry \"%s%s\" --class=\"%s\" --id=\"VID_%p\" {\n" - " %s_%s \n" - "}\n", - cur->unsupport ? "[***********] " : "", + " %s_%s \n" + "}\n", + cur->unsupport ? "[***********] " : "", cur->alias ? cur->alias : cur->name, cur->class, cur, cur->menu_prefix, cur->unsupport ? "unsupport_menuentry" : "common_menuentry"); @@ -3033,7 +3033,7 @@ int ventoy_get_disk_guid(const char *filename, grub_uint8_t *guid, grub_uint8_t char *device_name; char *pos; char *pos2; - + device_name = grub_file_get_device_name(filename); if (!device_name) { @@ -3051,7 +3051,7 @@ int ventoy_get_disk_guid(const char *filename, grub_uint8_t *guid, grub_uint8_t { pos2 = grub_strstr(pos, ")"); } - + if (pos2) { *pos2 = 0; @@ -3092,7 +3092,7 @@ grub_uint32_t ventoy_get_iso_boot_catlog(grub_file_t file) return 0; } - return desc.sector; + return desc.sector; } static grub_uint32_t ventoy_get_bios_eltorito_rba(grub_file_t file, grub_uint32_t sector) @@ -3102,7 +3102,7 @@ static grub_uint32_t ventoy_get_bios_eltorito_rba(grub_file_t file, grub_uint32_ grub_file_seek(file, sector * 2048); grub_file_read(file, buf, sizeof(buf)); - if (buf[0] == 0x01 && buf[1] == 0x00 && + if (buf[0] == 0x01 && buf[1] == 0x00 && buf[30] == 0x55 && buf[31] == 0xaa && buf[32] == 0x88) { return *((grub_uint32_t *)(buf + 40)); @@ -3187,14 +3187,14 @@ void ventoy_fill_os_param(grub_file_t file, ventoy_os_param *param) } grub_snprintf(param->vtoy_img_path, sizeof(param->vtoy_img_path), "%s", pos); - + ventoy_get_disk_guid(file->name, param->vtoy_disk_guid, param->vtoy_disk_signature); param->vtoy_img_size = file->size; param->vtoy_reserved[0] = g_ventoy_break_level; param->vtoy_reserved[1] = g_ventoy_debug_level; - + param->vtoy_reserved[2] = g_ventoy_chain_type; /* Windows CD/DVD prompt 0:suppress 1:reserved */ @@ -3207,7 +3207,7 @@ void ventoy_fill_os_param(grub_file_t file, ventoy_os_param *param) param->vtoy_reserved[4] = 1; } } - + fs = ventoy_get_env("ventoy_fs_probe"); if (fs && grub_strcmp(fs, "udf") == 0) { @@ -3245,7 +3245,7 @@ int ventoy_check_block_list(grub_file_t file, ventoy_img_chunk_list *chunklist, for (i = 0; i < chunklist->cur_chunk; i++) { chunk = chunklist->chunk + i; - + if (chunk->disk_start_sector <= start) { debug("%u disk start invalid %lu\n", i, (ulong)start); @@ -3265,7 +3265,7 @@ int ventoy_check_block_list(grub_file_t file, ventoy_img_chunk_list *chunklist, debug("maybe img file to be processed.\n"); return 0; } - + return 1; } @@ -3285,11 +3285,11 @@ int ventoy_get_block_list(grub_file_t file, ventoy_img_chunk_list *chunklist, gr fs_type = ventoy_get_fs_type(file->fs->name); if (fs_type == ventoy_fs_exfat) { - grub_fat_get_file_chunk(start, file, chunklist); + grub_fat_get_file_chunk(start, file, chunklist); } else if (fs_type == ventoy_fs_ext) { - grub_ext_get_file_chunk(start, file, chunklist); + grub_ext_get_file_chunk(start, file, chunklist); } else { @@ -3337,7 +3337,7 @@ int ventoy_get_block_list(grub_file_t file, ventoy_img_chunk_list *chunklist, gr { count >>= 2; } - + chunklist->chunk[i].img_start_sector = sector; chunklist->chunk[i].img_end_sector = sector + count - 1; sector += count; @@ -3352,20 +3352,20 @@ static grub_err_t ventoy_cmd_img_sector(grub_extcmd_context_t ctxt, int argc, ch int rc; grub_file_t file; grub_disk_addr_t start; - + (void)ctxt; (void)argc; file = ventoy_grub_file_open(VENTOY_FILE_TYPE, "%s", args[0]); if (!file) { - return grub_error(GRUB_ERR_BAD_ARGUMENT, "Can't open file %s\n", args[0]); + return grub_error(GRUB_ERR_BAD_ARGUMENT, "Can't open file %s\n", args[0]); } g_conf_replace_count = 0; grub_memset(g_conf_replace_node, 0, sizeof(g_conf_replace_node )); grub_memset(g_conf_replace_offset, 0, sizeof(g_conf_replace_offset )); - + if (g_img_chunk_list.chunk) { grub_free(g_img_chunk_list.chunk); @@ -3374,9 +3374,9 @@ static grub_err_t ventoy_cmd_img_sector(grub_extcmd_context_t ctxt, int argc, ch if (ventoy_get_fs_type(file->fs->name) >= ventoy_fs_max) { grub_file_close(file); - return grub_error(GRUB_ERR_BAD_ARGUMENT, "Unsupported filesystem %s\n", file->fs->name); + return grub_error(GRUB_ERR_BAD_ARGUMENT, "Unsupported filesystem %s\n", file->fs->name); } - + /* get image chunk data */ grub_memset(&g_img_chunk_list, 0, sizeof(g_img_chunk_list)); g_img_chunk_list.chunk = grub_malloc(sizeof(ventoy_img_chunk) * DEFAULT_CHUNK_NUM); @@ -3384,7 +3384,7 @@ static grub_err_t ventoy_cmd_img_sector(grub_extcmd_context_t ctxt, int argc, ch { return grub_error(GRUB_ERR_OUT_OF_MEMORY, "Can't allocate image chunk memoty\n"); } - + g_img_chunk_list.max_chunk = DEFAULT_CHUNK_NUM; g_img_chunk_list.cur_chunk = 0; @@ -3394,7 +3394,7 @@ static grub_err_t ventoy_cmd_img_sector(grub_extcmd_context_t ctxt, int argc, ch rc = ventoy_check_block_list(file, &g_img_chunk_list, start); grub_file_close(file); - + if (rc) { return grub_error(GRUB_ERR_NOT_IMPLEMENTED_YET, "Unsupported chunk list.\n"); @@ -3415,7 +3415,7 @@ static grub_err_t ventoy_select_conf_replace(grub_extcmd_context_t ctxt, int arg conf_replace *node = NULL; conf_replace *nodes[VTOY_MAX_CONF_REPLACE] = { NULL }; ventoy_grub_param_file_replace *replace = NULL; - + (void)ctxt; (void)argc; (void)args; @@ -3445,7 +3445,7 @@ static grub_err_t ventoy_select_conf_replace(grub_extcmd_context_t ctxt, int arg if (file) { offset = grub_iso9660_get_last_file_dirent_pos(file); - grub_file_close(file); + grub_file_close(file); } else if (node->img > 0) { @@ -3537,7 +3537,7 @@ static int ventoy_var_expand(int *record, int *flag, const char *var, char *expa *flag = 1; grub_printf("\n=================== Variables Expansion ===================\n\n"); } - + grub_printf("<%s>: ", var); grub_refresh(); @@ -3551,7 +3551,7 @@ static int ventoy_var_expand(int *record, int *flag, const char *var, char *expa grub_printf("\n"); grub_refresh(); *record = 1; - break; + break; } } else if (grub_isprint(c)) @@ -3573,7 +3573,7 @@ static int ventoy_var_expand(int *record, int *flag, const char *var, char *expa expand[i - 1] = 0; grub_printf("\r<%s>: %s", var, expand); - + grub_refresh(); i--; } @@ -3586,7 +3586,7 @@ static int ventoy_var_expand(int *record, int *flag, const char *var, char *expa { grub_snprintf(expand, len, "$$%s$$", var); } - + return 0; } @@ -3613,7 +3613,7 @@ static int ventoy_auto_install_var_expand(install_template *node) debug("auto install script too long %d\n", node->filelen); return 0; } - + if ((code[0] == 0xff && code[1] == 0xfe) || (code[0] == 0xfe && code[1] == 0xff)) { debug("UCS-2 encoding NOT supported\n"); @@ -3683,9 +3683,9 @@ static int ventoy_auto_install_var_expand(install_template *node) } } } - + VTOY_APPEND_NEWBUF(value); - + VTOY_APPEND_NEWBUF(end + 2); } else @@ -3726,7 +3726,7 @@ static grub_err_t ventoy_cmd_sel_auto_install(grub_extcmd_context_t ctxt, int ar grub_file_t file = NULL; char configfile[128]; install_template *node = NULL; - + (void)ctxt; (void)argc; (void)args; @@ -3764,9 +3764,9 @@ static grub_err_t ventoy_cmd_sel_auto_install(grub_extcmd_context_t ctxt, int ar if (node->timeout > 0) { - vtoy_ssprintf(buf, pos, "set timeout=%d\n", node->timeout); + vtoy_ssprintf(buf, pos, "set timeout=%d\n", node->timeout); } - + vtoy_ssprintf(buf, pos, "menuentry \"$VTLANG_NO_AUTOINS_SCRIPT\" --class=\"sel_auto_install\" {\n" " echo %s\n}\n", ""); @@ -3782,10 +3782,10 @@ static grub_err_t ventoy_cmd_sel_auto_install(grub_extcmd_context_t ctxt, int ar g_ventoy_suppress_esc = 1; g_ventoy_suppress_esc_default = defidx; g_ventoy_secondary_menu_on = 1; - + grub_snprintf(configfile, sizeof(configfile), "configfile mem:0x%llx:size:%d", (ulonglong)(ulong)buf, pos); grub_script_execute_sourcecode(configfile); - + g_ventoy_menu_esc = 0; g_ventoy_suppress_esc = 0; g_ventoy_suppress_esc_default = 1; @@ -3801,7 +3801,7 @@ static grub_err_t ventoy_cmd_sel_auto_install(grub_extcmd_context_t ctxt, int ar if (node->cursel >= 0 && node->cursel < node->templatenum) { - file = ventoy_grub_file_open(VENTOY_FILE_TYPE, "%s%s", ventoy_get_env("vtoy_iso_part"), + file = ventoy_grub_file_open(VENTOY_FILE_TYPE, "%s%s", ventoy_get_env("vtoy_iso_part"), node->templatepath[node->cursel].path); if (file) { @@ -3810,7 +3810,7 @@ static grub_err_t ventoy_cmd_sel_auto_install(grub_extcmd_context_t ctxt, int ar { grub_file_read(file, node->filebuf, file->size); grub_file_close(file); - + grub_memset(node->filebuf + file->size, 0, 8); node->filelen = (int)file->size; @@ -3819,7 +3819,7 @@ static grub_err_t ventoy_cmd_sel_auto_install(grub_extcmd_context_t ctxt, int ar } else { - debug("Failed to open auto install script <%s%s>\n", + debug("Failed to open auto install script <%s%s>\n", ventoy_get_env("vtoy_iso_part"), node->templatepath[node->cursel].path); } } @@ -3835,7 +3835,7 @@ static grub_err_t ventoy_cmd_sel_persistence(grub_extcmd_context_t ctxt, int arg char *buf = NULL; char configfile[128]; persistence_config *node; - + (void)ctxt; (void)argc; (void)args; @@ -3861,7 +3861,7 @@ static grub_err_t ventoy_cmd_sel_persistence(grub_extcmd_context_t ctxt, int arg { node->cursel = node->autosel - 1; debug("Persistence image auto select %d\n", node->autosel); - return 0; + return 0; } } @@ -3873,19 +3873,19 @@ static grub_err_t ventoy_cmd_sel_persistence(grub_extcmd_context_t ctxt, int arg if (node->timeout > 0) { - vtoy_ssprintf(buf, pos, "set timeout=%d\n", node->timeout); + vtoy_ssprintf(buf, pos, "set timeout=%d\n", node->timeout); } vtoy_ssprintf(buf, pos, "menuentry \"$VTLANG_NO_PERSIST\" --class=\"sel_persistence\" {\n" " echo %s\n}\n", ""); - + for (i = 0; i < node->backendnum; i++) { vtoy_ssprintf(buf, pos, "menuentry \"%s %s\" --class=\"sel_persistence\" {\n" " echo \"\"\n}\n", ventoy_get_vmenu_title("VTLANG_PERSIST_USE"), node->backendpath[i].path); - + } g_ventoy_menu_esc = 1; @@ -3895,7 +3895,7 @@ static grub_err_t ventoy_cmd_sel_persistence(grub_extcmd_context_t ctxt, int arg grub_snprintf(configfile, sizeof(configfile), "configfile mem:0x%llx:size:%d", (ulonglong)(ulong)buf, pos); grub_script_execute_sourcecode(configfile); - + g_ventoy_menu_esc = 0; g_ventoy_suppress_esc = 0; g_ventoy_suppress_esc_default = 1; @@ -3912,7 +3912,7 @@ static grub_err_t ventoy_cmd_dump_img_sector(grub_extcmd_context_t ctxt, int arg { grub_uint32_t i; ventoy_img_chunk *cur; - + (void)ctxt; (void)argc; (void)args; @@ -3920,7 +3920,7 @@ static grub_err_t ventoy_cmd_dump_img_sector(grub_extcmd_context_t ctxt, int arg for (i = 0; i < g_img_chunk_list.cur_chunk; i++) { cur = g_img_chunk_list.chunk + i; - grub_printf("image:[%u - %u] <==> disk:[%llu - %llu]\n", + grub_printf("image:[%u - %u] <==> disk:[%llu - %llu]\n", cur->img_start_sector, cur->img_end_sector, (unsigned long long)cur->disk_start_sector, (unsigned long long)cur->disk_end_sector ); @@ -3934,14 +3934,14 @@ static grub_err_t ventoy_cmd_test_block_list(grub_extcmd_context_t ctxt, int arg grub_uint32_t i; grub_file_t file; ventoy_img_chunk_list chunklist; - + (void)ctxt; (void)argc; file = ventoy_grub_file_open(VENTOY_FILE_TYPE, "%s", args[0]); if (!file) { - return grub_error(GRUB_ERR_BAD_ARGUMENT, "Can't open file %s\n", args[0]); + return grub_error(GRUB_ERR_BAD_ARGUMENT, "Can't open file %s\n", args[0]); } /* get image chunk data */ @@ -3951,12 +3951,12 @@ static grub_err_t ventoy_cmd_test_block_list(grub_extcmd_context_t ctxt, int arg { return grub_error(GRUB_ERR_OUT_OF_MEMORY, "Can't allocate image chunk memoty\n"); } - + chunklist.max_chunk = DEFAULT_CHUNK_NUM; chunklist.cur_chunk = 0; ventoy_get_block_list(file, &chunklist, 0); - + if (0 != ventoy_check_block_list(file, &chunklist, 0)) { grub_printf("########## UNSUPPORTED ###############\n"); @@ -3974,7 +3974,7 @@ static grub_err_t ventoy_cmd_test_block_list(grub_extcmd_context_t ctxt, int arg for (i = 0; i < chunklist.cur_chunk; i++) { - grub_printf("%2u: [%llu %llu] - [%llu %llu]\n", i, + grub_printf("%2u: [%llu %llu] - [%llu %llu]\n", i, (ulonglong)chunklist.chunk[i].img_start_sector, (ulonglong)chunklist.chunk[i].img_end_sector, (ulonglong)chunklist.chunk[i].disk_start_sector, @@ -3992,7 +3992,7 @@ static grub_err_t ventoy_cmd_add_replace_file(grub_extcmd_context_t ctxt, int ar { int i; ventoy_grub_param_file_replace *replace = NULL; - + (void)ctxt; (void)argc; (void)args; @@ -4001,14 +4001,14 @@ static grub_err_t ventoy_cmd_add_replace_file(grub_extcmd_context_t ctxt, int ar { replace = &(g_grub_param->file_replace); replace->magic = GRUB_FILE_REPLACE_MAGIC; - + replace->old_name_cnt = 0; for (i = 0; i < 4 && i + 1 < argc; i++) { replace->old_name_cnt++; grub_snprintf(replace->old_file_name[i], sizeof(replace->old_file_name[i]), "%s", args[i + 1]); } - + replace->new_file_virtual_id = (grub_uint32_t)grub_strtoul(args[0], NULL, 10); } @@ -4019,13 +4019,13 @@ static grub_err_t ventoy_cmd_get_replace_file_cnt(grub_extcmd_context_t ctxt, in { char buf[32]; ventoy_grub_param_file_replace *replace = &(g_grub_param->file_replace); - + (void)ctxt; if (argc >= 1) { grub_snprintf(buf, sizeof(buf), "%u", replace->old_name_cnt); - grub_env_set(args[0], buf); + grub_env_set(args[0], buf); } VENTOY_CMD_RETURN(GRUB_ERR_NONE); @@ -4045,7 +4045,7 @@ static grub_err_t ventoy_cmd_dump_menu(grub_extcmd_context_t ctxt, int argc, cha else { grub_printf("Tree Mode: CurLen:%d MaxLen:%u\n", g_tree_script_pos, VTOY_MAX_SCRIPT_BUF); - grub_printf("%s", g_tree_script_buf); + grub_printf("%s", g_tree_script_buf); } return 0; @@ -4054,7 +4054,7 @@ static grub_err_t ventoy_cmd_dump_menu(grub_extcmd_context_t ctxt, int argc, cha static grub_err_t ventoy_cmd_dump_img_list(grub_extcmd_context_t ctxt, int argc, char **args) { img_info *cur = g_ventoy_img_list; - + (void)ctxt; (void)argc; (void)args; @@ -4107,7 +4107,7 @@ static int ventoy_check_mode_by_name(char *filename, const char *suffix) int i; int len1; int len2; - + len1 = (int)grub_strlen(filename); len2 = (int)grub_strlen(suffix); @@ -4138,7 +4138,7 @@ static int ventoy_check_mode_by_name(char *filename, const char *suffix) { return 1; } - + return 0; } @@ -4181,7 +4181,7 @@ static grub_err_t ventoy_cmd_check_mode(grub_extcmd_context_t ctxt, int argc, ch { return 0; } - + if (argc == 2 && ventoy_check_mode_by_name(args[1], "vtgrub2")) { return 0; @@ -4195,7 +4195,7 @@ static grub_err_t ventoy_cmd_check_mode(grub_extcmd_context_t ctxt, int argc, ch { return 0; } - + if (argc == 2 && ventoy_check_mode_by_name(args[1], "vtwimboot")) { return 0; @@ -4211,12 +4211,12 @@ static grub_err_t ventoy_cmd_dynamic_menu(grub_extcmd_context_t ctxt, int argc, { static int configfile_mode = 0; char memfile[128] = {0}; - + (void)ctxt; (void)argc; (void)args; - /* + /* * args[0]: 0:normal 1:configfile * args[1]: 0:list_buf 1:tree_buf */ @@ -4233,11 +4233,11 @@ static grub_err_t ventoy_cmd_dynamic_menu(grub_extcmd_context_t ctxt, int argc, { if (args[1][0] == '0') { - grub_script_execute_sourcecode(g_list_script_buf); + grub_script_execute_sourcecode(g_list_script_buf); } else { - grub_script_execute_sourcecode(g_tree_script_buf); + grub_script_execute_sourcecode(g_tree_script_buf); } } else @@ -4250,21 +4250,21 @@ static grub_err_t ventoy_cmd_dynamic_menu(grub_extcmd_context_t ctxt, int argc, if (args[1][0] == '0') { - grub_snprintf(memfile, sizeof(memfile), "configfile mem:0x%llx:size:%d", + grub_snprintf(memfile, sizeof(memfile), "configfile mem:0x%llx:size:%d", (ulonglong)(ulong)g_list_script_buf, g_list_script_pos); } else { g_ventoy_last_entry = -1; - grub_snprintf(memfile, sizeof(memfile), "configfile mem:0x%llx:size:%d", - (ulonglong)(ulong)g_tree_script_buf, g_tree_script_pos); + grub_snprintf(memfile, sizeof(memfile), "configfile mem:0x%llx:size:%d", + (ulonglong)(ulong)g_tree_script_buf, g_tree_script_pos); } configfile_mode = 1; grub_script_execute_sourcecode(memfile); configfile_mode = 0; } - + return 0; } @@ -4278,7 +4278,7 @@ static grub_err_t ventoy_cmd_file_exist_nocase(grub_extcmd_context_t ctxt, int a { return 1; } - + g_ventoy_case_insensitive = 1; file = grub_file_open(args[0], VENTOY_FILE_TYPE); g_ventoy_case_insensitive = 0; @@ -4301,13 +4301,13 @@ static grub_err_t ventoy_cmd_find_bootable_hdd(grub_extcmd_context_t ctxt, int a const char *isopath = NULL; char hdname[32]; ventoy_mbr_head mbr; - + (void)ctxt; (void)argc; if (argc != 1) { - return grub_error(GRUB_ERR_BAD_ARGUMENT, "Usage: %s variable\n", cmd_raw_name); + return grub_error(GRUB_ERR_BAD_ARGUMENT, "Usage: %s variable\n", cmd_raw_name); } isopath = grub_env_get("vtoy_iso_part"); @@ -4329,7 +4329,7 @@ static grub_err_t ventoy_cmd_find_bootable_hdd(grub_extcmd_context_t ctxt, int a } grub_snprintf(hdname, sizeof(hdname), "hd%d", id); - + disk = grub_disk_open(hdname); if (!disk) { @@ -4345,7 +4345,7 @@ static grub_err_t ventoy_cmd_find_bootable_hdd(grub_extcmd_context_t ctxt, int a if (mbr.PartTbl[0].Active == 0x80 || mbr.PartTbl[1].Active == 0x80 || mbr.PartTbl[2].Active == 0x80 || mbr.PartTbl[3].Active == 0x80) { - + grub_env_set(args[0], hdname); find = 1; } @@ -4368,13 +4368,13 @@ static grub_err_t ventoy_cmd_read_1st_line(grub_extcmd_context_t ctxt, int argc, int len = 1024; grub_file_t file; char *buf = NULL; - + (void)ctxt; (void)argc; if (argc != 2) { - return grub_error(GRUB_ERR_BAD_ARGUMENT, "Usage: %s file var \n", cmd_raw_name); + return grub_error(GRUB_ERR_BAD_ARGUMENT, "Usage: %s file var \n", cmd_raw_name); } file = ventoy_grub_file_open(VENTOY_FILE_TYPE, "%s", args[0]); @@ -4400,7 +4400,7 @@ static grub_err_t ventoy_cmd_read_1st_line(grub_extcmd_context_t ctxt, int argc, grub_check_free(buf); grub_file_close(file); - + return 0; } @@ -4408,7 +4408,7 @@ static int ventoy_img_partition_callback (struct grub_disk *disk, const grub_par { grub_uint64_t end_max = 0; int *pCnt = (int *)data; - + (void)disk; (*pCnt)++; @@ -4421,7 +4421,7 @@ static int ventoy_img_partition_callback (struct grub_disk *disk, const grub_par { g_part_end_max = end_max; } - + return 0; } @@ -4431,7 +4431,7 @@ static grub_err_t ventoy_cmd_img_part_info(grub_extcmd_context_t ctxt, int argc, char *device_name = NULL; grub_device_t dev = NULL; char buf[64]; - + (void)ctxt; g_part_list_pos = 0; @@ -4454,7 +4454,7 @@ static grub_err_t ventoy_cmd_img_part_info(grub_extcmd_context_t ctxt, int argc, if (!dev) { debug("grub_device_open failed, %s\n", device_name); - goto end; + goto end; } grub_partition_iterate(dev->disk, ventoy_img_partition_callback, &cnt); @@ -4464,7 +4464,7 @@ static grub_err_t ventoy_cmd_img_part_info(grub_extcmd_context_t ctxt, int argc, grub_snprintf(buf, sizeof(buf), "%d", cnt); grub_env_set("vtoy_img_part_cnt", buf); - + grub_snprintf(buf, sizeof(buf), "%llu", (ulonglong)g_part_end_max); grub_env_set("vtoy_img_max_part_end", buf); @@ -4472,7 +4472,7 @@ static grub_err_t ventoy_cmd_img_part_info(grub_extcmd_context_t ctxt, int argc, check_free(device_name, grub_free); check_free(dev, grub_device_close); - + return 0; } @@ -4482,13 +4482,13 @@ static grub_err_t ventoy_cmd_file_strstr(grub_extcmd_context_t ctxt, int argc, c int rc = 1; grub_file_t file; char *buf = NULL; - + (void)ctxt; (void)argc; if (argc != 2) { - return grub_error(GRUB_ERR_BAD_ARGUMENT, "Usage: %s file str \n", cmd_raw_name); + return grub_error(GRUB_ERR_BAD_ARGUMENT, "Usage: %s file str \n", cmd_raw_name); } file = ventoy_grub_file_open(VENTOY_FILE_TYPE, "%s", args[0]); @@ -4516,7 +4516,7 @@ static grub_err_t ventoy_cmd_file_strstr(grub_extcmd_context_t ctxt, int argc, c grub_check_free(buf); grub_file_close(file); - + return rc; } @@ -4527,13 +4527,13 @@ static grub_err_t ventoy_cmd_parse_volume(grub_extcmd_context_t ctxt, int argc, char buf[64]; grub_uint64_t size; ventoy_iso9660_vd pvd; - + (void)ctxt; (void)argc; if (argc != 4) { - return grub_error(GRUB_ERR_BAD_ARGUMENT, "Usage: %s sysid volid space \n", cmd_raw_name); + return grub_error(GRUB_ERR_BAD_ARGUMENT, "Usage: %s sysid volid space \n", cmd_raw_name); } file = ventoy_grub_file_open(VENTOY_FILE_TYPE, "%s", args[0]); @@ -4563,10 +4563,10 @@ static grub_err_t ventoy_cmd_parse_volume(grub_extcmd_context_t ctxt, int argc, size *= 2048; grub_snprintf(buf, sizeof(buf), "%llu", (ulonglong)size); ventoy_set_env(args[3], buf); - + end: grub_file_close(file); - + return 0; } @@ -4575,13 +4575,13 @@ static grub_err_t ventoy_cmd_parse_create_date(grub_extcmd_context_t ctxt, int a int len; grub_file_t file; char buf[64]; - + (void)ctxt; (void)argc; if (argc != 2) { - return grub_error(GRUB_ERR_BAD_ARGUMENT, "Usage: %s var \n", cmd_raw_name); + return grub_error(GRUB_ERR_BAD_ARGUMENT, "Usage: %s var \n", cmd_raw_name); } file = ventoy_grub_file_open(VENTOY_FILE_TYPE, "%s", args[0]); @@ -4604,7 +4604,7 @@ static grub_err_t ventoy_cmd_parse_create_date(grub_extcmd_context_t ctxt, int a end: grub_file_close(file); - + return 0; } @@ -4615,7 +4615,7 @@ static grub_err_t ventoy_cmd_img_hook_root(grub_extcmd_context_t ctxt, int argc, (void)args; ventoy_env_hook_root(1); - + return 0; } @@ -4626,7 +4626,7 @@ static grub_err_t ventoy_cmd_img_unhook_root(grub_extcmd_context_t ctxt, int arg (void)args; ventoy_env_hook_root(0); - + return 0; } @@ -4647,7 +4647,7 @@ static grub_err_t ventoy_cmd_check_secureboot_var(grub_extcmd_context_t ctxt, in { return 0; } - + return ret; } #else @@ -4669,7 +4669,7 @@ static grub_err_t ventoy_cmd_img_check_range(grub_extcmd_context_t ctxt, int arg ventoy_gpt_info *gpt = NULL; ventoy_part_table *pt = NULL; grub_uint8_t zeroguid[16] = {0}; - + (void)ctxt; (void)argc; @@ -4705,7 +4705,7 @@ static grub_err_t ventoy_cmd_img_check_range(grub_extcmd_context_t ctxt, int arg { if (FileSectors < gpt->PartTbl[i].LastLBA) { - debug("out of range: part[%d] LastLBA:%llu FileSectors:%llu\n", i, + debug("out of range: part[%d] LastLBA:%llu FileSectors:%llu\n", i, (ulonglong)gpt->PartTbl[i].LastLBA, (ulonglong)FileSectors); goto out; } @@ -4721,16 +4721,16 @@ static grub_err_t ventoy_cmd_img_check_range(grub_extcmd_context_t ctxt, int arg pt = gpt->MBR.PartTbl + i; if (FileSectors < pt->StartSectorId + pt->SectorCount) { - debug("out of range: part[%d] LastLBA:%llu FileSectors:%llu\n", i, - (ulonglong)(pt->StartSectorId + pt->SectorCount), + debug("out of range: part[%d] LastLBA:%llu FileSectors:%llu\n", i, + (ulonglong)(pt->StartSectorId + pt->SectorCount), (ulonglong)FileSectors); goto out; } } } - + ret = 0; - + out: grub_file_close(file); grub_check_free(gpt); @@ -4742,7 +4742,7 @@ static grub_err_t ventoy_cmd_clear_key(grub_extcmd_context_t ctxt, int argc, cha { int i; int ret; - + (void)ctxt; (void)argc; (void)args; @@ -4763,7 +4763,7 @@ static grub_err_t ventoy_cmd_clear_key(grub_extcmd_context_t ctxt, int argc, cha grub_refresh(); grub_sleep(5); } - + return 0; } @@ -4782,9 +4782,9 @@ static grub_err_t ventoy_cmd_acpi_param(grub_extcmd_context_t ctxt, int argc, ch ventoy_image_location *location; ventoy_image_disk_region *region; struct grub_acpi_table_header *acpi; - + (void)ctxt; - + if (argc != 2) { return 1; @@ -4810,14 +4810,14 @@ static grub_err_t ventoy_cmd_acpi_param(grub_extcmd_context_t ctxt, int argc, ch loclen = sizeof(ventoy_image_location) + (img_chunk_num - 1) * sizeof(ventoy_image_disk_region); datalen = sizeof(ventoy_os_param) + loclen; - + buflen = sizeof(struct grub_acpi_table_header) + datalen; acpi = grub_zalloc(buflen); if (!acpi) { return 1; } - + /* Step1: Fill acpi table header */ grub_memcpy(acpi->signature, "VTOY", 4); acpi->length = buflen; @@ -4861,7 +4861,7 @@ static grub_err_t ventoy_cmd_acpi_param(grub_extcmd_context_t ctxt, int argc, ch { region->image_sector_count = chunk->img_end_sector - chunk->img_start_sector + 1; region->image_start_sector = chunk->img_start_sector; - region->disk_start_sector = chunk->disk_start_sector; + region->disk_start_sector = chunk->disk_start_sector; region++; chunk++; } @@ -4876,7 +4876,7 @@ static grub_err_t ventoy_cmd_acpi_param(grub_extcmd_context_t ctxt, int argc, ch grub_script_execute_sourcecode(cmd); grub_free(acpi); - + VENTOY_CMD_RETURN(0); } @@ -4888,7 +4888,7 @@ static grub_err_t ventoy_cmd_push_last_entry(grub_extcmd_context_t ctxt, int arg g_ventoy_last_entry_back = g_ventoy_last_entry; g_ventoy_last_entry = -1; - + return 0; } @@ -4899,7 +4899,7 @@ static grub_err_t ventoy_cmd_pop_last_entry(grub_extcmd_context_t ctxt, int argc (void)args; g_ventoy_last_entry = g_ventoy_last_entry_back; - + return 0; } @@ -4933,7 +4933,7 @@ static grub_err_t ventoy_cmd_lib_module_ver(grub_extcmd_context_t ctxt, int argc grub_device_t dev = NULL; grub_fs_t fs = NULL; char buf[128] = {0}; - + (void)ctxt; if (argc != 3) @@ -4955,7 +4955,7 @@ static grub_err_t ventoy_cmd_lib_module_ver(grub_extcmd_context_t ctxt, int argc if (!dev) { debug("grub_device_open failed, %s\n", device_name); - goto end; + goto end; } fs = grub_fs_probe(dev); @@ -4969,16 +4969,16 @@ static grub_err_t ventoy_cmd_lib_module_ver(grub_extcmd_context_t ctxt, int argc if (buf[0]) { - ventoy_set_env(args[2], buf); + ventoy_set_env(args[2], buf); } - + rc = 0; - + end: check_free(device_name, grub_free); check_free(dev, grub_device_close); - + return rc; } @@ -4988,7 +4988,7 @@ int ventoy_load_part_table(const char *diskname) int ret; grub_disk_t disk; grub_device_t dev; - + g_ventoy_part_info = grub_zalloc(sizeof(ventoy_gpt_info)); if (!g_ventoy_part_info) { @@ -5066,7 +5066,7 @@ static void ventoy_prompt_end(void) grub_reboot(); } else if (op == 3) - { + { grub_script_execute_sourcecode("halt"); } } @@ -5087,7 +5087,7 @@ static void ventoy_prompt_end(void) static grub_err_t ventoy_cmd_load_part_table(grub_extcmd_context_t ctxt, int argc, char **args) { int ret; - + (void)argc; (void)ctxt; @@ -5138,7 +5138,7 @@ static grub_err_t ventoy_cmd_part_exist(grub_extcmd_context_t ctxt, int argc, ch id = (int)grub_strtoul(args[0], NULL, 10); grub_errno = 0; - + if (grub_memcmp(g_ventoy_part_info->Head.Signature, "EFI PART", 8) == 0) { if (id >= 1 && id <= 128) @@ -5147,7 +5147,7 @@ static grub_err_t ventoy_cmd_part_exist(grub_extcmd_context_t ctxt, int argc, ch { return 0; } - } + } } else { @@ -5170,7 +5170,7 @@ static grub_err_t ventoy_cmd_get_fs_label(grub_extcmd_context_t ctxt, int argc, grub_device_t dev = NULL; grub_fs_t fs = NULL; char *label = NULL; - + (void)ctxt; debug("get fs label for %s\n", args[0]); @@ -5192,7 +5192,7 @@ static grub_err_t ventoy_cmd_get_fs_label(grub_extcmd_context_t ctxt, int argc, if (!dev) { debug("grub_device_open failed, %s\n", device_name); - goto end; + goto end; } fs = grub_fs_probe(dev); @@ -5211,12 +5211,12 @@ static grub_err_t ventoy_cmd_get_fs_label(grub_extcmd_context_t ctxt, int argc, } rc = 0; - + end: check_free(device_name, grub_free); check_free(dev, grub_device_close); - + return rc; } @@ -5249,7 +5249,7 @@ static grub_err_t ventoy_fs_enum_1st_child(int argc, char **args, grub_fs_dir_ho grub_device_t dev = NULL; grub_fs_t fs = NULL; char name[256] ={0}; - + if (argc != 3) { debug("ventoy_fs_enum_1st_child, invalid param num %d\n", argc); @@ -5267,7 +5267,7 @@ static grub_err_t ventoy_fs_enum_1st_child(int argc, char **args, grub_fs_dir_ho if (!dev) { debug("grub_device_open failed, %s\n", device_name); - goto end; + goto end; } fs = grub_fs_probe(dev); @@ -5282,14 +5282,14 @@ static grub_err_t ventoy_fs_enum_1st_child(int argc, char **args, grub_fs_dir_ho { ventoy_set_env(args[2], name); } - + rc = 0; - + end: check_free(device_name, grub_free); check_free(dev, grub_device_close); - + return rc; } @@ -5310,7 +5310,7 @@ static grub_err_t ventoy_cmd_basename(grub_extcmd_context_t ctxt, int argc, char char c; char *pos = NULL; char *end = NULL; - + (void)ctxt; if (argc != 2) @@ -5348,7 +5348,7 @@ static grub_err_t ventoy_cmd_basefile(grub_extcmd_context_t ctxt, int argc, char int i; int len; const char *buf; - + (void)ctxt; if (argc != 2) @@ -5377,7 +5377,7 @@ static grub_err_t ventoy_cmd_enum_video_mode(grub_extcmd_context_t ctxt, int arg { struct grub_video_mode_info info; char buf[32]; - + (void)ctxt; (void)argc; (void)args; @@ -5408,7 +5408,7 @@ static grub_err_t vt_cmd_update_cur_video_mode(grub_extcmd_context_t ctxt, int a { struct grub_video_mode_info info; char buf[32]; - + (void)ctxt; (void)argc; (void)args; @@ -5431,7 +5431,7 @@ static grub_err_t ventoy_cmd_get_video_mode(grub_extcmd_context_t ctxt, int argc { int id; char buf[32]; - + (void)ctxt; (void)argc; @@ -5443,7 +5443,7 @@ static grub_err_t ventoy_cmd_get_video_mode(grub_extcmd_context_t ctxt, int argc id = (int)grub_strtoul(args[0], NULL, 10); if (id < g_video_mode_num) { - grub_snprintf(buf, sizeof(buf), "%ux%ux%u", + grub_snprintf(buf, sizeof(buf), "%ux%ux%u", g_video_mode_list[id].width, g_video_mode_list[id].height, g_video_mode_list[id].bpp); } @@ -5460,7 +5460,7 @@ static grub_err_t ventoy_cmd_get_efivdisk_offset(grub_extcmd_context_t ctxt, int char value[32]; grub_uint32_t boot_catlog = 0; grub_uint8_t buf[512]; - + (void)ctxt; if (argc != 2) @@ -5527,7 +5527,7 @@ static int ventoy_collect_replace_initrd(const char *filename, const struct grub curpos = pfsdir->curpos; len = grub_strlen(filename); - + if (info->dir) { if ((len == 1 && filename[0] == '.') || @@ -5538,7 +5538,7 @@ static int ventoy_collect_replace_initrd(const char *filename, const struct grub //debug("#### [DIR] <%s> <%s>\n", pfsdir->fullpath, filename); pfsdir->dircnt++; - + printlen = grub_snprintf(pfsdir->fullpath + curpos, 512 - curpos, "%s/", filename); pfsdir->curpos = curpos + printlen; pfsdir->fs->fs_dir(pfsdir->dev, pfsdir->fullpath, ventoy_collect_replace_initrd, pfsdir); @@ -5549,7 +5549,7 @@ static int ventoy_collect_replace_initrd(const char *filename, const struct grub { //debug("#### [FILE] <%s> <%s>\n", pfsdir->fullpath, filename); pfsdir->filecnt++; - + /* We consider the xxx.img file bigger than 32MB is the initramfs file */ if (len > 4 && grub_strncmp(filename + len - 4, ".img", 4) == 0) { @@ -5572,7 +5572,7 @@ static grub_err_t ventoy_cmd_search_replace_initrd(grub_extcmd_context_t ctxt, i grub_device_t dev = NULL; grub_fs_t fs = NULL; replace_fs_dir *pfsdir = NULL; - + (void)ctxt; if (argc != 2) @@ -5596,7 +5596,7 @@ static grub_err_t ventoy_cmd_search_replace_initrd(grub_extcmd_context_t ctxt, i dev = grub_device_open(device_name); if (!dev) { - goto fail; + goto fail; } fs = grub_fs_probe(dev); @@ -5632,7 +5632,7 @@ static grub_err_t ventoy_cmd_search_replace_initrd(grub_extcmd_context_t ctxt, i } fail: - + grub_check_free(pfsdir); grub_check_free(device_name); check_free(dev, grub_device_close); @@ -5643,7 +5643,7 @@ static grub_err_t ventoy_cmd_search_replace_initrd(grub_extcmd_context_t ctxt, i static grub_err_t ventoy_cmd_push_pager(grub_extcmd_context_t ctxt, int argc, char **args) { const char *pager = NULL; - + (void)ctxt; (void)argc; (void)args; @@ -5723,7 +5723,7 @@ static int ventoy_chk_case_dir(const char *filename, const struct grub_dirhook_i } } } - + return 0; } @@ -5734,7 +5734,7 @@ static grub_err_t ventoy_cmd_chk_json_pathcase(grub_extcmd_context_t ctxt, int a grub_device_t dev = NULL; grub_fs_t fs = NULL; chk_case_fs_dir fs_dir; - + (void)ctxt; (void)argc; (void)args; @@ -5843,7 +5843,7 @@ static grub_err_t grub_cmd_syslinux_nojoliet(grub_extcmd_context_t ctxt, int arg grub_uint32_t boot_catlog = 0; grub_uint8_t sector[512]; boot_info_table *info = NULL; - + (void)ctxt; (void)argc; @@ -5872,7 +5872,7 @@ static grub_err_t grub_cmd_syslinux_nojoliet(grub_extcmd_context_t ctxt, int arg debug("no bootcatlog found %u\n", boot_catlog); goto out; } - + loadrba = ventoy_get_bios_eltorito_rba(file, boot_catlog); if (loadrba == 0) { @@ -5884,9 +5884,9 @@ static grub_err_t grub_cmd_syslinux_nojoliet(grub_extcmd_context_t ctxt, int arg grub_file_read(file, sector, 512); info = (boot_info_table *)sector; - if (info->bi_data0 == 0x7c6ceafa && - info->bi_data1 == 0x90900000 && - info->bi_PrimaryVolumeDescriptor == 16 && + if (info->bi_data0 == 0x7c6ceafa && + info->bi_data1 == 0x90900000 && + info->bi_PrimaryVolumeDescriptor == 16 && info->bi_BootFileLocation == loadrba) { debug("bootloader is syslinux, %u.\n", loadrba); @@ -5904,15 +5904,15 @@ static grub_err_t grub_cmd_vlnk_dump_part(grub_extcmd_context_t ctxt, int argc, { int n = 0; ventoy_vlnk_part *node; - + (void)ctxt; (void)argc; (void)args; for (node = g_vlnk_part_list; node; node = node->next) { - grub_printf("[%d] %s disksig:%08x offset:%llu fs:%s\n", - ++n, node->device, node->disksig, + grub_printf("[%d] %s disksig:%08x offset:%llu fs:%s\n", + ++n, node->device, node->disksig, (ulonglong)node->partoffset, (node->fs ? node->fs->name : "N/A")); } @@ -5922,7 +5922,7 @@ static grub_err_t grub_cmd_vlnk_dump_part(grub_extcmd_context_t ctxt, int argc, static grub_err_t grub_cmd_is_vlnk_name(grub_extcmd_context_t ctxt, int argc, char **args) { int len = 0; - + (void)ctxt; if (argc == 1) @@ -5931,7 +5931,7 @@ static grub_err_t grub_cmd_is_vlnk_name(grub_extcmd_context_t ctxt, int argc, ch if (grub_file_is_vlnk_suffix(args[0], len)) { return 0; - } + } } return 1; @@ -5941,7 +5941,7 @@ static grub_err_t grub_cmd_get_vlnk_dst(grub_extcmd_context_t ctxt, int argc, ch { int vlnk = 0; const char *name = NULL; - + (void)ctxt; if (argc == 2) @@ -5967,7 +5967,7 @@ static grub_err_t grub_cmd_check_vlnk(grub_extcmd_context_t ctxt, int argc, char grub_file_t file = NULL; ventoy_vlnk vlnk; char dst[512]; - + (void)ctxt; if (argc != 1) @@ -6026,7 +6026,7 @@ static grub_err_t ventoy_cmd_iso_vd_id_parse(grub_extcmd_context_t ctxt, int arg int ret = 1; int offset = 318; grub_file_t file = NULL; - + (void)ctxt; (void)argc; @@ -6059,7 +6059,7 @@ static grub_err_t ventoy_cmd_iso_vd_id_begin(grub_extcmd_context_t ctxt, int arg { int ret = 1; char *id = g_iso_vd_id_publisher; - + (void)ctxt; (void)argc; @@ -6076,7 +6076,7 @@ static grub_err_t ventoy_cmd_iso_vd_id_begin(grub_extcmd_context_t ctxt, int arg { ret = 0; } - + if (args[1][0] == '1' && grub_strncmp(id, args[2], grub_strlen(args[2])) == 0) { ret = 0; @@ -6105,7 +6105,7 @@ static grub_err_t ventoy_cmd_dump_rsv_page(grub_extcmd_context_t ctxt, int argc, grub_uint64_t total; grub_uint64_t org_required; grub_uint64_t new_required; - + (void)ctxt; (void)argc; (void)args; @@ -6130,7 +6130,7 @@ static grub_err_t ventoy_cmd_dump_rsv_page(grub_extcmd_context_t ctxt, int argc, static grub_err_t ventoy_cmd_need_secondary_menu(grub_extcmd_context_t ctxt, int argc, char **args) { const char *env = NULL; - + (void)ctxt; (void)argc; @@ -6233,7 +6233,7 @@ static grub_err_t ventoy_cmd_show_secondary_menu(grub_extcmd_context_t ctxt, int g_ventoy_secondary_menu_on = 0; select = seldata[g_ventoy_last_entry]; - + if (select == 2) { g_ventoy_wimboot_mode = 1; @@ -6284,7 +6284,7 @@ static grub_err_t ventoy_cmd_secondary_recover_mode(grub_extcmd_context_t ctxt, } g_vtoy_secondary_need_recover = 0; - + VENTOY_CMD_RETURN(GRUB_ERR_NONE); } @@ -6341,17 +6341,17 @@ static int ventoy_chksum_pathcmp(int chktype, char *rlpath, char *rdpath) return 0; } } - + return 1; } static int ventoy_find_checksum ( - grub_file_t file, - const char *uname, - int retlen, - char *path, - int chktype, + grub_file_t file, + const char *uname, + int retlen, + char *path, + int chktype, char *chksum ) { @@ -6385,7 +6385,7 @@ static int ventoy_find_checksum pos = grub_strchr(currline, '='); pos1 = grub_strchr(currline, '('); pos2 = grub_strchr(currline, ')'); - + if (pos && pos1 && pos2) { *pos2 = 0; @@ -6403,7 +6403,7 @@ static int ventoy_find_checksum if (ventoy_chksum_pathcmp(chktype, path, pos) == 0) { grub_memcpy(chksum, currline, retlen); - goto end; + goto end; } } } @@ -6453,7 +6453,7 @@ static int ventoy_check_chkfile(const char *isopart, char *path, const char *lch if (pfile) { - *pfile = file; + *pfile = file; } else { @@ -6485,9 +6485,9 @@ static grub_err_t ventoy_cmd_cmp_checksum(grub_extcmd_context_t ctxt, int argc, grub_strncpy(uchkname, g_lower_chksum_name[index], sizeof(uchkname)); ventoy_str_toupper(uchkname); - + isopart = grub_env_get("vtoy_iso_part"); - calc_value = grub_env_get("VT_LAST_CHECK_SUM"); + calc_value = grub_env_get("VT_LAST_CHECK_SUM"); chktype = ventoy_check_chkfile(isopart, args[1], g_lower_chksum_name[index], &file); if (chktype <= 0) @@ -6562,7 +6562,7 @@ static grub_err_t ventoy_cmd_cmp_checksum(grub_extcmd_context_t ctxt, int argc, static int ventoy_find_all_checksum ( - grub_file_t file, + grub_file_t file, char *path, int chktype, int exists[VTOY_CHKSUM_NUM], @@ -6604,7 +6604,7 @@ static int ventoy_find_all_checksum { continue; } - + uname = g_lower_chksum_name[i]; ulen = g_lower_chksum_namelen[i]; @@ -6613,7 +6613,7 @@ static int ventoy_find_all_checksum pos = grub_strchr(currline, '='); pos1 = grub_strchr(currline, '('); pos2 = grub_strchr(currline, ')'); - + if (pos && pos1 && pos2) { c = *pos2; @@ -6664,7 +6664,7 @@ static grub_err_t ventoy_cmd_vtoychksum_exist(grub_extcmd_context_t ctxt, int ar (void)argc; (void)ctxt; - + isopart = grub_env_get("vtoy_iso_part"); for (i = 0; i < VTOY_CHKSUM_NUM; i++) @@ -6689,7 +6689,7 @@ static grub_err_t ventoy_cmd_vtoychksum_exist(grub_extcmd_context_t ctxt, int ar *pos = 0; file = ventoy_grub_file_open(VENTOY_FILE_TYPE, "%s%s/VENTOY_CHECKSUM", isopart, args[0]); *pos = c; - + if (file) { if (tip == 0 && file->size > (32 * VTOY_SIZE_1KB)) @@ -6698,7 +6698,7 @@ static grub_err_t ventoy_cmd_vtoychksum_exist(grub_extcmd_context_t ctxt, int ar grub_printf("Reading checksum file...\n"); grub_refresh(); } - + debug("parse local VENTOY_CHECKSUM\n"); ventoy_find_all_checksum(file, args[0], 2, exists, &totexist); grub_file_close(file); @@ -6758,7 +6758,7 @@ int ventoy_env_init(void) g_list_script_buf = grub_malloc(VTOY_MAX_SCRIPT_BUF); for (i = 0; i < VTOY_MAX_CONF_REPLACE; i++) { - g_conf_replace_new_buf[i] = grub_malloc(vtoy_max_replace_file_size); + g_conf_replace_new_buf[i] = grub_malloc(vtoy_max_replace_file_size); } ventoy_filt_register(0, ventoy_wrapper_open); @@ -6787,7 +6787,7 @@ int ventoy_env_init(void) grub_snprintf(buf, sizeof(buf), "0x%lx", (ulong)ventoy_chain_file_read); grub_env_set("vtoy_chain_file_read", buf); grub_env_export("vtoy_chain_file_read"); - + grub_snprintf(buf, sizeof(buf), "0x%lx", (ulong)ventoy_get_vmenu_title); grub_env_set("VTOY_VMENU_FUNC_ADDR", buf); grub_env_export("VTOY_VMENU_FUNC_ADDR"); @@ -6801,7 +6801,7 @@ int ventoy_env_init(void) -static cmd_para ventoy_cmds[] = +static cmd_para ventoy_cmds[] = { { "vt_browser_disk", ventoy_cmd_browser_disk, 0, NULL, "", "", NULL }, { "vt_browser_dir", ventoy_cmd_browser_dir, 0, NULL, "", "", NULL }, @@ -6844,13 +6844,13 @@ static cmd_para ventoy_cmds[] = { "vt_get_fs_label", ventoy_cmd_get_fs_label, 0, NULL, "", "", NULL }, { "vt_fs_enum_1st_file", ventoy_cmd_fs_enum_1st_file, 0, NULL, "", "", NULL }, { "vt_fs_enum_1st_dir", ventoy_cmd_fs_enum_1st_dir, 0, NULL, "", "", NULL }, - { "vt_file_basename", ventoy_cmd_basename, 0, NULL, "", "", NULL }, - { "vt_file_basefile", ventoy_cmd_basefile, 0, NULL, "", "", NULL }, - { "vt_enum_video_mode", ventoy_cmd_enum_video_mode, 0, NULL, "", "", NULL }, - { "vt_get_video_mode", ventoy_cmd_get_video_mode, 0, NULL, "", "", NULL }, - { "vt_update_cur_video_mode", vt_cmd_update_cur_video_mode, 0, NULL, "", "", NULL }, + { "vt_file_basename", ventoy_cmd_basename, 0, NULL, "", "", NULL }, + { "vt_file_basefile", ventoy_cmd_basefile, 0, NULL, "", "", NULL }, + { "vt_enum_video_mode", ventoy_cmd_enum_video_mode, 0, NULL, "", "", NULL }, + { "vt_get_video_mode", ventoy_cmd_get_video_mode, 0, NULL, "", "", NULL }, + { "vt_update_cur_video_mode", vt_cmd_update_cur_video_mode, 0, NULL, "", "", NULL }, + - { "vt_find_first_bootable_hd", ventoy_cmd_find_bootable_hdd, 0, NULL, "", "", NULL }, { "vt_dump_menu", ventoy_cmd_dump_menu, 0, NULL, "", "", NULL }, { "vt_dynamic_menu", ventoy_cmd_dynamic_menu, 0, NULL, "", "", NULL }, @@ -6870,7 +6870,7 @@ static cmd_para ventoy_cmds[] = { "vt_load_file_to_mem", ventoy_cmd_load_file_to_mem, 0, NULL, "", "", NULL }, { "vt_load_img_memdisk", ventoy_cmd_load_img_memdisk, 0, NULL, "", "", NULL }, { "vt_concat_efi_iso", ventoy_cmd_concat_efi_iso, 0, NULL, "", "", NULL }, - + { "vt_linux_parse_initrd_isolinux", ventoy_cmd_isolinux_initrd_collect, 0, NULL, "{cfgfile}", "", NULL }, { "vt_linux_parse_initrd_grub", ventoy_cmd_grub_initrd_collect, 0, NULL, "{cfgfile}", "", NULL }, { "vt_linux_specify_initrd_file", ventoy_cmd_specify_initrd_file, 0, NULL, "", "", NULL }, @@ -6897,16 +6897,16 @@ static cmd_para ventoy_cmds[] = { "vt_test_block_list", ventoy_cmd_test_block_list, 0, NULL, "", "", NULL }, { "vt_file_exist_nocase", ventoy_cmd_file_exist_nocase, 0, NULL, "", "", NULL }, - + { "vt_load_plugin", ventoy_cmd_load_plugin, 0, NULL, "", "", NULL }, { "vt_check_plugin_json", ventoy_cmd_plugin_check_json, 0, NULL, "", "", NULL }, { "vt_check_password", ventoy_cmd_check_password, 0, NULL, "", "", NULL }, - + { "vt_1st_line", ventoy_cmd_read_1st_line, 0, NULL, "", "", NULL }, { "vt_file_strstr", ventoy_cmd_file_strstr, 0, NULL, "", "", NULL }, { "vt_img_part_info", ventoy_cmd_img_part_info, 0, NULL, "", "", NULL }, - + { "vt_parse_iso_volume", ventoy_cmd_parse_volume, 0, NULL, "", "", NULL }, { "vt_parse_iso_create_date", ventoy_cmd_parse_create_date, 0, NULL, "", "", NULL }, { "vt_parse_freenas_ver", ventoy_cmd_parse_freenas_ver, 0, NULL, "", "", NULL }, @@ -6976,11 +6976,11 @@ int ventoy_register_all_cmd(void) { grub_uint32_t i; cmd_para *cur = NULL; - + for (i = 0; i < ARRAY_SIZE(ventoy_cmds); i++) { cur = ventoy_cmds + i; - cur->cmd = grub_register_extcmd(cur->name, cur->func, cur->flags, + cur->cmd = grub_register_extcmd(cur->name, cur->func, cur->flags, cur->summary, cur->description, cur->parser); } @@ -6990,12 +6990,12 @@ int ventoy_register_all_cmd(void) int ventoy_unregister_all_cmd(void) { grub_uint32_t i; - + for (i = 0; i < ARRAY_SIZE(ventoy_cmds); i++) { grub_unregister_extcmd(ventoy_cmds[i].cmd); } - + return 0; } diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_def.h b/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_def.h index 64a6ba8d4e5..aaef48ba765 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_def.h +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_def.h @@ -7,12 +7,12 @@ * 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 . * @@ -135,7 +135,7 @@ typedef enum VTOY_FILE_FLT VTOY_FILE_FLT_IMG, /* .img */ VTOY_FILE_FLT_VHD, /* .vhd(x) */ VTOY_FILE_FLT_VTOY, /* .vtoy */ - + VTOY_FILE_FLT_BUTT }VTOY_FILE_FLT; @@ -153,7 +153,7 @@ typedef struct cmd_para grub_extcmd_func_t func; grub_command_flags_t flags; const struct grub_arg_option *parser; - + const char *summary; const char *description; @@ -164,7 +164,7 @@ typedef struct cmd_para #define ventoy_align(value, align) (((value) + ((align) - 1)) & (~((align) - 1))) #pragma pack(1) -typedef struct cpio_newc_header +typedef struct cpio_newc_header { char c_magic[6]; char c_ino[8]; @@ -199,7 +199,7 @@ typedef struct ventoy_patch_vhd grub_uint8_t part_offset_or_guid[16]; grub_uint32_t reserved1; grub_uint32_t part_type; - grub_uint8_t disk_signature_or_guid[16]; + grub_uint8_t disk_signature_or_guid[16]; grub_uint8_t reserved2[16]; grub_uint8_t vhd_file_path[1]; }ventoy_patch_vhd; @@ -277,7 +277,7 @@ typedef struct img_info const char *tip2; const char *class; const char *menu_prefix; - + int id; int type; int plugin_list_index; @@ -306,8 +306,8 @@ typedef struct img_iterator_node struct img_iterator_node *parent; struct img_iterator_node *firstchild; - - void *firstiso; + + void *firstiso; }img_iterator_node; @@ -321,7 +321,7 @@ typedef struct initrd_info grub_uint8_t iso_type; // 0: iso9660 1:udf grub_uint32_t udf_start_block; - + grub_uint64_t override_offset; grub_uint32_t override_length; char override_data[32]; @@ -390,7 +390,7 @@ void ventoy_debug(const char *fmt, ...); #pragma pack(1) /* A WIM resource header */ -typedef struct wim_resource_header +typedef struct wim_resource_header { grub_uint64_t size_in_wim:56; /* Compressed length */ grub_uint64_t flags:8; /* flags */ @@ -402,7 +402,7 @@ typedef struct wim_resource_header #define WIM_RESHDR_ZLEN_MASK 0x00ffffffffffffffULL /* WIM resource header flags */ -typedef enum wim_resource_header_flags +typedef enum wim_resource_header_flags { WIM_RESHDR_METADATA = ( 0x02ULL << 56 ), /* Resource contains metadata */ WIM_RESHDR_COMPRESSED = ( 0x04ULL << 56 ), /* Resource is compressed */ @@ -412,7 +412,7 @@ typedef enum wim_resource_header_flags #define WIM_HEAD_SIGNATURE "MSWIM\0\0" /* WIM header */ -typedef struct wim_header +typedef struct wim_header { grub_uint8_t signature[8]; /* Signature */ grub_uint32_t header_len; /* Header length */ @@ -432,21 +432,21 @@ typedef struct wim_header } wim_header; /* WIM header flags */ -typedef enum wim_header_flags +typedef enum wim_header_flags { WIM_HDR_XPRESS = 0x00020000, /* WIM uses Xpress compresson */ WIM_HDR_LZX = 0x00040000, /* WIM uses LZX compression */ }wim_header_flags; /* A WIM file hash */ -typedef struct wim_hash +typedef struct wim_hash { /* SHA-1 hash */ grub_uint8_t sha1[20]; }wim_hash; /* A WIM lookup table entry */ -typedef struct wim_lookup_entry +typedef struct wim_lookup_entry { wim_resource_header resource; /* Resource header */ grub_uint16_t part; /* Part number */ @@ -458,19 +458,19 @@ typedef struct wim_lookup_entry #define WIM_CHUNK_LEN 32768 /* A WIM chunk buffer */ -typedef struct wim_chunk_buffer +typedef struct wim_chunk_buffer { grub_uint8_t data[WIM_CHUNK_LEN]; /*Data */ }wim_chunk_buffer; /* Security data */ -typedef struct wim_security_header +typedef struct wim_security_header { grub_uint32_t len; /* Length */ grub_uint32_t count; /* Number of entries */ }wim_security_header; -typedef struct wim_stream_entry +typedef struct wim_stream_entry { grub_uint64_t len; grub_uint64_t unused1; @@ -480,7 +480,7 @@ typedef struct wim_stream_entry }wim_stream_entry; /* Directory entry */ -typedef struct wim_directory_entry +typedef struct wim_directory_entry { grub_uint64_t len; /* Length */ grub_uint32_t attributes; /* Attributes */ @@ -583,7 +583,7 @@ typedef struct _VTOY_JSON struct _VTOY_JSON *pstChild; JSON_TYPE enDataType; - union + union { char *pcStrVal; int iNumVal; @@ -694,7 +694,7 @@ int vtoy_json_parse_value ( char *pcNewStart, char *pcRawStart, - VTOY_JSON *pstJson, + VTOY_JSON *pstJson, const char *pcData, const char **ppcEnd ); @@ -710,51 +710,51 @@ int vtoy_json_scan_parse int vtoy_json_scan_array ( - VTOY_JSON *pstJson, - const char *szKey, + VTOY_JSON *pstJson, + const char *szKey, VTOY_JSON **ppstArrayItem ); int vtoy_json_scan_array_ex ( - VTOY_JSON *pstJson, - const char *szKey, + VTOY_JSON *pstJson, + const char *szKey, VTOY_JSON **ppstArrayItem ); int vtoy_json_scan_object ( - VTOY_JSON *pstJson, - const char *szKey, + VTOY_JSON *pstJson, + const char *szKey, VTOY_JSON **ppstObjectItem ); int vtoy_json_get_int ( - VTOY_JSON *pstJson, - const char *szKey, + VTOY_JSON *pstJson, + const char *szKey, int *piValue ); int vtoy_json_get_uint ( - VTOY_JSON *pstJson, - const char *szKey, + VTOY_JSON *pstJson, + const char *szKey, grub_uint32_t *puiValue ); int vtoy_json_get_uint64 ( - VTOY_JSON *pstJson, - const char *szKey, + VTOY_JSON *pstJson, + const char *szKey, grub_uint64_t *pui64Value ); int vtoy_json_get_bool ( VTOY_JSON *pstJson, - const char *szKey, + const char *szKey, grub_uint8_t *pbValue ); int vtoy_json_get_string ( - VTOY_JSON *pstJson, - const char *szKey, + VTOY_JSON *pstJson, + const char *szKey, grub_uint32_t uiBufLen, char *pcBuf ); @@ -776,7 +776,7 @@ static inline int ventoy_isspace (int c) static inline int ventoy_is_word_end(int c) { - return (c == 0 || c == ',' || ventoy_isspace(c)); + return (c == 0 || c == ',' || ventoy_isspace(c)); } #pragma pack(1) @@ -948,7 +948,7 @@ typedef struct persistence_config int cursel; int backendnum; file_fullpath *backendpath; - + struct persistence_config *next; }persistence_config; diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_json.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_json.c index 8f81779fff1..e06796a8f63 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_json.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_json.c @@ -1,5 +1,5 @@ /****************************************************************************** - * ventoy_json.c + * ventoy_json.c * * Copyright (c) 2020, longpanda * @@ -7,12 +7,12 @@ * 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 . * @@ -92,20 +92,20 @@ VTOY_JSON *vtoy_json_find_item { while (NULL != pstJson) { - if ((enDataType == pstJson->enDataType) && + if ((enDataType == pstJson->enDataType) && (0 == grub_strcmp(szKey, pstJson->pcName))) { return pstJson; } pstJson = pstJson->pstNext; } - + return NULL; } static int vtoy_json_parse_number ( - VTOY_JSON *pstJson, + VTOY_JSON *pstJson, const char *pcData, const char **ppcEnd ) @@ -121,7 +121,7 @@ static int vtoy_json_parse_number pstJson->enDataType = JSON_TYPE_NUMBER; pstJson->unData.lValue = Value; - + return JSON_SUCCESS; } @@ -129,7 +129,7 @@ static int vtoy_json_parse_string ( char *pcNewStart, char *pcRawStart, - VTOY_JSON *pstJson, + VTOY_JSON *pstJson, const char *pcData, const char **ppcEnd ) @@ -137,7 +137,7 @@ static int vtoy_json_parse_string grub_uint32_t uiLen = 0; const char *pcPos = NULL; const char *pcTmp = pcData + 1; - + *ppcEnd = pcData; if ('\"' != *pcData) @@ -161,7 +161,7 @@ static int vtoy_json_parse_string break; } } - + if (*pcPos == 0 || pcPos < pcTmp) { json_debug("Invalid quotes string %s.", pcData); @@ -170,12 +170,12 @@ static int vtoy_json_parse_string } *ppcEnd = pcPos + 1; - uiLen = (grub_uint32_t)(unsigned long)(pcPos - pcTmp); - + uiLen = (grub_uint32_t)(unsigned long)(pcPos - pcTmp); + pstJson->enDataType = JSON_TYPE_STRING; pstJson->unData.pcStrVal = pcNewStart + (pcTmp - pcRawStart); pstJson->unData.pcStrVal[uiLen] = '\0'; - + return JSON_SUCCESS; } @@ -183,7 +183,7 @@ static int vtoy_json_parse_array ( char *pcNewStart, char *pcRawStart, - VTOY_JSON *pstJson, + VTOY_JSON *pstJson, const char *pcData, const char **ppcEnd ) @@ -252,7 +252,7 @@ static int vtoy_json_parse_object ( char *pcNewStart, char *pcRawStart, - VTOY_JSON *pstJson, + VTOY_JSON *pstJson, const char *pcData, const char **ppcEnd ) @@ -354,13 +354,13 @@ int vtoy_json_parse_value ( char *pcNewStart, char *pcRawStart, - VTOY_JSON *pstJson, + VTOY_JSON *pstJson, const char *pcData, const char **ppcEnd ) { pcData = vtoy_json_skip(pcData); - + switch (*pcData) { case 'n': @@ -434,7 +434,7 @@ VTOY_JSON * vtoy_json_create(void) { return NULL; } - + return pstJson; } @@ -458,7 +458,7 @@ int vtoy_json_parse(VTOY_JSON *pstJson, const char *szJsonData) Ret = vtoy_json_parse_value(pcNewBuf, (char *)szJsonData, pstJson, szJsonData, &pcEnd); if (JSON_SUCCESS != Ret) { - json_debug("Failed to parse json data %s start=%p, end=%p:%s.", + json_debug("Failed to parse json data %s start=%p, end=%p:%s.", szJsonData, szJsonData, pcEnd, pcEnd); return JSON_FAILED; } @@ -472,7 +472,7 @@ int vtoy_json_scan_parse grub_uint32_t uiParseNum, JSON_PARSE *pstJsonParse ) -{ +{ grub_uint32_t i = 0; const VTOY_JSON *pstJsonCur = NULL; JSON_PARSE *pstCurParse = NULL; @@ -488,7 +488,7 @@ int vtoy_json_scan_parse for (i = 0, pstCurParse = NULL; i < uiParseNum; i++) { if (0 == grub_strcmp(pstJsonParse[i].pcKey, pstJsonCur->pcName)) - { + { pstCurParse = pstJsonParse + i; break; } @@ -498,7 +498,7 @@ int vtoy_json_scan_parse { continue; } - + switch (pstJsonCur->enDataType) { case JSON_TYPE_NUMBER: @@ -517,7 +517,7 @@ int vtoy_json_scan_parse } else if ((pstCurParse->uiBufSize > sizeof(grub_uint64_t))) { - grub_snprintf((char *)pstCurParse->pDataBuf, pstCurParse->uiBufSize, "%llu", + grub_snprintf((char *)pstCurParse->pDataBuf, pstCurParse->uiBufSize, "%llu", (unsigned long long)(pstJsonCur->unData.lValue)); } else @@ -548,13 +548,13 @@ int vtoy_json_scan_parse int vtoy_json_scan_array ( - VTOY_JSON *pstJson, - const char *szKey, + VTOY_JSON *pstJson, + const char *szKey, VTOY_JSON **ppstArrayItem ) { VTOY_JSON *pstJsonItem = NULL; - + pstJsonItem = vtoy_json_find_item(pstJson, JSON_TYPE_ARRAY, szKey); if (NULL == pstJsonItem) { @@ -569,20 +569,20 @@ int vtoy_json_scan_array int vtoy_json_scan_array_ex ( - VTOY_JSON *pstJson, - const char *szKey, + VTOY_JSON *pstJson, + const char *szKey, VTOY_JSON **ppstArrayItem ) { VTOY_JSON *pstJsonItem = NULL; - + pstJsonItem = vtoy_json_find_item(pstJson, JSON_TYPE_ARRAY, szKey); if (NULL == pstJsonItem) { json_debug("Key %s is not found in json data.", szKey); return JSON_NOT_FOUND; } - + *ppstArrayItem = pstJsonItem->pstChild; return JSON_SUCCESS; @@ -590,8 +590,8 @@ int vtoy_json_scan_array_ex int vtoy_json_scan_object ( - VTOY_JSON *pstJson, - const char *szKey, + VTOY_JSON *pstJson, + const char *szKey, VTOY_JSON **ppstObjectItem ) { @@ -611,13 +611,13 @@ int vtoy_json_scan_object int vtoy_json_get_int ( - VTOY_JSON *pstJson, - const char *szKey, + VTOY_JSON *pstJson, + const char *szKey, int *piValue ) { VTOY_JSON *pstJsonItem = NULL; - + pstJsonItem = vtoy_json_find_item(pstJson, JSON_TYPE_NUMBER, szKey); if (NULL == pstJsonItem) { @@ -632,13 +632,13 @@ int vtoy_json_get_int int vtoy_json_get_uint ( - VTOY_JSON *pstJson, - const char *szKey, + VTOY_JSON *pstJson, + const char *szKey, grub_uint32_t *puiValue ) { VTOY_JSON *pstJsonItem = NULL; - + pstJsonItem = vtoy_json_find_item(pstJson, JSON_TYPE_NUMBER, szKey); if (NULL == pstJsonItem) { @@ -653,13 +653,13 @@ int vtoy_json_get_uint int vtoy_json_get_uint64 ( - VTOY_JSON *pstJson, - const char *szKey, + VTOY_JSON *pstJson, + const char *szKey, grub_uint64_t *pui64Value ) { VTOY_JSON *pstJsonItem = NULL; - + pstJsonItem = vtoy_json_find_item(pstJson, JSON_TYPE_NUMBER, szKey); if (NULL == pstJsonItem) { @@ -675,12 +675,12 @@ int vtoy_json_get_uint64 int vtoy_json_get_bool ( VTOY_JSON *pstJson, - const char *szKey, + const char *szKey, grub_uint8_t *pbValue ) { VTOY_JSON *pstJsonItem = NULL; - + pstJsonItem = vtoy_json_find_item(pstJson, JSON_TYPE_BOOL, szKey); if (NULL == pstJsonItem) { @@ -695,14 +695,14 @@ int vtoy_json_get_bool int vtoy_json_get_string ( - VTOY_JSON *pstJson, - const char *szKey, + VTOY_JSON *pstJson, + const char *szKey, grub_uint32_t uiBufLen, char *pcBuf ) { VTOY_JSON *pstJsonItem = NULL; - + pstJsonItem = vtoy_json_find_item(pstJson, JSON_TYPE_STRING, szKey); if (NULL == pstJsonItem) { @@ -737,7 +737,7 @@ const char * vtoy_json_get_string_ex(VTOY_JSON *pstJson, const char *szKey) int vtoy_json_destroy(VTOY_JSON *pstJson) { if (NULL == pstJson) - { + { return JSON_SUCCESS; } @@ -752,7 +752,7 @@ int vtoy_json_destroy(VTOY_JSON *pstJson) } grub_free(pstJson); - + return JSON_SUCCESS; } diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_linux.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_linux.c index 93ebeb92a3b..b7c4a6eb3c6 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_linux.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_linux.c @@ -1,5 +1,5 @@ /****************************************************************************** - * ventoy_linux.c + * ventoy_linux.c * * Copyright (c) 2020, longpanda * @@ -7,12 +7,12 @@ * 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 . * @@ -84,7 +84,7 @@ grub_err_t ventoy_cmd_clear_initrd_list(grub_extcmd_context_t ctxt, int argc, ch { initrd_info *node = g_initrd_img_list; initrd_info *next; - + (void)ctxt; (void)argc; (void)args; @@ -108,7 +108,7 @@ grub_err_t ventoy_cmd_dump_initrd_list(grub_extcmd_context_t ctxt, int argc, cha { int i = 0; initrd_info *node = g_initrd_img_list; - + (void)ctxt; (void)argc; (void)args; @@ -119,7 +119,7 @@ grub_err_t ventoy_cmd_dump_initrd_list(grub_extcmd_context_t ctxt, int argc, cha while (node) { grub_printf("%s ", node->size > 0 ? "*" : " "); - grub_printf("%02u %s offset:%llu size:%llu \n", i++, node->name, (unsigned long long)node->offset, + grub_printf("%02u %s offset:%llu size:%llu \n", i++, node->name, (unsigned long long)node->offset, (unsigned long long)node->size); node = node->next; } @@ -130,7 +130,7 @@ grub_err_t ventoy_cmd_dump_initrd_list(grub_extcmd_context_t ctxt, int argc, cha } static void ventoy_parse_directory(char *path, char *dir, int buflen) -{ +{ int end; char *pos; @@ -201,7 +201,7 @@ static grub_err_t ventoy_isolinux_initrd_collect(grub_file_t file, const char *p } } - pos += offset; + pos += offset; while (1) { @@ -291,7 +291,7 @@ grub_err_t ventoy_cmd_isolinux_initrd_collect(grub_extcmd_context_t ctxt, int ar char *device_name = NULL; ventoy_initrd_ctx ctx; char directory[256]; - + (void)ctxt; (void)argc; @@ -304,7 +304,7 @@ grub_err_t ventoy_cmd_isolinux_initrd_collect(grub_extcmd_context_t ctxt, int ar dev = grub_device_open(device_name); if (!dev) { - goto end; + goto end; } fs = grub_fs_probe(dev); @@ -334,7 +334,7 @@ static int ventoy_linux_initrd_collect_hook(const char *filename, const struct g { int len; initrd_info *img = NULL; - + (void)data; if (0 == info->dir) @@ -354,7 +354,7 @@ static int ventoy_linux_initrd_collect_hook(const char *filename, const struct g grub_free(img); } else - { + { if (g_initrd_img_list) { img->prev = g_initrd_img_tail; @@ -385,7 +385,7 @@ static int ventoy_linux_collect_boot_initrds(void) if (!dev) { debug("failed to open device loop\n"); - goto end; + goto end; } fs = grub_fs_probe(dev); @@ -398,7 +398,7 @@ static int ventoy_linux_collect_boot_initrds(void) fs->fs_dir(dev, "/boot", ventoy_linux_initrd_collect_hook, NULL); end: - return 0; + return 0; } static grub_err_t ventoy_grub_cfg_initrd_collect(const char *fileName) @@ -421,7 +421,7 @@ static grub_err_t ventoy_grub_cfg_initrd_collect(const char *fileName) { return 0; } - + buf = grub_zalloc(file->size + 2); if (!buf) { @@ -492,8 +492,8 @@ static grub_err_t ventoy_grub_cfg_initrd_collect(const char *fileName) len = (int)grub_strlen(img->name); if (grub_strcmp(img->name + len - 4, ".img") == 0) { - initrd_dollar++; - } + initrd_dollar++; + } } } @@ -549,8 +549,8 @@ static int ventoy_grub_initrd_hook(const char *filename, const struct grub_dirho debug("ventoy_grub_initrd_hook %s\n", filename); - if (NULL == grub_strstr(filename, ".cfg") && - NULL == grub_strstr(filename, ".CFG") && + if (NULL == grub_strstr(filename, ".cfg") && + NULL == grub_strstr(filename, ".CFG") && NULL == grub_strstr(filename, ".conf")) { return 0; @@ -570,7 +570,7 @@ grub_err_t ventoy_cmd_grub_initrd_collect(grub_extcmd_context_t ctxt, int argc, grub_device_t dev = NULL; char *device_name = NULL; ventoy_initrd_ctx ctx; - + (void)ctxt; (void)argc; @@ -597,7 +597,7 @@ grub_err_t ventoy_cmd_grub_initrd_collect(grub_extcmd_context_t ctxt, int argc, if (!dev) { debug("failed to open device %s\n", device_name); - goto end; + goto end; } fs = grub_fs_probe(dev); @@ -697,7 +697,7 @@ static void ventoy_cpio_newc_fill_int(grub_uint32_t value, char *buf, int buflen } else { - grub_memcpy(buf + buflen - len, intbuf, len); + grub_memcpy(buf + buflen - len, intbuf, len); } } @@ -707,7 +707,7 @@ int ventoy_cpio_newc_fill_head(void *buf, int filesize, const void *filedata, co int headlen = 0; static grub_uint32_t cpio_ino = 0xFFFFFFF0; cpio_newc_header *cpio = (cpio_newc_header *)buf; - + namelen = grub_strlen(name) + 1; headlen = sizeof(cpio_newc_header) + namelen; headlen = ventoy_align(headlen, 4); @@ -735,7 +735,7 @@ static grub_uint32_t ventoy_linux_get_virt_chunk_count(void) { int i; grub_uint32_t count = g_valid_initrd_count; - + if (g_conf_replace_count > 0) { for (i = 0; i < g_conf_replace_count; i++) @@ -746,12 +746,12 @@ static grub_uint32_t ventoy_linux_get_virt_chunk_count(void) } } } - + if (g_append_ext_sector > 0) { count++; } - + return count; } @@ -759,7 +759,7 @@ static grub_uint32_t ventoy_linux_get_virt_chunk_size(void) { int i; grub_uint32_t size; - + size = (sizeof(ventoy_virt_chunk) + g_ventoy_cpio_size) * g_valid_initrd_count; if (g_conf_replace_count > 0) @@ -772,7 +772,7 @@ static grub_uint32_t ventoy_linux_get_virt_chunk_size(void) } } } - + if (g_append_ext_sector > 0) { size += sizeof(ventoy_virt_chunk) + VTOY_APPEND_EXT_SIZE; @@ -841,7 +841,7 @@ static void ventoy_linux_fill_virt_data( grub_uint64_t isosize, ventoy_chain_ if (g_append_ext_sector > 0) { cpio_secs = VTOY_APPEND_EXT_SIZE / 2048; - + cur->mem_sector_start = sector; cur->mem_sector_end = cur->mem_sector_start + cpio_secs; cur->mem_sector_offset = offset; @@ -866,7 +866,7 @@ static void ventoy_linux_fill_virt_data( grub_uint64_t isosize, ventoy_chain_ if (g_conf_replace_offset[i] > 0) { cpio_secs = g_conf_replace_new_len_align[i] / 2048; - + cur->mem_sector_start = sector; cur->mem_sector_end = cur->mem_sector_start + cpio_secs; cur->mem_sector_offset = offset; @@ -915,7 +915,7 @@ static grub_uint32_t ventoy_linux_get_override_chunk_count(void) { count++; } - + return count; } @@ -965,7 +965,7 @@ static void ventoy_linux_fill_override_data( grub_uint64_t isosize, void *ove } newlen = (grub_uint32_t)(node->size + g_ventoy_cpio_size); - mod = newlen % 4; + mod = newlen % 4; if (mod > 0) { newlen += 4 - mod; /* cpio must align with 4 */ @@ -986,7 +986,7 @@ static void ventoy_linux_fill_override_data( grub_uint64_t isosize, void *ove else { udf = (ventoy_udf_override *)node->override_data; - + node->override_length = sizeof(ventoy_udf_override); udf->length = newlen; udf->position = (grub_uint32_t)sector - node->udf_start_block; @@ -1005,7 +1005,7 @@ static void ventoy_linux_fill_override_data( grub_uint64_t isosize, void *ove for (i = 0; i < g_conf_replace_count; i++) { if (g_conf_replace_offset[i] > 0) - { + { cur->img_offset = g_conf_replace_offset[i]; cur->override_size = sizeof(ventoy_iso9660_override); @@ -1024,7 +1024,7 @@ static void ventoy_linux_fill_override_data( grub_uint64_t isosize, void *ove } if (g_svd_replace_offset > 0) - { + { cur->img_offset = g_svd_replace_offset; cur->override_size = 1; cur->override_data[0] = 0xFF; @@ -1037,7 +1037,7 @@ static void ventoy_linux_fill_override_data( grub_uint64_t isosize, void *ove grub_err_t ventoy_cmd_initrd_count(grub_extcmd_context_t ctxt, int argc, char **args) { char buf[32] = {0}; - + (void)ctxt; (void)argc; (void)args; @@ -1054,7 +1054,7 @@ grub_err_t ventoy_cmd_initrd_count(grub_extcmd_context_t ctxt, int argc, char ** grub_err_t ventoy_cmd_valid_initrd_count(grub_extcmd_context_t ctxt, int argc, char **args) { char buf[32] = {0}; - + (void)ctxt; (void)argc; (void)args; @@ -1084,7 +1084,7 @@ static grub_err_t ventoy_linux_locate_initrd(int filt, int *filtcnt) { filtbysize = 0; } - + for (node = g_initrd_img_list; node; node = node->next) { file = ventoy_grub_file_open(VENTOY_FILE_TYPE, "(loop)%s", node->name); @@ -1096,7 +1096,7 @@ static grub_err_t ventoy_linux_locate_initrd(int filt, int *filtcnt) debug("file <%s> size:%d\n", node->name, (int)file->size); /* initrd file too small */ - if (filtbysize + if (filtbysize && (NULL == grub_strstr(node->name, "minirt.gz")) && (NULL == grub_strstr(node->name, "initrd.xz")) && (NULL == grub_strstr(node->name, "initrd.gz")) @@ -1121,7 +1121,7 @@ static grub_err_t ventoy_linux_locate_initrd(int filt, int *filtcnt) { node->iso_type = 0; node->override_offset = grub_iso9660_get_last_file_dirent_pos(file) + 2; - + grub_file_read(file, &data, 1); // just read for hook trigger node->offset = grub_iso9660_get_last_read_pos(file); } @@ -1147,7 +1147,7 @@ grub_err_t ventoy_cmd_linux_get_main_initrd_index(grub_extcmd_context_t ctxt, in int index = 0; char buf[32]; initrd_info *node = NULL; - + (void)ctxt; (void)argc; (void)args; @@ -1169,7 +1169,7 @@ grub_err_t ventoy_cmd_linux_get_main_initrd_index(grub_extcmd_context_t ctxt, in { continue; } - + if (grub_strstr(node->name, "ucode") || grub_strstr(node->name, "-firmware")) { index++; @@ -1213,7 +1213,7 @@ static int ventoy_cpio_busybox64(cpio_newc_header *head, const char *file) char filepath[128]; grub_snprintf(filepath, sizeof(filepath), "ventoy/busybox/%s", file); - + name = (char *)(head + 1); while (name[0] && count < 2) { @@ -1233,7 +1233,7 @@ static int ventoy_cpio_busybox64(cpio_newc_header *head, const char *file) offset = ventoy_align(offset, 4); offset += ventoy_cpio_newc_get_int(head->c_filesize); offset = ventoy_align(offset, 4); - + head = (cpio_newc_header *)((char *)head + offset); name = (char *)(head + 1); } @@ -1258,14 +1258,14 @@ grub_err_t ventoy_cmd_skip_svd(grub_extcmd_context_t ctxt, int argc, char **args int i; grub_file_t file; char buf[16]; - + (void)ctxt; (void)argc; file = ventoy_grub_file_open(VENTOY_FILE_TYPE, "%s", args[0]); if (!file) { - return grub_error(GRUB_ERR_BAD_ARGUMENT, "Can't open file %s\n", args[0]); + return grub_error(GRUB_ERR_BAD_ARGUMENT, "Can't open file %s\n", args[0]); } for (i = 0; i < 10; i++) @@ -1300,7 +1300,7 @@ grub_err_t ventoy_cmd_append_ext_sector(grub_extcmd_context_t ctxt, int argc, ch if (args[0][0] == '1') { - g_append_ext_sector = 1; + g_append_ext_sector = 1; } else { @@ -1343,7 +1343,7 @@ grub_err_t ventoy_cmd_load_cpio(grub_extcmd_context_t ctxt, int argc, char **arg if (argc != 4) { - return grub_error(GRUB_ERR_BAD_ARGUMENT, "Usage: %s cpiofile\n", cmd_raw_name); + return grub_error(GRUB_ERR_BAD_ARGUMENT, "Usage: %s cpiofile\n", cmd_raw_name); } if (g_img_chunk_list.chunk == NULL || g_img_chunk_list.cur_chunk == 0) @@ -1356,7 +1356,7 @@ grub_err_t ventoy_cmd_load_cpio(grub_extcmd_context_t ctxt, int argc, char **arg file = ventoy_grub_file_open(VENTOY_FILE_TYPE, "%s/%s", args[0], VTOY_COMM_CPIO); if (!file) { - return grub_error(GRUB_ERR_BAD_ARGUMENT, "Can't open file %s/%s\n", args[0], VTOY_COMM_CPIO); + return grub_error(GRUB_ERR_BAD_ARGUMENT, "Can't open file %s/%s\n", args[0], VTOY_COMM_CPIO); } archfile = ventoy_grub_file_open(VENTOY_FILE_TYPE, "%s/%s", args[0], VTOY_ARCH_CPIO); @@ -1385,9 +1385,9 @@ grub_err_t ventoy_cmd_load_cpio(grub_extcmd_context_t ctxt, int argc, char **arg template_file = ventoy_plugin_get_cur_install_template(args[1], &template_node); if (template_file) { - debug("auto install template: <%s> \n", + debug("auto install template: <%s> \n", template_file, template_node->filebuf, template_node->filelen); - + template_size = template_node->filelen; template_buf = grub_malloc(template_size); if (template_buf) @@ -1436,7 +1436,7 @@ grub_err_t ventoy_cmd_load_cpio(grub_extcmd_context_t ctxt, int argc, char **arg { if (dudnode->files[i].size > 0) { - dud_size += dudnode->files[i].size + sizeof(cpio_newc_header); + dud_size += dudnode->files[i].size + sizeof(cpio_newc_header); } } } @@ -1445,7 +1445,7 @@ grub_err_t ventoy_cmd_load_cpio(grub_extcmd_context_t ctxt, int argc, char **arg debug("dud not configed %s\n", args[1]); } - g_ventoy_cpio_buf = grub_malloc(file->size + archfile->size + 40960 + template_size + + g_ventoy_cpio_buf = grub_malloc(file->size + archfile->size + 40960 + template_size + persistent_size + injection_size + dud_size + img_chunk_size); if (NULL == g_ventoy_cpio_buf) { @@ -1569,7 +1569,7 @@ grub_err_t ventoy_cmd_trailer_cpio(grub_extcmd_context_t ctxt, int argc, char ** 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x42, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x54, 0x52, - 0x41, 0x49, 0x4C, 0x45, 0x52, 0x21, 0x21, 0x21, 0x00, 0x00, 0x00, 0x00 + 0x41, 0x49, 0x4C, 0x45, 0x52, 0x21, 0x21, 0x21, 0x00, 0x00, 0x00, 0x00 }; (void)ctxt; @@ -1626,7 +1626,7 @@ grub_err_t ventoy_cmd_trailer_cpio(grub_extcmd_context_t ctxt, int argc, char ** offset = ventoy_align(offset, 4); offset += ventoy_cpio_newc_get_int(head->c_filesize); offset = ventoy_align(offset, 4); - + head = (cpio_newc_header *)((char *)head + offset); name = (char *)(head + 1); } @@ -1654,7 +1654,7 @@ grub_err_t ventoy_cmd_linux_chain_data(grub_extcmd_context_t ctxt, int argc, cha const char *pLastChain = NULL; const char *compatible; ventoy_chain_head *chain; - + (void)ctxt; (void)argc; @@ -1705,12 +1705,12 @@ grub_err_t ventoy_cmd_linux_chain_data(grub_extcmd_context_t ctxt, int argc, cha } } } - + img_chunk_size = g_img_chunk_list.cur_chunk * sizeof(ventoy_img_chunk); override_count = ventoy_linux_get_override_chunk_count(); virt_chunk_count = ventoy_linux_get_virt_chunk_count(); - + if (ventoy_compatible) { size = sizeof(ventoy_chain_head) + img_chunk_size; @@ -1721,7 +1721,7 @@ grub_err_t ventoy_cmd_linux_chain_data(grub_extcmd_context_t ctxt, int argc, cha virt_chunk_size = ventoy_linux_get_virt_chunk_size(); size = sizeof(ventoy_chain_head) + img_chunk_size + override_size + virt_chunk_size; } - + pLastChain = grub_env_get("vtoy_chain_mem_addr"); if (pLastChain) { @@ -1778,12 +1778,12 @@ grub_err_t ventoy_cmd_linux_chain_data(grub_extcmd_context_t ctxt, int argc, cha { chain->override_chunk_offset = chain->img_chunk_offset + img_chunk_size; chain->override_chunk_num = override_count; - ventoy_linux_fill_override_data(isosize, (char *)chain + chain->override_chunk_offset); + ventoy_linux_fill_override_data(isosize, (char *)chain + chain->override_chunk_offset); } /* part 5: virt chunk */ if (virt_chunk_count > 0) - { + { chain->virt_chunk_offset = chain->override_chunk_offset + override_size; chain->virt_chunk_num = virt_chunk_count; ventoy_linux_fill_virt_data(isosize, chain); @@ -1807,14 +1807,14 @@ static char *ventoy_systemd_conf_tag(char *buf, const char *tag, int optional) if (grub_strncmp(start, tag, taglen) == 0 && (start[taglen] == ' ' || start[taglen] == '\t')) { start += taglen; - VTOY_SKIP_SPACE(start); + VTOY_SKIP_SPACE(start); return start; } } if (optional == 0) { - debug("tag<%s> NOT found\n", tag); + debug("tag<%s> NOT found\n", tag); } return NULL; } @@ -1874,7 +1874,7 @@ static int ventoy_systemd_conf_hook(const char *filename, const struct grub_dirh tag = ventoy_systemd_conf_tag(filebuf, "options", 0); vtoy_len_ssprintf(ctx->buf, ctx->pos, ctx->len, "%s \n", tag ? tag : ""); - + /* initrd xxx xxx xxx */ vtoy_len_ssprintf(ctx->buf, ctx->pos, ctx->len, " echo \"Downloading initrd ...\"\n initrd "); grub_memcpy(filebuf, bkbuf, file->size); @@ -1900,7 +1900,7 @@ grub_err_t ventoy_cmd_linux_systemd_menu(grub_extcmd_context_t ctxt, int argc, c char *device_name = NULL; grub_device_t dev = NULL; systemd_menu_ctx ctx; - + (void)ctxt; (void)argc; @@ -1910,7 +1910,7 @@ grub_err_t ventoy_cmd_linux_systemd_menu(grub_extcmd_context_t ctxt, int argc, c if (!buf) { goto end; - } + } } device_name = grub_file_get_device_name(args[0]); @@ -1924,7 +1924,7 @@ grub_err_t ventoy_cmd_linux_systemd_menu(grub_extcmd_context_t ctxt, int argc, c if (!dev) { debug("failed to open device %s\n", device_name); - goto end; + goto end; } fs = grub_fs_probe(dev); @@ -1983,7 +1983,7 @@ grub_err_t ventoy_cmd_linux_limine_menu(grub_extcmd_context_t ctxt, int argc, ch char *initrd = NULL; char *param = NULL; static char *buf = NULL; - + (void)ctxt; (void)argc; @@ -1993,14 +1993,14 @@ grub_err_t ventoy_cmd_linux_limine_menu(grub_extcmd_context_t ctxt, int argc, ch if (!buf) { goto end; - } + } } title = buf + len; kernel = title + 1024; initrd = kernel + 1024; param = initrd + 1024; - + file = ventoy_grub_file_open(VENTOY_FILE_TYPE, args[0]); if (!file) { @@ -2016,7 +2016,7 @@ grub_err_t ventoy_cmd_linux_limine_menu(grub_extcmd_context_t ctxt, int argc, ch grub_file_read(file, filebuf, file->size); grub_file_close(file); - + title[0] = kernel[0] = initrd[0] = param[0] = 0; for (start = filebuf; start; start = nextline) { @@ -2045,7 +2045,7 @@ grub_err_t ventoy_cmd_linux_limine_menu(grub_extcmd_context_t ctxt, int argc, ch } else { - grub_snprintf(title, 1024, "%s", start + 1); + grub_snprintf(title, 1024, "%s", start + 1); } } } @@ -2066,12 +2066,12 @@ grub_err_t ventoy_cmd_linux_limine_menu(grub_extcmd_context_t ctxt, int argc, ch { ventoy_limine_path_convert(kernel); ventoy_limine_path_convert(initrd); - + vtoy_len_ssprintf(buf, pos, len, "menuentry \"%s\" {\n", title); vtoy_len_ssprintf(buf, pos, len, " echo \"Downloading kernel ...\"\n linux %s %s\n", kernel, param); vtoy_len_ssprintf(buf, pos, len, " echo \"Downloading initrd ...\"\n initrd %s\n", initrd); vtoy_len_ssprintf(buf, pos, len, "}\n"); - + title[0] = kernel[0] = initrd[0] = param[0] = 0; } } diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_plugin.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_plugin.c index 8a95b33b260..3182678632d 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_plugin.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_plugin.c @@ -1,5 +1,5 @@ /****************************************************************************** - * ventoy_plugin.c + * ventoy_plugin.c * * Copyright (c) 2020, longpanda * @@ -7,12 +7,12 @@ * 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 . * @@ -111,13 +111,13 @@ static int ventoy_plugin_control_check(VTOY_JSON *json, const char *isodisk) if (pChild->enDataType == JSON_TYPE_STRING) { if (grub_strcmp(pChild->pcName, "VTOY_DEFAULT_IMAGE") == 0) - { + { grub_printf("%s: %s [%s]\n", pChild->pcName, pChild->unData.pcStrVal, ventoy_check_file_exist("%s%s", isodisk, pChild->unData.pcStrVal) ? "OK" : "NOT EXIST"); } else { - grub_printf("%s: %s\n", pChild->pcName, pChild->unData.pcStrVal); + grub_printf("%s: %s\n", pChild->pcName, pChild->unData.pcStrVal); } } else @@ -169,7 +169,7 @@ static int ventoy_plugin_theme_check(VTOY_JSON *json, const char *isodisk) int exist = 0; const char *value; VTOY_JSON *node; - + value = vtoy_json_get_string_ex(json->pstChild, "file"); if (value) { @@ -182,7 +182,7 @@ static int ventoy_plugin_theme_check(VTOY_JSON *json, const char *isodisk) { exist = ventoy_check_file_exist("%s/ventoy/%s", isodisk, value); } - + if (exist == 0) { grub_printf("Theme file %s does NOT exist\n", value); @@ -221,13 +221,13 @@ static int ventoy_plugin_theme_check(VTOY_JSON *json, const char *isodisk) } } } - + value = vtoy_json_get_string_ex(json->pstChild, "gfxmode"); if (value) { grub_printf("gfxmode: %s\n", value); } - + value = vtoy_json_get_string_ex(json->pstChild, "display_mode"); if (value) { @@ -245,13 +245,13 @@ static int ventoy_plugin_theme_check(VTOY_JSON *json, const char *isodisk) { grub_printf("ventoy_left: %s\n", value); } - + value = vtoy_json_get_string_ex(json->pstChild, "ventoy_top"); if (value) { grub_printf("ventoy_top: %s\n", value); } - + value = vtoy_json_get_string_ex(json->pstChild, "ventoy_color"); if (value) { @@ -304,7 +304,7 @@ static int ventoy_plugin_theme_entry(VTOY_JSON *json, const char *isodisk) { grub_snprintf(filepath, sizeof(filepath), "%s/ventoy/%s", isodisk, value); } - + if (ventoy_check_file_exist(filepath) == 0) { debug("Theme file %s does not exist\n", filepath); @@ -391,27 +391,27 @@ static int ventoy_plugin_theme_entry(VTOY_JSON *json, const char *isodisk) grub_snprintf(val, sizeof(val), "%d", g_theme_res_fit); ventoy_env_export("vtoy_res_fit", val); } - + if (g_theme_id > g_theme_num || g_theme_id < 0) { g_theme_id = 0; } } - + value = vtoy_json_get_string_ex(json->pstChild, "gfxmode"); if (value) { debug("vtoy_gfxmode %s\n", value); ventoy_env_export("vtoy_gfxmode", value); } - + value = vtoy_json_get_string_ex(json->pstChild, "display_mode"); if (value) { debug("display_mode %s\n", value); ventoy_env_export("vtoy_display_mode", value); } - + value = vtoy_json_get_string_ex(json->pstChild, "serial_param"); if (value) { @@ -424,13 +424,13 @@ static int ventoy_plugin_theme_entry(VTOY_JSON *json, const char *isodisk) { ventoy_env_export(ventoy_left_key, value); } - + value = vtoy_json_get_string_ex(json->pstChild, "ventoy_top"); if (value) { ventoy_env_export(ventoy_top_key, value); } - + value = vtoy_json_get_string_ex(json->pstChild, "ventoy_color"); if (value) { @@ -442,7 +442,7 @@ static int ventoy_plugin_theme_entry(VTOY_JSON *json, const char *isodisk) { for (node = node->pstChild; node; node = node->pstNext) { - if (node->enDataType == JSON_TYPE_STRING && + if (node->enDataType == JSON_TYPE_STRING && ventoy_check_file_exist("%s%s", isodisk, node->unData.pcStrVal)) { grub_snprintf(filepath, sizeof(filepath), "%s%s", isodisk, node->unData.pcStrVal); @@ -467,7 +467,7 @@ static int ventoy_plugin_check_path(const char *path, const char *file) grub_printf("%s contains invalid '\\' \n", file); return 1; } - + if (grub_strstr(file, "//")) { grub_printf("%s contains invalid double slash\n", file); @@ -491,8 +491,8 @@ static int ventoy_plugin_check_path(const char *path, const char *file) static int ventoy_plugin_check_fullpath ( - VTOY_JSON *json, - const char *isodisk, + VTOY_JSON *json, + const char *isodisk, const char *key, int *pathnum ) @@ -502,7 +502,7 @@ static int ventoy_plugin_check_fullpath int cnt = 0; VTOY_JSON *node = json; VTOY_JSON *child = NULL; - + while (node) { if (0 == grub_strcmp(key, node->pcName)) @@ -547,9 +547,9 @@ static int ventoy_plugin_check_fullpath static int ventoy_plugin_parse_fullpath ( - VTOY_JSON *json, - const char *isodisk, - const char *key, + VTOY_JSON *json, + const char *isodisk, + const char *key, file_fullpath **fullpath, int *pathnum ) @@ -559,7 +559,7 @@ static int ventoy_plugin_parse_fullpath VTOY_JSON *node = json; VTOY_JSON *child = NULL; file_fullpath *path = NULL; - + while (node) { if (0 == grub_strcmp(key, node->pcName)) @@ -583,7 +583,7 @@ static int ventoy_plugin_parse_fullpath debug("%s%s file not found\n", isodisk, node->unData.pcStrVal); return 1; } - + path = (file_fullpath *)grub_zalloc(sizeof(file_fullpath)); if (path) { @@ -605,12 +605,12 @@ static int ventoy_plugin_parse_fullpath count++; } debug("%s is array type data, count=%d\n", node->pcName, count); - + path = (file_fullpath *)grub_zalloc(sizeof(file_fullpath) * count); if (path) { *fullpath = path; - + for (count = 0, child = node->pstChild; child; child = child->pstNext) { if (ventoy_check_file_exist("%s%s", isodisk, child->unData.pcStrVal)) @@ -650,15 +650,15 @@ static int ventoy_plugin_auto_install_check(VTOY_JSON *json, const char *isodisk { grub_printf("NOT object type\n"); } - + if ((iso = vtoy_json_get_string_ex(pNode->pstChild, "image")) != NULL) { pos = grub_strchr(iso, '*'); if (pos || 0 == ventoy_plugin_check_path(isodisk, iso)) { - grub_printf("image: %s [%s]\n", iso, (pos ? "*" : "OK")); + grub_printf("image: %s [%s]\n", iso, (pos ? "*" : "OK")); ventoy_plugin_check_fullpath(pNode->pstChild, isodisk, "template", &pathnum); - + if (JSON_SUCCESS == vtoy_json_get_int(pNode->pstChild, "autosel", &autosel)) { if (autosel >= 0 && autosel <= pathnum) @@ -670,7 +670,7 @@ static int ventoy_plugin_auto_install_check(VTOY_JSON *json, const char *isodisk grub_printf("autosel: %d [FAIL]\n", autosel); } } - + if (JSON_SUCCESS == vtoy_json_get_int(pNode->pstChild, "timeout", &timeout)) { if (timeout >= 0) @@ -694,7 +694,7 @@ static int ventoy_plugin_auto_install_check(VTOY_JSON *json, const char *isodisk { grub_printf("parent: %s [OK]\n", iso); ventoy_plugin_check_fullpath(pNode->pstChild, isodisk, "template", &pathnum); - + if (JSON_SUCCESS == vtoy_json_get_int(pNode->pstChild, "autosel", &autosel)) { if (autosel >= 0 && autosel <= pathnum) @@ -706,7 +706,7 @@ static int ventoy_plugin_auto_install_check(VTOY_JSON *json, const char *isodisk grub_printf("autosel: %d [FAIL]\n", autosel); } } - + if (JSON_SUCCESS == vtoy_json_get_int(pNode->pstChild, "timeout", &timeout)) { if (timeout >= 0) @@ -772,7 +772,7 @@ static int ventoy_plugin_auto_install_entry(VTOY_JSON *json, const char *isodisk type = auto_install_type_parent; iso = vtoy_json_get_string_ex(pNode->pstChild, "parent"); } - + if (iso && iso[0] == '/') { if (0 == ventoy_plugin_parse_fullpath(pNode->pstChild, isodisk, "template", &templatepath, &pathnum)) @@ -794,7 +794,7 @@ static int ventoy_plugin_auto_install_entry(VTOY_JSON *json, const char *isodisk node->autosel = autosel; } } - + if (JSON_SUCCESS == vtoy_json_get_int(pNode->pstChild, "timeout", &timeout)) { if (timeout >= 0) @@ -807,7 +807,7 @@ static int ventoy_plugin_auto_install_entry(VTOY_JSON *json, const char *isodisk { node->next = g_install_template_head; } - + g_install_template_head = node; } } @@ -836,7 +836,7 @@ static int ventoy_plugin_dud_check(VTOY_JSON *json, const char *isodisk) { grub_printf("NOT object type\n"); } - + iso = vtoy_json_get_string_ex(pNode->pstChild, "image"); if (iso) { @@ -908,7 +908,7 @@ static int ventoy_plugin_dud_entry(VTOY_JSON *json, const char *isodisk) { node->next = g_dud_head; } - + g_dud_head = node; } else @@ -931,7 +931,7 @@ static int ventoy_plugin_parse_pwdstr(char *pwdstr, vtoy_password *pwd) char *pos; char bytes[3]; vtoy_password tmpPwd; - + len = (int)grub_strlen(pwdstr); if (len > 64) { @@ -955,7 +955,7 @@ static int ventoy_plugin_parse_pwdstr(char *pwdstr, vtoy_password *pwd) bytes[0] = pwdstr[4 + i * 2]; bytes[1] = pwdstr[4 + i * 2 + 1]; bytes[2] = 0; - + if (grub_isxdigit(bytes[0]) && grub_isxdigit(bytes[1])) { tmpPwd.md5[i] = (grub_uint8_t)grub_strtoul(bytes, NULL, 16); @@ -982,7 +982,7 @@ static int ventoy_plugin_parse_pwdstr(char *pwdstr, vtoy_password *pwd) if (NULL == pwd) grub_printf("Invalid md5 salt password format %s\n", pwdstr); return 1; } - + ch = *pos; *pos = 0; grub_snprintf(tmpPwd.salt, sizeof(tmpPwd.salt), "%s", pwdstr + 4); @@ -994,7 +994,7 @@ static int ventoy_plugin_parse_pwdstr(char *pwdstr, vtoy_password *pwd) bytes[0] = pos[i * 2]; bytes[1] = pos[i * 2 + 1]; bytes[2] = 0; - + if (grub_isxdigit(bytes[0]) && grub_isxdigit(bytes[1])) { tmpPwd.md5[i] = (grub_uint8_t)grub_strtoul(bytes, NULL, 16); @@ -1038,10 +1038,10 @@ static int ventoy_plugin_get_pwd_type(const char *pwd) grub_snprintf(pwdtype, sizeof(pwdtype), "%spwd", g_menu_prefix[i]); if (grub_strcmp(pwdtype, pwd) == 0) { - return img_type_start + i; + return img_type_start + i; } } - + return -1; } @@ -1099,9 +1099,9 @@ static int ventoy_plugin_pwd_entry(VTOY_JSON *json, const char *isodisk) if (!iso) { type = vtoy_menu_pwd_parent; - iso = vtoy_json_get_string_ex(pCNode->pstChild, "parent"); - } - + iso = vtoy_json_get_string_ex(pCNode->pstChild, "parent"); + } + pwd = vtoy_json_get_string_ex(pCNode->pstChild, "pwd"); if (iso && pwd && iso[0] == '/') { @@ -1259,7 +1259,7 @@ static int ventoy_plugin_persistence_check(VTOY_JSON *json, const char *isodisk) { grub_printf("NOT object type\n"); } - + iso = vtoy_json_get_string_ex(pNode->pstChild, "image"); if (iso) { @@ -1280,7 +1280,7 @@ static int ventoy_plugin_persistence_check(VTOY_JSON *json, const char *isodisk) grub_printf("autosel: %d [FAIL]\n", autosel); } } - + if (JSON_SUCCESS == vtoy_json_get_int(pNode->pstChild, "timeout", &timeout)) { if (timeout >= 0) @@ -1292,7 +1292,7 @@ static int ventoy_plugin_persistence_check(VTOY_JSON *json, const char *isodisk) grub_printf("timeout: %d [FAIL]\n", timeout); } } - } + } else { grub_printf("image: %s [FAIL]\n", iso); @@ -1361,7 +1361,7 @@ static int ventoy_plugin_persistence_entry(VTOY_JSON *json, const char *isodisk) node->autosel = autosel; } } - + if (JSON_SUCCESS == vtoy_json_get_int(pNode->pstChild, "timeout", &timeout)) { if (timeout >= 0) @@ -1374,7 +1374,7 @@ static int ventoy_plugin_persistence_entry(VTOY_JSON *json, const char *isodisk) { node->next = g_persistence_head; } - + g_persistence_head = node; } } @@ -1408,7 +1408,7 @@ static int ventoy_plugin_menualias_check(VTOY_JSON *json, const char *isodisk) path = vtoy_json_get_string_ex(pNode->pstChild, "dir"); type = vtoy_alias_directory; } - + alias = vtoy_json_get_string_ex(pNode->pstChild, "alias"); if (path && path[0] == '/' && alias) { @@ -1483,7 +1483,7 @@ static int ventoy_plugin_menualias_entry(VTOY_JSON *json, const char *isodisk) path = vtoy_json_get_string_ex(pNode->pstChild, "dir"); type = vtoy_alias_directory; } - + alias = vtoy_json_get_string_ex(pNode->pstChild, "alias"); if (path && path[0] == '/' && alias) { @@ -1498,7 +1498,7 @@ static int ventoy_plugin_menualias_entry(VTOY_JSON *json, const char *isodisk) { node->next = g_menu_alias_head; } - + g_menu_alias_head = node; } } @@ -1527,13 +1527,13 @@ static int ventoy_plugin_menutip_check(VTOY_JSON *json, const char *isodisk) { grub_printf("left: <%s>\n", tip); } - + tip = vtoy_json_get_string_ex(json->pstChild, "top"); if (tip) { grub_printf("top: <%s>\n", tip); } - + tip = vtoy_json_get_string_ex(json->pstChild, "color"); if (tip) { @@ -1550,7 +1550,7 @@ static int ventoy_plugin_menutip_check(VTOY_JSON *json, const char *isodisk) path = vtoy_json_get_string_ex(pNode->pstChild, "dir"); type = vtoy_tip_directory; } - + if (path && path[0] == '/') { if (vtoy_tip_image_file == type) @@ -1592,7 +1592,7 @@ static int ventoy_plugin_menutip_check(VTOY_JSON *json, const char *isodisk) grub_printf("tip1: <%s>\n", tip); else grub_printf("tip1: \n"); - + tip = vtoy_json_get_string_ex(pNode->pstChild, "tip2"); if (tip) grub_printf("tip2: <%s>\n", tip); @@ -1649,13 +1649,13 @@ static int ventoy_plugin_menutip_entry(VTOY_JSON *json, const char *isodisk) { grub_env_set("VTOY_TIP_LEFT", tip); } - + tip = vtoy_json_get_string_ex(json->pstChild, "top"); if (tip) { grub_env_set("VTOY_TIP_TOP", tip); } - + tip = vtoy_json_get_string_ex(json->pstChild, "color"); if (tip) { @@ -1671,7 +1671,7 @@ static int ventoy_plugin_menutip_entry(VTOY_JSON *json, const char *isodisk) path = vtoy_json_get_string_ex(pNode->pstChild, "dir"); type = vtoy_tip_directory; } - + if (path && path[0] == '/') { node = grub_zalloc(sizeof(menu_tip)); @@ -1700,7 +1700,7 @@ static int ventoy_plugin_menutip_entry(VTOY_JSON *json, const char *isodisk) { node->next = g_menu_tip_head; } - + g_menu_tip_head = node; } } @@ -1754,12 +1754,12 @@ static int ventoy_plugin_injection_check(VTOY_JSON *json, const char *isodisk) } else { - grub_printf("image: <%s> [%s]\n", path, ventoy_check_file_exist("%s%s", isodisk, path) ? "OK" : "NOT EXIST"); + grub_printf("image: <%s> [%s]\n", path, ventoy_check_file_exist("%s%s", isodisk, path) ? "OK" : "NOT EXIST"); } } else { - grub_printf("parent: <%s> [%s]\n", path, + grub_printf("parent: <%s> [%s]\n", path, ventoy_is_dir_exist("%s%s", isodisk, path) ? "OK" : "NOT EXIST"); } @@ -1806,7 +1806,7 @@ static int ventoy_plugin_injection_entry(VTOY_JSON *json, const char *isodisk) type = injection_type_parent; path = vtoy_json_get_string_ex(pNode->pstChild, "parent"); } - + archive = vtoy_json_get_string_ex(pNode->pstChild, "archive"); if (path && path[0] == '/' && archive && archive[0] == '/') { @@ -1821,7 +1821,7 @@ static int ventoy_plugin_injection_entry(VTOY_JSON *json, const char *isodisk) { node->next = g_injection_head; } - + g_injection_head = node; } } @@ -1878,7 +1878,7 @@ static int ventoy_plugin_menuclass_entry(VTOY_JSON *json, const char *isodisk) type = vtoy_class_directory; } } - + class = vtoy_json_get_string_ex(pNode->pstChild, "class"); if (key && class) { @@ -1931,11 +1931,11 @@ static int ventoy_plugin_menuclass_check(VTOY_JSON *json, const char *isodisk) key = vtoy_json_get_string_ex(pNode->pstChild, "parent"); if (!key) { - name = "dir"; - key = vtoy_json_get_string_ex(pNode->pstChild, "dir"); + name = "dir"; + key = vtoy_json_get_string_ex(pNode->pstChild, "dir"); } } - + class = vtoy_json_get_string_ex(pNode->pstChild, "class"); if (key && class) { @@ -1986,7 +1986,7 @@ static int ventoy_plugin_custom_boot_entry(VTOY_JSON *json, const char *isodisk) key = vtoy_json_get_string_ex(pNode->pstChild, "dir"); type = vtoy_custom_boot_directory; } - + cfg = vtoy_json_get_string_ex(pNode->pstChild, "vcfg"); if (key && cfg) { @@ -2042,10 +2042,10 @@ static int ventoy_plugin_custom_boot_check(VTOY_JSON *json, const char *isodisk) key = vtoy_json_get_string_ex(pNode->pstChild, "file"); if (!key) { - key = vtoy_json_get_string_ex(pNode->pstChild, "dir"); + key = vtoy_json_get_string_ex(pNode->pstChild, "dir"); type = vtoy_custom_boot_directory; } - + cfg = vtoy_json_get_string_ex(pNode->pstChild, "vcfg"); len = (int)grub_strlen(cfg); if (key && cfg) @@ -2057,7 +2057,7 @@ static int ventoy_plugin_custom_boot_check(VTOY_JSON *json, const char *isodisk) else { grub_printf("%s: <%s>\n", (type == vtoy_custom_boot_directory) ? "dir" : "file", key); - grub_printf("vcfg: <%s>\n\n", cfg); + grub_printf("vcfg: <%s>\n\n", cfg); } } } @@ -2158,7 +2158,7 @@ static int ventoy_plugin_conf_replace_check(VTOY_JSON *json, const char *isodisk if (ventoy_check_file_exist("%s%s", isodisk, isof)) { grub_printf("iso:<%s> [OK]\n", isof); - + grub_snprintf(cmd, sizeof(cmd), "loopback vtisocheck \"%s%s\"", isodisk, isof); grub_script_execute_sourcecode(cmd); @@ -2179,7 +2179,7 @@ static int ventoy_plugin_conf_replace_check(VTOY_JSON *json, const char *isodisk { grub_printf("org:<%s> [NOT Exist]\n", orgf); } - + grub_script_execute_sourcecode("loopback -d vtisocheck"); } else if (grub_strchr(isof, '*')) @@ -2202,20 +2202,20 @@ static int ventoy_plugin_conf_replace_check(VTOY_JSON *json, const char *isodisk } else { - grub_printf("new1:<%s> [OK]\n", newf); + grub_printf("new1:<%s> [OK]\n", newf); } grub_file_close(file); } else { - 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("img:<%d>\n", img); } - + grub_printf("\n"); } } @@ -2261,7 +2261,7 @@ static int ventoy_plugin_auto_memdisk_entry(VTOY_JSON *json, const char *isodisk { node->next = g_auto_memdisk_head; } - + g_auto_memdisk_head = node; } } @@ -2398,7 +2398,7 @@ static int ventoy_plugin_image_list_check(VTOY_JSON *json, const char *isodisk) return 0; } -static plugin_entry g_plugin_entries[] = +static plugin_entry g_plugin_entries[] = { { "control", ventoy_plugin_control_entry, ventoy_plugin_control_check, 0 }, { "theme", ventoy_plugin_theme_entry, ventoy_plugin_theme_check, 0 }, @@ -2440,7 +2440,7 @@ static int ventoy_parse_plugin_config(VTOY_JSON *json, const char *isodisk) } } - + for (cur = json; cur; cur = cur->pstNext) { for (i = 0; i < (int)ARRAY_SIZE(g_plugin_entries); i++) @@ -2466,7 +2466,7 @@ grub_err_t ventoy_cmd_load_plugin(grub_extcmd_context_t ctxt, int argc, char **a grub_uint8_t *code = NULL; grub_file_t file; VTOY_JSON *json = NULL; - + (void)ctxt; (void)argc; @@ -2489,7 +2489,7 @@ grub_err_t ventoy_cmd_load_plugin(grub_extcmd_context_t ctxt, int argc, char **a grub_file_close(file); return 1; } - + buf[file->size] = 0; grub_file_read(file, buf, file->size); grub_file_close(file); @@ -2517,13 +2517,13 @@ grub_err_t ventoy_cmd_load_plugin(grub_extcmd_context_t ctxt, int argc, char **a grub_free(buf); return 1; } - + ret = vtoy_json_parse(json, buf + offset); if (ret) { grub_env_set("VTOY_PLUGIN_SYNTAX_ERROR", "1"); grub_env_export("VTOY_PLUGIN_SYNTAX_ERROR"); - + debug("Failed to parse json string %d\n", ret); grub_free(buf); return 1; @@ -2536,7 +2536,7 @@ grub_err_t ventoy_cmd_load_plugin(grub_extcmd_context_t ctxt, int argc, char **a grub_free(buf); if (g_boot_pwd.type) - { + { grub_printf("\n\n======= %s ======\n\n", grub_env_get("VTOY_TEXT_MENU_VER")); if (ventoy_check_password(&g_boot_pwd, 3)) { @@ -2580,12 +2580,12 @@ void ventoy_plugin_dump_auto_install(void) for (node = g_install_template_head; node; node = node->next) { - grub_printf("\n%s:<%s> <%d>\n", + grub_printf("\n%s:<%s> <%d>\n", (node->type == auto_install_type_file) ? "IMAGE" : "PARENT", node->isopath, node->templatenum); for (i = 0; i < node->templatenum; i++) { - grub_printf("SCRIPT %d:<%s>\n", i, node->templatepath[i].path); + grub_printf("SCRIPT %d:<%s>\n", i, node->templatepath[i].path); } } @@ -2605,7 +2605,7 @@ void ventoy_plugin_dump_persistence(void) for (i = 0; i < node->backendnum; i++) { - grub_printf("PERSIST %d:<%s>", i, node->backendpath[i].path); + grub_printf("PERSIST %d:<%s>", i, node->backendpath[i].path); rc = ventoy_plugin_get_persistent_chunklist(node->isopath, i, &chunk_list); if (rc == 0) { @@ -2643,7 +2643,7 @@ install_template * ventoy_plugin_find_install_template(const char *isopath) } } } - + for (node = g_install_template_head; node; node = node->next) { if (node->type == auto_install_type_parent) @@ -2744,7 +2744,7 @@ int ventoy_plugin_get_persistent_chunklist(const char *isopath, int index, vento node->backendpath[index].vlnk_add = 1; } } - + file = ventoy_grub_file_open(VENTOY_FILE_TYPE, "%s%s", g_iso_disk_name, path); if (!file) { @@ -2758,13 +2758,13 @@ int ventoy_plugin_get_persistent_chunklist(const char *isopath, int index, vento { goto end; } - + chunk_list->max_chunk = DEFAULT_CHUNK_NUM; chunk_list->cur_chunk = 0; start = file->device->disk->partition->start; ventoy_get_block_list(file, chunk_list, start); - + if (0 != ventoy_check_block_list(file, chunk_list, start)) { grub_free(chunk_list->chunk); @@ -2802,7 +2802,7 @@ const char * ventoy_plugin_get_injection(const char *isopath) } } } - + for (node = g_injection_head; node; node = node->next) { if (node->type == injection_type_parent) @@ -2830,7 +2830,7 @@ const char * ventoy_plugin_get_menu_alias(int type, const char *isopath) len = (int)grub_strlen(isopath); for (node = g_menu_alias_head; node; node = node->next) { - if (node->type == type && node->pathlen && + if (node->type == type && node->pathlen && node->pathlen == len && ventoy_strcmp(node->isopath, isopath) == 0) { return node->alias; @@ -2853,7 +2853,7 @@ const menu_tip * ventoy_plugin_get_menu_tip(int type, const char *isopath) len = (int)grub_strlen(isopath); for (node = g_menu_tip_head; node; node = node->next) { - if (node->type == type && node->pathlen && + if (node->type == type && node->pathlen && node->pathlen == len && ventoy_strcmp(node->isopath, isopath) == 0) { return node; @@ -2873,10 +2873,10 @@ const char * ventoy_plugin_get_menu_class(int type, const char *name, const char { return NULL; } - - namelen = (int)grub_strlen(name); - pathlen = (int)grub_strlen(path); - + + namelen = (int)grub_strlen(name); + pathlen = (int)grub_strlen(path); + if (vtoy_class_image_file == type) { for (node = g_menu_class_head; node; node = node->next) @@ -2894,7 +2894,7 @@ const char * ventoy_plugin_get_menu_class(int type, const char *name, const char } } } - + for (node = g_menu_class_head; node; node = node->next) { if (node->type != type) @@ -2929,7 +2929,7 @@ int ventoy_plugin_add_custom_boot(const char *vcfgpath) { int len; custom_boot *node = NULL; - + node = grub_zalloc(sizeof(custom_boot)); if (node) { @@ -2948,7 +2948,7 @@ int ventoy_plugin_add_custom_boot(const char *vcfgpath) } g_custom_boot_head = node; } - + return 0; } @@ -2964,19 +2964,19 @@ const char * ventoy_plugin_get_custom_boot(const char *isopath) } len = (int)grub_strlen(isopath); - + for (node = g_custom_boot_head; node; node = node->next) { if (node->type == vtoy_custom_boot_image_file) { if (node->pathlen == len && grub_strncmp(isopath, node->path, len) == 0) { - return node->cfg; + return node->cfg; } } else { - if (node->pathlen < len && isopath[node->pathlen] == '/' && + if (node->pathlen < len && isopath[node->pathlen] == '/' && grub_strncmp(isopath, node->path, node->pathlen) == 0) { for (i = node->pathlen + 1; i < len; i++) @@ -2989,7 +2989,7 @@ const char * ventoy_plugin_get_custom_boot(const char *isopath) if (i >= len) { - return node->cfg; + return node->cfg; } } } @@ -3008,7 +3008,7 @@ grub_err_t ventoy_cmd_dump_custom_boot(grub_extcmd_context_t ctxt, int argc, cha for (node = g_custom_boot_head; node; node = node->next) { - grub_printf("[%s] <%s>:<%s>\n", (node->type == vtoy_custom_boot_directory) ? "dir" : "file", + grub_printf("[%s] <%s>:<%s>\n", (node->type == vtoy_custom_boot_directory) ? "dir" : "file", node->path, node->cfg); } @@ -3025,7 +3025,7 @@ int ventoy_plugin_check_memdisk(const char *isopath) return 0; } - len = (int)grub_strlen(isopath); + len = (int)grub_strlen(isopath); for (node = g_auto_memdisk_head; node; node = node->next) { if (node->pathlen == len && ventoy_strncmp(node->isopath, isopath, len) == 0) @@ -3048,8 +3048,8 @@ int ventoy_plugin_get_image_list_index(int type, const char *name) return 0; } - len = (int)grub_strlen(name); - + len = (int)grub_strlen(name); + for (node = g_image_list_head; node; node = node->next, index++) { if (vtoy_class_directory == type) @@ -3083,7 +3083,7 @@ int ventoy_plugin_find_conf_replace(const char *iso, conf_replace *nodes[VTOY_MA } len = (int)grub_strlen(iso); - + for (node = g_conf_replace_head; node; node = node->next) { if (node->pathlen == len && ventoy_strncmp(node->isopath, iso, len) == 0) @@ -3095,7 +3095,7 @@ int ventoy_plugin_find_conf_replace(const char *iso, conf_replace *nodes[VTOY_MA } } } - + return n; } @@ -3117,7 +3117,7 @@ dud * ventoy_plugin_find_dud(const char *iso) return node; } } - + return NULL; } @@ -3134,16 +3134,16 @@ int ventoy_plugin_load_dud(dud *node, const char *isopart) debug("file %d has been loaded\n", i); continue; } - + file = ventoy_grub_file_open(VENTOY_FILE_TYPE, "%s%s", isopart, node->dudpath[i].path); if (file) { buf = grub_malloc(file->size); if (buf) { - grub_file_read(file, buf, file->size); + grub_file_read(file, buf, file->size); node->files[i].size = (int)file->size; - node->files[i].buf = buf; + node->files[i].buf = buf; } grub_file_close(file); } @@ -3166,7 +3166,7 @@ static const vtoy_password * ventoy_plugin_get_password(const char *isopath) if (g_pwd_head) { - len = (int)grub_strlen(isopath); + len = (int)grub_strlen(isopath); for (node = g_pwd_head; node; node = node->next) { if (node->type == vtoy_menu_pwd_file) @@ -3179,7 +3179,7 @@ static const vtoy_password * ventoy_plugin_get_password(const char *isopath) } for (node = g_pwd_head; node; node = node->next) - { + { if (node->type == vtoy_menu_pwd_parent) { if (node->pathlen < len && ventoy_plugin_is_parent(node->isopath, node->pathlen, isopath)) @@ -3217,7 +3217,7 @@ grub_err_t ventoy_cmd_check_password(grub_extcmd_context_t ctxt, int argc, char { int ret; const vtoy_password *pwd = NULL; - + (void)ctxt; (void)argc; @@ -3251,7 +3251,7 @@ grub_err_t ventoy_cmd_plugin_check_json(grub_extcmd_context_t ctxt, int argc, ch grub_file_t file; VTOY_JSON *node = NULL; VTOY_JSON *json = NULL; - + (void)ctxt; if (argc != 3) @@ -3273,7 +3273,7 @@ grub_err_t ventoy_cmd_plugin_check_json(grub_extcmd_context_t ctxt, int argc, ch grub_printf("Failed to malloc memory %lu.\n", (ulong)(file->size + 1)); goto end; } - + buf[file->size] = 0; grub_file_read(file, buf, file->size); @@ -3313,7 +3313,7 @@ grub_err_t ventoy_cmd_plugin_check_json(grub_extcmd_context_t ctxt, int argc, ch if (!node) { grub_printf("%s is NOT found in ventoy.json\n", args[1]); - goto end; + goto end; } } @@ -3323,12 +3323,12 @@ grub_err_t ventoy_cmd_plugin_check_json(grub_extcmd_context_t ctxt, int argc, ch { if (g_plugin_entries[i].checkfunc) { - ret = g_plugin_entries[i].checkfunc(node, args[2]); + ret = g_plugin_entries[i].checkfunc(node, args[2]); } break; } } - + end: check_free(file, grub_file_close); check_free(json, vtoy_json_destroy); @@ -3365,7 +3365,7 @@ grub_err_t ventoy_cmd_select_theme_cfg(grub_extcmd_context_t ctxt, int argc, cha { return 0; } - + for (node = g_theme_head; node; node = node->next) { name = grub_strstr(node->theme.path, ")/"); @@ -3377,22 +3377,22 @@ grub_err_t ventoy_cmd_select_theme_cfg(grub_extcmd_context_t ctxt, int argc, cha { name = node->theme.path; } - - pos += grub_snprintf(buf + pos, bufsize - pos, + + pos += grub_snprintf(buf + pos, bufsize - pos, "menuentry \"%s\" --class=debug_theme_item --class=debug_theme_select --class=F5tool {\n" "vt_set_theme_path \"%s\"\n" "}\n", name, node->theme.path); } - pos += grub_snprintf(buf + pos, bufsize - pos, + pos += grub_snprintf(buf + pos, bufsize - pos, "menuentry \"$VTLANG_RETURN_PREVIOUS\" --class=vtoyret VTOY_RET {\n" "echo 'Return ...'\n" "}\n"); grub_script_execute_sourcecode(buf); grub_free(buf); - + return 0; } @@ -3421,12 +3421,12 @@ grub_err_t ventoy_cmd_set_theme(grub_extcmd_context_t ctxt, int argc, char **arg } debug("g_theme_num = %d\n", g_theme_num); - + if (g_theme_num == 0) { goto end; } - + if (g_theme_id > 0 && g_theme_id <= g_theme_num) { for (i = 0; i < (grub_uint32_t)(g_theme_id - 1) && node; i++) @@ -3499,10 +3499,10 @@ grub_err_t ventoy_cmd_set_theme(grub_extcmd_context_t ctxt, int argc, char **arg if (argc > 0 && grub_strcmp(args[0], "switch") == 0) { - grub_snprintf(g_ventoy_theme_path, sizeof(g_ventoy_theme_path), "%s", pThemePath[mod]); + grub_snprintf(g_ventoy_theme_path, sizeof(g_ventoy_theme_path), "%s", pThemePath[mod]); } else - { + { debug("random theme %s\n", pThemePath[mod]); grub_env_set("theme", pThemePath[mod]); } @@ -3594,7 +3594,7 @@ int ventoy_plugin_load_menu_lang(int init, const char *lang) { ventoy_menu_push_key(GRUB_TERM_ESC); ventoy_menu_push_key(GRUB_TERM_ESC); - g_ventoy_menu_refresh = 1; + g_ventoy_menu_refresh = 1; } ret = 0; @@ -3619,7 +3619,7 @@ grub_err_t ventoy_cmd_cur_menu_lang(grub_extcmd_context_t ctxt, int argc, char * { grub_printf("%s\n", g_cur_menu_language); grub_printf("%s\n", g_ventoy_hotkey_tip); - grub_refresh(); + grub_refresh(); } VENTOY_CMD_RETURN(0); diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_unix.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_unix.c index 3c6086e6a62..5156bacc7bd 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_unix.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_unix.c @@ -1,5 +1,5 @@ /****************************************************************************** - * ventoy_unix.c + * ventoy_unix.c * * Copyright (c) 2020, longpanda * @@ -7,12 +7,12 @@ * 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 . * @@ -69,9 +69,9 @@ static int ventoy_get_file_override(const char *filename, grub_uint64_t *offset) } *offset = grub_iso9660_get_last_file_dirent_pos(file) + 2; - + grub_file_close(file); - + return 0; } @@ -83,12 +83,12 @@ static grub_uint32_t ventoy_unix_get_override_chunk_count(void) { count++; } - + if (g_mod_new_len > 0) { count++; } - + if (g_ko_fillmap_len > 0) { count += (g_ko_fillmap_len / 512); @@ -109,7 +109,7 @@ static grub_uint32_t ventoy_unix_get_virt_chunk_count(void) { count++; } - + if (g_mod_new_len > 0) { count++; @@ -127,7 +127,7 @@ static grub_uint32_t ventoy_unix_get_virt_chunk_size(void) { size += ventoy_align_2k(g_conf_new_len); } - + if (g_mod_new_len > 0) { size += ventoy_align_2k(g_mod_new_len); @@ -141,9 +141,9 @@ static void ventoy_unix_fill_map_data(ventoy_chain_head *chain, struct g_ventoy_ grub_uint32_t i; ventoy_img_chunk *chunk = NULL; - debug("Fill unix map data: <%llu> <%u> %p\n", + debug("Fill unix map data: <%llu> <%u> %p\n", (unsigned long long)chain->os_param.vtoy_disk_size, g_img_chunk_list.cur_chunk, map); - + map->magic1[0] = map->magic2[0] = VENTOY_UNIX_SEG_MAGIC0; map->magic1[1] = map->magic2[1] = VENTOY_UNIX_SEG_MAGIC1; map->magic1[2] = map->magic2[2] = VENTOY_UNIX_SEG_MAGIC2; @@ -158,12 +158,12 @@ static void ventoy_unix_fill_map_data(ventoy_chain_head *chain, struct g_ventoy_ debug("####[FAIL] Too many segments for the ISO file %u\n", g_img_chunk_list.cur_chunk); map->segnum = VENTOY_UNIX_MAX_SEGNUM; } - + for (i = 0; i < (grub_uint32_t)(map->segnum); i++) { chunk = g_img_chunk_list.chunk + i; map->seglist[i].seg_start_bytes = chunk->disk_start_sector * 512ULL; - map->seglist[i].seg_end_bytes = (chunk->disk_end_sector + 1) * 512ULL; + map->seglist[i].seg_end_bytes = (chunk->disk_end_sector + 1) * 512ULL; } } @@ -176,7 +176,7 @@ static void ventoy_unix_fill_override_data( grub_uint64_t isosize, ventoy_cha grub_uint64_t sector; ventoy_override_chunk *cur; ventoy_iso9660_override *dirent; - + sector = (isosize + 2047) / 2048; cur = (ventoy_override_chunk *)((char *)chain + chain->override_chunk_offset); @@ -215,7 +215,7 @@ static void ventoy_unix_fill_override_data( grub_uint64_t isosize, ventoy_cha offset = g_mod_override_offset; ventoy_unix_fill_map_data(chain, (struct g_ventoy_map *)data); - + for (i = 0; i < g_ko_fillmap_len / 512; i++) { cur->img_offset = offset; @@ -252,7 +252,7 @@ static void ventoy_unix_fill_virt_data( grub_uint64_t isosize, ventoy_chain_h override = (char *)chain + chain->virt_chunk_offset; cur = (ventoy_virt_chunk *)override; - + sector = (isosize + 2047) / 2048; offset = 2 * sizeof(ventoy_virt_chunk); @@ -267,10 +267,10 @@ static void ventoy_unix_fill_virt_data( grub_uint64_t isosize, ventoy_chain_h { ventoy_unix_fill_map_data(chain, (struct g_ventoy_map *)(g_mod_new_data + g_mod_search_magic)); } - + ventoy_unix_fill_virt(g_mod_new_data, g_mod_new_len); } - + return; } @@ -287,7 +287,7 @@ static int ventoy_freebsd_append_conf(char *buf, const char *isopath, const char grub_uint8_t disk_guid[16]; debug("ventoy_freebsd_append_conf %s\n", isopath); - + isofile = ventoy_grub_file_open(VENTOY_FILE_TYPE, "%s", isopath); if (!isofile) { @@ -296,7 +296,7 @@ static int ventoy_freebsd_append_conf(char *buf, const char *isopath, const char vtoy_ssprintf(buf, pos, "ventoy_load=\"%s\"\n", "YES"); vtoy_ssprintf(buf, pos, "ventoy_name=\"%s\"\n", g_ko_mod_path); - + if (alias) { vtoy_ssprintf(buf, pos, "hint.ventoy.0.alias=\"%s\"\n", alias); @@ -320,7 +320,7 @@ static int ventoy_freebsd_append_conf(char *buf, const char *isopath, const char } debug("Fill hint.ventoy info\n"); - + disk = isofile->device->disk; ventoy_get_disk_guid(isofile->name, disk_guid, disk_sig); @@ -338,7 +338,7 @@ static int ventoy_freebsd_append_conf(char *buf, const char *isopath, const char for (i = 0; i < g_img_chunk_list.cur_chunk; i++) { chunk = g_img_chunk_list.chunk + i; - vtoy_ssprintf(buf, pos, "hint.ventoy.%u.seg=\"0x%llx@0x%llx\"\n", + vtoy_ssprintf(buf, pos, "hint.ventoy.%u.seg=\"0x%llx@0x%llx\"\n", i, (ulonglong)(chunk->disk_start_sector * 512), (ulonglong)((chunk->disk_end_sector + 1) * 512)); } @@ -368,7 +368,7 @@ grub_err_t ventoy_cmd_unix_reset(grub_extcmd_context_t ctxt, int argc, char **ar (void)ctxt; (void)argc; (void)args; - + g_unix_vlnk_boot = 0; g_mod_search_magic = 0; g_conf_new_len = 0; @@ -411,7 +411,7 @@ grub_err_t ventoy_cmd_parse_freenas_ver(grub_extcmd_context_t ctxt, int argc, ch const char *ver = NULL; char *buf = NULL; VTOY_JSON *json = NULL; - + (void)ctxt; (void)argc; @@ -472,7 +472,7 @@ grub_err_t ventoy_cmd_unix_freebsd_ver(grub_extcmd_context_t ctxt, int argc, cha char *buf; char *start = NULL; char *nextline = NULL; - + (void)ctxt; (void)argc; (void)args; @@ -502,7 +502,7 @@ grub_err_t ventoy_cmd_unix_freebsd_ver(grub_extcmd_context_t ctxt, int argc, cha nextline++; } - *nextline = 0; + *nextline = 0; break; } nextline = ventoy_get_line(start); @@ -521,7 +521,7 @@ grub_err_t ventoy_cmd_unix_freebsd_ver(grub_extcmd_context_t ctxt, int argc, cha grub_free(buf); grub_file_close(file); - + VENTOY_CMD_RETURN(GRUB_ERR_NONE); } @@ -536,7 +536,7 @@ grub_err_t ventoy_cmd_unix_freebsd_ver_elf(grub_extcmd_context_t ctxt, int argc, char *data = NULL; void *hdr = NULL; char ver[64] = {0}; - + (void)ctxt; (void)argc; (void)args; @@ -567,7 +567,7 @@ grub_err_t ventoy_cmd_unix_freebsd_ver_elf(grub_extcmd_context_t ctxt, int argc, Elf64_Shdr *s; Elf64_Shdr *t; Elf64_Half i; - + h = hdr = grub_zalloc(e->e_shnum * e->e_shentsize); if (!h) { @@ -578,7 +578,7 @@ grub_err_t ventoy_cmd_unix_freebsd_ver_elf(grub_extcmd_context_t ctxt, int argc, grub_file_seek(elf->file, e->e_shoff); grub_file_read(elf->file, h, e->e_shnum * e->e_shentsize); - s = (Elf64_Shdr *)((char *)h + e->e_shstrndx * e->e_shentsize); + s = (Elf64_Shdr *)((char *)h + e->e_shstrndx * e->e_shentsize); str = grub_malloc(s->sh_size + 1); if (!str) { @@ -609,7 +609,7 @@ grub_err_t ventoy_cmd_unix_freebsd_ver_elf(grub_extcmd_context_t ctxt, int argc, Elf32_Shdr *s; Elf32_Shdr *t; Elf32_Half i; - + h = hdr = grub_zalloc(e->e_shnum * e->e_shentsize); if (!h) { @@ -620,7 +620,7 @@ grub_err_t ventoy_cmd_unix_freebsd_ver_elf(grub_extcmd_context_t ctxt, int argc, grub_file_seek(elf->file, e->e_shoff); grub_file_read(elf->file, h, e->e_shnum * e->e_shentsize); - s = (Elf32_Shdr *)((char *)h + e->e_shstrndx * e->e_shentsize); + s = (Elf32_Shdr *)((char *)h + e->e_shstrndx * e->e_shentsize); str = grub_malloc(s->sh_size + 1); if (!str) { @@ -666,7 +666,7 @@ grub_err_t ventoy_cmd_unix_freebsd_ver_elf(grub_extcmd_context_t ctxt, int argc, break; } } - + grub_snprintf(ver, sizeof(ver), "%s", data + j + 12); break; } @@ -689,7 +689,7 @@ grub_err_t ventoy_cmd_unix_freebsd_ver_elf(grub_extcmd_context_t ctxt, int argc, grub_check_free(hdr); grub_check_free(data); check_free(elf, grub_elf_close); - + VENTOY_CMD_RETURN(GRUB_ERR_NONE); } @@ -704,7 +704,7 @@ grub_err_t ventoy_cmd_unix_replace_grub_conf(grub_extcmd_context_t ctxt, int arg grub_file_t file; char extcfg[512]; const char *confile = NULL; - const char * loader_conf[] = + const char * loader_conf[] = { "/boot/grub/grub.cfg", }; @@ -716,7 +716,7 @@ grub_err_t ventoy_cmd_unix_replace_grub_conf(grub_extcmd_context_t ctxt, int arg debug("Replace conf invalid argc %d\n", argc); return 1; } - + for (i = 0; i < sizeof(loader_conf) / sizeof(loader_conf[0]); i++) { if (ventoy_get_file_override(loader_conf[i], &offset) == 0) @@ -728,7 +728,7 @@ grub_err_t ventoy_cmd_unix_replace_grub_conf(grub_extcmd_context_t ctxt, int arg } if (confile == NULL) - { + { debug("Can't find grub.cfg file from %u locations\n", i); return 1; } @@ -745,13 +745,13 @@ grub_err_t ventoy_cmd_unix_replace_grub_conf(grub_extcmd_context_t ctxt, int arg data = grub_malloc(VTOY_MAX_SCRIPT_BUF); if (!data) { - grub_file_close(file); + grub_file_close(file); return 1; } grub_file_read(file, data, file->size); grub_file_close(file); - + g_conf_new_data = data; g_conf_new_len = (int)file->size; @@ -783,7 +783,7 @@ grub_err_t ventoy_cmd_unix_replace_grub_conf(grub_extcmd_context_t ctxt, int arg { vtoy_ssprintf(extcfg, len, ";set kFreeBSD.hint.ventoy.0.remount=%d", 1); } - + grub_memmove(pos + len, pos, (int)(file->size - (pos - data))); grub_memcpy(pos, extcfg, len); g_conf_new_len += len; @@ -792,7 +792,7 @@ grub_err_t ventoy_cmd_unix_replace_grub_conf(grub_extcmd_context_t ctxt, int arg { debug("no kfreebsd found\n"); } - + VENTOY_CMD_RETURN(GRUB_ERR_NONE); } @@ -803,7 +803,7 @@ grub_err_t ventoy_cmd_unix_replace_conf(grub_extcmd_context_t ctxt, int argc, ch grub_uint64_t offset; grub_file_t file; const char *confile = NULL; - const char * loader_conf[] = + const char * loader_conf[] = { "/boot/loader.conf", "/boot/defaults/loader.conf", @@ -816,7 +816,7 @@ grub_err_t ventoy_cmd_unix_replace_conf(grub_extcmd_context_t ctxt, int argc, ch debug("Replace conf invalid argc %d\n", argc); return 1; } - + for (i = 0; i < sizeof(loader_conf) / sizeof(loader_conf[0]); i++) { if (ventoy_get_file_override(loader_conf[i], &offset) == 0) @@ -828,7 +828,7 @@ grub_err_t ventoy_cmd_unix_replace_conf(grub_extcmd_context_t ctxt, int argc, ch } if (confile == NULL) - { + { debug("Can't find loader.conf file from %u locations\n", i); return 1; } @@ -845,13 +845,13 @@ grub_err_t ventoy_cmd_unix_replace_conf(grub_extcmd_context_t ctxt, int argc, ch data = grub_malloc(VTOY_MAX_SCRIPT_BUF); if (!data) { - grub_file_close(file); + grub_file_close(file); return 1; } grub_file_read(file, data, file->size); grub_file_close(file); - + g_conf_new_data = data; g_conf_new_len = (int)file->size; @@ -863,19 +863,19 @@ grub_err_t ventoy_cmd_unix_replace_conf(grub_extcmd_context_t ctxt, int argc, ch { g_conf_new_len += ventoy_dragonfly_append_conf(data + file->size, args[1]); } - + VENTOY_CMD_RETURN(GRUB_ERR_NONE); } static int ventoy_unix_search_magic(char *data, int len) { int i; - grub_uint32_t *magic = NULL; + grub_uint32_t *magic = NULL; for (i = 0; i < len; i += 4096) { magic = (grub_uint32_t *)(data + i); - if (magic[0] == VENTOY_UNIX_SEG_MAGIC0 && magic[1] == VENTOY_UNIX_SEG_MAGIC1 && + if (magic[0] == VENTOY_UNIX_SEG_MAGIC0 && magic[1] == VENTOY_UNIX_SEG_MAGIC1 && magic[2] == VENTOY_UNIX_SEG_MAGIC2 && magic[3] == VENTOY_UNIX_SEG_MAGIC3) { debug("unix find search magic at 0x%x loop:%d\n", i, (i >> 12)); @@ -910,7 +910,7 @@ grub_err_t ventoy_cmd_unix_replace_ko(grub_extcmd_context_t ctxt, int argc, char g_mod_override_offset = offset; } else - { + { debug("Can't find replace ko file from %s\n", args[0]); return 1; } @@ -928,18 +928,18 @@ grub_err_t ventoy_cmd_unix_replace_ko(grub_extcmd_context_t ctxt, int argc, char if (!data) { debug("Failed to alloc memory for new ko %d\n", (int)file->size); - grub_file_close(file); + grub_file_close(file); return 1; } grub_file_read(file, data, file->size); grub_file_close(file); - + g_mod_new_data = data; g_mod_new_len = (int)file->size; ventoy_unix_search_magic(g_mod_new_data, g_mod_new_len); - + VENTOY_CMD_RETURN(GRUB_ERR_NONE); } @@ -967,7 +967,7 @@ grub_err_t ventoy_cmd_unix_ko_fillmap(grub_extcmd_context_t ctxt, int argc, char g_mod_override_offset = grub_iso9660_get_last_read_pos(file); } else - { + { debug("Can't find replace ko file from %s\n", args[0]); return 1; } @@ -977,8 +977,8 @@ grub_err_t ventoy_cmd_unix_ko_fillmap(grub_extcmd_context_t ctxt, int argc, char magic[0] = 0; grub_file_seek(file, i); grub_file_read(file, magic, sizeof(magic)); - - if (magic[0] == VENTOY_UNIX_SEG_MAGIC0 && magic[1] == VENTOY_UNIX_SEG_MAGIC1 && + + if (magic[0] == VENTOY_UNIX_SEG_MAGIC0 && magic[1] == VENTOY_UNIX_SEG_MAGIC1 && magic[2] == VENTOY_UNIX_SEG_MAGIC2 && magic[3] == VENTOY_UNIX_SEG_MAGIC3) { debug("unix find search magic at 0x%x loop:%d\n", i, (i >> 16)); @@ -987,7 +987,7 @@ grub_err_t ventoy_cmd_unix_ko_fillmap(grub_extcmd_context_t ctxt, int argc, char } } - len = (grub_uint32_t)OFFSET_OF(struct g_ventoy_map, seglist) + + len = (grub_uint32_t)OFFSET_OF(struct g_ventoy_map, seglist) + (sizeof(struct g_ventoy_seg) * g_img_chunk_list.cur_chunk); g_ko_fillmap_len = (int)len; @@ -1034,7 +1034,7 @@ grub_err_t ventoy_cmd_unix_fill_image_desc(grub_extcmd_context_t ctxt, int argc, if (grub_memcmp(flag, byte + i, 32) == 0) { debug("Find position flag at %d(0x%x)\n", i, i); - break; + break; } } } @@ -1118,7 +1118,7 @@ grub_err_t ventoy_cmd_unix_chain_data(grub_extcmd_context_t ctxt, int argc, char const char *pLastChain = NULL; const char *compatible; ventoy_chain_head *chain; - + (void)ctxt; (void)argc; @@ -1161,9 +1161,9 @@ grub_err_t ventoy_cmd_unix_chain_data(grub_extcmd_context_t ctxt, int argc, char return grub_error(GRUB_ERR_BAD_ARGUMENT, "File %s is not bootable", args[0]); } } - + img_chunk_size = g_img_chunk_list.cur_chunk * sizeof(ventoy_img_chunk); - + if (ventoy_compatible) { size = sizeof(ventoy_chain_head) + img_chunk_size; @@ -1172,11 +1172,11 @@ grub_err_t ventoy_cmd_unix_chain_data(grub_extcmd_context_t ctxt, int argc, char { override_count = ventoy_unix_get_override_chunk_count(); override_size = override_count * sizeof(ventoy_override_chunk); - + virt_chunk_size = ventoy_unix_get_virt_chunk_size(); size = sizeof(ventoy_chain_head) + img_chunk_size + override_size + virt_chunk_size; } - + pLastChain = grub_env_get("vtoy_chain_mem_addr"); if (pLastChain) { @@ -1239,7 +1239,7 @@ grub_err_t ventoy_cmd_unix_chain_data(grub_extcmd_context_t ctxt, int argc, char ventoy_unix_fill_virt_data(isosize, chain); grub_file_close(file); - + VENTOY_CMD_RETURN(GRUB_ERR_NONE); } diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_vhd.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_vhd.c index c5839c2c6c6..43c793a9d93 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_vhd.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_vhd.c @@ -1,5 +1,5 @@ /****************************************************************************** - * ventoy_vhd.c + * ventoy_vhd.c * * Copyright (c) 2020, longpanda * @@ -7,12 +7,12 @@ * 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 . * @@ -54,9 +54,9 @@ static int ventoy_vhd_find_bcd(int *bcdoffset, int *bcdlen, const char *path) grub_uint32_t offset; grub_file_t file; char cmdbuf[128]; - + grub_snprintf(cmdbuf, sizeof(cmdbuf), "loopback vhdiso mem:0x%lx:size:%d", (ulong)g_vhdboot_isobuf, g_vhdboot_isolen); - + grub_script_execute_sourcecode(cmdbuf); file = ventoy_grub_file_open(VENTOY_FILE_TYPE, "(vhdiso)%s", path); @@ -72,15 +72,15 @@ static int ventoy_vhd_find_bcd(int *bcdoffset, int *bcdlen, const char *path) *bcdlen = (int)file->size; debug("vhdiso bcd file offset:%d len:%d\n", *bcdoffset, *bcdlen); - + grub_file_close(file); - + grub_script_execute_sourcecode("loopback -d vhdiso"); return 0; } -static int ventoy_vhd_patch_path(char *vhdpath, ventoy_patch_vhd *patch1, ventoy_patch_vhd *patch2, +static int ventoy_vhd_patch_path(char *vhdpath, ventoy_patch_vhd *patch1, ventoy_patch_vhd *patch2, int bcdoffset, int bcdlen) { int i; @@ -90,10 +90,10 @@ static int ventoy_vhd_patch_path(char *vhdpath, ventoy_patch_vhd *patch1, ventoy const char *plat; char *newpath = NULL; grub_uint16_t *unicode_path; - const grub_uint8_t winloadexe[] = + const grub_uint8_t winloadexe[] = { 0x77, 0x00, 0x69, 0x00, 0x6E, 0x00, 0x6C, 0x00, 0x6F, 0x00, 0x61, 0x00, 0x64, 0x00, 0x2E, 0x00, - 0x65, 0x00, 0x78, 0x00, 0x65, 0x00 + 0x65, 0x00, 0x78, 0x00, 0x65, 0x00 }; while ((*vhdpath) != '/') @@ -103,7 +103,7 @@ static int ventoy_vhd_patch_path(char *vhdpath, ventoy_patch_vhd *patch1, ventoy pathlen = sizeof(grub_uint16_t) * (grub_strlen(vhdpath) + 1); debug("unicode path for <%s> len:%d\n", vhdpath, (int)pathlen); - + unicode_path = grub_zalloc(pathlen); if (!unicode_path) { @@ -115,11 +115,11 @@ static int ventoy_vhd_patch_path(char *vhdpath, ventoy_patch_vhd *patch1, ventoy if (plat && (plat[0] == 'e')) /* UEFI */ { pos = g_vhdboot_isobuf + bcdoffset; - + /* winload.exe ==> winload.efi */ for (i = 0; i + (int)sizeof(winloadexe) < bcdlen; i++) { - if (*((grub_uint32_t *)(pos + i)) == 0x00690077 && + if (*((grub_uint32_t *)(pos + i)) == 0x00690077 && grub_memcmp(pos + i, winloadexe, sizeof(winloadexe)) == 0) { pos[i + sizeof(winloadexe) - 4] = 0x66; @@ -139,7 +139,7 @@ static int ventoy_vhd_patch_path(char *vhdpath, ventoy_patch_vhd *patch1, ventoy *pos = '\\'; } } - + grub_utf8_to_utf16(unicode_path, pathlen, (grub_uint8_t *)newpath, -1, NULL); grub_memcpy(patch1->vhd_file_path, unicode_path, pathlen); grub_memcpy(patch2->vhd_file_path, unicode_path, pathlen); @@ -202,7 +202,7 @@ static int ventoy_vhd_read_parttbl(const char *filename, ventoy_gpt_info *gpt, i break; } } - } + } if (find == 0) // MBR Logical partition { @@ -232,7 +232,7 @@ static int ventoy_vhd_patch_disk(const char *vhdpath, ventoy_patch_vhd *patch1, if (vhdpath[0] == '/') { - gpt = g_ventoy_part_info; + gpt = g_ventoy_part_info; partIndex = 0; debug("This is Ventoy ISO partIndex %d %s\n", partIndex, vhdpath); } @@ -252,7 +252,7 @@ static int ventoy_vhd_patch_disk(const char *vhdpath, ventoy_patch_vhd *patch1, { ventoy_debug_dump_guid("GPT disk GUID: ", gpt->Head.DiskGuid); ventoy_debug_dump_guid("GPT partIndex GUID: ", gpt->PartTbl[partIndex].PartGuid); - + grub_memcpy(patch1->disk_signature_or_guid, gpt->Head.DiskGuid, 16); grub_memcpy(patch1->part_offset_or_guid, gpt->PartTbl[partIndex].PartGuid, 16); grub_memcpy(patch2->disk_signature_or_guid, gpt->Head.DiskGuid, 16); @@ -274,7 +274,7 @@ static int ventoy_vhd_patch_disk(const char *vhdpath, ventoy_patch_vhd *patch1, grub_memcpy(patch1->part_offset_or_guid, &offset, 8); grub_memcpy(patch2->part_offset_or_guid, &offset, 8); - + grub_memcpy(patch1->disk_signature_or_guid, gpt->MBR.BootCode + 0x1b8, 4); grub_memcpy(patch2->disk_signature_or_guid, gpt->MBR.BootCode + 0x1b8, 4); @@ -294,8 +294,8 @@ static int ventoy_find_vhdpatch_offset(int bcdoffset, int bcdlen, int *offset) int i; int cnt = 0; grub_uint8_t *buf = (grub_uint8_t *)(g_vhdboot_isobuf + bcdoffset); - grub_uint8_t magic[16] = { - 0x5C, 0x00, 0x58, 0x00, 0x58, 0x00, 0x58, 0x00, 0x58, 0x00, 0x58, 0x00, 0x58, 0x00, 0x58, 0x00 + grub_uint8_t magic[16] = { + 0x5C, 0x00, 0x58, 0x00, 0x58, 0x00, 0x58, 0x00, 0x58, 0x00, 0x58, 0x00, 0x58, 0x00, 0x58, 0x00 }; for (i = 0; i < bcdlen - 16 && cnt < 2; i++) @@ -304,7 +304,7 @@ static int ventoy_find_vhdpatch_offset(int bcdoffset, int bcdlen, int *offset) { if (grub_memcmp(magic, buf + i, 16) == 0) { - *offset++ = i - (int)OFFSET_OF(ventoy_patch_vhd, vhd_file_path); + *offset++ = i - (int)OFFSET_OF(ventoy_patch_vhd, vhd_file_path); cnt++; } } @@ -345,7 +345,7 @@ grub_err_t ventoy_cmd_patch_vhdboot(grub_extcmd_context_t ctxt, int argc, char * patch1 = (ventoy_patch_vhd *)(g_vhdboot_isobuf + bcdoffset + patchoffset[0]); patch2 = (ventoy_patch_vhd *)(g_vhdboot_isobuf + bcdoffset + patchoffset[1]); - debug("Find /boot/bcd (%d %d) now patch it (offset: 0x%x 0x%x) ...\n", + debug("Find /boot/bcd (%d %d) now patch it (offset: 0x%x 0x%x) ...\n", bcdoffset, bcdlen, patchoffset[0], patchoffset[1]); ventoy_vhd_patch_disk(args[0], patch1, patch2); ventoy_vhd_patch_path(args[0], patch1, patch2, bcdoffset, bcdlen); @@ -361,8 +361,8 @@ grub_err_t ventoy_cmd_patch_vhdboot(grub_extcmd_context_t ctxt, int argc, char * ventoy_find_vhdpatch_offset(bcdoffset, bcdlen, patchoffset); patch1 = (ventoy_patch_vhd *)(g_vhdboot_isobuf + bcdoffset + patchoffset[0]); patch2 = (ventoy_patch_vhd *)(g_vhdboot_isobuf + bcdoffset + patchoffset[1]); - - debug("Find /boot/BCD (%d %d) now patch it (offset: 0x%x 0x%x) ...\n", + + debug("Find /boot/BCD (%d %d) now patch it (offset: 0x%x 0x%x) ...\n", bcdoffset, bcdlen, patchoffset[0], patchoffset[1]); ventoy_vhd_patch_disk(args[0], patch1, patch2); ventoy_vhd_patch_path(args[0], patch1, patch2, bcdoffset, bcdlen); @@ -382,7 +382,7 @@ grub_err_t ventoy_cmd_load_vhdboot(grub_extcmd_context_t ctxt, int argc, char ** { int buflen; grub_file_t file; - + (void)ctxt; (void)argc; @@ -412,7 +412,7 @@ grub_err_t ventoy_cmd_load_vhdboot(grub_extcmd_context_t ctxt, int argc, char ** #else g_vhdboot_totbuf = (char *)grub_malloc(buflen); #endif - + if (!g_vhdboot_totbuf) { grub_file_close(file); @@ -474,7 +474,7 @@ static int ventoy_raw_trim_head(grub_uint64_t offset) { g_img_chunk_list.chunk[i].disk_start_sector += delta; g_img_chunk_list.chunk[i].img_start_sector += (grub_uint32_t)(delta / 4); - + if (i > 0) { memsize = (g_img_chunk_list.cur_chunk - i) * sizeof(ventoy_img_chunk); @@ -485,7 +485,7 @@ static int ventoy_raw_trim_head(grub_uint64_t offset) for (i = 0; i < g_img_chunk_list.cur_chunk; i++) { - imgsecs = g_img_chunk_list.chunk[i].img_end_sector + 1 - g_img_chunk_list.chunk[i].img_start_sector; + imgsecs = g_img_chunk_list.chunk[i].img_end_sector + 1 - g_img_chunk_list.chunk[i].img_start_sector; g_img_chunk_list.chunk[i].img_start_sector = imgstart; g_img_chunk_list.chunk[i].img_end_sector = imgstart + (imgsecs - 1); imgstart += imgsecs; @@ -505,7 +505,7 @@ grub_err_t ventoy_cmd_get_vtoy_type(grub_extcmd_context_t ctxt, int argc, char * VDIPREHEADER vdihdr; char type[16] = {0}; ventoy_gpt_info *gpt = NULL; - + (void)ctxt; g_img_trim_head_secnum = 0; @@ -523,7 +523,7 @@ grub_err_t ventoy_cmd_get_vtoy_type(grub_extcmd_context_t ctxt, int argc, char * } grub_snprintf(type, sizeof(type), "unknown"); - + grub_file_seek(file, file->size - 512); grub_file_read(file, &vhdfoot, sizeof(vhdfoot)); @@ -536,7 +536,7 @@ grub_err_t ventoy_cmd_get_vtoy_type(grub_extcmd_context_t ctxt, int argc, char * { grub_file_seek(file, 0); grub_file_read(file, &vdihdr, sizeof(vdihdr)); - if (vdihdr.u32Signature == VDI_IMAGE_SIGNATURE) + if (vdihdr.u32Signature == VDI_IMAGE_SIGNATURE) { grub_snprintf(type, sizeof(type), "vdi"); if (grub_strncmp(vdihdr.szFileInfo, VDI_IMAGE_FILE_INFO, grub_strlen(VDI_IMAGE_FILE_INFO)) == 0) @@ -565,7 +565,7 @@ grub_err_t ventoy_cmd_get_vtoy_type(grub_extcmd_context_t ctxt, int argc, char * grub_env_set(args[1], type); debug("<%s> vtoy type: <%s> offset:%d\n", args[0], type, offset); - + if (offset >= 0) { gpt = grub_zalloc(sizeof(ventoy_gpt_info)); @@ -574,7 +574,7 @@ grub_err_t ventoy_cmd_get_vtoy_type(grub_extcmd_context_t ctxt, int argc, char * grub_env_set(args[1], "unknown"); goto end; } - + grub_file_seek(file, offset); grub_file_read(file, gpt, sizeof(ventoy_gpt_info)); @@ -617,7 +617,7 @@ grub_err_t ventoy_cmd_get_vtoy_type(grub_extcmd_context_t ctxt, int argc, char * if (data == 0x23) { altboot = 1; - grub_env_set(args[3], "1"); + grub_env_set(args[3], "1"); } else { @@ -655,7 +655,7 @@ grub_err_t ventoy_cmd_get_vtoy_type(grub_extcmd_context_t ctxt, int argc, char * end: grub_check_free(gpt); grub_file_close(file); - VENTOY_CMD_RETURN(GRUB_ERR_NONE); + VENTOY_CMD_RETURN(GRUB_ERR_NONE); } grub_err_t ventoy_cmd_raw_chain_data(grub_extcmd_context_t ctxt, int argc, char **args) @@ -666,7 +666,7 @@ grub_err_t ventoy_cmd_raw_chain_data(grub_extcmd_context_t ctxt, int argc, char grub_disk_t disk; const char *pLastChain = NULL; ventoy_chain_head *chain; - + (void)ctxt; (void)argc; @@ -693,9 +693,9 @@ grub_err_t ventoy_cmd_raw_chain_data(grub_extcmd_context_t ctxt, int argc, char } img_chunk_size = g_img_chunk_list.cur_chunk * sizeof(ventoy_img_chunk); - + size = sizeof(ventoy_chain_head) + img_chunk_size; - + pLastChain = grub_env_get("vtoy_chain_mem_addr"); if (pLastChain) { @@ -736,7 +736,7 @@ grub_err_t ventoy_cmd_raw_chain_data(grub_extcmd_context_t ctxt, int argc, char { chain->real_img_size_in_bytes -= g_img_trim_head_secnum * 512; } - + chain->virt_img_size_in_bytes = chain->real_img_size_in_bytes; chain->boot_catalog = 0; @@ -749,6 +749,6 @@ grub_err_t ventoy_cmd_raw_chain_data(grub_extcmd_context_t ctxt, int argc, char grub_file_read(file, chain->boot_catalog_sector, 512); grub_file_close(file); - + VENTOY_CMD_RETURN(GRUB_ERR_NONE); } diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_windows.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_windows.c index 6a47ad93b5d..802b5ff7969 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_windows.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_windows.c @@ -1,5 +1,5 @@ /****************************************************************************** - * ventoy_windows.c + * ventoy_windows.c * * Copyright (c) 2020, longpanda * @@ -7,12 +7,12 @@ * 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 . * @@ -102,14 +102,14 @@ static int ventoy_collect_wim_patch(const char *bcdfile) grub_file_read(file, buf, file->size); for (i = 0; i < (int)file->size - 8; i++) - { + { if (buf[i + 8] != 0) { continue; } - + magic = *(grub_uint64_t *)(buf + i); - + /* .wim .WIM .Wim */ if ((magic == 0x006D00690077002EULL) || (magic == 0x004D00490057002EULL) || @@ -130,7 +130,7 @@ static int ventoy_collect_wim_patch(const char *bcdfile) { continue; } - + valid = 1; for (k = 0, j += 2; k < (int)sizeof(path) - 1 && j < i + 8; j += 2) { @@ -145,7 +145,7 @@ static int ventoy_collect_wim_patch(const char *bcdfile) { c = '/'; } - + path[k++] = c; } path[k++] = 0; @@ -164,7 +164,7 @@ static int ventoy_collect_wim_patch(const char *bcdfile) node->pathlen = grub_snprintf(node->path, sizeof(node->path), "%s", path); debug("add patch <%s>\n", path); - + if (g_wim_patch_head) { node->next = g_wim_patch_head; @@ -191,7 +191,7 @@ static int ventoy_collect_wim_patch(const char *bcdfile) grub_err_t ventoy_cmd_wim_patch_count(grub_extcmd_context_t ctxt, int argc, char **args) { char buf[32]; - + (void)ctxt; (void)argc; (void)args; @@ -201,14 +201,14 @@ grub_err_t ventoy_cmd_wim_patch_count(grub_extcmd_context_t ctxt, int argc, char grub_snprintf(buf, sizeof(buf), "%d", g_wim_total_patch_count); ventoy_set_env(args[0], buf); } - + return 0; } grub_err_t ventoy_cmd_collect_wim_patch(grub_extcmd_context_t ctxt, int argc, char **args) { wim_patch *node = NULL; - + (void)ctxt; (void)argc; (void)args; @@ -234,7 +234,7 @@ grub_err_t ventoy_cmd_collect_wim_patch(grub_extcmd_context_t ctxt, int argc, ch node->pathlen = grub_snprintf(node->path, sizeof(node->path), "%s", args[1]); debug("add patch <%s>\n", args[1]); - + if (g_wim_patch_head) { node->next = g_wim_patch_head; @@ -277,7 +277,7 @@ static int wim_name_cmp(const char *search, grub_uint16_t *name, grub_uint16_t n search++; name++; namelen--; - + c1 = vtoy_to_upper(*search); c2 = vtoy_to_upper(*name); } @@ -298,7 +298,7 @@ static int ventoy_is_pe64(grub_uint8_t *buffer) { return 0; } - + pe_off = *(grub_uint32_t *)(buffer + 60); if (buffer[pe_off] != 'P' || buffer[pe_off + 1] != 'E') @@ -319,7 +319,7 @@ grub_err_t ventoy_cmd_is_pe64(grub_extcmd_context_t ctxt, int argc, char **args) int ret = 1; grub_file_t file; grub_uint8_t buf[512]; - + (void)ctxt; (void)argc; @@ -350,7 +350,7 @@ grub_err_t ventoy_cmd_sel_wimboot(grub_extcmd_context_t ctxt, int argc, char **a int size; char *buf = NULL; char configfile[128]; - + (void)ctxt; (void)argc; (void)args; @@ -363,7 +363,7 @@ grub_err_t ventoy_cmd_sel_wimboot(grub_extcmd_context_t ctxt, int argc, char **a return 0; } - size = (int)grub_snprintf(buf, 8192, + size = (int)grub_snprintf(buf, 8192, "menuentry \"Windows Setup (32-bit)\" {\n" " set vtoy_wimboot_sel=32\n" "}\n" @@ -379,7 +379,7 @@ grub_err_t ventoy_cmd_sel_wimboot(grub_extcmd_context_t ctxt, int argc, char **a grub_snprintf(configfile, sizeof(configfile), "configfile mem:0x%llx:size:%d", (ulonglong)(ulong)buf, size); grub_script_execute_sourcecode(configfile); - + g_ventoy_menu_esc = 0; g_ventoy_suppress_esc = 0; @@ -429,11 +429,11 @@ static int ventoy_load_jump_exe(const char *path, grub_uint8_t **data, grub_uint grub_file_t file; debug("windows load jump %s\n", path); - + file = ventoy_grub_file_open(VENTOY_FILE_TYPE, "%s", path); if (!file) { - debug("Can't open file %s\n", path); + debug("Can't open file %s\n", path); return 1; } @@ -479,7 +479,7 @@ static int ventoy_get_override_info(grub_file_t file, wim_tail *wim_data) grub_uint64_t override_offset; grub_uint32_t override_len; grub_uint64_t fe_entry_size_offset; - + if (grub_strcmp(file->fs->name, "iso9660") == 0) { g_iso_fs_type = wim_data->iso_type = 0; @@ -489,18 +489,18 @@ static int ventoy_get_override_info(grub_file_t file, wim_tail *wim_data) grub_file_read(file, &start_block, 1); // just read for hook trigger file_offset = grub_iso9660_get_last_read_pos(file); - debug("iso9660 wim size:%llu override_offset:%llu file_offset:%llu\n", + debug("iso9660 wim size:%llu override_offset:%llu file_offset:%llu\n", (ulonglong)file->size, (ulonglong)override_offset, (ulonglong)file_offset); } else { - g_iso_fs_type = wim_data->iso_type = 1; + g_iso_fs_type = wim_data->iso_type = 1; override_len = sizeof(ventoy_udf_override); override_offset = grub_udf_get_last_file_attr_offset(file, &start_block, &fe_entry_size_offset); - + file_offset = grub_udf_get_file_offset(file); - debug("UDF wim size:%llu override_offset:%llu file_offset:%llu start_block=%u\n", + debug("UDF wim size:%llu override_offset:%llu file_offset:%llu start_block=%u\n", (ulonglong)file->size, (ulonglong)override_offset, (ulonglong)file_offset, start_block); } @@ -551,9 +551,9 @@ static int ventoy_read_resource(grub_file_t fp, wim_header *wimhdr, wim_resource chunk_offset = (grub_uint32_t *)buffer_compress; //debug("%llu %llu chunk_num=%lu", (ulonglong)head->size_in_wim, (ulonglong)head->raw_size, chunk_num); - + cur_dst = buffer_decompress; - + for (i = 0; i < chunk_num - 1; i++) { chunk_size = (i == 0) ? chunk_offset[i] : chunk_offset[i] - chunk_offset[i - 1]; @@ -561,7 +561,7 @@ static int ventoy_read_resource(grub_file_t fp, wim_header *wimhdr, wim_resource if (WIM_CHUNK_LEN == chunk_size) { grub_memcpy(cur_dst, buffer_compress + cur_offset, chunk_size); - decompress_len = (int)chunk_size; + decompress_len = (int)chunk_size; } else { @@ -571,12 +571,12 @@ static int ventoy_read_resource(grub_file_t fp, wim_header *wimhdr, wim_resource } else { - decompress_len = (int)lzx_decompress(buffer_compress + cur_offset, chunk_size, cur_dst); + decompress_len = (int)lzx_decompress(buffer_compress + cur_offset, chunk_size, cur_dst); } } //debug("chunk_size:%u decompresslen:%d\n", chunk_size, decompress_len); - + total_decompress += decompress_len; cur_dst += decompress_len; cur_offset += chunk_size; @@ -585,12 +585,12 @@ static int ventoy_read_resource(grub_file_t fp, wim_header *wimhdr, wim_resource /* last chunk */ last_chunk_size = (grub_uint32_t)(head->size_in_wim - cur_offset); last_decompress_size = head->raw_size - total_decompress; - + if (last_chunk_size < WIM_CHUNK_LEN && last_chunk_size == last_decompress_size) { debug("Last chunk %u uncompressed\n", last_chunk_size); grub_memcpy(cur_dst, buffer_compress + cur_offset, last_chunk_size); - decompress_len = (int)last_chunk_size; + decompress_len = (int)last_chunk_size; } else { @@ -606,17 +606,17 @@ static int ventoy_read_resource(grub_file_t fp, wim_header *wimhdr, wim_resource cur_dst += decompress_len; total_decompress += decompress_len; - + //debug("last chunk_size:%u decompresslen:%d tot:%d\n", last_chunk_size, decompress_len, total_decompress); if (cur_dst != buffer_decompress + head->raw_size) { - debug("head->size_in_wim:%llu head->raw_size:%llu cur_dst:%p buffer_decompress:%p total_decompress:%d\n", + debug("head->size_in_wim:%llu head->raw_size:%llu cur_dst:%p buffer_decompress:%p total_decompress:%d\n", (ulonglong)head->size_in_wim, (ulonglong)head->raw_size, cur_dst, buffer_decompress, total_decompress); grub_free(buffer_decompress); return 1; } - + *buffer = buffer_decompress; return 0; } @@ -624,7 +624,7 @@ static int ventoy_read_resource(grub_file_t fp, wim_header *wimhdr, wim_resource static wim_directory_entry * search_wim_dirent(wim_directory_entry *dir, const char *search_name) { - do + do { if (dir->len && dir->name_len) { @@ -635,15 +635,15 @@ static wim_directory_entry * search_wim_dirent(wim_directory_entry *dir, const c } dir = (wim_directory_entry *)((grub_uint8_t *)dir + dir->len); } while(dir->len); - + return NULL; } static wim_directory_entry * search_full_wim_dirent ( - void *meta_data, + void *meta_data, wim_directory_entry *dir, - const char **path + const char **path ) { wim_directory_entry *subdir = NULL; @@ -655,7 +655,7 @@ static wim_directory_entry * search_full_wim_dirent search = search_wim_dirent(subdir, *path); path++; } - + return search; } @@ -664,7 +664,7 @@ static wim_directory_entry * search_full_wim_dirent static wim_lookup_entry * ventoy_find_look_entry(wim_header *header, wim_lookup_entry *lookup, wim_hash *hash) { grub_uint32_t i = 0; - + for (i = 0; i < (grub_uint32_t)header->lookup.raw_size / sizeof(wim_lookup_entry); i++) { if (grub_memcmp(&lookup[i].hash, hash, sizeof(wim_hash)) == 0) @@ -678,18 +678,18 @@ static wim_lookup_entry * ventoy_find_look_entry(wim_header *header, wim_lookup_ static int parse_registry_setup_cmdline ( - grub_file_t file, - wim_header *head, - wim_lookup_entry *lookup, - void *meta_data, - wim_directory_entry *dir, - char *buf, + grub_file_t file, + wim_header *head, + wim_lookup_entry *lookup, + void *meta_data, + wim_directory_entry *dir, + char *buf, grub_uint32_t buflen ) { char c; int ret = 0; - grub_uint32_t i = 0; + grub_uint32_t i = 0; grub_uint32_t reglen = 0; wim_hash zerohash; reg_vk *regvk = NULL; @@ -718,7 +718,7 @@ static int parse_registry_setup_cmdline } reglen = (grub_uint32_t)look->resource.raw_size; - debug("find system lookup entry_id:%ld raw_size:%u\n", + debug("find system lookup entry_id:%ld raw_size:%u\n", ((long)look - (long)lookup) / sizeof(wim_lookup_entry), reglen); if (0 != ventoy_read_resource(file, head, &(look->resource), (void **)&(decompress_data))) @@ -739,7 +739,7 @@ static int parse_registry_setup_cmdline { if (grub_strncasecmp((char *)(regvk + 1), "cmdline", 7) == 0) { - debug("find registry cmdline i:%u offset:(0x%x)%u size:(0x%x)%u\n", + debug("find registry cmdline i:%u offset:(0x%x)%u size:(0x%x)%u\n", i, regvk->dataoffset, regvk->dataoffset, regvk->datasize, regvk->datasize); break; } @@ -783,7 +783,7 @@ static int parse_custom_setup_path(char *cmdline, const char **path, char *exefi int len = 0; char *pos1 = NULL; char *pos2 = NULL; - + if ((cmdline[0] == 'x' || cmdline[0] == 'X') && cmdline[1] == ':') { pos1 = pos2 = cmdline + 3; @@ -796,9 +796,9 @@ static int parse_custom_setup_path(char *cmdline, const char **path, char *exefi } path[i++] = pos1; - + if (*pos2 == 0) - { + { break; } @@ -830,7 +830,7 @@ static int parse_custom_setup_path(char *cmdline, const char **path, char *exefi if (len < 4 || grub_strcasecmp(path[i - 1] + len - 4, ".exe") != 0) { grub_snprintf(exefile, 256, "%s.exe", path[i - 1]); - path[i - 1] = exefile; + path[i - 1] = exefile; } @@ -840,10 +840,10 @@ static int parse_custom_setup_path(char *cmdline, const char **path, char *exefi static wim_directory_entry * search_replace_wim_dirent ( - grub_file_t file, - wim_header *head, - wim_lookup_entry *lookup, - void *meta_data, + grub_file_t file, + wim_header *head, + wim_lookup_entry *lookup, + void *meta_data, wim_directory_entry *dir ) { @@ -866,7 +866,7 @@ static wim_directory_entry * search_replace_wim_dirent if (0 == ret) { debug("registry setup cmdline:<%s>\n", cmdline); - + if (grub_strncasecmp(cmdline, "PECMD", 5) == 0) { wim_dirent = pecmd_dirent; @@ -924,7 +924,7 @@ static wim_lookup_entry * ventoy_find_meta_entry(wim_header *header, wim_lookup_ { return NULL; } - + for (i = 0; i < (grub_uint32_t)header->lookup.raw_size / sizeof(wim_lookup_entry); i++) { if (lookup[i].resource.flags & RESHDR_FLAG_METADATA) @@ -995,7 +995,7 @@ static int ventoy_update_all_hash(wim_patch *patch, void *meta_data, wim_directo debug("find target file, name_len:%u upadte hash\n", dir->name_len); grub_memcpy(dir->hash.sha1, &(patch->wim_data.bin_hash), sizeof(wim_hash)); } - + if (dir->subdir) { ventoy_update_all_hash(patch, meta_data, (wim_directory_entry *)((char *)meta_data + dir->subdir)); @@ -1008,7 +1008,7 @@ static int ventoy_update_all_hash(wim_patch *patch, void *meta_data, wim_directo } else { - dir = (wim_directory_entry *)((char *)dir + dir->len); + dir = (wim_directory_entry *)((char *)dir + dir->len); } } while (dir->len >= sizeof(wim_directory_entry)); @@ -1024,15 +1024,15 @@ static int ventoy_cat_exe_file_data(wim_tail *wim_data, grub_uint32_t exe_len, g grub_uint8_t *jump_data = NULL; pe64 = ventoy_is_pe64(exe_data); - + grub_snprintf(file, sizeof(file), "%s/vtoyjump%d.exe", grub_env_get("vtoy_path"), pe64 ? 64 : 32); ventoy_load_jump_exe(file, &jump_data, &jump_len, NULL); jump_align = ventoy_align(jump_len, 16); - + wim_data->jump_exe_len = jump_len; wim_data->bin_raw_len = jump_align + sizeof(ventoy_os_param) + windatalen + exe_len; wim_data->bin_align_len = ventoy_align(wim_data->bin_raw_len, 2048); - + wim_data->jump_bin_data = grub_malloc(wim_data->bin_align_len); if (wim_data->jump_bin_data) { @@ -1040,9 +1040,9 @@ static int ventoy_cat_exe_file_data(wim_tail *wim_data, grub_uint32_t exe_len, g grub_memcpy(wim_data->jump_bin_data + jump_align + sizeof(ventoy_os_param) + windatalen, exe_data, exe_len); } - debug("jump_exe_len:%u bin_raw_len:%u bin_align_len:%u\n", + debug("jump_exe_len:%u bin_raw_len:%u bin_align_len:%u\n", wim_data->jump_exe_len, wim_data->bin_raw_len, wim_data->bin_align_len); - + return 0; } @@ -1056,13 +1056,13 @@ static int ventoy_get_windows_rtdata_len(const char *iso, int *flag) *flag = 0; size = (int)sizeof(ventoy_windows_data); - + pos = grub_strstr(iso, "/"); if (!pos) { return size; } - + script = ventoy_plugin_get_cur_install_template(pos, &template_node); if (script) { @@ -1090,7 +1090,7 @@ static int ventoy_fill_windows_rtdata(void *buf, char *isopath, int dataflag) { data->windows11_bypass_check = 1; } - + env = grub_env_get("VTOY_WIN11_BYPASS_NRO"); if (env && env[0] == '1' && env[1] == 0) { @@ -1166,7 +1166,7 @@ static int ventoy_update_before_chain(ventoy_os_param *param, char *isopath) jump_align = ventoy_align(wim_data->jump_exe_len, 16); if (wim_data->jump_bin_data) { - grub_memcpy(wim_data->jump_bin_data + jump_align, param, sizeof(ventoy_os_param)); + grub_memcpy(wim_data->jump_bin_data + jump_align, param, sizeof(ventoy_os_param)); ventoy_fill_windows_rtdata(wim_data->jump_bin_data + jump_align + sizeof(ventoy_os_param), isopath, wim_data->windata_flag); } @@ -1223,15 +1223,15 @@ static int ventoy_wimdows_locate_wim(const char *disk, wim_patch *patch, int win wim_directory_entry *rootdir = NULL; wim_directory_entry *search = NULL; wim_stream_entry *stream = NULL; - wim_header *head = &(patch->wim_data.wim_header); + wim_header *head = &(patch->wim_data.wim_header); wim_tail *wim_data = &patch->wim_data; - + debug("windows locate wim start %s\n", patch->path); g_ventoy_case_insensitive = 1; file = ventoy_grub_file_open(VENTOY_FILE_TYPE, "%s%s", disk, patch->path); g_ventoy_case_insensitive = 0; - + if (!file) { debug("File %s%s NOT exist\n", disk, patch->path); @@ -1291,7 +1291,7 @@ static int ventoy_wimdows_locate_wim(const char *disk, wim_patch *patch, int win grub_file_close(file); return 1; } - + debug("find replace file at %p\n", search); grub_memset(&patch->old_hash, 0, sizeof(wim_hash)); @@ -1304,7 +1304,7 @@ static int ventoy_wimdows_locate_wim(const char *disk, wim_patch *patch, int win if (stream->name_len == 0) { grub_memcpy(&patch->old_hash, stream->hash.sha1, sizeof(wim_hash)); - debug("new search hash: %02x %02x %02x %02x %02x %02x %02x %02x\n", + debug("new search hash: %02x %02x %02x %02x %02x %02x %02x %02x\n", ventoy_varg_8(patch->old_hash.sha1)); break; } @@ -1313,16 +1313,16 @@ static int ventoy_wimdows_locate_wim(const char *disk, wim_patch *patch, int win } else { - grub_memcpy(&patch->old_hash, search->hash.sha1, sizeof(wim_hash)); + grub_memcpy(&patch->old_hash, search->hash.sha1, sizeof(wim_hash)); } - + /* find and extact winpeshl.exe */ patch->replace_look = ventoy_find_look_entry(head, lookup, &patch->old_hash); if (patch->replace_look) { exe_len = (grub_uint32_t)patch->replace_look->resource.raw_size; - debug("find replace lookup entry_id:%ld raw_size:%u\n", + debug("find replace lookup entry_id:%ld raw_size:%u\n", ((long)patch->replace_look - (long)lookup) / sizeof(wim_lookup_entry), exe_len); if (0 == ventoy_read_resource(file, head, &(patch->replace_look->resource), (void **)&(exe_data))) @@ -1337,18 +1337,18 @@ static int ventoy_wimdows_locate_wim(const char *disk, wim_patch *patch, int win } else { - debug("failed to find lookup entry for replace file %02x %02x %02x %02x\n", + debug("failed to find lookup entry for replace file %02x %02x %02x %02x\n", ventoy_varg_4(patch->old_hash.sha1)); } wim_data->wim_raw_size = (grub_uint32_t)file->size; wim_data->wim_align_size = ventoy_align(wim_data->wim_raw_size, 2048); - + grub_check_free(wim_data->new_meta_data); wim_data->new_meta_data = decompress_data; wim_data->new_meta_len = head->metadata.raw_size; wim_data->new_meta_align_len = ventoy_align(wim_data->new_meta_len, 2048); - + grub_check_free(wim_data->new_lookup_data); wim_data->new_lookup_data = (grub_uint8_t *)lookup; wim_data->new_lookup_len = (grub_uint32_t)head->lookup.raw_size; @@ -1412,7 +1412,7 @@ grub_err_t ventoy_cmd_sel_winpe_wim(grub_extcmd_context_t ctxt, int argc, char * { continue; } - + g_ventoy_case_insensitive = 1; file = ventoy_grub_file_open(VENTOY_FILE_TYPE, "%s%s", args[0], node->path); g_ventoy_case_insensitive = 0; @@ -1451,7 +1451,7 @@ grub_err_t ventoy_cmd_sel_winpe_wim(grub_extcmd_context_t ctxt, int argc, char * g_ventoy_secondary_menu_on = 1; grub_snprintf(cfgfile, sizeof(cfgfile), "configfile mem:0x%llx:size:%d", (ulonglong)(ulong)cmd, pos); - grub_script_execute_sourcecode(cfgfile); + grub_script_execute_sourcecode(cfgfile); g_ventoy_menu_esc = 0; g_ventoy_suppress_esc = 0; @@ -1506,7 +1506,7 @@ grub_err_t ventoy_cmd_locate_wim_patch(grub_extcmd_context_t ctxt, int argc, cha static grub_uint32_t ventoy_get_override_chunk_num(void) { grub_uint32_t chunk_num = 0; - + if (g_iso_fs_type == 0) { /* ISO9660: */ @@ -1573,8 +1573,8 @@ static void ventoy_windows_fill_override_data_iso9660( grub_uint64_t isosize, { continue; } - - new_wim_size = wim_data->wim_align_size + wim_data->bin_align_len + + + new_wim_size = wim_data->wim_align_size + wim_data->bin_align_len + wim_data->new_meta_align_len + wim_data->new_lookup_align_len; dirent = (ventoy_iso9660_override *)wim_data->override_data; @@ -1602,7 +1602,7 @@ static void ventoy_windows_fill_override_data_iso9660( grub_uint64_t isosize, return; } -static int ventoy_windows_fill_udf_short_ad(grub_file_t isofile, grub_uint32_t curpos, +static int ventoy_windows_fill_udf_short_ad(grub_file_t isofile, grub_uint32_t curpos, wim_tail *wim_data, grub_uint32_t new_wim_size) { int i; @@ -1610,7 +1610,7 @@ static int ventoy_windows_fill_udf_short_ad(grub_file_t isofile, grub_uint32_t c grub_uint32_t left_size = 0; ventoy_udf_override *udf = NULL; ventoy_udf_override tmp[4]; - + grub_memset(tmp, 0, sizeof(tmp)); grub_file_seek(isofile, wim_data->override_offset); grub_file_read(isofile, tmp, sizeof(tmp)); @@ -1658,7 +1658,7 @@ static void ventoy_windows_fill_override_data_udf(grub_file_t isofile, void *ove sector = (isofile->size + 2047) / 2048; cur = (ventoy_override_chunk *)override; - + if (g_suppress_wincd_override_offset > 0) { ventoy_fill_suppress_wincd_override_data(cur); @@ -1676,13 +1676,13 @@ static void ventoy_windows_fill_override_data_udf(grub_file_t isofile, void *ove { udf_start_block = wim_data->udf_start_block; } - new_wim_size = wim_data->wim_align_size + wim_data->bin_align_len + + new_wim_size = wim_data->wim_align_size + wim_data->bin_align_len + wim_data->new_meta_align_len + wim_data->new_lookup_align_len; total_wim_size += new_wim_size; } } - //override 1: sector number in pd data + //override 1: sector number in pd data cur->img_offset = grub_udf_get_last_pd_size_offset(); cur->override_size = 4; data32 = sector - udf_start_block + (total_wim_size / 2048); @@ -1695,8 +1695,8 @@ static void ventoy_windows_fill_override_data_udf(grub_file_t isofile, void *ove { continue; } - - new_wim_size = wim_data->wim_align_size + wim_data->bin_align_len + + + new_wim_size = wim_data->wim_align_size + wim_data->bin_align_len + wim_data->new_meta_align_len + wim_data->new_lookup_align_len; //override 2: filesize in file_entry @@ -1710,7 +1710,7 @@ static void ventoy_windows_fill_override_data_udf(grub_file_t isofile, void *ove ventoy_windows_fill_udf_short_ad(isofile, (grub_uint32_t)sector - udf_start_block, wim_data, new_wim_size); sector += (new_wim_size / 2048); - + cur++; cur->img_offset = wim_data->override_offset; cur->override_size = wim_data->override_len; @@ -1731,18 +1731,18 @@ static grub_uint32_t ventoy_windows_get_virt_data_size(void) grub_uint32_t size = 0; wim_tail *wim_data = NULL; wim_patch *node = g_wim_patch_head; - + while (node) { if (node->valid) { wim_data = &node->wim_data; - size += sizeof(ventoy_virt_chunk) + wim_data->bin_align_len + + size += sizeof(ventoy_virt_chunk) + wim_data->bin_align_len + wim_data->new_meta_align_len + wim_data->new_lookup_align_len; } node = node->next; } - + return size; } @@ -1755,7 +1755,7 @@ static void ventoy_windows_fill_virt_data( grub_uint64_t isosize, ventoy_chai char *override = NULL; ventoy_virt_chunk *cur = NULL; wim_tail *wim_data = NULL; - wim_patch *node = NULL; + wim_patch *node = NULL; sector = (isosize + 2047) / 2048; offset = sizeof(ventoy_virt_chunk) * g_wim_valid_patch_count; @@ -1778,7 +1778,7 @@ static void ventoy_windows_fill_virt_data( grub_uint64_t isosize, ventoy_chai cur->remap_sector_start = sector; cur->remap_sector_end = cur->remap_sector_start + wim_secs; cur->org_sector_start = (grub_uint32_t)(wim_data->file_offset / 2048); - + cur->mem_sector_start = cur->remap_sector_end; cur->mem_sector_end = cur->mem_sector_start + mem_secs; cur->mem_sector_offset = offset; @@ -1791,13 +1791,13 @@ static void ventoy_windows_fill_virt_data( grub_uint64_t isosize, ventoy_chai grub_memcpy(override + offset, wim_data->new_meta_data, wim_data->new_meta_len); offset += wim_data->new_meta_align_len; - + grub_memcpy(override + offset, wim_data->new_lookup_data, wim_data->new_lookup_len); offset += wim_data->new_lookup_align_len; - chain->virt_img_size_in_bytes += wim_data->wim_align_size + - wim_data->bin_align_len + - wim_data->new_meta_align_len + + chain->virt_img_size_in_bytes += wim_data->wim_align_size + + wim_data->bin_align_len + + wim_data->new_meta_align_len + wim_data->new_lookup_align_len; } @@ -1808,7 +1808,7 @@ static int ventoy_windows_drive_map(ventoy_chain_head *chain, int vlnk) { int hd1 = 0; grub_disk_t disk; - + debug("drive map begin <%p> <%d> ...\n", chain, vlnk); disk = grub_disk_open("hd1"); @@ -1883,7 +1883,7 @@ static int ventoy_suppress_windows_cd_prompt(void) readpos = grub_iso9660_get_last_read_pos(file); } - debug("bootfix.bin readpos:%lu (sector:%lu) data: %02x %02x %02x %02x\n", + debug("bootfix.bin readpos:%lu (sector:%lu) data: %02x %02x %02x %02x\n", (ulong)readpos, (ulong)readpos / 2048, data[24], data[25], data[26], data[27]); if (*(grub_uint32_t *)(data + 24) == 0x13cd0080) @@ -1960,7 +1960,7 @@ static int ventoy_extract_init_exe(char *wimfile, grub_uint8_t **pexe_data, grub debug("Failed to find replace file %p\n", search); goto out; } - + uname = (grub_uint16_t *)(search + 1); for (i = 0; i < search->name_len / 2 && i < 200; i++) { @@ -1979,7 +1979,7 @@ static int ventoy_extract_init_exe(char *wimfile, grub_uint8_t **pexe_data, grub if (stream->name_len == 0) { grub_memcpy(&hashdata, stream->hash.sha1, sizeof(wim_hash)); - debug("new search hash: %02x %02x %02x %02x %02x %02x %02x %02x\n", + debug("new search hash: %02x %02x %02x %02x %02x %02x %02x %02x\n", ventoy_varg_8(hashdata.sha1)); break; } @@ -1988,7 +1988,7 @@ static int ventoy_extract_init_exe(char *wimfile, grub_uint8_t **pexe_data, grub } else { - grub_memcpy(&hashdata, search->hash.sha1, sizeof(wim_hash)); + grub_memcpy(&hashdata, search->hash.sha1, sizeof(wim_hash)); } /* find and extact winpeshl.exe */ @@ -1996,7 +1996,7 @@ static int ventoy_extract_init_exe(char *wimfile, grub_uint8_t **pexe_data, grub if (replace_look) { exe_len = (grub_uint32_t)replace_look->resource.raw_size; - debug("find replace lookup entry_id:%ld raw_size:%u\n", + debug("find replace lookup entry_id:%ld raw_size:%u\n", ((long)replace_look - (long)lookup) / sizeof(wim_lookup_entry), exe_len); if (0 != ventoy_read_resource(file, head, &(replace_look->resource), (void **)&(exe_data))) @@ -2008,7 +2008,7 @@ static int ventoy_extract_init_exe(char *wimfile, grub_uint8_t **pexe_data, grub } else { - debug("failed to find lookup entry for replace file %02x %02x %02x %02x\n", + debug("failed to find lookup entry for replace file %02x %02x %02x %02x\n", ventoy_varg_4(hashdata.sha1)); } @@ -2018,7 +2018,7 @@ static int ventoy_extract_init_exe(char *wimfile, grub_uint8_t **pexe_data, grub *pexe_data = exe_data; *pexe_len = exe_len; } - + out: grub_check_free(lookup); @@ -2106,7 +2106,7 @@ grub_err_t ventoy_cmd_windows_chain_data(grub_extcmd_context_t ctxt, int argc, c const char *pLastChain = NULL; const char *compatible; ventoy_chain_head *chain; - + (void)ctxt; (void)argc; @@ -2129,7 +2129,7 @@ grub_err_t ventoy_cmd_windows_chain_data(grub_extcmd_context_t ctxt, int argc, c unknown_image = 1; if (!g_ventoy_wimboot_mode) { - debug("Warning: %s was not recognized by Ventoy\n", args[0]); + debug("Warning: %s was not recognized by Ventoy\n", args[0]); } } @@ -2168,7 +2168,7 @@ grub_err_t ventoy_cmd_windows_chain_data(grub_extcmd_context_t ctxt, int argc, c } img_chunk_size = g_img_chunk_list.cur_chunk * sizeof(ventoy_img_chunk); - + if (ventoy_compatible || unknown_image) { override_size = g_suppress_wincd_override_offset > 0 ? sizeof(ventoy_override_chunk) : 0; @@ -2259,7 +2259,7 @@ grub_err_t ventoy_cmd_windows_chain_data(grub_extcmd_context_t ctxt, int argc, c } else { - ventoy_windows_fill_override_data_udf(file, (char *)chain + chain->override_chunk_offset); + ventoy_windows_fill_override_data_udf(file, (char *)chain + chain->override_chunk_offset); } /* part 5: virt chunk */ @@ -2269,7 +2269,7 @@ grub_err_t ventoy_cmd_windows_chain_data(grub_extcmd_context_t ctxt, int argc, c if (ventoy_is_efi_os() == 0) { - ventoy_windows_drive_map(chain, file->vlnk); + ventoy_windows_drive_map(chain, file->vlnk); } VENTOY_CMD_RETURN(GRUB_ERR_NONE); @@ -2280,7 +2280,7 @@ static grub_uint32_t ventoy_get_wim_iso_offset(const char *filepath) grub_uint32_t imgoffset; grub_file_t file; char cmdbuf[128]; - + grub_snprintf(cmdbuf, sizeof(cmdbuf), "loopback wimiso \"%s\"", filepath); grub_script_execute_sourcecode(cmdbuf); @@ -2294,9 +2294,9 @@ static grub_uint32_t ventoy_get_wim_iso_offset(const char *filepath) imgoffset = (grub_uint32_t)grub_iso9660_get_last_file_dirent_pos(file) + 2; debug("wimiso wim direct offset: %u\n", imgoffset); - + grub_file_close(file); - + grub_script_execute_sourcecode("loopback -d wimiso"); return imgoffset; @@ -2310,10 +2310,10 @@ static int ventoy_get_wim_chunklist(grub_file_t wimfile, ventoy_img_chunk_list * { return grub_error(GRUB_ERR_OUT_OF_MEMORY, "Can't allocate image chunk memoty\n"); } - + wimchunk->max_chunk = DEFAULT_CHUNK_NUM; wimchunk->cur_chunk = 0; - + ventoy_get_block_list(wimfile, wimchunk, wimfile->device->disk->partition->start); return 0; @@ -2324,7 +2324,7 @@ grub_err_t ventoy_cmd_is_standard_winiso(grub_extcmd_context_t ctxt, int argc, c int i; int ret = 1; char prefix[32] = {0}; - const char *chkfile[] = + const char *chkfile[] = { "boot/bcd", "boot/boot.sdi", NULL }; @@ -2359,7 +2359,7 @@ grub_err_t ventoy_cmd_is_standard_winiso(grub_extcmd_context_t ctxt, int argc, c } } - if ((!ventoy_check_file_exist("%s%s/sources/install.wim", args[0], prefix)) && + if ((!ventoy_check_file_exist("%s%s/sources/install.wim", args[0], prefix)) && (!ventoy_check_file_exist("%s%s/sources/install.esd", args[0], prefix))) { debug("No install.wim(esd) found.\n"); @@ -2385,7 +2385,7 @@ grub_err_t ventoy_cmd_wim_check_bootable(grub_extcmd_context_t ctxt, int argc, c grub_uint32_t boot_index; grub_file_t file = NULL; wim_header *wimhdr = NULL; - + (void)ctxt; (void)argc; @@ -2411,7 +2411,7 @@ grub_err_t ventoy_cmd_wim_check_bootable(grub_extcmd_context_t ctxt, int argc, c { return 1; } - + VENTOY_CMD_RETURN(GRUB_ERR_NONE); } @@ -2434,7 +2434,7 @@ static grub_err_t ventoy_vlnk_wim_chain_data(grub_file_t wimfile) ventoy_img_chunk *chunknode; ventoy_override_chunk *override; ventoy_img_chunk_list wimchunk; - + debug("vlnk wim chain data begin <%s> ...\n", wimfile->name); if (NULL == g_wimiso_chunk_list.chunk || NULL == g_wimiso_path) @@ -2540,11 +2540,11 @@ static grub_err_t ventoy_vlnk_wim_chain_data(grub_file_t wimfile) { chunknode = wimchunk.chunk + i; chunknode->img_start_sector = isosector; - chunknode->img_end_sector = chunknode->img_start_sector + + chunknode->img_end_sector = chunknode->img_start_sector + ((chunknode->disk_end_sector + 1 - chunknode->disk_start_sector) / 4) - 1; isosector = chunknode->img_end_sector + 1; } - + grub_memcpy((char *)chain + chain->img_chunk_offset + img_chunk1_size, wimchunk.chunk, img_chunk2_size); /* part 4: override chunk */ @@ -2557,7 +2557,7 @@ static grub_err_t ventoy_vlnk_wim_chain_data(grub_file_t wimfile) grub_file_seek(file, 0); grub_file_read(file, override->override_data, file->size); - + dirent = (ventoy_iso9660_override *)(override->override_data + imgoffset); dirent->first_sector = (grub_uint32_t)((file->size + 2047) / 2048); dirent->size = (grub_uint32_t)(wimsize); @@ -2568,7 +2568,7 @@ static grub_err_t ventoy_vlnk_wim_chain_data(grub_file_t wimfile) if (ventoy_is_efi_os() == 0) { - ventoy_windows_drive_map(chain, 0); + ventoy_windows_drive_map(chain, 0); } grub_file_close(file); @@ -2595,7 +2595,7 @@ static grub_err_t ventoy_normal_wim_chain_data(grub_file_t wimfile) ventoy_img_chunk *chunknode; ventoy_override_chunk *override; ventoy_img_chunk_list wimchunk; - + debug("normal wim chain data begin <%s> ...\n", wimfile->name); if (NULL == g_wimiso_chunk_list.chunk || NULL == g_wimiso_path) @@ -2629,7 +2629,7 @@ static grub_err_t ventoy_normal_wim_chain_data(grub_file_t wimfile) img_chunk1_size = g_wimiso_chunk_list.cur_chunk * sizeof(ventoy_img_chunk); img_chunk2_size = wimchunk.cur_chunk * sizeof(ventoy_img_chunk); override_size = sizeof(ventoy_override_chunk); - + size = sizeof(ventoy_chain_head) + img_chunk1_size + img_chunk2_size + override_size; pLastChain = grub_env_get("vtoy_chain_mem_addr"); @@ -2693,11 +2693,11 @@ static grub_err_t ventoy_normal_wim_chain_data(grub_file_t wimfile) { chunknode = wimchunk.chunk + i; chunknode->img_start_sector = isosector; - chunknode->img_end_sector = chunknode->img_start_sector + + chunknode->img_end_sector = chunknode->img_start_sector + ((chunknode->disk_end_sector + 1 - chunknode->disk_start_sector) / 4) - 1; isosector = chunknode->img_end_sector + 1; } - + grub_memcpy((char *)chain + chain->img_chunk_offset + img_chunk1_size, wimchunk.chunk, img_chunk2_size); /* part 4: override chunk */ @@ -2707,7 +2707,7 @@ static grub_err_t ventoy_normal_wim_chain_data(grub_file_t wimfile) override = (ventoy_override_chunk *)((char *)chain + chain->override_chunk_offset); override->img_offset = imgoffset; override->override_size = sizeof(ventoy_iso9660_override); - + dirent = (ventoy_iso9660_override *)(override->override_data); dirent->first_sector = (grub_uint32_t)((file->size + 2047) / 2048); dirent->size = (grub_uint32_t)(wimsize); @@ -2718,7 +2718,7 @@ static grub_err_t ventoy_normal_wim_chain_data(grub_file_t wimfile) if (ventoy_is_efi_os() == 0) { - ventoy_windows_drive_map(chain, 0); + ventoy_windows_drive_map(chain, 0); } grub_file_close(file); @@ -2762,7 +2762,7 @@ int ventoy_chain_file_size(const char *path) size = (int)(file->size); grub_file_close(file); - + return size; } @@ -2775,7 +2775,7 @@ int ventoy_chain_file_read(const char *path, int offset, int len, void *buf) grub_file_seek(file, offset); size = grub_file_read(file, buf, len); grub_file_close(file); - + return size; } diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/wimboot.h b/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/wimboot.h index 5a77eaed709..d8e579fcfc1 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/wimboot.h +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/wimboot.h @@ -7,12 +7,12 @@ * 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 . * diff --git a/GRUB2/MOD_SRC/grub-2.04/include/grub/charset.h b/GRUB2/MOD_SRC/grub-2.04/include/grub/charset.h index 4c5975346fa..83b72a9cff6 100644 --- a/GRUB2/MOD_SRC/grub-2.04/include/grub/charset.h +++ b/GRUB2/MOD_SRC/grub-2.04/include/grub/charset.h @@ -49,7 +49,7 @@ #define GRUB_UTF16_LOWER_SURROGATE(code) \ (0xDC00 | (((code) - GRUB_UCS2_LIMIT) & 0x3ff)) -/* Process one character from UTF8 sequence. +/* Process one character from UTF8 sequence. At beginning set *code = 0, *count = 0. Returns 0 on failure and 1 on success. *count holds the number of trailing bytes. */ static inline int @@ -317,7 +317,7 @@ grub_encode_utf8_character (grub_uint8_t *dest, grub_uint8_t *destend, grub_uint32_t code); const grub_uint32_t * -grub_unicode_get_comb_start (const grub_uint32_t *str, +grub_unicode_get_comb_start (const grub_uint32_t *str, const grub_uint32_t *cur); int diff --git a/GRUB2/MOD_SRC/grub-2.04/include/grub/disk.h b/GRUB2/MOD_SRC/grub-2.04/include/grub/disk.h index ef4e55c1c4b..9a1f1d5d856 100644 --- a/GRUB2/MOD_SRC/grub-2.04/include/grub/disk.h +++ b/GRUB2/MOD_SRC/grub-2.04/include/grub/disk.h @@ -58,7 +58,7 @@ struct grub_disk_memberlist; #endif typedef enum - { + { GRUB_DISK_PULL_NONE, GRUB_DISK_PULL_REMOVABLE, GRUB_DISK_PULL_RESCAN, @@ -195,7 +195,7 @@ grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data) grub_disk_t EXPORT_FUNC(grub_disk_open) (const char *name); void EXPORT_FUNC(grub_disk_close) (grub_disk_t disk); -grub_err_t EXPORT_FUNC(grub_disk_blocklist_read)(void *chunklist, grub_uint64_t sector, +grub_err_t EXPORT_FUNC(grub_disk_blocklist_read)(void *chunklist, grub_uint64_t sector, grub_uint64_t size, grub_uint32_t log_sector_size); grub_err_t EXPORT_FUNC(grub_disk_read) (grub_disk_t disk, diff --git a/GRUB2/MOD_SRC/grub-2.04/include/grub/dl.h b/GRUB2/MOD_SRC/grub-2.04/include/grub/dl.h index f70498da096..f39eb7e1ae4 100644 --- a/GRUB2/MOD_SRC/grub-2.04/include/grub/dl.h +++ b/GRUB2/MOD_SRC/grub-2.04/include/grub/dl.h @@ -98,7 +98,7 @@ grub_mod_fini (void) #endif #else #ifdef __APPLE__ -#define GRUB_MOD_SECTION(x) _ ## x , _ ##x +#define GRUB_MOD_SECTION(x) _ ## x , _ ##x #else #define GRUB_MOD_SECTION(x) . ## x #endif diff --git a/GRUB2/MOD_SRC/grub-2.04/include/grub/efi/api.h b/GRUB2/MOD_SRC/grub-2.04/include/grub/efi/api.h index 16cfef9c514..e3272e8ddd2 100644 --- a/GRUB2/MOD_SRC/grub-2.04/include/grub/efi/api.h +++ b/GRUB2/MOD_SRC/grub-2.04/include/grub/efi/api.h @@ -411,7 +411,7 @@ struct grub_efi_sal_system_table_translation_register_descriptor struct grub_efi_sal_system_table_purge_translation_coherence { grub_uint8_t type; - grub_uint8_t reserved[3]; + grub_uint8_t reserved[3]; grub_uint32_t ndomains; grub_uint64_t coherence; }; diff --git a/GRUB2/MOD_SRC/grub-2.04/include/grub/efi/efi.h b/GRUB2/MOD_SRC/grub-2.04/include/grub/efi/efi.h index aec589c3807..ca69b667375 100644 --- a/GRUB2/MOD_SRC/grub-2.04/include/grub/efi/efi.h +++ b/GRUB2/MOD_SRC/grub-2.04/include/grub/efi/efi.h @@ -90,7 +90,7 @@ void * EXPORT_FUNC (grub_efi_allocate_iso_buf) (grub_uint64_t size); void * EXPORT_FUNC (grub_efi_allocate_chain_buf) (grub_uint64_t size); void EXPORT_FUNC (grub_efi_get_reserved_page_num) (grub_uint64_t *total, grub_uint64_t *org_required, grub_uint64_t *new_required); -extern void (*EXPORT_VAR(grub_efi_net_config)) (grub_efi_handle_t hnd, +extern void (*EXPORT_VAR(grub_efi_net_config)) (grub_efi_handle_t hnd, char **device, char **path); diff --git a/GRUB2/MOD_SRC/grub-2.04/include/grub/gfxmenu_view.h b/GRUB2/MOD_SRC/grub-2.04/include/grub/gfxmenu_view.h index 56c0d17ae6a..3c71277e76f 100644 --- a/GRUB2/MOD_SRC/grub-2.04/include/grub/gfxmenu_view.h +++ b/GRUB2/MOD_SRC/grub-2.04/include/grub/gfxmenu_view.h @@ -55,9 +55,9 @@ void grub_gfxmenu_view_redraw (grub_gfxmenu_view_t view, const grub_video_rect_t *region); -void +void grub_gfxmenu_clear_timeout (void *data); -void +void grub_gfxmenu_print_timeout (int timeout, void *data); void grub_gfxmenu_set_chosen_entry (int entry, void *data); diff --git a/GRUB2/MOD_SRC/grub-2.04/include/grub/menu_viewer.h b/GRUB2/MOD_SRC/grub-2.04/include/grub/menu_viewer.h index f068af954e9..f34ff0a21e2 100644 --- a/GRUB2/MOD_SRC/grub-2.04/include/grub/menu_viewer.h +++ b/GRUB2/MOD_SRC/grub-2.04/include/grub/menu_viewer.h @@ -40,7 +40,7 @@ struct grub_menu_viewer void grub_menu_register_viewer (struct grub_menu_viewer *viewer); grub_err_t -grub_menu_try_text (struct grub_term_output *term, +grub_menu_try_text (struct grub_term_output *term, int entry, grub_menu_t menu, int nested); extern grub_err_t (*grub_gfxmenu_try_hook) (int entry, grub_menu_t menu, diff --git a/GRUB2/MOD_SRC/grub-2.04/include/grub/mips64/efi/loongson.h b/GRUB2/MOD_SRC/grub-2.04/include/grub/mips64/efi/loongson.h index 180c3a5d4b9..af2a22742c9 100644 --- a/GRUB2/MOD_SRC/grub-2.04/include/grub/mips64/efi/loongson.h +++ b/GRUB2/MOD_SRC/grub-2.04/include/grub/mips64/efi/loongson.h @@ -30,7 +30,7 @@ #define GRUB_EFI_LOONGSON_MMAP_MAX 128 typedef enum - { + { GRUB_EFI_LOONGSON_SYSTEM_RAM_LOW = 1, GRUB_EFI_LOONGSON_SYSTEM_RAM_HIGH, GRUB_EFI_LOONGSON_MEMORY_RESERVED, @@ -298,6 +298,6 @@ typedef struct { }GRUB_PACKED vbios; -grub_uint32_t +grub_uint32_t EXPORT_FUNC (grub_efi_loongson_memmap_sort) (struct memmap array[], grub_uint32_t length, mem_map * bpmem, grub_uint32_t index, grub_uint32_t memtype); #endif /* ! GRUB_EFI_LOONGSON_HEADER */ diff --git a/GRUB2/MOD_SRC/grub-2.04/include/grub/term.h b/GRUB2/MOD_SRC/grub-2.04/include/grub/term.h index a2bd7a99e2a..856b706de0f 100644 --- a/GRUB2/MOD_SRC/grub-2.04/include/grub/term.h +++ b/GRUB2/MOD_SRC/grub-2.04/include/grub/term.h @@ -363,8 +363,8 @@ grub_term_gotoxy (struct grub_term_output *term, struct grub_term_coordinate pos term->gotoxy (term, pos); } -static inline void -grub_term_setcolorstate (struct grub_term_output *term, +static inline void +grub_term_setcolorstate (struct grub_term_output *term, grub_term_color_state state) { if (term->setcolorstate) @@ -375,20 +375,20 @@ static inline void grub_setcolorstate (grub_term_color_state state) { struct grub_term_output *term; - + FOR_ACTIVE_TERM_OUTPUTS(term) grub_term_setcolorstate (term, state); } /* Turn on/off the cursor. */ -static inline void +static inline void grub_term_setcursor (struct grub_term_output *term, int on) { if (term->setcursor) term->setcursor (term, on); } -static inline void +static inline void grub_term_cls (struct grub_term_output *term) { if (term->cls) diff --git a/GRUB2/MOD_SRC/grub-2.04/include/grub/util/install.h b/GRUB2/MOD_SRC/grub-2.04/include/grub/util/install.h index 58aa50ee99b..197cf01c234 100644 --- a/GRUB2/MOD_SRC/grub-2.04/include/grub/util/install.h +++ b/GRUB2/MOD_SRC/grub-2.04/include/grub/util/install.h @@ -230,11 +230,11 @@ void grub_install_sgi_setup (const char *install_device, const char *imgfile, const char *destname); -int +int grub_install_compress_gzip (const char *src, const char *dest); -int +int grub_install_compress_lzop (const char *src, const char *dest); -int +int grub_install_compress_xz (const char *src, const char *dest); void diff --git a/GRUB2/MOD_SRC/grub-2.04/include/grub/ventoy.h b/GRUB2/MOD_SRC/grub-2.04/include/grub/ventoy.h index 129a28906cd..520550d9331 100644 --- a/GRUB2/MOD_SRC/grub-2.04/include/grub/ventoy.h +++ b/GRUB2/MOD_SRC/grub-2.04/include/grub/ventoy.h @@ -7,12 +7,12 @@ * 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 . * @@ -81,7 +81,7 @@ typedef struct ventoy_image_location /* * disk region data (region_count) - * If the image file has more than one fragments in disk, + * If the image file has more than one fragments in disk, * there will be more than one region data here. * */ @@ -103,7 +103,7 @@ typedef struct ventoy_os_param char vtoy_img_path[384]; // It seems to be enough, utf-8 format grub_uint64_t vtoy_img_size; // image file size in bytes - /* + /* * Ventoy will write a copy of ventoy_image_location data into runtime memory * this is the physically address and length of that memory. * Address 0 means no such data exist. @@ -113,7 +113,7 @@ typedef struct ventoy_os_param grub_uint64_t vtoy_img_location_addr; grub_uint32_t vtoy_img_location_len; - /* + /* * These 32 bytes are reserved by ventoy. * * vtoy_reserved[0]: vtoy_break_level @@ -154,8 +154,8 @@ typedef struct ventoy_windows_data typedef struct ventoy_secure_data { grub_uint8_t magic1[16]; /* VENTOY_GUID */ - grub_uint8_t diskuuid[16]; - grub_uint8_t Checksum[16]; + grub_uint8_t diskuuid[16]; + grub_uint8_t Checksum[16]; grub_uint8_t adminSHA256[32]; grub_uint8_t reserved[4000]; grub_uint8_t magic2[16]; /* VENTOY_GUID */ @@ -199,7 +199,7 @@ typedef struct ventoy_chain_head grub_uint64_t virt_img_size_in_bytes; grub_uint32_t boot_catalog; grub_uint8_t boot_catalog_sector[2048]; - + grub_uint32_t img_chunk_offset; grub_uint32_t img_chunk_num; @@ -301,7 +301,7 @@ grub_uint64_t grub_udf_get_file_offset(grub_file_t file); grub_uint64_t grub_udf_get_last_pd_size_offset(void); grub_uint64_t grub_udf_get_last_file_attr_offset ( - grub_file_t file, + grub_file_t file, grub_uint32_t *startBlock, grub_uint64_t *fe_entry_size_offset ); diff --git a/GRUB2/MOD_SRC/grub-2.04/install.sh b/GRUB2/MOD_SRC/grub-2.04/install.sh index 45c7cb7cbca..952c64356a7 100644 --- a/GRUB2/MOD_SRC/grub-2.04/install.sh +++ b/GRUB2/MOD_SRC/grub-2.04/install.sh @@ -42,8 +42,8 @@ elif [ "$1" = "mips64el" ]; then grub-mkimage -v --directory "$VT_DIR/GRUB2/INSTALL/lib/grub/mips64el-efi" --prefix '(,2)/grub' --output "$VT_DIR/INSTALL/EFI/BOOT/BOOTMIPS.EFI" --format 'mips64el-efi' --compression 'auto' $all_modules_mips64el_uefi else all_modules="$net_modules_legacy $all_modules_legacy " - grub-mkimage -v --directory "$VT_DIR/GRUB2/INSTALL/lib/grub/i386-pc" --prefix '(,2)/grub' --output "$VT_DIR/INSTALL/grub/i386-pc/core.img" --format 'i386-pc' --compression 'auto' $all_modules_legacy 'fat' 'part_msdos' 'biosdisk' - + grub-mkimage -v --directory "$VT_DIR/GRUB2/INSTALL/lib/grub/i386-pc" --prefix '(,2)/grub' --output "$VT_DIR/INSTALL/grub/i386-pc/core.img" --format 'i386-pc' --compression 'auto' $all_modules_legacy 'fat' 'part_msdos' 'biosdisk' + #grub-mkimage -v --directory "$VT_DIR/GRUB2/INSTALL/lib/grub/i386-pc" -c "$VT_DIR/LiveCD/GRUB/embed.cfg" --prefix '/EFI/boot' --output "$VT_DIR/LiveCD/GRUB/cdrom.img" --format 'i386-pc-eltorito' --compression 'auto' $all_modules_legacy 'biosdisk' 'iso9660' 'fat' 'part_msdos' #rm -f $VT_DIR/LiveCD/GRUB/boot_hybrid.img #cp -a $VT_DIR/GRUB2/INSTALL/lib/grub/i386-pc/boot_hybrid.img $VT_DIR/LiveCD/GRUB/boot_hybrid.img @@ -54,11 +54,11 @@ grub-mknetdir --modules="$all_modules" --net-directory=$VT_DIR/GRUB2/PXE --sub if [ "$1" = "uefi" ]; then rm -f $VT_DIR/GRUB2/NBP/core.efi cp -a $VT_DIR/GRUB2/PXE/grub2/x86_64-efi/core.efi $VT_DIR/GRUB2/NBP/core.efi || exit 1 - + rm -rf $VT_DIR/INSTALL/grub/x86_64-efi mkdir -p $VT_DIR/INSTALL/grub/x86_64-efi - - cp -a $VT_DIR/GRUB2/PXE/grub2/x86_64-efi/normal.mod $VT_DIR/INSTALL/grub/x86_64-efi/normal.mod || exit 1 + + cp -a $VT_DIR/GRUB2/PXE/grub2/x86_64-efi/normal.mod $VT_DIR/INSTALL/grub/x86_64-efi/normal.mod || exit 1 #copy other modules ls -1 $VT_DIR/GRUB2/INSTALL/lib/grub/x86_64-efi/ | egrep '\.(lst|mod)$' | while read line; do @@ -70,11 +70,11 @@ if [ "$1" = "uefi" ]; then elif [ "$1" = "i386efi" ]; then rm -f $VT_DIR/GRUB2/NBP/core.efi cp -a $VT_DIR/GRUB2/PXE/grub2/i386-efi/core.efi $VT_DIR/GRUB2/NBP/core.efi || exit 1 - + rm -rf $VT_DIR/INSTALL/grub/i386-efi mkdir -p $VT_DIR/INSTALL/grub/i386-efi - cp -a $VT_DIR/GRUB2/PXE/grub2/i386-efi/normal.mod $VT_DIR/INSTALL/grub/i386-efi/normal.mod || exit 1 + cp -a $VT_DIR/GRUB2/PXE/grub2/i386-efi/normal.mod $VT_DIR/INSTALL/grub/i386-efi/normal.mod || exit 1 #copy other modules ls -1 $VT_DIR/GRUB2/INSTALL/lib/grub/i386-efi/ | egrep '\.(lst|mod)$' | while read line; do @@ -86,11 +86,11 @@ elif [ "$1" = "i386efi" ]; then elif [ "$1" = "arm64" ]; then rm -f $VT_DIR/GRUB2/NBP/core.efi cp -a $VT_DIR/GRUB2/PXE/grub2/arm64-efi/core.efi $VT_DIR/GRUB2/NBP/core.efi || exit 1 - + rm -rf $VT_DIR/INSTALL/grub/arm64-efi mkdir -p $VT_DIR/INSTALL/grub/arm64-efi - cp -a $VT_DIR/GRUB2/PXE/grub2/arm64-efi/normal.mod $VT_DIR/INSTALL/grub/arm64-efi/normal.mod || exit 1 + cp -a $VT_DIR/GRUB2/PXE/grub2/arm64-efi/normal.mod $VT_DIR/INSTALL/grub/arm64-efi/normal.mod || exit 1 #copy other modules ls -1 $VT_DIR/GRUB2/INSTALL/lib/grub/arm64-efi/ | egrep '\.(lst|mod)$' | while read line; do @@ -104,11 +104,11 @@ elif [ "$1" = "arm64" ]; then elif [ "$1" = "mips64el" ]; then rm -f $VT_DIR/GRUB2/NBP/core.efi cp -a $VT_DIR/GRUB2/PXE/grub2/mips64el-efi/core.efi $VT_DIR/GRUB2/NBP/core.efi || exit 1 - + rm -rf $VT_DIR/INSTALL/grub/mips64el-efi mkdir -p $VT_DIR/INSTALL/grub/mips64el-efi - cp -a $VT_DIR/GRUB2/PXE/grub2/mips64el-efi/normal.mod $VT_DIR/INSTALL/grub/mips64el-efi/normal.mod || exit 1 + cp -a $VT_DIR/GRUB2/PXE/grub2/mips64el-efi/normal.mod $VT_DIR/INSTALL/grub/mips64el-efi/normal.mod || exit 1 #copy other modules ls -1 $VT_DIR/GRUB2/INSTALL/lib/grub/mips64el-efi/ | egrep '\.(lst|mod)$' | while read line; do @@ -122,10 +122,10 @@ elif [ "$1" = "mips64el" ]; then else rm -f $VT_DIR/GRUB2/NBP/core.0 cp -a $VT_DIR/GRUB2/PXE/grub2/i386-pc/core.0 $VT_DIR/GRUB2/NBP/core.0 || exit 1 - + rm -f $VT_DIR/INSTALL/grub/i386-pc/boot.img cp -a $VT_DIR/GRUB2/INSTALL/lib/grub/i386-pc/boot.img $VT_DIR/INSTALL/grub/i386-pc/boot.img || exit 1 - + #copy other modules ls -1 $VT_DIR/GRUB2/INSTALL/lib/grub/i386-pc/ | egrep '\.(lst|mod)$' | while read line; do if ! echo $all_modules | grep -q " ${line%.mod} "; then diff --git a/GRUB2/MOD_SRC/grub-2.04/util/grub-install-common.c b/GRUB2/MOD_SRC/grub-2.04/util/grub-install-common.c index b18d55fd35d..43c0fe439b5 100644 --- a/GRUB2/MOD_SRC/grub-2.04/util/grub-install-common.c +++ b/GRUB2/MOD_SRC/grub-2.04/util/grub-install-common.c @@ -59,7 +59,7 @@ grub_install_help_filter (int key, const char *text, return xasprintf(text, "unicode"); case GRUB_INSTALL_OPTIONS_DIRECTORY: case GRUB_INSTALL_OPTIONS_DIRECTORY2: - return xasprintf(text, grub_util_get_pkglibdir ()); + return xasprintf(text, grub_util_get_pkglibdir ()); case GRUB_INSTALL_OPTIONS_LOCALE_DIRECTORY: return xasprintf(text, grub_util_get_localedir ()); case GRUB_INSTALL_OPTIONS_THEMES_DIRECTORY: @@ -80,7 +80,7 @@ grub_install_copy_file (const char *src, const char *dst, int is_needed) { - grub_util_fd_t in, out; + grub_util_fd_t in, out; ssize_t r; grub_util_info ("copying `%s' -> `%s'", src, dst); @@ -106,7 +106,7 @@ grub_install_copy_file (const char *src, if (!grub_install_copy_buffer) grub_install_copy_buffer = xmalloc (GRUB_INSTALL_COPY_BUFFER_SIZE); - + while (1) { r = grub_util_fd_read (in, grub_install_copy_buffer, GRUB_INSTALL_COPY_BUFFER_SIZE); @@ -437,7 +437,7 @@ grub_install_make_image_wrap_file (const char *dir, const char *prefix, const char *mkimage_target, int note) { const struct grub_install_image_target_desc *tgt; - const char *const compnames[] = + const char *const compnames[] = { [GRUB_COMPRESSION_AUTO] = "auto", [GRUB_COMPRESSION_NONE] = "none", @@ -738,7 +738,7 @@ static struct [GRUB_INSTALL_PLATFORM_ARM_COREBOOT] = { "arm", "coreboot" }, [GRUB_INSTALL_PLATFORM_RISCV32_EFI] = { "riscv32", "efi" }, [GRUB_INSTALL_PLATFORM_RISCV64_EFI] = { "riscv64", "efi" }, - }; + }; char * grub_install_get_platforms_string (void) @@ -766,7 +766,7 @@ grub_install_get_platforms_string (void) } ptr[-2] = 0; free (arr); - + return platforms_string; } @@ -937,7 +937,7 @@ grub_install_get_target (const char *src) fn = grub_util_path_concat (2, src, "modinfo.sh"); f = grub_util_fd_open (fn, GRUB_UTIL_FD_O_RDONLY); if (!GRUB_UTIL_FD_IS_VALID (f)) - grub_util_error (_("%s doesn't exist. Please specify --target or --directory"), + grub_util_error (_("%s doesn't exist. Please specify --target or --directory"), fn); r = grub_util_fd_read (f, buf, sizeof (buf) - 1); if (r < 0) diff --git a/GRUB2/MOD_SRC/grub-2.04/util/grub-install.c b/GRUB2/MOD_SRC/grub-2.04/util/grub-install.c index 76c7bbe1fb7..8fd9f86c221 100644 --- a/GRUB2/MOD_SRC/grub-2.04/util/grub-install.c +++ b/GRUB2/MOD_SRC/grub-2.04/util/grub-install.c @@ -86,17 +86,17 @@ enum OPTION_ROOT_DIRECTORY, OPTION_TARGET, OPTION_SETUP, - OPTION_MKRELPATH, - OPTION_MKDEVICEMAP, - OPTION_PROBE, - OPTION_EDITENV, - OPTION_ALLOW_FLOPPY, - OPTION_RECHECK, + OPTION_MKRELPATH, + OPTION_MKDEVICEMAP, + OPTION_PROBE, + OPTION_EDITENV, + OPTION_ALLOW_FLOPPY, + OPTION_RECHECK, OPTION_FORCE, OPTION_FORCE_FILE_ID, - OPTION_NO_NVRAM, - OPTION_REMOVABLE, - OPTION_BOOTLOADER_ID, + OPTION_NO_NVRAM, + OPTION_REMOVABLE, + OPTION_BOOTLOADER_ID, OPTION_EFI_DIRECTORY, OPTION_FONT, OPTION_DEBUG, @@ -114,7 +114,7 @@ enum static int fs_probe = 1; -static error_t +static error_t argp_parser (int key, char *arg, struct argp_state *state) { if (grub_install_parse (key, arg)) @@ -366,7 +366,7 @@ struct argp argp = { N_("Install GRUB on your drive.")"\v" N_("INSTALL_DEVICE must be system device filename.\n" "%s copies GRUB images into %s. On some platforms, it" - " may also install GRUB into the boot sector."), + " may also install GRUB into the boot sector."), NULL, help_filter, NULL }; @@ -693,7 +693,7 @@ write_to_disk (grub_device_t dev, const char *fn) core_size = grub_util_get_image_size (fn); - core_img = grub_util_read_image (fn); + core_img = grub_util_read_image (fn); grub_util_info ("writing `%s' to `%s'", fn, dev->disk->name); err = grub_disk_write (dev->disk, 0, 0, @@ -879,11 +879,11 @@ main (int argc, char *argv[]) const char * t; t = get_default_platform (); if (!t) - grub_util_error ("%s", + grub_util_error ("%s", _("Unable to determine your platform." " Use --target.") ); - target = xstrdup (t); + target = xstrdup (t); } grub_install_source_directory = grub_util_path_concat (2, grub_util_get_pkglibdir (), target); @@ -1071,7 +1071,7 @@ main (int argc, char *argv[]) for (curdev = efidir_device_names; *curdev; curdev++) grub_util_pull_device (*curdev); - + efidir_grub_devname = grub_util_get_grub_dev (efidir_device_names[0]); if (!efidir_grub_devname) grub_util_error (_("cannot find a GRUB drive for %s. Check your device.map"), @@ -1225,12 +1225,12 @@ main (int argc, char *argv[]) for (curdev = macppcdir_device_names; *curdev; curdev++) grub_util_pull_device (*curdev); - + macppcdir_grub_devname = grub_util_get_grub_dev (macppcdir_device_names[0]); if (!macppcdir_grub_devname) grub_util_error (_("cannot find a GRUB drive for %s. Check your device.map"), macppcdir_device_names[0]); - + macppcdir_grub_dev = grub_device_open (macppcdir_grub_devname); if (! macppcdir_grub_dev) grub_util_error ("%s", grub_errmsg); @@ -1274,7 +1274,7 @@ main (int argc, char *argv[]) ndev++; } - grub_drives = xmalloc (sizeof (grub_drives[0]) * (ndev + 1)); + grub_drives = xmalloc (sizeof (grub_drives[0]) * (ndev + 1)); for (curdev = grub_devices, curdrive = grub_drives; *curdev; curdev++, curdrive++) @@ -1706,7 +1706,7 @@ main (int argc, char *argv[]) { case GRUB_INSTALL_PLATFORM_I386_PC: { - char *boot_img_src = grub_util_path_concat (2, + char *boot_img_src = grub_util_path_concat (2, grub_install_source_directory, "boot.img"); char *boot_img = grub_util_path_concat (2, platdir, @@ -1725,7 +1725,7 @@ main (int argc, char *argv[]) platdir, device_map, install_device); - + /* Now perform the installation. */ if (install_bootsector) grub_util_bios_setup (platdir, "boot.img", "core.img", @@ -1735,7 +1735,7 @@ main (int argc, char *argv[]) } case GRUB_INSTALL_PLATFORM_SPARC64_IEEE1275: { - char *boot_img_src = grub_util_path_concat (2, + char *boot_img_src = grub_util_path_concat (2, grub_install_source_directory, "boot.img"); char *boot_img = grub_util_path_concat (2, platdir, @@ -1751,7 +1751,7 @@ main (int argc, char *argv[]) platdir, device_map, install_drive); - + /* Now perform the installation. */ if (install_bootsector) grub_util_sparc_setup (platdir, "boot.img", "core.img", diff --git a/GRUB2/MOD_SRC/grub-2.04/util/grub-mkconfig_lib.in b/GRUB2/MOD_SRC/grub-2.04/util/grub-mkconfig_lib.in index 0c820d5190e..633daa4e44b 100644 --- a/GRUB2/MOD_SRC/grub-2.04/util/grub-mkconfig_lib.in +++ b/GRUB2/MOD_SRC/grub-2.04/util/grub-mkconfig_lib.in @@ -68,7 +68,7 @@ is_path_readable_by_grub () # ... or if we can't figure out the abstraction module, for example if # memberlist fails on an LVM volume group. - if abstractions="`"${grub_probe}" -t abstraction "$path"`" 2> /dev/null ; then + if abstractions="`"${grub_probe}" -t abstraction "$path"`" 2> /dev/null ; then : else return 1 @@ -77,7 +77,7 @@ is_path_readable_by_grub () if [ x$GRUB_ENABLE_CRYPTODISK = xy ]; then return 0 fi - + for abstraction in $abstractions; do if [ "x$abstraction" = xcryptodisk ]; then return 1 diff --git a/GRUB2/MOD_SRC/grub-2.04/util/grub-mkimagexx.c b/GRUB2/MOD_SRC/grub-2.04/util/grub-mkimagexx.c index de8fd250450..8be8b4daee0 100644 --- a/GRUB2/MOD_SRC/grub-2.04/util/grub-mkimagexx.c +++ b/GRUB2/MOD_SRC/grub-2.04/util/grub-mkimagexx.c @@ -284,7 +284,7 @@ SUFFIX (grub_mkimage_generate_elf) (const struct grub_install_image_target_desc phdr->p_align = grub_host_to_target32 (layout->align > image_target->link_align ? layout->align : image_target->link_align); if (image_target->id == IMAGE_LOONGSON_ELF) - ehdr->e_flags = grub_host_to_target32 (0x1000 | EF_MIPS_NOREORDER + ehdr->e_flags = grub_host_to_target32 (0x1000 | EF_MIPS_NOREORDER | EF_MIPS_PIC | EF_MIPS_CPIC); else ehdr->e_flags = 0; @@ -457,7 +457,7 @@ SUFFIX (grub_mkimage_generate_elf) (const struct grub_install_image_target_desc if (note) { int note_size = sizeof (struct grub_ieee1275_note); - struct grub_ieee1275_note *note_ptr = (struct grub_ieee1275_note *) + struct grub_ieee1275_note *note_ptr = (struct grub_ieee1275_note *) (elf_img + program_size + header_size); grub_util_info ("adding CHRP NOTE segment"); @@ -2280,7 +2280,7 @@ SUFFIX (is_text_section) (Elf_Shdr *s, const struct grub_install_image_target_de static int SUFFIX (is_data_section) (Elf_Shdr *s, const struct grub_install_image_target_desc *image_target) { - if (!is_relocatable (image_target) + if (!is_relocatable (image_target) && grub_target_to_host32 (s->sh_type) != SHT_PROGBITS) return 0; return ((grub_target_to_host (s->sh_flags) & (SHF_EXECINSTR | SHF_ALLOC)) @@ -2466,7 +2466,7 @@ SUFFIX (locate_sections) (Elf_Ehdr *e, const char *kernel_path, layout->bss_start = layout->kernel_size; layout->end = layout->kernel_size; - + /* .bss */ for (i = 0, s = smd->sections; i < smd->num_sections; diff --git a/GRUB2/MOD_SRC/grub-2.04/util/grub-mknetdir.c b/GRUB2/MOD_SRC/grub-2.04/util/grub-mknetdir.c index 4db1e53ebec..ab2ae4fdeac 100644 --- a/GRUB2/MOD_SRC/grub-2.04/util/grub-mknetdir.c +++ b/GRUB2/MOD_SRC/grub-2.04/util/grub-mknetdir.c @@ -52,7 +52,7 @@ static struct argp_option options[] = { {0, 0, 0, 0, 0, 0} }; -static error_t +static error_t argp_parser (int key, char *arg, struct argp_state *state) { if (grub_install_parse (key, arg)) @@ -86,7 +86,7 @@ argp_parser (int key, char *arg, struct argp_state *state) struct argp argp = { options, argp_parser, NULL, "\v"N_("Prepares GRUB network boot images at net_directory/subdir " - "assuming net_directory being TFTP root."), + "assuming net_directory being TFTP root."), NULL, grub_install_help_filter, NULL }; diff --git a/GRUB2/MOD_SRC/grub-2.04/util/grub-mkrescue.c b/GRUB2/MOD_SRC/grub-2.04/util/grub-mkrescue.c index 190ebe43a17..20ddb9e303f 100644 --- a/GRUB2/MOD_SRC/grub-2.04/util/grub-mkrescue.c +++ b/GRUB2/MOD_SRC/grub-2.04/util/grub-mkrescue.c @@ -150,7 +150,7 @@ enum { SYS_AREA_ARCS } system_area = SYS_AREA_AUTO; -static error_t +static error_t argp_parser (int key, char *arg, struct argp_state *state) { if (grub_install_parse (key, arg)) @@ -494,7 +494,7 @@ main (int argc, char *argv[]) xorriso_push ("-as"); xorriso_push ("mkisofs"); xorriso_push ("-graft-points"); - + iso9660_dir = grub_util_make_temporary_dir (); grub_util_info ("temporary iso9660 dir is `%s'", iso9660_dir); boot_grub = grub_util_path_concat (3, iso9660_dir, "boot", "grub"); @@ -636,7 +636,7 @@ main (int argc, char *argv[]) strerror (errno)); fclose (bi); fwrite (buf, 1, 512, sa); - + grub_install_make_image_wrap_file (source_dirs[GRUB_INSTALL_PLATFORM_I386_PC], "/boot/grub", sa, sysarea_img, 0, load_cfg, @@ -645,7 +645,7 @@ main (int argc, char *argv[]) fflush (sa); grub_util_fd_sync (fileno (sa)); fclose (sa); - + if (sz > 32768) { grub_util_warn ("%s", _("Your xorriso doesn't support `--grub2-boot-info'. Your core image is too big. Boot as disk is disabled. Please use xorriso 1.2.9 or later.")); @@ -780,7 +780,7 @@ main (int argc, char *argv[]) make_image_fwdisk_abs (GRUB_INSTALL_PLATFORM_MIPS64EL_EFI, "mips64el-efi", imgname); free (imgname); - + imgname = grub_util_path_concat (2, efidir_efi_boot, "bootriscv32.efi"); make_image_fwdisk_abs (GRUB_INSTALL_PLATFORM_RISCV32_EFI, "riscv32-efi", imgname); diff --git a/GRUB2/MOD_SRC/grub-2.04/util/mkimage.c b/GRUB2/MOD_SRC/grub-2.04/util/mkimage.c index 766ab019f3c..ad4ce1cbdd8 100644 --- a/GRUB2/MOD_SRC/grub-2.04/util/mkimage.c +++ b/GRUB2/MOD_SRC/grub-2.04/util/mkimage.c @@ -121,7 +121,7 @@ static const struct grub_install_image_target_desc image_targets[] = .names = { "i386-pc", NULL }, .voidp_sizeof = 4, .bigendian = 0, - .id = IMAGE_I386_PC, + .id = IMAGE_I386_PC, .flags = PLATFORM_FLAGS_DECOMPRESSORS, .total_module_size = TARGET_NO_FIELD, .decompressor_compressed_size = GRUB_DECOMPRESSOR_I386_PC_COMPRESSED_SIZE, @@ -155,7 +155,7 @@ static const struct grub_install_image_target_desc image_targets[] = .names = { "i386-pc-pxe", NULL }, .voidp_sizeof = 4, .bigendian = 0, - .id = IMAGE_I386_PC_PXE, + .id = IMAGE_I386_PC_PXE, .flags = PLATFORM_FLAGS_DECOMPRESSORS, .total_module_size = TARGET_NO_FIELD, .decompressor_compressed_size = GRUB_DECOMPRESSOR_I386_PC_COMPRESSED_SIZE, @@ -171,7 +171,7 @@ static const struct grub_install_image_target_desc image_targets[] = .names = { "i386-pc-eltorito", NULL }, .voidp_sizeof = 4, .bigendian = 0, - .id = IMAGE_I386_PC_ELTORITO, + .id = IMAGE_I386_PC_ELTORITO, .flags = PLATFORM_FLAGS_DECOMPRESSORS, .total_module_size = TARGET_NO_FIELD, .decompressor_compressed_size = GRUB_DECOMPRESSOR_I386_PC_COMPRESSED_SIZE, @@ -203,7 +203,7 @@ static const struct grub_install_image_target_desc image_targets[] = .names = { "i386-ieee1275", NULL }, .voidp_sizeof = 4, .bigendian = 0, - .id = IMAGE_I386_IEEE1275, + .id = IMAGE_I386_IEEE1275, .flags = PLATFORM_FLAGS_NONE, .total_module_size = TARGET_NO_FIELD, .decompressor_compressed_size = TARGET_NO_FIELD, @@ -222,7 +222,7 @@ static const struct grub_install_image_target_desc image_targets[] = .names = { "i386-qemu", NULL }, .voidp_sizeof = 4, .bigendian = 0, - .id = IMAGE_QEMU, + .id = IMAGE_QEMU, .flags = PLATFORM_FLAGS_NONE, .total_module_size = TARGET_NO_FIELD, .decompressor_compressed_size = TARGET_NO_FIELD, @@ -236,8 +236,8 @@ static const struct grub_install_image_target_desc image_targets[] = .dirname = "x86_64-efi", .names = { "x86_64-efi", NULL }, .voidp_sizeof = 8, - .bigendian = 0, - .id = IMAGE_EFI, + .bigendian = 0, + .id = IMAGE_EFI, .flags = PLATFORM_FLAGS_NONE, .total_module_size = TARGET_NO_FIELD, .decompressor_compressed_size = TARGET_NO_FIELD, @@ -253,7 +253,7 @@ static const struct grub_install_image_target_desc image_targets[] = .names = { "i386-xen", NULL }, .voidp_sizeof = 4, .bigendian = 0, - .id = IMAGE_XEN, + .id = IMAGE_XEN, .flags = PLATFORM_FLAGS_NONE, .total_module_size = TARGET_NO_FIELD, .decompressor_compressed_size = TARGET_NO_FIELD, @@ -272,7 +272,7 @@ static const struct grub_install_image_target_desc image_targets[] = .names = { "x86_64-xen", NULL }, .voidp_sizeof = 8, .bigendian = 0, - .id = IMAGE_XEN, + .id = IMAGE_XEN, .flags = PLATFORM_FLAGS_NONE, .total_module_size = TARGET_NO_FIELD, .decompressor_compressed_size = TARGET_NO_FIELD, @@ -291,7 +291,7 @@ static const struct grub_install_image_target_desc image_targets[] = .names = { "mipsel-yeeloong-flash", NULL }, .voidp_sizeof = 4, .bigendian = 0, - .id = IMAGE_YEELOONG_FLASH, + .id = IMAGE_YEELOONG_FLASH, .flags = PLATFORM_FLAGS_DECOMPRESSORS, .total_module_size = GRUB_KERNEL_MIPS_LOONGSON_TOTAL_MODULE_SIZE, .decompressor_compressed_size = GRUB_DECOMPRESSOR_MIPS_LOONGSON_COMPRESSED_SIZE, @@ -309,7 +309,7 @@ static const struct grub_install_image_target_desc image_targets[] = .names = { "mipsel-fuloong2f-flash", NULL }, .voidp_sizeof = 4, .bigendian = 0, - .id = IMAGE_FULOONG2F_FLASH, + .id = IMAGE_FULOONG2F_FLASH, .flags = PLATFORM_FLAGS_DECOMPRESSORS, .total_module_size = GRUB_KERNEL_MIPS_LOONGSON_TOTAL_MODULE_SIZE, .decompressor_compressed_size = GRUB_DECOMPRESSOR_MIPS_LOONGSON_COMPRESSED_SIZE, @@ -329,7 +329,7 @@ static const struct grub_install_image_target_desc image_targets[] = "mipsel-fuloong-elf", NULL }, .voidp_sizeof = 4, .bigendian = 0, - .id = IMAGE_LOONGSON_ELF, + .id = IMAGE_LOONGSON_ELF, .flags = PLATFORM_FLAGS_DECOMPRESSORS, .total_module_size = GRUB_KERNEL_MIPS_LOONGSON_TOTAL_MODULE_SIZE, .decompressor_compressed_size = GRUB_DECOMPRESSOR_MIPS_LOONGSON_COMPRESSED_SIZE, @@ -347,7 +347,7 @@ static const struct grub_install_image_target_desc image_targets[] = .names = { "powerpc-ieee1275", NULL }, .voidp_sizeof = 4, .bigendian = 1, - .id = IMAGE_PPC, + .id = IMAGE_PPC, .flags = PLATFORM_FLAGS_NONE, .total_module_size = TARGET_NO_FIELD, .decompressor_compressed_size = TARGET_NO_FIELD, @@ -365,7 +365,7 @@ static const struct grub_install_image_target_desc image_targets[] = .dirname = "sparc64-ieee1275", .names = { "sparc64-ieee1275-raw", NULL }, .voidp_sizeof = 8, - .bigendian = 1, + .bigendian = 1, .id = IMAGE_SPARC64_RAW, .flags = PLATFORM_FLAGS_NONE, .total_module_size = GRUB_KERNEL_SPARC64_IEEE1275_TOTAL_MODULE_SIZE, @@ -381,7 +381,7 @@ static const struct grub_install_image_target_desc image_targets[] = .dirname = "sparc64-ieee1275", .names = { "sparc64-ieee1275-cdcore", NULL }, .voidp_sizeof = 8, - .bigendian = 1, + .bigendian = 1, .id = IMAGE_SPARC64_CDCORE, .flags = PLATFORM_FLAGS_NONE, .total_module_size = GRUB_KERNEL_SPARC64_IEEE1275_TOTAL_MODULE_SIZE, @@ -413,8 +413,8 @@ static const struct grub_install_image_target_desc image_targets[] = .dirname = "ia64-efi", .names = {"ia64-efi", NULL}, .voidp_sizeof = 8, - .bigendian = 0, - .id = IMAGE_EFI, + .bigendian = 0, + .id = IMAGE_EFI, .flags = PLATFORM_FLAGS_NONE, .total_module_size = TARGET_NO_FIELD, .decompressor_compressed_size = TARGET_NO_FIELD, @@ -430,7 +430,7 @@ static const struct grub_install_image_target_desc image_targets[] = .names = {"mips-arc", NULL}, .voidp_sizeof = 4, .bigendian = 1, - .id = IMAGE_MIPS_ARC, + .id = IMAGE_MIPS_ARC, .flags = PLATFORM_FLAGS_DECOMPRESSORS, .total_module_size = GRUB_KERNEL_MIPS_ARC_TOTAL_MODULE_SIZE, .decompressor_compressed_size = GRUB_DECOMPRESSOR_MIPS_LOONGSON_COMPRESSED_SIZE, @@ -448,7 +448,7 @@ static const struct grub_install_image_target_desc image_targets[] = .names = {"mipsel-arc", NULL}, .voidp_sizeof = 4, .bigendian = 0, - .id = IMAGE_MIPS_ARC, + .id = IMAGE_MIPS_ARC, .flags = PLATFORM_FLAGS_DECOMPRESSORS, .total_module_size = GRUB_KERNEL_MIPS_ARC_TOTAL_MODULE_SIZE, .decompressor_compressed_size = GRUB_DECOMPRESSOR_MIPS_LOONGSON_COMPRESSED_SIZE, @@ -466,7 +466,7 @@ static const struct grub_install_image_target_desc image_targets[] = .names = { "mipsel-qemu_mips-elf", NULL }, .voidp_sizeof = 4, .bigendian = 0, - .id = IMAGE_LOONGSON_ELF, + .id = IMAGE_LOONGSON_ELF, .flags = PLATFORM_FLAGS_DECOMPRESSORS, .total_module_size = GRUB_KERNEL_MIPS_QEMU_MIPS_TOTAL_MODULE_SIZE, .decompressor_compressed_size = GRUB_DECOMPRESSOR_MIPS_LOONGSON_COMPRESSED_SIZE, @@ -484,7 +484,7 @@ static const struct grub_install_image_target_desc image_targets[] = .names = { "mips-qemu_mips-flash", NULL }, .voidp_sizeof = 4, .bigendian = 1, - .id = IMAGE_QEMU_MIPS_FLASH, + .id = IMAGE_QEMU_MIPS_FLASH, .flags = PLATFORM_FLAGS_DECOMPRESSORS, .total_module_size = GRUB_KERNEL_MIPS_QEMU_MIPS_TOTAL_MODULE_SIZE, .decompressor_compressed_size = GRUB_DECOMPRESSOR_MIPS_LOONGSON_COMPRESSED_SIZE, @@ -502,7 +502,7 @@ static const struct grub_install_image_target_desc image_targets[] = .names = { "mipsel-qemu_mips-flash", NULL }, .voidp_sizeof = 4, .bigendian = 0, - .id = IMAGE_QEMU_MIPS_FLASH, + .id = IMAGE_QEMU_MIPS_FLASH, .flags = PLATFORM_FLAGS_DECOMPRESSORS, .total_module_size = GRUB_KERNEL_MIPS_QEMU_MIPS_TOTAL_MODULE_SIZE, .decompressor_compressed_size = GRUB_DECOMPRESSOR_MIPS_LOONGSON_COMPRESSED_SIZE, @@ -520,7 +520,7 @@ static const struct grub_install_image_target_desc image_targets[] = .names = { "mips-qemu_mips-elf", NULL }, .voidp_sizeof = 4, .bigendian = 1, - .id = IMAGE_LOONGSON_ELF, + .id = IMAGE_LOONGSON_ELF, .flags = PLATFORM_FLAGS_DECOMPRESSORS, .total_module_size = GRUB_KERNEL_MIPS_QEMU_MIPS_TOTAL_MODULE_SIZE, .decompressor_compressed_size = GRUB_DECOMPRESSOR_MIPS_LOONGSON_COMPRESSED_SIZE, @@ -538,7 +538,7 @@ static const struct grub_install_image_target_desc image_targets[] = .names = { "arm-uboot", NULL }, .voidp_sizeof = 4, .bigendian = 0, - .id = IMAGE_UBOOT, + .id = IMAGE_UBOOT, .flags = PLATFORM_FLAGS_NONE, .total_module_size = GRUB_KERNEL_ARM_UBOOT_TOTAL_MODULE_SIZE, .decompressor_compressed_size = TARGET_NO_FIELD, @@ -594,8 +594,8 @@ static const struct grub_install_image_target_desc image_targets[] = .dirname = "arm-efi", .names = { "arm-efi", NULL }, .voidp_sizeof = 4, - .bigendian = 0, - .id = IMAGE_EFI, + .bigendian = 0, + .id = IMAGE_EFI, .flags = PLATFORM_FLAGS_NONE, .total_module_size = TARGET_NO_FIELD, .decompressor_compressed_size = TARGET_NO_FIELD, @@ -1066,7 +1066,7 @@ grub_install_generate_image (const char *dir, const char *prefix, grub_util_info ("the core size is 0x%" GRUB_HOST_PRIxLONG_LONG, (unsigned long long) core_size); - if (!(image_target->flags & PLATFORM_FLAGS_DECOMPRESSORS) + if (!(image_target->flags & PLATFORM_FLAGS_DECOMPRESSORS) && image_target->total_module_size != TARGET_NO_FIELD) *((grub_uint32_t *) (core_img + image_target->total_module_size)) = grub_host_to_target32 (total_module_size); @@ -1092,7 +1092,7 @@ grub_install_generate_image (const char *dir, const char *prefix, default: grub_util_error (_("unknown compression %d"), comp); } - + decompress_path = grub_util_get_path (dir, name); decompress_size = grub_util_get_image_size (decompress_path); decompress_img = grub_util_read_image (decompress_path); @@ -1192,11 +1192,11 @@ grub_install_generate_image (const char *dir, const char *prefix, char *pxeboot_path, *pxeboot_img; size_t pxeboot_size; grub_uint32_t *ptr; - + pxeboot_path = grub_util_get_path (dir, "pxeboot.img"); pxeboot_size = grub_util_get_image_size (pxeboot_path); pxeboot_img = grub_util_read_image (pxeboot_path); - + grub_util_write_image (pxeboot_img, pxeboot_size, out, outname); free (pxeboot_img); @@ -1219,11 +1219,11 @@ grub_install_generate_image (const char *dir, const char *prefix, { char *eltorito_path, *eltorito_img; size_t eltorito_size; - + eltorito_path = grub_util_get_path (dir, "cdboot.img"); eltorito_size = grub_util_get_image_size (eltorito_path); eltorito_img = grub_util_read_image (eltorito_path); - + grub_util_write_image (eltorito_img, eltorito_size, out, outname); free (eltorito_img); @@ -1338,7 +1338,7 @@ grub_install_generate_image (const char *dir, const char *prefix, o->stack_commit_size = grub_host_to_target32 (0x10000); o->heap_reserve_size = grub_host_to_target32 (0x10000); o->heap_commit_size = grub_host_to_target32 (0x10000); - + o->num_data_directories = grub_host_to_target32 (GRUB_PE32_NUM_DATA_DIRECTORIES); o->base_relocation_table.rva = grub_host_to_target32 (reloc_addr); @@ -1351,7 +1351,7 @@ grub_install_generate_image (const char *dir, const char *prefix, c->optional_header_size = grub_host_to_target16 (sizeof (struct grub_pe64_optional_header)); - o = (struct grub_pe64_optional_header *) + o = (struct grub_pe64_optional_header *) (header + GRUB_PE32_MSDOS_STUB_SIZE + GRUB_PE32_SIGNATURE_SIZE + sizeof (struct grub_pe32_coff_header)); o->magic = grub_host_to_target16 (GRUB_PE32_PE64_MAGIC); @@ -1373,7 +1373,7 @@ grub_install_generate_image (const char *dir, const char *prefix, o->stack_commit_size = grub_host_to_target64 (0x10000); o->heap_reserve_size = grub_host_to_target64 (0x10000); o->heap_commit_size = grub_host_to_target64 (0x10000); - + o->num_data_directories = grub_host_to_target32 (GRUB_PE32_NUM_DATA_DIRECTORIES); @@ -1418,7 +1418,7 @@ grub_install_generate_image (const char *dir, const char *prefix, | GRUB_PE32_SCN_CNT_INITIALIZED_DATA | 0x80); #endif - + mods_section = data_section + 1; strcpy (mods_section->name, "mods"); mods_section->virtual_size = grub_cpu_to_le32 (reloc_addr - layout.kernel_size - header_size); @@ -1539,7 +1539,7 @@ grub_install_generate_image (const char *dir, const char *prefix, size_t boot_size; /* fwstart.img is the only part which can't be tested by using *-elf target. Check it against the checksum. */ - const grub_uint8_t yeeloong_fwstart_good_hash[512 / 8] = + const grub_uint8_t yeeloong_fwstart_good_hash[512 / 8] = { 0x5f, 0x67, 0x46, 0x57, 0x31, 0x30, 0xc5, 0x0a, 0xe9, 0x98, 0x18, 0xc9, 0xf3, 0xca, 0x45, 0xa5, @@ -1550,8 +1550,8 @@ grub_install_generate_image (const char *dir, const char *prefix, 0x5e, 0x5f, 0x23, 0x7d, 0x7a, 0xe8, 0x51, 0xf7, 0x1a, 0xaf, 0x2f, 0x54, 0x11, 0x2e, 0x5c, 0x25 }; - const grub_uint8_t fuloong2f_fwstart_good_hash[512 / 8] = - { + const grub_uint8_t fuloong2f_fwstart_good_hash[512 / 8] = + { 0x76, 0x9b, 0xad, 0x6e, 0xa2, 0x39, 0x47, 0x62, 0x1f, 0xc9, 0x3a, 0x6d, 0x05, 0x5c, 0x43, 0x5c, 0x29, 0x4a, 0x7e, 0x08, 0x2a, 0x31, 0x8f, 0x5d, @@ -1563,7 +1563,7 @@ grub_install_generate_image (const char *dir, const char *prefix, }; const grub_uint8_t *fwstart_good_hash; grub_uint8_t fwstart_hash[512 / 8]; - + if (image_target->id == IMAGE_FULOONG2F_FLASH) { fwstart_good_hash = fuloong2f_fwstart_good_hash; @@ -1592,7 +1592,7 @@ grub_install_generate_image (const char *dir, const char *prefix, rom_size = 512 * 1024; rom_img = xmalloc (rom_size); - memset (rom_img, 0, rom_size); + memset (rom_img, 0, rom_size); memcpy (rom_img, boot_img, boot_size); @@ -1618,7 +1618,7 @@ grub_install_generate_image (const char *dir, const char *prefix, rom_size = 512 * 1024; rom_img = xmalloc (rom_size); - memset (rom_img, 0, rom_size); + memset (rom_img, 0, rom_size); memcpy (rom_img, core_img, core_size); @@ -1724,7 +1724,7 @@ grub_install_generate_image (const char *dir, const char *prefix, head->entry = grub_host_to_target32 (target_addr); head->text_start = grub_host_to_target32 (target_addr); head->data_start = grub_host_to_target32 (target_addr + program_size); - grub_memcpy (section->name, ".text", sizeof (".text") - 1); + grub_memcpy (section->name, ".text", sizeof (".text") - 1); section->vaddr = grub_host_to_target32 (target_addr); section->size = grub_host_to_target32 (program_size); section->file_offset = grub_host_to_target32 (sizeof (*head) + sizeof (*section)); diff --git a/GRUB2/MOD_SRC/grub-2.04/util/setup.c b/GRUB2/MOD_SRC/grub-2.04/util/setup.c index 5d1c3e237f7..068996656a9 100644 --- a/GRUB2/MOD_SRC/grub-2.04/util/setup.c +++ b/GRUB2/MOD_SRC/grub-2.04/util/setup.c @@ -346,7 +346,7 @@ SETUP (const char *dir, root = drive; continue; } - grub_device_close (try_dev); + grub_device_close (try_dev); free (drive); } if (!root_dev) @@ -379,7 +379,7 @@ SETUP (const char *dir, tmp_img = xmalloc (GRUB_DISK_SECTOR_SIZE); if (grub_disk_read (dest_dev->disk, 0, 0, GRUB_DISK_SECTOR_SIZE, tmp_img)) grub_util_error ("%s", grub_errmsg); - + boot_drive_check = (grub_uint8_t *) (boot_img + GRUB_BOOT_MACHINE_DRIVE_CHECK); /* Copy the possible DOS BPB. */ @@ -541,7 +541,7 @@ SETUP (const char *dir, N_("Your embedding area is unusually small. " "core.img won't fit in it.")); } - + if (err) { grub_util_warn ("%s", grub_errmsg); @@ -556,7 +556,7 @@ SETUP (const char *dir, while (bl.block->len) { grub_memset (bl.block, 0, sizeof (*bl.block)); - + bl.block--; if ((char *) bl.block <= core_img) @@ -617,7 +617,7 @@ SETUP (const char *dir, - sizeof (*bl.block)); #if GRUB_SETUP_BIOS grub_size_t no_rs_length; - no_rs_length = grub_target_to_host16 + no_rs_length = grub_target_to_host16 (grub_get_unaligned16 (core_img + GRUB_DISK_SECTOR_SIZE + GRUB_KERNEL_I386_PC_NO_REED_SOLOMON_LENGTH)); @@ -843,7 +843,7 @@ SETUP (const char *dir, ptr += cur; len -= cur; bl.block--; - + if ((char *) bl.block <= core_img) grub_util_error ("%s", _("no terminator in the core image")); } diff --git a/IMG/cpio/sbin/init b/IMG/cpio/sbin/init index 15686c4eb71..24c07b55a1c 100644 --- a/IMG/cpio/sbin/init +++ b/IMG/cpio/sbin/init @@ -1,20 +1,20 @@ #!/ventoy/busybox/ash #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ #################################################################### @@ -68,7 +68,7 @@ elif [ "$VTOY_ARCH" = "x86_64" ]; then if [ -s $BUSYBOX_PATH/busybox ]; then $BUSYBOX_PATH/vtchmod64 $BUSYBOX_PATH/busybox else - $BUSYBOX_PATH/xzminidec64_musl < $BUSYBOX_PATH/busybox64.xz > $BUSYBOX_PATH/busybox + $BUSYBOX_PATH/xzminidec64_musl < $BUSYBOX_PATH/busybox64.xz > $BUSYBOX_PATH/busybox $BUSYBOX_PATH/vtchmod64_musl $BUSYBOX_PATH/busybox fi else @@ -120,7 +120,7 @@ if [ "$VTOY_ARCH" = "x86_64" ]; then ln -s $BUSYBOX_PATH/xzminidec64 $BUSYBOX_PATH/xzminidec ln -s $VTOY_PATH/tool/dmsetup64 $VTOY_PATH/tool/dmsetup ln -s $VTOY_PATH/tool/lunzip64 $VTOY_PATH/tool/lunzip - + rm -f $VTOY_PATH/tool/lz4cat $VTOY_PATH/tool/zstdcat ln -s $VTOY_PATH/tool/lz4cat64 $VTOY_PATH/tool/lz4cat ln -s $VTOY_PATH/tool/zstdcat64 $VTOY_PATH/tool/zstdcat @@ -141,13 +141,13 @@ elif [ "$VTOY_ARCH" = "mips64el" ]; then echo "Use MIPS64 busybox toolkit ..." >>$VTLOG ln -s $BUSYBOX_PATH/xzminidecm64e $BUSYBOX_PATH/xzminidec ln -s $VTOY_PATH/tool/dmsetupm64e $VTOY_PATH/tool/dmsetup - + # TBD #ln -s $VTOY_PATH/tool/lunzipm64e $VTOY_PATH/tool/lunzip - + rm -f $VTOY_PATH/tool/lz4cat $VTOY_PATH/tool/zstdcat ln -s $VTOY_PATH/tool/lz4catm64e $VTOY_PATH/tool/lz4cat - + # TBD #ln -s $VTOY_PATH/tool/zstdcataa64 $VTOY_PATH/tool/zstdcat @@ -156,7 +156,7 @@ elif [ "$VTOY_ARCH" = "aarch64" ]; then ln -s $BUSYBOX_PATH/xzminidecaa64 $BUSYBOX_PATH/xzminidec ln -s $VTOY_PATH/tool/dmsetupaa64 $VTOY_PATH/tool/dmsetup ln -s $VTOY_PATH/tool/lunzipaa64 $VTOY_PATH/tool/lunzip - + rm -f $VTOY_PATH/tool/lz4cat $VTOY_PATH/tool/zstdcat ln -s $VTOY_PATH/tool/lz4cataa64 $VTOY_PATH/tool/lz4cat ln -s $VTOY_PATH/tool/zstdcataa64 $VTOY_PATH/tool/zstdcat diff --git a/IMG/cpio/ventoy/hook/adelie/disk-hook.sh b/IMG/cpio/ventoy/hook/adelie/disk-hook.sh index 8ee05793258..ace73cb68ce 100644 --- a/IMG/cpio/ventoy/hook/adelie/disk-hook.sh +++ b/IMG/cpio/ventoy/hook/adelie/disk-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/hook/adelie/ventoy-hook.sh b/IMG/cpio/ventoy/hook/adelie/ventoy-hook.sh index 00d9eb0dd46..bd8b7290131 100644 --- a/IMG/cpio/ventoy/hook/adelie/ventoy-hook.sh +++ b/IMG/cpio/ventoy/hook/adelie/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh diff --git a/IMG/cpio/ventoy/hook/alpine/insert.sh b/IMG/cpio/ventoy/hook/alpine/insert.sh index 65c47fa58ac..dee27945194 100644 --- a/IMG/cpio/ventoy/hook/alpine/insert.sh +++ b/IMG/cpio/ventoy/hook/alpine/insert.sh @@ -1,4 +1,4 @@ -for i in 1 2; do +for i in 1 2; do if [ $i -eq 2 ]; then /ventoy/busybox/sh /ventoy/hook/alpine/udev_disk_hook.sh fi diff --git a/IMG/cpio/ventoy/hook/alpine/udev_disk_hook.sh b/IMG/cpio/ventoy/hook/alpine/udev_disk_hook.sh index df4953eccf7..fe42d8a6bde 100644 --- a/IMG/cpio/ventoy/hook/alpine/udev_disk_hook.sh +++ b/IMG/cpio/ventoy/hook/alpine/udev_disk_hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh @@ -32,7 +32,7 @@ fi # # longpanda: -# Alpine initramfs doesn't contain dm-mod or fuse module, +# Alpine initramfs doesn't contain dm-mod or fuse module, # and even the worse, the libpthread.so is not included too. # So here we directly dump the modloop squashfs file from disk to rootfs. # Fortunately, this file is not too big (< 100MB in alpine 3.11.3). diff --git a/IMG/cpio/ventoy/hook/alpine/ventoy-hook.sh b/IMG/cpio/ventoy/hook/alpine/ventoy-hook.sh index f894966fd3b..72baf41e5d2 100644 --- a/IMG/cpio/ventoy/hook/alpine/ventoy-hook.sh +++ b/IMG/cpio/ventoy/hook/alpine/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh @@ -28,7 +28,7 @@ while read line; do LineEnd=$(echo $line | awk -F: '{print $1}') if [ $LineEnd -gt $LineBegin ]; then sed "${LineEnd}i\done" -i /init - sed "${LineBegin}r /ventoy/hook/alpine/insert.sh" -i /init + sed "${LineBegin}r /ventoy/hook/alpine/insert.sh" -i /init break fi done < /t.list diff --git a/IMG/cpio/ventoy/hook/alt/udev_disk_hook.sh b/IMG/cpio/ventoy/hook/alt/udev_disk_hook.sh index 9a7fc661445..d2f011e2f38 100644 --- a/IMG/cpio/ventoy/hook/alt/udev_disk_hook.sh +++ b/IMG/cpio/ventoy/hook/alt/udev_disk_hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh @@ -30,7 +30,7 @@ if ! [ -e $VTOY_DM_PATH ]; then mknod -m 0666 $VTOY_DM_PATH b $blkdev_num fi -# +# # We do a trick for ATL series here. # Use /dev/vtCheatLoop and wapper it as a cdrom with bind mount. # Then the installer will accept /dev/vtCheatLoop as the install medium. diff --git a/IMG/cpio/ventoy/hook/alt/ventoy-hook.sh b/IMG/cpio/ventoy/hook/alt/ventoy-hook.sh index 3fabb01ec7c..74668761e12 100644 --- a/IMG/cpio/ventoy/hook/alt/ventoy-hook.sh +++ b/IMG/cpio/ventoy/hook/alt/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh diff --git a/IMG/cpio/ventoy/hook/android/ventoy-disk.sh b/IMG/cpio/ventoy/hook/android/ventoy-disk.sh index a9aee8d8c9b..17376489795 100644 --- a/IMG/cpio/ventoy/hook/android/ventoy-disk.sh +++ b/IMG/cpio/ventoy/hook/android/ventoy-disk.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/hook/android/ventoy-hook.sh b/IMG/cpio/ventoy/hook/android/ventoy-hook.sh index 4a315be6b0a..4b6e034cb89 100644 --- a/IMG/cpio/ventoy/hook/android/ventoy-hook.sh +++ b/IMG/cpio/ventoy/hook/android/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh diff --git a/IMG/cpio/ventoy/hook/arch/ovios-disk.sh b/IMG/cpio/ventoy/hook/arch/ovios-disk.sh index 561dc27a0a5..ae66db77ffd 100644 --- a/IMG/cpio/ventoy/hook/arch/ovios-disk.sh +++ b/IMG/cpio/ventoy/hook/arch/ovios-disk.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/hook/arch/ventoy-disk.sh b/IMG/cpio/ventoy/hook/arch/ventoy-disk.sh index 31e65f0972d..df38f213059 100644 --- a/IMG/cpio/ventoy/hook/arch/ventoy-disk.sh +++ b/IMG/cpio/ventoy/hook/arch/ventoy-disk.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh @@ -49,7 +49,7 @@ done if [ -n "$1" ]; then vtlog "ln -s /dev/$vtDM $1" - + if [ -e "$1" ]; then vtlog "$1 already exist" else @@ -58,18 +58,18 @@ if [ -n "$1" ]; then else vtLABEL=$($BUSYBOX_PATH/blkid /dev/$vtDM | $SED 's/.*LABEL="\([^"]*\)".*/\1/') vtlog "vtLABEL is $vtLABEL" - + if [ -z "$vtLABEL" ]; then vtLABEL=$($SED "s/.*label=\([^ ]*\)/\1/" /proc/cmdline) vtlog "vtLABEL is $vtLABEL from cmdline" fi - + if [ -e "/dev/disk/by-label/$vtLABEL" ]; then vtlog "$1 already exist" else ln -s /dev/$vtDM "/dev/disk/by-label/$vtLABEL" fi -fi +fi # OK finish set_ventoy_hook_finish diff --git a/IMG/cpio/ventoy/hook/arch/ventoy-hook.sh b/IMG/cpio/ventoy/hook/arch/ventoy-hook.sh index 5428e5e02d3..81a34777620 100644 --- a/IMG/cpio/ventoy/hook/arch/ventoy-hook.sh +++ b/IMG/cpio/ventoy/hook/arch/ventoy-hook.sh @@ -1,29 +1,29 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh if $GREP -q '^"$mount_handler"' /init; then echo 'use mount_handler1 ...' >> $VTLOG - + vthookfile=/hooks/archiso - + if [ -e /hooks/miso ]; then vthookfile=/hooks/miso $SED "/^\"\$mount_handler\"/i\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/arch/ventoy-disk.sh \"\$misodevice\"" -i /init @@ -33,22 +33,22 @@ if $GREP -q '^"$mount_handler"' /init; then else $SED "/^\"\$mount_handler\"/i\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/arch/ventoy-disk.sh \"\$archisodevice\"" -i /init fi - + if [ -f $vthookfile ]; then $SED '/while ! poll_device "${dev}"/a\ if /ventoy/busybox/sh /ventoy/hook/arch/ventoy-timeout.sh ${dev}; then break; fi' -i $vthookfile fi elif $GREP -q '^$mount_handler' /init; then echo 'use mount_handler2 ...' >> $VTLOG $SED "/^\$mount_handler/i\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/arch/ventoy-disk.sh" -i /init - + elif $GREP -q '^KEEP_SEARCHING' /init; then echo 'KEEP_SEARCHING found ...' >> $VTLOG $SED "/^KEEP_SEARCHING/i\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/arch/ovios-disk.sh " -i /init - - $BUSYBOX_PATH/mkdir -p /dev + + $BUSYBOX_PATH/mkdir -p /dev $BUSYBOX_PATH/mkdir -p /sys $BUSYBOX_PATH/mount -t sysfs sys /sys - + else # some archlinux initramfs doesn't contain device-mapper udev rules file ARCH_UDEV_DIR=$(ventoy_get_udev_conf_dir) @@ -66,5 +66,5 @@ else fi if [ -f $VTOY_PATH/ventoy_persistent_map ]; then - $SED "1 aexport cow_label=vtoycow" -i /init + $SED "1 aexport cow_label=vtoycow" -i /init fi diff --git a/IMG/cpio/ventoy/hook/arch/ventoy-timeout.sh b/IMG/cpio/ventoy/hook/arch/ventoy-timeout.sh index fec9cc0770a..fc4cb388ec3 100644 --- a/IMG/cpio/ventoy/hook/arch/ventoy-timeout.sh +++ b/IMG/cpio/ventoy/hook/arch/ventoy-timeout.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/hook/aryalinux/disk_hook.sh b/IMG/cpio/ventoy/hook/aryalinux/disk_hook.sh index 4b625c510b7..5bb21e3a645 100644 --- a/IMG/cpio/ventoy/hook/aryalinux/disk_hook.sh +++ b/IMG/cpio/ventoy/hook/aryalinux/disk_hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/hook/aryalinux/ventoy-hook.sh b/IMG/cpio/ventoy/hook/aryalinux/ventoy-hook.sh index 1900fd00b72..5e6a0e23eda 100644 --- a/IMG/cpio/ventoy/hook/aryalinux/ventoy-hook.sh +++ b/IMG/cpio/ventoy/hook/aryalinux/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh diff --git a/IMG/cpio/ventoy/hook/austrumi/disk_hook.sh b/IMG/cpio/ventoy/hook/austrumi/disk_hook.sh index 431ccd53103..bfc2e3ae032 100644 --- a/IMG/cpio/ventoy/hook/austrumi/disk_hook.sh +++ b/IMG/cpio/ventoy/hook/austrumi/disk_hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/hook/austrumi/ventoy-hook.sh b/IMG/cpio/ventoy/hook/austrumi/ventoy-hook.sh index 5785dee25b3..e95d367a318 100644 --- a/IMG/cpio/ventoy/hook/austrumi/ventoy-hook.sh +++ b/IMG/cpio/ventoy/hook/austrumi/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh diff --git a/IMG/cpio/ventoy/hook/berry/ventoy-disk.sh b/IMG/cpio/ventoy/hook/berry/ventoy-disk.sh index d318f98f867..01371dcf9ca 100644 --- a/IMG/cpio/ventoy/hook/berry/ventoy-disk.sh +++ b/IMG/cpio/ventoy/hook/berry/ventoy-disk.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/hook/berry/ventoy-hook.sh b/IMG/cpio/ventoy/hook/berry/ventoy-hook.sh index 2558523dcf3..d0c4558cffd 100644 --- a/IMG/cpio/ventoy/hook/berry/ventoy-hook.sh +++ b/IMG/cpio/ventoy/hook/berry/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ $SED "/for .*\$DEVICES/i\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/berry/ventoy-disk.sh" -i /init diff --git a/IMG/cpio/ventoy/hook/blackPanther/ventoy-hook.sh b/IMG/cpio/ventoy/hook/blackPanther/ventoy-hook.sh index e3b19f40e74..4e7ea669767 100644 --- a/IMG/cpio/ventoy/hook/blackPanther/ventoy-hook.sh +++ b/IMG/cpio/ventoy/hook/blackPanther/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh diff --git a/IMG/cpio/ventoy/hook/blackPanther/ventoy-inotifyd-hook.sh b/IMG/cpio/ventoy/hook/blackPanther/ventoy-inotifyd-hook.sh index caa80d4c9bb..35419eee700 100644 --- a/IMG/cpio/ventoy/hook/blackPanther/ventoy-inotifyd-hook.sh +++ b/IMG/cpio/ventoy/hook/blackPanther/ventoy-inotifyd-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh @@ -28,15 +28,15 @@ VTPATH_OLD=$PATH; PATH=$BUSYBOX_PATH:$VTOY_PATH/tool:$PATH if is_inotify_ventoy_part $3; then vtlog "##### INOTIFYD: $2/$3 is created (YES) ..." - + vtlog "find ventoy partition ..." $BUSYBOX_PATH/sh $VTOY_PATH/hook/default/udev_disk_hook.sh $3 noreplace - blkdev_num_dev=$($VTOY_PATH/tool/dmsetup ls | grep ventoy | sed 's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1 \2/') + blkdev_num_dev=$($VTOY_PATH/tool/dmsetup ls | grep ventoy | sed 's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1 \2/') mknod -m 660 /dev/ventoy b $blkdev_num_dev blackPanther-root /dev/ventoy - set_ventoy_hook_finish + set_ventoy_hook_finish else vtlog "##### INOTIFYD: $2/$3 is created (NO) ..." fi diff --git a/IMG/cpio/ventoy/hook/blackPanther/ventoy-inotifyd-start.sh b/IMG/cpio/ventoy/hook/blackPanther/ventoy-inotifyd-start.sh index 62e10a3b32c..e4eabda1979 100644 --- a/IMG/cpio/ventoy/hook/blackPanther/ventoy-inotifyd-start.sh +++ b/IMG/cpio/ventoy/hook/blackPanther/ventoy-inotifyd-start.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh @@ -24,7 +24,7 @@ vtHook=$($CAT $VTOY_PATH/inotifyd-hook-script.txt) vtdisk=$(get_ventoy_disk_name) if [ "$vtdisk" = "unknown" ]; then vtlog "... start inotifyd listen $vtHook ..." - $BUSYBOX_PATH/nohup $VTOY_PATH/tool/inotifyd $vtHook /dev:n 2>&- & + $BUSYBOX_PATH/nohup $VTOY_PATH/tool/inotifyd $vtHook /dev:n 2>&- & else vtlog "... $vtdisk already exist ..." $BUSYBOX_PATH/sh $vtHook n /dev "${vtdisk#/dev/}2" diff --git a/IMG/cpio/ventoy/hook/cdlinux/disk-hook.sh b/IMG/cpio/ventoy/hook/cdlinux/disk-hook.sh index 3e46fbfd15a..94d0daba992 100644 --- a/IMG/cpio/ventoy/hook/cdlinux/disk-hook.sh +++ b/IMG/cpio/ventoy/hook/cdlinux/disk-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/hook/cdlinux/ventoy-hook.sh b/IMG/cpio/ventoy/hook/cdlinux/ventoy-hook.sh index 0bbe835b346..3eda0d4658d 100644 --- a/IMG/cpio/ventoy/hook/cdlinux/ventoy-hook.sh +++ b/IMG/cpio/ventoy/hook/cdlinux/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh diff --git a/IMG/cpio/ventoy/hook/chimera/disk_hook.sh b/IMG/cpio/ventoy/hook/chimera/disk_hook.sh index 5cb1f233d34..16f236dad44 100644 --- a/IMG/cpio/ventoy/hook/chimera/disk_hook.sh +++ b/IMG/cpio/ventoy/hook/chimera/disk_hook.sh @@ -1,25 +1,25 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh -for i in 0 1 2 3 4 5 6 7 8 9; do +for i in 0 1 2 3 4 5 6 7 8 9; do vtdiskname=$(get_ventoy_disk_name) if [ "$vtdiskname" = "unknown" ]; then vtlog "wait for disk ..." diff --git a/IMG/cpio/ventoy/hook/chimera/ventoy-hook.sh b/IMG/cpio/ventoy/hook/chimera/ventoy-hook.sh index a1380882ad6..341d4b7ec27 100644 --- a/IMG/cpio/ventoy/hook/chimera/ventoy-hook.sh +++ b/IMG/cpio/ventoy/hook/chimera/ventoy-hook.sh @@ -1,22 +1,22 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh -$SED "/maybe_break *premount/a\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/chimera/disk_hook.sh" -i /init +$SED "/maybe_break *premount/a\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/chimera/disk_hook.sh" -i /init diff --git a/IMG/cpio/ventoy/hook/clear/disk-hook.sh b/IMG/cpio/ventoy/hook/clear/disk-hook.sh index 8ee05793258..ace73cb68ce 100644 --- a/IMG/cpio/ventoy/hook/clear/disk-hook.sh +++ b/IMG/cpio/ventoy/hook/clear/disk-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/hook/clear/hidden-hook.sh b/IMG/cpio/ventoy/hook/clear/hidden-hook.sh index 9b461b06715..fa5ec7e3035 100644 --- a/IMG/cpio/ventoy/hook/clear/hidden-hook.sh +++ b/IMG/cpio/ventoy/hook/clear/hidden-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/hook/clear/ventoy-hook.sh b/IMG/cpio/ventoy/hook/clear/ventoy-hook.sh index 3d7e2b55a87..99e3e703728 100644 --- a/IMG/cpio/ventoy/hook/clear/ventoy-hook.sh +++ b/IMG/cpio/ventoy/hook/clear/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh diff --git a/IMG/cpio/ventoy/hook/crux/disk_hook.sh b/IMG/cpio/ventoy/hook/crux/disk_hook.sh index 70d31b4d9eb..fccb2f2f88d 100644 --- a/IMG/cpio/ventoy/hook/crux/disk_hook.sh +++ b/IMG/cpio/ventoy/hook/crux/disk_hook.sh @@ -1,25 +1,25 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh -for i in 0 1 2 3 4 5 6 7 8 9; do +for i in 0 1 2 3 4 5 6 7 8 9; do vtdiskname=$(get_ventoy_disk_name) if [ "$vtdiskname" = "unknown" ]; then vtlog "wait for disk ..." diff --git a/IMG/cpio/ventoy/hook/crux/ventoy-hook.sh b/IMG/cpio/ventoy/hook/crux/ventoy-hook.sh index 8c5d048da4a..87a31ee334c 100644 --- a/IMG/cpio/ventoy/hook/crux/ventoy-hook.sh +++ b/IMG/cpio/ventoy/hook/crux/ventoy-hook.sh @@ -1,22 +1,22 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh -$SED "/find_and_mount_media.*(/a\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/crux/disk_hook.sh" -i /init +$SED "/find_and_mount_media.*(/a\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/crux/disk_hook.sh" -i /init diff --git a/IMG/cpio/ventoy/hook/cucumber/disk-hook.sh b/IMG/cpio/ventoy/hook/cucumber/disk-hook.sh index a5b7b955a13..750469e1d9d 100644 --- a/IMG/cpio/ventoy/hook/cucumber/disk-hook.sh +++ b/IMG/cpio/ventoy/hook/cucumber/disk-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/hook/cucumber/ventoy-hook.sh b/IMG/cpio/ventoy/hook/cucumber/ventoy-hook.sh index 4f0363c2609..603a49a0e2b 100644 --- a/IMG/cpio/ventoy/hook/cucumber/ventoy-hook.sh +++ b/IMG/cpio/ventoy/hook/cucumber/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh diff --git a/IMG/cpio/ventoy/hook/daphile/disk_hook.sh b/IMG/cpio/ventoy/hook/daphile/disk_hook.sh index 652f942d7e5..13116836b95 100644 --- a/IMG/cpio/ventoy/hook/daphile/disk_hook.sh +++ b/IMG/cpio/ventoy/hook/daphile/disk_hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh @@ -25,7 +25,7 @@ $BUSYBOX_PATH/modprobe virtio_blk 2>/dev/null $BUSYBOX_PATH/modprobe virtio_pci 2>/dev/null -for i in 0 1 2 3 4 5 6 7 8 9; do +for i in 0 1 2 3 4 5 6 7 8 9; do vtdiskname=$(get_ventoy_disk_name) if [ "$vtdiskname" = "unknown" ]; then vtlog "wait for disk ..." diff --git a/IMG/cpio/ventoy/hook/daphile/ventoy-hook.sh b/IMG/cpio/ventoy/hook/daphile/ventoy-hook.sh index 8deee628f9e..1b658027a6f 100644 --- a/IMG/cpio/ventoy/hook/daphile/ventoy-hook.sh +++ b/IMG/cpio/ventoy/hook/daphile/ventoy-hook.sh @@ -1,24 +1,24 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh -$SED "/mount_boot[^(]*$/i\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/daphile/disk_hook.sh" -i /init +$SED "/mount_boot[^(]*$/i\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/daphile/disk_hook.sh" -i /init $SED "s#'\.\*/block/mmcblk[^ ]*'#'\.\*/block/dm-[0-9]*'#" -i /init diff --git a/IMG/cpio/ventoy/hook/debian/antix-disk.sh b/IMG/cpio/ventoy/hook/debian/antix-disk.sh index e515fd28288..6e4b40ea692 100644 --- a/IMG/cpio/ventoy/hook/debian/antix-disk.sh +++ b/IMG/cpio/ventoy/hook/debian/antix-disk.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh @@ -26,18 +26,18 @@ VTPATH_OLD=$PATH; PATH=$BUSYBOX_PATH:$VTOY_PATH/tool:$PATH ventoy_os_install_dmsetup_by_unsquashfs() { vtlog "ventoy_os_install_dmsetup_by_unsquashfs $*" - + vtKoPo=$(ventoy_get_module_postfix) vtlog "vtKoPo=$vtKoPo" vtoydm -i -f $VTOY_PATH/ventoy_image_map -d $1 > $VTOY_PATH/iso_file_list - vtline=$(grep '[-][-] linuxfs ' $VTOY_PATH/iso_file_list) + vtline=$(grep '[-][-] linuxfs ' $VTOY_PATH/iso_file_list) sector=$(echo $vtline | awk '{print $(NF-1)}') length=$(echo $vtline | awk '{print $NF}') - + vtoydm -E -f $VTOY_PATH/ventoy_image_map -d $1 -s $sector -l $length -o $VTOY_PATH/fsdisk - + dmModPath="/usr/lib/modules/$vtKerVer/kernel/drivers/md/dm-mod.$vtKoPo" echo $dmModPath > $VTOY_PATH/fsextract vtoy_unsquashfs -d $VTOY_PATH/sqfs -n -q -e $VTOY_PATH/fsextract $VTOY_PATH/fsdisk 2>>$VTLOG @@ -48,7 +48,7 @@ ventoy_os_install_dmsetup_by_unsquashfs() { echo $dmModPath > $VTOY_PATH/fsextract vtoy_unsquashfs -d $VTOY_PATH/sqfs -n -q -e $VTOY_PATH/fsextract $VTOY_PATH/fsdisk 2>>$VTLOG fi - + if [ -e $VTOY_PATH/sqfs${dmModPath} ]; then vtlog "success $VTOY_PATH/sqfs${dmModPath}" insmod $VTOY_PATH/sqfs${dmModPath} @@ -81,14 +81,14 @@ ventoy_os_install_dmsetup_by_fuse() { ventoy_os_install_dmsetup() { vtlog "ventoy_os_install_dmsetup" - + if grep -q 'device-mapper' /proc/devices; then vtlog "device-mapper module already loaded" return; fi - + vtKerVer=$(uname -r) - + if ventoy_os_install_dmsetup_by_unsquashfs $1 $vtKerVer; then vtlog "unsquashfs success" else diff --git a/IMG/cpio/ventoy/hook/debian/antix-hook.sh b/IMG/cpio/ventoy/hook/debian/antix-hook.sh index 64ad6ee2fb5..92aa0ce1d1c 100644 --- a/IMG/cpio/ventoy/hook/debian/antix-hook.sh +++ b/IMG/cpio/ventoy/hook/debian/antix-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ if $GREP -q 'FILTERED_LIST=[^a-zA-Z0-9_]*$' /init; then diff --git a/IMG/cpio/ventoy/hook/debian/bliss-disk.sh b/IMG/cpio/ventoy/hook/debian/bliss-disk.sh index b340bbeab5b..e0a2f026d37 100644 --- a/IMG/cpio/ventoy/hook/debian/bliss-disk.sh +++ b/IMG/cpio/ventoy/hook/debian/bliss-disk.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/hook/debian/bliss-hook.sh b/IMG/cpio/ventoy/hook/debian/bliss-hook.sh index 3910ea8cb7f..f14b546519a 100644 --- a/IMG/cpio/ventoy/hook/debian/bliss-hook.sh +++ b/IMG/cpio/ventoy/hook/debian/bliss-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ $BUSYBOX_PATH/mkdir /dev diff --git a/IMG/cpio/ventoy/hook/debian/default-hook.sh b/IMG/cpio/ventoy/hook/debian/default-hook.sh index 5db56e350f5..422fbb10666 100644 --- a/IMG/cpio/ventoy/hook/debian/default-hook.sh +++ b/IMG/cpio/ventoy/hook/debian/default-hook.sh @@ -1,30 +1,30 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ CD_DETECT="/var/lib/dpkg/info/cdrom-detect.postinst" if [ -e /init ] && $GREP -q '^mountroot$' /init; then echo "Here before mountroot ..." >> $VTLOG - + $SED "/^mountroot$/i\\$BUSYBOX_PATH/sh $VTOY_PATH/hook/debian/disk_mount_hook.sh" -i /init $SED "/^mountroot$/i\\export LIVEMEDIA=/dev/mapper/ventoy" -i /init - $SED "/^mountroot$/i\\export LIVE_MEDIA=/dev/mapper/ventoy" -i /init + $SED "/^mountroot$/i\\export LIVE_MEDIA=/dev/mapper/ventoy" -i /init if $GREP -q 'live-media=' /proc/cmdline; then if [ -f /scripts/casper ] && $GREP -q '^ *LIVEMEDIA=' /scripts/casper; then @@ -34,14 +34,14 @@ if [ -e /init ] && $GREP -q '^mountroot$' /init; then elif [ -e "$CD_DETECT" ]; then echo "$CD_DETECT exist, now add hook in it..." >> $VTLOG $SED "1 a $BUSYBOX_PATH/sh $VTOY_PATH/hook/debian/disk_mount_hook.sh" -i "$CD_DETECT" - + if [ -e /bin/list-devices ]; then mv /bin/list-devices /bin/list-devices-bk cp -a /ventoy/hook/debian/list-devices /bin/list-devices fi elif [ -e /init ] && $GREP -q '/start-udev$' /init; then echo "Here use notify ..." >> $VTLOG - + ventoy_set_inotify_script debian/ventoy-inotifyd-hook.sh $SED "/start-udev$/i\\mount -n -o mode=0755 -t devtmpfs devtmpfs /dev" -i /init $SED "/start-udev$/i\\$BUSYBOX_PATH/sh $VTOY_PATH/hook/default/ventoy-inotifyd-start.sh" -i /init @@ -53,7 +53,7 @@ fi if [ -f $VTOY_PATH/autoinstall ]; then echo "Do auto install ..." >> $VTLOG - + if $GREP -q '^autoinstall:' $VTOY_PATH/autoinstall; then echo "cloud-init auto install ..." >> $VTLOG if $GREP -q "maybe_break init" /init; then @@ -64,7 +64,7 @@ if [ -f $VTOY_PATH/autoinstall ]; then $SED "/^mount \/proc/a export file=$VTOY_PATH/autoinstall; export auto='true'; export priority='critical'" -i /init fi fi - + # if [ -e /bin/check-missing-firmware ]; then # $SED "/^#!/a\exit 0" -i /bin/check-missing-firmware # fi @@ -74,12 +74,12 @@ fi if [ -f /mod.img ] && [ -f /mod/fs/cramfs.ko ]; then echo "mount mod.img and install dm-mod.ko" >> $VTLOG $BUSYBOX_PATH/insmod /mod/fs/cramfs.ko - + $BUSYBOX_PATH/mkdir $VTOY_PATH/modmnt $BUSYBOX_PATH/mount /mod.img $VTOY_PATH/modmnt $BUSYBOX_PATH/insmod $VTOY_PATH/modmnt/md/dm-mod.ko $BUSYBOX_PATH/umount $VTOY_PATH/modmnt - + $BUSYBOX_PATH/rmmod cramfs fi diff --git a/IMG/cpio/ventoy/hook/debian/devuan-disk.sh b/IMG/cpio/ventoy/hook/debian/devuan-disk.sh index b340bbeab5b..e0a2f026d37 100644 --- a/IMG/cpio/ventoy/hook/debian/devuan-disk.sh +++ b/IMG/cpio/ventoy/hook/debian/devuan-disk.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/hook/debian/devuan-hook.sh b/IMG/cpio/ventoy/hook/debian/devuan-hook.sh index dd975f0dbbd..5fbb7aca4a9 100644 --- a/IMG/cpio/ventoy/hook/debian/devuan-hook.sh +++ b/IMG/cpio/ventoy/hook/debian/devuan-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ $SED "/Mount.*cdrom/a\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/debian/devuan-disk.sh" -i /init diff --git a/IMG/cpio/ventoy/hook/debian/disk_mount_hook.sh b/IMG/cpio/ventoy/hook/debian/disk_mount_hook.sh index 4e00b8f1803..4ec1000d1f6 100644 --- a/IMG/cpio/ventoy/hook/debian/disk_mount_hook.sh +++ b/IMG/cpio/ventoy/hook/debian/disk_mount_hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/hook/debian/kerio-disk.sh b/IMG/cpio/ventoy/hook/debian/kerio-disk.sh index a589d8f8104..ebf47efa7ec 100644 --- a/IMG/cpio/ventoy/hook/debian/kerio-disk.sh +++ b/IMG/cpio/ventoy/hook/debian/kerio-disk.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh @@ -30,17 +30,17 @@ VTPATH_OLD=$PATH; PATH=$BUSYBOX_PATH:$VTOY_PATH/tool:$PATH ventoy_os_install_dmsetup_by_ko() { vtlog "ventoy_os_install_dmsetup_by_ko $1" - + vtVer=$(uname -r) if uname -m | $GREP -q 64; then vtBit=64 else vtBit=32 fi - + ventoy_extract_vtloopex $1 kerio vtLoopExDir=$VTOY_PATH/vtloopex/kerio/vtloopex - + if [ -e $vtLoopExDir/dm-mod/$vtVer/$vtBit/dm-mod.ko.xz ]; then $BUSYBOX_PATH/xz -d $vtLoopExDir/dm-mod/$vtVer/$vtBit/dm-mod.ko.xz insmod $vtLoopExDir/dm-mod/$vtVer/$vtBit/dm-mod.ko diff --git a/IMG/cpio/ventoy/hook/debian/kerio-hook.sh b/IMG/cpio/ventoy/hook/debian/kerio-hook.sh index 864292b78dd..1c38a33d26c 100644 --- a/IMG/cpio/ventoy/hook/debian/kerio-hook.sh +++ b/IMG/cpio/ventoy/hook/debian/kerio-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ $SED "/for drive in/i\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/debian/kerio-disk.sh >/dev/null 2>&1; cat /ventoy/vtDM; exit 0" -i /installer/install_init diff --git a/IMG/cpio/ventoy/hook/debian/knoppix-disk.sh b/IMG/cpio/ventoy/hook/debian/knoppix-disk.sh index 047ea6c254c..f7b03c1c761 100644 --- a/IMG/cpio/ventoy/hook/debian/knoppix-disk.sh +++ b/IMG/cpio/ventoy/hook/debian/knoppix-disk.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/hook/debian/knoppix-hook.sh b/IMG/cpio/ventoy/hook/debian/knoppix-hook.sh index b57fd15f7ec..55fe77e1e44 100644 --- a/IMG/cpio/ventoy/hook/debian/knoppix-hook.sh +++ b/IMG/cpio/ventoy/hook/debian/knoppix-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ $SED '/^findknoppix/a\ return 0' -i /init diff --git a/IMG/cpio/ventoy/hook/debian/kylin-disk.sh b/IMG/cpio/ventoy/hook/debian/kylin-disk.sh index 0bfb2851612..18bc47a7fb9 100644 --- a/IMG/cpio/ventoy/hook/debian/kylin-disk.sh +++ b/IMG/cpio/ventoy/hook/debian/kylin-disk.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh @@ -31,15 +31,15 @@ ventoy_os_install_dmsetup_by_fuse() { vtoy_fuse_iso -f $VTOY_PATH/ventoy_dm_table -m $VTOY_PATH/mnt/fuse mount -t iso9660 $VTOY_PATH/mnt/fuse/ventoy.iso $VTOY_PATH/mnt/iso - + sfsfile=$VTOY_PATH/mnt/iso/casper/filesystem.squashfs - + mount -t squashfs $sfsfile $VTOY_PATH/mnt/squashfs kVer=$(uname -r) KoName=$(ls $VTOY_PATH/mnt/squashfs/lib/modules/$kVer/kernel/drivers/md/dm-mod.ko*) vtlog "insmod $KoName" - insmod $KoName + insmod $KoName umount $VTOY_PATH/mnt/squashfs umount $VTOY_PATH/mnt/iso diff --git a/IMG/cpio/ventoy/hook/debian/kylin-hook.sh b/IMG/cpio/ventoy/hook/debian/kylin-hook.sh index 051ec4a223f..caf68552975 100644 --- a/IMG/cpio/ventoy/hook/debian/kylin-hook.sh +++ b/IMG/cpio/ventoy/hook/debian/kylin-hook.sh @@ -1,26 +1,26 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ if [ -e /init ] && $GREP -q '^mountroot$' /init; then echo "Here before mountroot ..." >> $VTLOG - + $SED "/^mountroot$/i\\$BUSYBOX_PATH/sh $VTOY_PATH/hook/debian/kylin-disk.sh" -i /init $SED "/^mountroot$/i\\export LIVEMEDIA=/dev/mapper/ventoy" -i /init - $SED "/^mountroot$/i\\export LIVE_MEDIA=/dev/mapper/ventoy" -i /init + $SED "/^mountroot$/i\\export LIVE_MEDIA=/dev/mapper/ventoy" -i /init fi diff --git a/IMG/cpio/ventoy/hook/debian/linuxconsole-disk.sh b/IMG/cpio/ventoy/hook/debian/linuxconsole-disk.sh index e5bb7cbb381..2d8ec28fe48 100644 --- a/IMG/cpio/ventoy/hook/debian/linuxconsole-disk.sh +++ b/IMG/cpio/ventoy/hook/debian/linuxconsole-disk.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/hook/debian/linuxconsole-hook.sh b/IMG/cpio/ventoy/hook/debian/linuxconsole-hook.sh index a8e1db7159d..2cff7bcb60c 100644 --- a/IMG/cpio/ventoy/hook/debian/linuxconsole-hook.sh +++ b/IMG/cpio/ventoy/hook/debian/linuxconsole-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ $SED "s#/busybox/bin/sleep 2#/busybox/bin/sleep 10#" -i /etc/init.d/tty1 diff --git a/IMG/cpio/ventoy/hook/debian/minios-disk.sh b/IMG/cpio/ventoy/hook/debian/minios-disk.sh index fb1768b191f..0042db93518 100644 --- a/IMG/cpio/ventoy/hook/debian/minios-disk.sh +++ b/IMG/cpio/ventoy/hook/debian/minios-disk.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh @@ -47,14 +47,14 @@ ventoy_os_install_dmsetup_by_fuse() { ventoy_os_install_dmsetup() { vtlog "ventoy_os_install_dmsetup" - + if grep -q 'device-mapper' /proc/devices; then vtlog "device-mapper module already loaded" return; fi - + vtKerVer=$(uname -r) - + if modprobe fuse 2>>$VTLOG; then ventoy_os_install_dmsetup_by_fuse $1 $vtKerVer fi diff --git a/IMG/cpio/ventoy/hook/debian/minios-hook.sh b/IMG/cpio/ventoy/hook/debian/minios-hook.sh index 09f6e632884..efc28fcb539 100644 --- a/IMG/cpio/ventoy/hook/debian/minios-hook.sh +++ b/IMG/cpio/ventoy/hook/debian/minios-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ if [ -f /lib/livekitlib ] && $GREP -q 'debug_log.*find_data_try' /lib/livekitlib; then diff --git a/IMG/cpio/ventoy/hook/debian/mll-disk.sh b/IMG/cpio/ventoy/hook/debian/mll-disk.sh index 8ee05793258..ace73cb68ce 100644 --- a/IMG/cpio/ventoy/hook/debian/mll-disk.sh +++ b/IMG/cpio/ventoy/hook/debian/mll-disk.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/hook/debian/mll-hook.sh b/IMG/cpio/ventoy/hook/debian/mll-hook.sh index 5186f0244e8..75882336321 100644 --- a/IMG/cpio/ventoy/hook/debian/mll-hook.sh +++ b/IMG/cpio/ventoy/hook/debian/mll-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ $SED "/^for DEVICE in/i\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/debian/mll-disk.sh" -i /etc/02_overlay.sh diff --git a/IMG/cpio/ventoy/hook/debian/mocaccino-disk.sh b/IMG/cpio/ventoy/hook/debian/mocaccino-disk.sh index 7d8765493c9..bcdebd613b2 100644 --- a/IMG/cpio/ventoy/hook/debian/mocaccino-disk.sh +++ b/IMG/cpio/ventoy/hook/debian/mocaccino-disk.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/hook/debian/mocaccino-hook.sh b/IMG/cpio/ventoy/hook/debian/mocaccino-hook.sh index 31143c32a77..b72c163f306 100644 --- a/IMG/cpio/ventoy/hook/debian/mocaccino-hook.sh +++ b/IMG/cpio/ventoy/hook/debian/mocaccino-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ $SED "/mount_system *$/i\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/debian/mocaccino-disk.sh" -i /loader diff --git a/IMG/cpio/ventoy/hook/debian/porteus-disk.sh b/IMG/cpio/ventoy/hook/debian/porteus-disk.sh index c16aa9e4fd1..b55295d88db 100644 --- a/IMG/cpio/ventoy/hook/debian/porteus-disk.sh +++ b/IMG/cpio/ventoy/hook/debian/porteus-disk.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh @@ -33,14 +33,14 @@ ventoy_os_install_dmsetup_by_fuse() { vtoy_fuse_iso -f $VTOY_PATH/ventoy_dm_table -m $VTOY_PATH/mnt/fuse mount -t iso9660 $VTOY_PATH/mnt/fuse/ventoy.iso $VTOY_PATH/mnt/iso - + sfsfile=$(ls $VTOY_PATH/mnt/iso/porteus/base/*kernel.xzm) - + mount -t squashfs $sfsfile $VTOY_PATH/mnt/squashfs KoName=$(ls $VTOY_PATH/mnt/squashfs/lib/modules/$2/kernel/drivers/md/dm-mod.ko*) vtlog "insmod $KoName" - insmod $KoName + insmod $KoName umount $VTOY_PATH/mnt/squashfs umount $VTOY_PATH/mnt/iso @@ -49,14 +49,14 @@ ventoy_os_install_dmsetup_by_fuse() { ventoy_os_install_dmsetup() { vtlog "ventoy_os_install_dmsetup" - + if grep -q 'device-mapper' /proc/devices; then vtlog "device-mapper module already loaded" return; fi - + vtKerVer=$(uname -r) - + ventoy_os_install_dmsetup_by_fuse $1 $vtKerVer } diff --git a/IMG/cpio/ventoy/hook/debian/porteus-hook.sh b/IMG/cpio/ventoy/hook/debian/porteus-hook.sh index 287e6309fd4..2b22d1dddaf 100644 --- a/IMG/cpio/ventoy/hook/debian/porteus-hook.sh +++ b/IMG/cpio/ventoy/hook/debian/porteus-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ porteus_hook() { diff --git a/IMG/cpio/ventoy/hook/debian/porteus-path.sh b/IMG/cpio/ventoy/hook/debian/porteus-path.sh index 16297de8af4..f514839a500 100644 --- a/IMG/cpio/ventoy/hook/debian/porteus-path.sh +++ b/IMG/cpio/ventoy/hook/debian/porteus-path.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/hook/debian/puppy-disk.sh b/IMG/cpio/ventoy/hook/debian/puppy-disk.sh index 17c715f8009..c432a5fdea3 100644 --- a/IMG/cpio/ventoy/hook/debian/puppy-disk.sh +++ b/IMG/cpio/ventoy/hook/debian/puppy-disk.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/hook/debian/puppy-hook.sh b/IMG/cpio/ventoy/hook/debian/puppy-hook.sh index d2e15638c47..ecfb5cfd77f 100644 --- a/IMG/cpio/ventoy/hook/debian/puppy-hook.sh +++ b/IMG/cpio/ventoy/hook/debian/puppy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ $SED '1 apmedia=usbhd' -i /init diff --git a/IMG/cpio/ventoy/hook/debian/pve-disk.sh b/IMG/cpio/ventoy/hook/debian/pve-disk.sh index 8ee05793258..ace73cb68ce 100644 --- a/IMG/cpio/ventoy/hook/debian/pve-disk.sh +++ b/IMG/cpio/ventoy/hook/debian/pve-disk.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/hook/debian/pve-hook.sh b/IMG/cpio/ventoy/hook/debian/pve-hook.sh index e54ab4cae7c..c27b4f8d0a1 100644 --- a/IMG/cpio/ventoy/hook/debian/pve-hook.sh +++ b/IMG/cpio/ventoy/hook/debian/pve-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ $SED "/\/sys\/block\/hd\*/i\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/debian/pve-disk.sh" -i /init diff --git a/IMG/cpio/ventoy/hook/debian/pyabr-disk.sh b/IMG/cpio/ventoy/hook/debian/pyabr-disk.sh index 993b4d22c07..10ca7bb6937 100644 --- a/IMG/cpio/ventoy/hook/debian/pyabr-disk.sh +++ b/IMG/cpio/ventoy/hook/debian/pyabr-disk.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/hook/debian/pyabr-hook.sh b/IMG/cpio/ventoy/hook/debian/pyabr-hook.sh index 25a797814af..1e5bb31c024 100644 --- a/IMG/cpio/ventoy/hook/debian/pyabr-hook.sh +++ b/IMG/cpio/ventoy/hook/debian/pyabr-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ $SED "/find_data/i\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/debian/pyabr-disk.sh" -i /init diff --git a/IMG/cpio/ventoy/hook/debian/slax-disk.sh b/IMG/cpio/ventoy/hook/debian/slax-disk.sh index f38c24bab30..d8220b150f7 100644 --- a/IMG/cpio/ventoy/hook/debian/slax-disk.sh +++ b/IMG/cpio/ventoy/hook/debian/slax-disk.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh @@ -47,14 +47,14 @@ ventoy_os_install_dmsetup_by_fuse() { ventoy_os_install_dmsetup() { vtlog "ventoy_os_install_dmsetup" - + if grep -q 'device-mapper' /proc/devices; then vtlog "device-mapper module already loaded" return; fi - + vtKerVer=$(uname -r) - + if modprobe fuse 2>>$VTLOG; then ventoy_os_install_dmsetup_by_fuse $1 $vtKerVer fi diff --git a/IMG/cpio/ventoy/hook/debian/slax-hook.sh b/IMG/cpio/ventoy/hook/debian/slax-hook.sh index 5663c0ee38e..87c69df0297 100644 --- a/IMG/cpio/ventoy/hook/debian/slax-hook.sh +++ b/IMG/cpio/ventoy/hook/debian/slax-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ if [ -f /lib/livekitlib ] && $GREP -q 'debug_log.*find_data_try' /lib/livekitlib; then diff --git a/IMG/cpio/ventoy/hook/debian/stratodesk-disk.sh b/IMG/cpio/ventoy/hook/debian/stratodesk-disk.sh index cf671bcafc5..56458ed7955 100644 --- a/IMG/cpio/ventoy/hook/debian/stratodesk-disk.sh +++ b/IMG/cpio/ventoy/hook/debian/stratodesk-disk.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/hook/debian/stratodesk-hook.sh b/IMG/cpio/ventoy/hook/debian/stratodesk-hook.sh index 6d045b759ce..0bc058153bf 100644 --- a/IMG/cpio/ventoy/hook/debian/stratodesk-hook.sh +++ b/IMG/cpio/ventoy/hook/debian/stratodesk-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ $SED "/maybe_break *post_modules/a\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/debian/stratodesk-disk.sh" -i /init diff --git a/IMG/cpio/ventoy/hook/debian/tails-hook.sh b/IMG/cpio/ventoy/hook/debian/tails-hook.sh index 34ef31dfb04..726e94e436b 100644 --- a/IMG/cpio/ventoy/hook/debian/tails-hook.sh +++ b/IMG/cpio/ventoy/hook/debian/tails-hook.sh @@ -1,33 +1,33 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ $SED "s#.*livefs_root=.*find_livefs.*#$BUSYBOX_PATH/mount -t iso9660 /dev/mapper/ventoy \$mountpoint; livefs_root=\$mountpoint#" -i /usr/lib/live/boot/9990-main.sh $SED "s#.*livefs_root=.*find_livefs.*#$BUSYBOX_PATH/mount -t iso9660 /dev/mapper/ventoy \$mountpoint; livefs_root=\$mountpoint#" -i /usr/bin/boot/9990-main.sh if [ -e /init ] && $GREP -q '^mountroot$' /init; then - echo "Here before mountroot ..." >> $VTLOG + echo "Here before mountroot ..." >> $VTLOG $SED "/^mountroot$/i\\$BUSYBOX_PATH/sh $VTOY_PATH/hook/debian/disk_mount_hook.sh" -i /init - + if [ -f /scripts/init-premount/ORDER ]; then $SED "/\/scripts\/init-premount\/partitioning/,+1d" -i /scripts/init-premount/ORDER fi - + else echo "Use default hook ..." >> $VTLOG ventoy_systemd_udevd_work_around diff --git a/IMG/cpio/ventoy/hook/debian/truenas-bottom.sh b/IMG/cpio/ventoy/hook/debian/truenas-bottom.sh index 0fb7df37d9e..461e2036d9a 100644 --- a/IMG/cpio/ventoy/hook/debian/truenas-bottom.sh +++ b/IMG/cpio/ventoy/hook/debian/truenas-bottom.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/hook/debian/truenas-disk.sh b/IMG/cpio/ventoy/hook/debian/truenas-disk.sh index 7deda575263..1b2001896fe 100644 --- a/IMG/cpio/ventoy/hook/debian/truenas-disk.sh +++ b/IMG/cpio/ventoy/hook/debian/truenas-disk.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh @@ -31,7 +31,7 @@ ventoy_run_fuse() { vtoydm -p -f $VTOY_PATH/ventoy_image_map -d $1 > $VTOY_PATH/ventoy_dm_table vtoy_fuse_iso -f $VTOY_PATH/ventoy_dm_table -m $VTOY_PATH/mnt/fuse - + mount -t iso9660 $VTOY_PATH/mnt/fuse/ventoy.iso $VTOY_PATH/mnt/iso } diff --git a/IMG/cpio/ventoy/hook/debian/truenas-hook.sh b/IMG/cpio/ventoy/hook/debian/truenas-hook.sh index d7d90f47f17..89263bf7b83 100644 --- a/IMG/cpio/ventoy/hook/debian/truenas-hook.sh +++ b/IMG/cpio/ventoy/hook/debian/truenas-hook.sh @@ -1,27 +1,27 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ if [ -e /init ] && $GREP -q '^mountroot$' /init; then - echo "Here before mountroot ..." >> $VTLOG + echo "Here before mountroot ..." >> $VTLOG $SED "/^mountroot$/i\\$BUSYBOX_PATH/sh $VTOY_PATH/hook/debian/truenas-disk.sh" -i /init $SED "/^mountroot$/i\\export LIVEMEDIA=/dev/mapper/ventoy" -i /init - $SED "/^mountroot$/i\\export LIVE_MEDIA=/dev/mapper/ventoy" -i /init - $SED "/^mountroot$/i\\export FROMISO=$VTOY_PATH/mnt/fuse/ventoy.iso" -i /init + $SED "/^mountroot$/i\\export LIVE_MEDIA=/dev/mapper/ventoy" -i /init + $SED "/^mountroot$/i\\export FROMISO=$VTOY_PATH/mnt/fuse/ventoy.iso" -i /init $SED "/exec *run-init/i\\$BUSYBOX_PATH/sh $VTOY_PATH/hook/debian/truenas-bottom.sh" -i /init fi diff --git a/IMG/cpio/ventoy/hook/debian/udev_disk_hook.sh b/IMG/cpio/ventoy/hook/debian/udev_disk_hook.sh index 251f046bbf0..01ffc997659 100644 --- a/IMG/cpio/ventoy/hook/debian/udev_disk_hook.sh +++ b/IMG/cpio/ventoy/hook/debian/udev_disk_hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh @@ -28,7 +28,7 @@ ventoy_os_install_dmsetup() { # dump iso file location $VTOY_PATH/tool/vtoydm -i -f $VTOY_PATH/ventoy_image_map -d ${vt_usb_disk} > $VTOY_PATH/iso_file_list - # install dmsetup + # install dmsetup LINE=$($GREP ' dmsetup.*\.udeb' $VTOY_PATH/iso_file_list) if [ $? -eq 0 ]; then install_udeb_from_line "$LINE" ${vt_usb_disk} @@ -47,7 +47,7 @@ ventoy_os_install_dmsetup() { if [ $LINTCNT -gt 1 ]; then vtlog "more than one pkgs, need to filter..." VER=$($BUSYBOX_PATH/uname -r) - + LINE=$($GREP -i ' md-modules.*\.udeb' $VTOY_PATH/iso_file_list | $GREP -i $VER) LINTCNT=$($GREP -i ' md-modules.*\.udeb' $VTOY_PATH/iso_file_list | $GREP -i -c $VER) if [ $LINTCNT -gt 1 ]; then @@ -55,7 +55,7 @@ ventoy_os_install_dmsetup() { LINE=$($GREP -i ' md-modules.*\.udeb' $VTOY_PATH/iso_file_list | $GREP -i -m1 $VER) fi fi - install_udeb_from_line "$LINE" ${vt_usb_disk} + install_udeb_from_line "$LINE" ${vt_usb_disk} fi # insmod md-mod if needed @@ -63,26 +63,26 @@ ventoy_os_install_dmsetup() { vtlog "device mapper module is loaded" else vtlog "device mapper module is NOT loaded, now load it..." - - VER=$($BUSYBOX_PATH/uname -r) + + VER=$($BUSYBOX_PATH/uname -r) KO=$($FIND /lib/modules/$VER/kernel/drivers/md -name "dm-mod*") vtlog "KO=$KO" - + insmod $KO fi - + vtlog "dmsetup install finish, now check it..." if dmsetup info >> $VTLOG 2>&1; then vtlog "dmsetup work ok" else vtlog "dmsetup not work, now try to load eglibc ..." - + # install eglibc (some ubuntu 32 bit version need it) LINE=$($GREP 'libc6-.*\.udeb' $VTOY_PATH/iso_file_list) if [ $? -eq 0 ]; then - install_udeb_from_line "$LINE" ${vt_usb_disk} + install_udeb_from_line "$LINE" ${vt_usb_disk} fi - + if dmsetup info >> $VTLOG 2>&1; then vtlog "dmsetup work ok after retry" else @@ -95,7 +95,7 @@ if is_ventoy_hook_finished || not_ventoy_disk "${1:0:-1}"; then exit 0 fi -vtlog "==== $0 $* ====" +vtlog "==== $0 $* ====" dmsetup_path=$(ventoy_find_bin_path dmsetup) if [ -z "$dmsetup_path" ]; then @@ -129,7 +129,7 @@ if [ -n "$VT_BUS_USB" ]; then echo /dev/$1 > /ventoy/list-devices-usb-part else vtlog "$1 is NOT USB device (bus $ID_BUS)" - + if $EGREP -q 'boot=|casper' /proc/cmdline; then vtlog "boot=, or casper, don't mount" else @@ -141,8 +141,8 @@ fi #special process for Linx if $BUSYBOX_PATH/uname -r | $GREP -q "^2\.6"; then if $GREP -q "linx" /proc/version; then - blkdev_num=$($VTOY_PATH/tool/dmsetup ls | $GREP ventoy | $SED 's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1:\2/') - vtDM=$(ventoy_find_dm_id ${blkdev_num}) + blkdev_num=$($VTOY_PATH/tool/dmsetup ls | $GREP ventoy | $SED 's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1:\2/') + vtDM=$(ventoy_find_dm_id ${blkdev_num}) echo "/dev/$vtDM" > /ventoy/list-devices-usb-part fi fi diff --git a/IMG/cpio/ventoy/hook/debian/veket-disk.sh b/IMG/cpio/ventoy/hook/debian/veket-disk.sh index 1e101807eb6..9b61d8cf31f 100644 --- a/IMG/cpio/ventoy/hook/debian/veket-disk.sh +++ b/IMG/cpio/ventoy/hook/debian/veket-disk.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh @@ -37,10 +37,10 @@ ventoy_os_install_dmsetup_by_fuse() { vtoy_fuse_iso -f $VTOY_PATH/ventoy_dm_table -m $VTOY_PATH/mnt/fuse mount -t iso9660 $VTOY_PATH/mnt/fuse/ventoy.iso $VTOY_PATH/mnt/iso - - + + for sfsfile in $(ls $VTOY_PATH/mnt/iso/*drv_veket*.sfs); do - mount -t squashfs $sfsfile $VTOY_PATH/mnt/squashfs + mount -t squashfs $sfsfile $VTOY_PATH/mnt/squashfs if [ -d $VTOY_PATH/mnt/squashfs/lib/modules ]; then KoName=$(ls $VTOY_PATH/mnt/squashfs/lib/modules/$2/kernel/drivers/md/dm-mod.ko*) if [ -n "$KoName" -a -f $KoName ]; then @@ -48,7 +48,7 @@ ventoy_os_install_dmsetup_by_fuse() { break fi fi - + umount $VTOY_PATH/mnt/squashfs done @@ -56,7 +56,7 @@ ventoy_os_install_dmsetup_by_fuse() { if [ -z "$drvdir" ]; then vtlog "retry for usr/lib dir" for sfsfile in $(ls $VTOY_PATH/mnt/iso/*drv_veket*.sfs); do - mount -t squashfs $sfsfile $VTOY_PATH/mnt/squashfs + mount -t squashfs $sfsfile $VTOY_PATH/mnt/squashfs if [ -d $VTOY_PATH/mnt/squashfs/usr/lib/modules ]; then KoName=$(ls $VTOY_PATH/mnt/squashfs/usr/lib/modules/$2/kernel/drivers/md/dm-mod.ko*) if [ -n "$KoName" -a -f $KoName ]; then @@ -64,19 +64,19 @@ ventoy_os_install_dmsetup_by_fuse() { break fi fi - + umount $VTOY_PATH/mnt/squashfs done fi - + KoName=$(ls $drvdir/kernel/drivers/dax/dax.ko*) vtlog "insmod $KoName" - insmod $KoName - + insmod $KoName + KoName=$(ls $drvdir/kernel/drivers/md/dm-mod.ko*) vtlog "insmod $KoName" - insmod $KoName + insmod $KoName umount $VTOY_PATH/mnt/squashfs umount $VTOY_PATH/mnt/iso @@ -85,14 +85,14 @@ ventoy_os_install_dmsetup_by_fuse() { ventoy_os_install_dmsetup() { vtlog "ventoy_os_install_dmsetup" - + if grep -q 'device-mapper' /proc/devices; then vtlog "device-mapper module already loaded" return; fi - + vtKerVer=$(uname -r) - + ventoy_os_install_dmsetup_by_fuse $1 $vtKerVer } diff --git a/IMG/cpio/ventoy/hook/debian/veket-hook.sh b/IMG/cpio/ventoy/hook/debian/veket-hook.sh index 5093cbb1815..c17dbb21e46 100644 --- a/IMG/cpio/ventoy/hook/debian/veket-hook.sh +++ b/IMG/cpio/ventoy/hook/debian/veket-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ $SED '1 apmedia=usbhd' -i /init diff --git a/IMG/cpio/ventoy/hook/debian/ventoy-cloud-init.sh b/IMG/cpio/ventoy/hook/debian/ventoy-cloud-init.sh index 0663f988e7c..706f4a4afec 100644 --- a/IMG/cpio/ventoy/hook/debian/ventoy-cloud-init.sh +++ b/IMG/cpio/ventoy/hook/debian/ventoy-cloud-init.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh @@ -44,14 +44,14 @@ if [ $vtSplit -eq 1 ]; then vtlog "Line number: $vtLine $vtLine1 $vtLine2" sed -n "1,${vtLine1}p" $VTOY_PATH/autoinstall >/tmpcidata/user-data sed -n "${vtLine2},\$p" $VTOY_PATH/autoinstall >/tmpcidata/meta-data - + sh /ventoy/hook/default/auto_install_varexp.sh /tmpcidata/user-data sh /ventoy/hook/default/auto_install_varexp.sh /tmpcidata/meta-data else vtlog "only user-data avaliable" cp -a $VTOY_PATH/autoinstall /tmpcidata/user-data touch /tmpcidata/meta-data - + sh /ventoy/hook/default/auto_install_varexp.sh /tmpcidata/user-data fi diff --git a/IMG/cpio/ventoy/hook/debian/ventoy-hook.sh b/IMG/cpio/ventoy/hook/debian/ventoy-hook.sh index d940e0d350a..9a4729b1df7 100644 --- a/IMG/cpio/ventoy/hook/debian/ventoy-hook.sh +++ b/IMG/cpio/ventoy/hook/debian/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh @@ -31,13 +31,13 @@ ventoy_get_debian_distro() { echo 'antix'; return fi fi - + if [ -e /DISTRO_SPECS ]; then if $GREP -q veket /DISTRO_SPECS; then echo 'veket'; return fi fi - + if [ -e /init ]; then if $EGREP -q 'PUPPYSFS|PUPPYFILE' /init; then if $GREP -q VEKETSFS /init; then @@ -63,61 +63,61 @@ ventoy_get_debian_distro() { if $GREP -q 'slax/' /proc/cmdline; then echo 'slax'; return fi - + if $GREP -q 'minios/' /proc/cmdline; then echo 'minios'; return fi - + if $GREP -q 'PVE ' /proc/version; then echo 'pve'; return fi - + if [ -d /porteus ]; then echo 'porteus'; return fi - + if $GREP -q 'porteus' /proc/version; then echo 'porteus'; return fi - + if $GREP -q 'linuxconsole' /proc/version; then echo 'linuxconsole'; return fi - + if $GREP -q 'vyos' /proc/version; then echo 'vyos'; return fi - + if $GREP -q 'kylin' /proc/version; then echo 'kylin'; return fi - + if [ -f /scripts/00-ver ]; then if $GREP -q 'Bliss-OS' /scripts/00-ver; then echo 'bliss'; return fi fi - + if [ -e /opt/kerio ]; then echo 'kerio'; return fi - + if $GREP -q 'mocaccino' /proc/version; then echo 'mocaccino'; return fi - + if $GREP -q '/pyabr/' /proc/cmdline; then echo 'pyabr'; return fi - + if [ -e /devuan-logo.txt ]; then echo 'devuan'; return fi - + if $GREP -q 'truenas' /proc/version; then echo 'truenas'; return fi - + echo 'default' } diff --git a/IMG/cpio/ventoy/hook/debian/ventoy-inotifyd-hook.sh b/IMG/cpio/ventoy/hook/debian/ventoy-inotifyd-hook.sh index e15472251ea..fe2815d4c77 100644 --- a/IMG/cpio/ventoy/hook/debian/ventoy-inotifyd-hook.sh +++ b/IMG/cpio/ventoy/hook/debian/ventoy-inotifyd-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh @@ -28,7 +28,7 @@ VTPATH_OLD=$PATH; PATH=$BUSYBOX_PATH:$VTOY_PATH/tool:$PATH if is_inotify_ventoy_part $3; then vtlog "##### INOTIFYD: $2/$3 is created (YES) ..." - vtlog "find ventoy partition $3 ..." + vtlog "find ventoy partition $3 ..." $BUSYBOX_PATH/sh $VTOY_PATH/hook/debian/udev_disk_hook.sh "$3" else vtlog "##### INOTIFYD: $2/$3 is created (NO)..." diff --git a/IMG/cpio/ventoy/hook/debian/ventoy_env2debconf.sh b/IMG/cpio/ventoy/hook/debian/ventoy_env2debconf.sh index 53b3effee99..387f7d42fcf 100644 --- a/IMG/cpio/ventoy/hook/debian/ventoy_env2debconf.sh +++ b/IMG/cpio/ventoy/hook/debian/ventoy_env2debconf.sh @@ -1,20 +1,20 @@ #!/bin/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ PATH=$PATH:/ventoy/busybox diff --git a/IMG/cpio/ventoy/hook/debian/vyos-disk.sh b/IMG/cpio/ventoy/hook/debian/vyos-disk.sh index 468adfd9f9d..33c03f47efd 100644 --- a/IMG/cpio/ventoy/hook/debian/vyos-disk.sh +++ b/IMG/cpio/ventoy/hook/debian/vyos-disk.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/hook/debian/vyos-hook.sh b/IMG/cpio/ventoy/hook/debian/vyos-hook.sh index 007f823b6d6..ae83e82c7c7 100644 --- a/IMG/cpio/ventoy/hook/debian/vyos-hook.sh +++ b/IMG/cpio/ventoy/hook/debian/vyos-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ if [ -e /init ] && $GREP -q '^mountroot$' /init; then diff --git a/IMG/cpio/ventoy/hook/deepin/disk_mount_hook.sh b/IMG/cpio/ventoy/hook/deepin/disk_mount_hook.sh index 4e00b8f1803..4ec1000d1f6 100644 --- a/IMG/cpio/ventoy/hook/deepin/disk_mount_hook.sh +++ b/IMG/cpio/ventoy/hook/deepin/disk_mount_hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/hook/deepin/udev_disk_hook.sh b/IMG/cpio/ventoy/hook/deepin/udev_disk_hook.sh index 251f046bbf0..01ffc997659 100644 --- a/IMG/cpio/ventoy/hook/deepin/udev_disk_hook.sh +++ b/IMG/cpio/ventoy/hook/deepin/udev_disk_hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh @@ -28,7 +28,7 @@ ventoy_os_install_dmsetup() { # dump iso file location $VTOY_PATH/tool/vtoydm -i -f $VTOY_PATH/ventoy_image_map -d ${vt_usb_disk} > $VTOY_PATH/iso_file_list - # install dmsetup + # install dmsetup LINE=$($GREP ' dmsetup.*\.udeb' $VTOY_PATH/iso_file_list) if [ $? -eq 0 ]; then install_udeb_from_line "$LINE" ${vt_usb_disk} @@ -47,7 +47,7 @@ ventoy_os_install_dmsetup() { if [ $LINTCNT -gt 1 ]; then vtlog "more than one pkgs, need to filter..." VER=$($BUSYBOX_PATH/uname -r) - + LINE=$($GREP -i ' md-modules.*\.udeb' $VTOY_PATH/iso_file_list | $GREP -i $VER) LINTCNT=$($GREP -i ' md-modules.*\.udeb' $VTOY_PATH/iso_file_list | $GREP -i -c $VER) if [ $LINTCNT -gt 1 ]; then @@ -55,7 +55,7 @@ ventoy_os_install_dmsetup() { LINE=$($GREP -i ' md-modules.*\.udeb' $VTOY_PATH/iso_file_list | $GREP -i -m1 $VER) fi fi - install_udeb_from_line "$LINE" ${vt_usb_disk} + install_udeb_from_line "$LINE" ${vt_usb_disk} fi # insmod md-mod if needed @@ -63,26 +63,26 @@ ventoy_os_install_dmsetup() { vtlog "device mapper module is loaded" else vtlog "device mapper module is NOT loaded, now load it..." - - VER=$($BUSYBOX_PATH/uname -r) + + VER=$($BUSYBOX_PATH/uname -r) KO=$($FIND /lib/modules/$VER/kernel/drivers/md -name "dm-mod*") vtlog "KO=$KO" - + insmod $KO fi - + vtlog "dmsetup install finish, now check it..." if dmsetup info >> $VTLOG 2>&1; then vtlog "dmsetup work ok" else vtlog "dmsetup not work, now try to load eglibc ..." - + # install eglibc (some ubuntu 32 bit version need it) LINE=$($GREP 'libc6-.*\.udeb' $VTOY_PATH/iso_file_list) if [ $? -eq 0 ]; then - install_udeb_from_line "$LINE" ${vt_usb_disk} + install_udeb_from_line "$LINE" ${vt_usb_disk} fi - + if dmsetup info >> $VTLOG 2>&1; then vtlog "dmsetup work ok after retry" else @@ -95,7 +95,7 @@ if is_ventoy_hook_finished || not_ventoy_disk "${1:0:-1}"; then exit 0 fi -vtlog "==== $0 $* ====" +vtlog "==== $0 $* ====" dmsetup_path=$(ventoy_find_bin_path dmsetup) if [ -z "$dmsetup_path" ]; then @@ -129,7 +129,7 @@ if [ -n "$VT_BUS_USB" ]; then echo /dev/$1 > /ventoy/list-devices-usb-part else vtlog "$1 is NOT USB device (bus $ID_BUS)" - + if $EGREP -q 'boot=|casper' /proc/cmdline; then vtlog "boot=, or casper, don't mount" else @@ -141,8 +141,8 @@ fi #special process for Linx if $BUSYBOX_PATH/uname -r | $GREP -q "^2\.6"; then if $GREP -q "linx" /proc/version; then - blkdev_num=$($VTOY_PATH/tool/dmsetup ls | $GREP ventoy | $SED 's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1:\2/') - vtDM=$(ventoy_find_dm_id ${blkdev_num}) + blkdev_num=$($VTOY_PATH/tool/dmsetup ls | $GREP ventoy | $SED 's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1:\2/') + vtDM=$(ventoy_find_dm_id ${blkdev_num}) echo "/dev/$vtDM" > /ventoy/list-devices-usb-part fi fi diff --git a/IMG/cpio/ventoy/hook/deepin/ventoy-hook.sh b/IMG/cpio/ventoy/hook/deepin/ventoy-hook.sh index 9625c623fe4..78e0c853ce3 100644 --- a/IMG/cpio/ventoy/hook/deepin/ventoy-hook.sh +++ b/IMG/cpio/ventoy/hook/deepin/ventoy-hook.sh @@ -1,29 +1,29 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ if [ -e /init ] && $GREP -q '^mountroot$' /init; then echo "Here before mountroot ..." >> $VTLOG - + $SED "/^mountroot$/i\\$BUSYBOX_PATH/sh $VTOY_PATH/hook/deepin/disk_mount_hook.sh" -i /init $SED "/^mountroot$/i\\export LIVEMEDIA=/dev/mapper/ventoy" -i /init - $SED "/^mountroot$/i\\export LIVE_MEDIA=/dev/mapper/ventoy" -i /init + $SED "/^mountroot$/i\\export LIVE_MEDIA=/dev/mapper/ventoy" -i /init if $GREP -q 'live-media=' /proc/cmdline; then if [ -f /scripts/casper ] && $GREP -q '^ *LIVEMEDIA=' /scripts/casper; then diff --git a/IMG/cpio/ventoy/hook/deepin/ventoy_autoinstall.sh b/IMG/cpio/ventoy/hook/deepin/ventoy_autoinstall.sh index 5e6f581c09a..d04fbca7b75 100644 --- a/IMG/cpio/ventoy/hook/deepin/ventoy_autoinstall.sh +++ b/IMG/cpio/ventoy/hook/deepin/ventoy_autoinstall.sh @@ -8,13 +8,13 @@ change_var_value() { local vVal=$3 local quote=$4 local vline - + if [ $quote -eq 0 ]; then vline="$vkey = $vVal" else vline="$vkey = \"$vVal\"" fi - + if grep -q -m1 "^$vkey[[:space:]]*=" $vfile; then sed "s#^$vkey[[:space:]]*=.*#$vline#g" -i $vfile else @@ -26,49 +26,49 @@ setting_script_process() { local sfile=$1 local vItem local vB64Item - + vItem=$(grep '^language[[:space:]]*=' /ventoy/autoinstall | awk '{print $3}') if [ -n "$vItem" ]; then change_var_value $sfile 'select_language_default_locale' "$vItem" 0 fi - + vItem=$(grep '^timezone[[:space:]]*=' /ventoy/autoinstall | awk '{print $3}') if [ -n "$vItem" ]; then change_var_value $sfile 'timezone_default' "$vItem" 0 fi - + vItem=$(grep '^hostname[[:space:]]*=' /ventoy/autoinstall | awk '{print $3}') if [ -n "$vItem" ]; then change_var_value $sfile 'system_info_default_hostname' "$vItem" 1 change_var_value $sfile 'DI_HOSTNAME' "$vItem" 1 fi - + vItem=$(grep '^root_password[[:space:]]*=' /ventoy/autoinstall | awk '{print $3}') if [ -n "$vItem" ]; then vB64Item=$(echo -n "$vItem" | base64) change_var_value $sfile 'system_info_default_root_password' "$vB64Item" 1 change_var_value $sfile 'DI_ROOTPASSWORD' "$vB64Item" 1 fi - + vItem=$(grep '^default_username[[:space:]]*=' /ventoy/autoinstall | awk '{print $3}') if [ -n "$vItem" ]; then change_var_value $sfile 'system_info_default_username' "$vItem" 1 change_var_value $sfile 'DI_USERNAME' "$vItem" 1 fi - + vItem=$(grep '^default_password[[:space:]]*=' /ventoy/autoinstall | awk '{print $3}') if [ -n "$vItem" ]; then change_var_value $sfile 'system_info_default_password' "$vItem" 1 change_var_value $sfile 'DI_PASSWORD' "$vItem" 1 fi - + vItem=$(grep '^install_disk[[:space:]]*=' /ventoy/autoinstall | awk '{print $3}') if [ -n "$vItem" ]; then echo "DI_FULLDISK_MULTIDISK_DEVICE = $vItem" >> $sfile echo "DI_ROOTDISK = $vItem" >> $sfile echo "DI_BOOTLOADER = $vItem" >> $sfile fi - + change_var_value $sfile 'skip_virtual_machine_page' 'true' 0 change_var_value $sfile 'skip_select_language_page' 'true' 0 change_var_value $sfile 'skip_select_language_page_on_first_boot' 'true' 0 @@ -83,7 +83,7 @@ setting_script_process() { change_var_value $sfile 'system_info_disable_license' 'true' 0 change_var_value $sfile 'system_info_disable_experience' 'true' 0 change_var_value $sfile 'system_info_disable_privacy_license' 'true' 0 - + #filesystem.squashfs search ini #first_page_state=0,表示ä¸è·³è¿‡é¦–页,展示首页让用户自己选择 #first_page_state=1,表示跳过首页,并且自动点击一键安装 @@ -95,13 +95,13 @@ setting_script_process() { update_settings() { local script=$1 local newscript - + echo "update_settings for $script ..." - + newscript=$(basename $script) cp -a $script /ventoy/vini_${newscript} setting_script_process /ventoy/vini_${newscript} - + rm -f $script cp -a /ventoy/vini_${newscript} $script } diff --git a/IMG/cpio/ventoy/hook/default/10-dm.rules b/IMG/cpio/ventoy/hook/default/10-dm.rules index f33df5822f6..4d38a0313c1 100644 --- a/IMG/cpio/ventoy/hook/default/10-dm.rules +++ b/IMG/cpio/ventoy/hook/default/10-dm.rules @@ -106,7 +106,7 @@ LABEL="dm_no_coldplug" # "dm" sysfs subdirectory is available in newer versions of DM # only (kernels >= 2.6.29). We have to check for its existence -# and use dmsetup tool instead to get the DM name, uuid and +# and use dmsetup tool instead to get the DM name, uuid and # suspended state if the "dm" subdirectory is not present. # The "suspended" item was added even later (kernels >= 2.6.31), # so we also have to call dmsetup if the kernel version used diff --git a/IMG/cpio/ventoy/hook/default/auto_install_varexp.sh b/IMG/cpio/ventoy/hook/default/auto_install_varexp.sh index af01d4e2fa9..83334d926f0 100644 --- a/IMG/cpio/ventoy/hook/default/auto_install_varexp.sh +++ b/IMG/cpio/ventoy/hook/default/auto_install_varexp.sh @@ -1,20 +1,20 @@ #!/bin/sh #************************************************************************************ # Copyright (c) 2022, longpanda -# +# # 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 . -# +# #************************************************************************************ PATH=$PATH:/ventoy/busybox:/ventoy/tool @@ -33,19 +33,19 @@ fi if [ -f /ventoy/ventoy_os_param ]; then VTOYDISK=$(vtoydump -f /ventoy/ventoy_os_param | awk -F'#' '{print $1}') vlog VTOYDISK=$VTOYDISK - + if [ -b "$VTOYDISK" ]; then vlog "$VTOYDISK exist OK" else vlog "$VTOYDISK does NOT exist" exit 0 fi - + if [ -n "$1" -a -f "$1" ]; then vtoyexpand "$1" "$VTOYDISK" else vlog "File $1 not exist" - fi + fi else vlog "os param file not exist" exit 0 diff --git a/IMG/cpio/ventoy/hook/default/udev_disk_hook.sh b/IMG/cpio/ventoy/hook/default/udev_disk_hook.sh index 633f29ea789..5c2b5fc56e5 100644 --- a/IMG/cpio/ventoy/hook/default/udev_disk_hook.sh +++ b/IMG/cpio/ventoy/hook/default/udev_disk_hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/hook/default/ventoy-hook.sh b/IMG/cpio/ventoy/hook/default/ventoy-hook.sh index 56e0e35e3f0..e699368a13f 100644 --- a/IMG/cpio/ventoy/hook/default/ventoy-hook.sh +++ b/IMG/cpio/ventoy/hook/default/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh diff --git a/IMG/cpio/ventoy/hook/default/ventoy-inotifyd-start.sh b/IMG/cpio/ventoy/hook/default/ventoy-inotifyd-start.sh index 6be8155510e..59e4dc85a81 100644 --- a/IMG/cpio/ventoy/hook/default/ventoy-inotifyd-start.sh +++ b/IMG/cpio/ventoy/hook/default/ventoy-inotifyd-start.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh @@ -24,7 +24,7 @@ vtHook=$($CAT $VTOY_PATH/inotifyd-hook-script.txt) vtdisk=$(get_ventoy_disk_name) if [ "$vtdisk" = "unknown" ]; then vtlog "... start inotifyd listen $vtHook ..." - $BUSYBOX_PATH/nohup $VTOY_PATH/tool/inotifyd $vtHook /dev:n 2>&- & + $BUSYBOX_PATH/nohup $VTOY_PATH/tool/inotifyd $vtHook /dev:n 2>&- & else vtlog "... $vtdisk already exist ..." $BUSYBOX_PATH/sh $vtHook n /dev "${vtdisk#/dev/}2" diff --git a/IMG/cpio/ventoy/hook/dragora/disk_hook.sh b/IMG/cpio/ventoy/hook/dragora/disk_hook.sh index 600bfc0cdca..54c7ee3038b 100644 --- a/IMG/cpio/ventoy/hook/dragora/disk_hook.sh +++ b/IMG/cpio/ventoy/hook/dragora/disk_hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/hook/dragora/ventoy-hook.sh b/IMG/cpio/ventoy/hook/dragora/ventoy-hook.sh index a0a2c198238..2b5773dc852 100644 --- a/IMG/cpio/ventoy/hook/dragora/ventoy-hook.sh +++ b/IMG/cpio/ventoy/hook/dragora/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh diff --git a/IMG/cpio/ventoy/hook/easystartup/disk_hook.sh b/IMG/cpio/ventoy/hook/easystartup/disk_hook.sh index b688688238a..8e6e835dc8e 100644 --- a/IMG/cpio/ventoy/hook/easystartup/disk_hook.sh +++ b/IMG/cpio/ventoy/hook/easystartup/disk_hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2021, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh @@ -29,7 +29,7 @@ get_rhel_ver() { if grep -q '6[.]1' /etc/redhat-release; then echo "RHAS6U1$machine"; return fi - + echo "RHAS6U1$machine" } diff --git a/IMG/cpio/ventoy/hook/easystartup/ventoy-hook.sh b/IMG/cpio/ventoy/hook/easystartup/ventoy-hook.sh index d18d9d522c6..6e22b492aab 100644 --- a/IMG/cpio/ventoy/hook/easystartup/ventoy-hook.sh +++ b/IMG/cpio/ventoy/hook/easystartup/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2021, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh diff --git a/IMG/cpio/ventoy/hook/easystartup/ventoy-initqueue.sh b/IMG/cpio/ventoy/hook/easystartup/ventoy-initqueue.sh index d4c8b5f0b65..f18bc097473 100644 --- a/IMG/cpio/ventoy/hook/easystartup/ventoy-initqueue.sh +++ b/IMG/cpio/ventoy/hook/easystartup/ventoy-initqueue.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2021, longpanda -# +# # 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 . -# +# #************************************************************************************ /ventoy/busybox/sh /ventoy/hook/easystartup/disk_hook.sh $* diff --git a/IMG/cpio/ventoy/hook/ewe/ventoy-disk.sh b/IMG/cpio/ventoy/hook/ewe/ventoy-disk.sh index 30b3f3af0bb..79dd20f9f4a 100644 --- a/IMG/cpio/ventoy/hook/ewe/ventoy-disk.sh +++ b/IMG/cpio/ventoy/hook/ewe/ventoy-disk.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh @@ -49,7 +49,7 @@ done if [ -n "$1" ]; then vtlog "ln -s /dev/$vtDM $1" - + if [ -e "$1" ]; then vtlog "$1 already exist" else @@ -58,18 +58,18 @@ if [ -n "$1" ]; then else vtLABEL=$($BUSYBOX_PATH/blkid /dev/$vtDM | $SED 's/.*LABEL="\([^"]*\)".*/\1/') vtlog "vtLABEL is $vtLABEL" - + if [ -z "$vtLABEL" ]; then vtLABEL=$($SED "s/.*label=\([^ ]*\)/\1/" /proc/cmdline) vtlog "vtLABEL is $vtLABEL from cmdline" fi - + if [ -e "/dev/disk/by-label/$vtLABEL" ]; then vtlog "$1 already exist" else ln -s /dev/$vtDM "/dev/disk/by-label/$vtLABEL" fi -fi +fi # OK finish set_ventoy_hook_finish diff --git a/IMG/cpio/ventoy/hook/ewe/ventoy-hook.sh b/IMG/cpio/ventoy/hook/ewe/ventoy-hook.sh index 590415f780c..f2a069bef7f 100644 --- a/IMG/cpio/ventoy/hook/ewe/ventoy-hook.sh +++ b/IMG/cpio/ventoy/hook/ewe/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh diff --git a/IMG/cpio/ventoy/hook/fatdog/disk-hook.sh b/IMG/cpio/ventoy/hook/fatdog/disk-hook.sh index 8ee05793258..ace73cb68ce 100644 --- a/IMG/cpio/ventoy/hook/fatdog/disk-hook.sh +++ b/IMG/cpio/ventoy/hook/fatdog/disk-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/hook/fatdog/ventoy-hook.sh b/IMG/cpio/ventoy/hook/fatdog/ventoy-hook.sh index 8b16432944e..58d84737bef 100644 --- a/IMG/cpio/ventoy/hook/fatdog/ventoy-hook.sh +++ b/IMG/cpio/ventoy/hook/fatdog/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh diff --git a/IMG/cpio/ventoy/hook/gentoo/disk_hook.sh b/IMG/cpio/ventoy/hook/gentoo/disk_hook.sh index 9ae2f6d96cf..cb2fa1d0606 100644 --- a/IMG/cpio/ventoy/hook/gentoo/disk_hook.sh +++ b/IMG/cpio/ventoy/hook/gentoo/disk_hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh @@ -23,7 +23,7 @@ $BUSYBOX_PATH/modprobe virtio_blk 2>/dev/null $BUSYBOX_PATH/modprobe virtio_pci 2>/dev/null -for i in 0 1 2 3 4 5 6 7 8 9; do +for i in 0 1 2 3 4 5 6 7 8 9; do vtdiskname=$(get_ventoy_disk_name) if [ "$vtdiskname" = "unknown" ]; then vtlog "wait for disk ..." diff --git a/IMG/cpio/ventoy/hook/gentoo/ventoy-hook.sh b/IMG/cpio/ventoy/hook/gentoo/ventoy-hook.sh index d0ba02a7fe8..36d3cfe9395 100644 --- a/IMG/cpio/ventoy/hook/gentoo/ventoy-hook.sh +++ b/IMG/cpio/ventoy/hook/gentoo/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh @@ -27,9 +27,9 @@ if $GREP -q kaspersky /proc/version; then elif $GREP -q 'setting up the root filesystem' /init; then $SED "/setting up the root filesystem/a\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/gentoo/disk_hook.sh" -i /init $SED "/setting up the root filesystem/a\ export CDROOT_DEV=/dev/mapper/ventoy" -i /init -elif [ -d /etc/udev/rules.d ] || [ -d /lib/udev/rules.d ]; then +elif [ -d /etc/udev/rules.d ] || [ -d /lib/udev/rules.d ]; then ventoy_systemd_udevd_work_around ventoy_add_udev_rule "$VTOY_PATH/hook/default/udev_disk_hook.sh %k noreplace" else - $SED "/mdev *-s/a\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/gentoo/disk_hook.sh" -i /init + $SED "/mdev *-s/a\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/gentoo/disk_hook.sh" -i /init fi diff --git a/IMG/cpio/ventoy/hook/gobo/ventoy-hook.sh b/IMG/cpio/ventoy/hook/gobo/ventoy-hook.sh index eb22a28a7c6..f11be512129 100644 --- a/IMG/cpio/ventoy/hook/gobo/ventoy-hook.sh +++ b/IMG/cpio/ventoy/hook/gobo/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh diff --git a/IMG/cpio/ventoy/hook/gobo/ventoy-inotifyd-hook.sh b/IMG/cpio/ventoy/hook/gobo/ventoy-inotifyd-hook.sh index 34a70a0f2cb..044b64b52ad 100644 --- a/IMG/cpio/ventoy/hook/gobo/ventoy-inotifyd-hook.sh +++ b/IMG/cpio/ventoy/hook/gobo/ventoy-inotifyd-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh @@ -27,10 +27,10 @@ VTPATH_OLD=$PATH; PATH=$BUSYBOX_PATH:$VTOY_PATH/tool:$PATH if is_inotify_ventoy_part $3; then vtlog "##### INOTIFYD: $2/$3 is created (YES)..." - + vtlog "find ventoy partition $3 ..." $BUSYBOX_PATH/sh $VTOY_PATH/hook/default/udev_disk_hook.sh $3 noreplace - + set_ventoy_hook_finish else vtlog "##### INOTIFYD: $2/$3 is created (NO)..." diff --git a/IMG/cpio/ventoy/hook/gobo/ventoy-inotifyd-start.sh b/IMG/cpio/ventoy/hook/gobo/ventoy-inotifyd-start.sh index 6be8155510e..59e4dc85a81 100644 --- a/IMG/cpio/ventoy/hook/gobo/ventoy-inotifyd-start.sh +++ b/IMG/cpio/ventoy/hook/gobo/ventoy-inotifyd-start.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh @@ -24,7 +24,7 @@ vtHook=$($CAT $VTOY_PATH/inotifyd-hook-script.txt) vtdisk=$(get_ventoy_disk_name) if [ "$vtdisk" = "unknown" ]; then vtlog "... start inotifyd listen $vtHook ..." - $BUSYBOX_PATH/nohup $VTOY_PATH/tool/inotifyd $vtHook /dev:n 2>&- & + $BUSYBOX_PATH/nohup $VTOY_PATH/tool/inotifyd $vtHook /dev:n 2>&- & else vtlog "... $vtdisk already exist ..." $BUSYBOX_PATH/sh $vtHook n /dev "${vtdisk#/dev/}2" diff --git a/IMG/cpio/ventoy/hook/guix/ventoy-before-init.sh b/IMG/cpio/ventoy/hook/guix/ventoy-before-init.sh index c29ca073e2d..292927c4457 100644 --- a/IMG/cpio/ventoy/hook/guix/ventoy-before-init.sh +++ b/IMG/cpio/ventoy/hook/guix/ventoy-before-init.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh diff --git a/IMG/cpio/ventoy/hook/guix/ventoy-disk.sh b/IMG/cpio/ventoy/hook/guix/ventoy-disk.sh index 561dc27a0a5..ae66db77ffd 100644 --- a/IMG/cpio/ventoy/hook/guix/ventoy-disk.sh +++ b/IMG/cpio/ventoy/hook/guix/ventoy-disk.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/hook/guix/ventoy-hook.sh b/IMG/cpio/ventoy/hook/guix/ventoy-hook.sh index dc6474e5119..f1b659f5be8 100644 --- a/IMG/cpio/ventoy/hook/guix/ventoy-hook.sh +++ b/IMG/cpio/ventoy/hook/guix/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh diff --git a/IMG/cpio/ventoy/hook/hyperbola/ventoy-disk.sh b/IMG/cpio/ventoy/hook/hyperbola/ventoy-disk.sh index 356c77f8efd..b3091eec2ee 100644 --- a/IMG/cpio/ventoy/hook/hyperbola/ventoy-disk.sh +++ b/IMG/cpio/ventoy/hook/hyperbola/ventoy-disk.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh @@ -38,10 +38,10 @@ ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2" "noreplace" if [ -n "$1" ]; then blkdev_num=$($VTOY_PATH/tool/dmsetup ls | grep ventoy | sed 's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1:\2/') vtDM=$(ventoy_find_dm_id ${blkdev_num}) - + vtlog "ln -s /dev/$vtDM $1" ln -s /dev/$vtDM "$1" -fi +fi # OK finish set_ventoy_hook_finish diff --git a/IMG/cpio/ventoy/hook/hyperbola/ventoy-hook.sh b/IMG/cpio/ventoy/hook/hyperbola/ventoy-hook.sh index aebe57adc86..0bd3ee8bdaa 100644 --- a/IMG/cpio/ventoy/hook/hyperbola/ventoy-hook.sh +++ b/IMG/cpio/ventoy/hook/hyperbola/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh @@ -22,11 +22,11 @@ if $GREP -q '^"$mount_handler"' /init; then echo 'use mount_handler ...' >> $VTLOG $SED "/^\"\$mount_handler\"/i\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/hyperbola/ventoy-disk.sh \"\$hyperisodevice\"" -i /init - + if [ -f /hooks/parabolaiso ]; then $SED '/while ! poll_device "${dev}"/a\ if /ventoy/busybox/sh /ventoy/hook/hyperbola/ventoy-timeout.sh ${dev}; then break; fi' -i /hooks/hyperiso fi - + else # some archlinux initramfs doesn't contain device-mapper udev rules file ARCH_UDEV_DIR=$(ventoy_get_udev_conf_dir) diff --git a/IMG/cpio/ventoy/hook/hyperbola/ventoy-timeout.sh b/IMG/cpio/ventoy/hook/hyperbola/ventoy-timeout.sh index fec9cc0770a..fc4cb388ec3 100644 --- a/IMG/cpio/ventoy/hook/hyperbola/ventoy-timeout.sh +++ b/IMG/cpio/ventoy/hook/hyperbola/ventoy-timeout.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/hook/kaos/ventoy-disk.sh b/IMG/cpio/ventoy/hook/kaos/ventoy-disk.sh index 42569cc0e9d..f21f5564e67 100644 --- a/IMG/cpio/ventoy/hook/kaos/ventoy-disk.sh +++ b/IMG/cpio/ventoy/hook/kaos/ventoy-disk.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh @@ -48,7 +48,7 @@ ventoy_os_install_dmsetup_by_fuse() { else insmod $KoName fi - + ventoy_check_umount $VTOY_PATH/mnt/squashfs ventoy_check_umount $VTOY_PATH/mnt/iso ventoy_check_umount $VTOY_PATH/mnt/fuse @@ -90,7 +90,7 @@ done if [ -n "$1" ]; then vtlog "ln -s /dev/$vtDM $1" - + if [ -e "$1" ]; then vtlog "$1 already exist" else @@ -99,18 +99,18 @@ if [ -n "$1" ]; then else vtLABEL=$($BUSYBOX_PATH/blkid /dev/$vtDM | $SED 's/.*LABEL="\([^"]*\)".*/\1/') vtlog "vtLABEL is $vtLABEL" - + if [ -z "$vtLABEL" ]; then vtLABEL=$($SED "s/.*label=\([^ ]*\)/\1/" /proc/cmdline) vtlog "vtLABEL is $vtLABEL from cmdline" fi - + if [ -e "/dev/disk/by-label/$vtLABEL" ]; then vtlog "$1 already exist" else ln -s /dev/$vtDM "/dev/disk/by-label/$vtLABEL" fi -fi +fi PATH=$VTPATH_OLD diff --git a/IMG/cpio/ventoy/hook/kaos/ventoy-hook.sh b/IMG/cpio/ventoy/hook/kaos/ventoy-hook.sh index 84aadc03fbb..c1c29d7da70 100644 --- a/IMG/cpio/ventoy/hook/kaos/ventoy-hook.sh +++ b/IMG/cpio/ventoy/hook/kaos/ventoy-hook.sh @@ -4,12 +4,12 @@ if $GREP -q '^"$mount_handler"' /init; then echo 'use mount_handler1 ...' >> $VTLOG - $SED "/^\"\$mount_handler\"/i\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/kaos/ventoy-disk.sh" -i /init + $SED "/^\"\$mount_handler\"/i\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/kaos/ventoy-disk.sh" -i /init elif $GREP -q '^$mount_handler' /init; then echo 'use mount_handler2 ...' >> $VTLOG - $SED "/^\$mount_handler/i\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/kaos/ventoy-disk.sh" -i /init + $SED "/^\$mount_handler/i\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/kaos/ventoy-disk.sh" -i /init fi if [ -f $VTOY_PATH/ventoy_persistent_map ]; then - $SED "1 aexport cow_label=vtoycow" -i /init + $SED "1 aexport cow_label=vtoycow" -i /init fi diff --git a/IMG/cpio/ventoy/hook/kiosk/ventoy-disk.sh b/IMG/cpio/ventoy/hook/kiosk/ventoy-disk.sh index 2c9342780ae..95ea836ba3e 100644 --- a/IMG/cpio/ventoy/hook/kiosk/ventoy-disk.sh +++ b/IMG/cpio/ventoy/hook/kiosk/ventoy-disk.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh @@ -23,25 +23,25 @@ VTPATH_OLD=$PATH; PATH=$BUSYBOX_PATH:$VTOY_PATH/tool:$PATH ventoy_os_install_dmsetup_by_unsquashfs() { vtlog "ventoy_os_install_dmsetup_by_unsquashfs $*" - + vtKerVer=$(uname -r) vtKoPo=$(ventoy_get_module_postfix) vtlog "vtKerVer=$vtKerVer vtKoPo=$vtKoPo" vtoydm -i -f $VTOY_PATH/ventoy_image_map -d $1 > $VTOY_PATH/iso_file_list - vtline=$(grep '[-][-] .*kernel.xzm ' $VTOY_PATH/iso_file_list) + vtline=$(grep '[-][-] .*kernel.xzm ' $VTOY_PATH/iso_file_list) sector=$(echo $vtline | awk '{print $(NF-1)}') length=$(echo $vtline | awk '{print $NF}') - + vtlog "vtline=$vtline sector=$sector length=$length" - + vtoydm -e -f $VTOY_PATH/ventoy_image_map -d $1 -s $sector -l $length -o $VTOY_PATH/kernel.xzm - mkdir -p $VTOY_PATH/sqfs + mkdir -p $VTOY_PATH/sqfs mount $VTOY_PATH/kernel.xzm $VTOY_PATH/sqfs - dmModPath="/lib/modules/$vtKerVer/kernel/drivers/md/dm-mod.$vtKoPo" - + dmModPath="/lib/modules/$vtKerVer/kernel/drivers/md/dm-mod.$vtKoPo" + if [ -e $VTOY_PATH/sqfs${dmModPath} ]; then vtlog "success $VTOY_PATH/sqfs${dmModPath}" insmod $VTOY_PATH/sqfs${dmModPath} @@ -49,7 +49,7 @@ ventoy_os_install_dmsetup_by_unsquashfs() { vterr "failed $VTOY_PATH/sqfs${dmModPath}" false fi - + umount $VTOY_PATH/sqfs rm -f $VTOY_PATH/kernel.xzm } diff --git a/IMG/cpio/ventoy/hook/kiosk/ventoy-hook.sh b/IMG/cpio/ventoy/hook/kiosk/ventoy-hook.sh index 31e5b96f489..1adaece214b 100644 --- a/IMG/cpio/ventoy/hook/kiosk/ventoy-hook.sh +++ b/IMG/cpio/ventoy/hook/kiosk/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh diff --git a/IMG/cpio/ventoy/hook/kwort/disk-hook.sh b/IMG/cpio/ventoy/hook/kwort/disk-hook.sh index 8ee05793258..ace73cb68ce 100644 --- a/IMG/cpio/ventoy/hook/kwort/disk-hook.sh +++ b/IMG/cpio/ventoy/hook/kwort/disk-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/hook/kwort/ventoy-hook.sh b/IMG/cpio/ventoy/hook/kwort/ventoy-hook.sh index 78f5615015a..816003c9495 100644 --- a/IMG/cpio/ventoy/hook/kwort/ventoy-hook.sh +++ b/IMG/cpio/ventoy/hook/kwort/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh diff --git a/IMG/cpio/ventoy/hook/lunar/ventoy-hook.sh b/IMG/cpio/ventoy/hook/lunar/ventoy-hook.sh index 31744f6ccfd..50d2bede488 100644 --- a/IMG/cpio/ventoy/hook/lunar/ventoy-hook.sh +++ b/IMG/cpio/ventoy/hook/lunar/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh diff --git a/IMG/cpio/ventoy/hook/lunar/ventoy-inotifyd-hook.sh b/IMG/cpio/ventoy/hook/lunar/ventoy-inotifyd-hook.sh index 2ddc120141a..448394948a4 100644 --- a/IMG/cpio/ventoy/hook/lunar/ventoy-inotifyd-hook.sh +++ b/IMG/cpio/ventoy/hook/lunar/ventoy-inotifyd-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh @@ -31,13 +31,13 @@ if is_inotify_ventoy_part $3; then vtlog "find ventoy partition ..." $BUSYBOX_PATH/sh $VTOY_PATH/hook/default/udev_disk_hook.sh $3 noreplace - + blkdev_num=$($VTOY_PATH/tool/dmsetup ls | grep ventoy | sed 's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1:\2/') vtDM=$(ventoy_find_dm_id ${blkdev_num}) cp -a /dev/$vtDM /dev/ventoy mount -t iso9660 /dev/ventoy /sysroot - + set_ventoy_hook_finish else vtlog "##### INOTIFYD: $2/$3 is created (NO) ..." diff --git a/IMG/cpio/ventoy/hook/lunar/ventoy-inotifyd-start.sh b/IMG/cpio/ventoy/hook/lunar/ventoy-inotifyd-start.sh index 6be8155510e..59e4dc85a81 100644 --- a/IMG/cpio/ventoy/hook/lunar/ventoy-inotifyd-start.sh +++ b/IMG/cpio/ventoy/hook/lunar/ventoy-inotifyd-start.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh @@ -24,7 +24,7 @@ vtHook=$($CAT $VTOY_PATH/inotifyd-hook-script.txt) vtdisk=$(get_ventoy_disk_name) if [ "$vtdisk" = "unknown" ]; then vtlog "... start inotifyd listen $vtHook ..." - $BUSYBOX_PATH/nohup $VTOY_PATH/tool/inotifyd $vtHook /dev:n 2>&- & + $BUSYBOX_PATH/nohup $VTOY_PATH/tool/inotifyd $vtHook /dev:n 2>&- & else vtlog "... $vtdisk already exist ..." $BUSYBOX_PATH/sh $vtHook n /dev "${vtdisk#/dev/}2" diff --git a/IMG/cpio/ventoy/hook/mageia/ventoy-hook.sh b/IMG/cpio/ventoy/hook/mageia/ventoy-hook.sh index 05c6c412e24..6a57b3a0bea 100644 --- a/IMG/cpio/ventoy/hook/mageia/ventoy-hook.sh +++ b/IMG/cpio/ventoy/hook/mageia/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh diff --git a/IMG/cpio/ventoy/hook/mageia/ventoy-inotifyd-hook.sh b/IMG/cpio/ventoy/hook/mageia/ventoy-inotifyd-hook.sh index 61e50eff5cd..5b05baa7bf6 100644 --- a/IMG/cpio/ventoy/hook/mageia/ventoy-inotifyd-hook.sh +++ b/IMG/cpio/ventoy/hook/mageia/ventoy-inotifyd-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh @@ -27,25 +27,25 @@ VTPATH_OLD=$PATH; PATH=$BUSYBOX_PATH:$VTOY_PATH/tool:$PATH if is_inotify_ventoy_part $3; then vtlog "##### INOTIFYD: $2/$3 is created (YES) ..." - + vtlog "find ventoy partition ..." $BUSYBOX_PATH/sh $VTOY_PATH/hook/default/udev_disk_hook.sh $3 noreplace - - blkdev_num=$($VTOY_PATH/tool/dmsetup ls | grep ventoy | sed 's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1:\2/') - vtDM=$(ventoy_find_dm_id ${blkdev_num}) + + blkdev_num=$($VTOY_PATH/tool/dmsetup ls | grep ventoy | sed 's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1:\2/') + vtDM=$(ventoy_find_dm_id ${blkdev_num}) vtLABEL=$($BUSYBOX_PATH/blkid /dev/$vtDM | $AWK '{print $2}' | $SED 's/.*"\(.*\)".*/\1/') - + vtlog "blkdev_num=$blkdev_num vtDM=$vtDM label $vtLABEL ..." - + if [ -n "$vtLABEL" ]; then $BUSYBOX_PATH/mkdir -p /dev/disk/by-label/ ln -s /dev/$vtDM /dev/disk/by-label/$vtLABEL fi - + # # cheatcode for mageia # - # From mageia/soft/drakx/mdk-stage1 source code, we see that the stage1 binary will search + # From mageia/soft/drakx/mdk-stage1 source code, we see that the stage1 binary will search # /tmp/syslog file to determin whether there is a DAC960 cdrom in the system. # So we insert some string to /tmp/syslog file to cheat the stage1 program. # @@ -55,13 +55,13 @@ if is_inotify_ventoy_part $3; then if [ -e /sbin/mgalive-root ]; then vtlog "set mgalive-root ..." - + $BUSYBOX_PATH/cp -a $BUSYBOX_PATH/blkid /sbin/blkid $BUSYBOX_PATH/mkdir -p /dev/mapper - ln -s /dev/$vtDM /dev/mapper/ventoy + ln -s /dev/$vtDM /dev/mapper/ventoy /sbin/mgalive-root /dev/$vtDM fi - + set_ventoy_hook_finish else vtlog "##### INOTIFYD: $2/$3 is created (NO) ..." diff --git a/IMG/cpio/ventoy/hook/mageia/ventoy-inotifyd-start.sh b/IMG/cpio/ventoy/hook/mageia/ventoy-inotifyd-start.sh index 6be8155510e..59e4dc85a81 100644 --- a/IMG/cpio/ventoy/hook/mageia/ventoy-inotifyd-start.sh +++ b/IMG/cpio/ventoy/hook/mageia/ventoy-inotifyd-start.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh @@ -24,7 +24,7 @@ vtHook=$($CAT $VTOY_PATH/inotifyd-hook-script.txt) vtdisk=$(get_ventoy_disk_name) if [ "$vtdisk" = "unknown" ]; then vtlog "... start inotifyd listen $vtHook ..." - $BUSYBOX_PATH/nohup $VTOY_PATH/tool/inotifyd $vtHook /dev:n 2>&- & + $BUSYBOX_PATH/nohup $VTOY_PATH/tool/inotifyd $vtHook /dev:n 2>&- & else vtlog "... $vtdisk already exist ..." $BUSYBOX_PATH/sh $vtHook n /dev "${vtdisk#/dev/}2" diff --git a/IMG/cpio/ventoy/hook/manjaro/ventoy-disk.sh b/IMG/cpio/ventoy/hook/manjaro/ventoy-disk.sh index d23fe49916c..f46300471d5 100644 --- a/IMG/cpio/ventoy/hook/manjaro/ventoy-disk.sh +++ b/IMG/cpio/ventoy/hook/manjaro/ventoy-disk.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh @@ -49,7 +49,7 @@ done if [ -n "$1" ]; then vtlog "ln -s /dev/$vtDM $1" - + if [ -e "$1" ]; then vtlog "$1 already exist" else @@ -58,18 +58,18 @@ if [ -n "$1" ]; then else vtLABEL=$($BUSYBOX_PATH/blkid /dev/$vtDM | $SED 's/.*LABEL="\([^"]*\)".*/\1/') vtlog "vtLABEL is $vtLABEL" - + if [ -z "$vtLABEL" ]; then vtLABEL=$($SED "s/.*label=\([^ ]*\)/\1/" /proc/cmdline) vtlog "vtLABEL is $vtLABEL from cmdline" fi - + if [ -e "/dev/disk/by-label/$vtLABEL" ]; then vtlog "/dev/disk/by-label/$vtLABEL already exist" else ln -s /dev/$vtDM "/dev/disk/by-label/$vtLABEL" fi -fi +fi # OK finish set_ventoy_hook_finish diff --git a/IMG/cpio/ventoy/hook/manjaro/ventoy-hook.sh b/IMG/cpio/ventoy/hook/manjaro/ventoy-hook.sh index f5cdcf5724d..9129e040f94 100644 --- a/IMG/cpio/ventoy/hook/manjaro/ventoy-hook.sh +++ b/IMG/cpio/ventoy/hook/manjaro/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh @@ -30,22 +30,22 @@ fi if $GREP -q '^"$mount_handler"' /init; then echo 'use mount_handler ...' >> $VTLOG - + vthookfile=/hooks/archiso - + if [ -e /hooks/miso ]; then vthookfile=/hooks/miso - $SED "/^\"\$mount_handler\"/i\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/manjaro/ventoy-disk.sh \"\$misodevice\"" -i /init + $SED "/^\"\$mount_handler\"/i\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/manjaro/ventoy-disk.sh \"\$misodevice\"" -i /init else $SED "/^\"\$mount_handler\"/i\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/manjaro/ventoy-disk.sh \"\$archisodevice\"" -i /init fi - + if [ -f $vthookfile ]; then $SED '/while ! poll_device "${dev}"/a\ if /ventoy/busybox/sh /ventoy/hook/manjaro/ventoy-timeout.sh ${dev}; then break; fi' -i $vthookfile - fi + fi elif $GREP -q '^mount_setup$' init; then echo "Here use notify ..." >> $VTLOG - + ventoy_set_inotify_script manjaro/ventoy-inotifyd-hook.sh $SED "/^mount_setup$/a\\$BUSYBOX_PATH/sh $VTOY_PATH/hook/default/ventoy-inotifyd-start.sh" -i /init else diff --git a/IMG/cpio/ventoy/hook/manjaro/ventoy-inotifyd-hook.sh b/IMG/cpio/ventoy/hook/manjaro/ventoy-inotifyd-hook.sh index 5f2d45cb6ad..5d83c0b6009 100644 --- a/IMG/cpio/ventoy/hook/manjaro/ventoy-inotifyd-hook.sh +++ b/IMG/cpio/ventoy/hook/manjaro/ventoy-inotifyd-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh @@ -27,15 +27,15 @@ VTPATH_OLD=$PATH; PATH=$BUSYBOX_PATH:$VTOY_PATH/tool:$PATH if is_inotify_ventoy_part $3; then vtlog "##### INOTIFYD: $2/$3 is created (YES) ..." - vtlog "find ventoy partition $3 ..." + vtlog "find ventoy partition $3 ..." $BUSYBOX_PATH/sh $VTOY_PATH/hook/default/udev_disk_hook.sh "$3" - - blkdev_num=$($VTOY_PATH/tool/dmsetup ls | grep ventoy | sed 's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1:\2/') + + blkdev_num=$($VTOY_PATH/tool/dmsetup ls | grep ventoy | sed 's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1:\2/') vtDM=$(ventoy_find_dm_id ${blkdev_num}) vtLABEL=$($BUSYBOX_PATH/blkid /dev/$vtDM | $AWK '{print $2}' | $SED 's/.*"\(.*\)".*/\1/') vtlog "blkdev_num=$blkdev_num vtDM=$vtDM label $vtLABEL ..." - + if ! [ -d /dev/disk/by-label ]; then mkdir -p /dev/disk/by-label fi diff --git a/IMG/cpio/ventoy/hook/nixos/udev_disk_hook.sh b/IMG/cpio/ventoy/hook/nixos/udev_disk_hook.sh index 633f29ea789..5c2b5fc56e5 100644 --- a/IMG/cpio/ventoy/hook/nixos/udev_disk_hook.sh +++ b/IMG/cpio/ventoy/hook/nixos/udev_disk_hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/hook/nixos/ventoy-hook.sh b/IMG/cpio/ventoy/hook/nixos/ventoy-hook.sh index 7b01c13cfc9..6ae3264ff63 100644 --- a/IMG/cpio/ventoy/hook/nixos/ventoy-hook.sh +++ b/IMG/cpio/ventoy/hook/nixos/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh diff --git a/IMG/cpio/ventoy/hook/nutyx/ventoy-disk.sh b/IMG/cpio/ventoy/hook/nutyx/ventoy-disk.sh index 44c5038f892..026e1f39afd 100644 --- a/IMG/cpio/ventoy/hook/nutyx/ventoy-disk.sh +++ b/IMG/cpio/ventoy/hook/nutyx/ventoy-disk.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh @@ -36,9 +36,9 @@ if [ "$vtdiskname" = "unknown" ]; then exit 0 fi -ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2" +ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2" -blkdev_num=$(dmsetup ls | grep ventoy | sed 's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1:\2/') +blkdev_num=$(dmsetup ls | grep ventoy | sed 's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1:\2/') vtDM=$(ventoy_find_dm_id ${blkdev_num}) vtlog "link /dev/$vtDM $VTOY_DM_PATH" diff --git a/IMG/cpio/ventoy/hook/nutyx/ventoy-hook.sh b/IMG/cpio/ventoy/hook/nutyx/ventoy-hook.sh index 17bf538b26b..e7a9dab0c6d 100644 --- a/IMG/cpio/ventoy/hook/nutyx/ventoy-hook.sh +++ b/IMG/cpio/ventoy/hook/nutyx/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh diff --git a/IMG/cpio/ventoy/hook/openEuler/ventoy-autoexp.sh b/IMG/cpio/ventoy/hook/openEuler/ventoy-autoexp.sh index 661d4365780..74cd0e82920 100644 --- a/IMG/cpio/ventoy/hook/openEuler/ventoy-autoexp.sh +++ b/IMG/cpio/ventoy/hook/openEuler/ventoy-autoexp.sh @@ -1,20 +1,20 @@ #!/bin/sh #************************************************************************************ # Copyright (c) 2022, longpanda -# +# # 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 . -# +# #************************************************************************************ if [ -f /run/install/ks.cfg ]; then diff --git a/IMG/cpio/ventoy/hook/openEuler/ventoy-hook.sh b/IMG/cpio/ventoy/hook/openEuler/ventoy-hook.sh index 40d67d5daf5..3eaa75bff60 100644 --- a/IMG/cpio/ventoy/hook/openEuler/ventoy-hook.sh +++ b/IMG/cpio/ventoy/hook/openEuler/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh @@ -29,14 +29,14 @@ else VTKS="inst.ks=hd:/dev/ventoy:$vtRawKs" break fi - + if echo $vtParam | $GREP -q '^ks=.*:/'; then vtRawKsFull="$vtParam" vtRawKs=$(echo $vtParam | $AWK -F: '{print $NF}') VTKS="ks=hd:/dev/ventoy:$vtRawKs" break fi - + if echo $vtParam | $GREP -q '^inst.ks=.*:/'; then vtRawKsFull="$vtParam" vtRawKs=$(echo $vtParam | $AWK -F: '{print $NF}') @@ -48,18 +48,18 @@ fi if [ -f $VTOY_PATH/ventoy_persistent_map ]; then VTOVERLAY="rd.live.overlay=/dev/dm-1:/vtoyoverlayfs/overlayfs" - + if [ -e /sbin/dmsquash-live-root ]; then echo "patch /sbin/dmsquash-live-root for persistent ..." >> $VTLOG $SED "/mount.*devspec.*\/run\/initramfs\/overlayfs/a . /ventoy/hook/openEuler/ventoy-overlay.sh" -i /sbin/dmsquash-live-root fi - + #close selinux $BUSYBOX_PATH/mkdir -p $VTOY_PATH/selinuxfs if $BUSYBOX_PATH/mount -t selinuxfs selinuxfs $VTOY_PATH/selinuxfs; then echo 1 > $VTOY_PATH/selinuxfs/disable $BUSYBOX_PATH/umount $VTOY_PATH/selinuxfs - fi + fi $BUSYBOX_PATH/rm -rf $VTOY_PATH/selinuxfs fi @@ -72,7 +72,7 @@ if [ -n "$vtRawKs" ]; then VTKS="" else echo "$vtRawKs" > $VTOY_PATH/ventoy_ks_rootpath - fi + fi fi if ls $VTOY_PATH | $GREP -q 'ventoy_dud[0-9]'; then diff --git a/IMG/cpio/ventoy/hook/openEuler/ventoy-inotifyd-hook.sh b/IMG/cpio/ventoy/hook/openEuler/ventoy-inotifyd-hook.sh index afbaec75542..38d2bbe860e 100644 --- a/IMG/cpio/ventoy/hook/openEuler/ventoy-inotifyd-hook.sh +++ b/IMG/cpio/ventoy/hook/openEuler/ventoy-inotifyd-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh @@ -30,33 +30,33 @@ if is_inotify_ventoy_part $3; then vtlog "##### INOTIFYD: $2/$3 is created (YES) ..." vtlog "find ventoy partition ..." - + #vtReplaceOpt=noreplace - - $BUSYBOX_PATH/sh $VTOY_PATH/hook/default/udev_disk_hook.sh $3 - + + $BUSYBOX_PATH/sh $VTOY_PATH/hook/default/udev_disk_hook.sh $3 + blkdev_num_mknod=$($VTOY_PATH/tool/dmsetup ls | $GREP ventoy | sed 's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1 \2/') $BUSYBOX_PATH/mknod -m 660 /dev/ventoy b $blkdev_num_mknod $BUSYBOX_PATH/modprobe isofs >/dev/null 2>&1 vtlog "mknod /dev/ventoy $blkdev_num_mknod" - + if [ -f $VTOY_PATH/ventoy_ks_rootpath ]; then vt_ks_rootpath=$(cat $VTOY_PATH/ventoy_ks_rootpath) vtlog "ks rootpath <$vt_ks_rootpath>" if [ -e /sbin/fetch-kickstart-disk ]; then - vtlog "fetch-kickstart-disk ..." + vtlog "fetch-kickstart-disk ..." /sbin/fetch-kickstart-disk /dev/ventoy "$vt_ks_rootpath" fi fi - + if [ -e /sbin/anaconda-diskroot ]; then - vtlog "set anaconda-diskroot ..." + vtlog "set anaconda-diskroot ..." #busybox cp doesn't support -t option (issue 1900) /bin/cp -a /bin/cp $BUSYBOX_PATH/cp /sbin/anaconda-diskroot /dev/ventoy fi - + set_ventoy_hook_finish else vtlog "##### INOTIFYD: $2/$3 is created (NO) ..." diff --git a/IMG/cpio/ventoy/hook/openEuler/ventoy-inotifyd-start.sh b/IMG/cpio/ventoy/hook/openEuler/ventoy-inotifyd-start.sh index 6be8155510e..59e4dc85a81 100644 --- a/IMG/cpio/ventoy/hook/openEuler/ventoy-inotifyd-start.sh +++ b/IMG/cpio/ventoy/hook/openEuler/ventoy-inotifyd-start.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh @@ -24,7 +24,7 @@ vtHook=$($CAT $VTOY_PATH/inotifyd-hook-script.txt) vtdisk=$(get_ventoy_disk_name) if [ "$vtdisk" = "unknown" ]; then vtlog "... start inotifyd listen $vtHook ..." - $BUSYBOX_PATH/nohup $VTOY_PATH/tool/inotifyd $vtHook /dev:n 2>&- & + $BUSYBOX_PATH/nohup $VTOY_PATH/tool/inotifyd $vtHook /dev:n 2>&- & else vtlog "... $vtdisk already exist ..." $BUSYBOX_PATH/sh $vtHook n /dev "${vtdisk#/dev/}2" diff --git a/IMG/cpio/ventoy/hook/openEuler/ventoy-make-link.sh b/IMG/cpio/ventoy/hook/openEuler/ventoy-make-link.sh index a69233610c1..f7955ae9886 100644 --- a/IMG/cpio/ventoy/hook/openEuler/ventoy-make-link.sh +++ b/IMG/cpio/ventoy/hook/openEuler/ventoy-make-link.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh @@ -23,7 +23,7 @@ if [ ! -e /dev/dm-0 ]; then exit 0 fi -blkdev_num=$($VTOY_PATH/tool/dmsetup ls | grep ventoy | sed 's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1:\2/') +blkdev_num=$($VTOY_PATH/tool/dmsetup ls | grep ventoy | sed 's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1:\2/') vtDM=$(ventoy_find_dm_id ${blkdev_num}) if ! [ -e /dev/mapper/ventoy ]; then diff --git a/IMG/cpio/ventoy/hook/openEuler/ventoy-overlay.sh b/IMG/cpio/ventoy/hook/openEuler/ventoy-overlay.sh index d8fe0799501..7962935d6d8 100644 --- a/IMG/cpio/ventoy/hook/openEuler/ventoy-overlay.sh +++ b/IMG/cpio/ventoy/hook/openEuler/ventoy-overlay.sh @@ -1,20 +1,20 @@ #!/bin/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ [ -d /run/initramfs/overlayfs$pathspec ] || mkdir -p /run/initramfs/overlayfs$pathspec diff --git a/IMG/cpio/ventoy/hook/openEuler/ventoy-repo.sh b/IMG/cpio/ventoy/hook/openEuler/ventoy-repo.sh index af85bebda73..5762d92b028 100644 --- a/IMG/cpio/ventoy/hook/openEuler/ventoy-repo.sh +++ b/IMG/cpio/ventoy/hook/openEuler/ventoy-repo.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/hook/openEuler/ventoy-timeout.sh b/IMG/cpio/ventoy/hook/openEuler/ventoy-timeout.sh index cfd339f7eff..f4f0df5b97d 100644 --- a/IMG/cpio/ventoy/hook/openEuler/ventoy-timeout.sh +++ b/IMG/cpio/ventoy/hook/openEuler/ventoy-timeout.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh @@ -32,7 +32,7 @@ if [ -f $VTOY_PATH/ventoy_ks_rootpath ]; then vt_ks_rootpath=$(cat $VTOY_PATH/ventoy_ks_rootpath) vtlog "ks rootpath <$vt_ks_rootpath>" if [ -e /sbin/fetch-kickstart-disk ]; then - vtlog "fetch-kickstart-disk ..." + vtlog "fetch-kickstart-disk ..." /sbin/fetch-kickstart-disk /dev/ventoy "$vt_ks_rootpath" fi fi diff --git a/IMG/cpio/ventoy/hook/parabola/ventoy-disk.sh b/IMG/cpio/ventoy/hook/parabola/ventoy-disk.sh index 356c77f8efd..b3091eec2ee 100644 --- a/IMG/cpio/ventoy/hook/parabola/ventoy-disk.sh +++ b/IMG/cpio/ventoy/hook/parabola/ventoy-disk.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh @@ -38,10 +38,10 @@ ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2" "noreplace" if [ -n "$1" ]; then blkdev_num=$($VTOY_PATH/tool/dmsetup ls | grep ventoy | sed 's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1:\2/') vtDM=$(ventoy_find_dm_id ${blkdev_num}) - + vtlog "ln -s /dev/$vtDM $1" ln -s /dev/$vtDM "$1" -fi +fi # OK finish set_ventoy_hook_finish diff --git a/IMG/cpio/ventoy/hook/parabola/ventoy-hook.sh b/IMG/cpio/ventoy/hook/parabola/ventoy-hook.sh index b8b3a5d5da9..3dd29aa076b 100644 --- a/IMG/cpio/ventoy/hook/parabola/ventoy-hook.sh +++ b/IMG/cpio/ventoy/hook/parabola/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh @@ -22,11 +22,11 @@ if $GREP -q '^"$mount_handler"' /init; then echo 'use mount_handler ...' >> $VTLOG $SED "/^\"\$mount_handler\"/i\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/parabola/ventoy-disk.sh \"\$parabolaisodevice\"" -i /init - + if [ -f /hooks/parabolaiso ]; then $SED '/while ! poll_device "${dev}"/a\ if /ventoy/busybox/sh /ventoy/hook/parabola/ventoy-timeout.sh ${dev}; then break; fi' -i /hooks/parabolaiso fi - + else # some archlinux initramfs doesn't contain device-mapper udev rules file ARCH_UDEV_DIR=$(ventoy_get_udev_conf_dir) diff --git a/IMG/cpio/ventoy/hook/parabola/ventoy-timeout.sh b/IMG/cpio/ventoy/hook/parabola/ventoy-timeout.sh index fec9cc0770a..fc4cb388ec3 100644 --- a/IMG/cpio/ventoy/hook/parabola/ventoy-timeout.sh +++ b/IMG/cpio/ventoy/hook/parabola/ventoy-timeout.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/hook/pclos/disk_hook.sh b/IMG/cpio/ventoy/hook/pclos/disk_hook.sh index bf7cb9e69c1..7b9f2ecd57d 100644 --- a/IMG/cpio/ventoy/hook/pclos/disk_hook.sh +++ b/IMG/cpio/ventoy/hook/pclos/disk_hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh @@ -23,18 +23,18 @@ VTPATH_OLD=$PATH; PATH=$BUSYBOX_PATH:$VTOY_PATH/tool:$PATH ventoy_os_install_device_mapper_by_unsquashfs() { vtlog "ventoy_os_install_device_mapper_by_unsquashfs $*" - + vtKoExt=$(ventoy_get_module_postfix) vtlog "vtKoExt=$vtKoExt" vtoydm -i -f $VTOY_PATH/ventoy_image_map -d $1 > $VTOY_PATH/iso_file_list - vtline=$(grep '[-][-] livecd.sqfs ' $VTOY_PATH/iso_file_list) + vtline=$(grep '[-][-] livecd.sqfs ' $VTOY_PATH/iso_file_list) sector=$(echo $vtline | awk '{print $(NF-1)}') length=$(echo $vtline | awk '{print $NF}') - + vtoydm -E -f $VTOY_PATH/ventoy_image_map -d $1 -s $sector -l $length -o $VTOY_PATH/fsdisk - + dmModPath="/lib/modules/$2/kernel/drivers/md/dm-mod.$vtKoExt" echo $dmModPath > $VTOY_PATH/fsextract vtoy_unsquashfs -d $VTOY_PATH/sqfs -n -q -e $VTOY_PATH/fsextract $VTOY_PATH/fsdisk @@ -50,12 +50,12 @@ ventoy_os_install_device_mapper_by_unsquashfs() { ventoy_os_install_device_mapper() { vtlog "ventoy_os_install_device_mapper" - + if grep -q 'device-mapper' /proc/devices; then vtlog "device-mapper module already loaded" return; fi - + vtKerVer=$(uname -r) if ventoy_os_install_device_mapper_by_unsquashfs $1 $vtKerVer; then vtlog "unsquashfs success" diff --git a/IMG/cpio/ventoy/hook/pclos/ventoy-hook.sh b/IMG/cpio/ventoy/hook/pclos/ventoy-hook.sh index d0824533e40..1db4588f842 100644 --- a/IMG/cpio/ventoy/hook/pclos/ventoy-hook.sh +++ b/IMG/cpio/ventoy/hook/pclos/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh diff --git a/IMG/cpio/ventoy/hook/phoenixos/disk_hook.sh b/IMG/cpio/ventoy/hook/phoenixos/disk_hook.sh index 56b97b21cb4..af90c40a8df 100644 --- a/IMG/cpio/ventoy/hook/phoenixos/disk_hook.sh +++ b/IMG/cpio/ventoy/hook/phoenixos/disk_hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh @@ -25,7 +25,7 @@ fi VTPATH_OLD=$PATH; PATH=$BUSYBOX_PATH:$VTOY_PATH/tool:$PATH -for i in 0 1 2 3 4 5 6 7 8 9; do +for i in 0 1 2 3 4 5 6 7 8 9; do vtdiskname=$(get_ventoy_disk_name) if [ "$vtdiskname" = "unknown" ]; then vtlog "wait for disk ..." diff --git a/IMG/cpio/ventoy/hook/phoenixos/ventoy-hook.sh b/IMG/cpio/ventoy/hook/phoenixos/ventoy-hook.sh index 0ead131c76d..14ce8e53382 100644 --- a/IMG/cpio/ventoy/hook/phoenixos/ventoy-hook.sh +++ b/IMG/cpio/ventoy/hook/phoenixos/ventoy-hook.sh @@ -1,24 +1,24 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh $BUSYBOX_PATH/mkdir /dev -$SED "/for device in/i\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/phoenixos/disk_hook.sh" -i /init -$SED "s#for device in #for device in /dev/ventoy #" -i /init +$SED "/for device in/i\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/phoenixos/disk_hook.sh" -i /init +$SED "s#for device in #for device in /dev/ventoy #" -i /init diff --git a/IMG/cpio/ventoy/hook/photon/ventoy-hook.sh b/IMG/cpio/ventoy/hook/photon/ventoy-hook.sh index 9a29807175b..38c21a61363 100644 --- a/IMG/cpio/ventoy/hook/photon/ventoy-hook.sh +++ b/IMG/cpio/ventoy/hook/photon/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh diff --git a/IMG/cpio/ventoy/hook/photon/ventoy-inotifyd-hook.sh b/IMG/cpio/ventoy/hook/photon/ventoy-inotifyd-hook.sh index 424d84e99ee..a9fdc52ad36 100644 --- a/IMG/cpio/ventoy/hook/photon/ventoy-inotifyd-hook.sh +++ b/IMG/cpio/ventoy/hook/photon/ventoy-inotifyd-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh @@ -31,10 +31,10 @@ if is_inotify_ventoy_part $3; then vtlog "find ventoy partition ..." $BUSYBOX_PATH/sh $VTOY_PATH/hook/default/udev_disk_hook.sh $3 noreplace - + blkdev_num=$($VTOY_PATH/tool/dmsetup ls | grep ventoy | sed 's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1 \2/') mknod -m 0660 /dev/ventoy b $blkdev_num - + set_ventoy_hook_finish else vtlog "##### INOTIFYD: $2/$3 is created (NO) ..." diff --git a/IMG/cpio/ventoy/hook/photon/ventoy-inotifyd-start.sh b/IMG/cpio/ventoy/hook/photon/ventoy-inotifyd-start.sh index 6be8155510e..59e4dc85a81 100644 --- a/IMG/cpio/ventoy/hook/photon/ventoy-inotifyd-start.sh +++ b/IMG/cpio/ventoy/hook/photon/ventoy-inotifyd-start.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh @@ -24,7 +24,7 @@ vtHook=$($CAT $VTOY_PATH/inotifyd-hook-script.txt) vtdisk=$(get_ventoy_disk_name) if [ "$vtdisk" = "unknown" ]; then vtlog "... start inotifyd listen $vtHook ..." - $BUSYBOX_PATH/nohup $VTOY_PATH/tool/inotifyd $vtHook /dev:n 2>&- & + $BUSYBOX_PATH/nohup $VTOY_PATH/tool/inotifyd $vtHook /dev:n 2>&- & else vtlog "... $vtdisk already exist ..." $BUSYBOX_PATH/sh $vtHook n /dev "${vtdisk#/dev/}2" diff --git a/IMG/cpio/ventoy/hook/pisilinux/ventoy-disk.sh b/IMG/cpio/ventoy/hook/pisilinux/ventoy-disk.sh index 891cd9057df..076ccc74c37 100644 --- a/IMG/cpio/ventoy/hook/pisilinux/ventoy-disk.sh +++ b/IMG/cpio/ventoy/hook/pisilinux/ventoy-disk.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/hook/pisilinux/ventoy-hook.sh b/IMG/cpio/ventoy/hook/pisilinux/ventoy-hook.sh index 9fc1fc588aa..87383ac52c6 100644 --- a/IMG/cpio/ventoy/hook/pisilinux/ventoy-hook.sh +++ b/IMG/cpio/ventoy/hook/pisilinux/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh diff --git a/IMG/cpio/ventoy/hook/ploplinux/disk_hook.sh b/IMG/cpio/ventoy/hook/ploplinux/disk_hook.sh index 336b7bbf0d1..60db000b5f3 100644 --- a/IMG/cpio/ventoy/hook/ploplinux/disk_hook.sh +++ b/IMG/cpio/ventoy/hook/ploplinux/disk_hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/hook/ploplinux/ventoy-hook.sh b/IMG/cpio/ventoy/hook/ploplinux/ventoy-hook.sh index 8eaef67b760..0e547d11cf3 100644 --- a/IMG/cpio/ventoy/hook/ploplinux/ventoy-hook.sh +++ b/IMG/cpio/ventoy/hook/ploplinux/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh diff --git a/IMG/cpio/ventoy/hook/pmagic/disk-hook.sh b/IMG/cpio/ventoy/hook/pmagic/disk-hook.sh index 3e46fbfd15a..94d0daba992 100644 --- a/IMG/cpio/ventoy/hook/pmagic/disk-hook.sh +++ b/IMG/cpio/ventoy/hook/pmagic/disk-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/hook/pmagic/udev_disk_hook.sh b/IMG/cpio/ventoy/hook/pmagic/udev_disk_hook.sh index 93e0548ec69..e01954fe63d 100644 --- a/IMG/cpio/ventoy/hook/pmagic/udev_disk_hook.sh +++ b/IMG/cpio/ventoy/hook/pmagic/udev_disk_hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/hook/pmagic/ventoy-hook.sh b/IMG/cpio/ventoy/hook/pmagic/ventoy-hook.sh index d476887556f..642826b0cea 100644 --- a/IMG/cpio/ventoy/hook/pmagic/ventoy-hook.sh +++ b/IMG/cpio/ventoy/hook/pmagic/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh @@ -24,7 +24,7 @@ if $GREP -q 'Searching *for *PMAGIC' /init; then $SED "/Searching *for *PMAGIC/a\ root=/dev/ventoy" -i /init $SED "/Searching *for *PMAGIC/a\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/pmagic/disk-hook.sh" -i /init else - echo "Use default..." >> $VTLOG + echo "Use default..." >> $VTLOG $SED "s#^root=.*cmdline.*#root=/dev/ventoy#g'" -i /init ventoy_systemd_udevd_work_around ventoy_add_udev_rule "$VTOY_PATH/hook/pmagic/udev_disk_hook.sh %k" diff --git a/IMG/cpio/ventoy/hook/primeos/ventoy-disk.sh b/IMG/cpio/ventoy/hook/primeos/ventoy-disk.sh index c678bdd1c51..26c3e983b87 100644 --- a/IMG/cpio/ventoy/hook/primeos/ventoy-disk.sh +++ b/IMG/cpio/ventoy/hook/primeos/ventoy-disk.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/hook/primeos/ventoy-hook.sh b/IMG/cpio/ventoy/hook/primeos/ventoy-hook.sh index 8cf543db639..b80bf160a95 100644 --- a/IMG/cpio/ventoy/hook/primeos/ventoy-hook.sh +++ b/IMG/cpio/ventoy/hook/primeos/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh diff --git a/IMG/cpio/ventoy/hook/rancher/disk_hook.sh b/IMG/cpio/ventoy/hook/rancher/disk_hook.sh index 336b7bbf0d1..60db000b5f3 100644 --- a/IMG/cpio/ventoy/hook/rancher/disk_hook.sh +++ b/IMG/cpio/ventoy/hook/rancher/disk_hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/hook/rancher/ventoy-hook.sh b/IMG/cpio/ventoy/hook/rancher/ventoy-hook.sh index e2f27faa15a..92237467222 100644 --- a/IMG/cpio/ventoy/hook/rancher/ventoy-hook.sh +++ b/IMG/cpio/ventoy/hook/rancher/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh diff --git a/IMG/cpio/ventoy/hook/rhel5/ventoy-hook.sh b/IMG/cpio/ventoy/hook/rhel5/ventoy-hook.sh index c028991d368..1c955a0f900 100644 --- a/IMG/cpio/ventoy/hook/rhel5/ventoy-hook.sh +++ b/IMG/cpio/ventoy/hook/rhel5/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ #if [ -e $VTOY_PATH/hook/rhel5/loader ]; then diff --git a/IMG/cpio/ventoy/hook/rhel5/ventoy-loader.sh b/IMG/cpio/ventoy/hook/rhel5/ventoy-loader.sh index 3582ed80eef..cabe79ee95d 100644 --- a/IMG/cpio/ventoy/hook/rhel5/ventoy-loader.sh +++ b/IMG/cpio/ventoy/hook/rhel5/ventoy-loader.sh @@ -1,46 +1,46 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh ventoy_os_install_dmsetup() { vtlog "ventoy_os_install_dmsetup $1" - + vt_usb_disk=$1 - + # dump iso file location $VTOY_PATH/tool/vtoydm -i -f $VTOY_PATH/ventoy_image_map -d ${vt_usb_disk} > $VTOY_PATH/iso_file_list - # install dmsetup + # install dmsetup LINE=$($GREP 'minstg2.img' $VTOY_PATH/iso_file_list) if [ $? -eq 0 ]; then extract_file_from_line "$LINE" ${vt_usb_disk} /tmp/minstg2.img - + mkdir -p /tmp/ramfs/minstg2.img mount -t squashfs /tmp/minstg2.img /tmp/ramfs/minstg2.img - + $BUSYBOX_PATH/ln -s /tmp/ramfs/minstg2.img/lib64 /lib64 $BUSYBOX_PATH/ln -s /tmp/ramfs/minstg2.img/usr /usr fi vtlog "dmsetup install finish, now check it..." - + dmsetup_path=$(ventoy_find_bin_path dmsetup) if [ -z "$dmsetup_path" ]; then vterr "dmsetup still not found after install" @@ -59,12 +59,12 @@ dmsetup_path=$(ventoy_find_bin_path dmsetup) if [ -z "$dmsetup_path" ]; then ventoy_os_install_dmsetup "$vtdiskname" ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2" "noreplace" - + $BUSYBOX_PATH/unlink /lib64 $BUSYBOX_PATH/unlink /usr umount /tmp/ramfs/minstg2.img rm -rf /tmp/ramfs/minstg2.img - rm -f /tmp/minstg2.img + rm -f /tmp/minstg2.img else ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2" "noreplace" fi diff --git a/IMG/cpio/ventoy/hook/rhel6/anaconda-repo-listen.sh b/IMG/cpio/ventoy/hook/rhel6/anaconda-repo-listen.sh index 5cadb79433f..05caf166179 100644 --- a/IMG/cpio/ventoy/hook/rhel6/anaconda-repo-listen.sh +++ b/IMG/cpio/ventoy/hook/rhel6/anaconda-repo-listen.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ sed -i "s/^enabled.*/enabled=0/g" $2/$3 diff --git a/IMG/cpio/ventoy/hook/rhel6/udev_disk_hook.sh b/IMG/cpio/ventoy/hook/rhel6/udev_disk_hook.sh index a1954ce5341..8d2133bb80f 100644 --- a/IMG/cpio/ventoy/hook/rhel6/udev_disk_hook.sh +++ b/IMG/cpio/ventoy/hook/rhel6/udev_disk_hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh @@ -23,23 +23,23 @@ vtCheatLoop=loop6 ventoy_os_install_dmsetup() { vtlog "ventoy_os_install_dmsetup $1" - + vt_usb_disk=$1 $BUSYBOX_PATH/modprobe dm-mod $BUSYBOX_PATH/modprobe linear - + # dump iso file location $VTOY_PATH/tool/vtoydm -i -f $VTOY_PATH/ventoy_image_map -d ${vt_usb_disk} > $VTOY_PATH/iso_file_list - # install dmsetup + # install dmsetup LINE=$($GREP 'device-mapper-[0-9].*\.rpm' $VTOY_PATH/iso_file_list) if [ $? -eq 0 ]; then install_rpm_from_line "$LINE" ${vt_usb_disk} fi vtlog "dmsetup install finish, now check it..." - + dmsetup_path=$(ventoy_find_bin_path dmsetup) if [ -z "$dmsetup_path" ]; then vterr "dmsetup still not found after install" @@ -66,13 +66,13 @@ fi #some distro add there repo file to /etc/anaconda.repos.d/ which will cause error during installation -#$BUSYBOX_PATH/nohup $VTOY_PATH/tool/inotifyd $VTOY_PATH/hook/rhel6/anaconda-repo-listen.sh /etc/anaconda.repos.d:n & +#$BUSYBOX_PATH/nohup $VTOY_PATH/tool/inotifyd $VTOY_PATH/hook/rhel6/anaconda-repo-listen.sh /etc/anaconda.repos.d:n & ventoy_udev_disk_common_hook $* "noreplace" $BUSYBOX_PATH/mount $VTOY_DM_PATH /mnt/ventoy -# +# # We do a trick for rhel6 series here. # Use /dev/$vtCheatLoop and wapper it as a removable cdrom with bind mount. # Then the anaconda installer will accept /dev/$vtCheatLoop as the install medium. diff --git a/IMG/cpio/ventoy/hook/rhel6/ventoy-hook.sh b/IMG/cpio/ventoy/hook/rhel6/ventoy-hook.sh index c3c33b6ad6e..20d54162320 100644 --- a/IMG/cpio/ventoy/hook/rhel6/ventoy-hook.sh +++ b/IMG/cpio/ventoy/hook/rhel6/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh @@ -30,11 +30,11 @@ ventoy_add_kernel_udev_rule "loop6" "$VTOY_PATH/hook/rhel6/udev_disk_hook.sh %k" if [ -f $VTOY_PATH/autoinstall ]; then $BUSYBOX_PATH/mv /sbin/loader /sbin/loader_bk $BUSYBOX_PATH/cp -a $VTOY_PATH/tool/loader /sbin/loader - + RawCmdLine=$($BUSYBOX_PATH/cat /proc/cmdline) echo -n "/sbin/loader_bk" > "/ventoy/loader_exec_file" echo -n "--cmdline=$RawCmdLine ks=file:$VTOY_PATH/autoinstall" > "/ventoy/loader_exec_cmdline" #echo 111 > "/ventoy/loader_debug" - + echo "/bin/sh /ventoy/hook/rhel6/ventoy-varexp.sh" > "/ventoy/loader_hook_cmd" fi diff --git a/IMG/cpio/ventoy/hook/rhel6/ventoy-varexp.sh b/IMG/cpio/ventoy/hook/rhel6/ventoy-varexp.sh index 99c23a2d61c..7459478b220 100644 --- a/IMG/cpio/ventoy/hook/rhel6/ventoy-varexp.sh +++ b/IMG/cpio/ventoy/hook/rhel6/ventoy-varexp.sh @@ -1,20 +1,20 @@ #!/bin/sh #************************************************************************************ # Copyright (c) 2022, longpanda -# +# # 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 . -# +# #************************************************************************************ PATH=$PATH:/ventoy/busybox:/ventoy/tool diff --git a/IMG/cpio/ventoy/hook/rhel7/ventoy-autoexp.sh b/IMG/cpio/ventoy/hook/rhel7/ventoy-autoexp.sh index 661d4365780..74cd0e82920 100644 --- a/IMG/cpio/ventoy/hook/rhel7/ventoy-autoexp.sh +++ b/IMG/cpio/ventoy/hook/rhel7/ventoy-autoexp.sh @@ -1,20 +1,20 @@ #!/bin/sh #************************************************************************************ # Copyright (c) 2022, longpanda -# +# # 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 . -# +# #************************************************************************************ if [ -f /run/install/ks.cfg ]; then diff --git a/IMG/cpio/ventoy/hook/rhel7/ventoy-hook.sh b/IMG/cpio/ventoy/hook/rhel7/ventoy-hook.sh index 613fa767d2f..53edf9c2ed0 100644 --- a/IMG/cpio/ventoy/hook/rhel7/ventoy-hook.sh +++ b/IMG/cpio/ventoy/hook/rhel7/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh @@ -30,21 +30,21 @@ else if echo $vtParam | $GREP -q 'ks=file:/'; then continue fi - + if echo $vtParam | $GREP -q 'inst.ks=hd:LABEL='; then vtRawKsFull="$vtParam" vtRawKs=$(echo $vtParam | $AWK -F: '{print $NF}') VTKS="inst.ks=hd:/dev/ventoy:$vtRawKs" break fi - + if echo $vtParam | $GREP -q '^ks=.*:/'; then vtRawKsFull="$vtParam" vtRawKs=$(echo $vtParam | $AWK -F: '{print $NF}') VTKS="ks=hd:/dev/ventoy:$vtRawKs" break fi - + if echo $vtParam | $GREP -q '^inst.ks=.*:/'; then vtRawKsFull="$vtParam" vtRawKs=$(echo $vtParam | $AWK -F: '{print $NF}') @@ -56,19 +56,19 @@ fi if [ -f $VTOY_PATH/ventoy_persistent_map ]; then VTOVERLAY="rd.live.overlay=/dev/dm-1:/vtoyoverlayfs/overlayfs" - + if [ -e /sbin/dmsquash-live-root ]; then echo "patch /sbin/dmsquash-live-root for persistent ..." >> $VTLOG - $SED "/mount.*devspec.*\/run\/initramfs\/overlayfs/a . /ventoy/hook/rhel7/ventoy-overlay.sh" -i /sbin/dmsquash-live-root + $SED "/mount.*devspec.*\/run\/initramfs\/overlayfs/a . /ventoy/hook/rhel7/ventoy-overlay.sh" -i /sbin/dmsquash-live-root $SED "s/osmin.img/osmin.imgxxxx/g" -i /sbin/dmsquash-live-root fi - + #close selinux $BUSYBOX_PATH/mkdir -p $VTOY_PATH/selinuxfs if $BUSYBOX_PATH/mount -t selinuxfs selinuxfs $VTOY_PATH/selinuxfs; then echo 1 > $VTOY_PATH/selinuxfs/disable $BUSYBOX_PATH/umount $VTOY_PATH/selinuxfs - fi + fi $BUSYBOX_PATH/rm -rf $VTOY_PATH/selinuxfs fi @@ -81,7 +81,7 @@ if [ -n "$vtRawKs" ]; then VTKS="" else echo "$vtRawKs" > $VTOY_PATH/ventoy_ks_rootpath - fi + fi fi if ls $VTOY_PATH | $GREP -q 'ventoy_dud[0-9]'; then @@ -128,19 +128,19 @@ if $GREP -q Fedora /etc/os-release; then if /ventoy/tool/vtoydump -a /ventoy/ventoy_os_param; then if ventoy_iso_scan_check; then echo "iso_scan process ..." >> $VTLOG - + vtIsoPath=$(/ventoy/tool/vtoydump -p /ventoy/ventoy_os_param) - VTISO_SCAN="iso-scan/filename=$vtIsoPath" + VTISO_SCAN="iso-scan/filename=$vtIsoPath" echo -n $vtIsoPath > /ventoy/vtoy_iso_scan - $SED "s#printf\(.*\)\$CMDLINE#printf\1\$CMDLINE $VTISO_SCAN $VTKS $VTOVERLAY $vtInstDD#" -i /lib/dracut-lib.sh + $SED "s#printf\(.*\)\$CMDLINE#printf\1\$CMDLINE $VTISO_SCAN $VTKS $VTOVERLAY $vtInstDD#" -i /lib/dracut-lib.sh if [ "$VTOY_LINUX_REMOUNT" = "01" -a "$vtNeedRepo" != "yes" ]; then ventoy_rw_iso_scan fi exit 0 fi -fi +fi fi diff --git a/IMG/cpio/ventoy/hook/rhel7/ventoy-inotifyd-call.sh b/IMG/cpio/ventoy/hook/rhel7/ventoy-inotifyd-call.sh index f1a909a50fc..2f192c76754 100644 --- a/IMG/cpio/ventoy/hook/rhel7/ventoy-inotifyd-call.sh +++ b/IMG/cpio/ventoy/hook/rhel7/ventoy-inotifyd-call.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2023, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh @@ -23,4 +23,4 @@ vtHook=$($CAT $VTOY_PATH/inotifyd-hook-script.txt) vtdisk=$(get_ventoy_disk_name) vtlog "... $vtdisk already exist ..." -$BUSYBOX_PATH/sh $vtHook n /dev "${vtdisk#/dev/}2" +$BUSYBOX_PATH/sh $vtHook n /dev "${vtdisk#/dev/}2" diff --git a/IMG/cpio/ventoy/hook/rhel7/ventoy-inotifyd-hook.sh b/IMG/cpio/ventoy/hook/rhel7/ventoy-inotifyd-hook.sh index 0ab59475e09..878d7891a99 100644 --- a/IMG/cpio/ventoy/hook/rhel7/ventoy-inotifyd-hook.sh +++ b/IMG/cpio/ventoy/hook/rhel7/ventoy-inotifyd-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh @@ -29,17 +29,17 @@ if is_inotify_ventoy_part $3; then vtlog "##### INOTIFYD: $2/$3 is created (YES) ..." - + vtlog "find ventoy partition ..." - + vtReplaceOpt=noreplace if [ -f /lib/dracut/hooks/pre-pivot/99-ventoy-repo.sh ]; then vtReplaceOpt="" fi - + $BUSYBOX_PATH/sh $VTOY_PATH/hook/default/udev_disk_hook.sh $3 $vtReplaceOpt - + blkdev_num_mknod=$($VTOY_PATH/tool/dmsetup ls | $GREP ventoy | sed 's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1 \2/') $BUSYBOX_PATH/mknod -m 660 /dev/ventoy b $blkdev_num_mknod $BUSYBOX_PATH/modprobe isofs >/dev/null 2>&1 @@ -49,7 +49,7 @@ if is_inotify_ventoy_part $3; then if [ -e $vtGenRulFile ] && $GREP -q dmsquash $vtGenRulFile; then vtScript=$($GREP -m1 'RUN.=' $vtGenRulFile | $AWK -F'RUN.=' '{print $2}' | $SED 's/"\(.*\)".*/\1/') vtlog "vtScript=$vtScript" - + if [ -f $VTOY_PATH/distmagic/SCRE ]; then /sbin/dmsquash-live-root /dev/ventoy elif [ -f $VTOY_PATH/distmagic/DELL_PER ]; then @@ -62,24 +62,24 @@ if is_inotify_ventoy_part $3; then else vtlog "$vtGenRulFile not exist..." fi - + if [ -f $VTOY_PATH/ventoy_ks_rootpath ]; then vt_ks_rootpath=$(cat $VTOY_PATH/ventoy_ks_rootpath) vtlog "ks rootpath <$vt_ks_rootpath>" if [ -e /sbin/fetch-kickstart-disk ]; then - vtlog "fetch-kickstart-disk ..." + vtlog "fetch-kickstart-disk ..." /sbin/fetch-kickstart-disk /dev/ventoy "$vt_ks_rootpath" fi fi - + if [ -e /sbin/anaconda-diskroot ]; then - vtlog "set anaconda-diskroot ..." + vtlog "set anaconda-diskroot ..." #busybox cp doesn't support -t option (issue 1900) /bin/cp -a /bin/cp $BUSYBOX_PATH/cp /sbin/anaconda-diskroot /dev/ventoy fi - + set_ventoy_hook_finish else vtlog "##### INOTIFYD: $2/$3 is created (NO) ..." diff --git a/IMG/cpio/ventoy/hook/rhel7/ventoy-inotifyd-start.sh b/IMG/cpio/ventoy/hook/rhel7/ventoy-inotifyd-start.sh index 21920c45603..638bcb24e92 100644 --- a/IMG/cpio/ventoy/hook/rhel7/ventoy-inotifyd-start.sh +++ b/IMG/cpio/ventoy/hook/rhel7/ventoy-inotifyd-start.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh @@ -24,11 +24,11 @@ vtHook=$($CAT $VTOY_PATH/inotifyd-hook-script.txt) vtdisk=$(get_ventoy_disk_name) if [ "$vtdisk" = "unknown" ]; then vtlog "... start inotifyd listen $vtHook ..." - $BUSYBOX_PATH/nohup $VTOY_PATH/tool/inotifyd $vtHook /dev:n 2>&- & + $BUSYBOX_PATH/nohup $VTOY_PATH/tool/inotifyd $vtHook /dev:n 2>&- & else vtlog "... $vtdisk already exist ..." - + #don't call it too early issue 2225 #$BUSYBOX_PATH/sh $vtHook n /dev "${vtdisk#/dev/}2" - cp -a $VTOY_PATH/hook/rhel7/ventoy-inotifyd-call.sh /lib/dracut/hooks/initqueue/settled/90-ventoy-inotifyd-call.sh + cp -a $VTOY_PATH/hook/rhel7/ventoy-inotifyd-call.sh /lib/dracut/hooks/initqueue/settled/90-ventoy-inotifyd-call.sh fi diff --git a/IMG/cpio/ventoy/hook/rhel7/ventoy-make-link.sh b/IMG/cpio/ventoy/hook/rhel7/ventoy-make-link.sh index 100815a87df..9bd3830a8b7 100644 --- a/IMG/cpio/ventoy/hook/rhel7/ventoy-make-link.sh +++ b/IMG/cpio/ventoy/hook/rhel7/ventoy-make-link.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh @@ -23,7 +23,7 @@ if [ ! -e /dev/dm-0 ]; then exit 0 fi -blkdev_num=$($VTOY_PATH/tool/dmsetup ls | grep ventoy | sed 's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1:\2/') +blkdev_num=$($VTOY_PATH/tool/dmsetup ls | grep ventoy | sed 's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1:\2/') vtDM=$(ventoy_find_dm_id ${blkdev_num}) if [ -e /dev/mapper/ventoy ]; then diff --git a/IMG/cpio/ventoy/hook/rhel7/ventoy-overlay.sh b/IMG/cpio/ventoy/hook/rhel7/ventoy-overlay.sh index d8fe0799501..7962935d6d8 100644 --- a/IMG/cpio/ventoy/hook/rhel7/ventoy-overlay.sh +++ b/IMG/cpio/ventoy/hook/rhel7/ventoy-overlay.sh @@ -1,20 +1,20 @@ #!/bin/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ [ -d /run/initramfs/overlayfs$pathspec ] || mkdir -p /run/initramfs/overlayfs$pathspec diff --git a/IMG/cpio/ventoy/hook/rhel7/ventoy-repo.sh b/IMG/cpio/ventoy/hook/rhel7/ventoy-repo.sh index 002aa5e7949..d15fd8e9565 100644 --- a/IMG/cpio/ventoy/hook/rhel7/ventoy-repo.sh +++ b/IMG/cpio/ventoy/hook/rhel7/ventoy-repo.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/hook/rhel7/ventoy-timeout.sh b/IMG/cpio/ventoy/hook/rhel7/ventoy-timeout.sh index cfd339f7eff..f4f0df5b97d 100644 --- a/IMG/cpio/ventoy/hook/rhel7/ventoy-timeout.sh +++ b/IMG/cpio/ventoy/hook/rhel7/ventoy-timeout.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh @@ -32,7 +32,7 @@ if [ -f $VTOY_PATH/ventoy_ks_rootpath ]; then vt_ks_rootpath=$(cat $VTOY_PATH/ventoy_ks_rootpath) vtlog "ks rootpath <$vt_ks_rootpath>" if [ -e /sbin/fetch-kickstart-disk ]; then - vtlog "fetch-kickstart-disk ..." + vtlog "fetch-kickstart-disk ..." /sbin/fetch-kickstart-disk /dev/ventoy "$vt_ks_rootpath" fi fi diff --git a/IMG/cpio/ventoy/hook/slackware/disk_hook.sh b/IMG/cpio/ventoy/hook/slackware/disk_hook.sh index 03bc90a8aed..26e6db1565b 100644 --- a/IMG/cpio/ventoy/hook/slackware/disk_hook.sh +++ b/IMG/cpio/ventoy/hook/slackware/disk_hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/hook/slackware/udev_disk_hook.sh b/IMG/cpio/ventoy/hook/slackware/udev_disk_hook.sh index 9b064832f44..69ad7202eb1 100644 --- a/IMG/cpio/ventoy/hook/slackware/udev_disk_hook.sh +++ b/IMG/cpio/ventoy/hook/slackware/udev_disk_hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/hook/smgl/disk_hook.sh b/IMG/cpio/ventoy/hook/smgl/disk_hook.sh index bc135d324a9..0130614eb97 100644 --- a/IMG/cpio/ventoy/hook/smgl/disk_hook.sh +++ b/IMG/cpio/ventoy/hook/smgl/disk_hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/hook/smgl/ventoy-hook.sh b/IMG/cpio/ventoy/hook/smgl/ventoy-hook.sh index 9eb20d59f27..4cf744969be 100644 --- a/IMG/cpio/ventoy/hook/smgl/ventoy-hook.sh +++ b/IMG/cpio/ventoy/hook/smgl/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh diff --git a/IMG/cpio/ventoy/hook/smoothwall/cd_list.sh b/IMG/cpio/ventoy/hook/smoothwall/cd_list.sh index 5e7cbab3e99..c183843f733 100644 --- a/IMG/cpio/ventoy/hook/smoothwall/cd_list.sh +++ b/IMG/cpio/ventoy/hook/smoothwall/cd_list.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/hook/smoothwall/disk_hook.sh b/IMG/cpio/ventoy/hook/smoothwall/disk_hook.sh index 94827cde91c..f8159ed3c04 100644 --- a/IMG/cpio/ventoy/hook/smoothwall/disk_hook.sh +++ b/IMG/cpio/ventoy/hook/smoothwall/disk_hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/hook/smoothwall/ventoy-hook.sh b/IMG/cpio/ventoy/hook/smoothwall/ventoy-hook.sh index c2dd611600a..74314975691 100644 --- a/IMG/cpio/ventoy/hook/smoothwall/ventoy-hook.sh +++ b/IMG/cpio/ventoy/hook/smoothwall/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh diff --git a/IMG/cpio/ventoy/hook/suse/disk_hook.sh b/IMG/cpio/ventoy/hook/suse/disk_hook.sh index d5b07b3a581..9ce6e956817 100644 --- a/IMG/cpio/ventoy/hook/suse/disk_hook.sh +++ b/IMG/cpio/ventoy/hook/suse/disk_hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh @@ -31,7 +31,7 @@ ventoy_os_install_dmsetup_by_fuse() { vtoy_fuse_iso -f $VTOY_PATH/ventoy_dm_table -m $VTOY_PATH/mnt/fuse mount -t iso9660 $VTOY_PATH/mnt/fuse/ventoy.iso $VTOY_PATH/mnt/iso - + [ -f $VTOY_PATH/mnt/iso/system/squashfs_sys.img ] && mount -t squashfs $VTOY_PATH/mnt/iso/system/squashfs_sys.img $VTOY_PATH/mnt/squashfs [ -f $VTOY_PATH/mnt/iso/system/squashfs.img ] && mount -t squashfs $VTOY_PATH/mnt/iso/system/squashfs.img $VTOY_PATH/mnt/squashfs diff --git a/IMG/cpio/ventoy/hook/suse/udev_disk_hook.sh b/IMG/cpio/ventoy/hook/suse/udev_disk_hook.sh index d5e8170df85..6ef52a61906 100644 --- a/IMG/cpio/ventoy/hook/suse/udev_disk_hook.sh +++ b/IMG/cpio/ventoy/hook/suse/udev_disk_hook.sh @@ -1,40 +1,40 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh ventoy_os_install_dmsetup() { vtlog "ventoy_os_install_dmsetup $1" - + vt_usb_disk=$1 # dump iso file location $VTOY_PATH/tool/vtoydm -i -f $VTOY_PATH/ventoy_image_map -d ${vt_usb_disk} > $VTOY_PATH/iso_file_list - # install dmsetup + # install dmsetup LINE=$($GREP 'device-mapper-[0-9]\..*\.rpm' $VTOY_PATH/iso_file_list) if [ $? -eq 0 ]; then install_rpm_from_line "$LINE" ${vt_usb_disk} fi vtlog "dmsetup install finish, now check it..." - + dmsetup_path=$(ventoy_find_bin_path dmsetup) if [ -z "$dmsetup_path" ]; then vterr "dmsetup still not found after install" diff --git a/IMG/cpio/ventoy/hook/suse/udev_setup_hook.sh b/IMG/cpio/ventoy/hook/suse/udev_setup_hook.sh index d222f6689f8..a77e2e478a2 100644 --- a/IMG/cpio/ventoy/hook/suse/udev_setup_hook.sh +++ b/IMG/cpio/ventoy/hook/suse/udev_setup_hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh @@ -37,7 +37,7 @@ fi /ventoy/busybox/sh /ventoy/hook/suse/udev_disk_hook.sh "${vtpart2#/dev/}" -if $GREP -q 'mediacheck=1' /proc/cmdline; then +if $GREP -q 'mediacheck=1' /proc/cmdline; then ventoy_copy_device_mapper "${vtdiskname}" fi diff --git a/IMG/cpio/ventoy/hook/suse/ventoy-hook.sh b/IMG/cpio/ventoy/hook/suse/ventoy-hook.sh index cc90cc5e566..8a1af181167 100644 --- a/IMG/cpio/ventoy/hook/suse/ventoy-hook.sh +++ b/IMG/cpio/ventoy/hook/suse/ventoy-hook.sh @@ -1,32 +1,32 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh -if [ -f $VTOY_PATH/autoinstall ]; then +if [ -f $VTOY_PATH/autoinstall ]; then if [ -f /linuxrc.config ]; then echo "AutoYaST: file:///ventoy/autoinstall" >> /info-ventoy $SED "1 iinfo: file:/info-ventoy" -i /linuxrc.config fi fi -if $GREP -q 'rdinit=/vtoy/vtoy' /proc/cmdline; then +if $GREP -q 'rdinit=/vtoy/vtoy' /proc/cmdline; then echo "remove rdinit param" >> $VTLOG echo "ptoptions=+rdinit" >> /linuxrc.config fi @@ -37,11 +37,11 @@ if $BUSYBOX_PATH/ls $VTOY_PATH | $GREP -q 'ventoy_dud[0-9]'; then vtKerVer=$($BUSYBOX_PATH/uname -r) ventoy_check_insmod /modules/loop.ko ventoy_check_insmod /modules/squashfs.ko - + ventoy_check_mount /parts/00_lib /modules ventoy_check_insmod /modules/lib/modules/$vtKerVer/initrd/isofs.ko $BUSYBOX_PATH/umount /modules - + for vtDud in $($BUSYBOX_PATH/ls $VTOY_PATH/ventoy_dud*); do $BUSYBOX_PATH/mkdir -p ${vtDud%.*}_mnt if $BUSYBOX_PATH/mount $vtDud ${vtDud%.*}_mnt > /dev/null 2>&1; then @@ -52,7 +52,7 @@ if $BUSYBOX_PATH/ls $VTOY_PATH | $GREP -q 'ventoy_dud[0-9]'; then echo "mount $vtDud failed" >> $VTLOG fi done - + $BUSYBOX_PATH/rmmod isofs >> $VTLOG 2>&1 $BUSYBOX_PATH/rmmod squashfs >> $VTLOG 2>&1 $BUSYBOX_PATH/rmmod loop >> $VTLOG 2>&1 @@ -64,14 +64,14 @@ fi #$SED "1 iinfo: file:/info-ventoy" -i /linuxrc.config if [ -e /etc/initrd.functions ] && $GREP -q 'HPIP' /etc/initrd.functions; then - echo "HPIP" >> $VTLOG + echo "HPIP" >> $VTLOG $BUSYBOX_PATH/mkdir /dev $BUSYBOX_PATH/mknod -m 660 /dev/console c 5 1 $SED "/CD_DEVICES=/a $BUSYBOX_PATH/sh $VTOY_PATH/hook/suse/disk_hook.sh" -i /etc/initrd.functions $SED "/CD_DEVICES=/a CD_DEVICES=\"/dev/ventoy \$CD_DEVICES\"" -i /etc/initrd.functions elif [ -f /scripts/udev_setup ]; then echo "udev_setup" >> $VTLOG - echo "/ventoy/busybox/sh /ventoy/hook/suse/udev_setup_hook.sh" >> /scripts/udev_setup + echo "/ventoy/busybox/sh /ventoy/hook/suse/udev_setup_hook.sh" >> /scripts/udev_setup else echo "SUSE" >> $VTLOG ventoy_systemd_udevd_work_around diff --git a/IMG/cpio/ventoy/hook/t2/disk_hook.sh b/IMG/cpio/ventoy/hook/t2/disk_hook.sh index d3b79a43674..fffa2583bdf 100644 --- a/IMG/cpio/ventoy/hook/t2/disk_hook.sh +++ b/IMG/cpio/ventoy/hook/t2/disk_hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/hook/t2/ventoy-hook.sh b/IMG/cpio/ventoy/hook/t2/ventoy-hook.sh index 2329265c46a..d2bb7eeabaf 100644 --- a/IMG/cpio/ventoy/hook/t2/ventoy-hook.sh +++ b/IMG/cpio/ventoy/hook/t2/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh diff --git a/IMG/cpio/ventoy/hook/tinycore/ventoy-disk.sh b/IMG/cpio/ventoy/hook/tinycore/ventoy-disk.sh index 86dce825a84..11c869eed65 100644 --- a/IMG/cpio/ventoy/hook/tinycore/ventoy-disk.sh +++ b/IMG/cpio/ventoy/hook/tinycore/ventoy-disk.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh @@ -37,7 +37,7 @@ if [ "$vtdiskname" = "unknown" ]; then fi if echo $vtdiskname | egrep -q "nvme.*p[0-9]$|mmc.*p[0-9]$|nbd.*p[0-9]$"; then - vPart="${vtdiskname}p2" + vPart="${vtdiskname}p2" else vPart="${vtdiskname}2" fi @@ -45,23 +45,23 @@ fi # TinyCore linux distro doesn't contain dmsetup, we use aoe here sudo modprobe aoe aoe_iflist=lo if [ -e /sys/module/aoe ]; then - + if ! [ -d /lib64 ]; then vtlog "link lib64" NEED_UNLIB64=1 ln -s /lib /lib64 fi - + VBLADE_BIN=$(ventoy_get_vblade_bin) - sudo nohup $VBLADE_BIN -r -f $VTOY_PATH/ventoy_image_map 9 0 lo "$vtdiskname" > /dev/null & + sudo nohup $VBLADE_BIN -r -f $VTOY_PATH/ventoy_image_map 9 0 lo "$vtdiskname" > /dev/null & sleep 2 while ! [ -b /dev/etherd/e9.0 ]; do vtlog 'Wait for /dev/etherd/e9.0 ....' sleep 2 done - + sudo cp -a /dev/etherd/e9.0 "$vPart" if [ -n "$NEED_UNLIB64" ]; then diff --git a/IMG/cpio/ventoy/hook/tinycore/ventoy-hook.sh b/IMG/cpio/ventoy/hook/tinycore/ventoy-hook.sh index 2bd18b3e026..f1d75ea05cd 100644 --- a/IMG/cpio/ventoy/hook/tinycore/ventoy-hook.sh +++ b/IMG/cpio/ventoy/hook/tinycore/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh diff --git a/IMG/cpio/ventoy/hook/ventoy-hook-lib.sh b/IMG/cpio/ventoy/hook/ventoy-hook-lib.sh index 11b1e57bee2..e1632282bb3 100644 --- a/IMG/cpio/ventoy/hook/ventoy-hook-lib.sh +++ b/IMG/cpio/ventoy/hook/ventoy-hook-lib.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ VTOY_PATH=/ventoy @@ -73,7 +73,7 @@ get_ventoy_disk_name() { line=$($VTOY_PATH/tool/vtoydump -f /ventoy/ventoy_os_param) if [ $? -eq 0 ]; then echo ${line%%#*} - else + else echo "unknown" fi fi @@ -83,7 +83,7 @@ get_ventoy_iso_name() { line=$($VTOY_PATH/tool/vtoydump -f /ventoy/ventoy_os_param) if [ $? -eq 0 ]; then echo ${line##*#} - else + else echo "unknown" fi } @@ -93,13 +93,13 @@ wait_for_usb_disk_ready() { while [ -n "Y" ]; do usb_disk=$(get_ventoy_disk_name) vtlog "wait_for_usb_disk_ready $usb_disk ..." - + if echo $usb_disk | $EGREP -q "nvme|mmc|nbd"; then vtpart2=${usb_disk}p2 else vtpart2=${usb_disk}2 fi - + if [ -e "${vtpart2}" ]; then vtlog "wait_for_usb_disk_ready $usb_disk finish" break @@ -122,7 +122,7 @@ check_usb_disk_ready() { else vtpart2=${1}2 fi - + [ -e "${vtpart2}" ] } @@ -157,28 +157,28 @@ ventoy_find_bin_path() { if $BUSYBOX_PATH/which "$1" > /dev/null; then $BUSYBOX_PATH/which "$1"; return fi - + for vt_path in '/bin' '/sbin' '/usr/bin' '/usr/sbin' '/usr/local/bin' '/usr/local/sbin' '/root/bin'; do if [ -e "$vt_path/$1" ]; then echo "$vt_path/$1"; return fi done - + echo "" } -ventoy_find_bin_run() { +ventoy_find_bin_run() { vtsudo=0 if [ "$1" = "sudo" ]; then shift vtsudo=1 fi - + vtbinpath=$(ventoy_find_bin_path "$1") if [ -n "$vtbinpath" ]; then shift - + if [ $vtsudo -eq 0 ]; then vtlog "$vtbinpath $*" $vtbinpath $* @@ -200,14 +200,14 @@ ventoy_check_dm_module() { if $GREP -q 'device-mapper' /proc/devices; then $BUSYBOX_PATH/true; return fi - + vtlog "device-mapper NOT found in /proc/devices, try to load kernel module" $BUSYBOX_PATH/modprobe dm_mod >>$VTLOG 2>&1 $BUSYBOX_PATH/modprobe dm-mod >>$VTLOG 2>&1 - + if ! $GREP -q 'device-mapper' /proc/devices; then vtlog "modprobe failed, now try to insmod ko..." - + $FIND /lib/modules/ -name "dm-mod.ko*" | while read vtline; do vtlog "insmod $vtline " $BUSYBOX_PATH/insmod $vtline >>$VTLOG 2>&1 @@ -235,13 +235,13 @@ ventoy_check_dm_module() { create_ventoy_device_mapper() { vtlog "create_ventoy_device_mapper $*" - + VT_DM_BIN=$(ventoy_find_bin_path dmsetup) if [ -z "$VT_DM_BIN" ]; then vtlog "no dmsetup avaliable, lastly try inbox dmsetup" VT_DM_BIN=$VTOY_PATH/tool/dmsetup fi - + vtlog "dmsetup avaliable in system $VT_DM_BIN" if ventoy_check_dm_module "$1"; then @@ -249,51 +249,51 @@ create_ventoy_device_mapper() { else vterr "Error: no dm module avaliable" fi - + $VTOY_PATH/tool/vtoydm -p -f $VTOY_PATH/ventoy_image_map -d $1 > $VTOY_PATH/ventoy_dm_table - $VTOY_PATH/tool/vtoydm -r -f $VTOY_PATH/ventoy_image_map -d $1 > $VTOY_PATH/ventoy_raw_table + $VTOY_PATH/tool/vtoydm -r -f $VTOY_PATH/ventoy_image_map -d $1 > $VTOY_PATH/ventoy_raw_table if [ -z "$2" ]; then $VT_DM_BIN create ventoy $VTOY_PATH/ventoy_dm_table >>$VTLOG 2>&1 else $VT_DM_BIN "$2" create ventoy $VTOY_PATH/ventoy_dm_table >>$VTLOG 2>&1 fi - + RAWDISKNAME=$($HEAD -n1 $VTOY_PATH/ventoy_raw_table | $AWK '{print $4}') $VT_DM_BIN create ${RAWDISKNAME#/dev/} $VTOY_PATH/ventoy_raw_table >>$VTLOG 2>&1 } create_persistent_device_mapper() { vtlog "create_persistent_device_mapper $*" - + VT_DM_BIN=$(ventoy_find_bin_path dmsetup) if [ -z "$VT_DM_BIN" ]; then vtlog "no dmsetup avaliable, lastly try inbox dmsetup" VT_DM_BIN=$VTOY_PATH/tool/dmsetup fi - + vtlog "dmsetup avaliable in system $VT_DM_BIN" - + if ventoy_check_dm_module "$1"; then vtlog "device-mapper module check success" else vterr "Error: no dm module avaliable" fi - - $VTOY_PATH/tool/vtoydm -p -f $VTOY_PATH/ventoy_persistent_map -d $1 > $VTOY_PATH/persistent_dm_table - $VT_DM_BIN create vtoy_persistent $VTOY_PATH/persistent_dm_table >>$VTLOG 2>&1 + + $VTOY_PATH/tool/vtoydm -p -f $VTOY_PATH/ventoy_persistent_map -d $1 > $VTOY_PATH/persistent_dm_table + $VT_DM_BIN create vtoy_persistent $VTOY_PATH/persistent_dm_table >>$VTLOG 2>&1 } wait_for_ventoy_dm_disk_label() { - DM=$($BUSYBOX_PATH/readlink $VTOY_DM_PATH) + DM=$($BUSYBOX_PATH/readlink $VTOY_DM_PATH) vtlog "wait_for_ventoy_dm_disk_label $DM ..." - + for i in 0 1 2 3 4 5 6 7 8 9; do vtlog "i=$i ####### ls /dev/disk/by-label/" ls -l /dev/disk/by-label/ >> $VTLOG - + if ls -l /dev/disk/by-label/ | $GREP -q "$DM"; then break else @@ -307,19 +307,19 @@ install_udeb_pkg() { $BUSYBOX_PATH/false return fi - + if [ -d /tmp/vtoy_udeb ]; then $BUSYBOX_PATH/rm -rf /tmp/vtoy_udeb fi - + $BUSYBOX_PATH/mkdir -p /tmp/vtoy_udeb $BUSYBOX_PATH/cp -a "$1" /tmp/vtoy_udeb/ - + CURDIR=$($BUSYBOX_PATH/pwd) cd /tmp/vtoy_udeb - + $BUSYBOX_PATH/ar x "$1" - + if [ -e 'data.tar.gz' ]; then $BUSYBOX_PATH/tar -xzf data.tar.gz -C / elif [ -e 'data.tar.xz' ]; then @@ -329,7 +329,7 @@ install_udeb_pkg() { elif [ -e 'data.tar.lzma' ]; then $BUSYBOX_PATH/tar -xaf data.tar.lzma -C / fi - + if [ -e 'control.tar.gz' ]; then $BUSYBOX_PATH/tar -xzf control.tar.gz -C / elif [ -e 'control.tar.xz' ]; then @@ -339,7 +339,7 @@ install_udeb_pkg() { elif [ -e 'control.tar.lzma' ]; then $BUSYBOX_PATH/tar -xaf control.tar.lzma -C / fi - + cd $CURDIR $BUSYBOX_PATH/rm -rf /tmp/vtoy_udeb $BUSYBOX_PATH/true @@ -351,13 +351,13 @@ install_udeb_from_line() { if ! [ -b "$2" ]; then vterr "disk #$2# not exist" - return + return fi sector=$(echo $1 | $AWK '{print $(NF-1)}') length=$(echo $1 | $AWK '{print $NF}') vtlog "sector=$sector length=$length" - + $VTOY_PATH/tool/vtoydm -e -f $VTOY_PATH/ventoy_image_map -d ${2} -s $sector -l $length -o /tmp/xxx.udeb if [ -e /tmp/xxx.udeb ]; then vtlog "extract udeb file from iso success" @@ -365,7 +365,7 @@ install_udeb_from_line() { vterr "extract udeb file from iso fail" return fi - + install_udeb_pkg /tmp/xxx.udeb $BUSYBOX_PATH/rm -f /tmp/xxx.udeb } @@ -374,13 +374,13 @@ extract_file_from_line() { vtlog "extract_file_from_line $1 disk=#$2#" if ! [ -b "$2" ]; then vterr "disk #$2# not exist" - return + return fi sector=$(echo $1 | $AWK '{print $(NF-1)}') length=$(echo $1 | $AWK '{print $NF}') vtlog "sector=$sector length=$length" - + $VTOY_PATH/tool/vtoydm -e -f $VTOY_PATH/ventoy_image_map -d ${2} -s $sector -l $length -o $3 if [ -e $3 ]; then vtlog "extract file from iso success" @@ -396,13 +396,13 @@ extract_rpm_from_line() { if ! [ -b "$2" ]; then vterr "disk #$2# not exist" - return + return fi sector=$(echo $1 | $AWK '{print $(NF-1)}') length=$(echo $1 | $AWK '{print $NF}') vtlog "sector=$sector length=$length" - + $VTOY_PATH/tool/vtoydm -e -f $VTOY_PATH/ventoy_image_map -d ${2} -s $sector -l $length -o /tmp/xxx.rpm if [ -e /tmp/xxx.rpm ]; then vtlog "extract rpm file from iso success" @@ -410,16 +410,16 @@ extract_rpm_from_line() { vterr "extract rpm file from iso fail" return fi - + CURPWD=$($BUSYBOX_PATH/pwd) - + $BUSYBOX_PATH/mkdir -p $VTOY_PATH/rpm cd $VTOY_PATH/rpm vtlog "extract rpm..." $BUSYBOX_PATH/rpm2cpio /tmp/xxx.rpm | $BUSYBOX_PATH/cpio -idm 2>>$VTLOG cd $CURPWD - - $BUSYBOX_PATH/rm -f /tmp/xxx.rpm + + $BUSYBOX_PATH/rm -f /tmp/xxx.rpm } install_rpm_from_line() { @@ -427,13 +427,13 @@ install_rpm_from_line() { if ! [ -b "$2" ]; then vterr "disk #$2# not exist" - return + return fi sector=$(echo $1 | $AWK '{print $(NF-1)}') length=$(echo $1 | $AWK '{print $NF}') vtlog "sector=$sector length=$length" - + $VTOY_PATH/tool/vtoydm -e -f $VTOY_PATH/ventoy_image_map -d ${2} -s $sector -l $length -o /tmp/xxx.rpm if [ -e /tmp/xxx.rpm ]; then vtlog "extract rpm file from iso success" @@ -441,14 +441,14 @@ install_rpm_from_line() { vterr "extract rpm file from iso fail" return fi - + CURPWD=$($BUSYBOX_PATH/pwd) - + cd / vtlog "install rpm..." $BUSYBOX_PATH/rpm2cpio /tmp/xxx.rpm | $BUSYBOX_PATH/cpio -idm 2>>$VTLOG cd $CURPWD - + $BUSYBOX_PATH/rm -f /tmp/xxx.rpm } @@ -457,8 +457,8 @@ dump_whole_iso_file() { vtlog "dmtable line: $vtline" vtcount=$(echo $vtline | $AWK '{print $2}') vtoffset=$(echo $vtline | $AWK '{print $NF}') - $BUSYBOX_PATH/dd if=$usb_disk of="$1" bs=512 count=$vtcount skip=$vtoffset oflag=append conv=notrunc - done + $BUSYBOX_PATH/dd if=$usb_disk of="$1" bs=512 count=$vtcount skip=$vtoffset oflag=append conv=notrunc + done } ventoy_copy_device_mapper() { @@ -469,27 +469,27 @@ ventoy_copy_device_mapper() { $BUSYBOX_PATH/cp -a "/dev/mapper/$VT_MAPPER_LINK" "$1" elif [ -b $VTOY_DM_PATH ]; then vtlog "replace block device $1..." - $BUSYBOX_PATH/mv "$1" $VTOY_PATH/dev_backup_${1#/dev/} + $BUSYBOX_PATH/mv "$1" $VTOY_PATH/dev_backup_${1#/dev/} $BUSYBOX_PATH/cp -a "$VTOY_DM_PATH" "$1" else - + vtlog "$VTOY_DM_PATH not exist, now check /dev/dm-X ..." VT_DM_BIN=$(ventoy_find_bin_path dmsetup) if [ -z "$VT_DM_BIN" ]; then vtlog "no dmsetup avaliable, lastly try inbox dmsetup" VT_DM_BIN=$VTOY_PATH/tool/dmsetup fi - + DM_VT_ID=$($VT_DM_BIN ls | $GREP ventoy | $SED 's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1 \2/') vtlog "DM_VT_ID=$DM_VT_ID ..." - $BUSYBOX_PATH/mv "$1" $VTOY_PATH/dev_backup_${1#/dev/} + $BUSYBOX_PATH/mv "$1" $VTOY_PATH/dev_backup_${1#/dev/} $BUSYBOX_PATH/mknod -m 0666 "$1" b $DM_VT_ID - fi + fi } # create link for device-mapper ventoy_create_persistent_link() { - blkdev_num=$($VTOY_PATH/tool/dmsetup ls | grep vtoy_persistent | sed 's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1:\2/') + blkdev_num=$($VTOY_PATH/tool/dmsetup ls | grep vtoy_persistent | sed 's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1:\2/') vtDM=$(ventoy_find_dm_id ${blkdev_num}) if ! [ -d /dev/disk/by-label ]; then @@ -508,12 +508,12 @@ ventoy_create_persistent_link() { cd /dev/disk/by-label ln -s ../../$vtDM $VTLABEL cd $vtOldDir - fi + fi } ventoy_partname_to_diskname() { if echo $1 | $EGREP -q "nvme.*p[0-9]$|mmc.*p[0-9]$|nbd.*p[0-9]$"; then - echo -n "${1:0:-2}" + echo -n "${1:0:-2}" else echo -n "${1:0:-1}" fi @@ -527,27 +527,27 @@ ventoy_diskname_to_partname() { fi } -ventoy_udev_disk_common_hook() { +ventoy_udev_disk_common_hook() { if echo $1 | $EGREP -q "nvme.*p[0-9]$|mmc.*p[0-9]$|nbd.*p[0-9]$"; then - VTDISK="${1:0:-2}" + VTDISK="${1:0:-2}" else VTDISK="${1:0:-1}" fi - + if [ -e /vtoy/vtoy ]; then VTRWMOD="" else VTRWMOD="--readonly" fi - + # create device mapper for iso image file if create_ventoy_device_mapper "/dev/$VTDISK" $VTRWMOD; then vtlog "==== create ventoy device mapper success ====" else vtlog "==== create ventoy device mapper failed ====" - + $SLEEP 3 - + if $GREP -q "/dev/$VTDISK" /proc/mounts; then $GREP "/dev/$VTDISK" /proc/mounts | while read vtLine; do vtPart=$(echo $vtLine | $AWK '{print $1}') @@ -556,7 +556,7 @@ ventoy_udev_disk_common_hook() { $BUSYBOX_PATH/umount $vtMnt done fi - + if create_ventoy_device_mapper "/dev/$VTDISK" $VTRWMOD; then vtlog "==== create ventoy device mapper success after retry ====" else @@ -564,45 +564,45 @@ ventoy_udev_disk_common_hook() { return fi fi - + if [ "$2" = "noreplace" ]; then vtlog "no need to replace block device" else ventoy_copy_device_mapper "/dev/$1" fi - + if [ -f $VTOY_PATH/ventoy_persistent_map ]; then create_persistent_device_mapper "/dev/$VTDISK" ventoy_create_persistent_link - fi + fi } -ventoy_create_dev_ventoy_part() { +ventoy_create_dev_ventoy_part() { blkdev_num=$($VTOY_PATH/tool/dmsetup ls | $GREP ventoy | $SED 's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1 \2/') $BUSYBOX_PATH/mknod -m 0666 /dev/ventoy b $blkdev_num - + if [ -e /vtoy_dm_table ]; then - vtPartid=1 + vtPartid=1 $CAT /vtoy_dm_table | while read vtline; do echo $vtline > /ventoy/dm_table_part${vtPartid} $VTOY_PATH/tool/dmsetup create ventoy${vtPartid} /ventoy/dm_table_part${vtPartid} - + blkdev_num=$($VTOY_PATH/tool/dmsetup ls | $GREP ventoy${vtPartid} | $SED 's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1 \2/') $BUSYBOX_PATH/mknod -m 0666 /dev/ventoy${vtPartid} b $blkdev_num - + vtPartid=$(expr $vtPartid + 1) - done + done fi } -ventoy_create_chromeos_ventoy_part() { +ventoy_create_chromeos_ventoy_part() { blkdev_num=$($VTOY_PATH/tool/dmsetup ls | $GREP ventoy | $SED 's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1 \2/') $BUSYBOX_PATH/mknod -m 0666 /dev/ventoy b $blkdev_num - + if [ -e /vtoy_dm_table ]; then vtPartid=1 - + $CAT /vtoy_dm_table | while read vtline; do echo $vtline > /ventoy/dm_table_part${vtPartid} @@ -614,9 +614,9 @@ ventoy_create_chromeos_ventoy_part() { blkdev_num=$($VTOY_PATH/tool/dmsetup ls | $GREP ventoy${vtPartid} | $SED 's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1 \2/') $BUSYBOX_PATH/mknod -m 0666 /dev/ventoy${vtPartid} b $blkdev_num - + vtPartid=$(expr $vtPartid + 1) - done + done fi } @@ -629,7 +629,7 @@ is_inotify_ventoy_part() { else vtShortName=${1:0:-1} fi - + if [ -e /dev/$vtShortName ]; then if [ "$VTOY_VLNK_BOOT" = "01" ]; then vtOrgDiskName=$($VTOY_PATH/tool/vtoydump -t $VTOY_PATH/ventoy_os_param) @@ -642,7 +642,7 @@ is_inotify_ventoy_part() { fi fi fi - + [ "1" = "0" ] } @@ -672,13 +672,13 @@ ventoy_extract_vtloopex() { cd $VTOY_PATH/vtloopex $CAT $VTOY_PATH/partmnt/ventoy/vtloopex.cpio | $BUSYBOX_PATH/cpio -idm >> $VTLOG 2>&1 $BUSYBOX_PATH/umount $VTOY_PATH/partmnt - $BUSYBOX_PATH/rm -rf $VTOY_PATH/partmnt + $BUSYBOX_PATH/rm -rf $VTOY_PATH/partmnt if [ -n "$2" ]; then cd $VTOY_PATH/vtloopex/$2/ $BUSYBOX_PATH/tar -xJf vtloopex.tar.xz fi - + cd $vtCurPwd } @@ -703,7 +703,7 @@ ventoy_check_umount() { ventoy_wait_dir() { vtdir=$1 vtsec=0 - + while [ $vtsec -lt $2 ]; do if [ -d "$vtdir" ]; then break diff --git a/IMG/cpio/ventoy/hook/ventoy-os-lib.sh b/IMG/cpio/ventoy/hook/ventoy-os-lib.sh index a52cd746722..f16765e8b6c 100644 --- a/IMG/cpio/ventoy/hook/ventoy-os-lib.sh +++ b/IMG/cpio/ventoy/hook/ventoy-os-lib.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ VT_RULE_DIR_PREFIX="" @@ -81,7 +81,7 @@ ventoy_add_udev_rule() { # ventoy_systemd_udevd_work_around() { for vtdir in 'lib' 'usr/lib'; do - + VTSYSTEMUDEV="$VT_RULE_DIR_PREFIX/$vtdir/systemd/system/systemd-udevd.service" if [ -e $VTSYSTEMUDEV ]; then if $GREP -q 'SystemCallArchitectures.*native' $VTSYSTEMUDEV; then @@ -168,6 +168,6 @@ ventoy_iso_scan_check() { fi fi fi - + [ $vtCheckOk -eq 1 ] } diff --git a/IMG/cpio/ventoy/hook/vine/dev-listen.sh b/IMG/cpio/ventoy/hook/vine/dev-listen.sh index a358fc11393..0c75b51121c 100644 --- a/IMG/cpio/ventoy/hook/vine/dev-listen.sh +++ b/IMG/cpio/ventoy/hook/vine/dev-listen.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/hook/vine/udev_disk_hook.sh b/IMG/cpio/ventoy/hook/vine/udev_disk_hook.sh index 1ea6d671ec8..ec512355da5 100644 --- a/IMG/cpio/ventoy/hook/vine/udev_disk_hook.sh +++ b/IMG/cpio/ventoy/hook/vine/udev_disk_hook.sh @@ -1,37 +1,37 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh ventoy_os_install_dmsetup_by_ko() { vtlog "ventoy_os_install_dmsetup_by_ko $1" - + vtVer=$($BUSYBOX_PATH/uname -r) if $BUSYBOX_PATH/uname -m | $GREP -q 64; then vtBit=64 else vtBit=32 fi - + ventoy_extract_vtloopex $1 vine vtLoopExDir=$VTOY_PATH/vtloopex/vine/vtloopex - + if [ -e $vtLoopExDir/dm-mod/$vtVer/$vtBit/dm-mod.ko.xz ]; then $BUSYBOX_PATH/xz -d $vtLoopExDir/dm-mod/$vtVer/$vtBit/dm-mod.ko.xz insmod $vtLoopExDir/dm-mod/$vtVer/$vtBit/dm-mod.ko @@ -40,13 +40,13 @@ ventoy_os_install_dmsetup_by_ko() { ventoy_os_install_dmsetup_by_rpm() { vtlog "ventoy_os_install_dmsetup_by_rpm $1" - + vt_usb_disk=$1 # dump iso file location $VTOY_PATH/tool/vtoydm -i -f $VTOY_PATH/ventoy_image_map -d ${vt_usb_disk} > $VTOY_PATH/iso_file_list - # install dmsetup + # install dmsetup LINE=$($GREP 'kernel-[0-9].*\.rpm' $VTOY_PATH/iso_file_list) if [ $? -eq 0 ]; then extract_rpm_from_line "$LINE" ${vt_usb_disk} @@ -56,11 +56,11 @@ ventoy_os_install_dmsetup_by_rpm() { vtlog "vtKoName=$vtKoName" insmod $vtKoName - + $BUSYBOX_PATH/rm -rf $VTOY_PATH/rpm/ } -if is_ventoy_hook_finished || not_ventoy_disk "${1:0:-1}"; then +if is_ventoy_hook_finished || not_ventoy_disk "${1:0:-1}"; then exit 0 fi diff --git a/IMG/cpio/ventoy/hook/vine/ventoy-hook.sh b/IMG/cpio/ventoy/hook/vine/ventoy-hook.sh index d10c2ea130a..73170934a6b 100644 --- a/IMG/cpio/ventoy/hook/vine/ventoy-hook.sh +++ b/IMG/cpio/ventoy/hook/vine/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh @@ -23,4 +23,4 @@ $BUSYBOX_PATH/cp -a /sbin/loader /sbin/loader_bk $VTOY_PATH/tool/vine_patch_loader /sbin/loader 253 -v >> $VTLOG $BUSYBOX_PATH/mknod -m 0660 /dev/null c 1 3 -$VTOY_PATH/hook/vine/dev-listen.sh & +$VTOY_PATH/hook/vine/dev-listen.sh & diff --git a/IMG/cpio/ventoy/hook/wifislax/disk_hook.sh b/IMG/cpio/ventoy/hook/wifislax/disk_hook.sh index aff0f98b4b8..d6d0cb9843d 100644 --- a/IMG/cpio/ventoy/hook/wifislax/disk_hook.sh +++ b/IMG/cpio/ventoy/hook/wifislax/disk_hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/hook/wifislax/ventoy-hook.sh b/IMG/cpio/ventoy/hook/wifislax/ventoy-hook.sh index cc0be88933d..3566cd6c470 100644 --- a/IMG/cpio/ventoy/hook/wifislax/ventoy-hook.sh +++ b/IMG/cpio/ventoy/hook/wifislax/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh diff --git a/IMG/cpio/ventoy/hook/xen/udev_disk_hook.sh b/IMG/cpio/ventoy/hook/xen/udev_disk_hook.sh index b25c1fbbccf..84a3f4c2b43 100644 --- a/IMG/cpio/ventoy/hook/xen/udev_disk_hook.sh +++ b/IMG/cpio/ventoy/hook/xen/udev_disk_hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/hook/xen/ventoy-hook.sh b/IMG/cpio/ventoy/hook/xen/ventoy-hook.sh index 1260ce15cad..2d40a79aa63 100644 --- a/IMG/cpio/ventoy/hook/xen/ventoy-hook.sh +++ b/IMG/cpio/ventoy/hook/xen/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh diff --git a/IMG/cpio/ventoy/hook/zeroshell/disk_hook.sh b/IMG/cpio/ventoy/hook/zeroshell/disk_hook.sh index 55058ecaa2a..38cc9017ccb 100644 --- a/IMG/cpio/ventoy/hook/zeroshell/disk_hook.sh +++ b/IMG/cpio/ventoy/hook/zeroshell/disk_hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/hook/zeroshell/ventoy-hook.sh b/IMG/cpio/ventoy/hook/zeroshell/ventoy-hook.sh index e08252d3cc2..bced0c8b2b0 100644 --- a/IMG/cpio/ventoy/hook/zeroshell/ventoy-hook.sh +++ b/IMG/cpio/ventoy/hook/zeroshell/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh diff --git a/IMG/cpio/ventoy/init b/IMG/cpio/ventoy/init index b1040bcf741..7db05b8a90c 100644 --- a/IMG/cpio/ventoy/init +++ b/IMG/cpio/ventoy/init @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ @@ -32,7 +32,7 @@ fi mount -t proc proc /proc export vtcmdline=$(cat /proc/cmdline) export vtkerver=$(cat /proc/version) -umount /proc; +umount /proc; if [ "$vtrmproc" = "Y" ]; then rm -rf /proc @@ -43,11 +43,11 @@ echo "kenel cmdline=$vtcmdline" >>$VTLOG #break here for debug if [ "$VTOY_BREAK_LEVEL" = "01" ] || [ "$VTOY_BREAK_LEVEL" = "11" ]; then - sleep 5 + sleep 5 echo -e "\n\n\033[32m ################################################# \033[0m" echo -e "\033[32m ################ VENTOY DEBUG ################### \033[0m" echo -e "\033[32m ################################################# \033[0m \n" - + if [ "$VTOY_BREAK_LEVEL" = "11" ]; then cat $VTLOG fi diff --git a/IMG/cpio/ventoy/init_chain b/IMG/cpio/ventoy/init_chain index 603437037fb..185f6f69b1b 100644 --- a/IMG/cpio/ventoy/init_chain +++ b/IMG/cpio/ventoy/init_chain @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ @@ -49,30 +49,30 @@ ventoy_is_initrd_ramdisk() { ventoy_mount_squashfs() { mkdir /dev - mount -t devtmpfs devtmpfs /dev + mount -t devtmpfs devtmpfs /dev dd if=$1 of=/dev/ram0 status=none umount /dev && rm -rf /dev } # param: file skip magic tmp -ventoy_unpack_initramfs() { - vtfile=$1; vtskip=$2; vtmagic=$3; vttmp=$4 +ventoy_unpack_initramfs() { + vtfile=$1; vtskip=$2; vtmagic=$3; vttmp=$4 echo "=====ventoy_unpack_initramfs: #$*#" >> $VTLOG - + #special process #if [ "${vtmagic:0:4}" = '5678' ]; then # echo -en '\x1F\x8B' | dd status=none of=$vtfile bs=1 count=2 conv=notrunc # vtmagic='1F8B' #fi - + if [ "${vtmagic:0:4}" = '6873' ]; then ventoy_mount_squashfs $vtfile return fi - + for vtx in '1F8B zcat' '1F9E zcat' '425A bzcat' '5D00 lzcat' 'FD37 xzcat' '894C lzopcat' '0221 lz4cat' '28B5 zstdcat' '3037 cat' '4C5A lunzip -c'; do if [ "${vtx:0:4}" = "${vtmagic:0:4}" ]; then - echo "vtx=$vtx" >> $VTLOG + echo "vtx=$vtx" >> $VTLOG if [ $vtskip -ne 0 ]; then dd if=$vtfile skip=$vtskip iflag=skip_bytes status=none > ${vtfile}.skip rm -f $vtfile @@ -83,35 +83,35 @@ ventoy_unpack_initramfs() { rm -f $VTOY_PATH/xzlog ${vtx:5} $vtfile 2> $VTOY_PATH/xzlog | (cpio -idmu 2>>$VTLOG; cat > $vttmp) if grep -q 'corrupted data' $VTOY_PATH/xzlog; then - echo 'xzcat failed, now try xzminidec...' >> $VTLOG + echo 'xzcat failed, now try xzminidec...' >> $VTLOG rm -f $VTOY_PATH/xzlog cat $vtfile | xzminidec 2> $VTOY_PATH/xzlog | (cpio -idmu 2>>$VTLOG; cat > $vttmp) - if grep -q 'limit' $VTOY_PATH/xzlog; then - echo 'xzminidec failed, now try xzcat_musl ...' >> $VTLOG + if grep -q 'limit' $VTOY_PATH/xzlog; then + echo 'xzminidec failed, now try xzcat_musl ...' >> $VTLOG xzcat_musl $vtfile | (cpio -idmu 2>>$VTLOG; cat > $vttmp) fi fi else ${vtx:5} $vtfile | (cpio -idmu 2>>$VTLOG; cat > $vttmp) - fi + fi break fi done } # param: file magic tmp -ventoy_unpack_initrd() { - vtfile=$1; vtmagic=$2; vttmp=$3 +ventoy_unpack_initrd() { + vtfile=$1; vtmagic=$2; vttmp=$3 echo "=====ventoy_unpack_initrd: #$*#" >> $VTLOG - + for vtx in '1F8B zcat' '1F9E zcat' '425A bzcat' '5D00 lzcat' 'FD37 xzcat' '894C lzopcat' '0221 lz4cat' '28B5 zstdcat' '3037 cat'; do if [ "${vtx:0:4}" = "${vtmagic:0:4}" ]; then - echo "vtx=$vtx" >> $VTLOG + echo "vtx=$vtx" >> $VTLOG ${vtx:5} $vtfile > $vttmp break fi - done + done } vtfile_head_zero() { @@ -120,12 +120,12 @@ vtfile_head_zero() { local vfile local vzero local vdump - + voffset=0 vfile=$1 vsize=$(stat -c '%s' ${vfile}) vzero=$(hexdump -n 512 -e '512/1 "%02X"' $vfile) - + while [ $voffset -lt $vsize ]; do vdump=$(hexdump -s $voffset -n 512 -e '512/1 "%02X"' $vfile) if [ "$vdump" != "$vzero" ]; then @@ -133,14 +133,14 @@ vtfile_head_zero() { return fi voffset=$($BUSYBOX_PATH/expr $voffset + 512) - done + done echo 0 } # This export is for busybox cpio command export EXTRACT_UNSAFE_SYMLINKS=1 -for vtfile in $(ls /initrd*); do +for vtfile in $(ls /initrd*); do #decompress first initrd vtmagic=$(hexdump -n 2 -e '2/1 "%02X"' $vtfile) @@ -155,40 +155,40 @@ for vtfile in $(ls /initrd*); do #only for cpio,cpio,...,initrd sequence, initrd,cpio or initrd,initrd sequence is not supported while [ -e ${vtfile}_tmp ] && [ $(stat -c '%s' ${vtfile}_tmp) -gt 512 ]; do mv ${vtfile}_tmp $vtfile - + vtdump=$(hexdump -n 512 -e '512/1 "%02X"' $vtfile) vtmagic=$(echo $vtdump | sed 's/^\(00\)*//') let vtoffset="(${#vtdump}-${#vtmagic})/2" - + if [ -z "$vtmagic" ]; then vtHeadZero=$(vtfile_head_zero $vtfile) if [ $vtHeadZero -gt 0 ]; then vtdump=$(hexdump -s $vtHeadZero -n 512 -e '512/1 "%02X"' $vtfile) vtmagic=$(echo $vtdump | sed 's/^\(00\)*//') - let vtoffset="(${#vtdump}-${#vtmagic})/2+$vtHeadZero" + let vtoffset="(${#vtdump}-${#vtmagic})/2+$vtHeadZero" echo "skip head $vtHeadZero zeros with magic ${vtmagic:0:4}" >> $VTLOG else - echo "terminate with all zero data file" >> $VTLOG + echo "terminate with all zero data file" >> $VTLOG break - fi + fi fi - + ventoy_unpack_initramfs $vtfile $vtoffset ${vtmagic:0:4} ${vtfile}_tmp done - + rm -f $vtfile ${vtfile}_tmp done #break here for debug if [ "$VTOY_BREAK_LEVEL" = "02" ] || [ "$VTOY_BREAK_LEVEL" = "12" ]; then - sleep 5 + sleep 5 echo -e "\n\n\033[32m ################################################# \033[0m" echo -e "\033[32m ################ VENTOY DEBUG ################### \033[0m" - echo -e "\033[32m ################################################# \033[0m \n" - if [ "$VTOY_BREAK_LEVEL" = "12" ]; then + echo -e "\033[32m ################################################# \033[0m \n" + if [ "$VTOY_BREAK_LEVEL" = "12" ]; then cat $VTOY_PATH/log - fi + fi exec $BUSYBOX_PATH/sh fi @@ -201,13 +201,13 @@ fi ventoy_unpack_injection() { vtmagic=$(hexdump -n 2 -e '2/1 "%02X"' $VTOY_PATH/ventoy_injection) echo "ventoy_unpack_injection vtmagic=$vtmagic ..." - + if [ "1F8B" = "$vtmagic" ] || [ "1F9E" = "$vtmagic" ]; then echo "tar.gz tar -xzvf" tar -xzvf $VTOY_PATH/ventoy_injection -C / elif [ "425A" = "$vtmagic" ]; then echo "tar.bz2 tar -xjvf" - tar -xjvf $VTOY_PATH/ventoy_injection -C / + tar -xjvf $VTOY_PATH/ventoy_injection -C / elif [ "FD37" = "$vtmagic" ]; then echo "tar.xz tar -xJvf" tar -xJvf $VTOY_PATH/ventoy_injection -C / @@ -222,7 +222,7 @@ ventoy_unpack_injection() { if [ -e $VTOY_PATH/ventoy_injection ]; then echo "### decompress injection ... ###" >>$VTLOG - ventoy_unpack_injection > $VTOY_PATH/injection.log 2>&1 + ventoy_unpack_injection > $VTOY_PATH/injection.log 2>&1 fi diff --git a/IMG/cpio/ventoy/init_loop b/IMG/cpio/ventoy/init_loop index 92886330cef..c24a9209cf6 100644 --- a/IMG/cpio/ventoy/init_loop +++ b/IMG/cpio/ventoy/init_loop @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ @@ -26,13 +26,13 @@ ventoy_unpack_injection() { vtmagic=$(hexdump -n 2 -e '2/1 "%02X"' $VTOY_PATH/ventoy_injection) echo "ventoy_unpack_injection vtmagic=$vtmagic ..." - + if [ "1F8B" = "$vtmagic" ] || [ "1F9E" = "$vtmagic" ]; then echo "tar.gz tar -xzvf" tar -xzvf $VTOY_PATH/ventoy_injection -C / elif [ "425A" = "$vtmagic" ]; then echo "tar.bz2 tar -xjvf" - tar -xjvf $VTOY_PATH/ventoy_injection -C / + tar -xjvf $VTOY_PATH/ventoy_injection -C / elif [ "FD37" = "$vtmagic" ]; then echo "tar.xz tar -xJvf" tar -xJvf $VTOY_PATH/ventoy_injection -C / diff --git a/IMG/cpio/ventoy/loop/LibreELEC/ventoy-disk.sh b/IMG/cpio/ventoy/loop/LibreELEC/ventoy-disk.sh index 8acbb36fc69..ae3c90b7c09 100644 --- a/IMG/cpio/ventoy/loop/LibreELEC/ventoy-disk.sh +++ b/IMG/cpio/ventoy/loop/LibreELEC/ventoy-disk.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/loop/LibreELEC/ventoy-hook.sh b/IMG/cpio/ventoy/loop/LibreELEC/ventoy-hook.sh index 16366326a5c..e2fd61eba54 100644 --- a/IMG/cpio/ventoy/loop/LibreELEC/ventoy-hook.sh +++ b/IMG/cpio/ventoy/loop/LibreELEC/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh diff --git a/IMG/cpio/ventoy/loop/batocera/ventoy-disk.sh b/IMG/cpio/ventoy/loop/batocera/ventoy-disk.sh index 6281cc71e7d..963edde91cb 100644 --- a/IMG/cpio/ventoy/loop/batocera/ventoy-disk.sh +++ b/IMG/cpio/ventoy/loop/batocera/ventoy-disk.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/loop/batocera/ventoy-hook.sh b/IMG/cpio/ventoy/loop/batocera/ventoy-hook.sh index 2bb7c8e75da..f4620a40c3f 100644 --- a/IMG/cpio/ventoy/loop/batocera/ventoy-hook.sh +++ b/IMG/cpio/ventoy/loop/batocera/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh diff --git a/IMG/cpio/ventoy/loop/cloudready/ventoy-hook.sh b/IMG/cpio/ventoy/loop/cloudready/ventoy-hook.sh index 666a4e0b150..3a53362ca47 100644 --- a/IMG/cpio/ventoy/loop/cloudready/ventoy-hook.sh +++ b/IMG/cpio/ventoy/loop/cloudready/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2021, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh @@ -30,13 +30,13 @@ sleep 2 while [ -n "Y" ]; do usb_disk=$(get_ventoy_disk_name) - + if echo $usb_disk | egrep -q "nvme|mmc|nbd"; then vtpart2=${usb_disk}p2 else vtpart2=${usb_disk}2 fi - + if [ -e "${vtpart2}" ]; then break else @@ -145,17 +145,17 @@ for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do else vtpart=$i fi - + if [ -e /newdev/${vtshortname}${vtpart} ]; then mv /newdev/${vtshortname}${vtpart} /newdev/backup_${vtshortname}${vtpart} fi cp -a /dev/ventoy${i} /newdev/${vtshortname}${vtpart} - + if [ $i -eq 3 ]; then [ -e /dev/${vtshortname}${vtpart} ] && rm -f /dev/${vtshortname}${vtpart} - cp -a /dev/ventoy${i} /dev/${vtshortname}${vtpart} - vt_root_dev="/dev/${vtshortname}${vtpart}" + cp -a /dev/ventoy${i} /dev/${vtshortname}${vtpart} + vt_root_dev="/dev/${vtshortname}${vtpart}" vtlog "vt_root_dev=$vt_root_dev" fi fi @@ -164,17 +164,17 @@ done # if grep -q 'DM=' /proc/cmdline; then # vtlog "Boot verified image ..." - + # dmP1=$(sed "s/.*\(0 [0-9]* verity\).*/\1/" /proc/cmdline) # alg=$(sed "s/.*alg=\([^ ]*\).*/\1/" /proc/cmdline) # hexdigest=$(sed "s/.*root_hexdigest=\([0-9a-fA-F][0-9a-fA-F]*\).*/\1/" /proc/cmdline) # salt=$(sed "s/.*salt=\([0-9a-fA-F][0-9a-fA-F]*\).*/\1/" /proc/cmdline) # hashstart=$(sed "s/.*hashstart=\([0-9][0-9]*\).*/\1/" /proc/cmdline) - + #512 to 4096 # blocknum=$(expr $hashstart / 8) # hashoffset=$(expr $hashstart \* 512) - + # vtlog "veritysetup create vroot $vt_root_dev $vt_root_dev $hexdigest --data-block-size=4096 --hash-block-size=4096 --data-blocks=$blocknum --hash-offset=$hashoffset --salt=$salt --hash=$alg --no-superblock --format=0" # veritysetup create vroot $vt_root_dev $vt_root_dev $hexdigest --data-block-size=4096 --hash-block-size=4096 --data-blocks=$blocknum --hash-offset=$hashoffset --salt=$salt --hash=$alg --no-superblock --format=0 # sleep 1 diff --git a/IMG/cpio/ventoy/loop/easyos/ventoy-disk.sh b/IMG/cpio/ventoy/loop/easyos/ventoy-disk.sh index 13a9706e4c4..18ac88e8471 100644 --- a/IMG/cpio/ventoy/loop/easyos/ventoy-disk.sh +++ b/IMG/cpio/ventoy/loop/easyos/ventoy-disk.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/loop/easyos/ventoy-hook.sh b/IMG/cpio/ventoy/loop/easyos/ventoy-hook.sh index 75eabc67f79..ab817f6f35a 100644 --- a/IMG/cpio/ventoy/loop/easyos/ventoy-hook.sh +++ b/IMG/cpio/ventoy/loop/easyos/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2022, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh diff --git a/IMG/cpio/ventoy/loop/easyos/ventoy-resize.sh b/IMG/cpio/ventoy/loop/easyos/ventoy-resize.sh index 3732e0a587c..3cb03892627 100644 --- a/IMG/cpio/ventoy/loop/easyos/ventoy-resize.sh +++ b/IMG/cpio/ventoy/loop/easyos/ventoy-resize.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2022, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/loop/endless/ventoy-hook.sh b/IMG/cpio/ventoy/loop/endless/ventoy-hook.sh index 7d0820d6b18..339f65b0d03 100644 --- a/IMG/cpio/ventoy/loop/endless/ventoy-hook.sh +++ b/IMG/cpio/ventoy/loop/endless/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh diff --git a/IMG/cpio/ventoy/loop/endless/ventoy-inotifyd-hook.sh b/IMG/cpio/ventoy/loop/endless/ventoy-inotifyd-hook.sh index cc9050dadee..707bc7a45a5 100644 --- a/IMG/cpio/ventoy/loop/endless/ventoy-inotifyd-hook.sh +++ b/IMG/cpio/ventoy/loop/endless/ventoy-inotifyd-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/loop/endless/ventoy-inotifyd-start.sh b/IMG/cpio/ventoy/loop/endless/ventoy-inotifyd-start.sh index 6375dc5edd8..ad853ca788e 100644 --- a/IMG/cpio/ventoy/loop/endless/ventoy-inotifyd-start.sh +++ b/IMG/cpio/ventoy/loop/endless/ventoy-inotifyd-start.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh @@ -24,7 +24,7 @@ vtHook=$($CAT $VTOY_PATH/inotifyd-loop-script.txt) vtdisk=$(get_ventoy_disk_name) if [ "$vtdisk" = "unknown" ]; then vtlog "... start inotifyd listen $vtHook ..." - $BUSYBOX_PATH/nohup $VTOY_PATH/tool/inotifyd $vtHook /dev:n 2>&- & + $BUSYBOX_PATH/nohup $VTOY_PATH/tool/inotifyd $vtHook /dev:n 2>&- & else vtlog "... $vtdisk already exist ..." $BUSYBOX_PATH/sh $vtHook n /dev "${vtdisk#/dev/}2" diff --git a/IMG/cpio/ventoy/loop/esysrescue/ventoy-disk.sh b/IMG/cpio/ventoy/loop/esysrescue/ventoy-disk.sh index f50c7d48f22..897ef765329 100644 --- a/IMG/cpio/ventoy/loop/esysrescue/ventoy-disk.sh +++ b/IMG/cpio/ventoy/loop/esysrescue/ventoy-disk.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/loop/esysrescue/ventoy-hook.sh b/IMG/cpio/ventoy/loop/esysrescue/ventoy-hook.sh index 5420f8cb667..14dc8413167 100644 --- a/IMG/cpio/ventoy/loop/esysrescue/ventoy-hook.sh +++ b/IMG/cpio/ventoy/loop/esysrescue/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh diff --git a/IMG/cpio/ventoy/loop/freedombox/ventoy-disk.sh b/IMG/cpio/ventoy/loop/freedombox/ventoy-disk.sh index 5ebc7f96760..e7edff7bf1e 100644 --- a/IMG/cpio/ventoy/loop/freedombox/ventoy-disk.sh +++ b/IMG/cpio/ventoy/loop/freedombox/ventoy-disk.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/loop/freedombox/ventoy-hook.sh b/IMG/cpio/ventoy/loop/freedombox/ventoy-hook.sh index 25853914e8a..0e61fe4c6de 100644 --- a/IMG/cpio/ventoy/loop/freedombox/ventoy-hook.sh +++ b/IMG/cpio/ventoy/loop/freedombox/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh diff --git a/IMG/cpio/ventoy/loop/fwts/ventoy-disk.sh b/IMG/cpio/ventoy/loop/fwts/ventoy-disk.sh index 8b249255c96..30ccfc1e606 100644 --- a/IMG/cpio/ventoy/loop/fwts/ventoy-disk.sh +++ b/IMG/cpio/ventoy/loop/fwts/ventoy-disk.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/loop/fwts/ventoy-hook.sh b/IMG/cpio/ventoy/loop/fwts/ventoy-hook.sh index 1da4fb90b15..d468a156bd6 100644 --- a/IMG/cpio/ventoy/loop/fwts/ventoy-hook.sh +++ b/IMG/cpio/ventoy/loop/fwts/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh diff --git a/IMG/cpio/ventoy/loop/fydeos/ventoy-hook.sh b/IMG/cpio/ventoy/loop/fydeos/ventoy-hook.sh index 666a4e0b150..3a53362ca47 100644 --- a/IMG/cpio/ventoy/loop/fydeos/ventoy-hook.sh +++ b/IMG/cpio/ventoy/loop/fydeos/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2021, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh @@ -30,13 +30,13 @@ sleep 2 while [ -n "Y" ]; do usb_disk=$(get_ventoy_disk_name) - + if echo $usb_disk | egrep -q "nvme|mmc|nbd"; then vtpart2=${usb_disk}p2 else vtpart2=${usb_disk}2 fi - + if [ -e "${vtpart2}" ]; then break else @@ -145,17 +145,17 @@ for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do else vtpart=$i fi - + if [ -e /newdev/${vtshortname}${vtpart} ]; then mv /newdev/${vtshortname}${vtpart} /newdev/backup_${vtshortname}${vtpart} fi cp -a /dev/ventoy${i} /newdev/${vtshortname}${vtpart} - + if [ $i -eq 3 ]; then [ -e /dev/${vtshortname}${vtpart} ] && rm -f /dev/${vtshortname}${vtpart} - cp -a /dev/ventoy${i} /dev/${vtshortname}${vtpart} - vt_root_dev="/dev/${vtshortname}${vtpart}" + cp -a /dev/ventoy${i} /dev/${vtshortname}${vtpart} + vt_root_dev="/dev/${vtshortname}${vtpart}" vtlog "vt_root_dev=$vt_root_dev" fi fi @@ -164,17 +164,17 @@ done # if grep -q 'DM=' /proc/cmdline; then # vtlog "Boot verified image ..." - + # dmP1=$(sed "s/.*\(0 [0-9]* verity\).*/\1/" /proc/cmdline) # alg=$(sed "s/.*alg=\([^ ]*\).*/\1/" /proc/cmdline) # hexdigest=$(sed "s/.*root_hexdigest=\([0-9a-fA-F][0-9a-fA-F]*\).*/\1/" /proc/cmdline) # salt=$(sed "s/.*salt=\([0-9a-fA-F][0-9a-fA-F]*\).*/\1/" /proc/cmdline) # hashstart=$(sed "s/.*hashstart=\([0-9][0-9]*\).*/\1/" /proc/cmdline) - + #512 to 4096 # blocknum=$(expr $hashstart / 8) # hashoffset=$(expr $hashstart \* 512) - + # vtlog "veritysetup create vroot $vt_root_dev $vt_root_dev $hexdigest --data-block-size=4096 --hash-block-size=4096 --data-blocks=$blocknum --hash-offset=$hashoffset --salt=$salt --hash=$alg --no-superblock --format=0" # veritysetup create vroot $vt_root_dev $vt_root_dev $hexdigest --data-block-size=4096 --hash-block-size=4096 --data-blocks=$blocknum --hash-offset=$hashoffset --salt=$salt --hash=$alg --no-superblock --format=0 # sleep 1 diff --git a/IMG/cpio/ventoy/loop/lakka/ventoy-disk.sh b/IMG/cpio/ventoy/loop/lakka/ventoy-disk.sh index 42a8e7feed4..f1ac61eae4d 100644 --- a/IMG/cpio/ventoy/loop/lakka/ventoy-disk.sh +++ b/IMG/cpio/ventoy/loop/lakka/ventoy-disk.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/loop/lakka/ventoy-hook.sh b/IMG/cpio/ventoy/loop/lakka/ventoy-hook.sh index 0fd01807a6c..27cfaf6cb88 100644 --- a/IMG/cpio/ventoy/loop/lakka/ventoy-hook.sh +++ b/IMG/cpio/ventoy/loop/lakka/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh diff --git a/IMG/cpio/ventoy/loop/openwrt/ventoy-disk.sh b/IMG/cpio/ventoy/loop/openwrt/ventoy-disk.sh index 52f46d66f1f..e90e9349f3e 100644 --- a/IMG/cpio/ventoy/loop/openwrt/ventoy-disk.sh +++ b/IMG/cpio/ventoy/loop/openwrt/ventoy-disk.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh @@ -49,11 +49,11 @@ check_insmod() { wrt_insmod() { kbit=$1 kv=$(uname -r) - + vtlog "insmod $kv $kbit" - + check_insmod /ventoy_openwrt/$kv/$kbit/dax.ko - check_insmod /ventoy_openwrt/$kv/$kbit/dm-mod.ko + check_insmod /ventoy_openwrt/$kv/$kbit/dm-mod.ko } insmod_dm_mod() { @@ -61,7 +61,7 @@ insmod_dm_mod() { vtlog "device-mapper enabled by system 0" return fi - + check_insmod /ventoy/modules/dax.ko check_insmod /ventoy/modules/dm-mod.ko @@ -69,7 +69,7 @@ insmod_dm_mod() { vtlog "device-mapper enabled by system 1" return fi - + if [ -f /ventoy_openwrt.xz ]; then tar xf /ventoy_openwrt.xz -C / rm -f /ventoy_openwrt.xz @@ -78,7 +78,7 @@ insmod_dm_mod() { if uname -m | egrep -q "amd64|x86_64"; then wrt_insmod 64 else - wrt_insmod generic + wrt_insmod generic if lsmod | grep -q 'dm-mod'; then vterr "insmod generic failed" else @@ -101,7 +101,7 @@ while [ -n "Y" ]; do vtlog "get_ventoy_disk_name $vtusb_disk not ready" sleep 2 check_mkdev_node - fi + fi done diff --git a/IMG/cpio/ventoy/loop/openwrt/ventoy-hook.sh b/IMG/cpio/ventoy/loop/openwrt/ventoy-hook.sh index f6c1c8c69ff..e481486a24f 100644 --- a/IMG/cpio/ventoy/loop/openwrt/ventoy-hook.sh +++ b/IMG/cpio/ventoy/loop/openwrt/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh diff --git a/IMG/cpio/ventoy/loop/paldo/ventoy-disk.sh b/IMG/cpio/ventoy/loop/paldo/ventoy-disk.sh index ef45f04a19d..669b02390ca 100644 --- a/IMG/cpio/ventoy/loop/paldo/ventoy-disk.sh +++ b/IMG/cpio/ventoy/loop/paldo/ventoy-disk.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/loop/paldo/ventoy-hook.sh b/IMG/cpio/ventoy/loop/paldo/ventoy-hook.sh index efdff627f2b..ddb00f6b0cd 100644 --- a/IMG/cpio/ventoy/loop/paldo/ventoy-hook.sh +++ b/IMG/cpio/ventoy/loop/paldo/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh diff --git a/IMG/cpio/ventoy/loop/recalbox/ventoy-create-part.sh b/IMG/cpio/ventoy/loop/recalbox/ventoy-create-part.sh index e7edeb0c4ae..d6a912e1a60 100644 --- a/IMG/cpio/ventoy/loop/recalbox/ventoy-create-part.sh +++ b/IMG/cpio/ventoy/loop/recalbox/ventoy-create-part.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh @@ -35,9 +35,9 @@ vtlog "try patch init script" if [ -f /new_root/etc/init.d/S11share ]; then cp -a /new_root/etc/init.d/S11share /new_root/overlay/S11share sed "/^ *createMissingPartitions *$/r $VTOY_PATH/loop/recalbox/ventoy-share.sh" -i /new_root/overlay/S11share - + vtFile=$(ls -1 /new_root/etc/init.d/ | grep -m1 S01) - + mount --bind /new_root/overlay/S11share /new_root/etc/init.d/$vtFile vtlog "patch S11share to $vtFile" fi diff --git a/IMG/cpio/ventoy/loop/recalbox/ventoy-disk.sh b/IMG/cpio/ventoy/loop/recalbox/ventoy-disk.sh index 3c6b6ee2d82..dcfd94d127f 100644 --- a/IMG/cpio/ventoy/loop/recalbox/ventoy-disk.sh +++ b/IMG/cpio/ventoy/loop/recalbox/ventoy-disk.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/loop/recalbox/ventoy-hook.sh b/IMG/cpio/ventoy/loop/recalbox/ventoy-hook.sh index 881c236c8e0..398af8c806e 100644 --- a/IMG/cpio/ventoy/loop/recalbox/ventoy-hook.sh +++ b/IMG/cpio/ventoy/loop/recalbox/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh diff --git a/IMG/cpio/ventoy/loop/tails/ventoy-disk.sh b/IMG/cpio/ventoy/loop/tails/ventoy-disk.sh index a4e4706c86b..04503689295 100644 --- a/IMG/cpio/ventoy/loop/tails/ventoy-disk.sh +++ b/IMG/cpio/ventoy/loop/tails/ventoy-disk.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh @@ -45,7 +45,7 @@ ventoy_create_dev_ventoy_part if [ -n "${FSUUID}" ]; then vtPartid=0 MaxPart=$(cat /vtoy_dm_table|wc -l) - + while [ $vtPartid -le $MaxPart ]; do if blkid /dev/dm-${vtPartid} | grep -q "${FSUUID}"; then ln -s ../../dm-${vtPartid} "/dev/disk/by-uuid/${FSUUID}" diff --git a/IMG/cpio/ventoy/loop/tails/ventoy-hook.sh b/IMG/cpio/ventoy/loop/tails/ventoy-hook.sh index 4eec2ae6ec1..c86d4324855 100644 --- a/IMG/cpio/ventoy/loop/tails/ventoy-hook.sh +++ b/IMG/cpio/ventoy/loop/tails/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh diff --git a/IMG/cpio/ventoy/loop/ubos/newroot-hook.sh b/IMG/cpio/ventoy/loop/ubos/newroot-hook.sh index ecc0f18eec6..1b0dc506c90 100644 --- a/IMG/cpio/ventoy/loop/ubos/newroot-hook.sh +++ b/IMG/cpio/ventoy/loop/ubos/newroot-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/loop/ubos/ventoy-disk.sh b/IMG/cpio/ventoy/loop/ubos/ventoy-disk.sh index a095067ee88..8d1f3efbf55 100644 --- a/IMG/cpio/ventoy/loop/ubos/ventoy-disk.sh +++ b/IMG/cpio/ventoy/loop/ubos/ventoy-disk.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/loop/ubos/ventoy-hook.sh b/IMG/cpio/ventoy/loop/ubos/ventoy-hook.sh index ef79b2a88ca..d4aba7e1be5 100644 --- a/IMG/cpio/ventoy/loop/ubos/ventoy-hook.sh +++ b/IMG/cpio/ventoy/loop/ubos/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh diff --git a/IMG/cpio/ventoy/loop/volumio/ventoy-disk.sh b/IMG/cpio/ventoy/loop/volumio/ventoy-disk.sh index 8b249255c96..30ccfc1e606 100644 --- a/IMG/cpio/ventoy/loop/volumio/ventoy-disk.sh +++ b/IMG/cpio/ventoy/loop/volumio/ventoy-disk.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . /ventoy/hook/ventoy-hook-lib.sh diff --git a/IMG/cpio/ventoy/loop/volumio/ventoy-hook.sh b/IMG/cpio/ventoy/loop/volumio/ventoy-hook.sh index 7b616d29138..cbc48d63ab6 100644 --- a/IMG/cpio/ventoy/loop/volumio/ventoy-hook.sh +++ b/IMG/cpio/ventoy/loop/volumio/ventoy-hook.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ . $VTOY_PATH/hook/ventoy-os-lib.sh diff --git a/IMG/cpio/ventoy/ventoy_chain.sh b/IMG/cpio/ventoy/ventoy_chain.sh index d63a132239e..e0b73c27b7b 100644 --- a/IMG/cpio/ventoy/ventoy_chain.sh +++ b/IMG/cpio/ventoy/ventoy_chain.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ #################################################################### @@ -68,7 +68,7 @@ ventoy_get_os_type() { # Ubuntu : do the same process with debian elif $GREP -q '[Uu]buntu' /proc/version; then echo 'debian'; return - + # Deepin : elif $GREP -q '[Dd]eepin' /proc/version; then echo 'deepin'; return @@ -89,12 +89,12 @@ ventoy_get_os_type() { # rhel7/CentOS7/rhel8/CentOS8 and all other distributions based on them elif $GREP -q 'el[78]' /proc/version; then - echo 'rhel7'; return + echo 'rhel7'; return # Maybe rhel9 rhel1x use the same way? Who knows! elif $EGREP -q 'el9|el1[0-9]' /proc/version; then - echo 'rhel7'; return - + echo 'rhel7'; return + # Fedora : do the same process with rhel7 elif $GREP -q '\.fc[0-9][0-9]\.' /proc/version; then echo 'rhel7'; return @@ -105,55 +105,55 @@ ventoy_get_os_type() { # SUSE elif $GREP -q 'SUSE' /proc/version; then echo 'suse'; return - + # ArchLinux elif $EGREP -q 'archlinux|ARCH' /proc/version; then echo 'arch'; return - + # kiosk elif $EGREP -q 'kiosk' /proc/version; then echo 'kiosk'; return - + # gentoo elif $EGREP -q '[Gg]entoo' /proc/version; then if $GREP -q 'daphile' /proc/version; then echo 'daphile'; return fi - + echo 'gentoo'; return - + # TinyCore elif $EGREP -q 'tinycore' /proc/version; then echo 'tinycore'; return - + # manjaro elif $EGREP -q 'manjaro|MANJARO' /proc/version; then echo 'manjaro'; return - + # mageia elif $EGREP -q 'mageia' /proc/version; then echo 'mageia'; return - + # pclinux OS elif $GREP -i -q 'PCLinuxOS' /proc/version; then echo 'pclos'; return - + # KaOS elif $GREP -i -q 'kaos' /proc/version; then echo 'kaos'; return - + # Alpine elif $GREP -q 'Alpine' /proc/version; then echo 'alpine'; return elif $GREP -i -q 'PhoenixOS' /proc/version; then echo 'phoenixos'; return - + # NixOS elif $GREP -i -q 'NixOS' /proc/version; then echo 'nixos'; return - - + + fi if [ -e /lib/debian-installer ]; then @@ -164,7 +164,7 @@ ventoy_get_os_type() { if $GREP -q 'XenServer' /etc/os-release; then echo 'xen'; return elif $GREP -q 'SUSE ' /etc/os-release; then - echo 'suse'; return + echo 'suse'; return elif $GREP -q 'uruk' /etc/os-release; then echo 'debian'; return elif $GREP -q 'Solus' /etc/os-release; then @@ -179,165 +179,165 @@ ventoy_get_os_type() { echo 'deepin'; return fi fi - + if $BUSYBOX_PATH/dmesg | $GREP -q -m1 "Xen:"; then echo 'xen'; return fi - - + + if [ -e /etc/HOSTNAME ] && $GREP -i -q 'slackware' /etc/HOSTNAME; then echo 'slackware'; return fi - + if [ -e /init ]; then if $GREP -i -q zeroshell /init; then echo 'zeroshell'; return fi fi - + if $EGREP -q 'ALT ' /proc/version; then echo 'alt'; return fi - + if $EGREP -q 'porteus' /proc/version; then echo 'debian'; return fi - + if $GREP -q 'Clear Linux ' /proc/version; then echo 'clear'; return fi - + if $GREP -q 'artix' /proc/version; then echo 'arch'; return fi - + if $GREP -q 'berry ' /proc/version; then echo 'berry'; return fi - + if $GREP -q 'Gobo ' /proc/version; then echo 'gobo'; return fi - + if $GREP -q 'NuTyX' /proc/version; then echo 'nutyx'; return fi - + if [ -d /gnu ]; then vtLineNum=$($FIND /gnu/ -name guix | $BUSYBOX_PATH/wc -l) if [ $vtLineNum -gt 0 ]; then echo 'guix'; return fi fi - + if $GREP -q 'android.x86' /proc/version; then echo 'android'; return - fi - + fi + if $GREP -q 'android.google' /proc/version; then echo 'android'; return fi - + if $GREP -q 'adelielinux' /proc/version; then echo 'adelie'; return fi - + if $GREP -q 'CDlinux' /proc/cmdline; then echo 'cdlinux'; return fi - + if $GREP -q 'parabola' /proc/version; then echo 'parabola'; return fi - + if $GREP -q 'cucumber' /proc/version; then echo 'cucumber'; return fi - + if $GREP -q 'fatdog' /proc/version; then echo 'fatdog'; return fi - + if $GREP -q 'KWORT' /proc/version; then echo 'kwort'; return fi - + if $GREP -q 'iwamoto' /proc/version; then echo 'vine'; return fi - + if $GREP -q 'hyperbola' /proc/cmdline; then echo 'hyperbola'; return fi - + if $GREP -q 'CRUX' /proc/version; then echo 'crux'; return fi - + if [ -f /init ]; then if $GREP -q 'AryaLinux' /init; then echo 'aryalinux'; return elif $GREP -q 'Dragora' /init; then echo 'dragora'; return - + fi fi - + if $GREP -q 'slackware' /proc/version; then echo 'slackware'; return fi - + if $BUSYBOX_PATH/hostname | $GREP -q 'smoothwall'; then echo 'smoothwall'; return - fi - + fi + if $GREP -q 'photon' /proc/version; then echo 'photon'; return fi - + if $GREP -q 'ploplinux' /proc/version; then echo 'ploplinux'; return fi - + if $GREP -q 'lunar' /proc/version; then echo 'lunar'; return fi - + if $GREP -q 'SMGL-' /proc/version; then echo 'smgl'; return fi - + if $GREP -q 'rancher' /proc/version; then echo 'rancher'; return fi - - + + if [ -e /init ]; then if $GREP -q -m1 'T2 SDE' /init; then echo 't2'; return fi fi - + if $GREP -q 'wifislax' /proc/version; then echo 'wifislax'; return fi - + if $GREP -q 'pisilinux' /proc/version; then echo 'pisilinux'; return fi - + if $GREP -q 'blackPanther' /proc/version; then echo 'blackPanther'; return fi - + if $GREP -q 'primeos' /proc/version; then echo 'primeos'; return fi - + if $GREP -q 'austrumi' /proc/version; then echo 'austrumi'; return fi - + if [ -f /DISTRO_SPECS ]; then if $GREP -q '[Pp]uppy' /DISTRO_SPECS; then echo 'debian'; return @@ -345,12 +345,12 @@ ventoy_get_os_type() { echo 'debian'; return fi fi - + if [ -f /etc/openEuler-release ]; then echo "openEuler"; return fi - - + + #special arch based iso file check if [ -f /init ]; then if $GREP -q 'mount_handler' /init; then @@ -365,33 +365,33 @@ ventoy_get_os_type() { fi fi fi - - + + #Kylin V10 Server if [ -f /usr/sbin/dhclient ]; then if $BUSYBOX_PATH/strings /usr/sbin/dhclient | $GREP -i -q -m1 openeuler; then echo 'openEuler'; return fi fi - + if $GREP -q 'chimera' /proc/version; then echo 'chimera'; return fi - + if $GREP -q '4.19.' /proc/version; then if [ -d /lib/dracut/hooks ]; then echo 'openEuler'; return fi fi - + if [ -f /etc/tinyramfs/config ]; then if $GREP -q 'EWE_ISO' /etc/tinyramfs/config; then echo "ewe"; return fi fi - - + + echo "default" } @@ -411,7 +411,7 @@ if $GREP -q -i Untangle /proc/version; then vtEnvExport="$vtEnvExport $vtItemkey=$vtItemVal" fi done - + echo "================ env export ================" >> $VTLOG echo $vtEnvExport >> $VTLOG echo "============================================" >> $VTLOG @@ -439,7 +439,7 @@ if [ "$VTOY_BREAK_LEVEL" = "03" ] || [ "$VTOY_BREAK_LEVEL" = "13" ]; then echo -e "\n\n\033[32m ################################################# \033[0m" echo -e "\033[32m ################ VENTOY DEBUG ################### \033[0m" echo -e "\033[32m ################################################# \033[0m \n" - if [ "$VTOY_BREAK_LEVEL" = "13" ]; then + if [ "$VTOY_BREAK_LEVEL" = "13" ]; then $CAT $VTOY_PATH/log fi exec $BUSYBOX_PATH/sh @@ -477,12 +477,12 @@ for vtinit in $user_rdinit /init /sbin/init /linuxrc; do if [ -f "$VTOY_PATH/hook/$VTOS/ventoy-before-init.sh" ]; then $BUSYBOX_PATH/sh "$VTOY_PATH/hook/$VTOS/ventoy-before-init.sh" fi - + if [ -z "$vtEnvExport" ]; then exec "$vtinit" else exec env $vtEnvExport "$vtinit" - fi + fi fi fi done diff --git a/IMG/cpio/ventoy/ventoy_loop.sh b/IMG/cpio/ventoy/ventoy_loop.sh index ee8ceedce3c..f367051fff0 100644 --- a/IMG/cpio/ventoy/ventoy_loop.sh +++ b/IMG/cpio/ventoy/ventoy_loop.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ #################################################################### @@ -70,31 +70,31 @@ ventoy_get_os_type() { if $GREP -q 'endless' /proc/version; then echo 'endless'; return fi - + if $GREP -q 'OpenWrt' /proc/version; then echo 'openwrt'; return fi - + if $GREP -q 'easyos' /proc/cmdline; then echo 'easyos'; return fi - + if [ -e /BOOT_SPECS ]; then if $GREP -q 'easyos' /BOOT_SPECS; then echo 'easyos'; return fi fi - + if [ -e /etc/os-release ]; then if $GREP -q 'volumio' /etc/os-release; then echo 'volumio'; return fi fi - + if $GREP -q 'ventoyos=' /proc/cmdline; then - $SED "s/.*ventoyos=\([a-zA-Z0-9_-]*\).*/\1/" /proc/cmdline; return - fi - + $SED "s/.*ventoyos=\([a-zA-Z0-9_-]*\).*/\1/" /proc/cmdline; return + fi + if [ -d /twres ]; then if $GREP -q 'Phoenix' /init; then echo 'phoenixos'; return @@ -116,80 +116,80 @@ ventoy_get_os_type() { # rhel7/CentOS7/rhel8/CentOS8 and all other distributions based on them elif $GREP -q 'el[78]' /proc/version; then - echo 'rhel7'; return + echo 'rhel7'; return # Maybe rhel9 rhel1x use the same way? Who knows! elif $EGREP -q 'el9|el1[0-9]' /proc/version; then - echo 'rhel7'; return - + echo 'rhel7'; return + # Fedora : do the same process with rhel7 elif $GREP -q '\.fc[0-9][0-9]\.' /proc/version; then echo 'rhel7'; return - + # Debian : elif $GREP -q '[Dd]ebian' /proc/version; then echo 'debian'; return - + # Ubuntu : do the same process with debian elif $GREP -q '[Uu]buntu' /proc/version; then echo 'debian'; return - + # Deepin : do the same process with debian elif $GREP -q '[Dd]eepin' /proc/version; then - echo 'debian'; return + echo 'debian'; return # SUSE elif $GREP -q 'SUSE' /proc/version; then echo 'suse'; return - + # ArchLinux elif $EGREP -q 'archlinux|ARCH' /proc/version; then echo 'arch'; return - + # kiosk elif $EGREP -q 'kiosk' /proc/version; then echo 'kiosk'; return - + # gentoo elif $EGREP -q '[Gg]entoo' /proc/version; then if $GREP -q 'daphile' /proc/version; then echo 'daphile'; return fi - + echo 'gentoo'; return - + # TinyCore elif $EGREP -q 'tinycore' /proc/version; then echo 'tinycore'; return - + # manjaro elif $EGREP -q 'manjaro|MANJARO' /proc/version; then echo 'manjaro'; return - + # mageia elif $EGREP -q 'mageia' /proc/version; then echo 'mageia'; return - + # pclinux OS elif $GREP -i -q 'PCLinuxOS' /proc/version; then echo 'pclos'; return - + # KaOS elif $GREP -i -q 'kaos' /proc/version; then echo 'kaos'; return - + # Alpine elif $GREP -q 'Alpine' /proc/version; then echo 'alpine'; return elif $GREP -i -q 'PhoenixOS' /proc/version; then echo 'phoenixos'; return - + # NixOS elif $GREP -i -q 'NixOS' /proc/version; then echo 'nixos'; return - - + + fi if [ -e /lib/debian-installer ]; then @@ -200,7 +200,7 @@ ventoy_get_os_type() { if $GREP -q 'XenServer' /etc/os-release; then echo 'xen'; return elif $GREP -q 'SUSE ' /etc/os-release; then - echo 'suse'; return + echo 'suse'; return elif $GREP -q 'uruk' /etc/os-release; then echo 'debian'; return elif $GREP -q 'Solus' /etc/os-release; then @@ -215,161 +215,161 @@ ventoy_get_os_type() { echo 'debian'; return fi fi - + if $BUSYBOX_PATH/dmesg | $GREP -q -m1 "Xen:"; then echo 'xen'; return fi - - + + if [ -e /etc/HOSTNAME ] && $GREP -i -q 'slackware' /etc/HOSTNAME; then echo 'slackware'; return fi - + if [ -e /init ]; then if $GREP -i -q zeroshell /init; then echo 'zeroshell'; return fi fi - + if $EGREP -q 'ALT ' /proc/version; then echo 'alt'; return fi - + if $EGREP -q 'porteus' /proc/version; then echo 'debian'; return fi - + if $GREP -q 'Clear Linux ' /proc/version; then echo 'clear'; return fi - + if $GREP -q 'artix' /proc/version; then echo 'arch'; return fi - + if $GREP -q 'berry ' /proc/version; then echo 'berry'; return fi - + if $GREP -q 'Gobo ' /proc/version; then echo 'gobo'; return fi - + if $GREP -q 'NuTyX' /proc/version; then echo 'nutyx'; return fi - + if [ -d /gnu ]; then vtLineNum=$($FIND /gnu/ -name guix | $BUSYBOX_PATH/wc -l) if [ $vtLineNum -gt 0 ]; then echo 'guix'; return fi fi - + if $GREP -q 'android.x86' /proc/version; then echo 'android'; return - fi - + fi + if $GREP -q 'adelielinux' /proc/version; then echo 'adelie'; return fi - + if $GREP -q 'CDlinux' /proc/cmdline; then echo 'cdlinux'; return fi - + if $GREP -q 'parabola' /proc/version; then echo 'parabola'; return fi - + if $GREP -q 'cucumber' /proc/version; then echo 'cucumber'; return fi - + if $GREP -q 'fatdog' /proc/version; then echo 'fatdog'; return fi - + if $GREP -q 'KWORT' /proc/version; then echo 'kwort'; return fi - + if $GREP -q 'iwamoto' /proc/version; then echo 'vine'; return fi - + if $GREP -q 'hyperbola' /proc/cmdline; then echo 'hyperbola'; return fi - + if $GREP -q 'CRUX' /proc/version; then echo 'crux'; return fi - + if [ -f /init ]; then if $GREP -q 'AryaLinux' /init; then echo 'aryalinux'; return elif $GREP -q 'Dragora' /init; then echo 'dragora'; return - + fi fi - + if $GREP -q 'slackware' /proc/version; then echo 'slackware'; return fi - + if $BUSYBOX_PATH/hostname | $GREP -q 'smoothwall'; then echo 'smoothwall'; return - fi - + fi + if $GREP -q 'photon' /proc/version; then echo 'photon'; return fi - + if $GREP -q 'ploplinux' /proc/version; then echo 'ploplinux'; return fi - + if $GREP -q 'lunar' /proc/version; then echo 'lunar'; return fi - + if $GREP -q 'SMGL-' /proc/version; then echo 'smgl'; return fi - + if $GREP -q 'rancher' /proc/version; then echo 'rancher'; return fi - - + + if [ -e /init ]; then if $GREP -q -m1 'T2 SDE' /init; then echo 't2'; return fi fi - + if $GREP -q 'wifislax' /proc/version; then echo 'wifislax'; return fi - + if $GREP -q 'pisilinux' /proc/version; then echo 'pisilinux'; return fi - + if $GREP -q 'blackPanther' /proc/version; then echo 'blackPanther'; return fi - + if $GREP -q 'primeos' /proc/version; then echo 'primeos'; return fi - + if $GREP -q 'austrumi' /proc/version; then echo 'austrumi'; return fi - + if [ -f /DISTRO_SPECS ]; then if $GREP -q '[Pp]uppy' /DISTRO_SPECS; then echo 'debian'; return @@ -377,11 +377,11 @@ ventoy_get_os_type() { echo 'debian'; return fi fi - + if [ -f /etc/openEuler-release ]; then echo "openEuler"; return fi - + echo "default" } @@ -404,7 +404,7 @@ if [ "$VTOY_BREAK_LEVEL" = "03" ] || [ "$VTOY_BREAK_LEVEL" = "13" ]; then echo -e "\n\n\033[32m ################################################# \033[0m" echo -e "\033[32m ################ VENTOY DEBUG ################### \033[0m" echo -e "\033[32m ################################################# \033[0m \n" - if [ "$VTOY_BREAK_LEVEL" = "13" ]; then + if [ "$VTOY_BREAK_LEVEL" = "13" ]; then $CAT $VTOY_PATH/log fi exec $BUSYBOX_PATH/sh diff --git a/IMG/cpio_x86/ventoy/tool/ventoy_loader.sh b/IMG/cpio_x86/ventoy/tool/ventoy_loader.sh index 5844cbd78a9..df275799c77 100644 --- a/IMG/cpio_x86/ventoy/tool/ventoy_loader.sh +++ b/IMG/cpio_x86/ventoy/tool/ventoy_loader.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ exec /ventoy/busybox/sh diff --git a/IMG/cpio_x86/ventoy/tool/vtoytool_install.sh b/IMG/cpio_x86/ventoy/tool/vtoytool_install.sh index 1ccadd16bc5..6d86246ba92 100644 --- a/IMG/cpio_x86/ventoy/tool/vtoytool_install.sh +++ b/IMG/cpio_x86/ventoy/tool/vtoytool_install.sh @@ -1,20 +1,20 @@ #!/ventoy/busybox/sh #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ echo "#### install vtoytool #####" >> $VTLOG @@ -35,9 +35,9 @@ if $GREP -q aarch64 $VTOY_PATH/ventoy_arch; then if $VTOY_PATH/tool/vtoytool/$vtdir/vtoytool_aa64 --install 2>>$VTLOG; then echo "vtoytool_aa64 OK" >> $VTLOG break - fi + fi done - + $BUSYBOX_PATH/cp -a $VTOY_PATH/tool/vtoy_fuse_iso_aa64 $VTOY_PATH/tool/vtoy_fuse_iso $BUSYBOX_PATH/cp -a $VTOY_PATH/tool/unsquashfs_aa64 $VTOY_PATH/tool/vtoy_unsquashfs elif $GREP -q mips64el $VTOY_PATH/ventoy_arch; then @@ -46,12 +46,12 @@ elif $GREP -q mips64el $VTOY_PATH/ventoy_arch; then if $VTOY_PATH/tool/vtoytool/$vtdir/vtoytool_m64e --install 2>>$VTLOG; then echo "vtoytool_m64e OK" >> $VTLOG break - fi + fi done - + # TBD #$BUSYBOX_PATH/cp -a $VTOY_PATH/tool/vtoy_fuse_iso_aa64 $VTOY_PATH/tool/vtoy_fuse_iso - #$BUSYBOX_PATH/cp -a $VTOY_PATH/tool/unsquashfs_aa64 $VTOY_PATH/tool/vtoy_unsquashfs + #$BUSYBOX_PATH/cp -a $VTOY_PATH/tool/unsquashfs_aa64 $VTOY_PATH/tool/vtoy_unsquashfs else for vtdir in $(ls $VTOY_PATH/tool/vtoytool/); do echo "try $VTOY_PATH/tool/vtoytool/$vtdir/ ..." >> $VTLOG @@ -59,18 +59,18 @@ else echo "vtoytool_64 OK" >> $VTLOG break fi - + if $VTOY_PATH/tool/vtoytool/$vtdir/vtoytool_32 --install 2>>$VTLOG; then echo "vtoytool_32 OK" >> $VTLOG break fi done - + if $VTOY_PATH/tool/vtoy_fuse_iso_64 -t 2>>$VTLOG; then echo "use vtoy_fuse_iso_64" >>$VTLOG $BUSYBOX_PATH/cp -a $VTOY_PATH/tool/vtoy_fuse_iso_64 $VTOY_PATH/tool/vtoy_fuse_iso else - echo "use vtoy_fuse_iso_32" >>$VTLOG + echo "use vtoy_fuse_iso_32" >>$VTLOG $BUSYBOX_PATH/cp -a $VTOY_PATH/tool/vtoy_fuse_iso_32 $VTOY_PATH/tool/vtoy_fuse_iso fi @@ -78,18 +78,18 @@ else echo "use unsquashfs_64" >>$VTLOG $BUSYBOX_PATH/cp -a $VTOY_PATH/tool/unsquashfs_64 $VTOY_PATH/tool/vtoy_unsquashfs else - echo "use unsquashfs_32" >>$VTLOG + echo "use unsquashfs_32" >>$VTLOG $BUSYBOX_PATH/cp -a $VTOY_PATH/tool/unsquashfs_32 $VTOY_PATH/tool/vtoy_unsquashfs fi if $GREP -q 64 $VTOY_PATH/ventoy_arch; then - echo "use veritysetup64" >>$VTLOG + echo "use veritysetup64" >>$VTLOG if [ -f $VTOY_PATH/tool/veritysetup64 ]; then $BUSYBOX_PATH/cp -a $VTOY_PATH/tool/veritysetup64 $VTOY_PATH/tool/veritysetup fi else - echo "use veritysetup32" >>$VTLOG - + echo "use veritysetup32" >>$VTLOG + if [ -f $VTOY_PATH/tool/veritysetup32 ]; then $BUSYBOX_PATH/cp -a $VTOY_PATH/tool/veritysetup32 $VTOY_PATH/tool/veritysetup fi diff --git a/IMG/mkcpio.sh b/IMG/mkcpio.sh index c204336551b..5b482d3c0e7 100644 --- a/IMG/mkcpio.sh +++ b/IMG/mkcpio.sh @@ -10,7 +10,7 @@ fi ############### cpio ############ chmod -R 777 cpio -rm -f ventoy.cpio ventoy_x86.cpio ventoy_arm64.cpio ventoy_mips64.cpio +rm -f ventoy.cpio ventoy_x86.cpio ventoy_arm64.cpio ventoy_mips64.cpio cp -a cpio cpio_tmp diff --git a/IMG/mkloopex.sh b/IMG/mkloopex.sh index 1a87dec6b85..2c4fc010a23 100644 --- a/IMG/mkloopex.sh +++ b/IMG/mkloopex.sh @@ -8,8 +8,8 @@ cd vtloopex_tmp for dir in $(ls); do - cd $dir - tar -cJf vtloopex.tar.xz vtloopex + cd $dir + tar -cJf vtloopex.tar.xz vtloopex rm -rf vtloopex cd .. done diff --git a/INSTALL/CreatePersistentImg.sh b/INSTALL/CreatePersistentImg.sh index 21d65c47bf1..ccd15d86beb 100644 --- a/INSTALL/CreatePersistentImg.sh +++ b/INSTALL/CreatePersistentImg.sh @@ -14,7 +14,7 @@ print_usage() { echo ' -l label, default is casper-rw' echo ' -c configfile name inside the persistence file. File content is "/ union"' echo ' -o outputfile name, default is persistence.dat' - echo ' -e enable encryption, disabled by default (only few distros support this)' + echo ' -e enable encryption, disabled by default (only few distros support this)' echo '' } @@ -72,11 +72,11 @@ if echo $size | grep -q "^[0-9][0-9]*$"; then if echo $fstype | grep -q '^xfs$'; then vtMinSize=16 fi - + if [ $size -lt $vtMinSize ]; then echo "size too small ($size)" exit 1 - fi + fi else echo "Invalid size $size" exit 1 @@ -85,7 +85,7 @@ fi # check file system type # nodiscard must be set for ext2/3/4 -# -K must be set for xfs +# -K must be set for xfs if echo $fstype | grep -q '^ext[234]$'; then fsopt='-E nodiscard' elif [ "$fstype" = "xfs" ]; then @@ -114,7 +114,7 @@ if [ ! -z "$passphrase" ]; then freeloop="/dev/mapper/persist_decrypted" fi -mkfs -t $fstype $fsopt -L $label $freeloop +mkfs -t $fstype $fsopt -L $label $freeloop sync @@ -122,7 +122,7 @@ if [ -n "$config" ]; then if [ -d ./persist_tmp_mnt ]; then rm -rf ./persist_tmp_mnt fi - + mkdir ./persist_tmp_mnt if mount $freeloop ./persist_tmp_mnt; then echo '/ union' > ./persist_tmp_mnt/$config diff --git a/INSTALL/ExtendPersistentImg.sh b/INSTALL/ExtendPersistentImg.sh index 5f8b852f5f6..de7b32852cb 100644 --- a/INSTALL/ExtendPersistentImg.sh +++ b/INSTALL/ExtendPersistentImg.sh @@ -113,7 +113,7 @@ fi freeloop=$(losetup -f) losetup $freeloop "$file" -if [ "$cmd" = "resize2fs" ]; then +if [ "$cmd" = "resize2fs" ]; then echo "$mode ext filesystem by resize2fs ..." echo "resize2fs $freeloop ${total}M" e2fsck -f $freeloop diff --git a/INSTALL/README b/INSTALL/README index 989e10ade11..90ee6c34766 100644 --- a/INSTALL/README +++ b/INSTALL/README @@ -8,17 +8,17 @@ Ventoy2Disk.sh CMD [ OPTION ] /dev/sdX -i install ventoy to sdX (fail if disk already installed with ventoy) -I force install ventoy to sdX (no matter installed or not) -u update ventoy in sdX - + OPTION: (optional) -r SIZE_MB preserve some space at the bottom of the disk (only for install) -s enable secure boot support (default is disabled) -g use GPT partition style, default is MBR style (only for install) -Please refer https://www.ventoy.net/en/doc_start.html for details. +Please refer https://www.ventoy.net/en/doc_start.html for details. ========== VentoyWeb.sh =============== -1. sudo bash VentoyWeb.sh +1. sudo bash VentoyWeb.sh 2. open your browser and visit http://127.0.0.1:24680 @@ -55,7 +55,7 @@ Please refer https://www.ventoy.net/en/plugin_persistence.html for details. ========== ExtendPersistentImg.sh =============== -sudo bash ExtendPersistentImg.sh file size +sudo bash ExtendPersistentImg.sh file size For example: bash ExtendPersistentImg.sh persistence.dat 2048 ----> Extend persistence.dat by 2048MB That is to say, persistence.dat file will grow to 3GB size (assume that it is 1GB size before extend) diff --git a/INSTALL/Ventoy2Disk.sh b/INSTALL/Ventoy2Disk.sh index f08ab1090a2..793a1faa3d6 100644 --- a/INSTALL/Ventoy2Disk.sh +++ b/INSTALL/Ventoy2Disk.sh @@ -4,12 +4,12 @@ OLDDIR=$(pwd) if ! [ -f ./tool/ventoy_lib.sh ]; then if [ -f ${0%Ventoy2Disk.sh}/tool/ventoy_lib.sh ]; then - cd ${0%Ventoy2Disk.sh} + cd ${0%Ventoy2Disk.sh} fi fi if [ -f ./ventoy/version ]; then - curver=$(cat ./ventoy/version) + curver=$(cat ./ventoy/version) fi if uname -m | grep -E -q 'aarch64|arm64'; then @@ -37,7 +37,7 @@ if ! [ -f ./boot/boot.img ]; then if [ -d ./grub ]; then echo "Don't run Ventoy2Disk.sh here, please download the released install package, and run the script in it." else - echo "Please run under the correct directory!" + echo "Please run under the correct directory!" fi exit 1 fi @@ -71,7 +71,7 @@ else ash ./tool/VentoyWorker.sh $* fi -if [ -n "$OLDDIR" ]; then +if [ -n "$OLDDIR" ]; then CURDIR=$(pwd) if [ "$CURDIR" != "$OLDDIR" ]; then cd "$OLDDIR" diff --git a/INSTALL/VentoyPlugson.sh b/INSTALL/VentoyPlugson.sh index 255c5f6512c..906be4eb55e 100644 --- a/INSTALL/VentoyPlugson.sh +++ b/INSTALL/VentoyPlugson.sh @@ -2,7 +2,7 @@ . ./tool/ventoy_lib.sh -print_usage() { +print_usage() { echo 'Usage: sudo bash VentoyPlugson.sh [OPTION] /dev/sdX' echo ' OPTION: (optional)' echo ' -H x.x.x.x http server IP address (default is 127.0.0.1)' @@ -39,13 +39,13 @@ elif echo $machine | grep -E -q 'mips64'; then elif echo $machine | grep -E -q 'i[3-6]86'; then TOOLDIR=i386 else - echo "Unsupported machine type $machine" + echo "Unsupported machine type $machine" exit 1 fi if ! [ -f "$OLDDIR/tool/plugson.tar.xz" ]; then - echo "Please run under the correct directory!" + echo "Please run under the correct directory!" exit 1 fi @@ -71,7 +71,7 @@ cd ../../ chmod +x -R ./tool/$TOOLDIR if ! [ -f "$OLDDIR/tool/$TOOLDIR/Plugson" ]; then - echo "$OLDDIR/tool/$TOOLDIR/Plugson does not exist!" + echo "$OLDDIR/tool/$TOOLDIR/Plugson does not exist!" exit 1 fi @@ -104,7 +104,7 @@ while [ -n "$1" ]; do else DISK=$1 fi - + shift done @@ -138,9 +138,9 @@ fi version=$(get_disk_ventoy_version $DISK) if [ $? -eq 0 ]; then echo "Ventoy version in Disk: $version" - + vtPart1Type=$(dd if=$DISK bs=1 count=1 skip=450 status=none | hexdump -n1 -e '1/1 "%02X"') - if [ "$vtPart1Type" = "EE" ]; then + if [ "$vtPart1Type" = "EE" ]; then echo "Disk Partition Style : GPT" partstyle=1 else @@ -165,15 +165,15 @@ PART1=$(get_disk_part_name $DISK 1) if grep -q "^$PART1 " /proc/mounts; then mtpnt=$(grep "^$PART1 " /proc/mounts | awk '{print $2}' | sed 's/\\040/ /g') fstype=$(grep "^$PART1 " /proc/mounts | awk '{print $3}') - + if echo $fstype | grep -q -i 'fuse'; then if hexdump -C -n 16 $PART1 | grep -q -i "EXFAT"; then fstype="exFAT" elif hexdump -C -n 16 $PART1 | grep -q -i "NTFS"; then - fstype="NTFS" + fstype="NTFS" fi fi - + echo "$PART1 is mounted at $mtpnt $fstype" else echo "$PART1 is NOT mounted, please mount it first!" @@ -219,7 +219,7 @@ if [ -f /proc/$wID/maps ]; then fi -if [ -n "$OLDDIR" ]; then +if [ -n "$OLDDIR" ]; then CURDIR=$(pwd) if [ "$CURDIR" != "$OLDDIR" ]; then cd "$OLDDIR" diff --git a/INSTALL/VentoyWeb.sh b/INSTALL/VentoyWeb.sh index 537348aac58..c2b1b31ed8d 100644 --- a/INSTALL/VentoyWeb.sh +++ b/INSTALL/VentoyWeb.sh @@ -1,7 +1,7 @@ #!/bin/bash -print_usage() { - echo 'Usage: VentoyWeb.sh [ OPTION ]' +print_usage() { + echo 'Usage: VentoyWeb.sh [ OPTION ]' echo ' OPTION: (optional)' echo ' -H x.x.x.x http server IP address (default is 127.0.0.1)' echo ' -p PORT http server PORT (default is 24680)' @@ -46,7 +46,7 @@ if [ ! -f ./boot/boot.img ]; then echo "Don't run VentoyWeb.sh here, please download the released install package, and run the script in it." else echo "Current directory is $PWD" - echo "Please run under the correct directory!" + echo "Please run under the correct directory!" fi exit 1 fi @@ -65,7 +65,7 @@ while [ -n "$1" ]; do else print_err "Invalid host $1" exit 1 - fi + fi elif [ "$1" = "-p" ]; then shift if [ $1 -gt 0 -a $1 -le 65535 ]; then @@ -75,7 +75,7 @@ while [ -n "$1" ]; do exit 1 fi fi - + shift done @@ -122,7 +122,7 @@ echo "" wait $wID -if [ -n "$OLDDIR" ]; then +if [ -n "$OLDDIR" ]; then CURDIR=$(pwd) if [ "$CURDIR" != "$OLDDIR" ]; then cd "$OLDDIR" diff --git a/INSTALL/grub/checksum.cfg b/INSTALL/grub/checksum.cfg index df045ec5ff4..5f0ae9104a2 100644 --- a/INSTALL/grub/checksum.cfg +++ b/INSTALL/grub/checksum.cfg @@ -1,6 +1,6 @@ unset vtchkdef -vt_vtoychksum_exist "${VTOY_CHKSUM_FILE_PATH}" +vt_vtoychksum_exist "${VTOY_CHKSUM_FILE_PATH}" if [ "$VT_EXIST_MD5" = "1" ]; then if [ -z "$vtchkdef" ]; then @@ -8,7 +8,7 @@ if [ "$VT_EXIST_MD5" = "1" ]; then set vtchkdef=1 fi menuentry "$VTLANG_CHKSUM_MD5_CALC_CHK" --class=checksum_md5 { - md5sum "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}" + md5sum "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}" vt_cmp_checksum 0 "${VTOY_CHKSUM_FILE_PATH}" echo -en "\n\n$VTLANG_ENTER_EXIT ..." @@ -17,7 +17,7 @@ if [ "$VT_EXIST_MD5" = "1" ]; then else menuentry "$VTLANG_CHKSUM_MD5_CALC" --class=checksum_md5 { md5sum "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}" - + echo -en "\n\n$VTLANG_ENTER_EXIT ..." read vtInputKey } @@ -30,15 +30,15 @@ if [ "$VT_EXIST_SHA1" = "1" ]; then fi menuentry "$VTLANG_CHKSUM_SHA1_CALC_CHK" --class=checksum_sha1 { sha1sum "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}" - vt_cmp_checksum 1 "${VTOY_CHKSUM_FILE_PATH}" - + vt_cmp_checksum 1 "${VTOY_CHKSUM_FILE_PATH}" + echo -en "\n\n$VTLANG_ENTER_EXIT ..." read vtInputKey } else menuentry "$VTLANG_CHKSUM_SHA1_CALC" --class=checksum_sha1 { sha1sum "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}" - + echo -en "\n\n$VTLANG_ENTER_EXIT ..." read vtInputKey } @@ -53,15 +53,15 @@ if [ "$VT_EXIST_SHA256" = "1" ]; then fi menuentry "$VTLANG_CHKSUM_SHA256_CALC_CHK" --class=checksum_sha256 { sha256sum "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}" - vt_cmp_checksum 2 "${VTOY_CHKSUM_FILE_PATH}" - + vt_cmp_checksum 2 "${VTOY_CHKSUM_FILE_PATH}" + echo -en "\n\n$VTLANG_ENTER_EXIT ..." read vtInputKey } else menuentry "$VTLANG_CHKSUM_SHA256_CALC" --class=checksum_sha256 { sha256sum "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}" - + echo -en "\n\n$VTLANG_ENTER_EXIT ..." read vtInputKey } @@ -76,15 +76,15 @@ if [ "$VT_EXIST_SHA512" = "1" ]; then fi menuentry "$VTLANG_CHKSUM_SHA512_CALC_CHK" --class=checksum_sha512{ sha512sum "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}" - vt_cmp_checksum 3 "${VTOY_CHKSUM_FILE_PATH}" - + vt_cmp_checksum 3 "${VTOY_CHKSUM_FILE_PATH}" + echo -en "\n\n$VTLANG_ENTER_EXIT ..." read vtInputKey } else menuentry "$VTLANG_CHKSUM_SHA512_CALC" --class=checksum_sha512{ sha512sum "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}" - + echo -en "\n\n$VTLANG_ENTER_EXIT ..." read vtInputKey } diff --git a/INSTALL/grub/debug.cfg b/INSTALL/grub/debug.cfg index 09b1992f898..e084a6e7600 100644 --- a/INSTALL/grub/debug.cfg +++ b/INSTALL/grub/debug.cfg @@ -11,7 +11,7 @@ submenu "$VTLANG_CTRL_TEMP_SET" --class=debug_temp_set --class=F5tool { set VTOY_WIN11_BYPASS_CHECK=0 fi } - + menuentry "[ $VTOY_WIN11_BYPASS_NRO ] $VTLANG_WIN11_BYPASS_NRO" --class=debug_temp_win11_nro --class=debug_temp_set --class=F5tool \ VTOY_RUN_SET1 { if [ "$VTOY_WIN11_BYPASS_NRO" = "0" ]; then @@ -19,8 +19,8 @@ submenu "$VTLANG_CTRL_TEMP_SET" --class=debug_temp_set --class=F5tool { else set VTOY_WIN11_BYPASS_NRO=0 fi - } - + } + menuentry "[ $VTOY_SECONDARY_BOOT_MENU ] $VTLANG_SECONDARY_BOOT_MENU" --class=debug_temp_second_menu --class=debug_temp_set --class=F5tool \ VTOY_RUN_SET3 { if [ "$VTOY_SECONDARY_BOOT_MENU" = "0" ]; then @@ -48,21 +48,21 @@ submenu "$VTLANG_RESOLUTION_CFG" --class=debug_resolution --class=F5tool { menuentry "$VTLANG_RETURN_PREVIOUS" --class=vtoyret VTOY_RET { echo "Return ..." } - + vt_update_cur_video_mode VT_CUR_MODE set vdid=0 while [ $vdid -lt $VTOY_VIDEO_MODE_NUM ]; do vt_get_video_mode $vdid vtCurMode - + unset vtActive if [ "$vtCurMode" = "$VT_CUR_MODE" ]; then set vtActive="[*]" fi - + menuentry "$vtCurMode $vtActive" --class=debug_videomode --class=debug_resolution --class=F5tool VTOY_RUN_RET { terminal_output console set gfxmode=$1 - terminal_output gfxterm + terminal_output gfxterm if [ "$vtoy_res_fit" = "1" ]; then vt_set_theme switch fi @@ -102,7 +102,7 @@ if [ "$grub_platform" != "pc" ]; then echo -en "\n$VTLANG_ENTER_EXIT ..." read vtInputKey } - + menuentry "$VTLANG_UTIL_FIX_BLINIT_FAIL" --class=debug_util_blinit --class=debug_util --class=F5tool { chainloader ${vtoy_path}/vtoyutil_${VTOY_EFI_ARCH}.efi env_param=${env_param} ${vtdebug_flag} feature=fix_windows_mmap boot @@ -121,132 +121,132 @@ submenu "$VTLANG_JSON_CHK_JSON" --class=debug_json --class=F5tool { menuentry "$VTLANG_JSON_CHK_CONTROL" --class=debug_control --class=debug_json --class=F5tool { set pager=1 vt_check_plugin_json $vt_plugin_path control $vtoy_iso_part - + echo -en "\n$VTLANG_ENTER_EXIT ..." read vtInputKey unset pager } - + menuentry "$VTLANG_JSON_CHK_THEME" --class=debug_theme --class=debug_json --class=F5tool { set pager=1 vt_check_plugin_json $vt_plugin_path theme $vtoy_iso_part - + echo -en "\n$VTLANG_ENTER_EXIT ..." read vtInputKey unset pager } - + menuentry "$VTLANG_JSON_CHK_AUTOINS" --class=debug_autoinstall --class=debug_json --class=F5tool { set pager=1 vt_check_plugin_json $vt_plugin_path auto_install $vtoy_iso_part - + echo -en "\n$VTLANG_ENTER_EXIT ..." read vtInputKey unset pager } - + menuentry "$VTLANG_JSON_CHK_PERSIST" --class=debug_persistence --class=debug_json --class=F5tool { set pager=1 vt_check_plugin_json $vt_plugin_path persistence $vtoy_iso_part - + echo -e "\n############### dump persistence ###############" vt_dump_persistence - + echo -en "\n$VTLANG_ENTER_EXIT ..." read vtInputKey unset pager } - + menuentry "$VTLANG_JSON_CHK_MENU_ALIAS" --class=debug_menualias --class=debug_json --class=F5tool { set pager=1 vt_check_plugin_json $vt_plugin_path menu_alias $vtoy_iso_part - + echo -en "\n$VTLANG_ENTER_EXIT ..." read vtInputKey unset pager } - + menuentry "$VTLANG_JSON_CHK_MENU_TIP" --class=debug_menutip --class=debug_json --class=F5tool { set pager=1 vt_check_plugin_json $vt_plugin_path menu_tip $vtoy_iso_part - + echo -en "\n$VTLANG_ENTER_EXIT ..." read vtInputKey unset pager } - + menuentry "$VTLANG_JSON_CHK_MENU_CLASS" --class=debug_menuclass --class=debug_json --class=F5tool { set pager=1 vt_check_plugin_json $vt_plugin_path menu_class $vtoy_iso_part - + echo -en "\n$VTLANG_ENTER_EXIT ..." read vtInputKey unset pager - } + } menuentry "$VTLANG_JSON_CHK_INJECTION" --class=debug_injection --class=debug_json --class=F5tool { set pager=1 vt_check_plugin_json $vt_plugin_path injection $vtoy_iso_part - + echo -en "\n$VTLANG_ENTER_EXIT ..." read vtInputKey unset pager - } + } menuentry "$VTLANG_JSON_CHK_AUTO_MEMDISK" --class=debug_automemdisk --class=debug_json --class=F5tool { set pager=1 vt_check_plugin_json $vt_plugin_path auto_memdisk $vtoy_iso_part - + echo -en "\n$VTLANG_ENTER_EXIT ..." read vtInputKey unset pager - } + } menuentry "$VTLANG_JSON_CHK_IMG_LIST" --class=debug_imagelist --class=debug_json --class=F5tool { set pager=1 vt_check_plugin_json $vt_plugin_path image_list $vtoy_iso_part - + echo -en "\n$VTLANG_ENTER_EXIT ..." read vtInputKey unset pager } - + menuentry "$VTLANG_JSON_CHK_IMG_BLIST" --class=debug_imageblacklist --class=debug_json --class=F5tool { set pager=1 vt_check_plugin_json $vt_plugin_path image_blacklist $vtoy_iso_part - + echo -en "\n$VTLANG_ENTER_EXIT ..." read vtInputKey unset pager } - + menuentry "$VTLANG_JSON_CHK_CONF_REPLACE" --class=debug_bootconf_replace --class=debug_json --class=F5tool { set pager=1 vt_check_plugin_json $vt_plugin_path conf_replace $vtoy_iso_part - + echo -en "\n$VTLANG_ENTER_EXIT ..." read vtInputKey unset pager } - + menuentry "$VTLANG_JSON_CHK_DUD" --class=debug_dud --class=debug_json --class=F5tool { set pager=1 vt_check_plugin_json $vt_plugin_path dud $vtoy_iso_part - + echo -en "\n$VTLANG_ENTER_EXIT ..." read vtInputKey unset pager } - + menuentry "$VTLANG_JSON_CHK_PASSWORD" --class=debug_pwd --class=debug_json --class=F5tool { set pager=1 vt_check_plugin_json $vt_plugin_path password $vtoy_iso_part - + echo -en "\n$VTLANG_ENTER_EXIT ..." read vtInputKey unset pager } - + menuentry "$VTLANG_RETURN_PREVIOUS" --class=vtoyret VTOY_RET { echo "Return ..." } diff --git a/INSTALL/grub/distro/fwts.cfg b/INSTALL/grub/distro/fwts.cfg index 6b138dc7d9c..22f602ac4c1 100644 --- a/INSTALL/grub/distro/fwts.cfg +++ b/INSTALL/grub/distro/fwts.cfg @@ -6,8 +6,8 @@ menuentry 'Firmware Test Suite' --class ubuntu --class gnu-linux --class gnu --c initrd /boot/initrd.img } -menuentry 'Firmware Test Suite (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os { - set root='vtimghd,4' +menuentry 'Firmware Test Suite (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os { + set root='vtimghd,4' echo 'Loading Linux ...' linux /boot/vmlinuz root=LABEL=$label ro recovery nomodeset echo 'Loading initial ramdisk ...' diff --git a/INSTALL/grub/grub.cfg b/INSTALL/grub/grub.cfg index d1b7c96023b..1d91ac11a31 100644 --- a/INSTALL/grub/grub.cfg +++ b/INSTALL/grub/grub.cfg @@ -1,19 +1,19 @@ #************************************************************************************ # Copyright (c) 2020, longpanda -# +# # 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 . -# +# #************************************************************************************ if [ "$grub_platform" = "pc" ]; then @@ -56,15 +56,15 @@ function ventoy_cli_console { fi } -function ventoy_gui_console { +function ventoy_gui_console { if [ -z "$vtoy_display_mode" ]; then terminal_output gfxterm elif [ "$vtoy_display_mode" = "GUI" ]; then terminal_output gfxterm - fi + fi } -function ventoy_acpi_param { +function ventoy_acpi_param { if [ "$VTOY_PARAM_NO_ACPI" != "1" ]; then vt_acpi_param "$1" "$2" fi @@ -74,7 +74,7 @@ function ventoy_vcfg_proc { if vt_check_custom_boot "${1}" vt_vcfg; then set vtoy_chosen_path="${1}" vt_file_basefile "${vtoy_chosen_path}" vtoy_chosen_file - + export vtoy_chosen_path export vtoy_chosen_file ventoy_debug_pause @@ -90,7 +90,7 @@ function ventoy_language { } function ventoy_diagnosis { - vt_enum_video_mode + vt_enum_video_mode configfile $prefix/debug.cfg } @@ -98,7 +98,7 @@ function ventoy_localboot { configfile $prefix/localboot.cfg } -function ventoy_ext_menu { +function ventoy_ext_menu { if [ -e $vt_plugin_path/ventoy/ventoy_grub.cfg ]; then set ventoy_new_context=1 configfile $vt_plugin_path/ventoy/ventoy_grub.cfg @@ -128,14 +128,14 @@ function ventoy_show_help { cat "(vt_help_tarfs)/help/${vtCurLang}.txt" else cat "(vt_help_tarfs)/help/en_US.txt" - fi + fi loopback -d vt_help_tarfs fi } function ventoy_load_menu_lang_file { vt_load_file_to_mem "auto" $prefix/menu.tar.gz vtoy_menu_lang_mem - loopback vt_menu_tarfs mem:${vtoy_menu_lang_mem_addr}:size:${vtoy_menu_lang_mem_size} + loopback vt_menu_tarfs mem:${vtoy_menu_lang_mem_addr}:size:${vtoy_menu_lang_mem_size} } function get_os_type { @@ -147,9 +147,9 @@ function get_os_type { set vtoy_os=Windows fi else - for file in "efi/microsoft/boot/bcd" "sources/boot.wim" "boot/bcd" "bootmgr.efi" "boot/etfsboot.com" ; do - if vt_file_exist_nocase (loop)/$file; then - set vtoy_os=Windows + for file in "efi/microsoft/boot/bcd" "sources/boot.wim" "boot/bcd" "bootmgr.efi" "boot/etfsboot.com" ; do + if vt_file_exist_nocase (loop)/$file; then + set vtoy_os=Windows break fi done @@ -168,9 +168,9 @@ function get_os_type { elif vt_str_begin "$vt_system_id" "DragonFly"; then set vtoy_os=Unix set vt_unix_type=DragonFly - - - elif [ -e (loop)/boot/kernel/kernel ]; then + + + elif [ -e (loop)/boot/kernel/kernel ]; then if file --is-x86-kfreebsd (loop)/boot/kernel/kernel; then set vtoy_os=Unix set vt_unix_type=FreeBSD @@ -190,7 +190,7 @@ function vt_check_compatible_pe { #Check for PE without external tools #set compatible if ISO file is less than 80MB if [ $vt_chosen_size -GT 33554432 -a $vt_chosen_size -LE 83886080 ]; then - set ventoy_compatible=YES + set ventoy_compatible=YES fi return @@ -207,9 +207,9 @@ function vt_check_compatible_linux { } function locate_initrd { - vt_linux_locate_initrd + vt_linux_locate_initrd - if [ -n "${vtdebug_flag}" ]; then + if [ -n "${vtdebug_flag}" ]; then vt_linux_dump_initrd ventoy_debug_pause fi @@ -217,7 +217,7 @@ function locate_initrd { function locate_wim { vt_windows_locate_wim_patch (loop) "$1" - + if [ -n "${vtdebug_flag}" ]; then echo '###############################################' vt_dump_wim_patch @@ -236,7 +236,7 @@ function distro_specify_wim_patch { vt_windows_collect_wim_patch wim /2k10/winpe/w1086pe.wim vt_windows_collect_wim_patch wim /2k10/winpe/w8x86pe.wim vt_windows_collect_wim_patch wim /2k10/winpe/w7x86pe.wim - fi + fi } function distro_specify_wim_patch_phase2 { @@ -253,18 +253,18 @@ function distro_specify_wim_patch_phase2 { fi done fi - + } function distro_specify_initrd_file { if [ -e (loop)/boot/all.rdz ]; then vt_linux_specify_initrd_file /boot/all.rdz - elif [ -e (loop)/boot/xen.gz ]; then + elif [ -e (loop)/boot/xen.gz ]; then if [ -e (loop)/install.img ]; then vt_linux_specify_initrd_file /install.img fi - elif [ -d (loop)/casper ]; then + elif [ -d (loop)/casper ]; then if [ -e (loop)/casper/initrd ]; then vt_linux_specify_initrd_file /casper/initrd fi @@ -294,21 +294,21 @@ function distro_specify_initrd_file { vt_linux_specify_initrd_file /boot/x86_64/loader/initrd elif [ -f (loop)/boot/initramfs-x86_64.img ]; then vt_linux_specify_initrd_file /boot/initramfs-x86_64.img - elif [ -f (loop)/boot/isolinux/initramfs_data64.cpio.gz ]; then + elif [ -f (loop)/boot/isolinux/initramfs_data64.cpio.gz ]; then vt_linux_specify_initrd_file /boot/isolinux/initramfs_data64.cpio.gz - elif [ -f (loop)/boot/initrd.img ]; then + elif [ -f (loop)/boot/initrd.img ]; then vt_linux_specify_initrd_file /boot/initrd.img - + fi - - if [ -f (loop)/isolinux/initrd.gz ]; then + + if [ -f (loop)/isolinux/initrd.gz ]; then vt_linux_specify_initrd_file /isolinux/initrd.gz fi - - if vt_str_begin "$vt_volume_id" "QUBES"; then + + if vt_str_begin "$vt_volume_id" "QUBES"; then vt_linux_specify_initrd_file /images/pxeboot/initrd.img fi - + if [ "$vt_chosen_size" = "1133375488" ]; then if [ -d (loop)/boot/grub/x86_64-efi ]; then vt_cpio_busybox64 "64h" @@ -328,17 +328,17 @@ function distro_specify_initrd_file_phase2 { vt_linux_specify_initrd_file /boot/iniramfs.igz elif [ -f (loop)/initrd-x86_64 ]; then vt_linux_specify_initrd_file /initrd-x86_64 - elif [ -f (loop)/live/initrd.img ]; then + elif [ -f (loop)/live/initrd.img ]; then vt_linux_specify_initrd_file /live/initrd.img - elif [ -f (loop)/initrd.img ]; then + elif [ -f (loop)/initrd.img ]; then vt_linux_specify_initrd_file /initrd.img - elif [ -f (loop)/sysresccd/boot/x86_64/sysresccd.img ]; then + elif [ -f (loop)/sysresccd/boot/x86_64/sysresccd.img ]; then vt_linux_specify_initrd_file /sysresccd/boot/x86_64/sysresccd.img - elif [ -f (loop)/CDlinux/initrd ]; then + elif [ -f (loop)/CDlinux/initrd ]; then vt_linux_specify_initrd_file /CDlinux/initrd - elif [ -f (loop)/parabola/boot/x86_64/parabolaiso.img ]; then + elif [ -f (loop)/parabola/boot/x86_64/parabolaiso.img ]; then vt_linux_specify_initrd_file /parabola/boot/x86_64/parabolaiso.img - if [ -f (loop)/parabola/boot/i686/parabolaiso.img ]; then + if [ -f (loop)/parabola/boot/i686/parabolaiso.img ]; then vt_linux_specify_initrd_file /parabola/boot/i686/parabolaiso.img fi elif [ -f (loop)/parabola/boot/x86_64/initramfs-linux-libre.img ]; then @@ -346,44 +346,44 @@ function distro_specify_initrd_file_phase2 { if [ -f (loop)/parabola/boot/i686/initramfs-linux-libre.img ]; then vt_linux_specify_initrd_file /parabola/boot/i686/initramfs-linux-libre.img fi - elif [ -f (loop)/hyperbola/boot/x86_64/hyperiso.img ]; then + elif [ -f (loop)/hyperbola/boot/x86_64/hyperiso.img ]; then vt_linux_specify_initrd_file /hyperbola/boot/x86_64/hyperiso.img - if [ -f (loop)/hyperbola/boot/i686/hyperiso.img ]; then + if [ -f (loop)/hyperbola/boot/i686/hyperiso.img ]; then vt_linux_specify_initrd_file /hyperbola/boot/i686/hyperiso.img fi - elif [ -f (loop)/EFI/BOOT/initrd.img ]; then + elif [ -f (loop)/EFI/BOOT/initrd.img ]; then #Qubes vt_linux_specify_initrd_file /EFI/BOOT/initrd.img if [ "$grub_platform" != "pc" ]; then - vt_add_replace_file 0 "initrd.img" + vt_add_replace_file 0 "initrd.img" fi - elif [ -f (loop)/initrd ]; then + elif [ -f (loop)/initrd ]; then vt_linux_specify_initrd_file /initrd - elif [ -f (loop)/live/initrd1 ]; then + elif [ -f (loop)/live/initrd1 ]; then vt_linux_specify_initrd_file /live/initrd1 - elif [ -f (loop)/isolinux/initrd.img ]; then + elif [ -f (loop)/isolinux/initrd.img ]; then vt_linux_specify_initrd_file /isolinux/initrd.img - elif [ -f (loop)/isolinux/initrd.gz ]; then + elif [ -f (loop)/isolinux/initrd.gz ]; then vt_linux_specify_initrd_file /isolinux/initrd.gz - elif [ -f (loop)/syslinux/kernel/initramfs.gz ]; then - vt_linux_specify_initrd_file /syslinux/kernel/initramfs.gz + elif [ -f (loop)/syslinux/kernel/initramfs.gz ]; then + vt_linux_specify_initrd_file /syslinux/kernel/initramfs.gz elif vt_strstr "$vt_volume_id" "Daphile"; then vt_linux_parse_initrd_isolinux (loop)/isolinux/ - elif [ -f (loop)/boot/rootfs.xz ]; then + elif [ -f (loop)/boot/rootfs.xz ]; then vt_linux_specify_initrd_file /boot/rootfs.xz if [ "$grub_platform" != "pc" ]; then vt_add_replace_file 0 "minimal\\x86_64\\rootfs.xz" fi - elif [ -f (loop)/arch/boot/x86_64/archiso.img ]; then + elif [ -f (loop)/arch/boot/x86_64/archiso.img ]; then vt_linux_specify_initrd_file /arch/boot/x86_64/archiso.img if [ "$grub_platform" != "pc" ]; then vt_add_replace_file 0 "EFI\\archiso\\archiso.img" fi - elif [ -f (loop)/blackarch/boot/x86_64/archiso.img ]; then + elif [ -f (loop)/blackarch/boot/x86_64/archiso.img ]; then vt_linux_specify_initrd_file /blackarch/boot/x86_64/archiso.img - elif [ -f (loop)/blackarch/boot/x86_64/initramfs-linux.img ]; then + elif [ -f (loop)/blackarch/boot/x86_64/initramfs-linux.img ]; then vt_linux_specify_initrd_file /blackarch/boot/x86_64/initramfs-linux.img - + elif [ -f (loop)/install.amd/initrd.gz ]; then vt_linux_specify_initrd_file /live/initrd2.img vt_linux_specify_initrd_file /install.amd/initrd.gz @@ -421,7 +421,7 @@ function distro_specify_initrd_file_phase2 { elif [ -f (loop)/initramfs-linux.img ]; then vt_linux_specify_initrd_file /initramfs-linux.img elif [ -f (loop)/boot/isolinux/initrd.gz ]; then - vt_linux_specify_initrd_file /boot/isolinux/initrd.gz + vt_linux_specify_initrd_file /boot/isolinux/initrd.gz fi } @@ -438,29 +438,29 @@ function ventoy_get_furybsd_ver { fi } -function ventoy_get_freenas_ver { +function ventoy_get_freenas_ver { set vt_freebsd_ver=11.x if [ -e (loop)/FreeNAS-MANIFEST ]; then vt_parse_freenas_ver (loop)/FreeNAS-MANIFEST vt_freenas_ver if regexp --set 1:vtNasVer "^(14|13|12|11)\.[0-9]" "$vt_freenas_ver"; then - set vt_freebsd_ver=${vtNasVer}.x + set vt_freebsd_ver=${vtNasVer}.x fi fi } -function ventoy_get_truenas_ver { +function ventoy_get_truenas_ver { set vt_freebsd_ver=12.x if [ -e (loop)/TrueNAS-MANIFEST ]; then vt_parse_freenas_ver (loop)/TrueNAS-MANIFEST vt_truenas_ver if regexp --set 1:vtTNasVer "^(14|13|12|11)\.[0-9]" "$vt_truenas_ver"; then - set vt_freebsd_ver=${vtTNasVer}.x + set vt_freebsd_ver=${vtTNasVer}.x fi fi } -function ventoy_get_midnightbsd_ver { +function ventoy_get_midnightbsd_ver { if vt_str_begin "$vt_volume_id" "1_"; then set vt_freebsd_ver=11.x elif vt_str_begin "$vt_volume_id" "2_"; then @@ -486,34 +486,34 @@ function ventoy_freebsd_proc { elif vt_strstr "$vt_volume_id" "TRUENAS"; then ventoy_get_truenas_ver "$1" "${chosen_path}" elif vt_strstr "$vt_volume_id" "FURYBSD"; then - ventoy_get_furybsd_ver "$1" "${chosen_path}" + ventoy_get_furybsd_ver "$1" "${chosen_path}" elif regexp --set 1:vtBsdVerNum "^(14|13|12|11|10|9)_[0-9]" "$vt_volume_id"; then - set vt_freebsd_ver=${vtBsdVerNum}.x + set vt_freebsd_ver=${vtBsdVerNum}.x elif [ -d (loop)/usr/midnightbsd-dist ]; then ventoy_get_midnightbsd_ver "$1" "${chosen_path}" set vtFreeBsdDistro=MidnightBSD elif [ -e (loop)/bin/freebsd-version ]; then - vt_unix_parse_freebsd_ver (loop)/bin/freebsd-version vt_userland_ver + vt_unix_parse_freebsd_ver (loop)/bin/freebsd-version vt_userland_ver if regexp --set 1:vtBsdVerNum "\"(14|13|12|11|10|9)\.[0-9]-" "$vt_userland_ver"; then set vt_freebsd_ver=${vtBsdVerNum}.x - fi + fi elif [ -e (loop)/README.TXT ]; then vt_1st_line (loop)/README.TXT vt_freebsd_line1 if regexp --set 1:vtBsdVerNum "FreeBSD (14|13|12|11|10|9)\.[0-9]-" "$vt_freebsd_line1"; then - set vt_freebsd_ver=${vtBsdVerNum}.x + set vt_freebsd_ver=${vtBsdVerNum}.x fi elif vt_strstr "${chosen_path}" "MidnightBSD"; then set vt_freebsd_ver=9.x fi - + if [ -e (loop)/usr/freebsd-dist/cloninst.sh ]; then set vtFreeBsdDistro=ClonOS fi - + set vt_freebsd_bit=64 for file in "/boot/kernel/kernel" "/boot/kernel/kernel.gz"; do - if [ -e (loop)/$file ]; then + if [ -e (loop)/$file ]; then if file --is-i386-kfreebsd (loop)/$file; then set vt_freebsd_bit=32 fi @@ -527,7 +527,7 @@ function ventoy_freebsd_proc { elif [ -e (loop)/boot/kernel/kernel.gz ]; then vt_unix_parse_freebsd_ver_elf (loop)/boot/kernel/kernel.gz $vt_freebsd_bit vt_freebsd_ver fi - + if [ "$vt_freebsd_ver" = "xx" ]; then set vt_freebsd_ver=14.x fi @@ -543,15 +543,15 @@ function ventoy_freebsd_proc { if [ -n "${vtdebug_flag}" ]; then echo "This is $vtFreeBsdDistro $vt_freebsd_ver ${vt_freebsd_bit}bit" fi - + unset vt_unix_mod_path - for file in "/COPYRIGHT" "/FreeNAS-MANIFEST" "/TrueNAS-MANIFEST" "/version" "/etc/fstab"; do - if [ -e (loop)${file} ]; then + for file in "/COPYRIGHT" "/FreeNAS-MANIFEST" "/TrueNAS-MANIFEST" "/version" "/etc/fstab"; do + if [ -e (loop)${file} ]; then set vt_unix_mod_path=${file} break fi done - + if [ -n "$vt_unix_mod_path" ]; then vt_unix_replace_ko $vt_unix_mod_path (vtunix)/ventoy_unix/$vtFreeBsdDistro/geom_ventoy_ko/$vt_freebsd_ver/$vt_freebsd_bit/geom_ventoy.ko.xz vt_unix_replace_conf FreeBSD "${1}${chosen_path}" @@ -569,7 +569,7 @@ function ventoy_dragonfly_proc { unset vt_unix_mod_path for file in "/boot/kernel/initrd.img.gz"; do - if [ -e (loop)${file} ]; then + if [ -e (loop)${file} ]; then set vt_unix_mod_path=${file} break fi @@ -583,27 +583,27 @@ function ventoy_dragonfly_proc { function ventoy_unix_comm_proc { vt_unix_reset - + vt_unix_check_vlnk "${1}${chosen_path}" - + if [ "$ventoy_compatible" = "NO" ]; then loopback vtunix $vtoy_efi_part/ventoy/ventoy_unix.cpio - + if [ "$vt_unix_type" = "FreeBSD" ]; then ventoy_freebsd_proc "$1" "${chosen_path}" elif [ "$vt_unix_type" = "DragonFly" ]; then - ventoy_dragonfly_proc "$1" "${chosen_path}" + ventoy_dragonfly_proc "$1" "${chosen_path}" elif [ "$vt_unix_type" = "NetBSD" ]; then echo "NetBSD not supported" - - + + else if [ -n "${vtdebug_flag}" ]; then echo "Unknown unix type" fi fi fi - + vt_unix_chain_data "${1}${chosen_path}" ventoy_debug_pause } @@ -620,23 +620,23 @@ function uefi_windows_menu_func { if [ "$ventoy_compatible" = "NO" -o "$vt_cur_wimboot_mode" = "1" ]; then if [ "$ventoy_fs_probe" = "iso9660" ]; then loopback -d loop - vt_iso9660_nojoliet 1 + vt_iso9660_nojoliet 1 loopback loop "$1$2" fi - + for file in "efi/microsoft/boot/bcd"; do - vt_windows_collect_wim_patch bcd (loop)/$file + vt_windows_collect_wim_patch bcd (loop)/$file done vt_windows_count_wim_patch vt_wim_cnt if [ $vt_wim_cnt -eq 0 ]; then distro_specify_wim_patch_phase2 fi - - ventoy_debug_pause + + ventoy_debug_pause locate_wim "${chosen_path}" fi - + vt_windows_chain_data "${1}${chosen_path}" ventoy_debug_pause @@ -658,10 +658,10 @@ function uefi_windows_menu_func { function uefi_find_replace_initrd { if vt_get_efi_vdisk_offset "${1}${2}" vt_efivdisk_offset; then loopback -s $vt_efivdisk_offset vtefivdisk "${1}${2}" - + unset vt_rp_initrd vt_search_replace_initrd (vtefivdisk) vt_rp_initrd - + if [ -n "$vt_rp_initrd" ]; then vt_add_replace_file $3 "$vt_rp_initrd" fi @@ -672,24 +672,24 @@ function uefi_find_replace_initrd { } function uefi_linux_menu_func { - - if [ "$ventoy_compatible" = "NO" ]; then - + + if [ "$ventoy_compatible" = "NO" ]; then + if [ "$ventoy_fs_probe" = "udf" ]; then - loopback -d loop + loopback -d loop set ventoy_fs_probe=iso9660 loopback loop "$1$2" fi - + vt_load_cpio $vtoy_path "$2" "$1" "busybox=$ventoy_busybox_ver" - + vt_linux_clear_initrd - + if [ -d (loop)/pmagic ]; then vt_linux_specify_initrd_file /pmagic/initrd.img else for file in "boot/grub/grub.cfg" "EFI/BOOT/grub.cfg" "EFI/boot/grub.cfg" "efi/boot/grub.cfg" "EFI/BOOT/BOOTX64.conf" "/grub/grub.cfg" "EFI/BOOT/grub/grub.cfg"; do - if [ -e (loop)/$file ]; then + if [ -e (loop)/$file ]; then vt_linux_parse_initrd_grub file (loop)/$file fi done @@ -701,29 +701,29 @@ function uefi_linux_menu_func { elif [ -d (loop)/boot/grub ]; then vt_linux_parse_initrd_grub dir (loop)/boot/grub/ fi - + distro_specify_initrd_file - + vt_linux_initrd_count vtcount - + if [ $vtcount -eq 0 ]; then if [ -e (loop)/EFI/boot/livegrub.cfg ]; then vt_linux_parse_initrd_grub file (loop)/EFI/boot/livegrub.cfg fi distro_specify_initrd_file_phase2 - + if [ "$vt_efi_dir" = "NO" ]; then if [ -f (loop)/efi.img ]; then vt_add_replace_file 0 "initrd" fi fi fi - + locate_initrd - + if [ -d (loop)/loader/entries ]; then vt_linux_get_main_initrd_index vtindex - + if [ -d (loop)/arch ]; then if [ -f (loop)/arch/boot/x86_64/archiso.img ]; then vt_add_replace_file $vtindex "EFI\\archiso\\archiso.img" @@ -775,16 +775,16 @@ function uefi_linux_menu_func { vt_add_replace_file $vtindex "parabola\\boot\\x86_64\\initramfs-linux-libre.img" fi elif [ -e (loop)/syslinux/alt0/full.cz ]; then - vt_add_replace_file 0 "EFI\\BOOT\\full.cz" + vt_add_replace_file 0 "EFI\\BOOT\\full.cz" set FirstTryBootFile='@EFI@BOOT@grubx64.efi' - + elif vt_str_begin "$vt_volume_id" "SolusLive"; then vt_add_replace_file 0 "initrd" fi - + fi - + vt_linux_chain_data "${1}${chosen_path}" if [ -n "$LoadIsoEfiDriver" -a $vt_chosen_size -LT 104857600 ]; then @@ -795,7 +795,7 @@ function uefi_linux_menu_func { if [ -n "$vtoy_chain_mem_addr" ]; then ventoy_acpi_param ${vtoy_chain_mem_addr} 2048 - ventoy_cli_console + ventoy_cli_console unset vtGrub2Mode if vt_check_mode 3 "$vt_chosen_name"; then @@ -820,11 +820,11 @@ function uefi_linux_menu_func { fi # fallback - set vtback_root=$root + set vtback_root=$root vt_push_last_entry set vtback_theme=$theme unset theme - + vt_trailer_cpio "$vtoy_iso_part" "$vt_chosen_path" noinit vt_set_boot_opt rdinit=/vtoy/vtoy @@ -849,7 +849,7 @@ function uefi_linux_menu_func { configfile "mem:${vt_sys_menu_mem_addr}:size:${vt_sys_menu_mem_size}" fi fi - + if [ $vtback_cfg_find -eq 0 ]; then if [ -f (loop)/boot/isolinux/syslnx64.cfg ]; then syslinux_configfile (loop)/boot/isolinux/syslnx64.cfg @@ -869,7 +869,7 @@ function uefi_linux_menu_func { fi vt_unset_boot_opt - set root=$vtback_root + set root=$vtback_root set theme=$vtback_theme vt_pop_last_entry ventoy_gui_console @@ -881,7 +881,7 @@ function uefi_linux_menu_func { function uefi_unix_menu_func { ventoy_unix_comm_proc $1 "${chosen_path}" - + if [ -n "$vtoy_chain_mem_addr" ]; then ventoy_acpi_param ${vtoy_chain_mem_addr} 2048 ventoy_cli_console @@ -899,7 +899,7 @@ function ventoy_reset_nojoliet { else vt_iso9660_nojoliet 0 fi - + vt_append_extra_sector 0 } @@ -924,7 +924,7 @@ function uefi_iso_menu_func { vt_append_extra_sector 1 fi fi - + if [ -d (loop)/EFI ]; then set vt_efi_dir=YES elif [ -d (loop)/efi ]; then @@ -932,24 +932,24 @@ function uefi_iso_menu_func { else set vt_efi_dir=NO fi - + if [ -n "$vtcompat" ]; then set ventoy_compatible=YES unset vtcompat elif vt_check_mode 1 "$vt_chosen_name"; then set ventoy_compatible=YES else - vt_check_compatible (loop) + vt_check_compatible (loop) fi - + vt_img_sector "${1}${chosen_path}" - + if [ "$ventoy_fs_probe" = "iso9660" ]; then vt_select_conf_replace "${1}" "${chosen_path}" fi - + if [ "$vtoy_os" = "Windows" ]; then - vt_check_compatible_pe (loop) + vt_check_compatible_pe (loop) uefi_windows_menu_func "$1" "${chosen_path}" elif [ "$vtoy_os" = "Unix" ]; then uefi_unix_menu_func "$1" "${chosen_path}" @@ -958,17 +958,17 @@ function uefi_iso_menu_func { uefi_linux_menu_func "$1" "${chosen_path}" fi - ventoy_gui_console + ventoy_gui_console } -function uefi_iso_memdisk { +function uefi_iso_memdisk { echo 'Loading ISO file to memory ...' vt_load_img_memdisk "${1}${2}" vtoy_iso_buf - + ventoy_cli_console chainloader ${vtoy_path}/ventoy_${VTOY_EFI_ARCH}.efi memdisk env_param=${env_param} isoefi=${LoadIsoEfiDriver} ${vtdebug_flag} mem:${vtoy_iso_buf_addr}:size:${vtoy_iso_buf_size} boot - + ventoy_gui_console } @@ -994,7 +994,7 @@ function vtoy_windows_wimboot { fi vt_windows_wimboot_data "$vtoy_wimboot_prefix/sources/boot.wim" vtoy_init_exe vtoy_wim_bit - + if [ "$grub_platform" = "pc" ]; then linux16 "$vtoy_path/$vt_wimkernel" quiet ventoy_debug_pause @@ -1035,33 +1035,33 @@ function vtoy_windows_wimboot { function vtoy_winpe_wimboot { unset vtoy_boot_sdi_legacy unset vtoy_boot_sdi_efi - - set vtoy_wimboot_prefix=(loop) + + set vtoy_wimboot_prefix=(loop) set vtoy_wim_path="$1" - + if [ -n "${vtdebug_flag}" ]; then echo "winpe_wimboot $1 $2 $3" fi - + if [ "$2" != "0" ]; then set vtoy_boot_sdi_legacy="newc:boot.sdi:$vtoy_wimboot_prefix/$2" set vtoy_boot_sdi_efi="vf=boot.sdi:$vtoy_wimboot_prefix/$2" fi vt_windows_wimboot_data $vtoy_wimboot_prefix/$vtoy_wim_path vtoy_init_exe vtoy_wim_bit - + if [ "$grub_platform" = "pc" ]; then linux16 "$vtoy_path/$vt_wimkernel" quiet ventoy_debug_pause - vt_set_wim_load_prompt 1 "Loading files......" + vt_set_wim_load_prompt 1 "Loading files......" initrd16 newc:$vtoy_init_exe:mem:${vtoy_wimboot_mem_addr}:size:${vtoy_wimboot_mem_size} \ newc:vtoy_wimboot:$vtoy_path/$vt_wimkernel \ newc:bootmgr.exe:mem:${vtoy_pe_bootmgr_mem_addr}:size:${vtoy_pe_bootmgr_mem_size} \ newc:bcd:mem:${vtoy_pe_bcd_mem_addr}:size:${vtoy_pe_bcd_mem_size} \ $vtoy_boot_sdi_legacy \ newc:boot.wim:$vtoy_wimboot_prefix/$vtoy_wim_path - vt_set_wim_load_prompt 0 + vt_set_wim_load_prompt 0 boot else if [ "$VTOY_EFI_ARCH" = "x64" -a "$vtoy_wim_bit" = "32" ]; then @@ -1078,7 +1078,7 @@ function vtoy_winpe_wimboot { else set vtoy_wimfile_path=$vtoy_wimboot_prefix/$vtoy_wim_path fi - + unset vtoy_boot_efi_path if [ -F (loop)/efi/boot/boot${VTOY_EFI_ARCH}.efi ]; then set vtoy_boot_efi_path="vf=bootx64.efi:(loop)/efi/boot/boot${VTOY_EFI_ARCH}.efi" @@ -1101,7 +1101,7 @@ function vtoy_winpe_wimboot { function vtoy_wimboot_func { if [ "$grub_platform" = "pc" ]; then - set vt_wimkernel=wimboot.x86_64.xz + set vt_wimkernel=wimboot.x86_64.xz else if [ "$grub_cpu" = "i386" ]; then set vt_wimkernel=wimboot.i386.efi.xz @@ -1115,12 +1115,12 @@ function vtoy_wimboot_func { vtoy_windows_wimboot else vt_sel_winpe_wim (loop) - if [ -n "$vtoy_pe_wim_path" ]; then + if [ -n "$vtoy_pe_wim_path" ]; then echo -e "\n==================== VENTOY WIMBOOT ==================\n" - + vt_fs_ignore_case 1 vt_load_file_to_mem "auto" $vtoy_path/common_bcd.xz vtoy_pe_bcd_mem - + set vt_sdi_path=0 for vsdi in "boot/boot.sdi" "2K10/FONTS/boot.sdi" "SSTR/boot.sdi" "ISPE/BOOT.SDI" \ "boot/uqi.sdi" "ISYL/boot.sdi" "WEPE/WEPE.SDI" ; do @@ -1129,14 +1129,14 @@ function vtoy_wimboot_func { break fi done - + if [ "$grub_platform" = "pc" ]; then vt_load_file_to_mem "auto" $vtoy_path/common_bootmgr.xz vtoy_pe_bootmgr_mem vtoy_winpe_wimboot "$vtoy_pe_wim_path" "$vt_sdi_path" 1 else vtoy_winpe_wimboot "$vtoy_pe_wim_path" "$vt_sdi_path" 0 fi - + vt_fs_ignore_case 0 fi fi @@ -1144,39 +1144,39 @@ function vtoy_wimboot_func { function legacy_windows_menu_func { vt_windows_reset - + unset vt_cur_wimboot_mode if vt_check_mode 4 "$vt_chosen_name"; then set vt_cur_wimboot_mode=1 fi - + if [ "$ventoy_compatible" = "NO" -o "$vt_cur_wimboot_mode" = "1" ]; then if [ "$ventoy_fs_probe" = "iso9660" ]; then loopback -d loop vt_iso9660_nojoliet 1 loopback loop "$1$2" fi - + for file in "boot/bcd" "/efi/microsoft/boot/bcd" "SSTR/BCD" "boot/bce"; do - vt_windows_collect_wim_patch bcd (loop)/$file + vt_windows_collect_wim_patch bcd (loop)/$file done - + distro_specify_wim_patch vt_windows_count_wim_patch vt_wim_cnt if [ $vt_wim_cnt -eq 0 ]; then distro_specify_wim_patch_phase2 fi - + ventoy_debug_pause if [ -z "$vt_cur_wimboot_mode" ]; then locate_wim "${chosen_path}" fi fi - + vt_windows_chain_data "${1}${chosen_path}" ventoy_debug_pause - + if [ "$vt_cur_wimboot_mode" = "1" ]; then vtoy_wimboot_func fi @@ -1204,7 +1204,7 @@ function legacy_linux_menu_func { loopback loop "$1$2" fi - + if vt_syslinux_need_nojoliet "$1$2"; then vt_iso9660_nojoliet 1 loopback -d loop @@ -1214,7 +1214,7 @@ function legacy_linux_menu_func { vt_load_cpio $vtoy_path "$2" "$1" "busybox=$ventoy_busybox_ver" vt_linux_clear_initrd - + if [ -d (loop)/pmagic ]; then vt_linux_specify_initrd_file /pmagic/initrd.img else @@ -1224,7 +1224,7 @@ function legacy_linux_menu_func { fi done fi - + # special process for special distros #archlinux if [ -d (loop)/arch/boot/syslinux ]; then @@ -1232,18 +1232,18 @@ function legacy_linux_menu_func { vt_linux_parse_initrd_isolinux (loop)/arch/boot/syslinux/ /arch/boot/syslinux/ elif [ -d (loop)/anarchy/boot/syslinux ]; then vt_linux_parse_initrd_isolinux (loop)/anarchy/boot/syslinux/ /anarchy/ - + #manjaro elif [ -d (loop)/manjaro ]; then if [ -e (loop)/boot/grub/kernels.cfg ]; then vt_linux_parse_initrd_grub file (loop)/boot/grub/kernels.cfg fi - elif [ -e (loop)/boot/grub/grub.cfg ]; then + elif [ -e (loop)/boot/grub/grub.cfg ]; then vt_linux_parse_initrd_grub file (loop)/boot/grub/grub.cfg fi - + distro_specify_initrd_file - + vt_linux_initrd_count vtcount if [ $vtcount -eq 0 ]; then if [ -d (loop)/rancheros ]; then @@ -1252,13 +1252,13 @@ function legacy_linux_menu_func { distro_specify_initrd_file_phase2 fi - + locate_initrd fi - + vt_linux_chain_data "${1}${chosen_path}" ventoy_debug_pause - + if [ -n "$vtoy_chain_mem_addr" ]; then unset vtGrub2Mode if vt_check_mode 3 "$vt_chosen_name"; then @@ -1266,19 +1266,19 @@ function legacy_linux_menu_func { elif vt_str_begin "$vt_volume_id" "HOLO_"; then if [ -d (loop)/loader/entries ]; then set vtGrub2Mode=1 - fi + fi fi - + if [ -n "$vtGrub2Mode" ]; then ventoy_acpi_param ${vtoy_chain_mem_addr} 2048 ventoy_cli_console # fallback - set vtback_root=$root + set vtback_root=$root vt_push_last_entry set vtback_theme=$theme unset theme - + vt_trailer_cpio "$vtoy_iso_part" "$vt_chosen_path" noinit vt_set_boot_opt rdinit=/vtoy/vtoy @@ -1292,18 +1292,18 @@ function legacy_linux_menu_func { fi done if [ $vtback_cfg_find -eq 0 ]; then - if [ -f (loop)/loader/loader.conf -a -d (loop)/loader/entries ]; then + if [ -f (loop)/loader/loader.conf -a -d (loop)/loader/entries ]; then if vt_str_begin "$vt_volume_id" "HOLO_"; then set root=(loop,2) vt_systemd_menu (loop,2) vt_sys_menu_mem else vt_systemd_menu (loop) vt_sys_menu_mem fi - set vtback_cfg_find=1 + set vtback_cfg_find=1 configfile "mem:${vt_sys_menu_mem_addr}:size:${vt_sys_menu_mem_size}" fi fi - + if [ $vtback_cfg_find -eq 0 ]; then if [ -f (loop)/boot/isolinux/syslnx64.cfg ]; then syslinux_configfile (loop)/boot/isolinux/syslnx64.cfg @@ -1315,13 +1315,13 @@ function legacy_linux_menu_func { fi vt_unset_boot_opt - set root=$vtback_root + set root=$vtback_root set theme=$vtback_theme vt_pop_last_entry ventoy_gui_console else ventoy_acpi_param ${vtoy_chain_mem_addr} 2048 - linux16 $vtoy_path/ipxe.krn ${vtdebug_flag} mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size} + linux16 $vtoy_path/ipxe.krn ${vtdebug_flag} mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size} boot fi else @@ -1331,9 +1331,9 @@ function legacy_linux_menu_func { } -function legacy_unix_menu_func { +function legacy_unix_menu_func { ventoy_unix_comm_proc $1 "${chosen_path}" - + if [ -n "$vtoy_chain_mem_addr" ]; then #ventoy_acpi_param ${vtoy_chain_mem_addr} 2048 linux16 $vtoy_path/ipxe.krn ${vtdebug_flag} mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size} @@ -1347,10 +1347,10 @@ function legacy_unix_menu_func { function legacy_iso_menu_func { set chosen_path="$2" - + vt_select_auto_install "${chosen_path}" vt_select_persistence "${chosen_path}" - + if [ -n "$vtcompat" ]; then set ventoy_compatible=YES unset vtcompat @@ -1359,7 +1359,7 @@ function legacy_iso_menu_func { else vt_check_compatible (loop) fi - + vt_img_sector "${1}${chosen_path}" if [ "$ventoy_fs_probe" = "iso9660" ]; then @@ -1367,7 +1367,7 @@ function legacy_iso_menu_func { fi if [ "$vtoy_os" = "Windows" ]; then - vt_check_compatible_pe (loop) + vt_check_compatible_pe (loop) legacy_windows_menu_func "$1" "${chosen_path}" elif [ "$vtoy_os" = "Unix" ]; then legacy_unix_menu_func "$1" "${chosen_path}" @@ -1380,7 +1380,7 @@ function legacy_iso_menu_func { function legacy_iso_memdisk { - linux16 $vtoy_path/memdisk iso raw + linux16 $vtoy_path/memdisk iso raw echo "Loading ISO file to memory ..." initrd16 "${1}${2}" boot @@ -1397,22 +1397,22 @@ function iso_endless_os_proc { vt_load_cpio $vtoy_path "$2" "$1" "busybox=$ventoy_busybox_ver" vt_trailer_cpio "$1" "$2" noinit - + ventoy_debug_pause - vt_set_boot_opt '@kparams' rdinit=/vtoy/vtoy + vt_set_boot_opt '@kparams' rdinit=/vtoy/vtoy set eosimage=loop - set ventoy_bls_bootdev=/boot + set ventoy_bls_bootdev=/boot set ventoy_loading_tip="Loading files ......" - - export eosimage + + export eosimage configfile (loop)/endless/grub/grub.cfg - + unset eosimage unset ventoy_bls_bootdev unset ventoy_loading_tip - + vt_unset_boot_opt } @@ -1425,7 +1425,7 @@ function ventoy_iso_busybox_ver { set ventoy_busybox_ver=m64 else set ventoy_busybox_ver=32 - + #special process for deepin-live iso if [ "$vt_chosen_size" = "403701760" ]; then if vt_str_str "$vt_chosen_path" "/deepin-live"; then @@ -1448,11 +1448,11 @@ function ventoy_iso_busybox_ver { function iso_common_menuentry { unset vt_system_id unset vt_volume_id - + vt_chosen_img_path vt_chosen_path vt_chosen_size vt_chosen_name vt_parse_iso_volume "${vtoy_iso_part}${vt_chosen_path}" vt_system_id vt_volume_id vt_volume_space - if [ $vt_volume_space -NE $vt_chosen_size ]; then + if [ $vt_volume_space -NE $vt_chosen_size ]; then vt_mod $vt_chosen_size 2048 vt_chosen_size_mod if [ $vt_chosen_size_mod -ne 0 ]; then echo -e "\n $vt_volume_space $vt_chosen_size $vt_chosen_size_mod\n" @@ -1462,17 +1462,17 @@ function iso_common_menuentry { read vtInputKey fi fi - + if vt_check_password "${vt_chosen_path}"; then return fi - if ventoy_vcfg_proc "${vt_chosen_path}"; then + if ventoy_vcfg_proc "${vt_chosen_path}"; then return fi - - - + + + #secondary boot menu if vt_is_udf "${vtoy_iso_part}${vt_chosen_path}"; then set ventoy_fs_probe=udf @@ -1480,16 +1480,16 @@ function iso_common_menuentry { set ventoy_fs_probe=iso9660 ventoy_reset_nojoliet fi - + if [ -d (loop)/ ]; then loopback -d loop fi - loopback loop "${vtoy_iso_part}${vt_chosen_path}" - + loopback loop "${vtoy_iso_part}${vt_chosen_path}" + get_os_type (loop) - + ventoy_debug_pause - + if vt_need_secondary_menu "$vt_chosen_name"; then vt_show_secondary_menu "$vt_chosen_path" "$vtoy_os" $vt_chosen_size if [ "$VTOY_SECOND_EXIT" = "1" ]; then @@ -1498,12 +1498,12 @@ function iso_common_menuentry { fi - if vt_str_begin "$vt_volume_id" "Avira"; then + if vt_str_begin "$vt_volume_id" "Avira"; then vt_skip_svd "${vtoy_iso_part}${vt_chosen_path}" fi - + ventoy_iso_busybox_ver - + #special process for Endless OS if vt_str_begin "$vt_volume_id" "Endless-OS"; then iso_endless_os_proc $vtoy_iso_part "$vt_chosen_path" @@ -1513,7 +1513,7 @@ function iso_common_menuentry { # auto memdisk mode for some special ISO files - vt_iso_vd_id_parse "${vtoy_iso_part}${vt_chosen_path}" + vt_iso_vd_id_parse "${vtoy_iso_part}${vt_chosen_path}" unset vtMemDiskBoot if vt_check_mode 0 "$vt_chosen_name"; then set vtMemDiskBoot=1 @@ -1525,7 +1525,7 @@ function iso_common_menuentry { set vtMemDiskBoot=1 fi fi - + #For iKuai8 (<64MB) if [ $vt_chosen_size -LE 67108864 ]; then if vt_str_begin "$vt_chosen_name" "iKuai"; then @@ -1568,14 +1568,14 @@ function miso_common_menuentry { legacy_iso_memdisk $vtoy_iso_part "$vt_chosen_path" else uefi_iso_memdisk $vtoy_iso_part "$vt_chosen_path" - fi + fi } function common_unsupport_menuentry { echo -e "\n The name of the iso file could NOT contain space or non-ascii characters. \n" - echo -e " 文件å中ä¸èƒ½æœ‰ä¸­æ–‡æˆ–空格 \n" - echo -en "\n$VTLANG_ENTER_EXIT ..." + echo -e " 文件å中ä¸èƒ½æœ‰ä¸­æ–‡æˆ–空格 \n" + echo -en "\n$VTLANG_ENTER_EXIT ..." read vtInputKey } @@ -1589,27 +1589,27 @@ function iso_unsupport_menuentry { function wim_common_menuentry { vt_chosen_img_path vt_chosen_path vt_chosen_size vt_chosen_name - + if vt_check_password "${vt_chosen_path}"; then return fi - - if ventoy_vcfg_proc "${vt_chosen_path}"; then + + if ventoy_vcfg_proc "${vt_chosen_path}"; then return fi - + if vt_wim_check_bootable "${vtoy_iso_part}${vt_chosen_path}"; then vt_wim_chain_data "${vtoy_iso_part}${vt_chosen_path}" else echo -e "\n This is NOT a bootable WIM file. \n" echo -e " è¿™ä¸æ˜¯ä¸€ä¸ªå¯å¯åŠ¨çš„ WIM 文件。\n" fi - - ventoy_debug_pause - + + ventoy_debug_pause + if [ -n "$vtoy_chain_mem_addr" ]; then if [ "$grub_platform" = "pc" ]; then - linux16 $vtoy_path/ipxe.krn ${vtdebug_flag} mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size} + linux16 $vtoy_path/ipxe.krn ${vtdebug_flag} mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size} else ventoy_cli_console chainloader ${vtoy_path}/ventoy_${VTOY_EFI_ARCH}.efi env_param=${env_param} isoefi=${LoadIsoEfiDriver} ${vtdebug_flag} mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size} @@ -1628,31 +1628,31 @@ function wim_unsupport_menuentry { function efi_common_menuentry { vt_chosen_img_path vt_chosen_path vt_chosen_size vt_chosen_name - + if vt_check_password "${vt_chosen_path}"; then return fi - - if ventoy_vcfg_proc "${vt_chosen_path}"; then + + if ventoy_vcfg_proc "${vt_chosen_path}"; then return fi - + unset vt_vlnk_dst if vt_is_vlnk_name "${vt_chosen_path}"; then vt_get_vlnk_dst "${vtoy_iso_part}${vt_chosen_path}" vt_vlnk_dst if [ -z "$vt_vlnk_dst" ]; then - echo -e "\n### VLNK FILE NOT FOUND ###\n### VLNK 文件ä¸å­˜åœ¨ ###\n" + echo -e "\n### VLNK FILE NOT FOUND ###\n### VLNK 文件ä¸å­˜åœ¨ ###\n" ventoy_pause return fi else vt_vlnk_dst="${vtoy_iso_part}${vt_chosen_path}" fi - + ventoy_debug_pause ventoy_cli_console - + #first try with chainload set vtOldRoot=$root set root=$vtoy_iso_part @@ -1661,9 +1661,9 @@ function efi_common_menuentry { #retry with isoboot set root=$vtOldRoot - vt_concat_efi_iso "${vt_vlnk_dst}" vtoy_iso_buf + vt_concat_efi_iso "${vt_vlnk_dst}" vtoy_iso_buf chainloader ${vtoy_path}/ventoy_${VTOY_EFI_ARCH}.efi memdisk env_param=${env_param} dotefi isoefi=on ${vtdebug_flag} mem:${vtoy_iso_buf_addr}:size:${vtoy_iso_buf_size} - boot + boot ventoy_gui_console } @@ -1674,14 +1674,14 @@ function efi_unsupport_menuentry { function vhdboot_common_func { vt_patch_vhdboot "$1" - - ventoy_debug_pause - + + ventoy_debug_pause + if [ -n "$vtoy_vhd_buf_addr" ]; then if [ "$grub_platform" = "pc" ]; then ventoy_cli_console - linux16 $vtoy_path/memdisk iso raw - initrd16 mem:${vtoy_vhd_buf_addr}:size:${vtoy_vhd_buf_size} + linux16 $vtoy_path/memdisk iso raw + initrd16 mem:${vtoy_vhd_buf_addr}:size:${vtoy_vhd_buf_size} boot ventoy_gui_console else @@ -1698,20 +1698,20 @@ function vhdboot_common_func { function vhd_common_menuentry { vt_chosen_img_path vt_chosen_path vt_chosen_size vt_chosen_name - + if vt_check_password "${vt_chosen_path}"; then return fi - - if ventoy_vcfg_proc "${vt_chosen_path}"; then + + if ventoy_vcfg_proc "${vt_chosen_path}"; then return fi - + unset vt_vlnk_dst if vt_is_vlnk_name "${vt_chosen_path}"; then vt_get_vlnk_dst "${vtoy_iso_part}${vt_chosen_path}" vt_vlnk_dst if [ -z "$vt_vlnk_dst" ]; then - echo -e "\n### VLNK FILE NOT FOUND ###\n### VLNK 文件ä¸å­˜åœ¨ ###\n" + echo -e "\n### VLNK FILE NOT FOUND ###\n### VLNK 文件ä¸å­˜åœ¨ ###\n" ventoy_pause return fi @@ -1727,7 +1727,7 @@ function vhd_common_menuentry { fi fi fi - + vhdboot_common_func "${vt_vlnk_dst}" } @@ -1738,18 +1738,18 @@ function vhd_unsupport_menuentry { function vtoyboot_common_func { set AltBootPart=0 set vtoysupport=0 - + vt_get_vtoy_type "${1}" vtoytype parttype AltBootPart - - if vt_str_begin $vtoytype vhd; then + + if vt_str_begin $vtoytype vhd; then set vtoysupport=1 elif [ "$vtoytype" = "raw" ]; then set vtoysupport=1 elif [ "$vtoytype" = "vdi" ]; then set vtoysupport=1 fi - - if [ $vtoysupport -eq 1 ]; then + + if [ $vtoysupport -eq 1 ]; then if [ "$grub_platform" = "pc" ]; then if [ "$parttype" = "gpt" -a $AltBootPart -eq 0 ]; then echo "The OS in the vdisk was created in UEFI mode, but current is Legacy BIOS mode." @@ -1768,11 +1768,11 @@ function vtoyboot_common_func { vt_raw_chain_data "${1}" ventoy_debug_pause - - if [ -n "$vtoy_chain_mem_addr" ]; then + + if [ -n "$vtoy_chain_mem_addr" ]; then if [ "$grub_platform" = "pc" ]; then vt_acpi_param ${vtoy_chain_mem_addr} 512 - linux16 $vtoy_path/ipxe.krn ${vtdebug_flag} bios80 sector512 mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size} + linux16 $vtoy_path/ipxe.krn ${vtdebug_flag} bios80 sector512 mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size} boot else if vt_check_secureboot_var; then @@ -1782,7 +1782,7 @@ function vtoyboot_common_func { chainloader ${vtoy_path}/ventoy_${VTOY_EFI_ARCH}.efi sector512 env_param=${ventoy_env_param} ${vtdebug_flag} mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size} boot ventoy_gui_console - fi + fi else echo "chain empty failed!" ventoy_pause @@ -1793,29 +1793,29 @@ function vtoyboot_common_func { fi } -function vtoy_common_menuentry { +function vtoy_common_menuentry { vt_chosen_img_path vt_chosen_path vt_chosen_size vt_chosen_name - + if vt_check_password "${vt_chosen_path}"; then return - fi - - if ventoy_vcfg_proc "${vt_chosen_path}"; then + fi + + if ventoy_vcfg_proc "${vt_chosen_path}"; then return fi - + unset vt_vlnk_dst if vt_is_vlnk_name "${vt_chosen_path}"; then vt_get_vlnk_dst "${vtoy_iso_part}${vt_chosen_path}" vt_vlnk_dst if [ -z "$vt_vlnk_dst" ]; then - echo -e "\n### VLNK FILE NOT FOUND ###\n### VLNK 文件ä¸å­˜åœ¨ ###\n" + echo -e "\n### VLNK FILE NOT FOUND ###\n### VLNK 文件ä¸å­˜åœ¨ ###\n" ventoy_pause return fi else vt_vlnk_dst="${vtoy_iso_part}${vt_chosen_path}" fi - + vtoyboot_common_func "${vt_vlnk_dst}" } @@ -1832,17 +1832,17 @@ function vtoy_unsupport_menuentry { function only_uefi_tip { echo -e "\n This IMG file is only supported in UEFI mode. \n" echo -en "\n$VTLANG_ENTER_EXIT ..." - read vtInputKey + read vtInputKey } function ventoy_img_easyos { vt_load_cpio $vtoy_path "${vt_chosen_path}" ${vtoy_iso_part} "busybox=$ventoy_busybox_ver" vt_trailer_cpio ${vtoy_iso_part} "${vt_chosen_path}" noinit - + loopback easysfs (vtimghd,1)/easy.sfs vt_get_lib_module_ver (easysfs) /lib/modules/ vt_module_ver - - if [ -n "$vt_module_ver" ]; then + + if [ -n "$vt_module_ver" ]; then for mod in "kernel/drivers/md/dm-mod.ko" "kernel/drivers/dax/dax.ko"; do if [ -e (easysfs)/lib/modules/$vt_module_ver/$mod ]; then vt_img_extra_initrd_append (easysfs)/lib/modules/$vt_module_ver/$mod @@ -1855,9 +1855,9 @@ function ventoy_img_easyos { #boot image file vt_set_boot_opt rdinit=/vtoy/vtoy vt_img_hook_root - + syslinux_configfile (vtimghd,1)/syslinux.cfg - + vt_img_unhook_root vt_unset_boot_opt loopback -d easysfs @@ -1866,17 +1866,17 @@ function ventoy_img_easyos { function ventoy_img_easyos2 { vt_load_cpio $vtoy_path "${vt_chosen_path}" ${vtoy_iso_part} "busybox=$ventoy_busybox_ver" vt_trailer_cpio ${vtoy_iso_part} "${vt_chosen_path}" noinit - + if [ -e (vtimghd,2)/easyos/easy.sfs ]; then loopback easysfs (vtimghd,2)/easyos/easy.sfs elif [ -d (vtimghd,2)/easyos/releases ]; then vt_fs_enum_1st_dir (vtimghd,2) /easyos/releases/ vt_dir_name loopback easysfs (vtimghd,2)/easyos/releases/$vt_dir_name/easy.sfs fi - + vt_get_lib_module_ver (easysfs) /lib/modules/ vt_module_ver - - if [ -n "$vt_module_ver" ]; then + + if [ -n "$vt_module_ver" ]; then for mod in "kernel/drivers/md/dm-mod.ko" "kernel/drivers/dax/dax.ko"; do if [ -e (easysfs)/lib/modules/$vt_module_ver/$mod ]; then vt_img_extra_initrd_append (easysfs)/lib/modules/$vt_module_ver/$mod @@ -1889,10 +1889,10 @@ function ventoy_img_easyos2 { #boot image file vt_set_boot_opt rdinit=/vtoy/vtoy vt_img_hook_root - + vt_limine_menu (vtimghd,1)/limine.cfg vt_sys_menu_mem configfile "mem:${vt_sys_menu_mem_addr}:size:${vt_sys_menu_mem_size}" - + vt_img_unhook_root vt_unset_boot_opt loopback -d easysfs @@ -1907,27 +1907,27 @@ function ventoy_img_volumio { #boot image file vt_set_boot_opt rdinit=/vtoy/vtoy imgpart=/dev/ventoy2 bootpart=/dev/ventoy1 vt_img_hook_root - + syslinux_configfile (vtimghd,1)/syslinux.cfg - + vt_img_unhook_root vt_unset_boot_opt } function ventoy_img_openelec { elec_ver=$1 - + vt_load_cpio $vtoy_path "${vt_chosen_path}" ${vtoy_iso_part} "busybox=$ventoy_busybox_ver" vt_trailer_cpio ${vtoy_iso_part} "${vt_chosen_path}" noinit - loopback vtloopex $vtoy_efi_part/ventoy/vtloopex.cpio + loopback vtloopex $vtoy_efi_part/ventoy/vtloopex.cpio vt_img_extra_initrd_append (vtloopex)/$elec_ver/vtloopex.tar.xz if [ "$elec_ver" = "LibreELEC" ]; then if [ -f (vtimghd,1)/system ]; then loopback elecsfs (vtimghd,1)/system vt_get_lib_module_ver (elecsfs) /usr/lib/kernel-overlays/base/lib/modules/ vt_module_ver - if [ -n "$vt_module_ver" ]; then + if [ -n "$vt_module_ver" ]; then for mod in "kernel/drivers/md/dm-mod.ko"; do if [ -e (elecsfs)/usr/lib/kernel-overlays/base/lib/modules/$vt_module_ver/$mod ]; then vt_img_extra_initrd_append (elecsfs)/usr/lib/kernel-overlays/base/lib/modules/$vt_module_ver/$mod @@ -1942,10 +1942,10 @@ function ventoy_img_openelec { #boot image file vt_set_boot_opt rdinit=/vtoy/vtoy ventoyos=$elec_ver vt_img_hook_root - + set root=(vtimghd,1) syslinux_configfile (vtimghd,1)/syslinux.cfg - + vt_img_unhook_root vt_unset_boot_opt loopback -d vtloopex @@ -1958,7 +1958,7 @@ function ventoy_img_freedombox { vt_trailer_cpio ${vtoy_iso_part} "${vt_chosen_path}" noinit vt_get_lib_module_ver (vtimghd,1) /lib/modules/ vt_module_ver - if [ -n "$vt_module_ver" ]; then + if [ -n "$vt_module_ver" ]; then vt_img_extra_initrd_append (vtimghd,1)/lib/modules/$vt_module_ver/kernel/drivers/md/dm-mod.ko fi @@ -1967,9 +1967,9 @@ function ventoy_img_freedombox { #boot image file vt_set_boot_opt rdinit=/vtoy/vtoy ventoyos=freedombox vt_img_hook_root - + configfile (vtimghd,1)/boot/grub/grub.cfg - + vt_img_unhook_root vt_unset_boot_opt } @@ -1983,15 +1983,15 @@ function ventoy_img_paldo { #boot image file vt_set_boot_opt rdinit=/vtoy/vtoy ventoyos=paldo vt_img_hook_root - + vt_fs_enum_1st_file (vtimghd,1) /loader/entries/ vt_paldo_entry_conf vt_file_basename $vt_paldo_entry_conf vtPaldoVer - + echo loading file... linux (vtimghd,1)/linux-${vtPaldoVer} root=/dev/ventoy1 rootfstype=vfat initrd (vtimghd,1)/initramfs-${vtPaldoVer} boot - + vt_img_unhook_root vt_unset_boot_opt } @@ -2001,7 +2001,7 @@ function ventoy_img_ubos { vt_trailer_cpio ${vtoy_iso_part} "${vt_chosen_path}" noinit vt_get_lib_module_ver (vtimghd,3) /lib/modules/ vt_module_ver - if [ -n "$vt_module_ver" ]; then + if [ -n "$vt_module_ver" ]; then vt_img_extra_initrd_append (vtimghd,3)/lib/modules/$vt_module_ver/kernel/drivers/md/dm-mod.ko.xz fi @@ -2010,7 +2010,7 @@ function ventoy_img_ubos { #boot image file vt_set_boot_opt rdinit=/vtoy/vtoy ventoyos=ubos vt_img_hook_root - + echo loading file... linux (vtimghd,2)/vmlinuz-linux root=/dev/ventoy3 rw initrd (vtimghd,2)/initramfs-linux.img @@ -2033,7 +2033,7 @@ function ventoy_img_recalbox { if [ -e (vtimghd,1)/boot/recalbox ]; then loopback recalbox (vtimghd,1)/boot/recalbox vt_get_lib_module_ver (recalbox) /lib/modules/ vt_module_ver - if [ -n "$vt_module_ver" ]; then + if [ -n "$vt_module_ver" ]; then vt_img_extra_initrd_append (recalbox)/lib/modules/$vt_module_ver/kernel/drivers/md/dm-mod.ko fi fi @@ -2043,7 +2043,7 @@ function ventoy_img_recalbox { #boot image file vt_set_boot_opt rdinit=/vtoy/vtoy ventoyos=recalbox vt_img_hook_root - + set root=(vtimghd,1) configfile (vtimghd,1)/boot/grub/grub.cfg @@ -2077,7 +2077,7 @@ function ventoy_img_batocera { #boot image file vt_set_boot_opt rdinit=/vtoy/vtoy ventoyos=batocera vt_img_hook_root - + set root=(vtimghd,1) syslinux_configfile (vtimghd,1)/boot/syslinux/syslinux.cfg @@ -2122,7 +2122,7 @@ function ventoy_img_openwrt { ventoy_cli_console return fi - + vt_load_cpio $vtoy_path "${vt_chosen_path}" ${vtoy_iso_part} "busybox=$ventoy_busybox_ver" vt_trailer_cpio ${vtoy_iso_part} "${vt_chosen_path}" noinit @@ -2135,7 +2135,7 @@ function ventoy_img_openwrt { #boot image file vt_set_boot_opt rdinit=/vtoy/vtoy ventoyos=openwrt vt_img_hook_root - + set root=(vtimghd,1) configfile (vtimghd,1)/boot/grub/grub.cfg @@ -2152,7 +2152,7 @@ function ventoy_img_tails { #boot image file vt_set_boot_opt rdinit=/vtoy/vtoy live-media=/dev/dm-1 ventoyos=tails vt_img_hook_root - + set root=(vtimghd,1) configfile (vtimghd,1)/efi/debian/grub.cfg @@ -2186,7 +2186,7 @@ function ventoy_img_fydeos { vt_img_unhook_root vt_unset_boot_opt - + unset grubdisk unset grubpartA unset grubpartB @@ -2215,12 +2215,12 @@ function ventoy_img_cloudready { set linuxpartA=(sda,3) set linuxpartB=(sda,5) - set root=(vtimghd,12) + set root=(vtimghd,12) configfile (vtimghd,12)/efi/boot/grub.cfg vt_img_unhook_root vt_unset_boot_opt - + unset grubdisk unset grubpartA unset grubpartB @@ -2238,30 +2238,30 @@ function ventoy_img_fwts { #boot image file vt_set_boot_opt rdinit=/vtoy/vtoy ventoyos=fwts vt_img_hook_root - + configfile $prefix/distro/fwts.cfg vt_img_unhook_root vt_unset_boot_opt } -function ventoy_img_memtest86 { +function ventoy_img_memtest86 { chainloader (vtimghd,1)/efi/boot/BOOTX64.efi boot } function img_unsupport_tip { echo -e "\n This IMG file is NOT supported now. \n" - echo -e " 当å‰ä¸æ”¯æŒå¯åŠ¨æ­¤ IMG 文件 \n" + echo -e " 当å‰ä¸æ”¯æŒå¯åŠ¨æ­¤ IMG 文件 \n" echo -en "\n$VTLANG_ENTER_EXIT ..." - read vtInputKey + read vtInputKey } function legacy_img_memdisk { linux16 $vtoy_path/memdisk echo "Loading img file to memory ..." initrd16 "${1}${2}" - + ventoy_cli_console boot } @@ -2272,12 +2272,12 @@ function img_common_menuentry { unset LoadIsoEfiDriver vt_chosen_img_path vt_chosen_path vt_chosen_size vt_chosen_name - + if vt_check_password "${vt_chosen_path}"; then return fi - if ventoy_vcfg_proc "${vt_chosen_path}"; then + if ventoy_vcfg_proc "${vt_chosen_path}"; then return fi @@ -2323,7 +2323,7 @@ function img_common_menuentry { fi if vt_str_begin "$vtImgHd3Label" "ROOT-"; then - if [ -f (vtimghd,3)/etc/os-release.d/ID ]; then + if [ -f (vtimghd,3)/etc/os-release.d/ID ]; then vt_1st_line (vtimghd,3)/etc/os-release.d/ID vt_release_line1 if vt_str_begin "$vt_release_line1" "FydeOS"; then ventoy_img_fydeos @@ -2362,21 +2362,21 @@ function img_common_menuentry { elif [ -f (vtimghd,2)/loader/entries/ubos.conf ]; then ventoy_img_ubos elif [ -f (vtimghd,2)/etc/openwrt_version ]; then - ventoy_img_openwrt + ventoy_img_openwrt else - if [ -f (vtimghd,1)/efi/boot/mt86.png ]; then + if [ -f (vtimghd,1)/efi/boot/mt86.png ]; then if [ "$grub_platform" = "pc" ]; then img_unsupport_tip - fi + fi fi #common chain vt_linux_chain_data "${vtoy_iso_part}${vt_chosen_path}" ventoy_acpi_param ${vtoy_chain_mem_addr} 512 - if [ "$grub_platform" = "pc" ]; then - linux16 $vtoy_path/ipxe.krn ${vtdebug_flag} sector512 mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size} + if [ "$grub_platform" = "pc" ]; then + linux16 $vtoy_path/ipxe.krn ${vtdebug_flag} sector512 mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size} boot - else + else chainloader ${vtoy_path}/ventoy_${VTOY_EFI_ARCH}.efi sector512 env_param=${env_param} isoefi=${LoadIsoEfiDriver} FirstTry=${FirstTryBootFile} ${vtdebug_flag} mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size} boot fi @@ -2413,8 +2413,8 @@ function mimg_common_menuentry { ventoy_cli_console chainloader ${vtoy_path}/ventoy_${VTOY_EFI_ARCH}.efi memdisk env_param=${env_param} isoefi=${LoadIsoEfiDriver} ${vtdebug_flag} mem:${vtoy_img_buf_addr}:size:${vtoy_img_buf_size} boot - ventoy_gui_console - fi + ventoy_gui_console + fi } ############################################################# @@ -2431,7 +2431,7 @@ set VENTOY_VERSION="1.1.05" set VTOY_PARAM_NO_ACPI=1 # Default menu display mode, you can change it as you want. -# 0: List mode +# 0: List mode # 1: TreeView mode set VTOY_DEFAULT_MENU_MODE=0 @@ -2454,7 +2454,7 @@ set VTOY_LANG_CMD="ventoy_language" if [ "$grub_platform" = "pc" ]; then set VTOY_TEXT_MENU_VER="Ventoy $VENTOY_VERSION BIOS www.ventoy.net" -else +else if [ "$grub_cpu" = "i386" ]; then set VTOY_EFI_ARCH=ia32 set VTOY_TEXT_MENU_VER="Ventoy $VENTOY_VERSION IA32 www.ventoy.net" @@ -2466,7 +2466,7 @@ else set VTOY_TEXT_MENU_VER="Ventoy $VENTOY_VERSION MIPS www.ventoy.net" else set VTOY_EFI_ARCH=x64 - set VTOY_TEXT_MENU_VER="Ventoy $VENTOY_VERSION UEFI www.ventoy.net" + set VTOY_TEXT_MENU_VER="Ventoy $VENTOY_VERSION UEFI www.ventoy.net" fi fi @@ -2505,7 +2505,7 @@ else set vtoydev=$vtoy_dev set vtoy_iso_part=($vtoy_dev,1) set vtoy_efi_part=($vtoy_dev,2) - + vt_load_file_to_mem "auto" $prefix/fonts/unicode.pf2 vtoy_font_mem loadfont mem:${vtoy_font_mem_addr}:size:${vtoy_font_mem_size} @@ -2582,7 +2582,7 @@ elif [ "$vtoy_display_mode" = "serial_console" ]; then serial $vtoy_serial_param fi terminal_input serial console - terminal_output serial console + terminal_output serial console else if [ "$vtoy_gfxmode" = "max" ]; then set gfxmode=1024x768 @@ -2595,7 +2595,7 @@ else terminal_output gfxterm elif [ "$vtoy_res_fit" = "1" ]; then terminal_output gfxterm - fi + fi if [ -n "$vtoy_theme" ]; then vt_set_theme @@ -2630,7 +2630,7 @@ if [ -n "$VTOY_PLUGIN_SYNTAX_ERROR" ]; then 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" + echo -e " ventoy.json 文件中有语法错误,所有é…置都ä¸ä¼šç”Ÿæ•ˆï¼Œè¯·æ£€æŸ¥ï¼\n" fi echo -e "\n press ENTER to continue (请按 回车 键继续) ..." @@ -2687,7 +2687,7 @@ vt_list_img $vtoy_iso_part ventoy_img_count #Main menu if [ $ventoy_img_count -gt 0 ]; then if [ $VTOY_DEFAULT_MENU_MODE -eq 0 ]; then - vt_dynamic_menu 0 0 + vt_dynamic_menu 0 0 else vt_dynamic_menu 0 1 fi @@ -2709,14 +2709,14 @@ fi #special VTOY_DEFAULT_IMAGE process if [ -n "$VTOY_DEFAULT_IMAGE" ]; then if regexp --set 1:vtHotkey --set 2:vtDefault "(F[2-9])>(.*)" "$VTOY_DEFAULT_IMAGE"; then - + set default="$vtDefault" if [ -z "$VTOY_MENU_TIMEOUT" ]; then set timeout=0 else set timeout=$VTOY_MENU_TIMEOUT fi - + export timeout export default @@ -2732,11 +2732,11 @@ if [ -n "$VTOY_DEFAULT_IMAGE" ]; then elif [ "$vtHotkey" = "F6" ]; then ventoy_ext_menu fi - + vt_fn_mutex_lock 0 - + unset timeout unset default - fi + fi fi diff --git a/INSTALL/grub/help/vi_VN.txt b/INSTALL/grub/help/vi_VN.txt index 304d5ccca01..7f4bb6888e0 100644 --- a/INSTALL/grub/help/vi_VN.txt +++ b/INSTALL/grub/help/vi_VN.txt @@ -3,7 +3,7 @@ F1 - Hiển thị thông tin trợ giúp F2 - Duyệt tìm và khởi động tệp từ ổ đĩa trên máy F3 - Chuyển đổi chế độ bảng chá»n giữa dạng cây <-> dạng danh sách. F4 - Khởi động Windows hoặc GNU/Linux trên đĩa cục bá»™ -F5 - Các tiện ích +F5 - Các tiện ích F6 - Tải menu GRUB2 tuỳ chá»n F7 - Chuyển giữa giao diện đồ hoạ <-> giao diện văn bản diff --git a/INSTALL/grub/hwinfo.cfg b/INSTALL/grub/hwinfo.cfg index cee2774bfd4..c7d454d2de9 100644 --- a/INSTALL/grub/hwinfo.cfg +++ b/INSTALL/grub/hwinfo.cfg @@ -1,6 +1,6 @@ -menuentry "$VTLANG_HWINFO" --class=debug_hwinfo --class=F5tool { +menuentry "$VTLANG_HWINFO" --class=debug_hwinfo --class=F5tool { smbios -t 4 -s 0x10 --set=cpu_brand - + set system_vendor="-"; smbios -t 1 -s 0x04 --set=system_vendor; set system_product="-"; @@ -23,9 +23,9 @@ menuentry "$VTLANG_HWINFO" --class=debug_hwinfo --class=F5tool { smbios -t 0 -s 0x08 --set=bios_date; set bios_size="-"; smbios -t 0 -b 0x09 --set=bios_size; - - - echo "Platform $grub_cpu-$grub_platform" + + + echo "Platform $grub_cpu-$grub_platform" if [ "$grub_platform" != "pc" ]; then echo "UEFI Version $grub_uefi_version" if vt_check_secureboot_var; then @@ -34,28 +34,28 @@ menuentry "$VTLANG_HWINFO" --class=debug_hwinfo --class=F5tool { echo "Secure Boot Disabled" fi fi - - echo "" + + echo "" echo "CPU Model $cpu_brand" echo "Physical RAM $grub_total_ram MB" - - echo "" + + echo "" echo "Manufacture $system_vendor" echo "Product Name $system_product" echo "Version $system_version" - - echo "" + + echo "" echo "Board Manufacture $board_vendor" echo "Board Name $board_product" echo "Board Version $board_version" - - echo "" + + echo "" echo "BIOS Manufacture $bios_vendor" echo "BIOS Version $bios_ver" echo "BIOS Date $bios_date" echo "BIOS ROM Size $bios_size" - - + + echo -en "\n\n\n$VTLANG_ENTER_EXIT ..." read vtInputKey } diff --git a/INSTALL/grub/localboot.cfg b/INSTALL/grub/localboot.cfg index e746f1a6120..8623185374d 100644 --- a/INSTALL/grub/localboot.cfg +++ b/INSTALL/grub/localboot.cfg @@ -1,7 +1,7 @@ if [ "$grub_platform" = "pc" ]; then menuentry "$VTLANG_LB_SBOOT_WINDOWS" --class=boot_windows --class=F4boot { - + set partid=3 while [ $partid -le 128 ]; do if vt_check_part_exist $partid; then @@ -17,7 +17,7 @@ if [ "$grub_platform" = "pc" ]; then fi vt_incr partid 1 done - + if search -n -s -f /Boot/BCD; then for bt in bootmgr BOOTMGR Bootmgr BootMGR; do if [ -f /$bt ]; then @@ -35,39 +35,39 @@ if [ "$grub_platform" = "pc" ]; then ntldr /ntldr else echo "Windows NOT found ..." - fi + fi } - + menuentry "$VTLANG_LB_SBOOT_G4D" --class=boot_g4d --class=F4boot { if search -n -s -f /grldr; then ntldr /grldr else echo "Grub4dos NOT found ..." - fi + fi } - + menuentry "$VTLANG_LB_SBOOT_HDD1" --class=boot_disk --class=F4boot { set root=(hd0,1) chainloader +1 boot } - + menuentry "$VTLANG_LB_SBOOT_HDD2" --class=boot_disk --class=F4boot { set root=(hd1,1) chainloader +1 boot } - + menuentry "$VTLANG_LB_SBOOT_HDD3" --class=boot_disk --class=F4boot { set root=(hd2,1) chainloader +1 boot } - + else - menuentry "$VTLANG_LB_SBOOT_WINDOWS" --class=boot_windows --class=F4boot { - + menuentry "$VTLANG_LB_SBOOT_WINDOWS" --class=boot_windows --class=F4boot { + set partid=3 while [ $partid -le 128 ]; do if vt_check_part_exist $partid; then @@ -103,9 +103,9 @@ else boot else echo "Windows NOT found ..." - fi + fi } - + if [ "$grub_cpu" = "i386" ]; then menuentry "$VTLANG_LB_SBOOT_IA32EFI" --class=boot_uefi --class=F4boot { set VTOY_SEARCH_NO_VTOYEFI=1 @@ -122,9 +122,9 @@ else else unset VTOY_SEARCH_NO_VTOYEFI echo "BOOTIA32.EFI NOT found ..." - fi + fi } - + menuentry "$VTLANG_LB_SBOOT_XORBOOT" --class=boot_xorboot --class=F4boot { set VTOY_SEARCH_NO_VTOYEFI=1 if search -n -s -f /efi/xorboot/xorboot32.xor; then @@ -148,7 +148,7 @@ else else unset VTOY_SEARCH_NO_VTOYEFI echo "xorboot NOT found ..." - fi + fi } elif [ "$grub_cpu" = "arm64" ]; then menuentry "$VTLANG_LB_SBOOT_AA64EFI" --class=boot_uefi --class=F4boot { @@ -166,7 +166,7 @@ else else unset VTOY_SEARCH_NO_VTOYEFI echo "BOOTAA64.EFI NOT found ..." - fi + fi } else menuentry "$VTLANG_LB_SBOOT_X64EFI" --class=boot_uefi --class=F4boot { @@ -184,7 +184,7 @@ else else unset VTOY_SEARCH_NO_VTOYEFI echo "BOOTX64.EFI NOT found ..." - fi + fi } menuentry "$VTLANG_LB_SBOOT_XORBOOT" --class=boot_xorboot --class=F4boot { @@ -210,10 +210,10 @@ else else unset VTOY_SEARCH_NO_VTOYEFI echo "xorboot NOT found ..." - fi + fi } fi - + fi diff --git a/INSTALL/grub/menu/ar_AR.json b/INSTALL/grub/menu/ar_AR.json index 8bfbd9ab7ad..c284543a924 100644 --- a/INSTALL/grub/menu/ar_AR.json +++ b/INSTALL/grub/menu/ar_AR.json @@ -1,13 +1,13 @@ { "VTLANG_LANGUAGE_NAME": "Arabic (العربية)", - + "VTLANG_STR_HOTKEY_LIST": "L: لغة F1: مساعدة F2: ØªØµÙØ­ F3: عرض لائحي F4: إقلاع محلي F5: أدوات F6: عوده", "VTLANG_STR_HOTKEY_TREE": "L: لغة F1: مساعدة F2: ØªØµÙØ­ F3: عرض شجري F4: إقلاع محلي F5: أدوات F6: عوده", "VTLANG_RETURN_PREVIOUS": "عودة إلى القائمة السابقة [Esc]", "VTLANG_RETURN_PRV_NOESC": "عودة إلى القائمة السابقة", - + "VTLANG_MENU_LANG": "اختيار اللغة ÙÙŠ القائمة", - + "VTLANG_LB_SBOOT_WINDOWS": "البحث والإقلاع على Windows", "VTLANG_LB_SBOOT_G4D": "البحث والإقلاع على Grub4dos", "VTLANG_LB_SBOOT_HDD1": "الإقلاع على القرص المحلي الأول", @@ -17,7 +17,7 @@ "VTLANG_LB_SBOOT_IA32EFI": "البحث والإقلاع على BOOTIA32.EFI", "VTLANG_LB_SBOOT_AA64EFI": "البحث والإقلاع على BOOTAA64.EFI", "VTLANG_LB_SBOOT_XORBOOT": "البحث والإقلاع على xorboot", - + "VTLANG_FILE_CHKSUM": "تدقيق المجموع للملÙ", "VTLANG_CHKSUM_MD5_CALC": "احسب md5sum", "VTLANG_CHKSUM_SHA1_CALC": "احسب sha1sum", @@ -27,26 +27,26 @@ "VTLANG_CHKSUM_SHA1_CALC_CHK": "احسب وتحقق sha1sum", "VTLANG_CHKSUM_SHA256_CALC_CHK": "احسب وتحقق sha256sum", "VTLANG_CHKSUM_SHA512_CALC_CHK": "احسب وتحقق sha512sum", - + "VTLANG_POWER": "الطاقة", "VTLANG_POWER_REBOOT": "إعادة التشغيل", "VTLANG_POWER_HALT": "إيقاÙ", "VTLANG_POWER_BOOT_EFIFW": "إعادة التشغيل إلى إعداد EFI", - + "VTLANG_KEYBRD_LAYOUT": "تخطيطات لوحة Ø§Ù„Ù…ÙØ§ØªÙŠØ­", "VTLANG_HWINFO": "معلومات حول العتاد", - + "VTLANG_RESOLUTION_CFG": "تكوين الدقة", "VTLANG_SCREEN_MODE": "وضع عرض الشاشة", "VTLANG_SCREEN_TEXT_MODE": "ÙØ±Ø¶ تحديد وضع النص", "VTLANG_SCREEN_GUI_MODE": "ÙØ±Ø¶ تحديد وضع الرسومات", - + "VTLANG_THEME_SELECT": "اختر السمة", - + "VTLANG_UEFI_UTIL": "أدوات Ventoy UEFI المساعدة", "VTLANG_UTIL_SHOW_EFI_DRV": "عرض برامج تشغيل EFI", "VTLANG_UTIL_FIX_BLINIT_FAIL": "إصلاح ÙØ´Ù„ تهيئة Windows BlinitializeLibrary", - + "VTLANG_JSON_CHK_JSON": "التحقق من تكوين json للبرنامج الإضاÙÙŠ (ventoy.json)", "VTLANG_JSON_CHK_CONTROL": "التحقق من تكوين برنامج الإضاÙÙŠ العام للتحكم", "VTLANG_JSON_CHK_THEME": "التحقق من تكوين برنامج الإضاÙÙŠ الخاص بالسمة", @@ -62,32 +62,32 @@ "VTLANG_JSON_CHK_CONF_REPLACE": "التحقق من تكوين برنامج الإضاÙÙŠ الخاص باستبدال مل٠التكوين للإقلاع", "VTLANG_JSON_CHK_DUD": "التحقق من تكوين برنامج الإضاÙÙŠ الخاص بـ dud", "VTLANG_JSON_CHK_PASSWORD": "التحقق من تكوين برنامج الإضاÙÙŠ الخاص بكلمة المرور", - + "VTLANG_NORMAL_MODE": "الإقلاع ÙÙŠ الوضع العادي", "VTLANG_WIMBOOT_MODE": "الإقلاع ÙÙŠ وضع wimboot", "VTLANG_GRUB2_MODE": "الإقلاع ÙÙŠ وضع grub2", "VTLANG_MEMDISK_MODE": "الإقلاع ÙÙŠ وضع memdisk", - + "VTLANG_RET_TO_LISTVIEW": "العودة إلى ListView", "VTLANG_RET_TO_TREEVIEW": "العودة إلى TreeView", - + "VTLANG_NO_AUTOINS_SCRIPT": "الإقلاع بدون قالب التثبيت التلقائي", "VTLANG_AUTOINS_USE": "الإقلاع مع", - + "VTLANG_NO_PERSIST": "الإقلاع بدون الاستمرارية", "VTLANG_PERSIST_USE": "الإقلاع مع", - + "VTLANG_BROWER_RETURN": "العودة", - + "VTLANG_ENTER_EXIT": "اضغط على Ù…ÙØªØ§Ø­ Enter للخروج", "VTLANG_ENTER_REBOOT": "اضغط على Ù…ÙØªØ§Ø­ Enter لإعادة التشغيل", "VTLANG_ENTER_CONTINUE": "اضغط على Ù…ÙØªØ§Ø­ Enter للمتابعة", - + "VTLANG_CTRL_TEMP_SET": "إعدادات التحكم المؤقتة", "VTLANG_WIN11_BYPASS_CHECK": "تجاوز ÙØ­Øµ CPU/TPM/SecureBoot عند تثبيت Windows 11", "VTLANG_WIN11_BYPASS_NRO": "تجاوز متطلبات الحساب عبر الإنترنت عند تثبيت Windows 11", "VTLANG_LINUX_REMOUNT": "ضم قسم Ventoy بعد إقلاع Linux", "VTLANG_SECONDARY_BOOT_MENU": "اظهر قائمة الإقلاع الثانوية", - + "MENU_STR_XXX": "" } diff --git a/INSTALL/grub/menu/bn_BN.json b/INSTALL/grub/menu/bn_BN.json index c76442dad7c..09d7bd7e729 100644 --- a/INSTALL/grub/menu/bn_BN.json +++ b/INSTALL/grub/menu/bn_BN.json @@ -1,13 +1,13 @@ { "VTLANG_LANGUAGE_NAME": "Bengali (বাংলা)", - + "VTLANG_STR_HOTKEY_LIST": "L:ভাষা F1:সাহাযà§à¦¯ F2:Browser F3:ListView F4:Localboot F5:Tools F6:ExMenu", "VTLANG_STR_HOTKEY_TREE": "L:ভাষা F1:সাহাযà§à¦¯ F2:Browser F3:TreeView F4:Localboot F5:Tools F6:ExMenu", "VTLANG_RETURN_PREVIOUS": "পূরà§à¦¬à¦¬à¦°à§à¦¤à§€ মেনà§à¦¤à§‡ ফিরে যান [Esc]", "VTLANG_RETURN_PRV_NOESC": "পূরà§à¦¬à¦¬à¦°à§à¦¤à§€ মেনà§à¦¤à§‡ ফিরে যান", - + "VTLANG_MENU_LANG": "মেনৠভাষা নিরà§à¦¬à¦¾à¦šà¦¨ করà§à¦¨", - + "VTLANG_LB_SBOOT_WINDOWS": "Windows অনà§à¦¸à¦¨à§à¦§à¦¾à¦¨ করà§à¦¨ à¦à¦¬à¦‚ বà§à¦Ÿ করà§à¦¨", "VTLANG_LB_SBOOT_G4D": "Grub4dos অনà§à¦¸à¦¨à§à¦§à¦¾à¦¨ করà§à¦¨ à¦à¦¬à¦‚ বà§à¦Ÿ করà§à¦¨", "VTLANG_LB_SBOOT_HDD1": "১ম(1st) সà§à¦¥à¦¾à¦¨à§€à¦¯à¦¼ ডিসà§à¦• বà§à¦Ÿ করà§à¦¨", @@ -17,7 +17,7 @@ "VTLANG_LB_SBOOT_IA32EFI": "BOOTIA32.EFI অনà§à¦¸à¦¨à§à¦§à¦¾à¦¨ করà§à¦¨ à¦à¦¬à¦‚ বà§à¦Ÿ করà§à¦¨", "VTLANG_LB_SBOOT_AA64EFI": "BOOTAA64.EFI অনà§à¦¸à¦¨à§à¦§à¦¾à¦¨ করà§à¦¨ à¦à¦¬à¦‚ বà§à¦Ÿ করà§à¦¨", "VTLANG_LB_SBOOT_XORBOOT": "xorboot অনà§à¦¸à¦¨à§à¦§à¦¾à¦¨ করà§à¦¨ à¦à¦¬à¦‚ বà§à¦Ÿ করà§à¦¨", - + "VTLANG_FILE_CHKSUM": "ফাইল চেকসাম", "VTLANG_CHKSUM_MD5_CALC": "md5sum গণনা করà§à¦¨", "VTLANG_CHKSUM_SHA1_CALC": "sha1sum গণনা করà§à¦¨", @@ -27,26 +27,26 @@ "VTLANG_CHKSUM_SHA1_CALC_CHK": "গণনা করà§à¦¨ à¦à¦¬à¦‚ sha1sum চেক করà§à¦¨", "VTLANG_CHKSUM_SHA256_CALC_CHK": "গণনা করà§à¦¨ à¦à¦¬à¦‚ sha256sum চেক করà§à¦¨", "VTLANG_CHKSUM_SHA512_CALC_CHK": "গণনা করà§à¦¨ à¦à¦¬à¦‚ sha512sum চেক করà§à¦¨", - + "VTLANG_POWER": "পাওয়ার", "VTLANG_POWER_REBOOT": "রিবà§à¦Ÿ", "VTLANG_POWER_HALT": "হলà§à¦Ÿ", "VTLANG_POWER_BOOT_EFIFW": "EFI সেটআপে রিবà§à¦Ÿ করà§à¦¨", - + "VTLANG_KEYBRD_LAYOUT": "কীবোরà§à¦¡ লেআউট", "VTLANG_HWINFO": "হারà§à¦¡à¦“য়à§à¦¯à¦¾à¦° তথà§à¦¯", - + "VTLANG_RESOLUTION_CFG": "রেজোলিউশন কনফিগারেশন", "VTLANG_SCREEN_MODE": "Screen Display মোড", "VTLANG_SCREEN_TEXT_MODE": "Force Text মোড", "VTLANG_SCREEN_GUI_MODE": "Force Graphics মোড", - + "VTLANG_THEME_SELECT": "থিম নিরà§à¦¬à¦¾à¦šà¦¨ করà§à¦¨", - + "VTLANG_UEFI_UTIL": "Ventoy UEFI ইউটিলিটিস", "VTLANG_UTIL_SHOW_EFI_DRV": "EFI ডà§à¦°à¦¾à¦‡à¦­à¦¾à¦° দেখান", "VTLANG_UTIL_FIX_BLINIT_FAIL": "Windows BlinitializeLibrary বà§à¦¯à¦°à§à¦¥à¦¤à¦¾à¦° সমাধান করà§à¦¨", - + "VTLANG_JSON_CHK_JSON": "পà§à¦²à¦¾à¦—ইন json কনফিগারেশন পরীকà§à¦·à¦¾ করà§à¦¨ (ventoy.json)", "VTLANG_JSON_CHK_CONTROL": "গà§à¦²à§‹à¦¬à¦¾à¦² কনà§à¦Ÿà§à¦°à§‹à¦² পà§à¦²à¦¾à¦—ইন কনফিগারেশন চেক করà§à¦¨", "VTLANG_JSON_CHK_THEME": "থিম পà§à¦²à¦¾à¦—ইন কনফিগারেশন পরীকà§à¦·à¦¾ করà§à¦¨", @@ -62,32 +62,32 @@ "VTLANG_JSON_CHK_CONF_REPLACE": "boot conf replace পà§à¦²à¦¾à¦—ইন কনফিগারেশন পরীকà§à¦·à¦¾ করà§à¦¨", "VTLANG_JSON_CHK_DUD": "dud পà§à¦²à¦¾à¦—ইন কনফিগারেশন পরীকà§à¦·à¦¾ করà§à¦¨", "VTLANG_JSON_CHK_PASSWORD": "password পà§à¦²à¦¾à¦—ইন কনফিগারেশন পরীকà§à¦·à¦¾ করà§à¦¨", - + "VTLANG_NORMAL_MODE": "সাধারণ মোডে বà§à¦Ÿ করà§à¦¨", "VTLANG_WIMBOOT_MODE": "wimboot মোডে বà§à¦Ÿ করà§à¦¨", "VTLANG_GRUB2_MODE": "grub2 মোডে বà§à¦Ÿ করà§à¦¨", "VTLANG_MEMDISK_MODE": "memdisk মোডে বà§à¦Ÿ করà§à¦¨", - + "VTLANG_RET_TO_LISTVIEW": "ListView-ঠফিরে যান", "VTLANG_RET_TO_TREEVIEW": "TreeView-ঠফিরে যান", - + "VTLANG_NO_AUTOINS_SCRIPT": "auto install মোড বিনা বà§à¦Ÿ করà§à¦¨", "VTLANG_AUTOINS_USE": "দিয়ে বà§à¦Ÿ করà§à¦¨", - + "VTLANG_NO_PERSIST": "persistence বিনা বà§à¦Ÿ করà§à¦¨", "VTLANG_PERSIST_USE": "দিয়ে বà§à¦Ÿ করà§à¦¨", - + "VTLANG_BROWER_RETURN": "ফিরে", - + "VTLANG_ENTER_EXIT": "পà§à¦°à¦¸à§à¦¥à¦¾à¦¨ করার জনà§à¦¯ à¦à¦¨à§à¦Ÿà¦¾à¦° কী টিপà§à¦¨", "VTLANG_ENTER_REBOOT": "রিবà§à¦Ÿ করতে à¦à¦¨à§à¦Ÿà¦¾à¦° কী টিপà§à¦¨", "VTLANG_ENTER_CONTINUE": "চালিয়ে যেতে à¦à¦¨à§à¦Ÿà¦¾à¦° কী টিপà§à¦¨", - + "VTLANG_CTRL_TEMP_SET": "অসà§à¦¥à¦¾à¦¯à¦¼à§€ নিয়নà§à¦¤à§à¦°à¦£ সেটিংস", "VTLANG_WIN11_BYPASS_CHECK": "Windows 11 ইনসà§à¦Ÿà¦² করার সময় CPU/TPM/SecureBoot চেক বাইপাস করà§à¦¨", "VTLANG_WIN11_BYPASS_NRO": "Windows 11 ইনসà§à¦Ÿà¦² করার সময় অনলাইন অà§à¦¯à¦¾à¦•াউনà§à¦Ÿà§‡à¦° পà§à¦°à¦¯à¦¼à§‹à¦œà¦¨ বাইপাস করà§à¦¨", "VTLANG_LINUX_REMOUNT": "লিনাকà§à¦¸ বà§à¦Ÿà§‡à¦° পরে ভেনà§à¦Ÿà¦¯à¦¼ পারà§à¦Ÿà¦¿à¦¶à¦¨à¦Ÿà¦¿ মাউনà§à¦Ÿ করà§à¦¨", "VTLANG_SECONDARY_BOOT_MENU": "গৌণ বà§à¦Ÿ মেনৠদেখান", - + "MENU_STR_XXX": "" } diff --git a/INSTALL/grub/menu/cs_CZ.json b/INSTALL/grub/menu/cs_CZ.json index 2368e952fc5..a469a35b7a1 100644 --- a/INSTALL/grub/menu/cs_CZ.json +++ b/INSTALL/grub/menu/cs_CZ.json @@ -1,13 +1,13 @@ { "VTLANG_LANGUAGE_NAME": "Czech (ÄŒeÅ¡tina)", - + "VTLANG_STR_HOTKEY_LIST": "L:Jazyk F1:NápovÄ›da F2:Procházet F3:Seznam F4:Místní boot F5:Nástroje F6:Rozšířená nabídka", "VTLANG_STR_HOTKEY_TREE": "L:Jazyk F1:NápovÄ›da F2:Procházet F3:Strom F4:Místní boot F5:Nástroje F6:Rozšířená nabídka", "VTLANG_RETURN_PREVIOUS": "Vrátit do pÅ™edchozí nabídky [Esc]", "VTLANG_RETURN_PRV_NOESC": "Vrátit do pÅ™edchozí nabídky", - + "VTLANG_MENU_LANG": "VýbÄ›rt jazyka nabídel", - + "VTLANG_LB_SBOOT_WINDOWS": "Najít a spustit Windows", "VTLANG_LB_SBOOT_G4D": "Najít a spustit Grub4dos", "VTLANG_LB_SBOOT_HDD1": "Spustit 1. místní disk", @@ -17,7 +17,7 @@ "VTLANG_LB_SBOOT_IA32EFI": "Najít a spustit BOOTIA32.EFI", "VTLANG_LB_SBOOT_AA64EFI": "Najít a spustit BOOTAA64.EFI", "VTLANG_LB_SBOOT_XORBOOT": "Najít a spustit xorboot", - + "VTLANG_FILE_CHKSUM": "Kontrolní souÄet souboru", "VTLANG_CHKSUM_MD5_CALC": "SpoÄítat md5sum", "VTLANG_CHKSUM_SHA1_CALC": "SpoÄítat sha1sum", @@ -27,26 +27,26 @@ "VTLANG_CHKSUM_SHA1_CALC_CHK": "SpoÄítat a ověřit sha1sum", "VTLANG_CHKSUM_SHA256_CALC_CHK": "SpoÄítat a ověřit sha256sum", "VTLANG_CHKSUM_SHA512_CALC_CHK": "SpoÄítat a ověřit sha512sum", - + "VTLANG_POWER": "Napájení", "VTLANG_POWER_REBOOT": "Restartovat", "VTLANG_POWER_HALT": "Vypnout", "VTLANG_POWER_BOOT_EFIFW": "Restartovat do EFI nastavení", - + "VTLANG_KEYBRD_LAYOUT": "Rozložení klávesnice", "VTLANG_HWINFO": "Informace o hardwaru", - + "VTLANG_RESOLUTION_CFG": "Nastavení roliÅ¡ení", "VTLANG_SCREEN_MODE": "Nastavení režimu zobrazení", "VTLANG_SCREEN_TEXT_MODE": "Vynutit textový režim", "VTLANG_SCREEN_GUI_MODE": "Vynutit grafický režim", - + "VTLANG_THEME_SELECT": "VýbÄ›r motivu", - + "VTLANG_UEFI_UTIL": "Ventoy UEFI nástroje", "VTLANG_UTIL_SHOW_EFI_DRV": "Zobrazit EFI ovladaÄe", "VTLANG_UTIL_FIX_BLINIT_FAIL": "Opravit chybu Windows BlinitializeLibrary", - + "VTLANG_JSON_CHK_JSON": "Zkontrolovat json konfiguraci zásuvných modulů (ventoy.json)", "VTLANG_JSON_CHK_CONTROL": "Zkontrolovat konfiguraci hlavního zásuvného modulu", "VTLANG_JSON_CHK_THEME": "Zkontrolovat konfiguraci zásuvného modulu motivů", @@ -62,32 +62,32 @@ "VTLANG_JSON_CHK_CONF_REPLACE": "Zkontrolovat konfiguraci zásuvného modulu nahrazení konfigurace spouÅ¡tÄ›ní", "VTLANG_JSON_CHK_DUD": "Zkontrolovat konfiguraci zásuvného modulu dud", "VTLANG_JSON_CHK_PASSWORD": "Zkontrolovat konfiguraci zásuvného modulu hesla", - + "VTLANG_NORMAL_MODE": "Spustit normálnÄ›", "VTLANG_WIMBOOT_MODE": "Spustit v režimu wimboot", "VTLANG_GRUB2_MODE": "Spustit v režimu grub2", "VTLANG_MEMDISK_MODE": "Spustit v režimu memdisk", - + "VTLANG_RET_TO_LISTVIEW": "Vrátis do zobrazení seznamu", "VTLANG_RET_TO_TREEVIEW": "Vrátit do zobrazení stromu", - + "VTLANG_NO_AUTOINS_SCRIPT": "Spustit bez Å¡ablony automatické instalace", "VTLANG_AUTOINS_USE": "Spustit s", - + "VTLANG_NO_PERSIST": "Spustit bez perzistence", "VTLANG_PERSIST_USE": "Spustit s", - + "VTLANG_BROWER_RETURN": "Vrátit", - + "VTLANG_ENTER_EXIT": "zmáÄknÄ›te Enter pro ukonÄení", "VTLANG_ENTER_REBOOT": "zmáÄknÄ›te Enter pro restart", "VTLANG_ENTER_CONTINUE": "zmáÄknÄ›te enter pro pokraÄování", - + "VTLANG_CTRL_TEMP_SET": "DoÄasné řídící nastavení", "VTLANG_WIN11_BYPASS_CHECK": "Obejít CPU/TPM/SecureBoot kontrolu pÅ™i instalaci Windows 11", "VTLANG_WIN11_BYPASS_NRO": "Obejít požadování online úÄtu pÅ™i instalaci Windows 11", "VTLANG_LINUX_REMOUNT": "PÅ™ipojit Ventoy oddíl po spuÅ¡tÄ›ní Linuxu", "VTLANG_SECONDARY_BOOT_MENU": "Zobrazit druhou spouÅ¡tÄ›cí nabídku", - + "MENU_STR_XXX": "" } diff --git a/INSTALL/grub/menu/de_DE.json b/INSTALL/grub/menu/de_DE.json index 050ec05db1a..199117bd9f0 100644 --- a/INSTALL/grub/menu/de_DE.json +++ b/INSTALL/grub/menu/de_DE.json @@ -1,13 +1,13 @@ { "VTLANG_LANGUAGE_NAME": "German (Deutsch)", - + "VTLANG_STR_HOTKEY_LIST": "L:Sprache F1:Hilfe F2:Browser F3:Listenansicht F4:Lokaler Start F5:Werkzeuge F6:Erweitert", "VTLANG_STR_HOTKEY_TREE": "L:Sprache F1:Hilfe F2:Browser F3:Listenansicht F4:Lokaler Start F5:Werkzeuge F6:Erweitert", "VTLANG_RETURN_PREVIOUS": "Zu vorherigem Menü [Esc]", "VTLANG_RETURN_PRV_NOESC": "Zu vorherigem Menü", - + "VTLANG_MENU_LANG": "Menüsprache auswählen", - + "VTLANG_LB_SBOOT_WINDOWS": "Windows suchen und starten", "VTLANG_LB_SBOOT_G4D": "Grub4dos suchen und starten", "VTLANG_LB_SBOOT_HDD1": "Vom ersten lokalen Datenträger starten", @@ -17,7 +17,7 @@ "VTLANG_LB_SBOOT_IA32EFI": "BOOTIA32.EFI suchen und starten", "VTLANG_LB_SBOOT_AA64EFI": "BOOTAA64.EFI suchen und starten", "VTLANG_LB_SBOOT_XORBOOT": "xorboot suchen und starten", - + "VTLANG_FILE_CHKSUM": "Dateiprüfsumme", "VTLANG_CHKSUM_MD5_CALC": "md5sum berechnen", "VTLANG_CHKSUM_SHA1_CALC": "sha1sum berechnen", @@ -27,26 +27,26 @@ "VTLANG_CHKSUM_SHA1_CALC_CHK": "sha1sum berechnen und prüfen", "VTLANG_CHKSUM_SHA256_CALC_CHK": "sha256sum berechnen und prüfen", "VTLANG_CHKSUM_SHA512_CALC_CHK": "sha512sum berechnen und prüfen", - + "VTLANG_POWER": "Power", "VTLANG_POWER_REBOOT": "Neustart", "VTLANG_POWER_HALT": "Herunterfahren", "VTLANG_POWER_BOOT_EFIFW": "Neustart in EFI-Konfiguration", - + "VTLANG_KEYBRD_LAYOUT": "Tastaturlayout", "VTLANG_HWINFO": "Hardwareinformationen", - + "VTLANG_RESOLUTION_CFG": "Auflösungseinstellungen", "VTLANG_SCREEN_MODE": "Bildschirmanzeigemodus", "VTLANG_SCREEN_TEXT_MODE": "Textmodus erzwingen", "VTLANG_SCREEN_GUI_MODE": "Grafikmodus erzwingen", - + "VTLANG_THEME_SELECT": "Design auswählen", - + "VTLANG_UEFI_UTIL": "Ventoy UEFI-Dienstprogramme", "VTLANG_UTIL_SHOW_EFI_DRV": "EFI-Treiber anzeigen", "VTLANG_UTIL_FIX_BLINIT_FAIL": "Windows BlinitializeLibrary Fehler beheben", - + "VTLANG_JSON_CHK_JSON": "Konfiguration des JSON-Plugins prüfen (ventoy.json)", "VTLANG_JSON_CHK_CONTROL": "Konfiguration des Plugins für die allgemeine Kontrolle prüfen", "VTLANG_JSON_CHK_THEME": "Konfiguration des Design-Plugins prüfen", @@ -62,32 +62,32 @@ "VTLANG_JSON_CHK_CONF_REPLACE": "Konfiguration des Boot-Conf-Replace-Plugins prüfen", "VTLANG_JSON_CHK_DUD": "Konfiguration des dud-Plugins prüfen", "VTLANG_JSON_CHK_PASSWORD": "Konfiguration des Passwort-Plugins prüfen", - + "VTLANG_NORMAL_MODE": "In Normal-Modus starten", "VTLANG_WIMBOOT_MODE": "In wimboot-Modus starten", "VTLANG_GRUB2_MODE": "In grub2-Modus starten", "VTLANG_MEMDISK_MODE": "In memdisk-Modus starten", - + "VTLANG_RET_TO_LISTVIEW": "Zurück zur Listenansicht", "VTLANG_RET_TO_TREEVIEW": "Zurück zur Baumansicht", - + "VTLANG_NO_AUTOINS_SCRIPT": "Ohne Vorlage für die automatische Installation starten", "VTLANG_AUTOINS_USE": "Start mit", - + "VTLANG_NO_PERSIST": "Ohne Persistenz starten", "VTLANG_PERSIST_USE": "Start mit", - + "VTLANG_BROWER_RETURN": "Zurück", - + "VTLANG_ENTER_EXIT": "Drücken Sie zum Beenden die Eingabetaste", "VTLANG_ENTER_REBOOT": "Drücken Sie die Eingabetaste, um neu zu starten", "VTLANG_ENTER_CONTINUE": "Drücken Sie die Eingabetaste, um fortzufahren", - + "VTLANG_CTRL_TEMP_SET": "Temporäre Steuerungseinstellungen", "VTLANG_WIN11_BYPASS_CHECK": "Umgehen Sie die CPU/TPM/SecureBoot-Prüfung bei der Installation von Windows 11", "VTLANG_WIN11_BYPASS_NRO": "Umgehen Sie die Online-Kontoanforderung bei der Installation von Windows 11", "VTLANG_LINUX_REMOUNT": "Mounten Sie die Ventoy-Partition nach dem Booten von Linux", "VTLANG_SECONDARY_BOOT_MENU": "Sekundäres Bootmenü anzeigen", - + "MENU_STR_XXX": "" } diff --git a/INSTALL/grub/menu/en_US.json b/INSTALL/grub/menu/en_US.json index 6c4c5332973..efb0b2c2673 100644 --- a/INSTALL/grub/menu/en_US.json +++ b/INSTALL/grub/menu/en_US.json @@ -1,13 +1,13 @@ { "VTLANG_LANGUAGE_NAME": "English (English)", - + "VTLANG_STR_HOTKEY_LIST": "L:Language F1:Help F2:Browse F3:ListView F4:Localboot F5:Tools F6:ExMenu", "VTLANG_STR_HOTKEY_TREE": "L:Language F1:Help F2:Browse F3:TreeView F4:Localboot F5:Tools F6:ExMenu", "VTLANG_RETURN_PREVIOUS": "Return to previous menu [Esc]", "VTLANG_RETURN_PRV_NOESC": "Return to previous menu", - + "VTLANG_MENU_LANG": "Menu Language Select", - + "VTLANG_LB_SBOOT_WINDOWS": "Search and boot Windows", "VTLANG_LB_SBOOT_G4D": "Search and boot Grub4dos", "VTLANG_LB_SBOOT_HDD1": "Boot the 1st local disk", @@ -17,7 +17,7 @@ "VTLANG_LB_SBOOT_IA32EFI": "Search and boot BOOTIA32.EFI", "VTLANG_LB_SBOOT_AA64EFI": "Search and boot BOOTAA64.EFI", "VTLANG_LB_SBOOT_XORBOOT": "Search and boot xorboot", - + "VTLANG_FILE_CHKSUM": "File checksum", "VTLANG_CHKSUM_MD5_CALC": "Calculate md5sum", "VTLANG_CHKSUM_SHA1_CALC": "Calculate sha1sum", @@ -27,26 +27,26 @@ "VTLANG_CHKSUM_SHA1_CALC_CHK": "Calculate and check sha1sum", "VTLANG_CHKSUM_SHA256_CALC_CHK": "Calculate and check sha256sum", "VTLANG_CHKSUM_SHA512_CALC_CHK": "Calculate and check sha512sum", - + "VTLANG_POWER": "Power", "VTLANG_POWER_REBOOT": "Reboot", "VTLANG_POWER_HALT": "Halt", "VTLANG_POWER_BOOT_EFIFW": "Reboot to EFI setup", - + "VTLANG_KEYBRD_LAYOUT": "Keyboard Layouts", "VTLANG_HWINFO": "Hardware Information", - + "VTLANG_RESOLUTION_CFG": "Resolution Configuration", "VTLANG_SCREEN_MODE": "Screen Display Mode", "VTLANG_SCREEN_TEXT_MODE": "Force Text Mode", "VTLANG_SCREEN_GUI_MODE": "Force Graphics Mode", - + "VTLANG_THEME_SELECT": "Theme Select", - + "VTLANG_UEFI_UTIL": "Ventoy UEFI Utilities", "VTLANG_UTIL_SHOW_EFI_DRV": "Show EFI Drivers", "VTLANG_UTIL_FIX_BLINIT_FAIL": "Fixup Windows BlinitializeLibrary Failure", - + "VTLANG_JSON_CHK_JSON": "Check plugin json configuration (ventoy.json)", "VTLANG_JSON_CHK_CONTROL": "Check global control plugin configuration", "VTLANG_JSON_CHK_THEME": "Check theme plugin configuration", @@ -62,32 +62,32 @@ "VTLANG_JSON_CHK_CONF_REPLACE": "Check boot conf replace plugin configuration", "VTLANG_JSON_CHK_DUD": "Check dud plugin configuration", "VTLANG_JSON_CHK_PASSWORD": "Check password plugin configuration", - + "VTLANG_NORMAL_MODE": "Boot in normal mode", "VTLANG_WIMBOOT_MODE": "Boot in wimboot mode", "VTLANG_GRUB2_MODE": "Boot in grub2 mode", "VTLANG_MEMDISK_MODE": "Boot in memdisk mode", - + "VTLANG_RET_TO_LISTVIEW": "Return to ListView", "VTLANG_RET_TO_TREEVIEW": "Return to TreeView", - + "VTLANG_NO_AUTOINS_SCRIPT": "Boot without auto installation template", "VTLANG_AUTOINS_USE": "Boot with", - + "VTLANG_NO_PERSIST": "Boot without persistence", "VTLANG_PERSIST_USE": "Boot with", - + "VTLANG_BROWER_RETURN": "Return", - + "VTLANG_ENTER_EXIT": "press Enter key to exit", "VTLANG_ENTER_REBOOT": "press Enter key to reboot", "VTLANG_ENTER_CONTINUE": "press Enter key to continue", - + "VTLANG_CTRL_TEMP_SET": "Temporary Control Settings", "VTLANG_WIN11_BYPASS_CHECK": "Bypass CPU/TPM/SecureBoot check when install Windows 11", "VTLANG_WIN11_BYPASS_NRO": "Bypass online account requirement when install Windows 11", "VTLANG_LINUX_REMOUNT": "Mount Ventoy partition after boot Linux", "VTLANG_SECONDARY_BOOT_MENU": "Show secondary boot menu", - + "MENU_STR_XXX": "" } diff --git a/INSTALL/grub/menu/es_ES.json b/INSTALL/grub/menu/es_ES.json index 69bbcd80e41..6dd00df4847 100644 --- a/INSTALL/grub/menu/es_ES.json +++ b/INSTALL/grub/menu/es_ES.json @@ -1,13 +1,13 @@ { "VTLANG_LANGUAGE_NAME": "Spanish (Español)", - + "VTLANG_STR_HOTKEY_LIST": "L:Lenguaje F1:Ayuda F2:Navegar F3:Vista de lista F4:Arranque local F5:Herramientas F6:Extensión de menú", "VTLANG_STR_HOTKEY_TREE": "L:Lenguaje F1:Ayuda F2:Navegar F3:Vista de árbol F4:Arranque local F5:Herramientas F6:Extensión de menú", "VTLANG_RETURN_PREVIOUS": "Regresar al menú previo [Esc]", "VTLANG_RETURN_PRV_NOESC": "Regresar al menú previo", - + "VTLANG_MENU_LANG": "Selección de idioma del menú", - + "VTLANG_LB_SBOOT_WINDOWS": "Buscar y arrancar Windows", "VTLANG_LB_SBOOT_G4D": "Buscar y arrancar Grub4dos", "VTLANG_LB_SBOOT_HDD1": "Arrancar el 1er disco local", @@ -17,7 +17,7 @@ "VTLANG_LB_SBOOT_IA32EFI": "Buscar y arrancar BOOTIA32.EFI", "VTLANG_LB_SBOOT_AA64EFI": "Buscar y arrancar BOOTAA64.EFI", "VTLANG_LB_SBOOT_XORBOOT": "Buscar y arrancar xorboot", - + "VTLANG_FILE_CHKSUM": "Suma de comprobación del archivo", "VTLANG_CHKSUM_MD5_CALC": "Calcular md5sum", "VTLANG_CHKSUM_SHA1_CALC": "Calcular sha1sum", @@ -27,26 +27,26 @@ "VTLANG_CHKSUM_SHA1_CALC_CHK": "Calcular y comprobar sha1sum", "VTLANG_CHKSUM_SHA256_CALC_CHK": "Calcular y comprobar sha256sum", "VTLANG_CHKSUM_SHA512_CALC_CHK": "Calcular y comprobar sha512sum", - + "VTLANG_POWER": "Poder", "VTLANG_POWER_REBOOT": "Reiniciar", "VTLANG_POWER_HALT": "Detener", "VTLANG_POWER_BOOT_EFIFW": "Reiniciar a configuración EFI", - + "VTLANG_KEYBRD_LAYOUT": "Distribuciones de teclado", "VTLANG_HWINFO": "Información de Hardware", - + "VTLANG_RESOLUTION_CFG": "Configuración de resolución", "VTLANG_SCREEN_MODE": "Modo de visualización de pantalla", "VTLANG_SCREEN_TEXT_MODE": "Forzar modo texto", "VTLANG_SCREEN_GUI_MODE": "Forzar modo gráfico", - + "VTLANG_THEME_SELECT": "Selección de tema", - + "VTLANG_UEFI_UTIL": "Utilidades UEFI de Ventoy", "VTLANG_UTIL_SHOW_EFI_DRV": "Mostrar controladores EFI", "VTLANG_UTIL_FIX_BLINIT_FAIL": "Reparar la falla de BinitializeLibrary de Windows", - + "VTLANG_JSON_CHK_JSON": "Comprobar configuración de complemento de json (ventoy.json)", "VTLANG_JSON_CHK_CONTROL": "Comprobar configuración de complemento de control global", "VTLANG_JSON_CHK_THEME": "Comprobar configuración de complemento de tema", @@ -62,32 +62,32 @@ "VTLANG_JSON_CHK_CONF_REPLACE": "Comprobar configuración de complemento de reemplazo de configuración de arranque", "VTLANG_JSON_CHK_DUD": "Comprobar configuración de complemento de dud", "VTLANG_JSON_CHK_PASSWORD": "Comprobar configuración de complemento de contraseñas", - + "VTLANG_NORMAL_MODE": "Arrancar en modo normal", "VTLANG_WIMBOOT_MODE": "Arrancar en modo wimboot", "VTLANG_GRUB2_MODE": "Arrancar en modo grub2", "VTLANG_MEMDISK_MODE": "Arrancar en modo memdisk", - + "VTLANG_RET_TO_LISTVIEW": "Regresar a vista de lista", "VTLANG_RET_TO_TREEVIEW": "regresar a vista de árbol", - + "VTLANG_NO_AUTOINS_SCRIPT": "Arrancar sin plantilla de auto instalación", "VTLANG_AUTOINS_USE": "Arrancar con", - + "VTLANG_NO_PERSIST": "Arrancar sin persistencia", "VTLANG_PERSIST_USE": "Arrancar con", - + "VTLANG_BROWER_RETURN": "Regresar", - + "VTLANG_ENTER_EXIT": "presiona tecla Entrar para salir", "VTLANG_ENTER_REBOOT": "presiona tecla Entrar para reiniciar", "VTLANG_ENTER_CONTINUE": "presiona tecla Entrar para continuar", - + "VTLANG_CTRL_TEMP_SET": "Ajustes de control temporales", "VTLANG_WIN11_BYPASS_CHECK": "Saltar comprobación de CPU/TPM/Arranque Seguro al instalar Windows 11", "VTLANG_WIN11_BYPASS_NRO": "Saltar requerimiento de cuenta en linea al instalar Windows 11", "VTLANG_LINUX_REMOUNT": "Montar partición de Ventoy después de arrancar Linux", "VTLANG_SECONDARY_BOOT_MENU": "Mostrar menú de arranque secundario", - + "MENU_STR_XXX": "" } diff --git a/INSTALL/grub/menu/fr_FR.json b/INSTALL/grub/menu/fr_FR.json index 257a671a96f..e2d873e3acb 100644 --- a/INSTALL/grub/menu/fr_FR.json +++ b/INSTALL/grub/menu/fr_FR.json @@ -1,13 +1,13 @@ { "VTLANG_LANGUAGE_NAME": "French (Français)", - + "VTLANG_STR_HOTKEY_LIST": "L:Langue F1:Aide F2:Parcourir F3:Affichage liste F4:Démarrage local F5:Outils F6:Menu étendu", "VTLANG_STR_HOTKEY_TREE": "L:Langue F1:Aide F2:Parcourir F3:Affichage arborescence F4:Démarrage local F5:Outils F6:Menu étendu", "VTLANG_RETURN_PREVIOUS": "Retour au menu précédent [Echap]", "VTLANG_RETURN_PRV_NOESC": "Retour au menu précédent", - + "VTLANG_MENU_LANG": "Sélection de la langue des menus", - + "VTLANG_LB_SBOOT_WINDOWS": "Rechercher et démarrer Windows", "VTLANG_LB_SBOOT_G4D": "Rechercher et démarrer GRUB4DOS", "VTLANG_LB_SBOOT_HDD1": "Démarrer depuis le 1er disque local", @@ -17,7 +17,7 @@ "VTLANG_LB_SBOOT_IA32EFI": "Rechercher et démarrer BOOTIA32.EFI", "VTLANG_LB_SBOOT_AA64EFI": "Rechercher et démarrer BOOTAA64.EFI", "VTLANG_LB_SBOOT_XORBOOT": "Rechercher et démarrer xorboot", - + "VTLANG_FILE_CHKSUM": "Somme de contrôle du fichier", "VTLANG_CHKSUM_MD5_CALC": "Calculer MD5", "VTLANG_CHKSUM_SHA1_CALC": "Calculer SHA1", @@ -27,26 +27,26 @@ "VTLANG_CHKSUM_SHA1_CALC_CHK": "Calculer et vérifier SHA1", "VTLANG_CHKSUM_SHA256_CALC_CHK": "Calculer et vérifier SHA256", "VTLANG_CHKSUM_SHA512_CALC_CHK": "Calculer et vérifier SHA512", - + "VTLANG_POWER": "Extinction", "VTLANG_POWER_REBOOT": "Redémarrer", "VTLANG_POWER_HALT": "Éteindre", "VTLANG_POWER_BOOT_EFIFW": "Redémarrer et accéder au menu EFI", - + "VTLANG_KEYBRD_LAYOUT": "Dispositions de clavier", "VTLANG_HWINFO": "Informations sur le matériel", - + "VTLANG_RESOLUTION_CFG": "Configuration de la résolution", "VTLANG_SCREEN_MODE": "Mode d’affichage", "VTLANG_SCREEN_TEXT_MODE": "Mode texte", "VTLANG_SCREEN_GUI_MODE": "Mode graphique", - + "VTLANG_THEME_SELECT": "Sélection du thème", - + "VTLANG_UEFI_UTIL": "Utilitaires UEFI de Ventoy", "VTLANG_UTIL_SHOW_EFI_DRV": "Afficher les pilotes EFI", "VTLANG_UTIL_FIX_BLINIT_FAIL": "Contourner l’échec de Windows BlinitializeLibrary", - + "VTLANG_JSON_CHK_JSON": "Afficher le fichier de configuration (ventoy.json)", "VTLANG_JSON_CHK_CONTROL": "Afficher la configuration du plugin de contrôle global", "VTLANG_JSON_CHK_THEME": "Afficher la configuration du plugin de thème", @@ -62,32 +62,32 @@ "VTLANG_JSON_CHK_CONF_REPLACE": "Afficher la configuration du plugin de substitution des fichiers de démarrage", "VTLANG_JSON_CHK_DUD": "Afficher la configuration du plugin de disques de mise à jour des pilotes", "VTLANG_JSON_CHK_PASSWORD": "Afficher la configuration du plugin de mots de passe", - + "VTLANG_NORMAL_MODE": "Démarrer en mode normal", "VTLANG_WIMBOOT_MODE": "Démarrer en mode WimBoot", "VTLANG_GRUB2_MODE": "Démarrer en mode GRUB 2", "VTLANG_MEMDISK_MODE": "Démarrer en mode Memdisk", - + "VTLANG_RET_TO_LISTVIEW": "Revenir à l’affichage en liste", "VTLANG_RET_TO_TREEVIEW": "Revenir à l’affichage en arborescence", - + "VTLANG_NO_AUTOINS_SCRIPT": "Démarrer en ignorant le modèle d’auto-installation", "VTLANG_AUTOINS_USE": "Démarrer en chargeant le modèle d’auto-installation", - + "VTLANG_NO_PERSIST": "Démarrer sans persistance", "VTLANG_PERSIST_USE": "Démarrer avec la persistance", - + "VTLANG_BROWER_RETURN": "Retour", - + "VTLANG_ENTER_EXIT": "appuyez sur la touche Entrée pour quitter", "VTLANG_ENTER_REBOOT": "appuyez sur la touche Entrée pour redémarrer", "VTLANG_ENTER_CONTINUE": "appuyez sur la touche Entrée pour continuer", - + "VTLANG_CTRL_TEMP_SET": "Paramètres de contrôle temporaires", "VTLANG_WIN11_BYPASS_CHECK": "Ignorer la vérification CPU/TPM/SecureBoot lors de l'installation de Windows 11", "VTLANG_WIN11_BYPASS_NRO": "Contourner l'exigence de compte en ligne lors de l'installation de Windows 11", "VTLANG_LINUX_REMOUNT": "Monter la partition Ventoy après le démarrage de Linux", "VTLANG_SECONDARY_BOOT_MENU": "Afficher le menu de démarrage secondaire", - + "MENU_STR_XXX": "" } diff --git a/INSTALL/grub/menu/hi_HI.json b/INSTALL/grub/menu/hi_HI.json index f3a967eb27c..e544d70b2a1 100644 --- a/INSTALL/grub/menu/hi_HI.json +++ b/INSTALL/grub/menu/hi_HI.json @@ -1,13 +1,13 @@ { "VTLANG_LANGUAGE_NAME": "Hindi (हिनà¥à¤¦à¥€)", - + "VTLANG_STR_HOTKEY_LIST": "L:भाषा F1:मदद F2:बà¥à¤°à¤¾à¤‰à¤œà¤¼à¤° F3:ListView F4:सà¥à¤¥à¤¾à¤¨à¥€à¤¯à¤¬à¥‚ट F5:उपकरण F6:ExMenu", "VTLANG_STR_HOTKEY_TREE": "L:भाषा F1:मदद F2:बà¥à¤°à¤¾à¤‰à¤œà¤¼à¤° F3:TreeView F4:सà¥à¤¥à¤¾à¤¨à¥€à¤¯à¤¬à¥‚ट F5:उपकरण F6:ExMenu", "VTLANG_RETURN_PREVIOUS": "पिछले मेनू पर लौटें [Esc]", "VTLANG_RETURN_PRV_NOESC": "पिछले मेनू पर लौटें", - + "VTLANG_MENU_LANG": "मेनू भाषा का चयन करें", - + "VTLANG_LB_SBOOT_WINDOWS": "Windows खोजें और बूट करें", "VTLANG_LB_SBOOT_G4D": "Grub4dos खोजें और बूट करें", "VTLANG_LB_SBOOT_HDD1": "पहली(1st) सà¥à¤¥à¤¾à¤¨à¥€à¤¯ डिसà¥à¤• को बूट करें", @@ -17,7 +17,7 @@ "VTLANG_LB_SBOOT_IA32EFI": "BOOTIA32.EFI खोजें और बूट करें", "VTLANG_LB_SBOOT_AA64EFI": "BOOTAA64.EFI खोजें और बूट करें", "VTLANG_LB_SBOOT_XORBOOT": "xorboot खोजें और बूट करें", - + "VTLANG_FILE_CHKSUM": "फ़ाइल चेकसम", "VTLANG_CHKSUM_MD5_CALC": "Md5sum की गणना करें", "VTLANG_CHKSUM_SHA1_CALC": "sha1sum की गणना करें", @@ -27,26 +27,26 @@ "VTLANG_CHKSUM_SHA1_CALC_CHK": "sha1sum की गणना और जाà¤à¤š करें", "VTLANG_CHKSUM_SHA256_CALC_CHK": "sha256sum की गणना और जाà¤à¤š करें", "VTLANG_CHKSUM_SHA512_CALC_CHK": "sha512sum की गणना और जाà¤à¤š करें", - + "VTLANG_POWER": "पावर", "VTLANG_POWER_REBOOT": "रीबूट", "VTLANG_POWER_HALT": "हालà¥à¤Ÿ", "VTLANG_POWER_BOOT_EFIFW": "EFI सेटअप के लिठरीबूट करें", - + "VTLANG_KEYBRD_LAYOUT": "कीबोरà¥à¤¡ लेआउट", "VTLANG_HWINFO": "हारà¥à¤¡à¤µà¥‡à¤¯à¤° की जानकारी", - + "VTLANG_RESOLUTION_CFG": "रिज़ॉलà¥à¤¯à¥‚शन कॉनà¥à¤«à¤¼à¤¿à¤—रेशन", "VTLANG_SCREEN_MODE": "Screen Display मोड", "VTLANG_SCREEN_TEXT_MODE": "फोरà¥à¤¸ Text मोड", "VTLANG_SCREEN_GUI_MODE": "फोरà¥à¤¸ Graphics मोड", - + "VTLANG_THEME_SELECT": "थीम का चयन", - + "VTLANG_UEFI_UTIL": "वेंटोय UEFI यूटिलिटीज", "VTLANG_UTIL_SHOW_EFI_DRV": "EFI डà¥à¤°à¤¾à¤‡à¤µà¤°à¥à¤¸ दिखाà¤à¤‚", "VTLANG_UTIL_FIX_BLINIT_FAIL": "Windows BlinitializeLibrary विफलता को ठीक करें", - + "VTLANG_JSON_CHK_JSON": "पà¥à¤²à¤—इन json विनà¥à¤¯à¤¾à¤¸ की जाà¤à¤š करें (ventoy.json)", "VTLANG_JSON_CHK_CONTROL": "global control पà¥à¤²à¤—इन विनà¥à¤¯à¤¾à¤¸ की जाà¤à¤š करें", "VTLANG_JSON_CHK_THEME": "theme पà¥à¤²à¤—इन विनà¥à¤¯à¤¾à¤¸ की जाà¤à¤š करें", @@ -62,32 +62,32 @@ "VTLANG_JSON_CHK_CONF_REPLACE": "boot conf replace पà¥à¤²à¤—इन विनà¥à¤¯à¤¾à¤¸ की जाà¤à¤š करें", "VTLANG_JSON_CHK_DUD": "dud पà¥à¤²à¤—इन विनà¥à¤¯à¤¾à¤¸ की जाà¤à¤š करें", "VTLANG_JSON_CHK_PASSWORD": "password पà¥à¤²à¤—इन विनà¥à¤¯à¤¾à¤¸ की जाà¤à¤š करें", - + "VTLANG_NORMAL_MODE": "सामानà¥à¤¯ मोड में बूट करें", "VTLANG_WIMBOOT_MODE": "wimboot मोड में बूट करें", "VTLANG_GRUB2_MODE": "grub2 मोड में बूट करें", "VTLANG_MEMDISK_MODE": "memdisk मोड में बूट करें", - + "VTLANG_RET_TO_LISTVIEW": "ListView पर वापस जाà¤à¤", "VTLANG_RET_TO_TREEVIEW": "TreeView पर वापस जाà¤à¤", - + "VTLANG_NO_AUTOINS_SCRIPT": "ऑटो इंसà¥à¤Ÿà¥‰à¤²à¥‡à¤¶à¤¨ टेमà¥à¤ªà¤²à¥‡à¤Ÿ के बिना बूट करें", "VTLANG_AUTOINS_USE": "के साथ बूट करें", - + "VTLANG_NO_PERSIST": "बिना persistence के बूट करें", "VTLANG_PERSIST_USE": "के साथ बूट करें", - + "VTLANG_BROWER_RETURN": "लौटें", - + "VTLANG_ENTER_EXIT": "बाहर निकलने के लिठà¤à¤‚टर कà¥à¤‚जी दबाà¤à¤‚", "VTLANG_ENTER_REBOOT": "रिबूट करने के लिठà¤à¤‚टर कà¥à¤‚जी दबाà¤à¤‚", "VTLANG_ENTER_CONTINUE": "जारी रखने के लिठà¤à¤‚टर कà¥à¤‚जी दबाà¤à¤‚", - + "VTLANG_CTRL_TEMP_SET": "असà¥à¤¥à¤¾à¤¯à¥€ नियंतà¥à¤°à¤£ सेटिंगà¥à¤¸", "VTLANG_WIN11_BYPASS_CHECK": "जब विंडोज 11 सà¥à¤¥à¤¾à¤ªà¤¿à¤¤ करें, CPU/TPM/SECUREBOOT CHECK को बायपास करें", "VTLANG_WIN11_BYPASS_NRO": "विंडोज 11 सà¥à¤¥à¤¾à¤ªà¤¿à¤¤ करते समय ऑनलाइन खाते की आवशà¥à¤¯à¤•ता बाईपास", "VTLANG_LINUX_REMOUNT": "लिनकà¥à¤¸ बूट के बाद वेंटॉय विभाजन को माउंट करें", "VTLANG_SECONDARY_BOOT_MENU": "दà¥à¤µà¤¿à¤¤à¥€à¤¯à¤• बूट मेनू दिखाà¤à¤‚", - + "MENU_STR_XXX": "" } diff --git a/INSTALL/grub/menu/hr_HR.json b/INSTALL/grub/menu/hr_HR.json index 7dc139c1a58..b8fc6145062 100644 --- a/INSTALL/grub/menu/hr_HR.json +++ b/INSTALL/grub/menu/hr_HR.json @@ -1,13 +1,13 @@ { "VTLANG_LANGUAGE_NAME": "Croatian (Hrvatski)", - + "VTLANG_STR_HOTKEY_LIST": "L:Jezik F1:Help F2:Browse F3:ListView F4:Localboot F5:Tools F6:ExMenu", "VTLANG_STR_HOTKEY_TREE": "L:Jezik F1:Help F2:Browse F3:TreeView F4:Localboot F5:Tools F6:ExMenu", "VTLANG_RETURN_PREVIOUS": "Return to previous menu [Esc]", "VTLANG_RETURN_PRV_NOESC": "Return to previous menu", - + "VTLANG_MENU_LANG": "Menu Language Select", - + "VTLANG_LB_SBOOT_WINDOWS": "Search and boot Windows", "VTLANG_LB_SBOOT_G4D": "Search and boot Grub4dos", "VTLANG_LB_SBOOT_HDD1": "Boot the 1st local disk", @@ -17,7 +17,7 @@ "VTLANG_LB_SBOOT_IA32EFI": "Search and boot BOOTIA32.EFI", "VTLANG_LB_SBOOT_AA64EFI": "Search and boot BOOTAA64.EFI", "VTLANG_LB_SBOOT_XORBOOT": "Search and boot xorboot", - + "VTLANG_FILE_CHKSUM": "File checksum", "VTLANG_CHKSUM_MD5_CALC": "Calculate md5sum", "VTLANG_CHKSUM_SHA1_CALC": "Calculate sha1sum", @@ -27,26 +27,26 @@ "VTLANG_CHKSUM_SHA1_CALC_CHK": "Calculate and check sha1sum", "VTLANG_CHKSUM_SHA256_CALC_CHK": "Calculate and check sha256sum", "VTLANG_CHKSUM_SHA512_CALC_CHK": "Calculate and check sha512sum", - + "VTLANG_POWER": "Power", "VTLANG_POWER_REBOOT": "Reboot", "VTLANG_POWER_HALT": "Halt", "VTLANG_POWER_BOOT_EFIFW": "Reboot to EFI setup", - + "VTLANG_KEYBRD_LAYOUT": "Keyboard Layouts", "VTLANG_HWINFO": "Hardware Information", - + "VTLANG_RESOLUTION_CFG": "Resolution Configuration", "VTLANG_SCREEN_MODE": "Screen Display Mode", "VTLANG_SCREEN_TEXT_MODE": "Force Text Mode", "VTLANG_SCREEN_GUI_MODE": "Force Graphics Mode", - + "VTLANG_THEME_SELECT": "Theme Select", - + "VTLANG_UEFI_UTIL": "Ventoy UEFI Utilities", "VTLANG_UTIL_SHOW_EFI_DRV": "Show EFI Drivers", "VTLANG_UTIL_FIX_BLINIT_FAIL": "Fixup Windows BlinitializeLibrary Failure", - + "VTLANG_JSON_CHK_JSON": "Check plugin json configuration (ventoy.json)", "VTLANG_JSON_CHK_CONTROL": "Check global control plugin configuration", "VTLANG_JSON_CHK_THEME": "Check theme plugin configuration", @@ -62,32 +62,32 @@ "VTLANG_JSON_CHK_CONF_REPLACE": "Check boot conf replace plugin configuration", "VTLANG_JSON_CHK_DUD": "Check dud plugin configuration", "VTLANG_JSON_CHK_PASSWORD": "Check password plugin configuration", - + "VTLANG_NORMAL_MODE": "Boot in normal mode", "VTLANG_WIMBOOT_MODE": "Boot in wimboot mode", "VTLANG_GRUB2_MODE": "Boot in grub2 mode", "VTLANG_MEMDISK_MODE": "Boot in memdisk mode", - + "VTLANG_RET_TO_LISTVIEW": "Return to ListView", "VTLANG_RET_TO_TREEVIEW": "Return to TreeView", - + "VTLANG_NO_AUTOINS_SCRIPT": "Boot without auto installation template", "VTLANG_AUTOINS_USE": "Boot with", - + "VTLANG_NO_PERSIST": "Boot without persistence", "VTLANG_PERSIST_USE": "Boot with", - + "VTLANG_BROWER_RETURN": "Return", - + "VTLANG_ENTER_EXIT": "pritisnite tipku Enter za izlaz", "VTLANG_ENTER_REBOOT": "pritisnite tipku Enter za ponovno pokretanje", "VTLANG_ENTER_CONTINUE": "pritisnite tipku Enter za nastavak", - + "VTLANG_CTRL_TEMP_SET": "Temporary Control Settings", "VTLANG_WIN11_BYPASS_CHECK": "Bypass CPU/TPM/SecureBoot check when install Windows 11", "VTLANG_WIN11_BYPASS_NRO": "Bypass online account requirement when install Windows 11", "VTLANG_LINUX_REMOUNT": "Mount Ventoy partition after boot Linux", "VTLANG_SECONDARY_BOOT_MENU": "Show secondary boot menu", - + "MENU_STR_XXX": "" } diff --git a/INSTALL/grub/menu/id_ID.json b/INSTALL/grub/menu/id_ID.json index 74236a70f50..8fb9f967298 100644 --- a/INSTALL/grub/menu/id_ID.json +++ b/INSTALL/grub/menu/id_ID.json @@ -1,13 +1,13 @@ { "VTLANG_LANGUAGE_NAME": "Indonesian (Bahasa Indonesia)", - + "VTLANG_STR_HOTKEY_LIST": "L:Bahasa F1:Bantuan F2:Jelajah F3:ListView F4:boot lokal F5:Alat Utilitas F6:Menu Eksternal", "VTLANG_STR_HOTKEY_TREE": "L:Bahasa F1:Bantuan F2:Jelajah F3:ListView F4:boot lokal F5:Alat Utilitas F6:Menu Eksternal", "VTLANG_RETURN_PREVIOUS": "Kembali ke menu sebelumnya [Esc]", "VTLANG_RETURN_PRV_NOESC": "Kembali ke menu sebelumnya", - + "VTLANG_MENU_LANG": "Menu Pilihan Bahasa", - + "VTLANG_LB_SBOOT_WINDOWS": "Mencari dan jalankan boot ke Windows", "VTLANG_LB_SBOOT_G4D": "Mencari dan jalankan boot ke Grub4dos", "VTLANG_LB_SBOOT_HDD1": "Jalankan boot ke disk lokal 1", @@ -17,7 +17,7 @@ "VTLANG_LB_SBOOT_IA32EFI": "Mencari dan jalankan boot ke BOOTIA32.EFI", "VTLANG_LB_SBOOT_AA64EFI": "Mencari dan jalankan boot ke BOOTAA64.EFI", "VTLANG_LB_SBOOT_XORBOOT": "Mencari dan jalankan boot ke xorboot", - + "VTLANG_FILE_CHKSUM": "Berkas checksum", "VTLANG_CHKSUM_MD5_CALC": "Menghitung md5sum", "VTLANG_CHKSUM_SHA1_CALC": "Menghitung sha1sum", @@ -27,26 +27,26 @@ "VTLANG_CHKSUM_SHA1_CALC_CHK": "Menghitung dan memeriksa sha1sum", "VTLANG_CHKSUM_SHA256_CALC_CHK": "Menghitung dan memeriksa sha256sum", "VTLANG_CHKSUM_SHA512_CALC_CHK": "Menghitung dan memeriksa sha512sum", - + "VTLANG_POWER": "Daya", "VTLANG_POWER_REBOOT": "Memulai ulang", "VTLANG_POWER_HALT": "Mematikan", "VTLANG_POWER_BOOT_EFIFW": "Memulai ulang menuju EFI setup", - + "VTLANG_KEYBRD_LAYOUT": "Tata letak Keyboard", "VTLANG_HWINFO": "Informasi Perangkat Keras", - + "VTLANG_RESOLUTION_CFG": "Setelan Resolusi", "VTLANG_SCREEN_MODE": "Mode Tampilan Layar", "VTLANG_SCREEN_TEXT_MODE": "Paksa ke Mode Teks", "VTLANG_SCREEN_GUI_MODE": "Paksa ke Mode Grafis", - + "VTLANG_THEME_SELECT": "Pilih Tema", - + "VTLANG_UEFI_UTIL": "Ventoy UEFI Utilities", "VTLANG_UTIL_SHOW_EFI_DRV": "Tampilkan Driver EFI", "VTLANG_UTIL_FIX_BLINIT_FAIL": "Memperbaiki Kegagalan Windows BlinitializeLibrary", - + "VTLANG_JSON_CHK_JSON": "Periksa setelan plugin (ventoy.json)", "VTLANG_JSON_CHK_CONTROL": "Periksa setelan plugin global control", "VTLANG_JSON_CHK_THEME": "Periksa setelan plugin theme", @@ -62,32 +62,32 @@ "VTLANG_JSON_CHK_CONF_REPLACE": "Periksa setelan plugin boot conf replace", "VTLANG_JSON_CHK_DUD": "Periksa setelan plugin dud", "VTLANG_JSON_CHK_PASSWORD": "Periksa setelan plugin password", - + "VTLANG_NORMAL_MODE": "Jalankan boot di mode normal", "VTLANG_WIMBOOT_MODE": "Jalankan boot di mode wimboot", "VTLANG_GRUB2_MODE": "Jalankan boot di mode grub2", "VTLANG_MEMDISK_MODE": "Jalankan boot di mode memdisk", - + "VTLANG_RET_TO_LISTVIEW": "Kembali ke ListView", "VTLANG_RET_TO_TREEVIEW": "Kembali ke TreeView", - + "VTLANG_NO_AUTOINS_SCRIPT": "Jalankan boot tanpa templat instalasi otomatis", "VTLANG_AUTOINS_USE": "Jalankan boot dengan", - + "VTLANG_NO_PERSIST": "Jalankan boot tanpa persistence", "VTLANG_PERSIST_USE": "Jalankan boot", - + "VTLANG_BROWER_RETURN": "Kembali", - + "VTLANG_ENTER_EXIT": "tekan tombol Enter untuk keluar", "VTLANG_ENTER_REBOOT": "tekan tombol Enter untuk reboot", "VTLANG_ENTER_CONTINUE": "tekan tombol Enter untuk melanjutkan", - + "VTLANG_CTRL_TEMP_SET": "Temporary Control Settings", "VTLANG_WIN11_BYPASS_CHECK": "Bypass CPU/TPM/SecureBoot check when install Windows 11", "VTLANG_WIN11_BYPASS_NRO": "Bypass online account requirement when install Windows 11", "VTLANG_LINUX_REMOUNT": "Mount Ventoy partition after boot Linux", "VTLANG_SECONDARY_BOOT_MENU": "Show secondary boot menu", - + "MENU_STR_XXX": "" } diff --git a/INSTALL/grub/menu/it_IT.json b/INSTALL/grub/menu/it_IT.json index 0549282d13b..55514398b0e 100644 --- a/INSTALL/grub/menu/it_IT.json +++ b/INSTALL/grub/menu/it_IT.json @@ -1,13 +1,13 @@ { "VTLANG_LANGUAGE_NAME": "Italiano (Italian)", - + "VTLANG_STR_HOTKEY_LIST": "L:Lingua F1:Aiuto F2:Sfoglia F3:VistaElenco F4:BootLocale F5:Strumenti F6:MenuEx", "VTLANG_STR_HOTKEY_TREE": "L:Lingua F1:Aiuto F2:Sfoglia F3:VistaStruttura F4:BootLocale F5:Strumenti F6:MenuEx", "VTLANG_RETURN_PREVIOUS": "Torna al menu precedente [Esc]", "VTLANG_RETURN_PRV_NOESC": "Torna al menu precedente", - + "VTLANG_MENU_LANG": "Selezione lingua interfaccia", - + "VTLANG_LB_SBOOT_WINDOWS": "Cerca e avvia Windows", "VTLANG_LB_SBOOT_G4D": "Cerca e avvia Grub4dos", "VTLANG_LB_SBOOT_HDD1": "Avvia il 1° disco locale", @@ -17,7 +17,7 @@ "VTLANG_LB_SBOOT_IA32EFI": "Cerca e avvia BOOTIA32.EFI", "VTLANG_LB_SBOOT_AA64EFI": "Cerca e avvia BOOTAA64.EFI", "VTLANG_LB_SBOOT_XORBOOT": "Cerca e avvia xorboot", - + "VTLANG_FILE_CHKSUM": "File checksum", "VTLANG_CHKSUM_MD5_CALC": "Calcola md5sum", "VTLANG_CHKSUM_SHA1_CALC": "Calcola sha1sum", @@ -27,26 +27,26 @@ "VTLANG_CHKSUM_SHA1_CALC_CHK": "Calcola e controlla sha1sum", "VTLANG_CHKSUM_SHA256_CALC_CHK": "Calcola e controlla sha256sum", "VTLANG_CHKSUM_SHA512_CALC_CHK": "Calcola e controlla sha512sum", - + "VTLANG_POWER": "Spegni il computer", "VTLANG_POWER_REBOOT": "Riavvia il computer", "VTLANG_POWER_HALT": "Arresta il computer", "VTLANG_POWER_BOOT_EFIFW": "Riavvia il computer nell'impostazione EFI", - + "VTLANG_KEYBRD_LAYOUT": "Layout tastiera", "VTLANG_HWINFO": "Informazioni hardware computer", - + "VTLANG_RESOLUTION_CFG": "Imposta risoluzione schermo", "VTLANG_SCREEN_MODE": "Modalità schermo (testo/grafica)", "VTLANG_SCREEN_TEXT_MODE": "Forza modalità testo schermo", "VTLANG_SCREEN_GUI_MODE": "Forza modalità grafica schermo", - + "VTLANG_THEME_SELECT": "Seleziona tema interfaccia", - + "VTLANG_UEFI_UTIL": "Utilità UEFI Ventoy", "VTLANG_UTIL_SHOW_EFI_DRV": "Visualizza driver EFI", "VTLANG_UTIL_FIX_BLINIT_FAIL": "Correzione fallimento BlinitializeLibrary di Windows", - + "VTLANG_JSON_CHK_JSON": "Modifica file .json plugin (ventoy.json)", "VTLANG_JSON_CHK_CONTROL": "Modifica controllo globale della configurazione dei plugin", "VTLANG_JSON_CHK_THEME": "Modifica tema configurazione dei plugin", @@ -62,32 +62,32 @@ "VTLANG_JSON_CHK_CONF_REPLACE": "Modifica sostituzione configurazione di avvio configurazione dei plugin", "VTLANG_JSON_CHK_DUD": "Modifica dud configurazione plugin", "VTLANG_JSON_CHK_PASSWORD": "Modifica password configurazione plugin", - + "VTLANG_NORMAL_MODE": "Avvia in modalità normale", "VTLANG_WIMBOOT_MODE": "Avvia in modalità wimboot", "VTLANG_GRUB2_MODE": "Avvia in modalità grub2", "VTLANG_MEMDISK_MODE": "Avvia in modalità memdisk", - + "VTLANG_RET_TO_LISTVIEW": "Torna alla VistaElenco", "VTLANG_RET_TO_TREEVIEW": "Torna alla VistaStruttura", - + "VTLANG_NO_AUTOINS_SCRIPT": "Avvia senza il modello installazione automatica", "VTLANG_AUTOINS_USE": "Avvia con", - + "VTLANG_NO_PERSIST": "Avvia senza persistenza", "VTLANG_PERSIST_USE": "Avvia con", - + "VTLANG_BROWER_RETURN": "Indietro", - + "VTLANG_ENTER_EXIT": "Premi il tasto 'Invio' per uscire", "VTLANG_ENTER_REBOOT": "Premi il tasto 'Invio' per riavviare", "VTLANG_ENTER_CONTINUE": "Premi il tasto 'Invio' per continuare", - + "VTLANG_CTRL_TEMP_SET": "Impostazioni controllo temporaneo", "VTLANG_WIN11_BYPASS_CHECK": "Durante l'installazione di Windows 11 bypassa il controllo CPU/TPM/SecureBoot ", "VTLANG_WIN11_BYPASS_NRO": "Durante l'installazione di Windows 11 bypassa il requisito di un account online ", "VTLANG_LINUX_REMOUNT": "Dopo l'avvio di Linux monta la partizione Ventoy ", "VTLANG_SECONDARY_BOOT_MENU": "Visualizza menu di avvio secondario", - + "MENU_STR_XXX": "" } diff --git a/INSTALL/grub/menu/ja_JP.json b/INSTALL/grub/menu/ja_JP.json index 42738ac2534..468f8421ca8 100644 --- a/INSTALL/grub/menu/ja_JP.json +++ b/INSTALL/grub/menu/ja_JP.json @@ -1,13 +1,13 @@ { "VTLANG_LANGUAGE_NAME": "Japanese (日本語)", - + "VTLANG_STR_HOTKEY_LIST": "L:言語 F1:説明 F2:閲覧 F3:表示切替(階層) F4:手許ã‹ã‚‰èµ·å‹• F5:é“å…· F6:æ‹¡å¼µ", "VTLANG_STR_HOTKEY_TREE": "L:言語 F1:説明 F2:閲覧 F3:表示切替(一覧) F4:手許ã‹ã‚‰èµ·å‹• F5:é“å…· F6:æ‹¡å¼µ", "VTLANG_RETURN_PREVIOUS": "å‰ã«æˆ»ã‚‹ [Esc]", "VTLANG_RETURN_PRV_NOESC": "å‰ã«æˆ»ã‚‹", - + "VTLANG_MENU_LANG": "表示言語", - + "VTLANG_LB_SBOOT_WINDOWS": "Windowsを検索ã—ã¦èµ·å‹•ã™ã‚‹", "VTLANG_LB_SBOOT_G4D": "GRUB4DOSを検索ã—ã¦èµ·å‹•ã™ã‚‹", "VTLANG_LB_SBOOT_HDD1": "最åˆã®æ©Ÿå™¨ã‚’èµ·å‹•ã—ã¾ã™", @@ -17,7 +17,7 @@ "VTLANG_LB_SBOOT_IA32EFI": "BOOTIA32.EFIを検索ã—ã¦èµ·å‹•ã™ã‚‹", "VTLANG_LB_SBOOT_AA64EFI": "BOOTAA64.EFIを検索ã—ã¦èµ·å‹•ã™ã‚‹", "VTLANG_LB_SBOOT_XORBOOT": "xorbootを検索ã—ã¦èµ·å‹•ã™ã‚‹", - + "VTLANG_FILE_CHKSUM": "検査åˆè¨ˆ", "VTLANG_CHKSUM_MD5_CALC": "MD5を算出ã™ã‚‹", "VTLANG_CHKSUM_SHA1_CALC": "SHA1を算出ã™ã‚‹", @@ -27,26 +27,26 @@ "VTLANG_CHKSUM_SHA1_CALC_CHK": "SHA1を算出ã—ã¦æ¤œè¨¼ã™ã‚‹", "VTLANG_CHKSUM_SHA256_CALC_CHK": "SHA256を算出ã—ã¦æ¤œè¨¼ã™ã‚‹", "VTLANG_CHKSUM_SHA512_CALC_CHK": "SHA512を算出ã—ã¦æ¤œè¨¼ã™ã‚‹", - + "VTLANG_POWER": "é›»æº", "VTLANG_POWER_REBOOT": "å†èµ·å‹•", "VTLANG_POWER_HALT": "é›»æºæ–­", "VTLANG_POWER_BOOT_EFIFW": "å†èµ·å‹•ã—ã¦EFIã‚’æ§‹æˆã™ã‚‹", - + "VTLANG_KEYBRD_LAYOUT": "éµç›¤é…列", "VTLANG_HWINFO": "機器情報", - + "VTLANG_RESOLUTION_CFG": "ç”»é¢è§£åƒåº¦", "VTLANG_SCREEN_MODE": "表示ã®ç¨®é¡ž", "VTLANG_SCREEN_TEXT_MODE": "CLI表示を強制ã™ã‚‹", "VTLANG_SCREEN_GUI_MODE": "GUI表示を強制ã™ã‚‹", - + "VTLANG_THEME_SELECT": "外観", - + "VTLANG_UEFI_UTIL": "Ventoy UEFI Utilities", "VTLANG_UTIL_SHOW_EFI_DRV": "EFIドライãƒã‚’表示ã™ã‚‹", "VTLANG_UTIL_FIX_BLINIT_FAIL": "WindowsãŒã€ŒBlinitializeLibrary Failureã€ã§èµ·å‹•ã—ãªã„ã®ã‚’修正ã™ã‚‹", - + "VTLANG_JSON_CHK_JSON": "拡張機能ã®JSONæ§‹æˆãƒ•ァイル (ventoy.json) を検査ã™ã‚‹", "VTLANG_JSON_CHK_CONTROL": "拡張機能「global controlã€ã®æ§‹æˆã‚’検査ã™ã‚‹", "VTLANG_JSON_CHK_THEME": "拡張機能「themeã€ã®æ§‹æˆã‚’検査ã™ã‚‹", @@ -67,27 +67,27 @@ "VTLANG_WIMBOOT_MODE": "WimBootを介ã—ã¦èµ·å‹•", "VTLANG_GRUB2_MODE": "GRUB2を介ã—ã¦èµ·å‹•", "VTLANG_MEMDISK_MODE": "MEMDISKを介ã—ã¦èµ·å‹•", - + "VTLANG_RET_TO_LISTVIEW": "一覧表示ã«åˆ‡ã‚Šæ›¿ãˆã‚‹", "VTLANG_RET_TO_TREEVIEW": "階層表示ã«åˆ‡ã‚Šæ›¿ãˆã‚‹", - + "VTLANG_NO_AUTOINS_SCRIPT": "起動後ã«è‡ªå‹•ã§ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ã‚’行ã‚ãªã„", "VTLANG_AUTOINS_USE": "自動インストールを行ã†", - + "VTLANG_NO_PERSIST": "Liveç’°å¢ƒã®æ°¸ç¶šä¿ç®¡é ˜åŸŸã‚’無効ã«ã™ã‚‹", "VTLANG_PERSIST_USE": "有効ã«ã™ã‚‹", - + "VTLANG_BROWER_RETURN": "戻る", - + "VTLANG_ENTER_EXIT": "[Enter]を押ã—ã¦çµ‚了ã—ã¾ã™", "VTLANG_ENTER_REBOOT": "[Enter]を押ã—ã¦å†èµ·å‹•ã—ã¾ã™", "VTLANG_ENTER_CONTINUE": "[Enter]を押ã—ã¦ç¶šè¡Œã—ã¾ã™", - + "VTLANG_CTRL_TEMP_SET": "Temporary Control Settings", "VTLANG_WIN11_BYPASS_CHECK": "Bypass CPU/TPM/SecureBoot check when install Windows 11", "VTLANG_WIN11_BYPASS_NRO": "Bypass online account requirement when install Windows 11", "VTLANG_LINUX_REMOUNT": "Mount Ventoy partition after boot Linux", "VTLANG_SECONDARY_BOOT_MENU": "Show secondary boot menu", - + "MENU_STR_XXX": "" } diff --git a/INSTALL/grub/menu/ko_KR.json b/INSTALL/grub/menu/ko_KR.json index c5173ac98e8..f205c2d298d 100644 --- a/INSTALL/grub/menu/ko_KR.json +++ b/INSTALL/grub/menu/ko_KR.json @@ -1,13 +1,13 @@ { "VTLANG_LANGUAGE_NAME": "Korean (한국어)", - + "VTLANG_STR_HOTKEY_LIST": " L:언어 F1:ë„ì›€ë§ F2:찾아보기 F3:ëª©ë¡ ë³´ê¸° F4:로컬 부팅 F5:ë„구 F6:확장 메뉴", "VTLANG_STR_HOTKEY_TREE": " L:언어 F1:ë„ì›€ë§ F2:찾아보기 F3:트리 보기 F4:로컬 부팅 F5:ë„구 F6:확장 메뉴", "VTLANG_RETURN_PREVIOUS": "ì´ì „ 메뉴로 ëŒì•„가기 [Esc]", "VTLANG_RETURN_PRV_NOESC": "ì´ì „ 메뉴로 ëŒì•„가기", - + "VTLANG_MENU_LANG": "메뉴 언어 ì„ íƒ", - + "VTLANG_LB_SBOOT_WINDOWS": "Windows 검색 ë° ë¶€íŒ…", "VTLANG_LB_SBOOT_G4D": "Grub4dos 검색 ë° ë¶€íŒ…", "VTLANG_LB_SBOOT_HDD1": "첫 번째 로컬 ë””ìŠ¤í¬ ë¶€íŒ…", @@ -17,7 +17,7 @@ "VTLANG_LB_SBOOT_IA32EFI": "BOOTIA32.EFI 검색 ë° ë¶€íŒ…", "VTLANG_LB_SBOOT_AA64EFI": "BOOTAA64.EFI 검색 ë° ë¶€íŒ…", "VTLANG_LB_SBOOT_XORBOOT": "xorboot 검색 ë° ë¶€íŒ…", - + "VTLANG_FILE_CHKSUM": "íŒŒì¼ ì²´í¬ì„¬", "VTLANG_CHKSUM_MD5_CALC": "md5 검사값 계산", "VTLANG_CHKSUM_SHA1_CALC": "sha1 검사값 계산", @@ -27,26 +27,26 @@ "VTLANG_CHKSUM_SHA1_CALC_CHK": "sha1 검사값 계산 ë° í™•ì¸", "VTLANG_CHKSUM_SHA256_CALC_CHK": "sha256 검사값 계산 ë° í™•ì¸", "VTLANG_CHKSUM_SHA512_CALC_CHK": "sha512 검사값 계산 ë° í™•ì¸", - + "VTLANG_POWER": "ì „ì›", "VTLANG_POWER_REBOOT": "다시 시작", "VTLANG_POWER_HALT": "ì „ì› ë„기", "VTLANG_POWER_BOOT_EFIFW": "UEFI 설정으로 다시 시작", - + "VTLANG_KEYBRD_LAYOUT": "키보드 ë ˆì´ì•„웃", "VTLANG_HWINFO": "하드웨어 ì •ë³´", - + "VTLANG_RESOLUTION_CFG": "í•´ìƒë„ 구성", "VTLANG_SCREEN_MODE": "화면 표시 모드", "VTLANG_SCREEN_TEXT_MODE": "ê°•ì œ í…스트 모드", "VTLANG_SCREEN_GUI_MODE": "ê°•ì œ 그래픽 모드", - + "VTLANG_THEME_SELECT": "테마 ì„ íƒ", - + "VTLANG_UEFI_UTIL": "Ventoy UEFI 유틸리티", "VTLANG_UTIL_SHOW_EFI_DRV": "UEFI 드ë¼ì´ë²„ 표시", "VTLANG_UTIL_FIX_BLINIT_FAIL": "Windows 초기화 ë¼ì´ë¸ŒëŸ¬ë¦¬ 오류 복구", - + "VTLANG_JSON_CHK_JSON": "í”ŒëŸ¬ê·¸ì¸ íŒŒì¼ êµ¬ì„± í™•ì¸ (ventoy.json)", "VTLANG_JSON_CHK_CONTROL": "ì „ì—­ 제어 í”ŒëŸ¬ê·¸ì¸ êµ¬ì„± 확ì¸", "VTLANG_JSON_CHK_THEME": "테마 í”ŒëŸ¬ê·¸ì¸ êµ¬ì„± 확ì¸", @@ -62,32 +62,32 @@ "VTLANG_JSON_CHK_CONF_REPLACE": "부팅 구성 대체 í”ŒëŸ¬ê·¸ì¸ êµ¬ì„± 확ì¸", "VTLANG_JSON_CHK_DUD": "드ë¼ì´ë²„ ì—…ë°ì´íЏ ë””ìŠ¤í¬ í”ŒëŸ¬ê·¸ì¸ êµ¬ì„± 확ì¸", "VTLANG_JSON_CHK_PASSWORD": "암호 í”ŒëŸ¬ê·¸ì¸ êµ¬ì„± 확ì¸", - + "VTLANG_NORMAL_MODE": "ì¼ë°˜ 모드로 부팅", "VTLANG_WIMBOOT_MODE": "wimboot 모드로 부팅", "VTLANG_GRUB2_MODE": "grub2 모드로 부팅", "VTLANG_MEMDISK_MODE": "메모리 ë””ìŠ¤í¬ ëª¨ë“œë¡œ 부팅", - + "VTLANG_RET_TO_LISTVIEW": "목ë¡ë³´ê¸°ë¡œ ëŒì•„가기", "VTLANG_RET_TO_TREEVIEW": "트리보기로 ëŒì•„가기", - + "VTLANG_NO_AUTOINS_SCRIPT": "ìžë™ 설치 스í¬ë¦½íЏ 사용 안 함", "VTLANG_AUTOINS_USE": "부팅 대ìƒ", - + "VTLANG_NO_PERSIST": "ì˜êµ¬í™”ëœ ë°ì´í„° íŒŒì¼ ì‚¬ìš© 안 함", "VTLANG_PERSIST_USE": "부팅 대ìƒ", - + "VTLANG_BROWER_RETURN": "ëŒì•„가기", - + "VTLANG_ENTER_EXIT": "종료하려면 Enter 키를 누르십시오", "VTLANG_ENTER_REBOOT": "다시 시작하려면 Enter 키를 누르십시오", "VTLANG_ENTER_CONTINUE": "계ì†í•˜ë ¤ë©´ Enter 키를 누르십시오", - + "VTLANG_CTRL_TEMP_SET": "임시 제어 설정", "VTLANG_WIN11_BYPASS_CHECK": "Windows 11 설치 시 CPU/TPM/SecureBoot 검사 회피", "VTLANG_WIN11_BYPASS_NRO": "Windows 11 설치 시 온ë¼ì¸ 계정 요구 사항 무시", "VTLANG_LINUX_REMOUNT": "Linux 부팅 후 Ventoy 파티션 마운트", "VTLANG_SECONDARY_BOOT_MENU": "ë³´ì¡° 부팅 메뉴 표시", - + "MENU_STR_XXX": "" } diff --git a/INSTALL/grub/menu/pt_BR.json b/INSTALL/grub/menu/pt_BR.json index f36c97e6953..9a3f8f2fbe7 100644 --- a/INSTALL/grub/menu/pt_BR.json +++ b/INSTALL/grub/menu/pt_BR.json @@ -1,13 +1,13 @@ { "VTLANG_LANGUAGE_NAME": "Brazilian Portuguese (Português Brasileiro)", - + "VTLANG_STR_HOTKEY_LIST": "L:Idioma F1:Ajuda F2:Explorar F3:Visualização em Lista F4:Inicialização Local F5:Ferramentas F6:Sair", "VTLANG_STR_HOTKEY_TREE": "L:Idioma F1:Ajuda F2:Explorar F3:Visualização em Ãrvore F4:Inicialização Local F5:Ferramentas F6:Sair", "VTLANG_RETURN_PREVIOUS": "Retornar ao menu anterior [Esc]", "VTLANG_RETURN_PRV_NOESC": "Retornar ao menu anterior", - + "VTLANG_MENU_LANG": "Menu de Seleção dos Idiomas", - + "VTLANG_LB_SBOOT_WINDOWS": "Procurar e iniciar o Windows", "VTLANG_LB_SBOOT_G4D": "Procurar e iniciar o Grub4dos", "VTLANG_LB_SBOOT_HDD1": "Iniciar o 1º disco local", @@ -17,7 +17,7 @@ "VTLANG_LB_SBOOT_IA32EFI": "Procurar e iniciar o BOOTIA32.EFI", "VTLANG_LB_SBOOT_AA64EFI": "Procurar e iniciar o BOOTAA64.EFI", "VTLANG_LB_SBOOT_XORBOOT": "Procurar e iniciar o xorboot", - + "VTLANG_FILE_CHKSUM": "Checksum do arquivo", "VTLANG_CHKSUM_MD5_CALC": "Calcular o md5sum", "VTLANG_CHKSUM_SHA1_CALC": "Calcular o sha1sum", @@ -27,26 +27,26 @@ "VTLANG_CHKSUM_SHA1_CALC_CHK": "Calcular e verificar o sha1sum", "VTLANG_CHKSUM_SHA256_CALC_CHK": "Calcular e verificar o sha256sum", "VTLANG_CHKSUM_SHA512_CALC_CHK": "Calcular e verificar o sha512sum", - + "VTLANG_POWER": "Energia", "VTLANG_POWER_REBOOT": "Reiniciar", "VTLANG_POWER_HALT": "Desligar", "VTLANG_POWER_BOOT_EFIFW": "Reiniciar com a configuração do EFI", - + "VTLANG_KEYBRD_LAYOUT": "Esquemas do Teclado", "VTLANG_HWINFO": "Informações do Hardware", - + "VTLANG_RESOLUTION_CFG": "Configuração da Resolução", "VTLANG_SCREEN_MODE": "Modo de Exibição da Tela", "VTLANG_SCREEN_TEXT_MODE": "Forçar o Modo Texto", "VTLANG_SCREEN_GUI_MODE": "Forçar o Modo Gráfico", - + "VTLANG_THEME_SELECT": "Seleção de Tema", - + "VTLANG_UEFI_UTIL": "Utilitários UEFI do Ventoy", "VTLANG_UTIL_SHOW_EFI_DRV": "Mostrar os Drivers EFI", "VTLANG_UTIL_FIX_BLINIT_FAIL": "Consertar a Falha BlinitializeLibrary do Windows", - + "VTLANG_JSON_CHK_JSON": "Verificar a configuração do plugin json (ventoy.json)", "VTLANG_JSON_CHK_CONTROL": "Verificar a configuração do plugin de controle global", "VTLANG_JSON_CHK_THEME": "Verificar a configuração do plugin dos temas", @@ -62,32 +62,32 @@ "VTLANG_JSON_CHK_CONF_REPLACE": "Verificar a configuração do plugin de substituição da configuração de inicialização", "VTLANG_JSON_CHK_DUD": "Verificar a configuração do plugin dud", "VTLANG_JSON_CHK_PASSWORD": "Verificar a configuração do plugin das senhas", - + "VTLANG_NORMAL_MODE": "Iniciar no modo normal", "VTLANG_WIMBOOT_MODE": "Iniciar no modo wimboot", "VTLANG_GRUB2_MODE": "Iniciar no modo grub2", "VTLANG_MEMDISK_MODE": "Iniciar no modo memdisk", - + "VTLANG_RET_TO_LISTVIEW": "Retornar pra Visualização em Lista", "VTLANG_RET_TO_TREEVIEW": "Retornar para Visualização em Ãrvore", - + "VTLANG_NO_AUTOINS_SCRIPT": "Iniciar sem modelo de instalação automática", "VTLANG_AUTOINS_USE": "Iniciar com", - + "VTLANG_NO_PERSIST": "Iniciar sem persistência", "VTLANG_PERSIST_USE": "Iniciar com", - + "VTLANG_BROWER_RETURN": "Retornar", - + "VTLANG_ENTER_EXIT": "Pressione a tecla Enter pra sair", "VTLANG_ENTER_REBOOT": "Pressione a tecla Enter pra reiniciar", "VTLANG_ENTER_CONTINUE": "Pressione a tecla Enter pra continuar", - + "VTLANG_CTRL_TEMP_SET": "Configurações do Controle Temporário", "VTLANG_WIN11_BYPASS_CHECK": "Ignorar a verificação da CPU/TPM/SecureBoot quando instalar o Windows 11", "VTLANG_WIN11_BYPASS_NRO": "Ignorar o requerimento de conta online quanto instalar o Windows 11", "VTLANG_LINUX_REMOUNT": "Montar a partição do Ventoy após iniciar o Linux", "VTLANG_SECONDARY_BOOT_MENU": "Mostrar o menu secundário da inicialização", - + "MENU_STR_XXX": "" } diff --git a/INSTALL/grub/menu/pt_PT.json b/INSTALL/grub/menu/pt_PT.json index c40d74f96f1..318c29e6034 100644 --- a/INSTALL/grub/menu/pt_PT.json +++ b/INSTALL/grub/menu/pt_PT.json @@ -1,13 +1,13 @@ { "VTLANG_LANGUAGE_NAME": "Portuguese (Português de Portugal)", - + "VTLANG_STR_HOTKEY_LIST": "L:Idioma F1:Ajuda F2:Navegar F3:Estrutura F4:Arranque local F5:Ferramentas F6:Sair", "VTLANG_STR_HOTKEY_TREE": "L:Idioma F1:Ajuda F2:Navegar F3:Estrutura F4:Arranque local F5:Ferramentas F6:Sair", "VTLANG_RETURN_PREVIOUS": "Voltar ao menu anterior [Esc]", "VTLANG_RETURN_PRV_NOESC": "Voltar ao menu anterior", - + "VTLANG_MENU_LANG": "Seleção de idioma do menu", - + "VTLANG_LB_SBOOT_WINDOWS": "Pesquisar e iniciar o Windows", "VTLANG_LB_SBOOT_G4D": "Pesquisar e iniciar o Grub4dos", "VTLANG_LB_SBOOT_HDD1": "Arrancar o 1º disco local", @@ -17,7 +17,7 @@ "VTLANG_LB_SBOOT_IA32EFI": "Pesquisar e iniciar o BOOTIA32.EFI", "VTLANG_LB_SBOOT_AA64EFI": "Pesquisar e iniciar o BOOTAA64.EFI", "VTLANG_LB_SBOOT_XORBOOT": "Pesquisar e iniciar o xorboot", - + "VTLANG_FILE_CHKSUM": "Checksum do ficheiro", "VTLANG_CHKSUM_MD5_CALC": "Calcular MD5", "VTLANG_CHKSUM_SHA1_CALC": "Calcular SHA1", @@ -27,26 +27,26 @@ "VTLANG_CHKSUM_SHA1_CALC_CHK": "Calcular e verificar SHA1", "VTLANG_CHKSUM_SHA256_CALC_CHK": "Calcular e verificar SHA256", "VTLANG_CHKSUM_SHA512_CALC_CHK": "Calcular e verificar SHA512", - + "VTLANG_POWER": "Energia", "VTLANG_POWER_REBOOT": "Reiniciar", "VTLANG_POWER_HALT": "Desligar", "VTLANG_POWER_BOOT_EFIFW": "Reiniciar com a configuração EFI", - + "VTLANG_KEYBRD_LAYOUT": "Esquemas de teclado", "VTLANG_HWINFO": "Informação do hardware", - + "VTLANG_RESOLUTION_CFG": "Configuração da resolução", "VTLANG_SCREEN_MODE": "Modo de exibição", "VTLANG_SCREEN_TEXT_MODE": "Modo texto", "VTLANG_SCREEN_GUI_MODE": "Modo gráfico", - + "VTLANG_THEME_SELECT": "Seleção de tema", - + "VTLANG_UEFI_UTIL": "Ventoy UEFI Utilities", "VTLANG_UTIL_SHOW_EFI_DRV": "Mostrar controladores EFI", "VTLANG_UTIL_FIX_BLINIT_FAIL": "Corrigir falha BlinitializeLibrary do Windows", - + "VTLANG_JSON_CHK_JSON": "Verificar configuração do plugin json (ventoy.json)", "VTLANG_JSON_CHK_CONTROL": "Verificar a configuração do plugin de controlo global", "VTLANG_JSON_CHK_THEME": "Verificar configuração do plugin do tema", @@ -62,32 +62,32 @@ "VTLANG_JSON_CHK_CONF_REPLACE": "Verificar a configuração do plugin de substituição de conf. de arranque", "VTLANG_JSON_CHK_DUD": "Verificar configuração do plugin dud", "VTLANG_JSON_CHK_PASSWORD": "Verificar configuração do plugin palavra-passe", - + "VTLANG_NORMAL_MODE": "Arrancar no modo normal", "VTLANG_WIMBOOT_MODE": "Arrancar no modo wimboot", "VTLANG_GRUB2_MODE": "Arrancar no modo grub2", "VTLANG_MEMDISK_MODE": "Arrancar no modo memdisk", - + "VTLANG_RET_TO_LISTVIEW": "Voltar para Lista", "VTLANG_RET_TO_TREEVIEW": "Voltar para Estrutura", - + "VTLANG_NO_AUTOINS_SCRIPT": "Arrancar sem modelo de instalação automática", "VTLANG_AUTOINS_USE": "Arrancar com", - + "VTLANG_NO_PERSIST": "Arrancar sem persistência", "VTLANG_PERSIST_USE": "Arrancar com", - + "VTLANG_BROWER_RETURN": "Voltar", - + "VTLANG_ENTER_EXIT": "pressione a tecla Enter para sair", "VTLANG_ENTER_REBOOT": "pressione a tecla Enter para reiniciar", "VTLANG_ENTER_CONTINUE": "pressione a tecla Enter para continuar", - + "VTLANG_CTRL_TEMP_SET": "Configurações de Controle Temporário", "VTLANG_WIN11_BYPASS_CHECK": "Ignorar checagem de CPU/TPM/SecureBoot quando instalando Windows 11", "VTLANG_WIN11_BYPASS_NRO": "Ignorar requerimento de conta online quanto instalando Windows 11", "VTLANG_LINUX_REMOUNT": "Montar partição Ventoy após boot do Linux", "VTLANG_SECONDARY_BOOT_MENU": "Mostar menu seundário de boot", - + "MENU_STR_XXX": "" } diff --git a/INSTALL/grub/menu/ru_RU.json b/INSTALL/grub/menu/ru_RU.json index 15f2c85ced2..82f536dbb03 100644 --- a/INSTALL/grub/menu/ru_RU.json +++ b/INSTALL/grub/menu/ru_RU.json @@ -1,13 +1,13 @@ { "VTLANG_LANGUAGE_NAME": "Russian (РуÑÑкий)", - + "VTLANG_STR_HOTKEY_LIST": "L:Язык F1:Помощь F2:Обзор F3:ВидСпиÑок F4:ЛокалЗагрузка F5:Ð¡ÐµÑ€Ð²Ð¸Ñ F6:РаÑширМеню", "VTLANG_STR_HOTKEY_TREE": "L:Язык F1:Помощь F2:Обзор F3:ВидДерево F4:ЛокалЗагрузка F5:Ð¡ÐµÑ€Ð²Ð¸Ñ F6:РаÑширМеню", "VTLANG_RETURN_PREVIOUS": "ВернутьÑÑ Ð² предыдущее меню [Esc]", "VTLANG_RETURN_PRV_NOESC": "ВернутьÑÑ Ð² предыдущее меню", - + "VTLANG_MENU_LANG": "Выбор Ñзыка меню", - + "VTLANG_LB_SBOOT_WINDOWS": "Ðайти и загрузить Windows", "VTLANG_LB_SBOOT_G4D": "Ðайти и загрузить Grub4dos", "VTLANG_LB_SBOOT_HDD1": "Загрузить 1-й локальный диÑк", @@ -17,7 +17,7 @@ "VTLANG_LB_SBOOT_IA32EFI": "Ðайти и загрузить BOOTIA32.EFI", "VTLANG_LB_SBOOT_AA64EFI": "Ðайти и загрузить BOOTAA64.EFI", "VTLANG_LB_SBOOT_XORBOOT": "Ðайти и загрузить xorboot", - + "VTLANG_FILE_CHKSUM": "ÐšÐ¾Ð½Ñ‚Ñ€Ð¾Ð»ÑŒÐ½Ð°Ñ Ñумма файла", "VTLANG_CHKSUM_MD5_CALC": "ВычиÑлить md5sum", "VTLANG_CHKSUM_SHA1_CALC": "ВычиÑлить sha1sum", @@ -27,26 +27,26 @@ "VTLANG_CHKSUM_SHA1_CALC_CHK": "ВычиÑлить и проверить sha1sum", "VTLANG_CHKSUM_SHA256_CALC_CHK": "ВычиÑлить и проверить sha256sum", "VTLANG_CHKSUM_SHA512_CALC_CHK": "ВычиÑлить и проверить sha512sum", - + "VTLANG_POWER": "Питание", "VTLANG_POWER_REBOOT": "Перезагрузить", "VTLANG_POWER_HALT": "Завершить работу", "VTLANG_POWER_BOOT_EFIFW": "ПерезагрузитьÑÑ Ð² наÑтройку EFI", - + "VTLANG_KEYBRD_LAYOUT": "РаÑкладки клавиатуры", "VTLANG_HWINFO": "Ð¡Ð²ÐµÐ´ÐµÐ½Ð¸Ñ Ð¾Ð± оборудовании", - + "VTLANG_RESOLUTION_CFG": "ÐšÐ¾Ð½Ñ„Ð¸Ð³ÑƒÑ€Ð°Ñ†Ð¸Ñ Ñ€Ð°Ð·Ñ€ÐµÑˆÐµÐ½Ð¸Ñ", "VTLANG_SCREEN_MODE": "Режим Ð¾Ñ‚Ð¾Ð±Ñ€Ð°Ð¶ÐµÐ½Ð¸Ñ Ñкрана", "VTLANG_SCREEN_TEXT_MODE": "Выбрать текÑтовый режим", "VTLANG_SCREEN_GUI_MODE": "Выбрать графичеÑкий режим", - + "VTLANG_THEME_SELECT": "Выбор темы", - + "VTLANG_UEFI_UTIL": "Утилиты UEFI Ventoy", "VTLANG_UTIL_SHOW_EFI_DRV": "Показать драйверы EFI", "VTLANG_UTIL_FIX_BLINIT_FAIL": "ИÑправить ошибку Windows «BlinitializeLibrary»", - + "VTLANG_JSON_CHK_JSON": "Проверить наÑтройки раÑÑˆÐ¸Ñ€ÐµÐ½Ð¸Ñ Â«json» (ventoy.json)", "VTLANG_JSON_CHK_CONTROL": "Проверить наÑтройки раÑÑˆÐ¸Ñ€ÐµÐ½Ð¸Ñ Â«global control»", "VTLANG_JSON_CHK_THEME": "Проверить наÑтройки раÑÑˆÐ¸Ñ€ÐµÐ½Ð¸Ñ Â«theme»", @@ -62,32 +62,32 @@ "VTLANG_JSON_CHK_CONF_REPLACE": "Проверить наÑтройки раÑÑˆÐ¸Ñ€ÐµÐ½Ð¸Ñ Â«boot conf replace»", "VTLANG_JSON_CHK_DUD": "Проверить наÑтройки раÑÑˆÐ¸Ñ€ÐµÐ½Ð¸Ñ Â«dud»", "VTLANG_JSON_CHK_PASSWORD": "Проверить наÑтройки раÑÑˆÐ¸Ñ€ÐµÐ½Ð¸Ñ Â«password»", - + "VTLANG_NORMAL_MODE": "ЗагрузитьÑÑ Ð² обычном режиме", "VTLANG_WIMBOOT_MODE": "ЗагрузитьÑÑ Ð² режиме wimboot", "VTLANG_GRUB2_MODE": "ЗагрузитьÑÑ Ð² режиме grub2", "VTLANG_MEMDISK_MODE": "ЗагрузитьÑÑ Ð² режиме memdisk", - + "VTLANG_RET_TO_LISTVIEW": "ВернутьÑÑ Ðº Виду ÑпиÑком", "VTLANG_RET_TO_TREEVIEW": "ВернутьÑÑ Ðº Виду древом", - + "VTLANG_NO_AUTOINS_SCRIPT": "Загрузка без шаблона автоматичеÑкой уÑтановки", "VTLANG_AUTOINS_USE": "ЗагрузитьÑÑ Ñ", - + "VTLANG_NO_PERSIST": "Загрузка без ÑохранÑемоÑти", "VTLANG_PERSIST_USE": "ЗагрузитьÑÑ Ñ", - + "VTLANG_BROWER_RETURN": "ВернутьÑÑ", - + "VTLANG_ENTER_EXIT": "нажмите клавишу ввода, чтобы выйти", "VTLANG_ENTER_REBOOT": "нажмите клавишу ввода Ð´Ð»Ñ Ð¿ÐµÑ€ÐµÐ·Ð°Ð³Ñ€ÑƒÐ·ÐºÐ¸", "VTLANG_ENTER_CONTINUE": "нажмите клавишу ввода, чтобы продолжить", - + "VTLANG_CTRL_TEMP_SET": "ÐаÑтройки временного управлениÑ", "VTLANG_WIN11_BYPASS_CHECK": "Обойти проверку CPU/TPM/SecureBoot при уÑтановке Windows 11", "VTLANG_WIN11_BYPASS_NRO": "Обойти требование Ñетевой учётной запиÑи при уÑтановке Windows 11", "VTLANG_LINUX_REMOUNT": "Смонтировать раздел Ventoy поÑле загрузки Linux", "VTLANG_SECONDARY_BOOT_MENU": "Показать вторичное загрузочное меню", - + "MENU_STR_XXX": "" } diff --git a/INSTALL/grub/menu/sr_RS.json b/INSTALL/grub/menu/sr_RS.json index c71e8b10608..cef55e617cc 100644 --- a/INSTALL/grub/menu/sr_RS.json +++ b/INSTALL/grub/menu/sr_RS.json @@ -1,13 +1,13 @@ "VTLANG_LANGUAGE_NAME": "Serbian Latin (Srpski)", - + "VTLANG_STR_HOTKEY_LIST": "L:Језик F1:Help F2:Browse F3:ListView F4:Localboot F5:Tools F6:ExMenu", "VTLANG_STR_HOTKEY_TREE": "L:Језик F1:Help F2:Browse F3:TreeView F4:Localboot F5:Tools F6:ExMenu", "VTLANG_RETURN_PREVIOUS": "Return to previous menu [Esc]", "VTLANG_RETURN_PRV_NOESC": "Return to previous menu", - + "VTLANG_MENU_LANG": "Menu Language Select", - + "VTLANG_LB_SBOOT_WINDOWS": "Search and boot Windows", "VTLANG_LB_SBOOT_G4D": "Search and boot Grub4dos", "VTLANG_LB_SBOOT_HDD1": "Boot the 1st local disk", @@ -17,7 +17,7 @@ "VTLANG_LB_SBOOT_IA32EFI": "Search and boot BOOTIA32.EFI", "VTLANG_LB_SBOOT_AA64EFI": "Search and boot BOOTAA64.EFI", "VTLANG_LB_SBOOT_XORBOOT": "Search and boot xorboot", - + "VTLANG_FILE_CHKSUM": "File checksum", "VTLANG_CHKSUM_MD5_CALC": "Calculate md5sum", "VTLANG_CHKSUM_SHA1_CALC": "Calculate sha1sum", @@ -27,26 +27,26 @@ "VTLANG_CHKSUM_SHA1_CALC_CHK": "Calculate and check sha1sum", "VTLANG_CHKSUM_SHA256_CALC_CHK": "Calculate and check sha256sum", "VTLANG_CHKSUM_SHA512_CALC_CHK": "Calculate and check sha512sum", - + "VTLANG_POWER": "Power", "VTLANG_POWER_REBOOT": "Reboot", "VTLANG_POWER_HALT": "Halt", "VTLANG_POWER_BOOT_EFIFW": "Reboot to EFI setup", - + "VTLANG_KEYBRD_LAYOUT": "Keyboard Layouts", "VTLANG_HWINFO": "Hardware Information", - + "VTLANG_RESOLUTION_CFG": "Resolution Configuration", "VTLANG_SCREEN_MODE": "Screen Display Mode", "VTLANG_SCREEN_TEXT_MODE": "Force Text Mode", "VTLANG_SCREEN_GUI_MODE": "Force Graphics Mode", - + "VTLANG_THEME_SELECT": "Theme Select", - + "VTLANG_UEFI_UTIL": "Ventoy UEFI Utilities", "VTLANG_UTIL_SHOW_EFI_DRV": "Show EFI Drivers", "VTLANG_UTIL_FIX_BLINIT_FAIL": "Fixup Windows BlinitializeLibrary Failure", - + "VTLANG_JSON_CHK_JSON": "Check plugin json configuration (ventoy.json)", "VTLANG_JSON_CHK_CONTROL": "Check global control plugin configuration", "VTLANG_JSON_CHK_THEME": "Check theme plugin configuration", @@ -62,32 +62,32 @@ "VTLANG_JSON_CHK_CONF_REPLACE": "Check boot conf replace plugin configuration", "VTLANG_JSON_CHK_DUD": "Check dud plugin configuration", "VTLANG_JSON_CHK_PASSWORD": "Check password plugin configuration", - + "VTLANG_NORMAL_MODE": "Boot in normal mode", "VTLANG_WIMBOOT_MODE": "Boot in wimboot mode", "VTLANG_GRUB2_MODE": "Boot in grub2 mode", "VTLANG_MEMDISK_MODE": "Boot in memdisk mode", - + "VTLANG_RET_TO_LISTVIEW": "Return to ListView", "VTLANG_RET_TO_TREEVIEW": "Return to TreeView", - + "VTLANG_NO_AUTOINS_SCRIPT": "Boot without auto installation template", "VTLANG_AUTOINS_USE": "Boot with", - + "VTLANG_NO_PERSIST": "Boot without persistence", "VTLANG_PERSIST_USE": "Boot with", - + "VTLANG_BROWER_RETURN": "Return", - + "VTLANG_ENTER_EXIT": "press Enter key to exit", "VTLANG_ENTER_REBOOT": "press Enter key to reboot", "VTLANG_ENTER_CONTINUE": "press Enter key to continue", - + "VTLANG_CTRL_TEMP_SET": "Temporary Control Settings", "VTLANG_WIN11_BYPASS_CHECK": "Bypass CPU/TPM/SecureBoot check when install Windows 11", "VTLANG_WIN11_BYPASS_NRO": "Bypass online account requirement when install Windows 11", "VTLANG_LINUX_REMOUNT": "Mount Ventoy partition after boot Linux", "VTLANG_SECONDARY_BOOT_MENU": "Show secondary boot menu", - + "MENU_STR_XXX": "" } diff --git a/INSTALL/grub/menu/ta_IN.json b/INSTALL/grub/menu/ta_IN.json index 1c64cc4d0fe..ded9488edc9 100644 --- a/INSTALL/grub/menu/ta_IN.json +++ b/INSTALL/grub/menu/ta_IN.json @@ -1,13 +1,13 @@ { "VTLANG_LANGUAGE_NAME": "Tamil (தமிழà¯)", - + "VTLANG_STR_HOTKEY_LIST": "L:மொழி F1:உதவி F2:உலாவà¯à®• F3:படà¯à®Ÿà®¿à®¯à®²à¯à®ªà®¾à®°à¯à®µà¯ˆ F4:லோகà¯à®•லà¯à®ªà¯‚ட௠F5:கரà¯à®µà®¿à®•ள௠F6:ExMenu", "VTLANG_STR_HOTKEY_TREE": "L:மொழி F1:உதவி F2:உலாவà¯à®• F3:மரபà¯à®ªà®¾à®°à¯à®µà¯ˆ F4:லோகà¯à®•லà¯à®ªà¯‚ட௠F5:கரà¯à®µà®¿à®•ள௠F6:ExMenu", "VTLANG_RETURN_PREVIOUS": "à®®à¯à®¨à¯à®¤à¯ˆà®¯ படà¯à®Ÿà®¿à®¯à®²à¯à®•à¯à®•à¯à®¤à¯ திரà¯à®®à¯à®ªà¯ [Esc]", "VTLANG_RETURN_PRV_NOESC": "à®®à¯à®¨à¯à®¤à¯ˆà®¯ படà¯à®Ÿà®¿à®¯à®²à¯à®•à¯à®•à¯à®¤à¯ திரà¯à®®à¯à®ªà¯", - + "VTLANG_MENU_LANG": "மொழி தேரà¯à®µà¯ படà¯à®Ÿà®¿à®¯à®²à¯", - + "VTLANG_LB_SBOOT_WINDOWS": "விணà¯à®Ÿà¯‹à®¸à¯ˆà®¤à¯ தேடி தà¯à®µà®•à¯à®•வà¯à®®à¯", "VTLANG_LB_SBOOT_G4D": "Grub4dos à®à®¤à¯ தேடி தà¯à®µà®•à¯à®•வà¯à®®à¯", "VTLANG_LB_SBOOT_HDD1": "1வத௠உளà¯à®³à¯‚ர௠வடà¯à®Ÿà¯ˆ தà¯à®µà®•à¯à®•வà¯à®®à¯", @@ -17,7 +17,7 @@ "VTLANG_LB_SBOOT_IA32EFI": "BOOTIA32.EFI à®à®¤à¯ தேடி தà¯à®µà®•à¯à®•வà¯à®®à¯", "VTLANG_LB_SBOOT_AA64EFI": "BOOTAA64.EFI à®à®¤à¯ தேடி தà¯à®µà®•à¯à®•வà¯à®®à¯", "VTLANG_LB_SBOOT_XORBOOT": "xorboot à®à®¤à¯ தேடி தà¯à®µà®•à¯à®•வà¯à®®à¯", - + "VTLANG_FILE_CHKSUM": "கோபà¯à®ªà¯ செகà¯à®šà®®à¯", "VTLANG_CHKSUM_MD5_CALC": "md5sum à®à®•௠கணகà¯à®•ிடவà¯à®®à¯", "VTLANG_CHKSUM_SHA1_CALC": "sha1sum à®à®•௠கணகà¯à®•ிடவà¯à®®à¯", @@ -27,26 +27,26 @@ "VTLANG_CHKSUM_SHA1_CALC_CHK": "sha1sum à®à®•௠கணகà¯à®•ிடà¯à®Ÿà¯ சரிபாரà¯à®•à¯à®•வà¯à®®à¯", "VTLANG_CHKSUM_SHA256_CALC_CHK": "sha256sum à®à®•௠கணகà¯à®•ிடà¯à®Ÿà¯ சரிபாரà¯à®•à¯à®•வà¯à®®à¯", "VTLANG_CHKSUM_SHA512_CALC_CHK": "sha512sum à®à®•௠கணகà¯à®•ிடà¯à®Ÿà¯ சரிபாரà¯à®•à¯à®•வà¯à®®à¯", - + "VTLANG_POWER": "பவரà¯", "VTLANG_POWER_REBOOT": "மறà¯à®¤à¯Šà®Ÿà®•à¯à®•à®®à¯", "VTLANG_POWER_HALT": "நிறà¯à®¤à¯à®¤à¯", "VTLANG_POWER_BOOT_EFIFW": "EFI அமைபà¯à®ªà®¿à®±à¯à®•௠மீணà¯à®Ÿà¯à®®à¯ தà¯à®µà®•à¯à®•வà¯à®®à¯", - + "VTLANG_KEYBRD_LAYOUT": "விசைபà¯à®ªà®²à®•ை தளவமைபà¯à®ªà¯à®•ளà¯", "VTLANG_HWINFO": "வனà¯à®ªà¯Šà®°à¯à®³à¯ தகவலà¯", - + "VTLANG_RESOLUTION_CFG": "தீரà¯à®®à®¾à®©à®®à¯ கடà¯à®Ÿà®®à¯ˆà®ªà¯à®ªà¯", "VTLANG_SCREEN_MODE": "திரை காடà¯à®šà®¿ பயனà¯à®®à¯à®±à¯ˆ", "VTLANG_SCREEN_TEXT_MODE": "கடà¯à®Ÿà®¾à®¯ உரை பயனà¯à®®à¯à®±à¯ˆ", "VTLANG_SCREEN_GUI_MODE": "கடà¯à®Ÿà®¾à®¯ கிராபிகà¯à®¸à¯ பயனà¯à®®à¯à®±à¯ˆ", - + "VTLANG_THEME_SELECT": "தீம௠தேரà¯à®µà¯", - + "VTLANG_UEFI_UTIL": "Ventoy UEFI பயனà¯à®ªà®¾à®Ÿà¯à®•ளà¯", "VTLANG_UTIL_SHOW_EFI_DRV": "EFI இயகà¯à®•ிகளைக௠காடà¯à®Ÿà¯", "VTLANG_UTIL_FIX_BLINIT_FAIL": "Windows BlinitializeLibrary தோலà¯à®µà®¿à®¯à¯ˆà®šà¯ சரிசெயà¯à®¤à®²à¯", - + "VTLANG_JSON_CHK_JSON": "செரà¯à®•à¯à®¨à®¿à®°à®²à¯ json உளà¯à®³à®®à¯ˆà®µà¯ˆà®šà¯ சரிபாரà¯à®•à¯à®•வà¯à®®à¯ (ventoy.json)", "VTLANG_JSON_CHK_CONTROL": "உலகளாவிய கடà¯à®Ÿà¯à®ªà¯à®ªà®¾à®Ÿà¯à®Ÿà¯ செரà¯à®•à¯à®¨à®¿à®°à®²à¯ உளà¯à®³à®®à¯ˆà®µà¯ˆà®šà¯ சரிபாரà¯à®•à¯à®•வà¯à®®à¯", "VTLANG_JSON_CHK_THEME": "தீம௠செரà¯à®•à¯à®¨à®¿à®°à®²à¯ உளà¯à®³à®®à¯ˆà®µà¯ˆà®šà¯ சரிபாரà¯à®•à¯à®•வà¯à®®à¯", @@ -62,32 +62,32 @@ "VTLANG_JSON_CHK_CONF_REPLACE": "பூட௠conf சொரà¯à®•ி உளà¯à®³à®®à¯ˆà®µà¯ˆ மாறà¯à®±à¯à®µà®¤à¯ˆ சரிபாரà¯à®•à¯à®•வà¯à®®à¯", "VTLANG_JSON_CHK_DUD": "dud செரà¯à®•à¯à®¨à®¿à®°à®²à¯ உளà¯à®³à®®à¯ˆà®µà¯ˆ சரிபாரà¯à®•à¯à®•வà¯à®®à¯", "VTLANG_JSON_CHK_PASSWORD": "கடவà¯à®šà¯à®šà¯Šà®²à¯ செரà¯à®•à¯à®¨à®¿à®°à®²à¯ உளà¯à®³à®®à¯ˆà®µà¯ˆà®šà¯ சரிபாரà¯à®•à¯à®•வà¯à®®à¯", - + "VTLANG_NORMAL_MODE": "சாதாரண பயனà¯à®®à¯à®±à¯ˆà®¯à®¿à®²à¯ தà¯à®µà®•à¯à®•வà¯à®®à¯", "VTLANG_WIMBOOT_MODE": "wimboot பயனà¯à®®à¯à®±à¯ˆà®¯à®¿à®²à¯ தà¯à®µà®•à¯à®•வà¯à®®à¯", "VTLANG_GRUB2_MODE": "grub2 பயனà¯à®®à¯à®±à¯ˆà®¯à®¿à®²à¯ தà¯à®µà®•à¯à®•வà¯à®®à¯", "VTLANG_MEMDISK_MODE": "memdisk பயனà¯à®®à¯à®±à¯ˆà®¯à®¿à®²à¯ தà¯à®µà®•à¯à®•வà¯à®®à¯", - + "VTLANG_RET_TO_LISTVIEW": "படà¯à®Ÿà®¿à®¯à®²à¯à®ªà®¾à®°à¯à®µà¯ˆ பகà¯à®•தà¯à®¤à¯à®•à¯à®•à¯à®¤à¯ திரà¯à®®à¯à®ªà¯", "VTLANG_RET_TO_TREEVIEW": "மரபà¯à®ªà®¾à®°à¯à®µà¯ˆ பகà¯à®•தà¯à®¤à¯à®•à¯à®•à¯à®¤à¯ திரà¯à®®à¯à®ªà¯", - + "VTLANG_NO_AUTOINS_SCRIPT": "தானியஙà¯à®•ி நிறà¯à®µà®²à¯ டெமà¯à®ªà¯à®³à¯‡à®Ÿà¯ இலà¯à®²à®¾à®®à®²à¯ தà¯à®µà®•à¯à®•வà¯à®®à¯", "VTLANG_AUTOINS_USE": "தà¯à®µà®•à¯à®•வà¯à®®à¯ இதà¯à®¤à¯à®Ÿà®©à¯", - + "VTLANG_NO_PERSIST": "விடாமà¯à®¯à®±à¯à®šà®¿ இலà¯à®²à®¾à®®à®²à¯ தà¯à®µà®•à¯à®•வà¯à®®à¯", "VTLANG_PERSIST_USE": "தà¯à®µà®•à¯à®•வà¯à®®à¯ இதà¯à®¤à¯à®Ÿà®©à¯", - + "VTLANG_BROWER_RETURN": "திரà¯à®®à¯à®ªà¯", - + "VTLANG_ENTER_EXIT": "வெளியேற Enter விசையை à®…à®´à¯à®¤à¯à®¤à®µà¯à®®à¯", "VTLANG_ENTER_REBOOT": "மறà¯à®¤à¯Šà®Ÿà®•à¯à®•ம௠செயà¯à®¯ Enter விசையை à®…à®´à¯à®¤à¯à®¤à®µà¯à®®à¯", "VTLANG_ENTER_CONTINUE": "தொடர Enter விசையை à®…à®´à¯à®¤à¯à®¤à®µà¯à®®à¯", - + "VTLANG_CTRL_TEMP_SET": "தறà¯à®•ாலிக கடà¯à®Ÿà¯à®ªà¯à®ªà®¾à®Ÿà¯à®Ÿà¯ அமைபà¯à®ªà¯à®•ளà¯", "VTLANG_WIN11_BYPASS_CHECK": "விணà¯à®Ÿà¯‹à®¸à¯ 11 ஠நிறà¯à®µà¯à®®à¯ போத௠CPU/TPM/SecureBoot சரிபாரà¯à®ªà¯ˆ பà¯à®±à®•à¯à®•ணிகà¯à®•வà¯à®®à¯", "VTLANG_WIN11_BYPASS_NRO": "விணà¯à®Ÿà¯‹à®¸à¯ 11 ஠நிறà¯à®µà¯à®®à¯ போத௠ஆனà¯à®²à¯ˆà®©à¯ கணகà¯à®•ின௠தேவையை பà¯à®±à®•à¯à®•ணிகà¯à®•வà¯à®®à¯", "VTLANG_LINUX_REMOUNT": "லினகà¯à®¸à¯ˆ தà¯à®µà®•à¯à®•ிய பிறக௠Ventoy பகிரà¯à®µà¯ˆ à®à®±à¯à®±à®µà¯à®®à¯", "VTLANG_SECONDARY_BOOT_MENU": "இரணà¯à®Ÿà®¾à®®à¯ நிலை தà¯à®µà®•à¯à®• படà¯à®Ÿà®¿à®¯à®²à¯ˆà®•௠காடà¯à®Ÿà¯", - + "MENU_STR_XXX": "" } diff --git a/INSTALL/grub/menu/tr_TR.json b/INSTALL/grub/menu/tr_TR.json index bb7bc360c4b..bcded0f54ab 100644 --- a/INSTALL/grub/menu/tr_TR.json +++ b/INSTALL/grub/menu/tr_TR.json @@ -1,6 +1,6 @@ { "VTLANG_LANGUAGE_NAME": "Turkish (Türkçe)", - + "VTLANG_STR_HOTKEY_LIST": "L:Dil F1:Yardım F2:Gözat F3:Liste Görünümü F4:Önyükleme Seçenekleri F5:Araçlar F6:Grub2 Menü", "VTLANG_STR_HOTKEY_TREE": "L:Dil F1:Yardım F2:Gözat F3:AÄŸaç Görünümü F4:Önyükleme Seçenekleri F5:Araçlar F6:Grub2 Menü", "VTLANG_RETURN_PREVIOUS": "Önceki menüye geri dön [Esc]", diff --git a/INSTALL/grub/menu/uk_UA.json b/INSTALL/grub/menu/uk_UA.json index caf810b1db9..928ab9611bf 100644 --- a/INSTALL/grub/menu/uk_UA.json +++ b/INSTALL/grub/menu/uk_UA.json @@ -1,13 +1,13 @@ { "VTLANG_LANGUAGE_NAME": "Ukrainian (УкраїнÑька)", - + "VTLANG_STR_HOTKEY_LIST": "L:Мова F1:Довідка F2:ПереглÑд F3:Вид ÑпиÑком F4:Локальне Ð·Ð°Ð²Ð°Ð½Ñ‚Ð°Ð¶ÐµÐ½Ð½Ñ F5:ІнÑтрументи F6:Вийти з меню", "VTLANG_STR_HOTKEY_TREE": "L:Мова F1:Довідка F2:ПереглÑд F3:Вид деревом F4:Локальне Ð·Ð°Ð²Ð°Ð½Ñ‚Ð°Ð¶ÐµÐ½Ð½Ñ F5:ІнÑтрументи F6:Вийти з меню", "VTLANG_RETURN_PREVIOUS": "ПовернутиÑÑŒ до попереднього меню [Esc]", "VTLANG_RETURN_PRV_NOESC": "ПовернутиÑÑŒ до попереднього меню", - + "VTLANG_MENU_LANG": "Мова меню", - + "VTLANG_LB_SBOOT_WINDOWS": "Знайти та завантажити Windows", "VTLANG_LB_SBOOT_G4D": "Знайти та завантажити Grub4dos", "VTLANG_LB_SBOOT_HDD1": "Завантажити 1-й локальний диÑк", @@ -17,7 +17,7 @@ "VTLANG_LB_SBOOT_IA32EFI": "Знайти та завантажити BOOTIA32.EFI", "VTLANG_LB_SBOOT_AA64EFI": "Знайти та завантажити BOOTAA64.EFI", "VTLANG_LB_SBOOT_XORBOOT": "Знайти та завантажити xorboot", - + "VTLANG_FILE_CHKSUM": "Контрольна Ñума файлу", "VTLANG_CHKSUM_MD5_CALC": "Розрахувати md5", "VTLANG_CHKSUM_SHA1_CALC": "Розрахувати sha1", @@ -27,26 +27,26 @@ "VTLANG_CHKSUM_SHA1_CALC_CHK": "Розрахувати та перевірити sha1", "VTLANG_CHKSUM_SHA256_CALC_CHK": "Розрахувати та перевірити sha256", "VTLANG_CHKSUM_SHA512_CALC_CHK": "Розрахувати та перевірити sha512", - + "VTLANG_POWER": "ЖивленнÑ", "VTLANG_POWER_REBOOT": "Перезавантажити", "VTLANG_POWER_HALT": "Завершити роботу", "VTLANG_POWER_BOOT_EFIFW": "ПерезавантажитиÑÑŒ до налаштувань UEFI/BIOS", - + "VTLANG_KEYBRD_LAYOUT": "Розкладка клавіатури", "VTLANG_HWINFO": "ВідомоÑті про приÑтрій", - + "VTLANG_RESOLUTION_CFG": "ÐÐ°Ð»Ð°ÑˆÑ‚ÑƒÐ²Ð°Ð½Ð½Ñ Ñ€Ð¾Ð·Ð´Ñ–Ð»ÑŒÐ½Ð¾Ñ— здатноÑті", "VTLANG_SCREEN_MODE": "Ð†Ð½Ñ‚ÐµÑ€Ñ„ÐµÐ¹Ñ ÐºÐ¾Ñ€Ð¸Ñтувача", "VTLANG_SCREEN_TEXT_MODE": "Перейти до текÑтового інтерфейÑу", "VTLANG_SCREEN_GUI_MODE": "Перейти до графічного інтерфейÑу", - + "VTLANG_THEME_SELECT": "Теми", - + "VTLANG_UEFI_UTIL": "Утиліти Ventoy UEFI", "VTLANG_UTIL_SHOW_EFI_DRV": "Показати драйвери EFI", "VTLANG_UTIL_FIX_BLINIT_FAIL": "Виправити помилку Windows 'BlinitializeLibrary Failure'", - + "VTLANG_JSON_CHK_JSON": "Перевірити Ð½Ð°Ð»Ð°ÑˆÑ‚ÑƒÐ²Ð°Ð½Ð½Ñ Ð¿Ð»Ð°Ð³Ñ–Ð½Ñƒ 'json' (ventoy.json)", "VTLANG_JSON_CHK_CONTROL": "Перевірити Ð½Ð°Ð»Ð°ÑˆÑ‚ÑƒÐ²Ð°Ð½Ð½Ñ Ð¿Ð»Ð°Ð³Ñ–Ð½Ñƒ 'global control'", "VTLANG_JSON_CHK_THEME": "Перевірити Ð½Ð°Ð»Ð°ÑˆÑ‚ÑƒÐ²Ð°Ð½Ð½Ñ Ð¿Ð»Ð°Ð³Ñ–Ð½Ñƒ 'theme'", @@ -62,32 +62,32 @@ "VTLANG_JSON_CHK_CONF_REPLACE": "Перевірити Ð½Ð°Ð»Ð°ÑˆÑ‚ÑƒÐ²Ð°Ð½Ð½Ñ Ð¿Ð»Ð°Ð³Ñ–Ð½Ñƒ 'boot conf replace'", "VTLANG_JSON_CHK_DUD": "Перевірити Ð½Ð°Ð»Ð°ÑˆÑ‚ÑƒÐ²Ð°Ð½Ð½Ñ Ð¿Ð»Ð°Ð³Ñ–Ð½Ñƒ 'dud'", "VTLANG_JSON_CHK_PASSWORD": "Перевірити Ð½Ð°Ð»Ð°ÑˆÑ‚ÑƒÐ²Ð°Ð½Ð½Ñ Ð¿Ð»Ð°Ð³Ñ–Ð½Ñƒ 'password'", - + "VTLANG_NORMAL_MODE": "Завантажити в нормальному режимі", "VTLANG_WIMBOOT_MODE": "Завантажити в режимі wimboot", "VTLANG_GRUB2_MODE": "Завантажити в режимі GRUB2", "VTLANG_MEMDISK_MODE": "Завантажити в режимі MEMDISK", - + "VTLANG_RET_TO_LISTVIEW": "ПовернутиÑÑŒ до переглÑду ÑпиÑком", "VTLANG_RET_TO_TREEVIEW": "ПовернутиÑÑŒ до деревовидного переглÑду", - + "VTLANG_NO_AUTOINS_SCRIPT": "Завантажити без шаблону авто-інÑталÑції", "VTLANG_AUTOINS_USE": "Завантажити з", - + "VTLANG_NO_PERSIST": "Завантажити без збереженнÑ", "VTLANG_PERSIST_USE": "Завантажити з ", - + "VTLANG_BROWER_RETURN": "ПовернутиÑÑŒ", - + "VTLANG_ENTER_EXIT": "натиÑніть Enter Ð´Ð»Ñ Ð²Ð¸Ñ…Ð¾Ð´Ñƒ", "VTLANG_ENTER_REBOOT": "натиÑніть Enter Ð´Ð»Ñ Ð¿ÐµÑ€ÐµÐ·Ð°Ð²Ð°Ð½Ñ‚Ð°Ð¶ÐµÐ½Ð½Ñ", "VTLANG_ENTER_CONTINUE": "натиÑніть Enter Ð´Ð»Ñ Ð¿Ñ€Ð¾Ð´Ð¾Ð²Ð¶ÐµÐ½Ð½Ñ", - + "VTLANG_CTRL_TEMP_SET": "Різні налаштуваннÑ", "VTLANG_WIN11_BYPASS_CHECK": "Обійти перевірку CPU/TPM/SecureBoot під Ñ‡Ð°Ñ Ñ–Ð½ÑталÑції Windows 11", "VTLANG_WIN11_BYPASS_NRO": "Обійти вимогу онлайн-аккаунту під Ñ‡Ð°Ñ Ñ–Ð½ÑталÑції Windows 11", "VTLANG_LINUX_REMOUNT": "Монтувати розділ Ventoy піÑÐ»Ñ Ð·Ð°Ð²Ð°Ð½Ñ‚Ð°Ð¶ÐµÐ½Ð½Ñ Linux", "VTLANG_SECONDARY_BOOT_MENU": "Показувати вторинне меню завантаженнÑ", - + "MENU_STR_XXX": "" } diff --git a/INSTALL/grub/menu/vi_VN.json b/INSTALL/grub/menu/vi_VN.json index eddf6e78e58..23dc1d524c8 100644 --- a/INSTALL/grub/menu/vi_VN.json +++ b/INSTALL/grub/menu/vi_VN.json @@ -1,13 +1,13 @@ { "VTLANG_LANGUAGE_NAME": "Vietnamese (Tiếng Việt)", - + "VTLANG_STR_HOTKEY_LIST": "L:Ngôn ngữ F1:Trợ giúp F2:Duyệt F3:ListView F4:Khởi động cục bá»™ F5:Công cụ F6:ExMenu", "VTLANG_STR_HOTKEY_TREE": "L:Ngôn ngữ F1:Trợ giúp F2:Duyệt F3:TreeView F4:Khởi động cục bá»™ F5:Công cụ F6:ExMenu", "VTLANG_RETURN_PREVIOUS": "Trở vá» menu trước [Esc]", "VTLANG_RETURN_PRV_NOESC": "Trở vá» menu trước", - + "VTLANG_MENU_LANG": "Chá»n ngôn ngữ menu", - + "VTLANG_LB_SBOOT_WINDOWS": "Tìm kiếm và khởi động Windows", "VTLANG_LB_SBOOT_G4D": "Tìm kiếm và khởi động Grub4dos", "VTLANG_LB_SBOOT_HDD1": "Khởi động từ ổ đĩa thứ 1 ở trên máy", @@ -17,7 +17,7 @@ "VTLANG_LB_SBOOT_IA32EFI": "Tìm kiếm và khởi động BOOTIA32.EFI", "VTLANG_LB_SBOOT_AA64EFI": "Tìm kiếm và khởi động BOOTAA64.EFI", "VTLANG_LB_SBOOT_XORBOOT": "Tìm kiếm và khởi động xorboot", - + "VTLANG_FILE_CHKSUM": "Checksum tệp", "VTLANG_CHKSUM_MD5_CALC": "Tính md5sum", "VTLANG_CHKSUM_SHA1_CALC": "Tính sha1sum", @@ -27,26 +27,26 @@ "VTLANG_CHKSUM_SHA1_CALC_CHK": "Tính và kiểm tra sha1sum", "VTLANG_CHKSUM_SHA256_CALC_CHK": "Tính và kiểm tra sha256sum", "VTLANG_CHKSUM_SHA512_CALC_CHK": "Tính và kiểm tra sha512sum", - + "VTLANG_POWER": "Nguồn Ä‘iện", "VTLANG_POWER_REBOOT": "Khởi động lại", "VTLANG_POWER_HALT": "Tắt máy", "VTLANG_POWER_BOOT_EFIFW": "Khởi động lại vào cài đặt UEFI", - + "VTLANG_KEYBRD_LAYOUT": "Bố cục bàn phím", "VTLANG_HWINFO": "Thông tin phần cứng", - + "VTLANG_RESOLUTION_CFG": "Cấu hình độ phân giải", "VTLANG_SCREEN_MODE": "Chế độ hiển thị", "VTLANG_SCREEN_TEXT_MODE": "Bắt buá»™c giao diện văn bản", "VTLANG_SCREEN_GUI_MODE": "Bắt buá»™c giao diện đồ hoạ", - + "VTLANG_THEME_SELECT": "Chá»n chá»§ Ä‘á»", - + "VTLANG_UEFI_UTIL": "Các tiện ích UEFI Ventoy", "VTLANG_UTIL_SHOW_EFI_DRV": "Hiển thị các driver EFI", "VTLANG_UTIL_FIX_BLINIT_FAIL": "Sá»­a lá»—i BlinitializeLibrary cá»§a Windows", - + "VTLANG_JSON_CHK_JSON": "Kiểm tra cấu hình plugin json (ventoy.json)", "VTLANG_JSON_CHK_CONTROL": "Kiểm tra cấu hình plugin Ä‘iá»u khiển toàn cục", "VTLANG_JSON_CHK_THEME": "Kiểm tra cấu hình plugin chá»§ Ä‘á»", @@ -62,32 +62,32 @@ "VTLANG_JSON_CHK_CONF_REPLACE": "Kiểm tra cấu hình plugin boot replace conf", "VTLANG_JSON_CHK_DUD": "Kiểm tra cấu hình plugin dud", "VTLANG_JSON_CHK_PASSWORD": "Kiểm tra cấu hình plugin mật khẩu", - + "VTLANG_NORMAL_MODE": "Khởi động ở chế độ bình thưá»ng", "VTLANG_WIMBOOT_MODE": "Khởi động ở chế độ wimboot", "VTLANG_GRUB2_MODE": "Khởi động ở chế độ GRUB2", "VTLANG_MEMDISK_MODE": "Khởi động ở chế độ memdisk", - + "VTLANG_RET_TO_LISTVIEW": "Trở vá» ListView", "VTLANG_RET_TO_TREEVIEW": "Trở vá» TreeView", - + "VTLANG_NO_AUTOINS_SCRIPT": "Khởi động không dùng mẫu cài đặt", "VTLANG_AUTOINS_USE": "Khởi động vá»›i", - + "VTLANG_NO_PERSIST": "Khởi động không có persistence", "VTLANG_PERSIST_USE": "Khởi động vá»›i", - + "VTLANG_BROWER_RETURN": "Trở vá»", - + "VTLANG_ENTER_EXIT": "nhấn Enter để thoát", "VTLANG_ENTER_REBOOT": "nhấn Enter để khởi động lại", "VTLANG_ENTER_CONTINUE": "nhấn enter để tiếp tục", - + "VTLANG_CTRL_TEMP_SET": "Cài đặt Ä‘iá»u khiển tạm", "VTLANG_WIN11_BYPASS_CHECK": "Bá» qua kiểm tra CPU/TPM/SecureBoot khi cài đặt Windows 11", "VTLANG_WIN11_BYPASS_NRO": "Bá» qua yêu cầu tài khoản trá»±c tuyến khi cài đặt Windows 11", "VTLANG_LINUX_REMOUNT": "Gắn phân vùng Ventoy sau khi khởi động GNU/Linux", "VTLANG_SECONDARY_BOOT_MENU": "Hiện menu khởi động thứ cấp`", - + "MENU_STR_XXX": "" } diff --git a/INSTALL/grub/menu/zh_CN.json b/INSTALL/grub/menu/zh_CN.json index 570d11ae272..529824787a3 100644 --- a/INSTALL/grub/menu/zh_CN.json +++ b/INSTALL/grub/menu/zh_CN.json @@ -5,9 +5,9 @@ "VTLANG_STR_HOTKEY_TREE": "L:语言 F1:帮助 F2:本地æµè§ˆ F3:æ ‘å½¢æ¨¡å¼ F4:本地å¯åЍ F5:工具 F6:扩展èœå•", "VTLANG_RETURN_PREVIOUS": "返回上一级èœå• [Esc]", "VTLANG_RETURN_PRV_NOESC": "返回上一级èœå•", - + "VTLANG_MENU_LANG": "èœå•语言", - + "VTLANG_LB_SBOOT_WINDOWS": "æœç´¢å¹¶å¯åЍ Windows", "VTLANG_LB_SBOOT_G4D": "æœç´¢å¹¶å¯åЍ Grub4dos", "VTLANG_LB_SBOOT_HDD1": "å¯åŠ¨æœ¬åœ°ç¡¬ç›˜1中的系统", @@ -27,26 +27,26 @@ "VTLANG_CHKSUM_SHA1_CALC_CHK": "计算并检查 SHA1 校验值", "VTLANG_CHKSUM_SHA256_CALC_CHK": "计算并检查 SHA256 校验值", "VTLANG_CHKSUM_SHA512_CALC_CHK": "计算并检查 SHA512 校验值", - + "VTLANG_POWER": "电æº", "VTLANG_POWER_REBOOT": "é‡å¯", "VTLANG_POWER_HALT": "关机", "VTLANG_POWER_BOOT_EFIFW": "é‡å¯è¿›å…¥ UEFI 设置èœå•", - + "VTLANG_KEYBRD_LAYOUT": "键盘布局", "VTLANG_HWINFO": "硬件信æ¯", - + "VTLANG_RESOLUTION_CFG": "å±å¹•分辨率", "VTLANG_SCREEN_MODE": "显示模å¼", "VTLANG_SCREEN_TEXT_MODE": "文本模å¼", "VTLANG_SCREEN_GUI_MODE": "图形模å¼", - + "VTLANG_THEME_SELECT": "主题选择", - + "VTLANG_UEFI_UTIL": "Ventoy UEFI 工具", "VTLANG_UTIL_SHOW_EFI_DRV": "显示 UEFI 驱动", "VTLANG_UTIL_FIX_BLINIT_FAIL": "ä¿®å¤ Windows BlinitializeLibrary 错误", - + "VTLANG_JSON_CHK_JSON": "检查æ’ä»¶é…置文件 (ventoy.json)", "VTLANG_JSON_CHK_CONTROL": "é…置检查 —— 全局控制æ’ä»¶", "VTLANG_JSON_CHK_THEME": "é…置检查 —— 主题æ’ä»¶", @@ -62,32 +62,32 @@ "VTLANG_JSON_CHK_CONF_REPLACE": "é…置检查 —— å¯åЍé…ç½®æ›¿æ¢æ’ä»¶", "VTLANG_JSON_CHK_DUD": "é…置检查 —— Driver Update Diskæ’ä»¶", "VTLANG_JSON_CHK_PASSWORD": "é…置检查 —— å¯†ç æ’ä»¶", - + "VTLANG_NORMAL_MODE": "以正常模å¼å¯åЍ", "VTLANG_WIMBOOT_MODE": "以 wimboot 模å¼å¯åЍ", "VTLANG_GRUB2_MODE": "以 grub2 模å¼å¯åЍ", "VTLANG_MEMDISK_MODE": "以内存盘模å¼å¯åЍ", - + "VTLANG_RET_TO_LISTVIEW": "返回到列表模å¼", "VTLANG_RET_TO_TREEVIEW": "返回到树形模å¼", - + "VTLANG_NO_AUTOINS_SCRIPT": "ä¸ä½¿ç”¨è‡ªåŠ¨å®‰è£…è„šæœ¬", "VTLANG_AUTOINS_USE": "使用", - + "VTLANG_NO_PERSIST": "ä¸ä½¿ç”¨æŒä¹…åŒ–æ•°æ®æ–‡ä»¶", "VTLANG_PERSIST_USE": "使用", - + "VTLANG_BROWER_RETURN": "返回", - + "VTLANG_ENTER_EXIT": "按回车键退出", "VTLANG_ENTER_REBOOT": "按回车键é‡å¯", "VTLANG_ENTER_CONTINUE": "按回车键继续", - + "VTLANG_CTRL_TEMP_SET": "控制å˜é‡è®¾ç½®", "VTLANG_WIN11_BYPASS_CHECK": "安装 Windows 11 时绕过 TPM/安全å¯åЍ 等硬件检查", "VTLANG_WIN11_BYPASS_NRO": "安装 Windows 11 æ—¶ç»•è¿‡åœ¨çº¿è´¦æˆ·çš„è¦æ±‚", "VTLANG_LINUX_REMOUNT": "å¯åЍ Linux ç³»ç»ŸåŽæŒ‚è½½ Ventoy 分区", "VTLANG_SECONDARY_BOOT_MENU": "显示二级å¯åЍèœå•", - + "MENU_STR_XXX": "" } diff --git a/INSTALL/grub/menu/zh_TW.json b/INSTALL/grub/menu/zh_TW.json index 962fe5d78f2..1554050cf09 100644 --- a/INSTALL/grub/menu/zh_TW.json +++ b/INSTALL/grub/menu/zh_TW.json @@ -5,9 +5,9 @@ "VTLANG_STR_HOTKEY_TREE": "L:語言 F1:說明 F2:ç€è¦½ F3:樹狀檢視 F4:本機啟動 F5:工具 F6:附加é¸å–®", "VTLANG_RETURN_PREVIOUS": "返回上一層é¸å–® [Esc]", "VTLANG_RETURN_PRV_NOESC": "返回上一層é¸å–®", - + "VTLANG_MENU_LANG": "é¸å–®èªžè¨€", - + "VTLANG_LB_SBOOT_WINDOWS": "æœå°‹ä¸¦å•Ÿå‹• Windows", "VTLANG_LB_SBOOT_G4D": "æœå°‹ä¸¦å•Ÿå‹• Grub4dos", "VTLANG_LB_SBOOT_HDD1": "啟動本機硬碟1中的系統", @@ -27,26 +27,26 @@ "VTLANG_CHKSUM_SHA1_CALC_CHK": "計算並檢查 SHA1 檢查碼", "VTLANG_CHKSUM_SHA256_CALC_CHK": "計算並檢查 SHA256 檢查碼", "VTLANG_CHKSUM_SHA512_CALC_CHK": "計算並檢查 SHA512 檢查碼", - + "VTLANG_POWER": "é›»æº", "VTLANG_POWER_REBOOT": "釿–°é–‹æ©Ÿ", "VTLANG_POWER_HALT": "關機", "VTLANG_POWER_BOOT_EFIFW": "釿–°é–‹æ©Ÿé€²å…¥ UEFI 設定é¸å–®", - + "VTLANG_KEYBRD_LAYOUT": "éµç›¤è¨­å®š", "VTLANG_HWINFO": "硬體資訊", - + "VTLANG_RESOLUTION_CFG": "螢幕解æžåº¦", "VTLANG_SCREEN_MODE": "顯示模å¼", "VTLANG_SCREEN_TEXT_MODE": "強制文字模å¼", "VTLANG_SCREEN_GUI_MODE": "強制圖形模å¼", - + "VTLANG_THEME_SELECT": "ä¸»é¡Œé¢¨æ ¼é¸æ“‡", - + "VTLANG_UEFI_UTIL": "Ventoy UEFI 實用程å¼", "VTLANG_UTIL_SHOW_EFI_DRV": "顯示 UEFI é©…å‹•", "VTLANG_UTIL_FIX_BLINIT_FAIL": "修復 Windows BlinitializeLibrary 錯誤", - + "VTLANG_JSON_CHK_JSON": "檢查外掛程å¼è¨­å®šæª” (ventoy.json)", "VTLANG_JSON_CHK_CONTROL": "設定檢查 —— 全域控制外掛程å¼", "VTLANG_JSON_CHK_THEME": "設定檢查 —— 主題風格外掛程å¼", @@ -62,23 +62,23 @@ "VTLANG_JSON_CHK_CONF_REPLACE": "設定檢查 —— 啟動設定替æ›å¤–掛程å¼", "VTLANG_JSON_CHK_DUD": "設定檢查 —— Driver Update Disk外掛程å¼", "VTLANG_JSON_CHK_PASSWORD": "設定檢查 —— 密碼外掛程å¼", - + "VTLANG_NORMAL_MODE": "以正常模å¼å•Ÿå‹•", "VTLANG_WIMBOOT_MODE": "以 wimboot 模å¼å•Ÿå‹•", "VTLANG_GRUB2_MODE": "以 grub2 模å¼å•Ÿå‹•", "VTLANG_MEMDISK_MODE": "以 memdisk 模å¼å•Ÿå‹•", - + "VTLANG_RET_TO_LISTVIEW": "返回到清單檢視", "VTLANG_RET_TO_TREEVIEW": "返回到樹狀檢視", - + "VTLANG_NO_AUTOINS_SCRIPT": "ä¸ä½¿ç”¨è‡ªå‹•安è£è…³æœ¬", "VTLANG_AUTOINS_USE": "使用", - + "VTLANG_NO_PERSIST": "ä¸ä½¿ç”¨æ°¸ä¹…性資料檔案", "VTLANG_PERSIST_USE": "使用", - + "VTLANG_BROWER_RETURN": "返回", - + "VTLANG_ENTER_EXIT": "按 Enter éµé€€å‡º", "VTLANG_ENTER_REBOOT": "按 Enter éµé‡æ–°é–‹æ©Ÿ", "VTLANG_ENTER_CONTINUE": "按 Enter éµç¹¼çºŒ", @@ -88,6 +88,6 @@ "VTLANG_WIN11_BYPASS_NRO": "å®‰è£ Windows 11 時繞éŽç™»å…¥å¸³æˆ¶çš„需求", "VTLANG_LINUX_REMOUNT": "啟動 Linux 系統後掛載 Ventoy 分å€", "VTLANG_SECONDARY_BOOT_MENU": "顯示次è¦å•Ÿå‹•é¸å–®", - + "MENU_STR_XXX": "" } diff --git a/INSTALL/grub/power.cfg b/INSTALL/grub/power.cfg index 293151c3932..6d97edef83b 100644 --- a/INSTALL/grub/power.cfg +++ b/INSTALL/grub/power.cfg @@ -10,9 +10,9 @@ submenu "$VTLANG_POWER" --class=debug_power --class=F5tool { sleep 1 halt } - + if [ "$grub_platform" != "pc" ]; then - menuentry "$VTLANG_POWER_BOOT_EFIFW" --class=debug_efisetup --class=debug_power --class=F5tool { + menuentry "$VTLANG_POWER_BOOT_EFIFW" --class=debug_efisetup --class=debug_power --class=F5tool { echo -e '\n\nRebooting to enter UEFI firmware setup ... \n' sleep 1 fwsetup diff --git a/INSTALL/grub/themes/ventoy/theme.txt b/INSTALL/grub/themes/ventoy/theme.txt index 88e8a21f95e..a3b413b6aa5 100644 --- a/INSTALL/grub/themes/ventoy/theme.txt +++ b/INSTALL/grub/themes/ventoy/theme.txt @@ -14,9 +14,9 @@ terminal-box: "terminal_box_*.png" menu_pixmap_style = "menu_*.png" - item_color = "#ffffff" + item_color = "#ffffff" item_height = 30 - + item_spacing = 1 item_padding = 1 @@ -45,53 +45,53 @@ terminal-box: "terminal_box_*.png" highlight_style = "*" } -+ hbox{ ++ hbox{ left = 28% top = 95% width = 10% height = 25 - + label {text = "@VTOY_HOTKEY_TIP@" color = "blue" align = "left"} + + label {text = "@VTOY_HOTKEY_TIP@" color = "blue" align = "left"} } -+ hbox{ ++ hbox{ left = 30% top = 95%-25 width = 10% height = 25 - + label {text = "@VTOY_MEM_DISK@" color = "red" align = "left"} + + label {text = "@VTOY_MEM_DISK@" color = "red" align = "left"} } -+ hbox{ ++ hbox{ left = 30% top = 95%-50 width = 10% height = 25 - + label {text = "@VTOY_ISO_RAW@" color = "red" align = "left"} + + label {text = "@VTOY_ISO_RAW@" color = "red" align = "left"} } -+ hbox{ ++ hbox{ left = 30%+200 top = 95%-50 width = 10% height = 25 - + label {text = "@VTOY_GRUB2_MODE@" color = "red" align = "left"} + + label {text = "@VTOY_GRUB2_MODE@" color = "red" align = "left"} } -+ hbox{ ++ hbox{ left = 30%+200 top = 95%-25 width = 10% height = 25 - + label {text = "@VTOY_WIMBOOT_MODE@" color = "red" align = "left"} + + label {text = "@VTOY_WIMBOOT_MODE@" color = "red" align = "left"} } -+ hbox{ ++ hbox{ left = 90% - top = 55 + top = 55 width = 10% height = 25 - + label {text = "@VTOY_ISO_UEFI_DRV@" color = "red" align = "left"} + + label {text = "@VTOY_ISO_UEFI_DRV@" color = "red" align = "left"} } diff --git a/INSTALL/plugin/ventoy/theme/theme.txt b/INSTALL/plugin/ventoy/theme/theme.txt index f8815065f9d..b00d6675e04 100644 --- a/INSTALL/plugin/ventoy/theme/theme.txt +++ b/INSTALL/plugin/ventoy/theme/theme.txt @@ -14,9 +14,9 @@ terminal-box: "terminal_box_*.png" menu_pixmap_style = "menu_*.png" - item_color = "#ffffff" + item_color = "#ffffff" item_height = 30 - + item_spacing = 1 item_padding = 1 @@ -43,54 +43,54 @@ terminal-box: "terminal_box_*.png" highlight_style = "*" } -+ hbox{ ++ hbox{ left = 30% top = 95% width = 10% height = 25 - + label {text = "@VTOY_HOTKEY_TIP@" color = "blue" align = "left"} + + label {text = "@VTOY_HOTKEY_TIP@" color = "blue" align = "left"} } -+ hbox{ ++ hbox{ left = 30% top = 95%-25 width = 10% height = 25 - + label {text = "@VTOY_MEM_DISK@" color = "red" align = "left"} + + label {text = "@VTOY_MEM_DISK@" color = "red" align = "left"} } -+ hbox{ ++ hbox{ left = 30% top = 95%-50 width = 10% height = 25 - + label {text = "@VTOY_ISO_RAW@" color = "red" align = "left"} + + label {text = "@VTOY_ISO_RAW@" color = "red" align = "left"} } -+ hbox{ ++ hbox{ left = 30%+200 top = 95%-50 width = 10% height = 25 - + label {text = "@VTOY_GRUB2_MODE@" color = "red" align = "left"} + + label {text = "@VTOY_GRUB2_MODE@" color = "red" align = "left"} } -+ hbox{ ++ hbox{ left = 30%+200 top = 95%-25 width = 10% height = 25 - + label {text = "@VTOY_WIMBOOT_MODE@" color = "red" align = "left"} + + label {text = "@VTOY_WIMBOOT_MODE@" color = "red" align = "left"} } -+ hbox{ ++ hbox{ left = 90% - top = 55 + top = 55 width = 10% height = 25 - + label {text = "@VTOY_ISO_UEFI_DRV@" color = "red" align = "left"} + + label {text = "@VTOY_ISO_UEFI_DRV@" color = "red" align = "left"} } diff --git a/INSTALL/plugin/ventoy/ventoy.json b/INSTALL/plugin/ventoy/ventoy.json index 0452aaba695..57ce3c1f824 100644 --- a/INSTALL/plugin/ventoy/ventoy.json +++ b/INSTALL/plugin/ventoy/ventoy.json @@ -1,23 +1,23 @@ { "control": [ { "VTOY_DEFAULT_MENU_MODE": "1" }, - { "VTOY_FILT_DOT_UNDERSCORE_FILE": "1" } + { "VTOY_FILT_DOT_UNDERSCORE_FILE": "1" } ], - + "theme": { - "file": "/ventoy/theme/theme.txt", + "file": "/ventoy/theme/theme.txt", "display_mode": "GUI", "ventoy_left": "5%", "ventoy_top": "95%", "ventoy_color": "#0000ff" }, - - - "menu_class": [ + + + "menu_class": [ { "key": "ubuntu", "class": "ubuntu" - }, + }, { "key": "deepin", "class": "deepin" @@ -27,7 +27,7 @@ "class": "red-hat" } ], - + "menu_alias": [ { "image": "/ISO/MX-19.1_x64.iso", @@ -38,7 +38,7 @@ "alias": "我的 Windows 10 系统" } ], - + "auto_install": [ { "image": "/ISO/cn_windows_10.iso", @@ -56,5 +56,5 @@ ] } ] - + } diff --git a/INSTALL/tool/VentoyGTK.glade b/INSTALL/tool/VentoyGTK.glade index d362a81c242..38b53c6f48b 100644 --- a/INSTALL/tool/VentoyGTK.glade +++ b/INSTALL/tool/VentoyGTK.glade @@ -5,7 +5,7 @@ True False - + False False @@ -36,8 +36,8 @@ True - 10 - 10 + 10 + 10 @@ -48,7 +48,7 @@ 10 - + 220 @@ -85,7 +85,7 @@ 60 - + 220 @@ -121,7 +121,7 @@ 60 - + 440 @@ -141,8 +141,8 @@ True - 10 - 10 + 10 + 10 @@ -153,7 +153,7 @@ 140 - + OK @@ -183,25 +183,25 @@ 210 - + 460 25 True False - 0 + 0 10 250 - + - + False False @@ -235,7 +235,7 @@ Secure Boot Support True False - True + True False @@ -254,7 +254,7 @@ MBR True False - True + True True @@ -263,7 +263,7 @@ GPT True False - True + True False @@ -276,7 +276,7 @@ Partition Configuration True False - True + True @@ -284,7 +284,7 @@ Clear Ventoy True False - True + True @@ -292,7 +292,7 @@ Show All Devices True False - True + True False @@ -300,7 +300,7 @@ - + True @@ -335,8 +335,8 @@ False - 10 - 5 + 10 + 5 @@ -542,7 +542,7 @@ 100 40 True - True + True True @@ -564,21 +564,21 @@ 300 - + 460 25 True False - 0 + 0 10 345 - + diff --git a/INSTALL/tool/VentoyWorker.sh b/INSTALL/tool/VentoyWorker.sh index 7844b922994..68a7187c82d 100644 --- a/INSTALL/tool/VentoyWorker.sh +++ b/INSTALL/tool/VentoyWorker.sh @@ -185,15 +185,15 @@ if [ "$MODE" = "install" -a -z "$NONDESTRUCTIVE" ]; then fi else if parted -v > /dev/null 2>&1; then - PARTTOOL='parted' + PARTTOOL='parted' elif fdisk -v >/dev/null 2>&1; then - PARTTOOL='fdisk' + PARTTOOL='fdisk' else vterr "Both parted and fdisk are not found in the system, Ventoy can't create new partitions." exit 1 fi fi - + if [ "$PARTTOOL" = "parted" ]; then if parted -s $DISK p 2>&1 | grep -i -q 'sector size.*4096.*4096'; then vterr "Currently Ventoy does not support 4K native device." @@ -205,7 +205,7 @@ if [ "$MODE" = "install" -a -z "$NONDESTRUCTIVE" ]; then exit 1 fi fi - + version=$(get_disk_ventoy_version $DISK) if [ $? -eq 0 ]; then @@ -311,7 +311,7 @@ if [ "$MODE" = "install" -a -z "$NONDESTRUCTIVE" ]; then dd status=none conv=fsync if=/dev/zero of=$DISK bs=512 count=32 seek=$part2_start_sector #format part1 - wait_and_create_part ${PART1} ${PART2} + wait_and_create_part ${PART1} ${PART2} if [ -b ${PART1} ]; then vtinfo "Format partition 1 ${PART1} ..." mkexfatfs -n "$VTNEW_LABEL" -s $cluster_sectors ${PART1} @@ -324,7 +324,7 @@ if [ "$MODE" = "install" -a -z "$NONDESTRUCTIVE" ]; then fi else echo "mkexfatfs success" - fi + fi else vterr "${PART1} NOT exist" fi @@ -339,7 +339,7 @@ if [ "$MODE" = "install" -a -z "$NONDESTRUCTIVE" ]; then else xzcat ./boot/core.img.xz | dd status=none conv=fsync of=$DISK bs=512 count=2047 seek=1 fi - + # check and umount check_umount_disk "$DISK" @@ -360,9 +360,9 @@ if [ "$MODE" = "install" -a -z "$NONDESTRUCTIVE" ]; then vtinfo "esp partition processing ..." - if [ "$SECUREBOOT" != "YES" ]; then + if [ "$SECUREBOOT" != "YES" ]; then sleep 2 - check_umount_disk "$DISK" + check_umount_disk "$DISK" vtoycli partresize -s $DISK $part2_start_sector fi @@ -382,7 +382,7 @@ elif [ "$MODE" = "install" -a -n "$NONDESTRUCTIVE" ]; then exit 1 fi fi - + disk_sector_num=$(cat /sys/block/${DISK#/dev/}/size) disk_size_gb=$(expr $disk_sector_num / 2097152) @@ -395,8 +395,8 @@ elif [ "$MODE" = "install" -a -n "$NONDESTRUCTIVE" ]; then #Print disk info echo "Disk : $DISK" parted -s $DISK p 2>&1 | grep Model - echo "Size : $disk_size_gb GB" - echo "Style: $OldStyle" + echo "Size : $disk_size_gb GB" + echo "Style: $OldStyle" echo '' vtwarn "Attention:" @@ -410,13 +410,13 @@ elif [ "$MODE" = "install" -a -n "$NONDESTRUCTIVE" ]; then fi fi - if [ $disk_sector_num -le $VENTOY_SECTOR_NUM ]; then + 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=$(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) @@ -437,57 +437,57 @@ elif [ "$MODE" = "install" -a -n "$NONDESTRUCTIVE" ]; then 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 | grep -E -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." + echo "###[FAIL] ntfsresize failed." exit 1 fi elif echo $PART1_BLKID | grep -E -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." + 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) @@ -495,29 +495,29 @@ elif [ "$MODE" = "install" -a -n "$NONDESTRUCTIVE" ]; then 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 + 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 @@ -535,10 +535,10 @@ elif [ "$MODE" = "install" -a -n "$NONDESTRUCTIVE" ]; then vterr "Ventoy non-destructive installation on $DISK failed." echo "" fi - + else vtdebug "update Ventoy ..." - + oldver=$(get_disk_ventoy_version $DISK) if [ $? -ne 0 ]; then if is_disk_contains_ventoy $DISK; then @@ -615,7 +615,7 @@ else rm -f ./rsvdata.bin 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 sync @@ -626,8 +626,8 @@ else vtoycli partresize -s $DISK $part2_start fi - - if [ "$PART1_TYPE" = "EE" ]; then + + if [ "$PART1_TYPE" = "EE" ]; then vtinfo "update esp partition attribute" vtoycli gpt -f $DISK sync diff --git a/INSTALL/tool/distro_gui_type.json b/INSTALL/tool/distro_gui_type.json index f400fa954f6..fbaf0b4b8fa 100644 --- a/INSTALL/tool/distro_gui_type.json +++ b/INSTALL/tool/distro_gui_type.json @@ -48,5 +48,5 @@ "expression": "xfce", "gui": "gtk3" } - + ] diff --git a/INSTALL/tool/ventoy_lib.sh b/INSTALL/tool/ventoy_lib.sh index 854881d7a84..10f8d242c4b 100644 --- a/INSTALL/tool/ventoy_lib.sh +++ b/INSTALL/tool/ventoy_lib.sh @@ -37,7 +37,7 @@ vtoy_gen_uuid() { uuid -F BIN elif uuidgen -V > /dev/null 2>&1; then a=$(uuidgen | sed 's/-//g') - echo -en "\x${a:0:2}\x${a:2:2}\x${a:4:2}\x${a:6:2}\x${a:8:2}\x${a:10:2}\x${a:12:2}\x${a:14:2}\x${a:16:2}\x${a:18:2}\x${a:20:2}\x${a:22:2}\x${a:24:2}\x${a:26:2}\x${a:28:2}\x${a:30:2}" + echo -en "\x${a:0:2}\x${a:2:2}\x${a:4:2}\x${a:6:2}\x${a:8:2}\x${a:10:2}\x${a:12:2}\x${a:14:2}\x${a:16:2}\x${a:18:2}\x${a:20:2}\x${a:22:2}\x${a:24:2}\x${a:26:2}\x${a:28:2}\x${a:30:2}" elif python -V > /dev/null 2>&1; then a=$(python -c 'import sys,uuid; sys.stdout.write(uuid.uuid4().hex)') echo -en "\x${a:0:2}\x${a:2:2}\x${a:4:2}\x${a:6:2}\x${a:8:2}\x${a:10:2}\x${a:12:2}\x${a:14:2}\x${a:16:2}\x${a:18:2}\x${a:20:2}\x${a:22:2}\x${a:24:2}\x${a:26:2}\x${a:28:2}\x${a:30:2}" @@ -51,7 +51,7 @@ vtoy_gen_uuid() { } check_tool_work_ok() { - + if echo 1 | hexdump > /dev/null; then vtdebug "hexdump test ok ..." else @@ -59,7 +59,7 @@ check_tool_work_ok() { ventoy_false return fi - + if mkexfatfs -V > /dev/null; then vtdebug "mkexfatfs test ok ..." else @@ -67,7 +67,7 @@ check_tool_work_ok() { ventoy_false return fi - + if vtoycli fat -T; then vtdebug "vtoycli fat test ok ..." else @@ -75,7 +75,7 @@ check_tool_work_ok() { ventoy_false return fi - + vtdebug "tool check success ..." ventoy_true } @@ -83,7 +83,7 @@ check_tool_work_ok() { get_disk_part_name() { DISK=$1 - + if echo $DISK | grep -q "/dev/loop"; then echo ${DISK}p${2} elif echo $DISK | grep -q "/dev/nvme[0-9][0-9]*n[0-9]"; then @@ -119,12 +119,12 @@ get_ventoy_version_from_cfg() { } is_disk_contains_ventoy() { - DISK=$1 - - PART1=$(get_disk_part_name $1 1) - PART2=$(get_disk_part_name $1 2) - - if [ -e /sys/class/block/${PART2#/dev/}/size ]; then + DISK=$1 + + PART1=$(get_disk_part_name $1 1) + PART2=$(get_disk_part_name $1 2) + + if [ -e /sys/class/block/${PART2#/dev/}/size ]; then SIZE=$(cat /sys/class/block/${PART2#/dev/}/size) else SIZE=0 @@ -135,16 +135,16 @@ is_disk_contains_ventoy() { ventoy_false return fi - + if ! [ -b $PART2 ]; then vtdebug "$PART2 not exist" ventoy_false return fi - + PART1_TYPE=$(dd if=$DISK bs=1 count=1 skip=450 status=none | hexdump -n1 -e '1/1 "%02X"') PART2_TYPE=$(dd if=$DISK bs=1 count=1 skip=466 status=none | hexdump -n1 -e '1/1 "%02X"') - + # if [ "$PART1_TYPE" != "EE" ]; then # if [ "$PART2_TYPE" != "EF" ]; then # vtdebug "part2 type is $PART2_TYPE not EF" @@ -152,30 +152,30 @@ is_disk_contains_ventoy() { # return # fi # fi - + # PART1_TYPE=$(dd if=$DISK bs=1 count=1 skip=450 status=none | hexdump -n1 -e '1/1 "%02X"') # if [ "$PART1_TYPE" != "07" ]; then # vtdebug "part1 type is $PART2_TYPE not 07" # ventoy_false # return # fi - + if [ -e /sys/class/block/${PART1#/dev/}/start ]; then PART1_START=$(cat /sys/class/block/${PART1#/dev/}/start) fi - + if [ "$PART1_START" != "2048" ]; then vtdebug "part1 start is $PART1_START not 2048" ventoy_false return - fi - + fi + if [ "$VENTOY_SECTOR_NUM" != "$SIZE" ]; then vtdebug "part2 size is $SIZE not $VENTOY_SECTOR_NUM" ventoy_false return fi - + ventoy_true } @@ -184,9 +184,9 @@ check_disk_secure_boot() { ventoy_false return fi - - PART2=$(get_disk_part_name $1 2) - + + PART2=$(get_disk_part_name $1 2) + vtoycli fat -s $PART2 } @@ -196,9 +196,9 @@ get_disk_ventoy_version() { ventoy_false return fi - - PART2=$(get_disk_part_name $1 2) - + + PART2=$(get_disk_part_name $1 2) + ParseVer=$(vtoycli fat $PART2) if [ $? -eq 0 ]; then vtdebug "Ventoy version in $PART2 is $ParseVer" @@ -206,7 +206,7 @@ get_disk_ventoy_version() { ventoy_true return fi - + ventoy_false } @@ -228,17 +228,17 @@ wait_and_create_part() { if ls -l $vPART1 2>/dev/null | grep -q '^b'; then echo "$vPART1 exist OK" else - MajorMinor=$(sed "s/:/ /" /sys/class/block/${vPART1#/dev/}/dev) + MajorMinor=$(sed "s/:/ /" /sys/class/block/${vPART1#/dev/}/dev) echo "mknod -m 0660 $vPART1 b $MajorMinor ..." mknod -m 0660 $vPART1 b $MajorMinor fi - + if ls -l $vPART2 2>/dev/null | grep -q '^b'; then echo "$vPART2 exist OK" else - MajorMinor=$(sed "s/:/ /" /sys/class/block/${vPART2#/dev/}/dev) + MajorMinor=$(sed "s/:/ /" /sys/class/block/${vPART2#/dev/}/dev) echo "mknod -m 0660 $vPART2 b $MajorMinor ..." - mknod -m 0660 $vPART2 b $MajorMinor + mknod -m 0660 $vPART2 b $MajorMinor fi if ls -l $vPART1 2>/dev/null | grep -q '^b'; then @@ -256,30 +256,30 @@ format_ventoy_disk_mbr() { reserve_mb=$1 DISK=$2 PARTTOOL=$3 - + PART1=$(get_disk_part_name $DISK 1) PART2=$(get_disk_part_name $DISK 2) - + sector_num=$(cat /sys/block/${DISK#/dev/}/size) - - part1_start_sector=2048 - + + part1_start_sector=2048 + if [ $reserve_mb -gt 0 ]; then reserve_sector_num=$(expr $reserve_mb \* 2048) part1_end_sector=$(expr $sector_num - $reserve_sector_num - $VENTOY_SECTOR_NUM - 1) else part1_end_sector=$(expr $sector_num - $VENTOY_SECTOR_NUM - 1) fi - + part2_start_sector=$(expr $part1_end_sector + 1) - + modsector=$(expr $part2_start_sector % 8) if [ $modsector -gt 0 ]; then vtdebug "modsector:$modsector need to be aligned with 4KB" part1_end_sector=$(expr $part1_end_sector - $modsector) part2_start_sector=$(expr $part1_end_sector + 1) fi - + part2_end_sector=$(expr $part2_start_sector + $VENTOY_SECTOR_NUM - 1) export part2_start_sector @@ -299,7 +299,7 @@ format_ventoy_disk_mbr() { echo "" echo "Create partitions on $DISK by $PARTTOOL in MBR style ..." - + if [ "$PARTTOOL" = "parted" ]; then vtdebug "format disk by parted ..." parted -a none --script $DISK \ @@ -314,7 +314,7 @@ format_ventoy_disk_mbr() { echo -en '\xEF' | dd of=$DISK conv=fsync bs=1 count=1 seek=466 > /dev/null 2>&1 else vtdebug "format disk by fdisk ..." - + fdisk $DISK >>./log.txt 2>&1 </dev/null 2>&1 partprobe >/dev/null 2>&1 sleep 3 @@ -356,15 +356,15 @@ EOF done if ! [ -b $PART1 ]; then - MajorMinor=$(sed "s/:/ /" /sys/class/block/${PART1#/dev/}/dev) + MajorMinor=$(sed "s/:/ /" /sys/class/block/${PART1#/dev/}/dev) echo "mknod -m 0660 $PART1 b $MajorMinor ..." mknod -m 0660 $PART1 b $MajorMinor fi - + if ! [ -b $PART2 ]; then - MajorMinor=$(sed "s/:/ /" /sys/class/block/${PART2#/dev/}/dev) + MajorMinor=$(sed "s/:/ /" /sys/class/block/${PART2#/dev/}/dev) echo "mknod -m 0660 $PART2 b $MajorMinor ..." - mknod -m 0660 $PART2 b $MajorMinor + mknod -m 0660 $PART2 b $MajorMinor fi if [ -b $PART1 -a -b $PART2 ]; then @@ -393,30 +393,30 @@ format_ventoy_disk_gpt() { reserve_mb=$1 DISK=$2 PARTTOOL=$3 - + PART1=$(get_disk_part_name $DISK 1) PART2=$(get_disk_part_name $DISK 2) - + sector_num=$(cat /sys/block/${DISK#/dev/}/size) - - part1_start_sector=2048 - + + part1_start_sector=2048 + if [ $reserve_mb -gt 0 ]; then reserve_sector_num=$(expr $reserve_mb \* 2048 + 33) part1_end_sector=$(expr $sector_num - $reserve_sector_num - $VENTOY_SECTOR_NUM - 1) else part1_end_sector=$(expr $sector_num - $VENTOY_SECTOR_NUM - 34) fi - + part2_start_sector=$(expr $part1_end_sector + 1) - + modsector=$(expr $part2_start_sector % 8) if [ $modsector -gt 0 ]; then vtdebug "modsector:$modsector need to be aligned with 4KB" part1_end_sector=$(expr $part1_end_sector - $modsector) part2_start_sector=$(expr $part1_end_sector + 1) fi - + part2_end_sector=$(expr $part2_start_sector + $VENTOY_SECTOR_NUM - 1) export part2_start_sector @@ -436,13 +436,13 @@ format_ventoy_disk_gpt() { echo "" echo "Create partitions on $DISK by $PARTTOOL in GPT style ..." - + vtdebug "format disk by parted ..." - + if [ "$TOOLDIR" != "aarch64" ]; then vt_set_efi_type="set 2 msftdata on" - fi - + fi + parted -a none --script $DISK \ mklabel gpt \ unit s \ @@ -452,7 +452,7 @@ format_ventoy_disk_gpt() { quit sync - + vtoycli gpt -f $DISK sync @@ -472,15 +472,15 @@ format_ventoy_disk_gpt() { done if ! [ -b $PART1 ]; then - MajorMinor=$(sed "s/:/ /" /sys/class/block/${PART1#/dev/}/dev) + MajorMinor=$(sed "s/:/ /" /sys/class/block/${PART1#/dev/}/dev) echo "mknod -m 0660 $PART1 b $MajorMinor ..." mknod -m 0660 $PART1 b $MajorMinor fi - + if ! [ -b $PART2 ]; then - MajorMinor=$(sed "s/:/ /" /sys/class/block/${PART2#/dev/}/dev) + MajorMinor=$(sed "s/:/ /" /sys/class/block/${PART2#/dev/}/dev) echo "mknod -m 0660 $PART2 b $MajorMinor ..." - mknod -m 0660 $PART2 b $MajorMinor + mknod -m 0660 $PART2 b $MajorMinor fi if [ -b $PART1 -a -b $PART2 ]; then @@ -491,10 +491,10 @@ format_ventoy_disk_gpt() { fi echo "create efi fat fs $PART2 ..." - + for i in 0 1 2 3 4 5 6 7 8 9; do check_umount_disk "$PART2" - + if mkfs.vfat -F 16 -n VTOYEFI -s 1 $PART2; then echo 'success' break diff --git a/INSTALL/ventoy_pack.sh b/INSTALL/ventoy_pack.sh index e03e8b02eb2..075f38cbdfd 100644 --- a/INSTALL/ventoy_pack.sh +++ b/INSTALL/ventoy_pack.sh @@ -52,7 +52,7 @@ LOOP=$(losetup -f) rm -f img.bin dd if=/dev/zero of=img.bin bs=1M count=256 status=none -losetup -P $LOOP img.bin +losetup -P $LOOP img.bin while ! grep -q 524288 /sys/block/${LOOP#/dev/}/size 2>/dev/null; do echo "wait $LOOP ..." @@ -71,7 +71,7 @@ tmpdir=./ventoy-${curver} rm -rf $tmpmnt mkdir -p $tmpmnt -mount ${LOOP}p2 $tmpmnt +mount ${LOOP}p2 $tmpmnt mkdir -p $tmpmnt/grub @@ -211,7 +211,7 @@ for d in i386 x86_64 aarch64 mips64el; do cd $CurDir done -#chmod +#chmod find $tmpdir/ -type d -exec chmod 755 "{}" + find $tmpdir/ -type f -exec chmod 644 "{}" + chmod +x $tmpdir/Ventoy2Disk.sh diff --git a/IPXE/ipxe_mod_code/ipxe-3fe683e/src/arch/x86/core/runtime.c b/IPXE/ipxe_mod_code/ipxe-3fe683e/src/arch/x86/core/runtime.c index 049f14beab1..bc6756a8943 100644 --- a/IPXE/ipxe_mod_code/ipxe-3fe683e/src/arch/x86/core/runtime.c +++ b/IPXE/ipxe_mod_code/ipxe-3fe683e/src/arch/x86/core/runtime.c @@ -144,7 +144,7 @@ static int cmdline_init ( void ) { chainlen = (int)strtoul(pos2 + 6, NULL, 10); *pos2 = ':'; - g_initrd_addr = (void *)umalloc(chainlen); + g_initrd_addr = (void *)umalloc(chainlen); g_initrd_len = chainlen; memcpy_user((userptr_t)g_initrd_addr, 0, chainaddr, 0, chainlen); } @@ -160,7 +160,7 @@ static int cmdline_init ( void ) { } g_cmdline_copy = cmdline_copy; - + cmdline = cmdline_copy; copy_from_user ( cmdline, cmdline_user, 0, len ); DBGC ( colour, "RUNTIME found command line \"%s\" at %08x\n", diff --git a/IPXE/ipxe_mod_code/ipxe-3fe683e/src/arch/x86/core/ventoy_vdisk.c b/IPXE/ipxe_mod_code/ipxe-3fe683e/src/arch/x86/core/ventoy_vdisk.c index 0150ad78258..6aed94d4308 100644 --- a/IPXE/ipxe_mod_code/ipxe-3fe683e/src/arch/x86/core/ventoy_vdisk.c +++ b/IPXE/ipxe_mod_code/ipxe-3fe683e/src/arch/x86/core/ventoy_vdisk.c @@ -63,7 +63,7 @@ static uint64_t ventoy_remap_lba_hdd(uint64_t lba, uint32_t *count) uint32_t max_sectors; ventoy_img_chunk *cur; - if ((NULL == g_cur_chunk) || (lba < g_cur_chunk->img_start_sector) || + if ((NULL == g_cur_chunk) || (lba < g_cur_chunk->img_start_sector) || (lba > g_cur_chunk->img_end_sector)) { g_cur_chunk = NULL; @@ -86,7 +86,7 @@ static uint64_t ventoy_remap_lba_hdd(uint64_t lba, uint32_t *count) *count = max_sectors; } - return g_cur_chunk->disk_start_sector + (lba - g_cur_chunk->img_start_sector); + return g_cur_chunk->disk_start_sector + (lba - g_cur_chunk->img_start_sector); } return lba; } @@ -121,7 +121,7 @@ static uint64_t ventoy_remap_lba(uint64_t lba, uint32_t *count) if (512 == g_disk_sector_size) { - return g_cur_chunk->disk_start_sector + ((lba - g_cur_chunk->img_start_sector) << 2); + return g_cur_chunk->disk_start_sector + ((lba - g_cur_chunk->img_start_sector) << 2); } return g_cur_chunk->disk_start_sector + (lba - g_cur_chunk->img_start_sector) * 2048 / g_disk_sector_size; } @@ -151,7 +151,7 @@ static int ventoy_vdisk_read_real_hdd(uint64_t lba, unsigned int count, unsigned maplba = ventoy_remap_lba_hdd(curlba, &readcount); tmpcount = readcount; - + phyaddr = user_to_phys(buffer, 0); while (tmpcount > 0) @@ -218,7 +218,7 @@ static int ventoy_vdisk_read_real(uint64_t lba, unsigned int count, unsigned lon { readcount = left; maplba = ventoy_remap_lba(curlba, &readcount); - + if (g_disk_sector_size == 512) { tmpcount = (readcount << 2); @@ -289,7 +289,7 @@ static int ventoy_vdisk_read_real(uint64_t lba, unsigned int count, unsigned lon { if (end <= override_end) { - memcpy((char *)databuffer + override_start - start, override_data, end - override_start); + memcpy((char *)databuffer + override_start - start, override_data, end - override_start); } else { @@ -300,7 +300,7 @@ static int ventoy_vdisk_read_real(uint64_t lba, unsigned int count, unsigned lon { if (end <= override_end) { - memcpy((char *)databuffer, override_data + start - override_start, end - start); + memcpy((char *)databuffer, override_data + start - override_start, end - start); } else { @@ -308,7 +308,7 @@ static int ventoy_vdisk_read_real(uint64_t lba, unsigned int count, unsigned lon } } - if (g_fixup_iso9660_secover_enable && (!g_fixup_iso9660_secover_start) && + if (g_fixup_iso9660_secover_enable && (!g_fixup_iso9660_secover_start) && g_override_chunk[i].override_size == sizeof(ventoy_iso9660_override)) { ventoy_iso9660_override *dirent = (ventoy_iso9660_override *)override_data; @@ -414,7 +414,7 @@ int ventoy_vdisk_read(struct san_device *sandev, uint64_t lba, unsigned int coun ventoy_vdisk_read_real_hdd(lba, count, buffer); } #endif - + ventoy_vdisk_read_real_hdd(lba, count, buffer); ix86->regs.dl = sandev->drive; return 0; @@ -437,7 +437,7 @@ int ventoy_vdisk_read(struct san_device *sandev, uint64_t lba, unsigned int coun { /* fix for grub4dos Inconsistent data read from error */ memset((void *)(buffer + (count - 1) * 2048), 0, 2048); - + count = (g_chain->real_img_size_in_bytes / 2048) - lba; ventoy_vdisk_read_real(lba, count, buffer); ix86->regs.dl = sandev->drive; @@ -447,12 +447,12 @@ int ventoy_vdisk_read(struct san_device *sandev, uint64_t lba, unsigned int coun count = (readend - g_chain->real_img_size_in_bytes) / 2048; } - VirtSec = g_chain->virt_img_size_in_bytes / 2048; + VirtSec = g_chain->virt_img_size_in_bytes / 2048; if (lba >= VirtSec) { /* fix for grub4dos Inconsistent data read from error */ memset((void *)(buffer + (count - 1) * 2048), 0, 2048); - + ix86->regs.dl = sandev->drive; return 0; } @@ -473,7 +473,7 @@ int ventoy_vdisk_read(struct san_device *sandev, uint64_t lba, unsigned int coun { if (curlba >= node->mem_sector_start && curlba < node->mem_sector_end) { - memcpy((void *)(buffer + j * 2048), + memcpy((void *)(buffer + j * 2048), (char *)g_virt_chunk + node->mem_sector_offset + (curlba - node->mem_sector_start) * 2048, 2048); cur_flag->flag = 1; @@ -538,10 +538,10 @@ static void ventoy_dump_img_chunk(ventoy_chain_head *chain) for (i = 0; i < chain->img_chunk_num; i++) { printf("%2u: [ %u - %u ] <==> [ %llu - %llu ]\n", - i, chunk[i].img_start_sector, chunk[i].img_end_sector, + i, chunk[i].img_start_sector, chunk[i].img_end_sector, chunk[i].disk_start_sector, chunk[i].disk_end_sector); } - + ventoy_debug_pause(); } @@ -549,7 +549,7 @@ static void ventoy_dump_override_chunk(ventoy_chain_head *chain) { uint32_t i; ventoy_override_chunk *chunk; - + chunk = (ventoy_override_chunk *)((char *)chain + chain->override_chunk_offset); printf("##################### ventoy_dump_override_chunk #######################\n"); @@ -558,7 +558,7 @@ static void ventoy_dump_override_chunk(ventoy_chain_head *chain) { printf("%2u: [ %llu, %u ]\n", i, chunk[i].img_offset, chunk[i].override_size); } - + ventoy_debug_pause(); } @@ -566,7 +566,7 @@ static void ventoy_dump_virt_chunk(ventoy_chain_head *chain) { uint32_t i; ventoy_virt_chunk *node; - + printf("##################### ventoy_dump_virt_chunk #######################\n"); printf("virt_chunk_offset=%u\n", chain->virt_chunk_offset); printf("virt_chunk_num=%u\n", chain->virt_chunk_num); @@ -574,7 +574,7 @@ static void ventoy_dump_virt_chunk(ventoy_chain_head *chain) node = (ventoy_virt_chunk *)((char *)chain + chain->virt_chunk_offset); for (i = 0; i < chain->virt_chunk_num; i++, node++) { - printf("%2u: mem:[ %u, %u, %u ] remap:[ %u, %u, %u ]\n", i, + printf("%2u: mem:[ %u, %u, %u ] remap:[ %u, %u, %u ]\n", i, node->mem_sector_start, node->mem_sector_end, node->mem_sector_offset, @@ -582,7 +582,7 @@ static void ventoy_dump_virt_chunk(ventoy_chain_head *chain) node->remap_sector_end, node->org_sector_start); } - + ventoy_debug_pause(); } @@ -593,10 +593,10 @@ static void ventoy_dump_chain(ventoy_chain_head *chain) uint8_t *guid; uint8_t *sig; uint8_t *vtoy_reserve; - + guid = chain->os_param.vtoy_disk_guid; sig = chain->os_param.vtoy_disk_signature; - + for (i = 0; i < sizeof(ventoy_os_param); i++) { chksum += *((uint8_t *)(&(chain->os_param)) + i); @@ -616,8 +616,8 @@ static void ventoy_dump_chain(ventoy_chain_head *chain) printf("os_param->vtoy_disk_part_type=%u\n", chain->os_param.vtoy_disk_part_type); printf("os_param->vtoy_img_path=<%s>\n", chain->os_param.vtoy_img_path); printf("os_param->vtoy_img_size=<%llu>\n", chain->os_param.vtoy_img_size); - printf("os_param->vtoy_reserve[ ]=<%u %u %u %u %u %u %u>\n", - vtoy_reserve[0], vtoy_reserve[1], vtoy_reserve[2], vtoy_reserve[3], + printf("os_param->vtoy_reserve[ ]=<%u %u %u %u %u %u %u>\n", + vtoy_reserve[0], vtoy_reserve[1], vtoy_reserve[2], vtoy_reserve[3], vtoy_reserve[4], vtoy_reserve[5], vtoy_reserve[6]); printf("os_param->vtoy_img_location_addr=<0x%llx>\n", chain->os_param.vtoy_img_location_addr); printf("os_param->vtoy_img_location_len=<%u>\n", chain->os_param.vtoy_img_location_len); @@ -681,7 +681,7 @@ static int ventoy_update_image_location(ventoy_os_param *param) { return 0; } - + memcpy(&location->guid, ¶m->guid, sizeof(ventoy_guid)); location->image_sector_size = g_hddmode ? 512 : 2048; location->disk_sector_size = g_chain->disk_sector_size; @@ -706,7 +706,7 @@ static int ventoy_update_image_location(ventoy_os_param *param) { region->image_sector_count = chunk->img_end_sector - chunk->img_start_sector + 1; region->image_start_sector = chunk->img_start_sector; - region->disk_start_sector = chunk->disk_start_sector; + region->disk_start_sector = chunk->disk_start_sector; region++; chunk++; } @@ -721,7 +721,7 @@ int ventoy_boot_vdisk(void *data) unsigned int i; unsigned int drive; ventoy_img_chunk *cur; - + (void)data; ventoy_address.bufsize = offsetof ( typeof ( ventoy_address ), buffer_phys ); @@ -733,12 +733,12 @@ int ventoy_boot_vdisk(void *data) printf("cmdline: <%s>\n", g_cmdline_copy); ventoy_debug_pause(); } - + if (strstr(g_cmdline_copy, "sector512")) { g_hddmode = 1; } - + if (strstr(g_cmdline_copy, "bios80")) { g_bios_disk80 = 1; @@ -795,9 +795,9 @@ int ventoy_boot_vdisk(void *data) if (g_debug) { printf("### ventoy chain boot before boot image ... ###\n"); - ventoy_debug_pause(); + ventoy_debug_pause(); } - + ventoy_int13_boot(drive, &(g_chain->os_param), g_cmdline_copy); if (g_debug) diff --git a/IPXE/ipxe_mod_code/ipxe-3fe683e/src/arch/x86/interface/pcbios/ventoy_int13.c b/IPXE/ipxe_mod_code/ipxe-3fe683e/src/arch/x86/interface/pcbios/ventoy_int13.c index d343b0318d6..02c1c7d573f 100644 --- a/IPXE/ipxe_mod_code/ipxe-3fe683e/src/arch/x86/interface/pcbios/ventoy_int13.c +++ b/IPXE/ipxe_mod_code/ipxe-3fe683e/src/arch/x86/interface/pcbios/ventoy_int13.c @@ -58,7 +58,7 @@ static unsigned int g_drive_map2 = 0; * INT 13 emulation * * This module provides a mechanism for exporting block devices via - * the BIOS INT 13 disk interrupt interface. + * the BIOS INT 13 disk interrupt interface. * */ @@ -1067,7 +1067,7 @@ static __asmcall void int13 ( struct i386_all_regs *ix86 ) { if (ix86->regs.dh == 0 && (ix86->regs.cl & 0x3f) == 1 && ix86->regs.al == 1) { userptr_t buffer; - + buffer = real_to_user(ix86->segs.es, ix86->regs.bx); if (buffer) { @@ -1112,7 +1112,7 @@ static __asmcall void int13 ( struct i386_all_regs *ix86 ) { } else if ( ( ( bios_drive & 0x7f ) == 0x7f ) && ( command == INT13_CDROM_STATUS_TERMINATE ) && sandev->is_cdrom ) { - + /* Catch non-drive-specific CD-ROM calls */ } else { return; @@ -1120,7 +1120,7 @@ static __asmcall void int13 ( struct i386_all_regs *ix86 ) { } sandev->int13_command = command; - sandev->x86_regptr = ix86; + sandev->x86_regptr = ix86; DBGC2 ( sandev, "INT13,%02x (%02x): ", ix86->regs.ah, bios_drive ); @@ -1207,11 +1207,11 @@ static void int13_hook_vector ( void ) { TEXT16_CODE ( "\nint13_wrapper:\n\t" /* Preserve %ax and %dx for future reference */ "pushw %%bp\n\t" - "movw %%sp, %%bp\n\t" + "movw %%sp, %%bp\n\t" "pushw %%ax\n\t" "pushw %%dx\n\t" /* Clear OF, set CF, call int13() */ - "orb $0, %%al\n\t" + "orb $0, %%al\n\t" "stc\n\t" VIRT_CALL ( int13 ) /* Chain if OF not set */ @@ -1267,7 +1267,7 @@ static int int13_load_mbr ( unsigned int drive, struct segoff *address ) { /* Check magic signature */ get_real ( magic, address->segment, (address->offset + offsetof ( struct master_boot_record, magic ) ) ); - + if ( magic != INT13_MBR_MAGIC ) { DBG ( "INT13 drive %02x does not contain a valid MBR\n", drive ); @@ -1303,7 +1303,7 @@ static int int13_load_eltorito ( unsigned int drive, struct segoff *address ) { struct eltorito_boot_entry boot; } __attribute__ (( packed )) catalog; uint16_t status; - + if (g_sandev && g_sandev->drive == drive) { copy_to_user(phys_to_user ( eltorito_cmd.buffer ), 0, g_sandev->boot_catalog_sector, sizeof(g_sandev->boot_catalog_sector)); @@ -1327,7 +1327,7 @@ static int int13_load_eltorito ( unsigned int drive, struct segoff *address ) { return -EIO; } } - + copy_from_user ( &catalog, phys_to_user ( eltorito_cmd.buffer ), 0, sizeof ( catalog ) ); @@ -1391,7 +1391,7 @@ static int int13_load_eltorito ( unsigned int drive, struct segoff *address ) { bootinfo = (isolinux_boot_info *)(real_to_user(address->segment, address->offset)); if (0x7C6CEAFA == bootinfo->isolinux0 && 0x90900000 == bootinfo->isolinux1) { - if (bootinfo->BootFileLocation == 0 && bootinfo->PvdLocation == 16 && + if (bootinfo->BootFileLocation == 0 && bootinfo->PvdLocation == 16 && (bootinfo->BootFileLen / 2048) < catalog.boot.length && bootinfo->BootFileChecksum > 0) { if (g_debug) @@ -1419,7 +1419,7 @@ static int int13_load_eltorito ( unsigned int drive, struct segoff *address ) { * Registers the drive with the INT 13 emulation subsystem, and hooks * the INT 13 interrupt vector (if not already hooked). */ -unsigned int ventoy_int13_hook (ventoy_chain_head *chain) +unsigned int ventoy_int13_hook (ventoy_chain_head *chain) { unsigned int blocks; unsigned int blocks_per_cyl; @@ -1431,7 +1431,7 @@ unsigned int ventoy_int13_hook (ventoy_chain_head *chain) /* hook will copy num_drives to dl when int13 08 was called, so must initialize it's value */ get_real(num_drives, BDA_SEG, BDA_NUM_DRIVES); - + if (g_hddmode) { natural_drive = g_bios_disk80 ? 0x80 : (num_drives | 0x80); @@ -1449,7 +1449,7 @@ unsigned int ventoy_int13_hook (ventoy_chain_head *chain) } else { - g_drive_map1 = 0x80; + g_drive_map1 = 0x80; g_drive_map2 = 0x81; } } @@ -1524,9 +1524,9 @@ int ventoy_int13_boot ( unsigned int drive, void *imginfo, const char *cmdline) int rc; int headlen; struct segoff address; - struct acpi_header *acpi = NULL; + struct acpi_header *acpi = NULL; struct ibft_table *ibft = NULL; - + /* Look for a usable boot sector */ if (g_hddmode) { diff --git a/IPXE/ipxe_mod_code/ipxe-3fe683e/src/build.sh b/IPXE/ipxe_mod_code/ipxe-3fe683e/src/build.sh index e8417a2a4a9..decb7a142e6 100644 --- a/IPXE/ipxe_mod_code/ipxe-3fe683e/src/build.sh +++ b/IPXE/ipxe_mod_code/ipxe-3fe683e/src/build.sh @@ -14,12 +14,12 @@ build_bios() { mount bin/ipxe.iso ./mnt rm -f ../../../INSTALL/ventoy/ipxe.krn - cp -a ./mnt/ipxe.krn ../../../INSTALL/ventoy/ipxe.krn - + cp -a ./mnt/ipxe.krn ../../../INSTALL/ventoy/ipxe.krn + umount ./mnt > /dev/null 2>&1 umount ./mnt > /dev/null 2>&1 umount ./mnt > /dev/null 2>&1 - + rm -rf ./mnt echo -e "\n===============SUCCESS===============\n" diff --git a/IPXE/ipxe_mod_code/ipxe-3fe683e/src/core/ventoy_dummy.c b/IPXE/ipxe_mod_code/ipxe-3fe683e/src/core/ventoy_dummy.c index ee7d114ef0e..9997d3ff842 100644 --- a/IPXE/ipxe_mod_code/ipxe-3fe683e/src/core/ventoy_dummy.c +++ b/IPXE/ipxe_mod_code/ipxe-3fe683e/src/core/ventoy_dummy.c @@ -53,7 +53,7 @@ unsigned long pci_bar_size ( struct pci_device *pci, unsigned int reg ) { (void)pci; (void)reg; - + return 0; } @@ -72,7 +72,7 @@ void adjust_pci_device ( struct pci_device *pci ) /* * obj_netfront * obj_netvsc - * + * * ibft_model */ @@ -89,7 +89,7 @@ void scsi_parse_sense ( const void *data, size_t len, (void)data; (void)len; (void)sense; - + return; } @@ -114,10 +114,10 @@ int scsi_command ( struct interface *control, struct interface *data, (void)control; (void)data; (void)command; - + return 0; } - + int ata_open ( struct interface *block, struct interface *ata, unsigned int device, unsigned int max_count ) @@ -126,7 +126,7 @@ int ata_open ( struct interface *block, struct interface *ata, (void)ata; (void)device; (void)max_count; - + return 0; } @@ -141,39 +141,39 @@ int ata_command ( struct interface *control, struct interface *data, } #if 0 -static uint32_t mCrcTable[256] = +static uint32_t mCrcTable[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, + 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 }; diff --git a/IPXE/ipxe_mod_code/ipxe-3fe683e/src/core/vsprintf.c b/IPXE/ipxe_mod_code/ipxe-3fe683e/src/core/vsprintf.c index 4a231b46d01..43d5d8bc8f8 100644 --- a/IPXE/ipxe_mod_code/ipxe-3fe683e/src/core/vsprintf.c +++ b/IPXE/ipxe_mod_code/ipxe-3fe683e/src/core/vsprintf.c @@ -163,7 +163,7 @@ static char * format_decimal ( char *end, signed long num, int width, } #define ZPAD 0x10 -char *format_unsigned_decimal(char *end, unsigned long long num, int width, int flags) +char *format_unsigned_decimal(char *end, unsigned long long num, int width, int flags) { char *ptr = end; int zpad = ( flags & ZPAD ); @@ -287,7 +287,7 @@ size_t vcprintf ( struct printf_context *ctx, const char *fmt, va_list args ) { intptr_t ptrval; ptrval = ( intptr_t ) va_arg ( args, void * ); - ptr = format_hex ( ptr, ptrval, width, + ptr = format_hex ( ptr, ptrval, width, ( ALT_FORM | LCASE ) ); } else if ( ( *fmt & ~0x20 ) == 'X' ) { unsigned long long hex; @@ -347,7 +347,7 @@ struct sputc_context { /** Buffer for formatted string (used by printf_sputc()) */ char *buf; /** Buffer length (used by printf_sputc()) */ - size_t max_len; + size_t max_len; }; /** @@ -479,8 +479,8 @@ int vprintf ( const char *fmt, va_list args ) { struct printf_context ctx; /* Hand off to vcprintf */ - ctx.handler = printf_putchar; - return vcprintf ( &ctx, fmt, args ); + ctx.handler = printf_putchar; + return vcprintf ( &ctx, fmt, args ); } /** diff --git a/IPXE/ipxe_mod_code/ipxe-3fe683e/src/include/ipxe/sanboot.h b/IPXE/ipxe_mod_code/ipxe-3fe683e/src/include/ipxe/sanboot.h index 2c2639a3cc0..e61d8394bd5 100644 --- a/IPXE/ipxe_mod_code/ipxe-3fe683e/src/include/ipxe/sanboot.h +++ b/IPXE/ipxe_mod_code/ipxe-3fe683e/src/include/ipxe/sanboot.h @@ -92,7 +92,7 @@ struct san_device { uint8_t boot_catalog_sector[2048]; /** SAN paths */ - struct san_path path[0]; + struct san_path path[0]; }; /** SAN device flags */ diff --git a/IPXE/ipxe_mod_code/ipxe-3fe683e/src/include/ventoy.h b/IPXE/ipxe_mod_code/ipxe-3fe683e/src/include/ventoy.h index b759e9f54e6..582eb50b331 100644 --- a/IPXE/ipxe_mod_code/ipxe-3fe683e/src/include/ventoy.h +++ b/IPXE/ipxe_mod_code/ipxe-3fe683e/src/include/ventoy.h @@ -44,7 +44,7 @@ typedef struct ventoy_image_disk_region typedef struct ventoy_image_location { ventoy_guid guid; - + /* image sector size, 2048/512 */ grub_uint32_t image_sector_size; @@ -55,7 +55,7 @@ typedef struct ventoy_image_location /* * disk region data - * If the image file has more than one fragments in disk, + * If the image file has more than one fragments in disk, * there will be more than one region data here. * */ @@ -76,7 +76,7 @@ typedef struct ventoy_os_param char vtoy_img_path[384]; // It seems to be enough, utf-8 format grub_uint64_t vtoy_img_size; // image file size in bytes - /* + /* * Ventoy will write a copy of ventoy_image_location data into runtime memory * this is the physically address and length of that memory. * Address 0 means no such data exist. @@ -89,7 +89,7 @@ typedef struct ventoy_os_param grub_uint8_t vtoy_reserved[32]; // Internal use by ventoy grub_uint8_t vtoy_disk_signature[4]; - + grub_uint8_t reserved[27]; }ventoy_os_param; @@ -119,14 +119,14 @@ typedef struct ventoy_chain_head ventoy_os_param os_param; grub_uint32_t disk_drive; - grub_uint32_t drive_map; + grub_uint32_t drive_map; grub_uint32_t disk_sector_size; grub_uint64_t real_img_size_in_bytes; grub_uint64_t virt_img_size_in_bytes; grub_uint32_t boot_catalog; grub_uint8_t boot_catalog_sector[2048]; - + grub_uint32_t img_chunk_offset; grub_uint32_t img_chunk_num; @@ -179,7 +179,7 @@ typedef struct ventoy_virt_chunk typedef struct ventoy_sector_flag { uint8_t flag; // 0:init 1:mem 2:remap - uint64_t remap_lba; + uint64_t remap_lba; }ventoy_sector_flag; #define VENTOY_BIOS_FAKE_DRIVE 0xFE @@ -206,7 +206,7 @@ uint32_t CalculateCrc32 ); struct smbios3_entry { - + uint8_t signature[5]; /** Checksum */ @@ -220,11 +220,11 @@ struct smbios3_entry { /** Minor version */ uint8_t minor; - + uint8_t docrev; - + uint8_t revision; - + uint8_t reserved; uint32_t maxsize; diff --git a/IPXE/ipxe_mod_code/ipxe-3fe683e/src/net/tcp/iscsi.c b/IPXE/ipxe_mod_code/ipxe-3fe683e/src/net/tcp/iscsi.c index babf286cc42..44dcffb34be 100644 --- a/IPXE/ipxe_mod_code/ipxe-3fe683e/src/net/tcp/iscsi.c +++ b/IPXE/ipxe_mod_code/ipxe-3fe683e/src/net/tcp/iscsi.c @@ -588,7 +588,7 @@ static int iscsi_tx_data_out ( struct iscsi_session *iscsi ) { iobuf = xfer_alloc_iob ( &iscsi->socket, ( len + pad_len ) ); if ( ! iobuf ) return -ENOMEM; - + copy_from_user ( iob_put ( iobuf, len ), iscsi->command->data_out, offset, len ); memset ( iob_put ( iobuf, pad_len ), 0, pad_len ); @@ -707,7 +707,7 @@ static int iscsi_build_login_request_strings ( struct iscsi_session *iscsi, if ( iscsi->status & ISCSI_STATUS_STRINGS_CHAP_ALGORITHM ) { used += ssnprintf ( data + used, len - used, "CHAP_A=5%c", 0 ); } - + if ( ( iscsi->status & ISCSI_STATUS_STRINGS_CHAP_RESPONSE ) ) { char buf[ base16_encoded_len ( iscsi->chap.response_len ) + 1 ]; assert ( iscsi->initiator_username != NULL ); @@ -1407,7 +1407,7 @@ static int iscsi_tx_bhs ( struct iscsi_session *iscsi ) { * * @v iscsi iSCSI session * @ret rc Return status code - * + * * Handle transmission of part of a PDU data segment. iscsi::tx_bhs * will be valid when this is called. */ @@ -1459,7 +1459,7 @@ static void iscsi_tx_done ( struct iscsi_session *iscsi ) { * @v iscsi iSCSI session * @v buf Temporary data buffer * @v len Length of temporary data buffer - * + * * Constructs data to be sent for the current TX state */ static void iscsi_tx_step ( struct iscsi_session *iscsi ) { @@ -1642,7 +1642,7 @@ static int iscsi_socket_deliver ( struct iscsi_session *iscsi, case ISCSI_RX_BHS: rx = iscsi_rx_bhs; iscsi->rx_len = sizeof ( iscsi->rx_bhs ); - next_state = ISCSI_RX_AHS; + next_state = ISCSI_RX_AHS; break; case ISCSI_RX_AHS: rx = iscsi_rx_discard; @@ -2130,7 +2130,7 @@ static int iscsi_open ( struct interface *parent, struct uri *uri ) { /* Mortalise self, and return */ ref_put ( &iscsi->refcnt ); return 0; - + err_scsi_open: err_open_connection: err_sanity_iqn: diff --git a/KBD/cfg/KBD_AZERTY.cfg b/KBD/cfg/KBD_AZERTY.cfg index 6c6c7fc069a..f46e483c906 100644 --- a/KBD/cfg/KBD_AZERTY.cfg +++ b/KBD/cfg/KBD_AZERTY.cfg @@ -62,4 +62,4 @@ fi #braceright (}), enter (carriage return), semicolon (;), colon (:), quote (') , doublequote ("), slash (/), backquote (`), tilde (~) #backslash (\), bar (|), comma (,), less (<) period (.) , greater (>), question (?) #space, home, uparrow, pageup, leftarrow, center, rightarrow, end, downarrow, pagedown, insert, delete, F1-F12, shiftF1-shiftF12, ctrlF1-ctrlF12 -#Use prefix A for Alt+, e.g. Aequal, Aq, Aslash, A0, etc. \ No newline at end of file +#Use prefix A for Alt+, e.g. Aequal, Aq, Aslash, A0, etc. \ No newline at end of file diff --git a/KBD/cfg/KBD_CZECH_QWERTY.cfg b/KBD/cfg/KBD_CZECH_QWERTY.cfg index e5934f752cd..206e8be4ccd 100644 --- a/KBD/cfg/KBD_CZECH_QWERTY.cfg +++ b/KBD/cfg/KBD_CZECH_QWERTY.cfg @@ -72,4 +72,4 @@ fi #braceright (}), enter (carriage return), semicolon (;), colon (:), quote (') , doublequote ("), slash (/), backquote (`), tilde (~) #backslash (\), bar (|), comma (,), less (<) period (.) , greater (>), question (?) #space, home, uparrow, pageup, leftarrow, center, rightarrow, end, downarrow, pagedown, insert, delete, F1-F12, shiftF1-shiftF12, ctrlF1-ctrlF12 -#Use prefix A for Alt+, e.g. Aequal, Aq, Aslash, A0, etc. \ No newline at end of file +#Use prefix A for Alt+, e.g. Aequal, Aq, Aslash, A0, etc. \ No newline at end of file diff --git a/KBD/cfg/KBD_CZECH_QWERTZ.cfg b/KBD/cfg/KBD_CZECH_QWERTZ.cfg index be8938e9d5d..29b283b0581 100644 --- a/KBD/cfg/KBD_CZECH_QWERTZ.cfg +++ b/KBD/cfg/KBD_CZECH_QWERTZ.cfg @@ -61,4 +61,4 @@ fi #braceright (}), enter (carriage return), semicolon (;), colon (:), quote (') , doublequote ("), slash (/), backquote (`), tilde (~) #backslash (\), bar (|), comma (,), less (<) period (.) , greater (>), question (?) #space, home, uparrow, pageup, leftarrow, center, rightarrow, end, downarrow, pagedown, insert, delete, F1-F12, shiftF1-shiftF12, ctrlF1-ctrlF12 -#Use prefix A for Alt+, e.g. Aequal, Aq, Aslash, A0, etc. \ No newline at end of file +#Use prefix A for Alt+, e.g. Aequal, Aq, Aslash, A0, etc. \ No newline at end of file diff --git a/KBD/cfg/KBD_DANISH.cfg b/KBD/cfg/KBD_DANISH.cfg index 1e5990254e4..c57d75bf46f 100644 --- a/KBD/cfg/KBD_DANISH.cfg +++ b/KBD/cfg/KBD_DANISH.cfg @@ -53,4 +53,4 @@ fi #braceright (}), enter (carriage return), semicolon (;), colon (:), quote (') , doublequote ("), slash (/), backquote (`), tilde (~) #backslash (\), bar (|), comma (,), less (<) period (.) , greater (>), question (?) #space, home, uparrow, pageup, leftarrow, center, rightarrow, end, downarrow, pagedown, insert, delete, F1-F12, shiftF1-shiftF12, ctrlF1-ctrlF12 -#Use prefix A for Alt+, e.g. Aequal, Aq, Aslash, A0, etc. \ No newline at end of file +#Use prefix A for Alt+, e.g. Aequal, Aq, Aslash, A0, etc. \ No newline at end of file diff --git a/KBD/cfg/KBD_DVORAK_USA.cfg b/KBD/cfg/KBD_DVORAK_USA.cfg index 9e4b608742d..dd86d5a6c27 100644 --- a/KBD/cfg/KBD_DVORAK_USA.cfg +++ b/KBD/cfg/KBD_DVORAK_USA.cfg @@ -101,4 +101,4 @@ fi #braceright (}), enter (carriage return), semicolon (;), colon (:), quote (') , doublequote ("), slash (/), backquote (`), tilde (~) #backslash (\), bar (|), comma (,), less (<) period (.) , greater (>), question (?) #space, home, uparrow, pageup, leftarrow, center, rightarrow, end, downarrow, pagedown, insert, delete, F1-F12, shiftF1-shiftF12, ctrlF1-ctrlF12 -#Use prefix A for Alt+, e.g. Aequal, Aq, Aslash, A0, etc. \ No newline at end of file +#Use prefix A for Alt+, e.g. Aequal, Aq, Aslash, A0, etc. \ No newline at end of file diff --git a/KBD/cfg/KBD_FRENCH.cfg b/KBD/cfg/KBD_FRENCH.cfg index edc043013b6..89273f442ce 100644 --- a/KBD/cfg/KBD_FRENCH.cfg +++ b/KBD/cfg/KBD_FRENCH.cfg @@ -77,4 +77,4 @@ fi #braceright (}), enter (carriage return), semicolon (;), colon (:), quote (') , doublequote ("), slash (/), backquote (`), tilde (~) #backslash (\), bar (|), comma (,), less (<) period (.) , greater (>), question (?) #space, home, uparrow, pageup, leftarrow, center, rightarrow, end, downarrow, pagedown, insert, delete, F1-F12, shiftF1-shiftF12, ctrlF1-ctrlF12 -#Use prefix A for Alt+, e.g. Aequal, Aq, Aslash, A0, etc. \ No newline at end of file +#Use prefix A for Alt+, e.g. Aequal, Aq, Aslash, A0, etc. \ No newline at end of file diff --git a/KBD/cfg/KBD_GERMAN.cfg b/KBD/cfg/KBD_GERMAN.cfg index 1265fcd0e08..da10200d6da 100644 --- a/KBD/cfg/KBD_GERMAN.cfg +++ b/KBD/cfg/KBD_GERMAN.cfg @@ -53,4 +53,4 @@ fi #braceright (}), enter (carriage return), semicolon (;), colon (:), quote (') , doublequote ("), slash (/), backquote (`), tilde (~) #backslash (\), bar (|), comma (,), less (<) period (.) , greater (>), question (?) #space, home, uparrow, pageup, leftarrow, center, rightarrow, end, downarrow, pagedown, insert, delete, F1-F12, shiftF1-shiftF12, ctrlF1-ctrlF12 -#Use prefix A for Alt+, e.g. Aequal, Aq, Aslash, A0, etc. \ No newline at end of file +#Use prefix A for Alt+, e.g. Aequal, Aq, Aslash, A0, etc. \ No newline at end of file diff --git a/KBD/cfg/KBD_ITALIANO.cfg b/KBD/cfg/KBD_ITALIANO.cfg index 21846ec063c..8589827dcdc 100644 --- a/KBD/cfg/KBD_ITALIANO.cfg +++ b/KBD/cfg/KBD_ITALIANO.cfg @@ -49,4 +49,4 @@ fi #braceright (}), enter (carriage return), semicolon (;), colon (:), quote (') , doublequote ("), slash (/), backquote (`), tilde (~) #backslash (\), bar (|), comma (,), less (<) period (.) , greater (>), question (?) #space, home, uparrow, pageup, leftarrow, center, rightarrow, end, downarrow, pagedown, insert, delete, F1-F12, shiftF1-shiftF12, ctrlF1-ctrlF12 -#Use prefix A for Alt+, e.g. Aequal, Aq, Aslash, A0, etc. \ No newline at end of file +#Use prefix A for Alt+, e.g. Aequal, Aq, Aslash, A0, etc. \ No newline at end of file diff --git a/KBD/cfg/KBD_JAPAN_106.cfg b/KBD/cfg/KBD_JAPAN_106.cfg index 42c7fd9eabc..0064b7eb295 100644 --- a/KBD/cfg/KBD_JAPAN_106.cfg +++ b/KBD/cfg/KBD_JAPAN_106.cfg @@ -34,4 +34,4 @@ fi #braceright (}), enter (carriage return), semicolon (;), colon (:), quote (') , doublequote ("), slash (/), backquote (`), tilde (~) #backslash (\), bar (|), comma (,), less (<) period (.) , greater (>), question (?) #space, home, uparrow, pageup, leftarrow, center, rightarrow, end, downarrow, pagedown, insert, delete, F1-F12, shiftF1-shiftF12, ctrlF1-ctrlF12 -#Use prefix A for Alt+, e.g. Aequal, Aq, Aslash, A0, etc. \ No newline at end of file +#Use prefix A for Alt+, e.g. Aequal, Aq, Aslash, A0, etc. \ No newline at end of file diff --git a/KBD/cfg/KBD_LATIN_USA.cfg b/KBD/cfg/KBD_LATIN_USA.cfg index f50b4187d29..6afadbdd8fc 100644 --- a/KBD/cfg/KBD_LATIN_USA.cfg +++ b/KBD/cfg/KBD_LATIN_USA.cfg @@ -50,4 +50,4 @@ fi #braceright (}), enter (carriage return), semicolon (;), colon (:), quote (') , doublequote ("), slash (/), backquote (`), tilde (~) #backslash (\), bar (|), comma (,), less (<) period (.) , greater (>), question (?) #space, home, uparrow, pageup, leftarrow, center, rightarrow, end, downarrow, pagedown, insert, delete, F1-F12, shiftF1-shiftF12, ctrlF1-ctrlF12 -#Use prefix A for Alt+, e.g. Aequal, Aq, Aslash, A0, etc. \ No newline at end of file +#Use prefix A for Alt+, e.g. Aequal, Aq, Aslash, A0, etc. \ No newline at end of file diff --git a/KBD/cfg/KBD_PORTU_BRAZIL.cfg b/KBD/cfg/KBD_PORTU_BRAZIL.cfg index c0878a85074..7deca76e8b2 100644 --- a/KBD/cfg/KBD_PORTU_BRAZIL.cfg +++ b/KBD/cfg/KBD_PORTU_BRAZIL.cfg @@ -38,4 +38,4 @@ fi #braceright (}), enter (carriage return), semicolon (;), colon (:), quote (') , doublequote ("), slash (/), backquote (`), tilde (~) #backslash (\), bar (|), comma (,), less (<) period (.) , greater (>), question (?) #space, home, uparrow, pageup, leftarrow, center, rightarrow, end, downarrow, pagedown, insert, delete, F1-F12, shiftF1-shiftF12, ctrlF1-ctrlF12 -#Use prefix A for Alt+, e.g. Aequal, Aq, Aslash, A0, etc. \ No newline at end of file +#Use prefix A for Alt+, e.g. Aequal, Aq, Aslash, A0, etc. \ No newline at end of file diff --git a/KBD/cfg/KBD_QWERTZ.cfg b/KBD/cfg/KBD_QWERTZ.cfg index 0bacacceff6..da4b3edd4fc 100644 --- a/KBD/cfg/KBD_QWERTZ.cfg +++ b/KBD/cfg/KBD_QWERTZ.cfg @@ -41,4 +41,4 @@ fi #braceright (}), enter (carriage return), semicolon (;), colon (:), quote (') , doublequote ("), slash (/), backquote (`), tilde (~) #backslash (\), bar (|), comma (,), less (<) period (.) , greater (>), question (?) #space, home, uparrow, pageup, leftarrow, center, rightarrow, end, downarrow, pagedown, insert, delete, F1-F12, shiftF1-shiftF12, ctrlF1-ctrlF12 -#Use prefix A for Alt+, e.g. Aequal, Aq, Aslash, A0, etc. \ No newline at end of file +#Use prefix A for Alt+, e.g. Aequal, Aq, Aslash, A0, etc. \ No newline at end of file diff --git a/KBD/cfg/KBD_QWERTZ_HUN.cfg b/KBD/cfg/KBD_QWERTZ_HUN.cfg index f7263b3dc98..677b9dc71ee 100644 --- a/KBD/cfg/KBD_QWERTZ_HUN.cfg +++ b/KBD/cfg/KBD_QWERTZ_HUN.cfg @@ -66,4 +66,4 @@ fi #braceright (}), enter (carriage return), semicolon (;), colon (:), quote (') , doublequote ("), slash (/), backquote (`), tilde (~) #backslash (\), bar (|), comma (,), less (<) period (.) , greater (>), question (?) #space, home, uparrow, pageup, leftarrow, center, rightarrow, end, downarrow, pagedown, insert, delete, F1-F12, shiftF1-shiftF12, ctrlF1-ctrlF12 -#Use prefix A for Alt+, e.g. Aequal, Aq, Aslash, A0, etc. \ No newline at end of file +#Use prefix A for Alt+, e.g. Aequal, Aq, Aslash, A0, etc. \ No newline at end of file diff --git a/KBD/cfg/KBD_QWERTZ_SLOV_CROAT.cfg b/KBD/cfg/KBD_QWERTZ_SLOV_CROAT.cfg index 30b20eae38b..c5f6554c2af 100644 --- a/KBD/cfg/KBD_QWERTZ_SLOV_CROAT.cfg +++ b/KBD/cfg/KBD_QWERTZ_SLOV_CROAT.cfg @@ -45,4 +45,4 @@ fi #braceright (}), enter (carriage return), semicolon (;), colon (:), quote (') , doublequote ("), slash (/), backquote (`), tilde (~) #backslash (\), bar (|), comma (,), less (<) period (.) , greater (>), question (?) #space, home, uparrow, pageup, leftarrow, center, rightarrow, end, downarrow, pagedown, insert, delete, F1-F12, shiftF1-shiftF12, ctrlF1-ctrlF12 -#Use prefix A for Alt+, e.g. Aequal, Aq, Aslash, A0, etc. \ No newline at end of file +#Use prefix A for Alt+, e.g. Aequal, Aq, Aslash, A0, etc. \ No newline at end of file diff --git a/KBD/cfg/KBD_SPANISH.cfg b/KBD/cfg/KBD_SPANISH.cfg index fb9cc3b2f06..6ed5539d56e 100644 --- a/KBD/cfg/KBD_SPANISH.cfg +++ b/KBD/cfg/KBD_SPANISH.cfg @@ -51,4 +51,4 @@ fi #braceright (}), enter (carriage return), semicolon (;), colon (:), quote (') , doublequote ("), slash (/), backquote (`), tilde (~) #backslash (\), bar (|), comma (,), less (<) period (.) , greater (>), question (?) #space, home, uparrow, pageup, leftarrow, center, rightarrow, end, downarrow, pagedown, insert, delete, F1-F12, shiftF1-shiftF12, ctrlF1-ctrlF12 -#Use prefix A for Alt+, e.g. Aequal, Aq, Aslash, A0, etc. \ No newline at end of file +#Use prefix A for Alt+, e.g. Aequal, Aq, Aslash, A0, etc. \ No newline at end of file diff --git a/KBD/cfg/KBD_SWEDISH.cfg b/KBD/cfg/KBD_SWEDISH.cfg index 6d17d152b76..88030c805ab 100644 --- a/KBD/cfg/KBD_SWEDISH.cfg +++ b/KBD/cfg/KBD_SWEDISH.cfg @@ -53,4 +53,4 @@ fi #braceright (}), enter (carriage return), semicolon (;), colon (:), quote (') , doublequote ("), slash (/), backquote (`), tilde (~) #backslash (\), bar (|), comma (,), less (<) period (.) , greater (>), question (?) #space, home, uparrow, pageup, leftarrow, center, rightarrow, end, downarrow, pagedown, insert, delete, F1-F12, shiftF1-shiftF12, ctrlF1-ctrlF12 -#Use prefix A for Alt+, e.g. Aequal, Aq, Aslash, A0, etc. \ No newline at end of file +#Use prefix A for Alt+, e.g. Aequal, Aq, Aslash, A0, etc. \ No newline at end of file diff --git a/KBD/cfg/KBD_TURKISH_Q.cfg b/KBD/cfg/KBD_TURKISH_Q.cfg index 4a02fe61c60..e06fd0dbefe 100644 --- a/KBD/cfg/KBD_TURKISH_Q.cfg +++ b/KBD/cfg/KBD_TURKISH_Q.cfg @@ -46,4 +46,4 @@ fi #braceright (}), enter (carriage return), semicolon (;), colon (:), quote (') , doublequote ("), slash (/), backquote (`), tilde (~) #backslash (\), bar (|), comma (,), less (<) period (.) , greater (>), question (?) #space, home, uparrow, pageup, leftarrow, center, rightarrow, end, downarrow, pagedown, insert, delete, F1-F12, shiftF1-shiftF12, ctrlF1-ctrlF12 -#Use prefix A for Alt+, e.g. Aequal, Aq, Aslash, A0, etc. \ No newline at end of file +#Use prefix A for Alt+, e.g. Aequal, Aq, Aslash, A0, etc. \ No newline at end of file diff --git a/KBD/cfg/KBD_VIETNAMESE.cfg b/KBD/cfg/KBD_VIETNAMESE.cfg index 2d81867371f..e53f9b66395 100644 --- a/KBD/cfg/KBD_VIETNAMESE.cfg +++ b/KBD/cfg/KBD_VIETNAMESE.cfg @@ -49,4 +49,4 @@ fi #braceright (}), enter (carriage return), semicolon (;), colon (:), quote (') , doublequote ("), slash (/), backquote (`), tilde (~) #backslash (\), bar (|), comma (,), less (<) period (.) , greater (>), question (?) #space, home, uparrow, pageup, leftarrow, center, rightarrow, end, downarrow, pagedown, insert, delete, F1-F12, shiftF1-shiftF12, ctrlF1-ctrlF12 -#Use prefix A for Alt+, e.g. Aequal, Aq, Aslash, A0, etc. \ No newline at end of file +#Use prefix A for Alt+, e.g. Aequal, Aq, Aslash, A0, etc. \ No newline at end of file diff --git a/KBD/keyboard_layout.c b/KBD/keyboard_layout.c index 8d139b5fe31..aa68041ae16 100644 --- a/KBD/keyboard_layout.c +++ b/KBD/keyboard_layout.c @@ -7,54 +7,54 @@ static void ventoy_keyboard_layout_QWERTY_USA(void) { } static void ventoy_keyboard_layout_AZERTY(void) { grub_keymap_reset(); -grub_keymap_add_by_string("a", "q"); -grub_keymap_add_by_string("A", "Q"); -grub_keymap_add_by_string("z", "w"); -grub_keymap_add_by_string("Z", "W"); -grub_keymap_add_by_string("q", "a"); -grub_keymap_add_by_string("Q", "A"); -grub_keymap_add_by_string("m", "semicolon"); -grub_keymap_add_by_string("M", "colon"); -grub_keymap_add_by_string("w", "z"); -grub_keymap_add_by_string("W", "Z"); -grub_keymap_add_by_string("comma", "m"); -grub_keymap_add_by_string("question", "M"); -grub_keymap_add_by_string("semicolon", "comma"); -grub_keymap_add_by_string("period", "less"); -grub_keymap_add_by_string("colon", "period"); -grub_keymap_add_by_string("slash", "greater"); -grub_keymap_add_by_string("exclam", "slash"); -grub_keymap_add_by_string("dollar", "bracketright"); -grub_keymap_add_by_string("asterisk", "backslash"); -grub_keymap_add_by_string("percent", "doublequote"); -grub_keymap_add_by_string("ampersand", "1"); -grub_keymap_add_by_string("1", "exclam"); -grub_keymap_add_by_string("tilde", "2"); -grub_keymap_add_by_string("2", "at"); -grub_keymap_add_by_string("doublequote", "3"); -grub_keymap_add_by_string("3", "numbersign"); -grub_keymap_add_by_string("quote", "4"); -grub_keymap_add_by_string("4", "dollar"); -grub_keymap_add_by_string("parenleft", "5"); -grub_keymap_add_by_string("5", "percent"); -grub_keymap_add_by_string("minus", "6"); -grub_keymap_add_by_string("6", "caret"); -grub_keymap_add_by_string("backquote", "7"); -grub_keymap_add_by_string("7", "ampersand"); -grub_keymap_add_by_string("underscore", "8"); -grub_keymap_add_by_string("8", "asterisk"); -grub_keymap_add_by_string("caret", "9"); -grub_keymap_add_by_string("9", "parenleft"); -grub_keymap_add_by_string("at", "0"); -grub_keymap_add_by_string("0", "parenright"); -grub_keymap_add_by_string("parenright", "minus"); -grub_keymap_add_by_string("less", "backquote"); -grub_keymap_add_by_string("greater", "tilde"); -grub_keymap_add_by_string("numbersign", "braceright"); -grub_keymap_add_by_string("backslash", "question"); -grub_keymap_add_by_string("bracketright", "braceleft"); -grub_keymap_add_by_string("braceleft", "quote"); -grub_keymap_add_by_string("braceright", "underscore"); +grub_keymap_add_by_string("a", "q"); +grub_keymap_add_by_string("A", "Q"); +grub_keymap_add_by_string("z", "w"); +grub_keymap_add_by_string("Z", "W"); +grub_keymap_add_by_string("q", "a"); +grub_keymap_add_by_string("Q", "A"); +grub_keymap_add_by_string("m", "semicolon"); +grub_keymap_add_by_string("M", "colon"); +grub_keymap_add_by_string("w", "z"); +grub_keymap_add_by_string("W", "Z"); +grub_keymap_add_by_string("comma", "m"); +grub_keymap_add_by_string("question", "M"); +grub_keymap_add_by_string("semicolon", "comma"); +grub_keymap_add_by_string("period", "less"); +grub_keymap_add_by_string("colon", "period"); +grub_keymap_add_by_string("slash", "greater"); +grub_keymap_add_by_string("exclam", "slash"); +grub_keymap_add_by_string("dollar", "bracketright"); +grub_keymap_add_by_string("asterisk", "backslash"); +grub_keymap_add_by_string("percent", "doublequote"); +grub_keymap_add_by_string("ampersand", "1"); +grub_keymap_add_by_string("1", "exclam"); +grub_keymap_add_by_string("tilde", "2"); +grub_keymap_add_by_string("2", "at"); +grub_keymap_add_by_string("doublequote", "3"); +grub_keymap_add_by_string("3", "numbersign"); +grub_keymap_add_by_string("quote", "4"); +grub_keymap_add_by_string("4", "dollar"); +grub_keymap_add_by_string("parenleft", "5"); +grub_keymap_add_by_string("5", "percent"); +grub_keymap_add_by_string("minus", "6"); +grub_keymap_add_by_string("6", "caret"); +grub_keymap_add_by_string("backquote", "7"); +grub_keymap_add_by_string("7", "ampersand"); +grub_keymap_add_by_string("underscore", "8"); +grub_keymap_add_by_string("8", "asterisk"); +grub_keymap_add_by_string("caret", "9"); +grub_keymap_add_by_string("9", "parenleft"); +grub_keymap_add_by_string("at", "0"); +grub_keymap_add_by_string("0", "parenright"); +grub_keymap_add_by_string("parenright", "minus"); +grub_keymap_add_by_string("less", "backquote"); +grub_keymap_add_by_string("greater", "tilde"); +grub_keymap_add_by_string("numbersign", "braceright"); +grub_keymap_add_by_string("backslash", "question"); +grub_keymap_add_by_string("bracketright", "braceleft"); +grub_keymap_add_by_string("braceleft", "quote"); +grub_keymap_add_by_string("braceright", "underscore"); grub_keymap_enable(); } static void ventoy_keyboard_layout_CZECH_QWERTY(void) { @@ -118,9 +118,9 @@ grub_keymap_enable(); } static void ventoy_keyboard_layout_CZECH_QWERTZ(void) { grub_keymap_reset(); -grub_keymap_add_by_string("y", "z"); -grub_keymap_add_by_string("z", "y"); -grub_keymap_add_by_string("Y", "Z"); +grub_keymap_add_by_string("y", "z"); +grub_keymap_add_by_string("z", "y"); +grub_keymap_add_by_string("Y", "Z"); grub_keymap_add_by_string("Z", "Y"); grub_keymap_add_by_string("semicolon", "backquote"); grub_keymap_add_by_string("plus", "1"); @@ -204,22 +204,22 @@ static void ventoy_keyboard_layout_DVORAK_USA(void) { grub_keymap_reset(); grub_keymap_add_by_string("[", "minus"); grub_keymap_add_by_string("braceleft", "underscore"); -grub_keymap_add_by_string("quote", "q"); -grub_keymap_add_by_string("doublequote", "Q"); -grub_keymap_add_by_string("comma", "w"); -grub_keymap_add_by_string("less", "W"); -grub_keymap_add_by_string("s", "semicolon"); -grub_keymap_add_by_string("S", "colon"); -grub_keymap_add_by_string("semicolon", "z"); -grub_keymap_add_by_string("colon", "Z"); -grub_keymap_add_by_string("w", "comma"); -grub_keymap_add_by_string("W", "less"); -grub_keymap_add_by_string("v", "period"); -grub_keymap_add_by_string("z", "greater"); -grub_keymap_add_by_string("z", "slash"); -grub_keymap_add_by_string("equal", "bracketright"); -grub_keymap_add_by_string("backslash", "backslash"); -grub_keymap_add_by_string("underscore", "doublequote"); +grub_keymap_add_by_string("quote", "q"); +grub_keymap_add_by_string("doublequote", "Q"); +grub_keymap_add_by_string("comma", "w"); +grub_keymap_add_by_string("less", "W"); +grub_keymap_add_by_string("s", "semicolon"); +grub_keymap_add_by_string("S", "colon"); +grub_keymap_add_by_string("semicolon", "z"); +grub_keymap_add_by_string("colon", "Z"); +grub_keymap_add_by_string("w", "comma"); +grub_keymap_add_by_string("W", "less"); +grub_keymap_add_by_string("v", "period"); +grub_keymap_add_by_string("z", "greater"); +grub_keymap_add_by_string("z", "slash"); +grub_keymap_add_by_string("equal", "bracketright"); +grub_keymap_add_by_string("backslash", "backslash"); +grub_keymap_add_by_string("underscore", "doublequote"); grub_keymap_add_by_string("quote", "q"); grub_keymap_add_by_string("doublequote", "Q"); grub_keymap_add_by_string("comma", "w"); @@ -546,17 +546,17 @@ grub_keymap_add_by_string("backquote", "equal"); grub_keymap_add_by_string("numbersign", "backslash"); grub_keymap_add_by_string("parenright", "parenleft"); grub_keymap_add_by_string("parenleft", "asterisk"); -grub_keymap_add_by_string("percent", "caret"); -grub_keymap_add_by_string("less", "numbersign"); -grub_keymap_add_by_string("greater", "bar"); +grub_keymap_add_by_string("percent", "caret"); +grub_keymap_add_by_string("less", "numbersign"); +grub_keymap_add_by_string("greater", "bar"); grub_keymap_enable(); } static void ventoy_keyboard_layout_QWERTZ_HUN(void) { grub_keymap_reset(); -grub_keymap_add_by_string("y", "z"); -grub_keymap_add_by_string("z", "y"); -grub_keymap_add_by_string("Y", "Z"); -grub_keymap_add_by_string("Z", "Y"); +grub_keymap_add_by_string("y", "z"); +grub_keymap_add_by_string("z", "y"); +grub_keymap_add_by_string("Y", "Z"); +grub_keymap_add_by_string("Z", "Y"); grub_keymap_add_by_string("0", "backquote"); grub_keymap_add_by_string("quote", "exclam"); grub_keymap_add_by_string("doublequote", "at"); @@ -564,17 +564,17 @@ grub_keymap_add_by_string("plus", "numbersign"); grub_keymap_add_by_string("exclam", "dollar"); grub_keymap_add_by_string("slash", "caret"); grub_keymap_add_by_string("equal", "ampersand"); -grub_keymap_add_by_string("parenleft", "asterisk"); +grub_keymap_add_by_string("parenleft", "asterisk"); grub_keymap_add_by_string("parenright", "parenleft"); grub_keymap_add_by_string("backslash", "Aq"); grub_keymap_add_by_string("bar", "Aw"); -grub_keymap_add_by_string("bracketleft", "Af"); +grub_keymap_add_by_string("bracketleft", "Af"); grub_keymap_add_by_string("bracketright", "Ag"); grub_keymap_add_by_string("greater", "Az"); grub_keymap_add_by_string("numbersign", "Ax"); grub_keymap_add_by_string("ampersand", "Ac"); grub_keymap_add_by_string("at", "Av"); -grub_keymap_add_by_string("braceleft", "Ab"); +grub_keymap_add_by_string("braceleft", "Ab"); grub_keymap_add_by_string("braceright", "An"); grub_keymap_add_by_string("less", "Am"); grub_keymap_add_by_string("dollar", "colon"); diff --git a/KBD/mkconfig.sh b/KBD/mkconfig.sh index 0e09792cd73..efcba992d85 100644 --- a/KBD/mkconfig.sh +++ b/KBD/mkconfig.sh @@ -1,6 +1,6 @@ #!/bin/sh -# +# # Configfiles are from grubfilemanager project # @@ -20,10 +20,10 @@ EOF ls -1 cfg | while read line; do kbd=${line%.cfg} name=${kbd#KBD_} - + echo "menuentry $name --class=debug_kbd {" >> $cfgfile - grep '^setkey' cfg/$line >>$cfgfile - echo "}" >> $cfgfile + grep '^setkey' cfg/$line >>$cfgfile + echo "}" >> $cfgfile done dos2unix $cfgfile @@ -72,10 +72,10 @@ EOF ls -1 cfg | while read line; do kbd=${line%.cfg} name=${kbd#KBD_} - + echo " menuentry $name --class=debug_kbd {" >> $cfgfile echo " set_keyboard_layout $name" >> $cfgfile - echo " }" >> $cfgfile + echo " }" >> $cfgfile done echo "}" >>$cfgfile diff --git a/LANGUAGES/languages.json b/LANGUAGES/languages.json index f6e8ed38951..b0b4e635d57 100644 --- a/LANGUAGES/languages.json +++ b/LANGUAGES/languages.json @@ -1,10 +1,10 @@ [ { - "name":"Arabic (العربية)", + "name":"Arabic (العربية)", "FontFamily":"Courier New", "FontSize":20, "Author":"Omar Namis Mostafa", - + "STR_ERROR":"خطأ", "STR_WARNING":"تحذير", "STR_INFO":"معلومات", @@ -61,7 +61,7 @@ "STR_PART_CLUSTER_DEFAULT":"القيمة Ø§Ù„Ø§ÙØªØ±Ø§Ø¶ÙŠØ© للنظام", "STR_DONATE":"يتبرع", "STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native devices.", - + "STRXXX":"" }, { @@ -69,7 +69,7 @@ "FontFamily":"Courier New", "FontSize":16, "Author":"XÉ™yyam Qocayev", - + "STR_ERROR":"XÉ™ta", "STR_WARNING":"XÉ™bÉ™rdarlıq", "STR_INFO":"MÉ™lumat", @@ -126,7 +126,7 @@ "STR_PART_CLUSTER_DEFAULT":"System Default Value", "STR_DONATE":"IanÉ™", "STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native devices.", - + "STRXXX":"" }, { @@ -134,7 +134,7 @@ "FontFamily":"Courier New", "FontSize":16, "Author":"VenusGirl", - + "STR_ERROR":"오류", "STR_WARNING":"경고", "STR_INFO":"ì •ë³´", @@ -191,7 +191,7 @@ "STR_PART_CLUSTER_DEFAULT":"시스템 기본값", "STR_DONATE":"기부", "STR_4KN_UNSUPPORTED":"현재 Ventoy는 네ì´í‹°ë¸Œ 4K ì„¹í„°ì˜ ë””ìŠ¤í¬ë¥¼ ì§€ì›í•˜ì§€ 않습니다.", - + "STRXXX":"" }, { @@ -199,7 +199,7 @@ "FontFamily":"宋体", "FontSize":14, "Author":"longpanda", - + "STR_ERROR":"错误", "STR_WARNING":"警告", "STR_INFO":"æé†’", @@ -256,7 +256,7 @@ "STR_PART_CLUSTER_DEFAULT":"系统默认值", "STR_DONATE":"æåŠ©", "STR_4KN_UNSUPPORTED":"ç›®å‰ Ventoy 䏿”¯æŒåŽŸç”Ÿ 4K 扇区的ç£ç›˜ã€‚", - + "STRXXX":"" }, { @@ -321,7 +321,7 @@ "STR_PART_CLUSTER_DEFAULT":"System Standard Værdi", "STR_DONATE":"Donering", "STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native devices.", - + "STRXXX":"" }, { @@ -329,7 +329,7 @@ "FontFamily":"Courier New", "FontSize":16, "Author":"longpanda", - + "STR_ERROR":"Error", "STR_WARNING":"Warning", "STR_INFO":"Info", @@ -386,7 +386,7 @@ "STR_PART_CLUSTER_DEFAULT":"System Default Value", "STR_DONATE":"Donate", "STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native devices.", - + "STRXXX":"" }, { @@ -394,7 +394,7 @@ "FontFamily": "Courier New", "FontSize": 16, "Author": "44f33", - + "STR_ERROR": "შეცდáƒáƒ›áƒ", "STR_WARNING": "გáƒáƒ¤áƒ áƒ—ხილებáƒ", "STR_INFO": "ინფáƒáƒ áƒ›áƒáƒªáƒ˜áƒ", @@ -451,7 +451,7 @@ "STR_PART_CLUSTER_DEFAULT":"System Default Value", "STR_DONATE":"შემáƒáƒ¬áƒ˜áƒ áƒ£áƒšáƒáƒ‘áƒ", "STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native devices.", - + "STRXXX": "" }, { @@ -459,7 +459,7 @@ "FontFamily":"Courier New", "FontSize":16, "Author":"ivadham", - + "STR_ERROR":"خطا", "STR_WARNING":"هشدار", "STR_INFO":"توضیحات", @@ -516,7 +516,7 @@ "STR_PART_CLUSTER_DEFAULT":"System Default Value", "STR_DONATE":"اهداء", "STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native devices.", - + "STRXXX":"" }, { @@ -524,7 +524,7 @@ "FontFamily":"Courier New", "FontSize":16, "Author":"B.O.S.S, ChuckMichael", - + "STR_ERROR":"Błąd", "STR_WARNING":"Ostrzeżenie", "STR_INFO":"Informacja", @@ -581,7 +581,7 @@ "STR_PART_CLUSTER_DEFAULT":"Wartość domyÅ›lna systemu", "STR_DONATE":"Przekaż darowiznÄ™", "STR_4KN_UNSUPPORTED":"Obecnie Ventoy nie obsÅ‚uguje urzÄ…dzeÅ„ o fizycznym rozmiarze sektora 4K.", - + "STRXXX":"" }, { @@ -589,7 +589,7 @@ "FontFamily":"Courier New", "FontSize":16, "Author":"EstevaoCostaG3, David BrazSan, Hildo Guillardi Júnior, Chrystian Rubio, Felipe", - + "STR_ERROR":"Erro", "STR_WARNING":"Aviso", "STR_INFO":"Informações", @@ -646,7 +646,7 @@ "STR_PART_CLUSTER_DEFAULT":"Valor Padrão do Sistema", "STR_DONATE":"Doar", "STR_4KN_UNSUPPORTED":"Atualmente o Ventoy não suporta dispositivos 4K nativos.", - + "STRXXX":"" }, { @@ -654,7 +654,7 @@ "FontFamily":"Courier New", "FontSize":16, "Author":"Erhan Kültür,Tayfun Akkoyun, OÄŸuz Ersen", - + "STR_ERROR":"Hata", "STR_WARNING":"Uyarı", "STR_INFO":"Bilgi", @@ -711,7 +711,7 @@ "STR_PART_CLUSTER_DEFAULT":"Sistem varsayılan deÄŸeri", "STR_DONATE":"Ventoy'a Bağış yap", "STR_4KN_UNSUPPORTED":"Diskiniz 4K(4096byte) sektör yapısına sahip.Ventoy, 4K sektör yapısına sahip cihazlara ÅŸu anda destek vermemektedir.", - + "STRXXX":"" }, { @@ -719,7 +719,7 @@ "FontFamily":"Courier New", "FontSize":16, "Author":"luzea & u!^DEV, wiz64", - + "STR_ERROR":"Fehler", "STR_WARNING":"Warnung", "STR_INFO":"Info", @@ -776,7 +776,7 @@ "STR_PART_CLUSTER_DEFAULT":"Systemstandardwert", "STR_DONATE":"Spenden", "STR_4KN_UNSUPPORTED":"Ventoy unterstützt derzeit keine nativen 4K-Geräte.", - + "STRXXX":"" }, { @@ -784,7 +784,7 @@ "FontFamily":"Courier New", "FontSize":16, "Author":"quentin", - + "STR_ERROR":"Error", "STR_WARNING":"Avertiment", "STR_INFO":"Info", @@ -841,7 +841,7 @@ "STR_PART_CLUSTER_DEFAULT":"System Default Value", "STR_DONATE":"Donate", "STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native devices.", - + "STRXXX":"" }, { @@ -849,7 +849,7 @@ "FontFamily":"Courier New", "FontSize":16, "Author":"vboucard, Silejonu, wiz64", - + "STR_ERROR":"Erreur", "STR_WARNING":"Avertissement", "STR_INFO":"Info", @@ -906,7 +906,7 @@ "STR_PART_CLUSTER_DEFAULT":"Valeur par défaut du système", "STR_DONATE":"Faire un don", "STR_4KN_UNSUPPORTED":"Actuellement, Ventoy ne prend pas en charge les appareils natifs 4K.", - + "STRXXX":"" }, { @@ -914,7 +914,7 @@ "FontFamily":"Courier New", "FontSize":16, "Author":"vavanade, lev741", - + "STR_ERROR":"Chyba", "STR_WARNING":"Varování", "STR_INFO":"Info", @@ -955,7 +955,7 @@ "STR_WEB_TOKEN_MISMATCH":"Daemon status byl aktualizován, prosím vyskouÅ¡ejte to pozdÄ›ji.", "STR_WEB_SERVICE_BUSY":"Služba je zaneprázdnená, prosím vyskouÅ¡ejte to pozdÄ›ji.", "STR_MENU_VTSI_CREATE":"Vygenerovat VTSI Soubor", - "STR_VTSI_CREATE_TIP":"Tentokrát se do zařízení nebude zapisovat, jenom se vygeneruje VTSI soubor#@PokraÄovat?", + "STR_VTSI_CREATE_TIP":"Tentokrát se do zařízení nebude zapisovat, jenom se vygeneruje VTSI soubor#@PokraÄovat?", "STR_VTSI_CREATE_SUCCESS":"VTSI soubor úspěšne vytvoÅ™en!#@Múžete použit Rufus(3.15+) na jeho zapsání do zařízení pro dokonÄení instalace Ventoy.", "STR_VTSI_CREATE_FAILED":"Chyba pÅ™i vytváření VTSI souboru.", "STR_MENU_PART_RESIZE":"Nedestruktivní Instalace", @@ -971,7 +971,7 @@ "STR_PART_CLUSTER_DEFAULT":"Výchozí hodnota systému", "STR_DONATE":"Darovat", "STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native devices.", - + "STRXXX":"" }, { @@ -1035,7 +1035,7 @@ "STR_PART_CLUSTER_DEFAULT":"System Default Value", "STR_DONATE":"DarovaÅ¥", "STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native devices.", - + "STRXXX":"" }, { @@ -1043,7 +1043,7 @@ "FontFamily":"Courier New", "FontSize":16, "Author":"MELERIX", - + "STR_ERROR":"Error", "STR_WARNING":"Advertencia", "STR_INFO":"Información", @@ -1100,7 +1100,7 @@ "STR_PART_CLUSTER_DEFAULT":"Valor predeterminado del sistema", "STR_DONATE":"Donar", "STR_4KN_UNSUPPORTED":"Actualmente Ventoy no soporta dispositivos nativos 4K.", - + "STRXXX":"" }, { @@ -1108,7 +1108,7 @@ "FontFamily":"Courier New", "FontSize":16, "Author":"Carlos Sánchez, MELERIX, shulkalala", - + "STR_ERROR":"Error", "STR_WARNING":"Advertencia", "STR_INFO":"Información", @@ -1165,7 +1165,7 @@ "STR_PART_CLUSTER_DEFAULT":"Valor predeterminado del sistema", "STR_DONATE":"Donar", "STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native devices.", - + "STRXXX":"" }, { @@ -1173,7 +1173,7 @@ "FontFamily":"Courier New", "FontSize":16, "Author":"Dmitry Yerokhin, BL4CKH47H4CK3R, Teraskull, thehugonote, wiz64, dmitrygribenchuk, Темак", - + "STR_ERROR":"Ошибка", "STR_WARNING":"Внимание", "STR_INFO":"ИнформациÑ", @@ -1230,7 +1230,7 @@ "STR_PART_CLUSTER_DEFAULT":"СиÑтемное значение по умолчанию", "STR_DONATE":"Пожертвовать", "STR_4KN_UNSUPPORTED":"Ð’ наÑтоÑщее Ð²Ñ€ÐµÐ¼Ñ Ventoy не поддерживает родные уÑтройÑтва 4K.", - + "STRXXX":"" }, { @@ -1238,7 +1238,7 @@ "FontFamily":"Courier New", "FontSize":16, "Author":"BL4CKH47H4CK3R, wiz64", - + "STR_ERROR":"তà§à¦°à§à¦Ÿà¦¿", "STR_WARNING":"সতরà§à¦•তা", "STR_INFO":"তথà§à¦¯", @@ -1295,7 +1295,7 @@ "STR_PART_CLUSTER_DEFAULT":"সিসà§à¦Ÿà§‡à¦®à§‡à¦° ডিফলà§à¦Ÿ মান", "STR_DONATE":"দান করà§à¦¨", "STR_4KN_UNSUPPORTED":"বরà§à¦¤à¦®à¦¾à¦¨à§‡ Ventoy 4K নেটিভ ডিভাইস সমরà§à¦¥à¦¨ করে না।", - + "STRXXX":"" }, { @@ -1303,7 +1303,7 @@ "FontFamily":"Courier New", "FontSize":16, "Author":"BL4CKH47H4CK3R, wiz64", - + "STR_ERROR":"तà¥à¤°à¥à¤Ÿà¤¿", "STR_WARNING":"चेतावनी", "STR_INFO":"जानकारी", @@ -1360,7 +1360,7 @@ "STR_PART_CLUSTER_DEFAULT":"सिसà¥à¤Ÿà¤® डिफ़ॉलà¥à¤Ÿ मान", "STR_DONATE":"दान करें", "STR_4KN_UNSUPPORTED":"वरà¥à¤¤à¤®à¤¾à¤¨ में Ventoy 4K नेटिव डिवाइस को सपोरà¥à¤Ÿ नहीं करता है।", - + "STRXXX":"" }, { @@ -1368,7 +1368,7 @@ "FontFamily":"Courier New", "FontSize":16, "Author":"UmitCanbolat, RockyTDR", - + "STR_ERROR":"Fout", "STR_WARNING":"Waarschuwing", "STR_INFO":"Info", @@ -1425,7 +1425,7 @@ "STR_PART_CLUSTER_DEFAULT":"Standaardwaarde systeem", "STR_DONATE":"Doneer", "STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native devices.", - + "STRXXX":"" }, { @@ -1433,7 +1433,7 @@ "FontFamily":"Courier New", "FontSize":16, "Author":"DorinMol, cezarlacatus, wiz64", - + "STR_ERROR":"Eroare", "STR_WARNING":"Avertisment", "STR_INFO":"Informare", @@ -1490,7 +1490,7 @@ "STR_PART_CLUSTER_DEFAULT":"Valoarea implicită a sistemului", "STR_DONATE":"Donează", "STR_4KN_UNSUPPORTED":"Momentan, Ventoy nu suporta dispozitive native 4k.", - + "STRXXX":"" }, { @@ -1498,7 +1498,7 @@ "FontFamily":"Yu Gothic UI", "FontSize":16, "Author":"taichi eto, Bentnand, cmplstofB, Re*Index.(ot_inc)", - + "STR_ERROR":"エラー", "STR_WARNING":"警告", "STR_INFO":"情報", @@ -1555,7 +1555,7 @@ "STR_PART_CLUSTER_DEFAULT":"ã‚·ã‚¹ãƒ†ãƒ ã®æ—¢å®šå€¤", "STR_DONATE":"寄付", "STR_4KN_UNSUPPORTED":"ç¾åœ¨ã€Ventoyã¯4Kãƒã‚¤ãƒ†ã‚£ãƒ–デãƒã‚¤ã‚¹ã‚’サãƒãƒ¼ãƒˆã—ã¦ã„ã¾ã›ã‚“。", - + "STRXXX":"" }, { @@ -1563,7 +1563,7 @@ "FontFamily":"Courier New", "FontSize":16, "Author":"AverageUser2,Albano Battistella,bovirus,passero", - + "STR_ERROR":"Errore", "STR_WARNING":"Attenzione", "STR_INFO":"Info", @@ -1620,7 +1620,7 @@ "STR_PART_CLUSTER_DEFAULT":"Valore predefinito sistema", "STR_DONATE":"Dona", "STR_4KN_UNSUPPORTED":"Attualmente Ventoy non supporta dispositivi nativi 4K.", - + "STRXXX":"" }, { @@ -1628,7 +1628,7 @@ "FontFamily":"Courier New", "FontSize":16, "Author":"Valnjes", - + "STR_ERROR":"PogreÅ¡ka", "STR_WARNING":"Upozorenje", "STR_INFO":"Informacija", @@ -1685,7 +1685,7 @@ "STR_PART_CLUSTER_DEFAULT":"System Default Value", "STR_DONATE":"Donirajte", "STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native devices.", - + "STRXXX":"" }, { @@ -1693,7 +1693,7 @@ "FontFamily":"Courier New", "FontSize":16, "Author":"Bitfarago, gidano, meskobalazs", - + "STR_ERROR":"Hiba", "STR_WARNING":"Figyelmeztetés", "STR_INFO":"Információ", @@ -1750,7 +1750,7 @@ "STR_PART_CLUSTER_DEFAULT":"Rendszer alapérték", "STR_DONATE":"Adományoz", "STR_4KN_UNSUPPORTED":"Jelenleg a Ventoy nem támogat natív 4K eszközt.", - + "STRXXX":"" }, { @@ -1758,7 +1758,7 @@ "FontFamily":"新細明體", "FontSize":14, "Author":"penut85420,tony8077616", - + "STR_ERROR":"錯誤", "STR_WARNING":"警告", "STR_INFO":"æé†’", @@ -1815,7 +1815,7 @@ "STR_PART_CLUSTER_DEFAULT":"系統é è¨­å€¼", "STR_DONATE":"贊助", "STR_4KN_UNSUPPORTED":"ç›®å‰ Ventoy 䏿”¯æ´å–®ä½ç£å€æ ¼å¼ç‚º4K的硬碟。", - + "STRXXX":"" }, { @@ -1823,7 +1823,7 @@ "FontFamily":"Courier New", "FontSize":16, "Author":"Bojan Maksimović, panickingkernel, Zoran Jankov, Stefan Å ućur, Kosta Stojiljković", - + "STR_ERROR":"GreÅ¡ka", "STR_WARNING":"Upozorenje", "STR_INFO":"Informacija", @@ -1880,7 +1880,7 @@ "STR_PART_CLUSTER_DEFAULT":"Podrazumevana sistemska vrednost", "STR_DONATE":"Donirajte", "STR_4KN_UNSUPPORTED":"Ventoy trenutno ne podržava 4K izvorne ureÄ‘aje.", - + "STRXXX":"" }, { @@ -1945,7 +1945,7 @@ "STR_PART_CLUSTER_DEFAULT":"Подразумевана ÑиÑтемÑка вредноÑÑ‚", "STR_DONATE":"Донирајте", "STR_4KN_UNSUPPORTED":"Ventoy тренутно не подржава 4К изворне уређаје.", - + "STRXXX":"" }, { @@ -1953,7 +1953,7 @@ "FontFamily":"Courier New", "FontSize":17, "Author":"longpanda", - + "STR_ERROR":"ผิดพลาด", "STR_WARNING":"คำเตือน", "STR_INFO":"ข้อมูล", @@ -2010,7 +2010,7 @@ "STR_PART_CLUSTER_DEFAULT":"System Default Value", "STR_DONATE":"บริจาค", "STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native devices.", - + "STRXXX":"" }, { @@ -2075,7 +2075,7 @@ "STR_PART_CLUSTER_DEFAULT":"System Default Value", "STR_DONATE":"donere", "STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native devices.", - + "STRXXX":"" }, { @@ -2083,7 +2083,7 @@ "FontFamily":"Tahoma", "FontSize":14, "Author":"Nguyen Quoc Hoang - cuumay.win, HoangNPV - @isoamyl50", - + "STR_ERROR":"Lá»—i", "STR_WARNING":"Cảnh báo", "STR_INFO":"Thông tin", @@ -2140,7 +2140,7 @@ "STR_PART_CLUSTER_DEFAULT":"Theo giá trị mặc định cá»§a hệ thống", "STR_DONATE":"Ủng há»™ tác giả", "STR_4KN_UNSUPPORTED":"Hiện tại Ventoy không há»— trợ các thiết bị 4K native.", - + "STRXXX":"" }, { @@ -2148,7 +2148,7 @@ "FontFamily":"Courier New", "FontSize":16, "Author":"r0manas", - + "STR_ERROR ":"Klaida", "STR_WARNING ":"Ä®spÄ—jimas", "STR_INFO ":"Informacija", @@ -2205,7 +2205,7 @@ "STR_PART_CLUSTER_DEFAULT":"System Default Value", "STR_DONATE":"paaukoti", "STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native devices.", - + "STRXXX":"" }, { @@ -2213,7 +2213,7 @@ "FontFamily":"Courier New", "FontSize":16, "Author":"Влатко Стојанов", - + "STR_ERROR":"Грешка", "STR_WARNING":"Предупредување", "STR_INFO":"Инфо", @@ -2270,7 +2270,7 @@ "STR_PART_CLUSTER_DEFAULT":"System Default Value", "STR_DONATE":"донира", "STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native devices.", - + "STRXXX":"" }, { @@ -2278,7 +2278,7 @@ "FontFamily":"tahoma", "FontSize":16, "Author":"chaim-chv", - + "STR_ERROR":"תקלה", "STR_WARNING":"×זהרה", "STR_INFO":"מידע", @@ -2335,7 +2335,7 @@ "STR_PART_CLUSTER_DEFAULT":"System Default Value", "STR_DONATE":"לִתְרוֹ×", "STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native devices.", - + "STRXXX":"" }, { @@ -2343,7 +2343,7 @@ "FontFamily":"Courier New", "FontSize":16, "Author":"Eskiso, Hugo Carvalho", - + "STR_ERROR":"Erro", "STR_WARNING":"Aviso", "STR_INFO":"Informação", @@ -2400,7 +2400,7 @@ "STR_PART_CLUSTER_DEFAULT":"Valor predefinido do sistema", "STR_DONATE":"Doar", "STR_4KN_UNSUPPORTED":"Atualmente, o Ventoy não é compatível com dispositivos nativos 4K.", - + "STRXXX":"" }, { @@ -2408,7 +2408,7 @@ "FontFamily":"Courier New", "FontSize":16, "Author":"Ida Bagus Anom Sanjaya", - + "STR_ERROR":"Kesalahan", "STR_WARNING":"Peringatan", "STR_INFO":"Informasi", @@ -2465,7 +2465,7 @@ "STR_PART_CLUSTER_DEFAULT":"Nilai Standar Sistem", "STR_DONATE":"Donasi sukarela", "STR_4KN_UNSUPPORTED":"Saat ini Ventoy tidak mendukung perangkat 4K yang asli.", - + "STRXXX":"" }, { @@ -2473,7 +2473,7 @@ "FontFamily":"Courier New", "FontSize":16, "Author":"Allan Nordhøy", - + "STR_ERROR":"Feil", "STR_WARNING":"Advarsel", "STR_INFO":"Info", @@ -2530,7 +2530,7 @@ "STR_PART_CLUSTER_DEFAULT":"System Default Value", "STR_DONATE":"Donere", "STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native devices.", - + "STRXXX":"" }, { @@ -2595,7 +2595,7 @@ "STR_PART_CLUSTER_DEFAULT":"СиÑтемне Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð·Ð° умовчаннÑм", "STR_DONATE":"Пожертвуйте", "STR_4KN_UNSUPPORTED":"Ðаразі Ventoy не підтримує рідні приÑтрої 4K.", - + "STRXXX":"" }, { @@ -2603,7 +2603,7 @@ "FontFamily":"Courier New", "FontSize":16, "Author":"grmasa, Vasilis Kosmidis", - + "STR_ERROR":"Σφάλμα", "STR_WARNING":"ΠÏοειδοποίηση", "STR_INFO":"ΠληÏοφοÏίες", @@ -2660,16 +2660,16 @@ "STR_PART_CLUSTER_DEFAULT":"ΠÏοεπιλεγμένη τιμή συστήματος", "STR_DONATE":"ΔωÏεά", "STR_4KN_UNSUPPORTED":"Επί του παÏόντος, το Ventoy δεν υποστηÏίζει εγγενείς συσκευές 4K.", - + "STRXXX":"" }, - + { "name":"Swedish (Svenska)", "FontFamily":"Courier New", "FontSize":16, "Author":"Sopor", - + "STR_ERROR":"Fel", "STR_WARNING":"Varning", "STR_INFO":"Info", @@ -2726,7 +2726,7 @@ "STR_PART_CLUSTER_DEFAULT":"Systemets standardvärde", "STR_DONATE":"Donera", "STR_4KN_UNSUPPORTED":"För närvarande stöder inte Ventoy 4K-enheter.", - + "STRXXX":"" }, { @@ -2734,7 +2734,7 @@ "FontFamily":"Courier New", "FontSize":16, "Author":"Urajmal", - + "STR_ERROR":"Napaka", "STR_WARNING":"Opozorilo", "STR_INFO":"Info", @@ -2791,7 +2791,7 @@ "STR_PART_CLUSTER_DEFAULT":"System Default Value", "STR_DONATE":"Donirajte", "STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native devices.", - + "STRXXX":"" }, { @@ -2856,7 +2856,7 @@ "STR_PART_CLUSTER_DEFAULT":"По подразбиране от ÑиÑтемата", "STR_DONATE":"Дарете", "STR_4KN_UNSUPPORTED":"За момента Ventoy не поддържа уÑтройÑтва Ñ ÐºÐ»ÑŠÑтери, чиито размери Ñа 4КБ.", - + "STRXXX":"" }, { @@ -2921,7 +2921,7 @@ "STR_PART_CLUSTER_DEFAULT":"System Default Value", "STR_DONATE":"Õ†Õ¾Õ«Ö€Õ¡Õ¢Õ¥Ö€Õ¥Õ¬", "STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native devices.", - + "STRXXX":"" }, { @@ -2986,7 +2986,7 @@ "STR_PART_CLUSTER_DEFAULT":"System Default Value", "STR_DONATE":"Lahjoittaa", "STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native devices.", - + "STRXXX":"" }, { @@ -2994,7 +2994,7 @@ "FontFamily":"Courier New", "FontSize":16, "Author":"gbrea", - + "STR_ERROR":"Erro", "STR_WARNING":"Atención", "STR_INFO":"Info", @@ -3051,7 +3051,7 @@ "STR_PART_CLUSTER_DEFAULT":"System Default Value", "STR_DONATE":"Doa", "STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native devices.", - + "STRXXX":"" }, { @@ -3059,7 +3059,7 @@ "FontFamily":"Courier New", "FontSize":16, "Author":"guillemglez", - + "STR_ERROR":"Error", "STR_WARNING":"Avís", "STR_INFO":"Info", @@ -3116,16 +3116,16 @@ "STR_PART_CLUSTER_DEFAULT":"System Default Value", "STR_DONATE":"Donar", "STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native devices.", - + "STRXXX":"" }, - + { "name":"Georgian (ქáƒáƒ áƒ—ული)", "FontFamily":"Courier New", "FontSize":16, "Author":"Levan Baindurashvili", - + "STR_ERROR":"შეცდáƒáƒ›áƒ", "STR_WARNING":"გáƒáƒ¤áƒ áƒ—ხილებáƒ", "STR_INFO":"ინფáƒáƒ áƒ›áƒáƒªáƒ˜áƒ", @@ -3182,7 +3182,7 @@ "STR_PART_CLUSTER_DEFAULT":"System Default Value", "STR_DONATE":"შემáƒáƒ¬áƒ˜áƒ áƒ£áƒšáƒáƒ‘áƒ", "STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native devices.", - + "STRXXX":"" }, { @@ -3190,7 +3190,7 @@ "FontFamily":"Courier New", "FontSize":16, "Author":"K.B.Dharun Krishna", - + "STR_ERROR":"பிழை", "STR_WARNING":"எசà¯à®šà®°à®¿à®•à¯à®•ை", "STR_INFO":"தகவலà¯", @@ -3247,7 +3247,7 @@ "STR_PART_CLUSTER_DEFAULT":"கணினி இயலà¯à®ªà¯à®¨à®¿à®²à¯ˆ மதிபà¯à®ªà¯", "STR_DONATE":"தானம௠செயà¯", "STR_4KN_UNSUPPORTED":"தறà¯à®ªà¯‹à®¤à¯, வெணà¯à®Ÿà¯‹à®¯à¯ 4K சொநà¯à®¤ சாதனஙà¯à®•ளை ஆதரிகà¯à®•விலà¯à®²à¯ˆ.", - + "STRXXX":"" }, { @@ -3312,7 +3312,7 @@ "STR_PART_CLUSTER_DEFAULT":"СіÑÑ‚Ñмнае значÑнне па змаўчанні", "STR_DONATE":"ÐхвÑраваць", "STR_4KN_UNSUPPORTED":"Зараз Ventoy не падтрымлівае ўлаÑÐ½Ñ‹Ñ Ð¿Ñ€Ñ‹Ð»Ð°Ð´Ñ‹ 4K.", - + "STRXXX":"" } ] diff --git a/LinuxGUI/EXLIB/README.txt b/LinuxGUI/EXLIB/README.txt index ecbe5574e82..8a233fc3b5c 100644 --- a/LinuxGUI/EXLIB/README.txt +++ b/LinuxGUI/EXLIB/README.txt @@ -1,11 +1,11 @@ -====== ARM64 ====== +====== ARM64 ====== 1. Download CentOS-7-aarch64-Everything-2009.iso from internet. 2. mount CentOS-7-aarch64-Everything-2009.iso /mnt 3. sh prepare_lib_aarch64.sh /mnt/Packages/ -====== MIPS64EL ====== +====== MIPS64EL ====== 1. build dpkg for CentOS7 download dpkg_1.18.25.tar.xz from internet. cd dpkg-1.18.25 @@ -27,15 +27,15 @@ pool/main/libg/libglvnd/libglvnd0_1.3.2-1~bpo10+2_mips64el.deb pool/main/libg/libglvnd/libglx0_1.3.2-1~bpo10+2_mips64el.deb pool/main/q/qtbase-opensource-src/libqt5concurrent5_5.11.3+dfsg1-1+deb10u4_mips64el.deb pool/main/q/qtbase-opensource-src/libqt5core5a_5.11.3+dfsg1-1+deb10u4_mips64el.deb -pool/main/q/qtbase-opensource-src/libqt5dbus5_5.11.3+dfsg1-1+deb10u4_mips64el.deb -pool/main/q/qtbase-opensource-src/libqt5gui5_5.11.3+dfsg1-1+deb10u4_mips64el.deb +pool/main/q/qtbase-opensource-src/libqt5dbus5_5.11.3+dfsg1-1+deb10u4_mips64el.deb +pool/main/q/qtbase-opensource-src/libqt5gui5_5.11.3+dfsg1-1+deb10u4_mips64el.deb pool/main/q/qtbase-opensource-src/libqt5network5_5.11.3+dfsg1-1+deb10u4_mips64el.deb -pool/main/q/qtbase-opensource-src/libqt5opengl5_5.11.3+dfsg1-1+deb10u4_mips64el.deb +pool/main/q/qtbase-opensource-src/libqt5opengl5_5.11.3+dfsg1-1+deb10u4_mips64el.deb pool/main/q/qtbase-opensource-src/libqt5opengl5-dev_5.11.3+dfsg1-1+deb10u4_mips64el.deb -pool/main/q/qtbase-opensource-src/libqt5widgets5_5.11.3+dfsg1-1+deb10u4_mips64el.deb -pool/main/q/qtbase-opensource-src/libqt5xml5_5.11.3+dfsg1-1+deb10u4_mips64el.deb -pool/main/q/qtbase-opensource-src/qt5-qmake_5.11.3+dfsg1-1+deb10u4_mips64el.deb -pool/main/q/qtbase-opensource-src/qtbase5-dev_5.11.3+dfsg1-1+deb10u4_mips64el.deb +pool/main/q/qtbase-opensource-src/libqt5widgets5_5.11.3+dfsg1-1+deb10u4_mips64el.deb +pool/main/q/qtbase-opensource-src/libqt5xml5_5.11.3+dfsg1-1+deb10u4_mips64el.deb +pool/main/q/qtbase-opensource-src/qt5-qmake_5.11.3+dfsg1-1+deb10u4_mips64el.deb +pool/main/q/qtbase-opensource-src/qtbase5-dev_5.11.3+dfsg1-1+deb10u4_mips64el.deb pool/main/q/qtbase-opensource-src/qtbase5-dev-tools_5.11.3+dfsg1-1+deb10u4_mips64el.deb pool/main/q/qtbase-opensource-src/qtbase5-examples_5.11.3+dfsg1-1+deb10u4_mips64el.deb pool/main/q/qtbase-opensource-src/qtbase5-private-dev_5.11.3+dfsg1-1+deb10u4_mips64el.deb diff --git a/LinuxGUI/Ventoy2Disk/Core/ventoy_crc32.c b/LinuxGUI/Ventoy2Disk/Core/ventoy_crc32.c index 9f80c61b5ce..caff7d93965 100644 --- a/LinuxGUI/Ventoy2Disk/Core/ventoy_crc32.c +++ b/LinuxGUI/Ventoy2Disk/Core/ventoy_crc32.c @@ -7,12 +7,12 @@ * 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 . * @@ -289,7 +289,7 @@ uint32_t ventoy_crc32(void *Buffer, uint32_t Length) uint8_t *Ptr = Buffer; uint32_t Crc = 0xFFFFFFFF; - for (i = 0; i < Length; i++, Ptr++) + for (i = 0; i < Length; i++, Ptr++) { Crc = (Crc >> 8) ^ g_crc_table[(uint8_t) Crc ^ *Ptr]; } diff --git a/LinuxGUI/Ventoy2Disk/Core/ventoy_define.h b/LinuxGUI/Ventoy2Disk/Core/ventoy_define.h index ba1a4d28e0e..0da1cf7d3c4 100644 --- a/LinuxGUI/Ventoy2Disk/Core/ventoy_define.h +++ b/LinuxGUI/Ventoy2Disk/Core/ventoy_define.h @@ -7,12 +7,12 @@ * 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 . * @@ -111,7 +111,7 @@ typedef struct VTOY_GPT_INFO typedef struct disk_ventoy_data { int ventoy_valid; - + char ventoy_ver[32]; // 1.0.33 ... int secure_boot_flag; uint64_t preserved_space; diff --git a/LinuxGUI/Ventoy2Disk/Core/ventoy_disk.c b/LinuxGUI/Ventoy2Disk/Core/ventoy_disk.c index 5d4bbff736d..d2e4935c651 100644 --- a/LinuxGUI/Ventoy2Disk/Core/ventoy_disk.c +++ b/LinuxGUI/Ventoy2Disk/Core/ventoy_disk.c @@ -6,12 +6,12 @@ * 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 . * @@ -41,7 +41,7 @@ static int g_fatlib_media_fd = 0; static uint64_t g_fatlib_media_offset = 0; ventoy_disk *g_disk_list = NULL; -static const char *g_ventoy_dev_type_str[VTOY_DEVICE_END] = +static const char *g_ventoy_dev_type_str[VTOY_DEVICE_END] = { "unknown", "scsi", "USB", "ide", "dac960", "cpqarray", "file", "ataraid", "i2o", @@ -84,7 +84,7 @@ static int ventoy_check_blk_major(int major, const char *type) { if (strncmp(pos + 1, type, len) == 0) { - valid = 1; + valid = 1; } break; } @@ -105,7 +105,7 @@ static int ventoy_get_disk_devnum(const char *name, int *major, int* minor) int rc; char *pos; char devnum[16] = {0}; - + rc = ventoy_get_sys_file_line(devnum, sizeof(devnum), "/sys/block/%s/dev", name); if (rc) { @@ -132,63 +132,63 @@ static ventoy_dev_type ventoy_get_dev_type(const char *name, int major, int mino memset(syspath, 0, sizeof(syspath)); memset(dstpath, 0, sizeof(dstpath)); - + scnprintf(syspath, "/sys/block/%s", name); rc = readlink(syspath, dstpath, sizeof(dstpath) - 1); if (rc > 0 && strstr(dstpath, "/usb")) { return VTOY_DEVICE_USB; } - - if (SCSI_BLK_MAJOR(major) && (minor % 0x10 == 0)) + + if (SCSI_BLK_MAJOR(major) && (minor % 0x10 == 0)) { return VTOY_DEVICE_SCSI; } - else if (IDE_BLK_MAJOR(major) && (minor % 0x40 == 0)) + else if (IDE_BLK_MAJOR(major) && (minor % 0x40 == 0)) { return VTOY_DEVICE_IDE; } - else if (major == DAC960_MAJOR && (minor % 0x8 == 0)) + else if (major == DAC960_MAJOR && (minor % 0x8 == 0)) { return VTOY_DEVICE_DAC960; } - else if (major == ATARAID_MAJOR && (minor % 0x10 == 0)) + else if (major == ATARAID_MAJOR && (minor % 0x10 == 0)) { return VTOY_DEVICE_ATARAID; } - else if (major == AOE_MAJOR && (minor % 0x10 == 0)) + else if (major == AOE_MAJOR && (minor % 0x10 == 0)) { return VTOY_DEVICE_AOE; } - else if (major == DASD_MAJOR && (minor % 0x4 == 0)) + else if (major == DASD_MAJOR && (minor % 0x4 == 0)) { return VTOY_DEVICE_DASD; } - else if (major == VIODASD_MAJOR && (minor % 0x8 == 0)) + else if (major == VIODASD_MAJOR && (minor % 0x8 == 0)) { return VTOY_DEVICE_VIODASD; } - else if (SX8_BLK_MAJOR(major) && (minor % 0x20 == 0)) + else if (SX8_BLK_MAJOR(major) && (minor % 0x20 == 0)) { return VTOY_DEVICE_SX8; } - else if (I2O_BLK_MAJOR(major) && (minor % 0x10 == 0)) + else if (I2O_BLK_MAJOR(major) && (minor % 0x10 == 0)) { return VTOY_DEVICE_I2O; } - else if (CPQARRAY_BLK_MAJOR(major) && (minor % 0x10 == 0)) + else if (CPQARRAY_BLK_MAJOR(major) && (minor % 0x10 == 0)) { return VTOY_DEVICE_CPQARRAY; } - else if (UBD_MAJOR == major && (minor % 0x10 == 0)) + else if (UBD_MAJOR == major && (minor % 0x10 == 0)) { return VTOY_DEVICE_UBD; } - else if (XVD_MAJOR == major && (minor % 0x10 == 0)) + else if (XVD_MAJOR == major && (minor % 0x10 == 0)) { return VTOY_DEVICE_XVD; } - else if (SDMMC_MAJOR == major && (minor % 0x8 == 0)) + else if (SDMMC_MAJOR == major && (minor % 0x8 == 0)) { return VTOY_DEVICE_SDMMC; } @@ -216,7 +216,7 @@ static ventoy_dev_type ventoy_get_dev_type(const char *name, int major, int mino { return VTOY_DEVICE_PMEM; } - + return VTOY_DEVICE_END; } @@ -232,7 +232,7 @@ static int ventoy_is_possible_blkdev(const char *name) { return 0; } - + /* /dev/zramX */ if (name[0] == 'z' && name[1] == 'r' && name[2] == 'a' && name[3] == 'm') { @@ -256,7 +256,7 @@ static int ventoy_is_possible_blkdev(const char *name) { return 0; } - + return 1; } @@ -275,7 +275,7 @@ int ventoy_is_disk_4k_native(const char *disk) { ioctl(fd, BLKSSZGET, &logsector); ioctl(fd, BLKPBSZGET, &physector); - + if (logsector == 4096 && physector == 4096) { rc = 1; @@ -283,7 +283,7 @@ int ventoy_is_disk_4k_native(const char *disk) close(fd); } - vdebug("is 4k native disk <%s> <%d>\n", disk, rc); + vdebug("is 4k native disk <%s> <%d>\n", disk, rc); return rc; } @@ -300,7 +300,7 @@ uint64_t ventoy_get_disk_size_in_byte(const char *disk) if (access(diskpath, F_OK) >= 0) { vdebug("get disk size from sysfs for %s\n", disk); - + fd = open(diskpath, O_RDONLY | O_BINARY); if (fd >= 0) { @@ -352,14 +352,14 @@ static int fatlib_media_sector_read(uint32 sector, uint8 *buffer, uint32 sector_ { lseek(g_fatlib_media_fd, (sector + g_fatlib_media_offset) * 512ULL, SEEK_SET); read(g_fatlib_media_fd, buffer, sector_count * 512); - + return 1; } static int fatlib_is_secure_boot_enable(void) { void *flfile = NULL; - + flfile = fl_fopen("/EFI/BOOT/grubx64_real.efi", "rb"); if (flfile) { @@ -371,7 +371,7 @@ static int fatlib_is_secure_boot_enable(void) { vlog("/EFI/BOOT/grubx64_real.efi not exist\n"); } - + return 0; } @@ -427,7 +427,7 @@ static int fatlib_get_ventoy_version(char *verbuf, int bufsize) { vdebug("No grub.cfg found\n"); } - + return rc; } @@ -445,9 +445,9 @@ int ventoy_get_vtoy_data(ventoy_disk *info, int *ppartstyle) uint64_t part2_sector_count; uint64_t preserved_space; char name[64] = {0}; - disk_ventoy_data *vtoy = NULL; + disk_ventoy_data *vtoy = NULL; VTOY_GPT_INFO *gpt = NULL; - + vtoy = &(info->vtoydata); gpt = &(vtoy->gptinfo); memset(vtoy, 0, sizeof(disk_ventoy_data)); @@ -490,7 +490,7 @@ int ventoy_get_vtoy_data(ventoy_disk *info, int *ppartstyle) if (gpt->PartTbl[0].StartLBA == 0 || gpt->PartTbl[1].StartLBA == 0) { - vdebug("NO ventoy efi part layout <%llu %llu>\n", + vdebug("NO ventoy efi part layout <%llu %llu>\n", (_ull)gpt->PartTbl[0].StartLBA, (_ull)gpt->PartTbl[1].StartLBA); goto end; @@ -520,7 +520,7 @@ int ventoy_get_vtoy_data(ventoy_disk *info, int *ppartstyle) { *ppartstyle = part_style; } - + part1_start_sector = gpt->MBR.PartTbl[0].StartSectorId; part1_sector_count = gpt->MBR.PartTbl[0].SectorCount; part2_start_sector = gpt->MBR.PartTbl[1].StartSectorId; @@ -533,12 +533,12 @@ int ventoy_get_vtoy_data(ventoy_disk *info, int *ppartstyle) part2_sector_count != VTOYEFI_PART_SECTORS || (part1_start_sector + part1_sector_count) != part2_start_sector) { - vdebug("Not valid ventoy partition layout [%llu %llu] [%llu %llu]\n", + vdebug("Not valid ventoy partition layout [%llu %llu] [%llu %llu]\n", part1_start_sector, part1_sector_count, part2_start_sector, part2_sector_count); goto end; } - vdebug("ventoy partition layout check OK: [%llu %llu] [%llu %llu]\n", + vdebug("ventoy partition layout check OK: [%llu %llu] [%llu %llu]\n", part1_start_sector, part1_sector_count, part2_start_sector, part2_sector_count); vtoy->ventoy_valid = 1; @@ -554,7 +554,7 @@ int ventoy_get_vtoy_data(ventoy_disk *info, int *ppartstyle) ret = fatlib_get_ventoy_version(vtoy->ventoy_ver, sizeof(vtoy->ventoy_ver)); if (ret == 0 && vtoy->ventoy_ver[0]) { - vtoy->secure_boot_flag = fatlib_is_secure_boot_enable(); + vtoy->secure_boot_flag = fatlib_is_secure_boot_enable(); } else { @@ -579,7 +579,7 @@ int ventoy_get_vtoy_data(ventoy_disk *info, int *ppartstyle) { goto end; } - + lseek(fd, 2040 * 512, SEEK_SET); read(fd, vtoy->rsvdata, sizeof(vtoy->rsvdata)); @@ -617,7 +617,7 @@ int ventoy_get_disk_info(const char *name, ventoy_disk *info) scnprintf(info->part2_name, "%s2", name); scnprintf(info->part2_path, "/dev/%s2", name); } - + info->is4kn = ventoy_is_disk_4k_native(name); info->size_in_byte = ventoy_get_disk_size_in_byte(name); @@ -630,13 +630,13 @@ int ventoy_get_disk_info(const char *name, ventoy_disk *info) scnprintf(info->disk_model, "%s %s (%s)", vendor, model, ventoy_get_dev_type_name(info->type)); ventoy_get_vtoy_data(info, &(info->partstyle)); - - vdebug("disk:<%s %d:%d> model:<%s> size:%llu (%s)\n", + + vdebug("disk:<%s %d:%d> model:<%s> size:%llu (%s)\n", info->disk_path, info->major, info->minor, info->disk_model, info->size_in_byte, info->human_readable_size); if (info->vtoydata.ventoy_valid) { - vdebug("%s Ventoy:<%s> %s secureboot:%d preserve:%llu\n", info->disk_path, info->vtoydata.ventoy_ver, + vdebug("%s Ventoy:<%s> %s secureboot:%d preserve:%llu\n", info->disk_path, info->vtoydata.ventoy_ver, info->vtoydata.partition_style == MBR_PART_STYLE ? "MBR" : "GPT", info->vtoydata.secure_boot_flag, (_ull)(info->vtoydata.preserved_space)); } @@ -716,14 +716,14 @@ int ventoy_disk_enumerate_all(void) memset(g_disk_list + g_disk_num, 0, sizeof(ventoy_disk)); if (0 == ventoy_get_disk_info(p->d_name, g_disk_list + g_disk_num)) { - g_disk_num++; + g_disk_num++; } } } closedir(dir); ventoy_disk_sort(); - + return rc; } @@ -731,21 +731,21 @@ void ventoy_disk_dump(ventoy_disk *cur) { if (cur->vtoydata.ventoy_valid) { - vdebug("%s [%s] %s\tVentoy: %s %s secureboot:%d preserve:%llu\n", + vdebug("%s [%s] %s\tVentoy: %s %s secureboot:%d preserve:%llu\n", cur->disk_path, cur->human_readable_size, cur->disk_model, cur->vtoydata.ventoy_ver, cur->vtoydata.partition_style == MBR_PART_STYLE ? "MBR" : "GPT", cur->vtoydata.secure_boot_flag, (_ull)(cur->vtoydata.preserved_space)); } else { - vdebug("%s [%s] %s\tVentoy: NA\n", cur->disk_path, cur->human_readable_size, cur->disk_model); + vdebug("%s [%s] %s\tVentoy: NA\n", cur->disk_path, cur->human_readable_size, cur->disk_model); } } void ventoy_disk_dump_all(void) { int i; - + vdebug("============= DISK DUMP ============\n"); for (i = 0; i < g_disk_num; i++) { @@ -765,13 +765,13 @@ int ventoy_disk_init(void) ventoy_disk_enumerate_all(); ventoy_disk_dump_all(); - + return 0; } void ventoy_disk_exit(void) { - check_free(g_disk_list); + check_free(g_disk_list); g_disk_list = NULL; g_disk_num = 0; } diff --git a/LinuxGUI/Ventoy2Disk/Core/ventoy_disk.h b/LinuxGUI/Ventoy2Disk/Core/ventoy_disk.h index 50618dce65d..9ffeaa44b9c 100644 --- a/LinuxGUI/Ventoy2Disk/Core/ventoy_disk.h +++ b/LinuxGUI/Ventoy2Disk/Core/ventoy_disk.h @@ -7,12 +7,12 @@ * 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 . * @@ -20,7 +20,7 @@ #ifndef __VENTOY_DISK_H__ #define __VENTOY_DISK_H__ -typedef enum +typedef enum { VTOY_DEVICE_UNKNOWN = 0, VTOY_DEVICE_SCSI, @@ -45,7 +45,7 @@ typedef enum VTOY_DEVICE_NVME, VTOY_DEVICE_RAM, VTOY_DEVICE_PMEM, - + VTOY_DEVICE_END }ventoy_dev_type; diff --git a/LinuxGUI/Ventoy2Disk/Core/ventoy_json.h b/LinuxGUI/Ventoy2Disk/Core/ventoy_json.h index 32fef4b199c..6505860711b 100644 --- a/LinuxGUI/Ventoy2Disk/Core/ventoy_json.h +++ b/LinuxGUI/Ventoy2Disk/Core/ventoy_json.h @@ -7,12 +7,12 @@ * 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 . * @@ -80,7 +80,7 @@ typedef struct tagVTOY_JSON struct tagVTOY_JSON *pstChild; JSON_TYPE enDataType; - union + union { char *pcStrVal; int iNumVal; @@ -95,13 +95,13 @@ typedef struct tagVTOY_JSON uint32_t __uiCurPos = (uiCurPos);\ uint32_t __uiBufLen = (uiBufLen);\ char *__pcBuf = (pcBuf); - + #define VTOY_JSON_FMT_END(uiCurPos) \ (uiCurPos) = __uiCurPos;\ } - + #define VTOY_JSON_FMT_OBJ_BEGIN() ssprintf(__uiCurPos, __pcBuf, __uiBufLen, "{") - + #define VTOY_JSON_FMT_OBJ_END() \ {\ if (',' == *(__pcBuf + (__uiCurPos - 1)))\ @@ -119,7 +119,7 @@ typedef struct tagVTOY_JSON }\ ssprintf(__uiCurPos, __pcBuf, __uiBufLen, "},");\ } - + #define VTOY_JSON_FMT_KEY(Key) ssprintf(__uiCurPos, __pcBuf, __uiBufLen, "\"%s\":", (Key)) #define VTOY_JSON_FMT_ITEM(Item) ssprintf(__uiCurPos, __pcBuf, __uiBufLen, "\"%s\",", (Item)) @@ -141,7 +141,7 @@ typedef struct tagVTOY_JSON } #define VTOY_JSON_FMT_ARY_BEGIN() ssprintf(__uiCurPos, __pcBuf, __uiBufLen, "[") - + #define VTOY_JSON_FMT_ARY_END() \ {\ if (',' == *(__pcBuf + (__uiCurPos - 1)))\ @@ -159,7 +159,7 @@ typedef struct tagVTOY_JSON }\ ssprintf(__uiCurPos, __pcBuf, __uiBufLen, "],");\ } - + #define VTOY_JSON_FMT_UINT64(Key, Val) ssprintf(__uiCurPos, __pcBuf, __uiBufLen, "\"%s\":%llu,", Key, (_ull)Val) #define VTOY_JSON_FMT_ULONG(Key, Val) ssprintf(__uiCurPos, __pcBuf, __uiBufLen, "\"%s\":%lu,", Key, Val) @@ -174,12 +174,12 @@ typedef struct tagVTOY_JSON ssprintf(__uiCurPos, __pcBuf, __uiBufLen, "\"%s\":\"%llu\",", Key, Val) #define VTOY_JSON_FMT_SINT(Key, Val) ssprintf(__uiCurPos, __pcBuf, __uiBufLen, "\"%s\":%d,", Key, Val) - + #define VTOY_JSON_FMT_DUBL(Key, Val) ssprintf(__uiCurPos, __pcBuf, __uiBufLen, "\"%s\":%.1lf,", Key, Val) #define VTOY_JSON_FMT_DUBL2(Key, Val) ssprintf(__uiCurPos, __pcBuf, __uiBufLen, "\"%s\":%10.02lf,", Key, Val) -#define VTOY_JSON_FMT_STRN(Key, Val) ssprintf(__uiCurPos, __pcBuf, __uiBufLen, "\"%s\":\"%s\",", Key, Val) - +#define VTOY_JSON_FMT_STRN(Key, Val) ssprintf(__uiCurPos, __pcBuf, __uiBufLen, "\"%s\":\"%s\",", Key, Val) + #define VTOY_JSON_FMT_NULL(Key) ssprintf(__uiCurPos, __pcBuf, __uiBufLen, "\"%s\":null,", Key) #define VTOY_JSON_FMT_TRUE(Key) ssprintf(__uiCurPos, __pcBuf, __uiBufLen, "\"%s\":true,", (Key)) @@ -212,7 +212,7 @@ int vtoy_json_parse_value ( char *pcNewStart, char *pcRawStart, - VTOY_JSON *pstJson, + VTOY_JSON *pstJson, const char *pcData, const char **ppcEnd ); @@ -233,32 +233,32 @@ int vtoy_json_scan_parse ); int vtoy_json_get_int ( - VTOY_JSON *pstJson, - const char *szKey, + VTOY_JSON *pstJson, + const char *szKey, int *piValue ); int vtoy_json_get_uint ( - VTOY_JSON *pstJson, - const char *szKey, + VTOY_JSON *pstJson, + const char *szKey, uint32_t *puiValue ); int vtoy_json_get_uint64 ( - VTOY_JSON *pstJson, - const char *szKey, + VTOY_JSON *pstJson, + const char *szKey, uint64_t *pui64Value ); int vtoy_json_get_bool ( VTOY_JSON *pstJson, - const char *szKey, + const char *szKey, uint8_t *pbValue ); int vtoy_json_get_string ( - VTOY_JSON *pstJson, - const char *szKey, + VTOY_JSON *pstJson, + const char *szKey, uint32_t uiBufLen, char *pcBuf ); diff --git a/LinuxGUI/Ventoy2Disk/Core/ventoy_log.c b/LinuxGUI/Ventoy2Disk/Core/ventoy_log.c index 2df37c22c02..7c861bf68b5 100644 --- a/LinuxGUI/Ventoy2Disk/Core/ventoy_log.c +++ b/LinuxGUI/Ventoy2Disk/Core/ventoy_log.c @@ -7,12 +7,12 @@ * 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 . * @@ -56,7 +56,7 @@ void ventoy_syslog_newline(int level, const char *Fmt, ...) time_t stamp; struct tm ttm; FILE *fp; - + if (level > g_ventoy_log_level) { return; @@ -73,7 +73,7 @@ void ventoy_syslog_newline(int level, const char *Fmt, ...) fp = fopen(g_log_file, "a+"); if (fp) { - fprintf(fp, "[%04u/%02u/%02u %02u:%02u:%02u] %s\n", + fprintf(fp, "[%04u/%02u/%02u %02u:%02u:%02u] %s\n", ttm.tm_year, ttm.tm_mon, ttm.tm_mday, ttm.tm_hour, ttm.tm_min, ttm.tm_sec, log); @@ -89,7 +89,7 @@ void ventoy_syslog_printf(const char *Fmt, ...) time_t stamp; struct tm ttm; FILE *fp; - + time(&stamp); localtime_r(&stamp, &ttm); @@ -101,7 +101,7 @@ void ventoy_syslog_printf(const char *Fmt, ...) fp = fopen(g_log_file, "a+"); if (fp) { - fprintf(fp, "[%04u/%02u/%02u %02u:%02u:%02u] %s", + fprintf(fp, "[%04u/%02u/%02u %02u:%02u:%02u] %s", ttm.tm_year, ttm.tm_mon, ttm.tm_mday, ttm.tm_hour, ttm.tm_min, ttm.tm_sec, log); @@ -117,7 +117,7 @@ void ventoy_syslog(int level, const char *Fmt, ...) time_t stamp; struct tm ttm; FILE *fp; - + if (level > g_ventoy_log_level) { return; @@ -134,7 +134,7 @@ void ventoy_syslog(int level, const char *Fmt, ...) fp = fopen(g_log_file, "a+"); if (fp) { - fprintf(fp, "[%04u/%02u/%02u %02u:%02u:%02u] %s", + fprintf(fp, "[%04u/%02u/%02u %02u:%02u:%02u] %s", ttm.tm_year + 1900, ttm.tm_mon, ttm.tm_mday, ttm.tm_hour, ttm.tm_min, ttm.tm_sec, log); diff --git a/LinuxGUI/Ventoy2Disk/Core/ventoy_md5.c b/LinuxGUI/Ventoy2Disk/Core/ventoy_md5.c index ba79d54509a..c34923c93db 100644 --- a/LinuxGUI/Ventoy2Disk/Core/ventoy_md5.c +++ b/LinuxGUI/Ventoy2Disk/Core/ventoy_md5.c @@ -7,12 +7,12 @@ * 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 . * @@ -24,7 +24,7 @@ #include #include -const static uint32_t k[64] = +const static uint32_t k[64] = { 0xd76aa478, 0xe8c7b756, 0x242070db, 0xc1bdceee, 0xf57c0faf, 0x4787c62a, 0xa8304613, 0xfd469501, @@ -41,10 +41,10 @@ const static uint32_t k[64] = 0xf4292244, 0x432aff97, 0xab9423a7, 0xfc93a039, 0x655b59c3, 0x8f0ccc92, 0xffeff47d, 0x85845dd1, 0x6fa87e4f, 0xfe2ce6e0, 0xa3014314, 0x4e0811a1, - 0xf7537e82, 0xbd3af235, 0x2ad7d2bb, 0xeb86d391 + 0xf7537e82, 0xbd3af235, 0x2ad7d2bb, 0xeb86d391 }; -const static uint32_t r[] = +const static uint32_t r[] = { 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, @@ -65,30 +65,30 @@ const static uint32_t r[] = } void ventoy_md5(const void *data, uint32_t len, uint8_t *md5) -{ +{ uint32_t h0, h1, h2, h3; uint32_t w[16]; uint32_t a, b, c, d, i, f, g, temp; uint32_t offset, mod, delta; uint8_t postbuf[128] = {0}; - + // Initialize variables - simple count in nibbles: h0 = 0x67452301; h1 = 0xefcdab89; h2 = 0x98badcfe; h3 = 0x10325476; - + //Pre-processing: - //append "1" bit to message + //append "1" bit to message //append "0" bits until message length in bits ≡ 448 (mod 512) //append length mod (2^64) to message mod = len % 64; if (mod) { - memcpy(postbuf, (const uint8_t *)data + len - mod, mod); + memcpy(postbuf, (const uint8_t *)data + len - mod, mod); } - + postbuf[mod] = 0x80; if (mod < 56) { @@ -104,7 +104,7 @@ void ventoy_md5(const void *data, uint32_t len, uint8_t *md5) } len -= mod; - + for (offset = 0; offset < len + delta; offset += 64) { if (offset < len) @@ -121,43 +121,43 @@ void ventoy_md5(const void *data, uint32_t len, uint8_t *md5) b = h1; c = h2; d = h3; - + // Main loop: for (i = 0; i < 16; i++) { f = (b & c) | ((~b) & d); - g = i; + g = i; ROTATE_CALC(); } - + for (i = 16; i < 32; i++) { f = (d & b) | ((~d) & c); g = (5 * i + 1) % 16; ROTATE_CALC(); } - + for (i = 32; i < 48; i++) { f = b ^ c ^ d; g = (3 * i + 5) % 16; ROTATE_CALC(); } - + for (i = 48; i < 64; i++) { f = c ^ (b | (~d)); g = (7 * i) % 16; ROTATE_CALC(); } - + // Add this chunk's hash to result so far: h0 += a; h1 += b; h2 += c; h3 += d; } - + //var char md5[16] := h0 append h1 append h2 append h3 //(Output is in little-endian) to_bytes(h0, md5); to_bytes(h1, md5 + 4); diff --git a/LinuxGUI/Ventoy2Disk/Core/ventoy_util.c b/LinuxGUI/Ventoy2Disk/Core/ventoy_util.c index cbee36a8353..30935673e5e 100644 --- a/LinuxGUI/Ventoy2Disk/Core/ventoy_util.c +++ b/LinuxGUI/Ventoy2Disk/Core/ventoy_util.c @@ -6,12 +6,12 @@ * 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 . * @@ -125,7 +125,7 @@ int ventoy_get_sys_file_line(char *buffer, int buflen, const char *fmt, ...) break; } } - + return 0; } else @@ -168,7 +168,7 @@ static int ventoy_mount_path_escape(char *src, char *dst, int len) { int i = 0; int n = 0; - + dst[len - 1] = 0; for (i = 0; i < len - 1; i++) @@ -182,7 +182,7 @@ static int ventoy_mount_path_escape(char *src, char *dst, int len) { dst[n++] = src[i]; } - + if (src[i] == 0) { break; @@ -222,11 +222,11 @@ int ventoy_try_umount_disk(const char *devpath) *pos2 = 0; } - ventoy_mount_path_escape(pos1 + 1, mntpt, sizeof(mntpt)); + ventoy_mount_path_escape(pos1 + 1, mntpt, sizeof(mntpt)); rc = umount(mntpt); if (rc) { - vdebug("umount <%s> <%s> [ failed ] error:%d\n", devpath, mntpt, errno); + vdebug("umount <%s> <%s> [ failed ] error:%d\n", devpath, mntpt, errno); } else { @@ -303,14 +303,14 @@ const char * ventoy_get_local_version(void) scnprintf(LocalVersion, "%s", Buf); free(Buf); } - + return LocalVersion; } int VentoyGetLocalBootImg(MBR_HEAD *pMBR) { memcpy(pMBR, g_mbr_template, 512); - return 0; + return 0; } static int VentoyFillProtectMBR(uint64_t DiskSizeBytes, MBR_HEAD *pMBR) @@ -370,7 +370,7 @@ static int ventoy_fill_gpt_partname(uint16_t Name[36], const char *asciiName) { Name[i] = asciiName[i]; } - + return 0; } @@ -465,7 +465,7 @@ int VentoyFillMBRLocation(uint64_t DiskSizeInBytes, uint32_t StartSectorId, uint uint8_t Head; uint8_t Sector; uint8_t nSector = 63; - uint8_t nHead = 8; + uint8_t nHead = 8; uint32_t Cylinder; uint32_t EndSectorId; @@ -570,7 +570,7 @@ int ventoy_fill_mbr(uint64_t size, uint64_t reserve, int align4k, MBR_HEAD *pMBR PartSectorCount = VTOYEFI_PART_BYTES / 512; VentoyFillMBRLocation(size, PartStartSector, PartSectorCount, pMBR->PartTbl + 1); - pMBR->PartTbl[1].Active = 0x00; + pMBR->PartTbl[1].Active = 0x00; pMBR->PartTbl[1].FsFlag = 0xEF; // EFI System Partition pMBR->Byte55 = 0x55; @@ -635,7 +635,7 @@ int ventoy_fill_mbr_4k(uint64_t size, uint64_t reserve, int align4k, MBR_HEAD *p PartSectorCount = VTOYEFI_PART_BYTES / 4096; VentoyFillMBRLocation(size, PartStartSector, PartSectorCount, pMBR->PartTbl + 1); - pMBR->PartTbl[1].Active = 0x00; + pMBR->PartTbl[1].Active = 0x00; pMBR->PartTbl[1].FsFlag = 0xEF; // EFI System Partition pMBR->Byte55 = 0x55; diff --git a/LinuxGUI/Ventoy2Disk/Core/ventoy_util.h b/LinuxGUI/Ventoy2Disk/Core/ventoy_util.h index a5e4c8bd333..c28513d9c50 100644 --- a/LinuxGUI/Ventoy2Disk/Core/ventoy_util.h +++ b/LinuxGUI/Ventoy2Disk/Core/ventoy_util.h @@ -7,12 +7,12 @@ * 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 . * diff --git a/LinuxGUI/Ventoy2Disk/GTK/ventoy_gtk.c b/LinuxGUI/Ventoy2Disk/GTK/ventoy_gtk.c index bb9215a221d..ab02c2a3b48 100644 --- a/LinuxGUI/Ventoy2Disk/GTK/ventoy_gtk.c +++ b/LinuxGUI/Ventoy2Disk/GTK/ventoy_gtk.c @@ -7,12 +7,12 @@ * 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 . * @@ -113,15 +113,15 @@ int msgbox(GtkMessageType type, GtkButtonsType buttons, const char *strid) static void set_item_visible(const char *id, int visible) { GtkWidget *pWidget = NULL; - + pWidget = GTK_WIDGET(gtk_builder_get_object(g_pXmlBuilder, id)); if (visible) { - gtk_widget_show(pWidget); + gtk_widget_show(pWidget); } else { - gtk_widget_hide(pWidget); + gtk_widget_hide(pWidget); } } @@ -131,7 +131,7 @@ static void init_part_style_menu(void) style = ventoy_code_get_cur_part_style(); gtk_check_menu_item_set_active(g_menu_item_mbr, (0 == style)); - gtk_check_menu_item_set_active(g_menu_item_gpt, (1 == style)); + gtk_check_menu_item_set_active(g_menu_item_gpt, (1 == style)); gtk_label_set_text(g_label_local_part_style, style ? "GPT" : "MBR"); } @@ -142,7 +142,7 @@ static void select_language(const char *lang) const char *pDevice = NULL; VTOY_JSON *node = NULL; char device[256]; - + for (node = g_languages_json->pstChild; node; node = node->pstNext) { pName = vtoy_json_get_string_ex(node->pstChild, "name"); @@ -167,15 +167,15 @@ static void select_language(const char *lang) { gtk_label_set_text(g_device_title, vtoy_json_get_string_ex(node->pstChild, "STR_DEVICE")); } - + LANG_LABEL_TEXT("label_local_ver", "STR_LOCAL_VER"); LANG_LABEL_TEXT("label_device_ver", "STR_DISK_VER"); - + LANG_LABEL_TEXT("label_status", "STR_STATUS"); - + LANG_BUTTON_TEXT("button_install", "STR_INSTALL"); LANG_BUTTON_TEXT("button_update", "STR_UPDATE"); - + LANG_MENU_ITEM_TEXT("menu_option", "STR_MENU_OPTION"); LANG_MENU_ITEM_TEXT("menu_item_secure", "STR_MENU_SECURE_BOOT"); LANG_MENU_ITEM_TEXT("menu_part_style", "STR_MENU_PART_STYLE"); @@ -190,30 +190,30 @@ static void select_language(const char *lang) gtk_window_set_title(GTK_WINDOW(g_partCfgWindow), vtoy_json_get_string_ex(node->pstChild, "STR_MENU_PART_CFG")); - /* - * refresh screen + /* + * refresh screen */ - + gtk_widget_hide(g_topWindow); gtk_widget_show(g_topWindow); } -void on_secure_boot_toggled(GtkMenuItem *menuItem, gpointer data) +void on_secure_boot_toggled(GtkMenuItem *menuItem, gpointer data) { g_secure_boot_support = 1 - g_secure_boot_support; if (g_secure_boot_support) { - gtk_widget_show((GtkWidget *)g_image_secure_local); + gtk_widget_show((GtkWidget *)g_image_secure_local); } else { - gtk_widget_hide((GtkWidget *)g_image_secure_local); + gtk_widget_hide((GtkWidget *)g_image_secure_local); } } -void on_devlist_changed(GtkWidget *widget, gpointer data) +void on_devlist_changed(GtkWidget *widget, gpointer data) { int active; ventoy_disk *cur = NULL; @@ -270,9 +270,9 @@ void on_devlist_changed(GtkWidget *widget, gpointer data) } -void on_language_toggled(GtkMenuItem *menuItem, gpointer data) +void on_language_toggled(GtkMenuItem *menuItem, gpointer data) { - const char *cur_lang = NULL; + const char *cur_lang = NULL; if (g_languages_toggled_proc == 0) { @@ -287,10 +287,10 @@ void on_language_toggled(GtkMenuItem *menuItem, gpointer data) } } -void on_part_style_toggled(GtkMenuItem *menuItem, gpointer data) +void on_part_style_toggled(GtkMenuItem *menuItem, gpointer data) { int style; - + style = ventoy_code_get_cur_part_style(); ventoy_code_set_cur_part_style(1 - style); @@ -304,7 +304,7 @@ static ventoy_disk *select_active_dev(const char *select, int *activeid) ventoy_disk *cur = NULL; alldev = ventoy_code_get_cur_show_all(); - + /* find the match one */ if (select) { @@ -315,7 +315,7 @@ static ventoy_disk *select_active_dev(const char *select, int *activeid) { continue; } - + if (strcmp(cur->disk_name, select) == 0) { *activeid = i; @@ -332,7 +332,7 @@ static ventoy_disk *select_active_dev(const char *select, int *activeid) { continue; } - + if (cur->vtoydata.ventoy_valid) { *activeid = i; @@ -348,7 +348,7 @@ static ventoy_disk *select_active_dev(const char *select, int *activeid) { continue; } - + if (cur->type == VTOY_DEVICE_USB) { *activeid = i; @@ -364,11 +364,11 @@ static ventoy_disk *select_active_dev(const char *select, int *activeid) { continue; } - + *activeid = i; return cur; } - + return NULL; } @@ -386,7 +386,7 @@ static void fill_dev_list(const char *select) g_dev_changed_proc = 0; alldev = ventoy_code_get_cur_show_all(); - + vlog("fill_dev_list total disk: %d showall:%d\n", g_disk_num, alldev); /* gtk_combo_box_text_remove_all */ @@ -411,7 +411,7 @@ static void fill_dev_list(const char *select) if (active) { vlog("combox count:%d, active:%s id:%d\n", count, active->disk_name, activeid); - gtk_combo_box_set_active((GtkComboBox *)g_dev_combobox, activeid); + gtk_combo_box_set_active((GtkComboBox *)g_dev_combobox, activeid); gtk_widget_set_sensitive(GTK_WIDGET(g_install_button), TRUE); gtk_widget_set_sensitive(GTK_WIDGET(g_update_button), active->vtoydata.ventoy_valid); } @@ -427,21 +427,21 @@ static void fill_dev_list(const char *select) } -void on_show_all_toggled(GtkMenuItem *menuItem, gpointer data) +void on_show_all_toggled(GtkMenuItem *menuItem, gpointer data) { int show_all = ventoy_code_get_cur_show_all(); - + ventoy_code_set_cur_show_all(1 - show_all); fill_dev_list(NULL); } -void on_button_refresh_clicked(GtkWidget *widget, gpointer data) +void on_button_refresh_clicked(GtkWidget *widget, gpointer data) { if (g_thread_run || ventoy_code_is_busy()) { msgbox(GTK_MESSAGE_INFO, GTK_BUTTONS_OK, "STR_WAIT_PROCESS"); return; - } + } ventoy_code_refresh_device(); fill_dev_list(NULL); @@ -455,7 +455,7 @@ static void set_progress_bar_percent(int percent) gtk_progress_bar_set_fraction(g_progress_bar, percent * 1.0 / 100); vlog("set percent %d\n", percent); - + text = language_string("STR_STATUS"); if (percent == 0) { @@ -473,13 +473,13 @@ static void set_progress_bar_percent(int percent) } } -void on_clear_ventoy(GtkMenuItem *menuItem, gpointer data) +void on_clear_ventoy(GtkMenuItem *menuItem, gpointer data) { int ret; int active; char buf[1024]; char out[256]; - char disk_name[32]; + char disk_name[32]; ventoy_disk *cur = NULL; if (g_thread_run || ventoy_code_is_busy()) @@ -505,8 +505,8 @@ void on_clear_ventoy(GtkMenuItem *menuItem, gpointer data) return; } - gtk_widget_set_sensitive (GTK_WIDGET(g_refresh_button), FALSE); - gtk_widget_set_sensitive (GTK_WIDGET(g_install_button), FALSE); + gtk_widget_set_sensitive (GTK_WIDGET(g_refresh_button), FALSE); + gtk_widget_set_sensitive (GTK_WIDGET(g_install_button), FALSE); gtk_widget_set_sensitive (GTK_WIDGET(g_update_button), FALSE); g_thread_run = TRUE; @@ -540,8 +540,8 @@ void on_clear_ventoy(GtkMenuItem *menuItem, gpointer data) } set_progress_bar_percent(0); - gtk_widget_set_sensitive(GTK_WIDGET(g_refresh_button), TRUE); - gtk_widget_set_sensitive(GTK_WIDGET(g_install_button), TRUE); + gtk_widget_set_sensitive(GTK_WIDGET(g_refresh_button), TRUE); + gtk_widget_set_sensitive(GTK_WIDGET(g_install_button), TRUE); gtk_widget_set_sensitive(GTK_WIDGET(g_update_button), TRUE); fill_dev_list(disk_name); @@ -557,7 +557,7 @@ static int install_proc(ventoy_disk *cur) char buf[1024]; char dec[64]; char out[256]; - char disk_name[32]; + char disk_name[32]; long long space; vlog("install_thread ...\n"); @@ -595,7 +595,7 @@ static int install_proc(ventoy_disk *cur) VTOY_JSON_FMT_UINT("align_4kb", g_align_part_with_4k); VTOY_JSON_FMT_OBJ_END(); VTOY_JSON_FMT_END(pos); - + out[0] = 0; ventoy_func_handler(buf, out, sizeof(out)); vlog("func handler install <%s>\n", out); @@ -624,13 +624,13 @@ static int install_proc(ventoy_disk *cur) msgbox(GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, "STR_INSTALL_FAILED"); } else - { + { msgbox(GTK_MESSAGE_INFO, GTK_BUTTONS_OK, "STR_INSTALL_SUCCESS"); } set_progress_bar_percent(0); - gtk_widget_set_sensitive(GTK_WIDGET(g_refresh_button), TRUE); - gtk_widget_set_sensitive(GTK_WIDGET(g_install_button), TRUE); + gtk_widget_set_sensitive(GTK_WIDGET(g_refresh_button), TRUE); + gtk_widget_set_sensitive(GTK_WIDGET(g_install_button), TRUE); gtk_widget_set_sensitive(GTK_WIDGET(g_update_button), TRUE); fill_dev_list(disk_name); @@ -639,7 +639,7 @@ static int install_proc(ventoy_disk *cur) return 0; } -void on_button_install_clicked(GtkWidget *widget, gpointer data) +void on_button_install_clicked(GtkWidget *widget, gpointer data) { int active; long long size; @@ -704,10 +704,10 @@ void on_button_install_clicked(GtkWidget *widget, gpointer data) return; } - gtk_widget_set_sensitive (GTK_WIDGET(g_refresh_button), FALSE); - gtk_widget_set_sensitive (GTK_WIDGET(g_install_button), FALSE); + gtk_widget_set_sensitive (GTK_WIDGET(g_refresh_button), FALSE); + gtk_widget_set_sensitive (GTK_WIDGET(g_install_button), FALSE); gtk_widget_set_sensitive (GTK_WIDGET(g_update_button), FALSE); - + g_thread_run = TRUE; install_proc(cur); @@ -720,10 +720,10 @@ static int update_proc(ventoy_disk *cur) int percent = 0; char buf[1024]; char out[256]; - char disk_name[32]; + char disk_name[32]; g_snprintf(disk_name, sizeof(disk_name), "%s", cur->disk_name); - g_snprintf(buf, sizeof(buf), "{\"method\":\"update\",\"disk\":\"%s\",\"secure_boot\":%d}", + g_snprintf(buf, sizeof(buf), "{\"method\":\"update\",\"disk\":\"%s\",\"secure_boot\":%d}", disk_name, g_secure_boot_support); out[0] = 0; @@ -754,13 +754,13 @@ static int update_proc(ventoy_disk *cur) msgbox(GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, "STR_UPDATE_FAILED"); } else - { + { msgbox(GTK_MESSAGE_INFO, GTK_BUTTONS_OK, "STR_UPDATE_SUCCESS"); } set_progress_bar_percent(0); - gtk_widget_set_sensitive(GTK_WIDGET(g_refresh_button), TRUE); - gtk_widget_set_sensitive(GTK_WIDGET(g_install_button), TRUE); + gtk_widget_set_sensitive(GTK_WIDGET(g_refresh_button), TRUE); + gtk_widget_set_sensitive(GTK_WIDGET(g_install_button), TRUE); gtk_widget_set_sensitive(GTK_WIDGET(g_update_button), TRUE); fill_dev_list(disk_name); @@ -770,7 +770,7 @@ static int update_proc(ventoy_disk *cur) } -void on_button_update_clicked(GtkWidget *widget, gpointer data) +void on_button_update_clicked(GtkWidget *widget, gpointer data) { int active; ventoy_disk *cur = NULL; @@ -787,7 +787,7 @@ void on_button_update_clicked(GtkWidget *widget, gpointer data) vlog("invalid active combox id %d\n", active); return; } - cur = g_disk_list + active; + cur = g_disk_list + active; if (cur->vtoydata.ventoy_valid == 0) { @@ -800,12 +800,12 @@ void on_button_update_clicked(GtkWidget *widget, gpointer data) return; } - gtk_widget_set_sensitive (GTK_WIDGET(g_refresh_button), FALSE); - gtk_widget_set_sensitive (GTK_WIDGET(g_install_button), FALSE); + gtk_widget_set_sensitive (GTK_WIDGET(g_refresh_button), FALSE); + gtk_widget_set_sensitive (GTK_WIDGET(g_install_button), FALSE); gtk_widget_set_sensitive (GTK_WIDGET(g_update_button), FALSE); - + g_thread_run = TRUE; - + update_proc(cur); } @@ -824,7 +824,7 @@ static gint lang_compare(gconstpointer a, gconstpointer b) } else { - return g_strcmp0(name1, name2); + return g_strcmp0(name1, name2); } } @@ -851,17 +851,17 @@ static int load_languages(void) pName = getenv("LANG"); if (pName && strncmp(pName, "zh_CN", 5) == 0) { - ventoy_code_set_cur_language("Chinese Simplified (简体中文)"); + ventoy_code_set_cur_language("Chinese Simplified (简体中文)"); } else { - ventoy_code_set_cur_language("English (English)"); + ventoy_code_set_cur_language("English (English)"); } pCurLang = ventoy_code_get_cur_language(); } vlog("current language <%s>\n", pCurLang); - + ventoy_read_file_to_buf("./tool/languages.json", 1, (void **)&pBuf, &size); json = vtoy_json_create(); @@ -904,7 +904,7 @@ static int load_languages(void) pName = (char *)(pNameNode->data); pItem = (GtkRadioMenuItem *)gtk_radio_menu_item_new_with_label(pGroup, pName); pGroup = gtk_radio_menu_item_get_group(pItem); - + if (strcmp(pCurLang, pName) == 0) { gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(pItem), TRUE); @@ -914,17 +914,17 @@ static int load_languages(void) gtk_widget_show((GtkWidget *)pItem); gtk_menu_shell_append(GTK_MENU_SHELL(g_lang_menu), (GtkWidget *)pItem); } - + g_list_free(pNameList); free(pBuf); select_language(pCurLang); g_languages_toggled_proc = 1; - + return 0; } -void on_part_cfg_ok(GtkWidget *widget, gpointer data) +void on_part_cfg_ok(GtkWidget *widget, gpointer data) { const char *pos = NULL; const char *input = NULL; @@ -952,8 +952,8 @@ void on_part_cfg_ok(GtkWidget *widget, gpointer data) g_preserve_space_unit = gtk_combo_box_get_active((GtkComboBox *)g_part_space_unit_combox); g_preserve_space_number = (int)strtol(input, NULL, 10); - g_snprintf(device, sizeof(device), "%s [ -%d%s ]", - language_string("STR_DEVICE"), g_preserve_space_number, + g_snprintf(device, sizeof(device), "%s [ -%d%s ]", + language_string("STR_DEVICE"), g_preserve_space_number, g_preserve_space_unit ? "GB" : "MB"); gtk_label_set_text(g_device_title, device); } @@ -967,18 +967,18 @@ void on_part_cfg_ok(GtkWidget *widget, gpointer data) gtk_widget_hide(g_partCfgWindow); } -void on_part_cfg_cancel(GtkWidget *widget, gpointer data) +void on_part_cfg_cancel(GtkWidget *widget, gpointer data) { gtk_widget_hide(g_partCfgWindow); } -int on_part_cfg_close(GtkWidget *widget, gpointer data) +int on_part_cfg_close(GtkWidget *widget, gpointer data) { gtk_widget_hide(g_partCfgWindow); return TRUE; } -void on_part_config(GtkMenuItem *menuItem, gpointer data) +void on_part_config(GtkMenuItem *menuItem, gpointer data) { char value[64]; @@ -997,7 +997,7 @@ void on_part_config(GtkMenuItem *menuItem, gpointer data) gtk_widget_show_all(g_partCfgWindow); } -void on_reserve_space_toggled(GtkMenuItem *menuItem, gpointer data) +void on_reserve_space_toggled(GtkMenuItem *menuItem, gpointer data) { gboolean checked = gtk_toggle_button_get_active(g_part_preserve_checkbox); @@ -1040,7 +1040,7 @@ void on_init_window(GtkBuilder *pBuilder) char version[512]; vlog("on_init_window ...\n"); - + g_pXmlBuilder = pBuilder; g_topWindow = BUILDER_ITEM(GtkWidget, "window"); g_partCfgWindow = BUILDER_ITEM(GtkWidget, "part_cfg_dlg"); @@ -1049,38 +1049,38 @@ void on_init_window(GtkBuilder *pBuilder) g_refresh_button = BUILDER_ITEM(GtkButton, "button_refresh"); g_install_button = BUILDER_ITEM(GtkButton, "button_install"); g_update_button = BUILDER_ITEM(GtkButton, "button_update"); - + g_lang_menu = BUILDER_ITEM(GtkMenu, "submenu_language"); g_menu_item_secure_boot = BUILDER_ITEM(GtkCheckMenuItem, "menu_item_secure"); g_menu_item_mbr = BUILDER_ITEM(GtkCheckMenuItem, "menu_item_mbr"); g_menu_item_gpt = BUILDER_ITEM(GtkCheckMenuItem, "menu_item_gpt"); g_menu_item_show_all = BUILDER_ITEM(GtkCheckMenuItem, "menu_item_show_all"); - + g_device_title = BUILDER_ITEM(GtkLabel, "label_device"); g_label_local_part_style = BUILDER_ITEM(GtkLabel, "label_local_part_style"); g_label_dev_part_style = BUILDER_ITEM(GtkLabel, "label_dev_part_style"); - + g_label_local_ver = BUILDER_ITEM(GtkLabel, "label_local_ver_value"); g_label_disk_ver = BUILDER_ITEM(GtkLabel, "label_dev_ver_value"); - + g_label_status = BUILDER_ITEM(GtkLabel, "label_status"); - + g_image_secure_local = BUILDER_ITEM(GtkImage, "image_secure_local"); g_image_secure_device = BUILDER_ITEM(GtkImage, "image_secure_dev"); - + g_part_preserve_checkbox = BUILDER_ITEM(GtkToggleButton, "space_check_btn"); g_part_align_checkbox = BUILDER_ITEM(GtkToggleButton, "space_align_btn"); g_part_reserve_space_value = BUILDER_ITEM(GtkEntry, "entry_reserve_space"); g_part_space_unit_combox = BUILDER_ITEM(GtkComboBoxText, "comboboxtext_unit"); - + g_progress_bar = BUILDER_ITEM(GtkProgressBar, "progressbar1"); init_part_cfg_window(pBuilder); /* for gtk2 */ - gtk_frame_set_shadow_type(BUILDER_ITEM(GtkFrame, "frame_dummy1"), GTK_SHADOW_NONE); - gtk_frame_set_shadow_type(BUILDER_ITEM(GtkFrame, "frame_dummy2"), GTK_SHADOW_NONE); + gtk_frame_set_shadow_type(BUILDER_ITEM(GtkFrame, "frame_dummy1"), GTK_SHADOW_NONE); + gtk_frame_set_shadow_type(BUILDER_ITEM(GtkFrame, "frame_dummy2"), GTK_SHADOW_NONE); /* join group */ pGroup = gtk_radio_menu_item_get_group((GtkRadioMenuItem *)g_menu_item_mbr); @@ -1098,15 +1098,15 @@ void on_init_window(GtkBuilder *pBuilder) load_languages(); SIGNAL("combobox_devlist", "changed", on_devlist_changed); - + SIGNAL("button_refresh", "clicked", on_button_refresh_clicked); SIGNAL("button_install", "clicked", on_button_install_clicked); SIGNAL("button_update", "clicked", on_button_update_clicked); - + SIGNAL("menu_item_secure", "toggled", on_secure_boot_toggled); SIGNAL("menu_item_mbr", "toggled", on_part_style_toggled); SIGNAL("menu_item_show_all", "toggled", on_show_all_toggled); - + SIGNAL("menu_item_part_cfg", "activate", on_part_config); SIGNAL("menu_item_clear", "activate", on_clear_ventoy); @@ -1124,7 +1124,7 @@ void on_init_window(GtkBuilder *pBuilder) return; } -int on_exit_window(GtkWidget *widget, gpointer data) +int on_exit_window(GtkWidget *widget, gpointer data) { vlog("on_exit_window ...\n"); diff --git a/LinuxGUI/Ventoy2Disk/GTK/ventoy_gtk.h b/LinuxGUI/Ventoy2Disk/GTK/ventoy_gtk.h index d3c5e5c7d8d..bcdebb23603 100644 --- a/LinuxGUI/Ventoy2Disk/GTK/ventoy_gtk.h +++ b/LinuxGUI/Ventoy2Disk/GTK/ventoy_gtk.h @@ -7,12 +7,12 @@ * 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 . * @@ -49,13 +49,13 @@ int msgbox(GtkMessageType type, GtkButtonsType buttons, const char *strid); #define LANG_LABEL_TEXT(id, str) \ gtk_label_set_text(BUILDER_ITEM(GtkLabel, id), vtoy_json_get_string_ex(node->pstChild, str)) - + #define LANG_BUTTON_TEXT(id, str) \ gtk_button_set_label(BUILDER_ITEM(GtkButton, id), vtoy_json_get_string_ex(node->pstChild, str)) #define LANG_MENU_ITEM_TEXT(id, str) \ gtk_menu_item_set_label(BUILDER_ITEM(GtkMenuItem, id), vtoy_json_get_string_ex(node->pstChild, str)) - + #define LANG_CHKBTN_TEXT(id, str) \ gtk_check_button_set_label(BUILDER_ITEM(GtkCheckButton, id), vtoy_json_get_string_ex(node->pstChild, str)) diff --git a/LinuxGUI/Ventoy2Disk/Include/Ventoy2Disk.h b/LinuxGUI/Ventoy2Disk/Include/Ventoy2Disk.h index 32f452cba5c..dd144385bf5 100644 --- a/LinuxGUI/Ventoy2Disk/Include/Ventoy2Disk.h +++ b/LinuxGUI/Ventoy2Disk/Include/Ventoy2Disk.h @@ -7,12 +7,12 @@ * 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 . * diff --git a/LinuxGUI/Ventoy2Disk/Lib/exfat/src/libexfat/cluster.c b/LinuxGUI/Ventoy2Disk/Lib/exfat/src/libexfat/cluster.c index 15cd9aa339d..f145205408c 100644 --- a/LinuxGUI/Ventoy2Disk/Lib/exfat/src/libexfat/cluster.c +++ b/LinuxGUI/Ventoy2Disk/Lib/exfat/src/libexfat/cluster.c @@ -104,7 +104,7 @@ cluster_t exfat_advance_cluster(const struct exfat* ef, { node->fptr_cluster = exfat_next_cluster(ef, node, node->fptr_cluster); if (CLUSTER_INVALID(*ef->sb, node->fptr_cluster)) - break; /* the caller should handle this and print appropriate + break; /* the caller should handle this and print appropriate error message */ } node->fptr_index = count; diff --git a/LinuxGUI/Ventoy2Disk/Lib/exfat/src/libexfat/io.c b/LinuxGUI/Ventoy2Disk/Lib/exfat/src/libexfat/io.c index 4dee53656ed..478f96b8095 100644 --- a/LinuxGUI/Ventoy2Disk/Lib/exfat/src/libexfat/io.c +++ b/LinuxGUI/Ventoy2Disk/Lib/exfat/src/libexfat/io.c @@ -289,7 +289,7 @@ int exfat_close(struct exfat_dev* dev) rc = -EIO; } } - + free(dev); return rc; } @@ -337,7 +337,7 @@ off_t exfat_seek(struct exfat_dev* dev, off_t offset, int whence) { return -1; } - + lseek(dev->fd, 512 * 2048 + offset, SEEK_SET); return offset; } @@ -358,7 +358,7 @@ off_t exfat_seek(struct exfat_dev* dev, off_t offset, int whence) else { exfat_error("Invalid seek whence %d", whence); - return lseek(dev->fd, offset, whence); + return lseek(dev->fd, offset, whence); } #endif } diff --git a/LinuxGUI/Ventoy2Disk/Lib/exfat/src/libexfat/platform.h b/LinuxGUI/Ventoy2Disk/Lib/exfat/src/libexfat/platform.h index 9ab3155d36b..4c69436648d 100644 --- a/LinuxGUI/Ventoy2Disk/Lib/exfat/src/libexfat/platform.h +++ b/LinuxGUI/Ventoy2Disk/Lib/exfat/src/libexfat/platform.h @@ -56,7 +56,7 @@ #define EXFAT_LITTLE_ENDIAN _LITTLE_ENDIAN #define EXFAT_BIG_ENDIAN _BIG_ENDIAN -#else +#else #error Unknown platform #endif diff --git a/LinuxGUI/Ventoy2Disk/Lib/exfat/src/mkfs/mkexfat_main.c b/LinuxGUI/Ventoy2Disk/Lib/exfat/src/mkfs/mkexfat_main.c index c65035fa6ac..9cd7aedfdda 100644 --- a/LinuxGUI/Ventoy2Disk/Lib/exfat/src/mkfs/mkexfat_main.c +++ b/LinuxGUI/Ventoy2Disk/Lib/exfat/src/mkfs/mkexfat_main.c @@ -236,9 +236,9 @@ int mkexfat_main(const char *devpath, int fd, uint64_t part_sector_count) } #endif /* #if 0 */ - /* + /* * DiskSize > 32GB Cluster Size use 128KB - * DiskSize < 32GB Cluster Size use 32KB + * DiskSize < 32GB Cluster Size use 32KB */ if ((part_sector_count / 2097152) > 32) { @@ -251,7 +251,7 @@ int mkexfat_main(const char *devpath, int fd, uint64_t part_sector_count) g_vtoy_exfat_disk_fd = fd; g_vtoy_exfat_part_size = part_sector_count * 512; - + dev = exfat_open(devpath, EXFAT_MODE_RW); if (dev == NULL) return 1; @@ -262,7 +262,7 @@ int mkexfat_main(const char *devpath, int fd, uint64_t part_sector_count) } if (exfat_close(dev) != 0) return 1; - + return 0; } diff --git a/LinuxGUI/Ventoy2Disk/QT/build/Makefile b/LinuxGUI/Ventoy2Disk/QT/build/Makefile index 40d4a53c821..1453f4498ef 100644 --- a/LinuxGUI/Ventoy2Disk/QT/build/Makefile +++ b/LinuxGUI/Ventoy2Disk/QT/build/Makefile @@ -39,9 +39,9 @@ DISTNAME = Ventoy2Disk1.0.0 DISTDIR = /home/panda/590/build-Ventoy2Disk-Desktop_Qt_5_9_0_GCC_64bit-Release/.tmp/Ventoy2Disk1.0.0 LINK = g++ LFLAGS = -Wl,-O1 -Wl,-rpath,/home/panda/Qt5.9.0/5.9/gcc_64/lib -LIBS = $(SUBLIBS) -L/home/panda/Qt5.9.0/5.9/gcc_64/lib -lQt5Widgets -lQt5Gui -lQt5Core -lGL -lpthread +LIBS = $(SUBLIBS) -L/home/panda/Qt5.9.0/5.9/gcc_64/lib -lQt5Widgets -lQt5Gui -lQt5Core -lGL -lpthread AR = ar cqs -RANLIB = +RANLIB = SED = sed STRIP = strip @@ -384,14 +384,14 @@ DIST = ../Ventoy2Disk/Lib/fat_io_lib/API.txt \ ../Ventoy2Disk/partcfgdialog.cpp \ ../Ventoy2Disk/ventoy2diskwindow.cpp QMAKE_TARGET = Ventoy2Disk -DESTDIR = +DESTDIR = TARGET = Ventoy2Disk first: all ####### Build rules -$(TARGET): ui_partcfgdialog.h ui_ventoy2diskwindow.h $(OBJECTS) +$(TARGET): ui_partcfgdialog.h ui_ventoy2diskwindow.h $(OBJECTS) $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS) Makefile: ../Ventoy2Disk/Ventoy2Disk.pro ../../Qt5.9.0/5.9/gcc_64/mkspecs/linux-g++/qmake.conf ../../Qt5.9.0/5.9/gcc_64/mkspecs/features/spec_pre.prf \ @@ -751,13 +751,13 @@ distdir: FORCE $(COPY_FILE) --parents ../Ventoy2Disk/partcfgdialog.ui ../Ventoy2Disk/ventoy2diskwindow.ui $(DISTDIR)/ -clean: compiler_clean +clean: compiler_clean -$(DEL_FILE) $(OBJECTS) -$(DEL_FILE) *~ core *.core -distclean: clean - -$(DEL_FILE) $(TARGET) +distclean: clean + -$(DEL_FILE) $(TARGET) -$(DEL_FILE) .qmake.stash -$(DEL_FILE) Makefile @@ -1039,11 +1039,11 @@ compiler_yacc_impl_make_all: compiler_yacc_impl_clean: compiler_lex_make_all: compiler_lex_clean: -compiler_clean: compiler_moc_predefs_clean compiler_moc_header_clean compiler_uic_clean +compiler_clean: compiler_moc_predefs_clean compiler_moc_header_clean compiler_uic_clean ####### Compile -ventoy_crc32.o: ../Ventoy2Disk/Core/ventoy_crc32.c +ventoy_crc32.o: ../Ventoy2Disk/Core/ventoy_crc32.c $(CC) -c $(CFLAGS) $(INCPATH) -o ventoy_crc32.o ../Ventoy2Disk/Core/ventoy_crc32.c ventoy_disk.o: ../Ventoy2Disk/Core/ventoy_disk.c ../../Ventoy2Disk/Core/ventoy_define.h \ @@ -1065,7 +1065,7 @@ ventoy_json.o: ../Ventoy2Disk/Core/ventoy_json.c ../../Ventoy2Disk/Core/ventoy_d ventoy_log.o: ../Ventoy2Disk/Core/ventoy_log.c ../../Ventoy2Disk/Core/ventoy_define.h $(CC) -c $(CFLAGS) $(INCPATH) -o ventoy_log.o ../Ventoy2Disk/Core/ventoy_log.c -ventoy_md5.o: ../Ventoy2Disk/Core/ventoy_md5.c +ventoy_md5.o: ../Ventoy2Disk/Core/ventoy_md5.c $(CC) -c $(CFLAGS) $(INCPATH) -o ventoy_md5.o ../Ventoy2Disk/Core/ventoy_md5.c ventoy_util.o: ../Ventoy2Disk/Core/ventoy_util.c ../../Ventoy2Disk/Core/ventoy_define.h \ @@ -1315,10 +1315,10 @@ decompress_unxz.o: ../Ventoy2Disk/Lib/xz-embedded/linux/lib/decompress_unxz.c .. ../Ventoy2Disk/Lib/xz-embedded/linux/lib/xz/xz_dec_bcj.c $(CC) -c $(CFLAGS) $(INCPATH) -o decompress_unxz.o ../Ventoy2Disk/Lib/xz-embedded/linux/lib/decompress_unxz.c -refresh_icon_data.o: ../Ventoy2Disk/QT/refresh_icon_data.c +refresh_icon_data.o: ../Ventoy2Disk/QT/refresh_icon_data.c $(CC) -c $(CFLAGS) $(INCPATH) -o refresh_icon_data.o ../Ventoy2Disk/QT/refresh_icon_data.c -secure_icon_data.o: ../Ventoy2Disk/QT/secure_icon_data.c +secure_icon_data.o: ../Ventoy2Disk/QT/secure_icon_data.c $(CC) -c $(CFLAGS) $(INCPATH) -o secure_icon_data.o ../Ventoy2Disk/QT/secure_icon_data.c ventoy_qt_stub.o: ../Ventoy2Disk/QT/ventoy_qt_stub.c ../../Ventoy2Disk/Core/ventoy_define.h \ @@ -1734,10 +1734,10 @@ ventoy2diskwindow.o: ../Ventoy2Disk/ventoy2diskwindow.cpp ../Ventoy2Disk/ventoy2 ../../Ventoy2Disk/QT/ventoy_qt.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ventoy2diskwindow.o ../Ventoy2Disk/ventoy2diskwindow.cpp -moc_partcfgdialog.o: moc_partcfgdialog.cpp +moc_partcfgdialog.o: moc_partcfgdialog.cpp $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_partcfgdialog.o moc_partcfgdialog.cpp -moc_ventoy2diskwindow.o: moc_ventoy2diskwindow.cpp +moc_ventoy2diskwindow.o: moc_ventoy2diskwindow.cpp $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_ventoy2diskwindow.o moc_ventoy2diskwindow.cpp ####### Install @@ -1749,7 +1749,7 @@ install_target: first FORCE uninstall_target: FORCE -$(DEL_FILE) $(INSTALL_ROOT)/opt/Ventoy2Disk/bin/$(QMAKE_TARGET) - -$(DEL_DIR) $(INSTALL_ROOT)/opt/Ventoy2Disk/bin/ + -$(DEL_DIR) $(INSTALL_ROOT)/opt/Ventoy2Disk/bin/ install: install_target FORCE diff --git a/LinuxGUI/Ventoy2Disk/QT/build/moc_predefs.h b/LinuxGUI/Ventoy2Disk/QT/build/moc_predefs.h index 868c52fd0dc..3d77ded966b 100644 --- a/LinuxGUI/Ventoy2Disk/QT/build/moc_predefs.h +++ b/LinuxGUI/Ventoy2Disk/QT/build/moc_predefs.h @@ -74,7 +74,7 @@ #define __SIZEOF_INT__ 4 #define __SIZEOF_POINTER__ 8 #define __GCC_ATOMIC_CHAR16_T_LOCK_FREE 2 -#define __USER_LABEL_PREFIX__ +#define __USER_LABEL_PREFIX__ #define __FLT64X_EPSILON__ 1.08420217248550443400745280086994171e-19F64x #define __STDC_HOSTED__ 1 #define __LDBL_HAS_INFINITY__ 1 @@ -165,7 +165,7 @@ #define __FLT64_MIN_10_EXP__ (-307) #define __FLT64X_DECIMAL_DIG__ 21 #define __DEC128_MIN__ 1E-6143DL -#define __REGISTER_PREFIX__ +#define __REGISTER_PREFIX__ #define __UINT16_MAX__ 0xffff #define __DBL_HAS_DENORM__ 1 #define __FLT32_MIN__ 1.17549435082228750796873653722224568e-38F32 diff --git a/LinuxGUI/Ventoy2Disk/QT/main.cpp b/LinuxGUI/Ventoy2Disk/QT/main.cpp index 60e6281ef6e..741e1fdf901 100644 --- a/LinuxGUI/Ventoy2Disk/QT/main.cpp +++ b/LinuxGUI/Ventoy2Disk/QT/main.cpp @@ -47,8 +47,8 @@ int main(int argc, char *argv[]) } else { - QDir::setCurrent(curdir); - } + QDir::setCurrent(curdir); + } } if (!QFileInfo::exists("./boot/boot.img")) @@ -111,7 +111,7 @@ int main(int argc, char *argv[]) ventoy_disk_exit(); ventoy_http_exit(); - + vlog("######## Ventoy2Disk QT %s exit ########\n", ventoy_get_local_version()); /* log exit must at the end */ diff --git a/LinuxGUI/Ventoy2Disk/QT/ventoy2diskwindow.cpp b/LinuxGUI/Ventoy2Disk/QT/ventoy2diskwindow.cpp index 3615e3b7bf2..6809cedd793 100644 --- a/LinuxGUI/Ventoy2Disk/QT/ventoy2diskwindow.cpp +++ b/LinuxGUI/Ventoy2Disk/QT/ventoy2diskwindow.cpp @@ -29,7 +29,7 @@ void MyQThread::install_run() char buf[1024]; char dec[64]; char out[256]; - char disk_name[32]; + char disk_name[32]; ventoy_disk *cur; vlog("install run %d ...\n", m_index); @@ -82,7 +82,7 @@ void MyQThread::update_run() int percent = 0; char buf[1024]; char out[256]; - char disk_name[32]; + char disk_name[32]; ventoy_disk *cur; vlog("install run %d ...\n", m_index); @@ -249,7 +249,7 @@ void Ventoy2DiskWindow::LoadLanguages() } else { - ventoy_code_set_cur_language("English (English)"); + ventoy_code_set_cur_language("English (English)"); } curlang = ventoy_code_get_cur_language(); } @@ -582,7 +582,7 @@ void Ventoy2DiskWindow::on_ButtonUpdate_clicked() lang_string("STR_INFO", title_info); if (m_thread->m_running || ventoy_code_is_busy()) - { + { lang_string("STR_WAIT_PROCESS", msg); QMessageBox::warning(NULL, title_warn, msg); return; @@ -613,7 +613,7 @@ void Ventoy2DiskWindow::on_ButtonUpdate_clicked() ui->ButtonRefresh->setEnabled(false); m_thread->m_type = THREAD_TYPE_UPDATE; - m_thread->m_index = index; + m_thread->m_index = index; m_thread->m_secureboot = ui->actionSecure_Boot_Support->isChecked(); m_thread->m_running = true; @@ -637,7 +637,7 @@ void Ventoy2DiskWindow::on_ButtonRefresh_clicked() } void Ventoy2DiskWindow::on_comboBoxDevice_currentIndexChanged(int index) -{ +{ char ver[512]; ventoy_disk *cur; diff --git a/LinuxGUI/Ventoy2Disk/QT/ventoy2diskwindow.h b/LinuxGUI/Ventoy2Disk/QT/ventoy2diskwindow.h index 4a3be008fa9..69a80caa88f 100644 --- a/LinuxGUI/Ventoy2Disk/QT/ventoy2diskwindow.h +++ b/LinuxGUI/Ventoy2Disk/QT/ventoy2diskwindow.h @@ -83,7 +83,7 @@ private slots: void on_ButtonRefresh_clicked(); - void on_comboBoxDevice_currentIndexChanged(int index); + void on_comboBoxDevice_currentIndexChanged(int index); void on_actionPartition_Configuration_triggered(); diff --git a/LinuxGUI/Ventoy2Disk/QT/ventoy_qt.h b/LinuxGUI/Ventoy2Disk/QT/ventoy_qt.h index 6179d8b2e0e..d6c64f56937 100644 --- a/LinuxGUI/Ventoy2Disk/QT/ventoy_qt.h +++ b/LinuxGUI/Ventoy2Disk/QT/ventoy_qt.h @@ -7,12 +7,12 @@ * 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 . * diff --git a/LinuxGUI/Ventoy2Disk/QT/ventoy_qt_stub.c b/LinuxGUI/Ventoy2Disk/QT/ventoy_qt_stub.c index cee209d22a6..dc450c411b6 100644 --- a/LinuxGUI/Ventoy2Disk/QT/ventoy_qt_stub.c +++ b/LinuxGUI/Ventoy2Disk/QT/ventoy_qt_stub.c @@ -7,12 +7,12 @@ * 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 . * @@ -43,7 +43,7 @@ mg_start(const struct mg_callbacks *callbacks, (void)callbacks; (void)user_data; (void)options; - + return NULL; } @@ -589,7 +589,7 @@ static unsigned char window_icon_hexData[] = { 0x6E, 0x2D, 0x69, 0x6D, 0x67, 0x2E, 0x65, 0x61, 0x73, 0x79, 0x69, 0x63, 0x6F, 0x6E, 0x2E, 0x63, 0x6E, 0x2F, 0x66, 0x69, 0x6C, 0x65, 0x73, 0x2F, 0x32, 0x2F, 0x32, 0x39, 0x31, 0x36, 0x35, 0x2E, 0x70, 0x6E, 0x67, 0xBF, 0x98, 0x5F, 0xE5, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4E, 0x44, 0xAE, - 0x42, 0x60, 0x82 + 0x42, 0x60, 0x82 }; void *get_window_icon_raw_data(int *len) diff --git a/LinuxGUI/Ventoy2Disk/Web/ventoy_http.c b/LinuxGUI/Ventoy2Disk/Web/ventoy_http.c index 88f0e953f14..07b8b57f09c 100644 --- a/LinuxGUI/Ventoy2Disk/Web/ventoy_http.c +++ b/LinuxGUI/Ventoy2Disk/Web/ventoy_http.c @@ -6,12 +6,12 @@ * 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 . * @@ -73,8 +73,8 @@ static int ventoy_load_mbr_template(void) fread(g_mbr_template, 1, 512, fp); fclose(fp); - - ventoy_gen_preudo_uuid(g_mbr_template + 0x180); + + ventoy_gen_preudo_uuid(g_mbr_template + 0x180); return 0; } @@ -114,7 +114,7 @@ static int ventoy_unxz_efipart_img(void) g_efi_part_offset = 0; g_efi_part_raw_img = buf; - + rc = unxz(xzbuf, xzlen, NULL, ventoy_disk_xz_flush, buf, &inlen, NULL); vdebug("ventoy_unxz_efipart_img len:%d rc:%d unxzlen:%u\n", inlen, rc, g_efi_part_offset); @@ -146,7 +146,7 @@ static int ventoy_unxz_stg1_img(void) return 1; } } - + rc = unxz(xzbuf, xzlen, NULL, NULL, buf, &inlen, NULL); vdebug("ventoy_unxz_stg1_img len:%d rc:%d\n", inlen, rc); @@ -168,7 +168,7 @@ static int ventoy_http_save_cfg(void) return 0; } - fprintf(fp, "[Ventoy]\nLanguage=%s\nPartStyle=%d\nShowAllDevice=%d\n", + fprintf(fp, "[Ventoy]\nLanguage=%s\nPartStyle=%d\nShowAllDevice=%d\n", g_cur_language, g_cur_part_style, g_cur_show_all); fclose(fp); @@ -202,7 +202,7 @@ static int ventoy_http_load_cfg(void) break; } } - + len = (int)strlen("Language="); if (strncmp(line, "Language=", len) == 0) { @@ -227,7 +227,7 @@ static int ventoy_json_result(struct mg_connection *conn, const char *err) { if (conn) { - mg_printf(conn, + mg_printf(conn, "HTTP/1.1 200 OK \r\n" "Content-Type: application/json\r\n" "Content-Length: %d\r\n" @@ -246,12 +246,12 @@ static int ventoy_json_buffer(struct mg_connection *conn, const char *json_buf, { if (conn) { - mg_printf(conn, + mg_printf(conn, "HTTP/1.1 200 OK \r\n" "Content-Type: application/json\r\n" "Content-Length: %d\r\n" "\r\n%s", - json_len, json_buf); + json_len, json_buf); } else { @@ -275,7 +275,7 @@ static int ventoy_api_sysinfo(struct mg_connection *conn, VTOY_JSON *json) int pos = 0; int buflen = 0; char buf[512]; - + (void)json; busy = (g_current_progress == PT_FINISH) ? 0 : 1; @@ -303,7 +303,7 @@ static int ventoy_api_get_percent(struct mg_connection *conn, VTOY_JSON *json) int buflen = 0; int percent = 0; char buf[128]; - + (void)json; percent = g_current_progress * 100 / PT_FINISH; @@ -325,7 +325,7 @@ static int ventoy_api_get_percent(struct mg_connection *conn, VTOY_JSON *json) static int ventoy_api_set_language(struct mg_connection *conn, VTOY_JSON *json) { const char *lang = NULL; - + lang = vtoy_json_get_string_ex(json, "language"); if (lang) { @@ -334,26 +334,26 @@ static int ventoy_api_set_language(struct mg_connection *conn, VTOY_JSON *json) } ventoy_json_result(conn, VTOY_JSON_SUCCESS_RET); - return 0; + return 0; } static int ventoy_api_set_partstyle(struct mg_connection *conn, VTOY_JSON *json) { int ret; int style = 0; - + ret = vtoy_json_get_int(json, "partstyle", &style); if (JSON_SUCCESS == ret) { if ((style == 0) || (style == 1)) { g_cur_part_style = style; - ventoy_http_save_cfg(); + ventoy_http_save_cfg(); } } ventoy_json_result(conn, VTOY_JSON_SUCCESS_RET); - return 0; + return 0; } static int ventoy_clean_disk(int fd, uint64_t size) @@ -362,7 +362,7 @@ static int ventoy_clean_disk(int fd, uint64_t size) ssize_t len; off_t offset; void *buf = NULL; - + vdebug("ventoy_clean_disk fd:%d size:%llu\n", fd, (_ull)size); zerolen = 64 * 1024; @@ -391,7 +391,7 @@ static int ventoy_write_legacy_grub(int fd, int partstyle) { ssize_t len; off_t offset; - + if (partstyle) { vlog("Write GPT stage1 ...\n"); @@ -413,7 +413,7 @@ static int ventoy_write_legacy_grub(int fd, int partstyle) vlog("Write MBR stage1 ...\n"); offset = lseek(fd, 512, SEEK_SET); len = write(fd, g_grub_stg1_raw_img, SIZE_1MB - 512); - + vlog("lseek offset:%llu(%u) writelen:%llu(%u)\n", (_ull)offset, 512, (_ull)len, SIZE_1MB - 512); if (SIZE_1MB - 512 != len) { @@ -461,7 +461,7 @@ static int VentoyProcSecureBoot(int SecureBoot) void *file = NULL; vlog("VentoyProcSecureBoot %d ...\n", SecureBoot); - + if (SecureBoot) { vlog("Secure boot is enabled ...\n"); @@ -506,7 +506,7 @@ static int VentoyProcSecureBoot(int SecureBoot) { fl_fwrite(filebuf, 1, size, file); } - + fl_fflush(file); fl_fclose(file); } @@ -539,7 +539,7 @@ static int VentoyProcSecureBoot(int SecureBoot) fl_remove("/EFI/BOOT/BOOTIA32.EFI"); fl_remove("/EFI/BOOT/grubia32.efi"); fl_remove("/EFI/BOOT/grubia32_real.efi"); - fl_remove("/EFI/BOOT/mmia32.efi"); + fl_remove("/EFI/BOOT/mmia32.efi"); file = fl_fopen("/EFI/BOOT/BOOTIA32.EFI", "wb"); vlog("Open bootia32 efi file %p\n", file); @@ -582,7 +582,7 @@ static int ventoy_check_efi_part_data(int fd, uint64_t offset) { return 0; } - + lseek(fd, offset, SEEK_SET); for (i = 0; i < 32; i++) { @@ -603,7 +603,7 @@ static int ventoy_write_efipart(int fd, uint64_t offset, uint32_t secureboot) { int i; ssize_t len; - + vlog("Formatting part2 EFI offset:%llu ...\n", (_ull)offset); lseek(fd, offset, SEEK_SET); @@ -613,15 +613,15 @@ static int ventoy_write_efipart(int fd, uint64_t offset, uint32_t secureboot) for (i = 0; i < 32; i++) { len = write(fd, g_efi_part_raw_img + i * SIZE_1MB, SIZE_1MB); - vlog("write disk writelen:%lld datalen:%d [ %s ]\n", + vlog("write disk writelen:%lld datalen:%d [ %s ]\n", (_ll)len, SIZE_1MB, (len == SIZE_1MB) ? "success" : "failed"); - + if (len != SIZE_1MB) { vlog("failed to format part2 EFI\n"); return 1; } - + g_current_progress = PT_WRITE_VENTOY_START + i / 4; } @@ -637,7 +637,7 @@ static int VentoyFillBackupGptHead(VTOY_GPT_INFO *pInfo, VTOY_GPT_HDR *pHead) LBA = pHead->EfiStartLBA; BackupLBA = pHead->EfiBackupLBA; - + pHead->EfiStartLBA = BackupLBA; pHead->EfiBackupLBA = LBA; pHead->PartTblStartLBA = BackupLBA + 1 - 33; @@ -653,7 +653,7 @@ static int ventoy_write_gpt_part_table(int fd, uint64_t disksize, VTOY_GPT_INFO ssize_t len; off_t offset; VTOY_GPT_HDR BackupHead; - + VentoyFillBackupGptHead(gpt, &BackupHead); offset = lseek(fd, disksize - 512, SEEK_SET); @@ -671,7 +671,7 @@ static int ventoy_write_gpt_part_table(int fd, uint64_t disksize, VTOY_GPT_INFO { return 1; } - + offset = lseek(fd, 0, SEEK_SET); len = write(fd, gpt, sizeof(VTOY_GPT_INFO)); vlog("write gpt part head off:%llu len:%llu\n", (_ull)offset, (_ull)len); @@ -679,7 +679,7 @@ static int ventoy_write_gpt_part_table(int fd, uint64_t disksize, VTOY_GPT_INFO { return 1; } - + return 0; } @@ -691,12 +691,12 @@ static int ventoy_mbr_need_update(ventoy_disk *disk, MBR_HEAD *mbr) partition_style = disk->vtoydata.partition_style; memcpy(mbr, &(disk->vtoydata.gptinfo.MBR), 512); - + VentoyGetLocalBootImg(&LocalMBR); memcpy(LocalMBR.BootCode + 0x180, mbr->BootCode + 0x180, 16); if (partition_style) { - LocalMBR.BootCode[92] = 0x22; + LocalMBR.BootCode[92] = 0x22; } if (memcmp(LocalMBR.BootCode, mbr->BootCode, 440)) @@ -754,7 +754,7 @@ static void * ventoy_update_thread(void *data) g_current_progress = PT_LOAD_CORE_IMG; ventoy_unxz_stg1_img(); - + g_current_progress = PT_LOAD_DISK_IMG; ventoy_unxz_efipart_img(); @@ -791,26 +791,26 @@ static void * ventoy_update_thread(void *data) vlog("No need to update MBR\n"); } - + if (disk->vtoydata.partition_style) { pstGPT = (VTOY_GPT_INFO *)malloc(sizeof(VTOY_GPT_INFO)); memset(pstGPT, 0, sizeof(VTOY_GPT_INFO)); - + offset = lseek(fd, 0, SEEK_SET); len = read(fd, pstGPT, sizeof(VTOY_GPT_INFO)); vlog("Read GPT table offset:%llu len:%llu ...\n", (_ull)offset, (_ull)len); if (pstGPT->PartTbl[1].Attr != 0x8000000000000000ULL) { - vlog("Update EFI part attr from 0x%016llx to 0x%016llx\n", + vlog("Update EFI part attr from 0x%016llx to 0x%016llx\n", pstGPT->PartTbl[1].Attr, 0x8000000000000000ULL); pstGPT->PartTbl[1].Attr = 0x8000000000000000ULL; pstGPT->Head.PartTblCrc = ventoy_crc32(pstGPT->PartTbl, sizeof(pstGPT->PartTbl)); pstGPT->Head.Crc = 0; - pstGPT->Head.Crc = ventoy_crc32(&(pstGPT->Head), pstGPT->Head.Length); + pstGPT->Head.Crc = ventoy_crc32(&(pstGPT->Head), pstGPT->Head.Length); ventoy_write_gpt_part_table(fd, disk->size_in_byte, pstGPT); } else @@ -819,7 +819,7 @@ static void * ventoy_update_thread(void *data) } free(pstGPT); } - + g_current_progress = PT_SYNC_DATA1; @@ -836,13 +836,13 @@ static void * ventoy_update_thread(void *data) err: g_cur_process_result = 1; - vtoy_safe_close_fd(fd); + vtoy_safe_close_fd(fd); end: g_current_progress = PT_FINISH; check_free(thread); - + return NULL; } @@ -884,10 +884,10 @@ static void * ventoy_install_thread(void *data) g_current_progress = PT_DEL_ALL_PART; ventoy_clean_disk(fd, disk->size_in_byte); - + g_current_progress = PT_LOAD_CORE_IMG; ventoy_unxz_stg1_img(); - + g_current_progress = PT_LOAD_DISK_IMG; ventoy_unxz_efipart_img(); @@ -909,7 +909,7 @@ static void * ventoy_install_thread(void *data) Part2StartSector = MBR.PartTbl[1].StartSectorId; } - vlog("Part1StartSector:%llu Part1SectorCount:%llu Part2StartSector:%llu\n", + vlog("Part1StartSector:%llu Part1SectorCount:%llu Part2StartSector:%llu\n", (_ull)Part1StartSector, (_ull)Part1SectorCount, (_ull)Part2StartSector); if (thread->partstyle != disk->partstyle) @@ -968,7 +968,7 @@ static void * ventoy_install_thread(void *data) } vtoy_safe_close_fd(fd); - + /* reopen for write part table */ g_current_progress = PT_WRITE_PART_TABLE; vlog("Writting Partition Table style:%d...\n", thread->partstyle); @@ -1008,14 +1008,14 @@ static void * ventoy_install_thread(void *data) err: g_cur_process_result = 1; - vtoy_safe_close_fd(fd); + vtoy_safe_close_fd(fd); end: g_current_progress = PT_FINISH; check_free(gpt); check_free(thread); - + return NULL; } @@ -1026,13 +1026,13 @@ static int ventoy_api_clean(struct mg_connection *conn, VTOY_JSON *json) ventoy_disk *disk = NULL; const char *diskname = NULL; char path[128]; - + if (g_current_progress != PT_FINISH) { ventoy_json_result(conn, VTOY_JSON_BUSY_RET); - return 0; + return 0; } - + diskname = vtoy_json_get_string_ex(json, "disk"); if (diskname == NULL) { @@ -1094,12 +1094,12 @@ static int ventoy_api_clean(struct mg_connection *conn, VTOY_JSON *json) } vdebug("start clean %s ...\n", disk->disk_model); - ventoy_clean_disk(fd, disk->size_in_byte); + ventoy_clean_disk(fd, disk->size_in_byte); vtoy_safe_close_fd(fd); - + ventoy_json_result(conn, VTOY_JSON_SUCCESS_RET); - return 0; + return 0; } static int ventoy_api_install(struct mg_connection *conn, VTOY_JSON *json) @@ -1116,13 +1116,13 @@ static int ventoy_api_install(struct mg_connection *conn, VTOY_JSON *json) const char *reserve_space = NULL; ventoy_thread_data *thread = NULL; char path[128]; - + if (g_current_progress != PT_FINISH) { ventoy_json_result(conn, VTOY_JSON_BUSY_RET); - return 0; + return 0; } - + diskname = vtoy_json_get_string_ex(json, "disk"); reserve_space = vtoy_json_get_string_ex(json, "reserve_space"); ret += vtoy_json_get_uint(json, "partstyle", &style); @@ -1221,7 +1221,7 @@ static int ventoy_api_install(struct mg_connection *conn, VTOY_JSON *json) ventoy_json_result(conn, VTOY_JSON_FAILED_RET); return 0; } - + g_current_progress = PT_START; g_cur_process_result = 0; scnprintf(g_cur_process_type, "%s", "install"); @@ -1233,11 +1233,11 @@ static int ventoy_api_install(struct mg_connection *conn, VTOY_JSON *json) thread->partstyle = style; thread->secure_boot = secure_boot; thread->reserveBytes = reserveBytes; - + mg_start_thread(ventoy_install_thread, thread); - + ventoy_json_result(conn, VTOY_JSON_SUCCESS_RET); - return 0; + return 0; } static int ventoy_api_update(struct mg_connection *conn, VTOY_JSON *json) @@ -1250,13 +1250,13 @@ static int ventoy_api_update(struct mg_connection *conn, VTOY_JSON *json) const char *diskname = NULL; ventoy_thread_data *thread = NULL; char path[128]; - + if (g_current_progress != PT_FINISH) { ventoy_json_result(conn, VTOY_JSON_BUSY_RET); - return 0; + return 0; } - + diskname = vtoy_json_get_string_ex(json, "disk"); ret += vtoy_json_get_uint(json, "secure_boot", &secure_boot); if (diskname == NULL || ret != JSON_SUCCESS) @@ -1300,8 +1300,8 @@ static int ventoy_api_update(struct mg_connection *conn, VTOY_JSON *json) vlog("===== ventoy update %s new_secureboot:%u =========\n", disk->disk_path, secure_boot); vlog("==========================================================\n"); - vlog("%s version:%s partstyle:%u oldsecureboot:%u reserve:%llu\n", - disk->disk_path, disk->vtoydata.ventoy_ver, + vlog("%s version:%s partstyle:%u oldsecureboot:%u reserve:%llu\n", + disk->disk_path, disk->vtoydata.ventoy_ver, disk->vtoydata.partition_style, disk->vtoydata.secure_boot_flag, (_ull)(disk->vtoydata.preserved_space) @@ -1341,7 +1341,7 @@ static int ventoy_api_update(struct mg_connection *conn, VTOY_JSON *json) ventoy_json_result(conn, VTOY_JSON_FAILED_RET); return 0; } - + g_current_progress = PT_START; g_cur_process_result = 0; scnprintf(g_cur_process_type, "%s", "update"); @@ -1350,11 +1350,11 @@ static int ventoy_api_update(struct mg_connection *conn, VTOY_JSON *json) thread->disk = disk; thread->diskfd = fd; thread->secure_boot = secure_boot; - + mg_start_thread(ventoy_update_thread, thread); - + ventoy_json_result(conn, VTOY_JSON_SUCCESS_RET); - return 0; + return 0; } @@ -1381,7 +1381,7 @@ static int ventoy_api_get_dev_list(struct mg_connection *conn, VTOY_JSON *json) uint32_t alldev = 0; char *buf = NULL; ventoy_disk *cur = NULL; - + rc = vtoy_json_get_uint(json, "alldev", &alldev); if (JSON_SUCCESS != rc) { @@ -1409,7 +1409,7 @@ static int ventoy_api_get_dev_list(struct mg_connection *conn, VTOY_JSON *json) { continue; } - + VTOY_JSON_FMT_OBJ_BEGIN(); VTOY_JSON_FMT_STRN("name", cur->disk_name); VTOY_JSON_FMT_STRN("model", cur->disk_model); @@ -1420,7 +1420,7 @@ static int ventoy_api_get_dev_list(struct mg_connection *conn, VTOY_JSON *json) VTOY_JSON_FMT_UINT("vtoy_partstyle", cur->vtoydata.partition_style); VTOY_JSON_FMT_OBJ_ENDEX(); } - + VTOY_JSON_FMT_ARY_END(); VTOY_JSON_FMT_OBJ_END(); VTOY_JSON_FMT_END(pos); @@ -1429,7 +1429,7 @@ static int ventoy_api_get_dev_list(struct mg_connection *conn, VTOY_JSON *json) return 0; } -static JSON_CB g_ventoy_json_cb[] = +static JSON_CB g_ventoy_json_cb[] = { { "sysinfo", ventoy_api_sysinfo }, { "sel_language", ventoy_api_set_language }, @@ -1520,8 +1520,8 @@ static int ventoy_request_handler(struct mg_connection *conn) char *post_data_buf = NULL; const struct mg_request_info *ri = NULL; char stack_buf[512]; - - ri = mg_get_request_info(conn); + + ri = mg_get_request_info(conn); if (strcmp(ri->uri, "/vtoy/json") == 0) { @@ -1535,7 +1535,7 @@ static int ventoy_request_handler(struct mg_connection *conn) post_data_buf = stack_buf; post_buf_len = sizeof(stack_buf); } - + post_data_len = mg_read(conn, post_data_buf, post_buf_len); post_data_buf[post_data_len] = 0; @@ -1570,7 +1570,7 @@ int ventoy_http_start(const char *ip, const char *port) uint8_t uuid[16]; char addr[128]; struct mg_callbacks callbacks; - const char *options[] = + const char *options[] = { "listening_ports", "24680", "document_root", "WebUI", @@ -1600,7 +1600,7 @@ int ventoy_http_stop(void) { if (g_ventoy_http_ctx) { - mg_stop(g_ventoy_http_ctx); + mg_stop(g_ventoy_http_ctx); } return 0; } @@ -1612,7 +1612,7 @@ int ventoy_http_init(void) ventoy_http_load_cfg(); ventoy_load_mbr_template(); - + return 0; } @@ -1621,7 +1621,7 @@ void ventoy_http_exit(void) pthread_mutex_destroy(&g_api_mutex); check_free(g_efi_part_raw_img); - g_efi_part_raw_img = NULL; + g_efi_part_raw_img = NULL; } @@ -1638,7 +1638,7 @@ int ventoy_code_get_cur_part_style(void) void ventoy_code_set_cur_part_style(int style) { pthread_mutex_lock(&g_api_mutex); - + g_cur_part_style = style; ventoy_http_save_cfg(); @@ -1653,7 +1653,7 @@ int ventoy_code_get_cur_show_all(void) void ventoy_code_set_cur_show_all(int show_all) { pthread_mutex_lock(&g_api_mutex); - + g_cur_show_all = show_all; ventoy_http_save_cfg(); @@ -1663,10 +1663,10 @@ void ventoy_code_set_cur_show_all(int show_all) void ventoy_code_set_cur_language(const char *lang) { pthread_mutex_lock(&g_api_mutex); - + scnprintf(g_cur_language, "%s", lang); ventoy_http_save_cfg(); - + pthread_mutex_unlock(&g_api_mutex); } diff --git a/LinuxGUI/Ventoy2Disk/Web/ventoy_http.h b/LinuxGUI/Ventoy2Disk/Web/ventoy_http.h index 8c12c02fc2d..81c272d12df 100644 --- a/LinuxGUI/Ventoy2Disk/Web/ventoy_http.h +++ b/LinuxGUI/Ventoy2Disk/Web/ventoy_http.h @@ -7,12 +7,12 @@ * 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 . * @@ -34,7 +34,7 @@ typedef enum PROGRESS_POINT PT_UNXZ_DISK_IMG_FINISH = PT_LOAD_DISK_IMG + 32, PT_FORMAT_PART1, //10 - + PT_FORMAT_PART2, PT_WRITE_VENTOY_START, @@ -42,13 +42,13 @@ typedef enum PROGRESS_POINT PT_WRITE_STG1_IMG,//45 PT_SYNC_DATA1, - + PT_CHECK_PART2, PT_CHECK_PART2_FINISH = PT_CHECK_PART2 + 8, PT_WRITE_PART_TABLE,//52 PT_SYNC_DATA2, - + PT_FINISH }PROGRESS_POINT; diff --git a/LinuxGUI/Ventoy2Disk/main_webui.c b/LinuxGUI/Ventoy2Disk/main_webui.c index 2b782cc5337..9c4de4e7323 100644 --- a/LinuxGUI/Ventoy2Disk/main_webui.c +++ b/LinuxGUI/Ventoy2Disk/main_webui.c @@ -25,7 +25,7 @@ void ventoy_signal_stop(int sig) { vlog("ventoy server exit due to signal ...\n"); printf("ventoy server exit ...\n"); - + ventoy_http_stop(); ventoy_http_exit(); ventoy_disk_exit(); @@ -50,7 +50,7 @@ int main(int argc, char **argv) { ip = argv[1]; } - + if (isdigit(argv[2][0])) { port = argv[2]; @@ -79,7 +79,7 @@ int main(int argc, char **argv) ventoy_disk_init(); ventoy_http_init(); - + rc = ventoy_http_start(ip, port); if (rc) { @@ -95,7 +95,7 @@ int main(int argc, char **argv) sleep(100); } } - + return 0; } diff --git a/LinuxGUI/Ventoy2Disk/ventoy_gui.c b/LinuxGUI/Ventoy2Disk/ventoy_gui.c index a0512187f29..4011b638f47 100644 --- a/LinuxGUI/Ventoy2Disk/ventoy_gui.c +++ b/LinuxGUI/Ventoy2Disk/ventoy_gui.c @@ -6,7 +6,7 @@ #include #include #include -#include +#include #include #include #include @@ -97,7 +97,7 @@ void ventoy_syslog(int level, const char *Fmt, ...) FILE *fp; (void)level; - + time(&stamp); localtime_r(&stamp, &ttm); @@ -119,7 +119,7 @@ void ventoy_syslog(int level, const char *Fmt, ...) fp = fopen(g_log_file, "a+"); if (fp) { - fprintf(fp, "[%04u/%02u/%02u %02u:%02u:%02u] %s", + fprintf(fp, "[%04u/%02u/%02u %02u:%02u:%02u] %s", ttm.tm_year + 1900, ttm.tm_mon, ttm.tm_mday, ttm.tm_hour, ttm.tm_min, ttm.tm_sec, buf); @@ -127,7 +127,7 @@ void ventoy_syslog(int level, const char *Fmt, ...) } #if 0 - printf("[%04u/%02u/%02u %02u:%02u:%02u] %s", + printf("[%04u/%02u/%02u %02u:%02u:%02u] %s", ttm.tm_year + 1900, ttm.tm_mon, ttm.tm_mday, ttm.tm_hour, ttm.tm_min, ttm.tm_sec, buf); @@ -137,14 +137,14 @@ void ventoy_syslog(int level, const char *Fmt, ...) static int is_gtk_env(void) { const char *env = NULL; - + env = getenv("GNOME_SETUP_DISPLAY"); if (env && env[0] == ':') { vlog("GNOME_SETUP_DISPLAY=%s\n", env); return 1; } - + env = getenv("DESKTOP_SESSION"); if (env && strcasecmp(env, "xfce") == 0) { @@ -181,7 +181,7 @@ static int detect_gtk_version(int libflag) { return 3; } - + if (gtk4 > 0 && (gtk2 == 0 && gtk3 == 0)) { return 4; @@ -224,7 +224,7 @@ static int detect_qt_version(int libflag) { return 5; } - + if (qt6 > 0 && (qt4 == 0 && qt5 == 0)) { return 6; @@ -275,7 +275,7 @@ int get_os_bit(int *bit) *bit = strstr(unameData.machine, "64") ? 64 : 32; vlog("uname -m <%s> %dbit\n", unameData.machine, *bit); - + return 0; } @@ -298,7 +298,7 @@ int read_file_1st_line(const char *file, char *buffer, int buflen) static int read_pid_cmdline(long pid, char *Buffer, int BufLen) { char path[256]; - + snprintf(path, sizeof(path), "/proc/%ld/cmdline", pid); return read_file_1st_line(path, Buffer, BufLen); } @@ -346,13 +346,13 @@ static void touch_new_file(char *filename) *pos = '/'; } } - + fp = fopen(filename, "w+"); if (fp) { fclose(fp); - } - } + } + } } static int find_exe_path(const char *exe, char *pathbuf, int buflen) @@ -387,7 +387,7 @@ static int find_exe_path(const char *exe, char *pathbuf, int buflen) } tmpptr = NULL; } - + free(newenv); return 0; } @@ -395,7 +395,7 @@ static int find_exe_path(const char *exe, char *pathbuf, int buflen) void dump_args(const char *prefix, char **argv) { int i = 0; - + vlog("=========%s ARGS BEGIN===========\n", prefix); while (argv[i]) { @@ -555,12 +555,12 @@ static int restart_main(int argc, char **argv, char *guiexe) { vlog("recover success, argc=%d evecve <%s>\n", j, guiexe); dump_args("EXECVE", newargv); - execve(guiexe, newargv, envs); + execve(guiexe, newargv, envs); } else { vlog("recover failed, argc=%d evecv <%s>\n", j, guiexe); - execv(guiexe, newargv); + execv(guiexe, newargv); } return 1; @@ -651,24 +651,24 @@ static int restart_by_pkexec(int argc, char **argv, const char *curpath, const c if (j < MAX_PARAS) { - newargv[j++] = create_environ_param(VTOY_ENV_STR, environ); + newargv[j++] = create_environ_param(VTOY_ENV_STR, environ); } if (j < MAX_PARAS) { - newargv[j++] = exepara; + newargv[j++] = exepara; } - + if (g_xdg_log && j + 1 < MAX_PARAS) { - newargv[j++] = "-l"; - newargv[j++] = g_log_file; + newargv[j++] = "-l"; + newargv[j++] = g_log_file; } - + if (g_xdg_ini && j + 1 < MAX_PARAS) { - newargv[j++] = "-i"; - newargv[j++] = g_ini_file; + newargv[j++] = "-i"; + newargv[j++] = g_ini_file; } dump_args("PKEXEC", newargv); @@ -688,7 +688,7 @@ static int ld_cache_lib_check(const char *lib, int *flag) return 0; } } - + if (((*flag) & LIB_FLAG_GTK2) == 0) { if (strncmp(lib, "libgtk-x11-2.0.so", 17) == 0) @@ -698,7 +698,7 @@ static int ld_cache_lib_check(const char *lib, int *flag) return 0; } } - + if (((*flag) & LIB_FLAG_GTK4) == 0) { if (strncmp(lib, "libgtk-4.so", 11) == 0) @@ -708,7 +708,7 @@ static int ld_cache_lib_check(const char *lib, int *flag) return 0; } } - + if (((*flag) & LIB_FLAG_QT4) == 0) { if (strncmp(lib, "libQt4", 6) == 0) @@ -718,7 +718,7 @@ static int ld_cache_lib_check(const char *lib, int *flag) return 0; } } - + if (((*flag) & LIB_FLAG_QT5) == 0) { if (strncmp(lib, "libQt5", 6) == 0) @@ -728,7 +728,7 @@ static int ld_cache_lib_check(const char *lib, int *flag) return 0; } } - + if (((*flag) & LIB_FLAG_QT6) == 0) { if (strncmp(lib, "libQt6", 6) == 0) @@ -738,7 +738,7 @@ static int ld_cache_lib_check(const char *lib, int *flag) return 0; } } - + if (((*flag) & LIB_FLAG_GLADE2) == 0) { if (strncmp(lib, "libglade-2", 10) == 0) @@ -765,7 +765,7 @@ static int parse_ld_cache(int *flag) struct cache_file_new *cache_new = NULL; *flag = 0; - + fd = open(LD_CACHE_FILE, O_RDONLY); if (fd < 0) { @@ -807,7 +807,7 @@ static int parse_ld_cache(int *flag) close(fd); return 1; } - + format = 1; /* This is where the strings start. */ cache_data = (const char *) cache_new; @@ -824,7 +824,7 @@ static int parse_ld_cache(int *flag) } offset = ALIGN_CACHE(sizeof (struct cache_file) + (cache->nlibs * sizeof (struct file_entry))); - + /* This is where the strings start. */ cache_data = (const char *) &cache->libs[cache->nlibs]; @@ -861,7 +861,7 @@ static int parse_ld_cache(int *flag) } vlog("ldconfig lib flags 0x%x\n", *flag); - vlog("lib flags GLADE2:[%s] GTK2:[%s] GTK3:[%s] GTK4:[%s] QT4:[%s] QT5:[%s] QT6:[%s]\n", + vlog("lib flags GLADE2:[%s] GTK2:[%s] GTK3:[%s] GTK4:[%s] QT4:[%s] QT5:[%s] QT6:[%s]\n", INT2STR_YN((*flag) & LIB_FLAG_GLADE2), INT2STR_YN((*flag) & LIB_FLAG_GTK2), INT2STR_YN((*flag) & LIB_FLAG_GTK3), INT2STR_YN((*flag) & LIB_FLAG_GTK4), INT2STR_YN((*flag) & LIB_FLAG_QT4), INT2STR_YN((*flag) & LIB_FLAG_QT5), @@ -882,13 +882,13 @@ static int gui_type_check(VTOY_JSON *pstNode) const char *condition = NULL; const char *expression = NULL; char line[1024]; - + arch = vtoy_json_get_string_ex(pstNode, "arch"); srctype = vtoy_json_get_string_ex(pstNode, "type"); srcname = vtoy_json_get_string_ex(pstNode, "name"); condition = vtoy_json_get_string_ex(pstNode, "condition"); expression = vtoy_json_get_string_ex(pstNode, "expression"); - + if (srctype == NULL || srcname == NULL || condition == NULL) { return 0; @@ -907,7 +907,7 @@ static int gui_type_check(VTOY_JSON *pstNode) { return 0; } - + if (strcmp(condition, "exist") == 0) { vlog("File %s exist\n", srcname); @@ -967,7 +967,7 @@ static int gui_type_check(VTOY_JSON *pstNode) return 0; } } - + return 0; } @@ -1023,7 +1023,7 @@ static int distro_check_gui_env(char *type, int len, int *pver) read_file_to_buf("./tool/distro_gui_type.json", 1, (void **)&pBuf, &size); pBuf[size] = 0; - + pstJson = vtoy_json_create(); vtoy_json_parse(pstJson, pBuf); @@ -1094,7 +1094,7 @@ static int detect_gui_exe_path(int argc, char **argv, const char *curpath, char else if (access("./ventoy_gui_type", F_OK) != -1) { vlog("Get GUI type from ventoy_gui_type file.\n"); - + line[0] = 0; read_file_1st_line("./ventoy_gui_type", line, sizeof(line)); if (strncmp(line, "gtk2", 4) == 0) @@ -1191,7 +1191,7 @@ static int detect_gui_exe_path(int argc, char **argv, const char *curpath, char vlog("This is %s%d X environment.\n", guitype, ver); vlog("exe = %s\n", pathbuf); - + if (access(pathbuf, F_OK) == -1) { vlog("%s is not exist.\n", pathbuf); @@ -1328,7 +1328,7 @@ int main(int argc, char **argv) touch_new_file(g_log_file); } } - + env = getenv("XDG_CONFIG_HOME"); if (env) { diff --git a/LinuxGUI/WebUI/static/bootstrap/fonts/glyphicons-halflings-regular.svg b/LinuxGUI/WebUI/static/bootstrap/fonts/glyphicons-halflings-regular.svg index 94fb5490a2e..f155876e1b9 100644 --- a/LinuxGUI/WebUI/static/bootstrap/fonts/glyphicons-halflings-regular.svg +++ b/LinuxGUI/WebUI/static/bootstrap/fonts/glyphicons-halflings-regular.svg @@ -285,4 +285,4 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/LinuxGUI/build.sh b/LinuxGUI/build.sh index f568a2db6e2..1274be86ee7 100644 --- a/LinuxGUI/build.sh +++ b/LinuxGUI/build.sh @@ -1,14 +1,14 @@ #!/bin/bash -build_func() { +build_func() { libsuffix=$2 toolDir=$3 - + XXFLAG='-std=gnu99 -D_FILE_OFFSET_BITS=64' XXLIB="" - - echo "CC=$1 libsuffix=$libsuffix toolDir=$toolDir" - + + echo "CC=$1 libsuffix=$libsuffix toolDir=$toolDir" + $1 $XXFLAG -c -Wall -Wextra -Wshadow -Wformat-security -Winit-self \ -Wmissing-prototypes -O2 -DLINUX \ -I./Ventoy2Disk/Lib/libhttp/include \ @@ -16,7 +16,7 @@ build_func() { -DUSE_STACK_SIZE=102400 -DNDEBUG -fPIC \ ./Ventoy2Disk/Lib/libhttp/include/civetweb.c \ -o ./civetweb.o - + $1 $XXFLAG -O2 -Wall -Wno-unused-function -DSTATIC=static -DINIT= \ -I./Ventoy2Disk \ -I./Ventoy2Disk/Core \ @@ -45,7 +45,7 @@ build_func() { -o V2D$libsuffix rm -f *.o - + if [ "$libsuffix" = "aa64" ]; then aarch64-linux-gnu-strip V2D$libsuffix elif [ "$libsuffix" = "m64e" ]; then @@ -53,7 +53,7 @@ build_func() { else strip V2D$libsuffix fi - + rm -f ../INSTALL/tool/$toolDir/V2DServer cp -a V2D$libsuffix ../INSTALL/tool/$toolDir/V2DServer } diff --git a/LinuxGUI/build_gtk.sh b/LinuxGUI/build_gtk.sh index cbcadbd4149..82e8732f5b9 100644 --- a/LinuxGUI/build_gtk.sh +++ b/LinuxGUI/build_gtk.sh @@ -1,9 +1,9 @@ #!/bin/bash -build_func() { +build_func() { libsuffix=$2 toolDir=$3 - gtkver=$4 + gtkver=$4 if [ "$libsuffix" = "aa64" ]; then EXD=./EXLIB/aarch64 @@ -25,12 +25,12 @@ build_func() { fi XXLIB="" fi - + XXFLAG="-std=gnu99 -D_FILE_OFFSET_BITS=64 $GTKFLAG $GLADE -Wall" - - - echo "CC=$1 libsuffix=$libsuffix toolDir=$toolDir $gtkver" - + + + echo "CC=$1 libsuffix=$libsuffix toolDir=$toolDir $gtkver" + $1 $XXFLAG -c -Wall -Wextra -Wshadow -Wformat-security -Winit-self \ -Wmissing-prototypes -O2 -DLINUX \ -I./Ventoy2Disk/Lib/libhttp/include \ @@ -38,7 +38,7 @@ build_func() { -DUSE_STACK_SIZE=102400 -DNDEBUG -fPIC \ ./Ventoy2Disk/Lib/libhttp/include/civetweb.c \ -o ./civetweb.o - + $1 -O2 -Wall -Wno-unused-function -DSTATIC=static -DINIT= \ -I./Ventoy2Disk \ -I./Ventoy2Disk/Core \ @@ -66,10 +66,10 @@ build_func() { $XXLIB \ -l pthread \ ./civetweb.o \ - -o Ventoy2Disk.${gtkver}_$libsuffix $XXFLAG + -o Ventoy2Disk.${gtkver}_$libsuffix $XXFLAG rm -f *.o - + if [ "$libsuffix" = "aa64" ]; then aarch64-linux-gnu-strip Ventoy2Disk.${gtkver}_$libsuffix elif [ "$libsuffix" = "m64e" ]; then @@ -77,10 +77,10 @@ build_func() { else strip Ventoy2Disk.${gtkver}_$libsuffix fi - + rm -f ../INSTALL/tool/$toolDir/Ventoy2Disk.${gtkver}_$libsuffix cp -a Ventoy2Disk.${gtkver}_$libsuffix ../INSTALL/tool/$toolDir/Ventoy2Disk.${gtkver} - + $1 -O2 -D_FILE_OFFSET_BITS=64 Ventoy2Disk/ventoy_gui.c Ventoy2Disk/Core/ventoy_json.c -I Ventoy2Disk/Core -DVTOY_GUI_ARCH="\"$toolDir\"" -o VentoyGUI.$toolDir cp -a VentoyGUI.$toolDir ../INSTALL/ } diff --git a/LinuxGUI/build_qt.sh b/LinuxGUI/build_qt.sh index df5fab579eb..bc2ff5399c8 100644 --- a/LinuxGUI/build_qt.sh +++ b/LinuxGUI/build_qt.sh @@ -8,7 +8,7 @@ force_copy() { compile_file() { name=$(basename $2) obj=${name%.*} - + echo "$1 ${obj}.o ..." $1 -O2 -Wall -std=gnu99 -Wno-unused-function -Wno-format-truncation -Wno-address-of-packed-member -DSTATIC=static -DINIT= -D_FILE_OFFSET_BITS=64 \ -I./Ventoy2Disk \ @@ -28,7 +28,7 @@ compile_file() { } compile_dir() { - dir=$1 + dir=$1 for i in $(ls $dir/*.c); do compile_file "$2" "$i" done @@ -51,33 +51,33 @@ compile_lib() { build_qt() { echo "$1 main.o ..." $1 -c $2 $3 -o main.o ./Ventoy2Disk/QT/main.cpp - + echo "$1 partcfgdialog.o ..." $1 -c $2 $3 -o partcfgdialog.o ./Ventoy2Disk/QT/partcfgdialog.cpp - + echo "$1 ventoy2diskwindow.o ..." $1 -c $2 $3 -o ventoy2diskwindow.o ./Ventoy2Disk/QT/ventoy2diskwindow.cpp - + echo "$1 moc_partcfgdialog.o ..." $1 -c $2 $3 -o moc_partcfgdialog.o ./Ventoy2Disk/QT/build/moc_partcfgdialog.cpp - + echo "$1 moc_ventoy2diskwindow.o ..." $1 -c $2 $3 -o moc_ventoy2diskwindow.o ./Ventoy2Disk/QT/build/moc_ventoy2diskwindow.cpp - + echo "$1 Ventoy2Disk.qt5_${6} ..." $1 $4 -o Ventoy2Disk.qt5_${6} *.o $5 - rm -f *.o + rm -f *.o } build_qt_app() { - + DEFINES="-DQT_CHECK_EUID -DQT_DEPRECATED_WARNINGS -DSTATIC=static -DINIT= -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB" CXXFLAGS="-pipe -O2 -std=gnu++11 -Wall -W -D_REENTRANT -fPIC $DEFINES -Wno-deprecated-declarations -Wno-deprecated-copy" INCPATH=" -I./Ventoy2Disk -I. -I./Ventoy2Disk/Core -I./Ventoy2Disk/Web -I./Ventoy2Disk/QT -I./Ventoy2Disk/QT/build -I./Ventoy2Disk/Include -I./Ventoy2Disk/Lib/libhttp/include -I./Ventoy2Disk/Lib/fat_io_lib/include -I./Ventoy2Disk/Lib/xz-embedded/linux/include -I./Ventoy2Disk/Lib/xz-embedded/linux/include/linux -I./Ventoy2Disk/Lib/xz-embedded/userspace -I./Ventoy2Disk/Lib/exfat/src/libexfat -I./Ventoy2Disk/Lib/fat_io_lib -I$QT_INC_PATH -I$QT_INC_PATH/QtWidgets -I$QT_INC_PATH/QtGui -I$QT_INC_PATH/QtCore -I. -I." SUBLIBS="./libVentoyQT_${2}.a" LIBS="$SUBLIBS $QT_LIB_PATH/libQt5Widgets.so $QT_LIB_PATH/libQt5Gui.so $QT_LIB_PATH/libQt5Core.so -lpthread" - + build_qt "$1" "$CXXFLAGS" "$INCPATH" "$LFLAGS" "$LIBS" "$3" } @@ -104,7 +104,7 @@ build_qt_x86_64() { QT_LIB_PATH="/opt/Qt5.9.0/5.9/gcc_64/lib" LFLAGS="-Wl,-O1 -Wl,-rpath-link,$QT_LIB_PATH -L$QT_LIB_PATH" build_qt_app "g++" "x86_64" "64" - + force_copy Ventoy2Disk.qt5_64 ../INSTALL/tool/x86_64/Ventoy2Disk.qt5 rm -f ./libVentoyQT_x86_64.a } @@ -117,7 +117,7 @@ build_qt_aarch64() { QT_LIB_PATH="./EXLIB/aarch64/usr/lib64" LFLAGS="-Wl,-O1 -Wl,-rpath-link,$QT_LIB_PATH -L$QT_LIB_PATH -Wl,-rpath-link,./EXLIB/aarch64/lib64 -L./EXLIB/aarch64/lib64" build_qt_app "aarch64-linux-gnu-g++" "aarch64" "aa64" - + force_copy Ventoy2Disk.qt5_aa64 ../INSTALL/tool/aarch64/Ventoy2Disk.qt5 rm -f ./libVentoyQT_aarch64.a } diff --git a/LiveCD/ISO/EFI/boot/grub.cfg b/LiveCD/ISO/EFI/boot/grub.cfg index 2d93e3c5e76..52da7279bbb 100644 --- a/LiveCD/ISO/EFI/boot/grub.cfg +++ b/LiveCD/ISO/EFI/boot/grub.cfg @@ -4,13 +4,13 @@ set default=LiveCD clear -menuentry 'Ventoy xxx LiveCD' --id=LiveCD { +menuentry 'Ventoy xxx LiveCD' --id=LiveCD { linux /EFI/boot/vmlinuz64 quiet loglevel=0 superuser rdinit=/ventoy/init.sh initrd /EFI/ventoy/ventoy.gz /EFI/boot/corepure64.gz /EFI/boot/modules64.gz newc:ventoy.tar.gz:/EFI/ventoy/ventoy-xxx-linux.tar.gz boot } -menuentry 'Ventoy xxx LiveCD (Debug Mode)' { +menuentry 'Ventoy xxx LiveCD (Debug Mode)' { linux /EFI/boot/vmlinuz64 loglevel=10 multivt superuser rdinit=/ventoy/init.sh initrd /EFI/ventoy/ventoy.gz /EFI/boot/corepure64.gz /EFI/boot/modules64.gz newc:ventoy.tar.gz:/EFI/ventoy/ventoy-xxx-linux.tar.gz boot diff --git a/LiveCD/VTOY/ventoy/ventoy.sh b/LiveCD/VTOY/ventoy/ventoy.sh index 50cf22f6e51..ec2c61e1b35 100644 --- a/LiveCD/VTOY/ventoy/ventoy.sh +++ b/LiveCD/VTOY/ventoy/ventoy.sh @@ -33,10 +33,10 @@ enum_disk() { } select_disk() { - + echo "" > /dev/console echo "" > /dev/console - + if [ -f /device.list ]; then lines=$(cat /device.list | wc -l) cat /device.list > /dev/console @@ -44,25 +44,25 @@ select_disk() { echo -e "\033[31m !!! NO device detected !!!\033[0m" > /dev/console lines=0 fi - + echo "" > /dev/console echo " Refresh device list Reboot Enter shell" > /dev/console echo "" > /dev/console - - while true; do - + + while true; do + if [ $lines -gt 0 ]; then read -p "Please select the disk to operator [1-$lines] " Answer else read -p "Please choose your operation [a-c] " Answer fi - + if [ "$Answer" = "shell" ]; then echo 8888; return elif [ "$Answer" = "c" ] || [ "$Answer" = "C" ]; then echo 8888; return fi - + if [ "$Answer" = "a" ] || [ "$Answer" = "A" ]; then echo 0; return elif [ "$Answer" = "b" ] || [ "$Answer" = "B" ]; then @@ -89,7 +89,7 @@ get_dev_ventoy_ver() { if ! [ -b /dev/${1}2 ]; then echo "NO"; return fi - + mount -t vfat -o ro /dev/${1}2 /ventoy/mnt >/dev/null 2>/dev/null if [ -e /ventoy/mnt/ventoy ] && [ -f /ventoy/mnt/grub/grub.cfg ]; then if grep -q 'set.*VENTOY_VERSION=' /ventoy/mnt/grub/grub.cfg; then @@ -97,52 +97,52 @@ get_dev_ventoy_ver() { else echo 'NO' fi - + umount /ventoy/mnt return fi - + echo "NO" } ventoy_configuration() { while true; do - + if [ -f /preserve.txt ]; then SPACE=$(cat /preserve.txt) else SPACE=0 fi - + if [ -f /secureboot.txt ]; then SECURE=$(cat /secureboot.txt) else SECURE=Disable fi - + if [ -f /partstyle.txt ]; then STYLE=$(cat /partstyle.txt) else STYLE=MBR fi - + echo "" echo -e " <1> Preserve space (only for install) \033[32m[${SPACE}MB]\033[0m" echo -e " <2> Secure boot support \033[32m[$SECURE]\033[0m" echo -e " <3> Partition style (only for install) \033[32m[$STYLE]\033[0m" echo " <0> Back to previous menu" echo "" - + while true; do read -p "Please choose your operation: " Answer if echo $Answer | grep -q "^[0-3]$"; then break fi done - + if [ "$Answer" = "0" ]; then break - elif [ "$Answer" = "1" ]; then + elif [ "$Answer" = "1" ]; then while true; do read -p "Please input the preserve space in MB: " Answer if echo $Answer | grep -q "^[0-9][0-9]*$"; then @@ -187,54 +187,54 @@ enum_disk while true; do sel=$(select_disk) - + if [ $sel -eq 8888 ]; then break elif [ $sel -eq 0 ]; then enum_disk continue fi - + DEV=$(sed -n "${sel}p" /device.list | awk '{print $2}') DevVtVer=$(get_dev_ventoy_ver $DEV) if [ "$DevVtVer" = "NO" ]; then - + while true; do echo "" echo " <1> Install Ventoy to $DEV" echo " <2> Set Configuration" echo " <0> Back to previous menu" echo "" - + while true; do read -p "Please choose your operation: " Answer if echo $Answer | grep -q "^[0-2]$"; then break; fi done - + if [ "$Answer" = "0" ]; then break elif [ "$Answer" = "2" ]; then ventoy_configuration else - + opt="" if [ -f /preserve.txt ]; then opt="$opt -r $(cat /preserve.txt)" fi - - if [ -f /secureboot.txt ] && grep -q "Enable" /secureboot.txt; then + + if [ -f /secureboot.txt ] && grep -q "Enable" /secureboot.txt; then opt="$opt -s" fi - - if [ -f /partstyle.txt ] && grep -q "GPT" /partstyle.txt; then + + if [ -f /partstyle.txt ] && grep -q "GPT" /partstyle.txt; then opt="$opt -g" fi - - info "Ventoy2Disk.sh $opt -i /dev/$DEV" + + info "Ventoy2Disk.sh $opt -i /dev/$DEV" sh Ventoy2Disk.sh $opt -i /dev/$DEV sync break @@ -242,7 +242,7 @@ while true; do done else info "Ventoy $DevVtVer detected in the device $DEV" - + while true; do echo "" echo " <1> Update Ventoy in $DEV from $DevVtVer ==> $VTVER" @@ -250,23 +250,23 @@ while true; do echo " <3> Set Configuration" echo " <0> Back to previous menu" echo "" - + while true; do read -p "Please choose your operation: " Answer if echo $Answer | grep -q "^[0-3]$"; then break; fi done - + if [ "$Answer" = "0" ]; then break elif [ "$Answer" = "1" ]; then opt="" - if [ -f /secureboot.txt ] && grep -q "Enable" /secureboot.txt; then + if [ -f /secureboot.txt ] && grep -q "Enable" /secureboot.txt; then opt="$opt -s" fi - - info "Ventoy2Disk.sh $opt -u /dev/$DEV" + + info "Ventoy2Disk.sh $opt -u /dev/$DEV" sh Ventoy2Disk.sh $opt -u /dev/$DEV sync break @@ -275,23 +275,23 @@ while true; do if [ -f /preserve.txt ]; then opt="$opt -r $(cat /preserve.txt)" fi - - if [ -f /secureboot.txt ] && grep -q "Enable" /secureboot.txt; then + + if [ -f /secureboot.txt ] && grep -q "Enable" /secureboot.txt; then opt="$opt -s" fi - - if [ -f /partstyle.txt ] && grep -q "GPT" /partstyle.txt; then + + if [ -f /partstyle.txt ] && grep -q "GPT" /partstyle.txt; then opt="$opt -g" fi - - info "Ventoy2Disk.sh $opt -I /dev/$DEV" + + info "Ventoy2Disk.sh $opt -I /dev/$DEV" sh Ventoy2Disk.sh $opt -I /dev/$DEV sync break - else + else ventoy_configuration - fi - done + fi + done fi done diff --git a/LiveCD/livecd.sh b/LiveCD/livecd.sh index 6ab9a4aa6fa..1f3d967521d 100644 --- a/LiveCD/livecd.sh +++ b/LiveCD/livecd.sh @@ -23,7 +23,7 @@ fi rm -rf ISO_TMP cp -a ISO ISO_TMP -cp -a VTOY VTOY_TMP +cp -a VTOY VTOY_TMP ls -la if ! [ -d ISO_TMP ]; then diff --git a/LiveCDGUI/ISO/EFI/boot/grub.cfg b/LiveCDGUI/ISO/EFI/boot/grub.cfg index 0dc4828738f..843ab6fbcfb 100644 --- a/LiveCDGUI/ISO/EFI/boot/grub.cfg +++ b/LiveCDGUI/ISO/EFI/boot/grub.cfg @@ -7,21 +7,21 @@ clear menuentry 'Ventoy xxx LiveCD GUI' --id=LiveCD { echo downloading kernel ... linux /EFI/boot/vmlinuz quiet first_run rdinit=/VTOY/init - + echo downloading initrd ... initrd /EFI/boot/initrd - + echo booting LiveCD ... boot } -menuentry 'Ventoy xxx LiveCD GUI (Debug Mode)' { +menuentry 'Ventoy xxx LiveCD GUI (Debug Mode)' { echo downloading kernel ... linux /EFI/boot/vmlinuz debug loglevel=7 first_run rdinit=/VTOY/init - + echo downloading initrd ... initrd /EFI/boot/initrd - + echo booting LiveCD ... boot } diff --git a/LiveCDGUI/VTOY/init b/LiveCDGUI/VTOY/init index afd457a9011..93a4ebbd47b 100644 --- a/LiveCDGUI/VTOY/init +++ b/LiveCDGUI/VTOY/init @@ -24,7 +24,7 @@ mkdir -p /memory/xino /memory/changes /memory/images /memory/copy2ram mount -nt aufs -o nowarn_perm,xino=/memory/xino/.aufs.xino,br:/memory/changes=rw aufs /union -#Draw background +#Draw background if [ -z "$quiet" ]; then echo "##################################################" echo "Starting Ventoy Live GUI " @@ -41,10 +41,10 @@ else ln -s /opt/001/bin/kmod /bin/modprobe vga=`lspci | grep 0300: | head -n1 | cut -d: -f3-4 | sed s/:/d0000/g`; [ "$vga" ] && driver="$(grep -i $vga /lib/modules/`uname -r`/modules.alias 2>/dev/null | head -n1 | rev | cut -d" " -f1 | rev)" - + # Nvidia quirk: [ "$driver" ] || { lspci | grep 0300: | head -n1 | cut -d: -f3 | grep -q "10de" && driver=nouveau; } - + # VirtualBox quirk: [ "$driver" = vboxvideo ] || modprobe $driver 2>/dev/null test -e /dev/fb0 || { cp /opt/001/sbin/v86d /sbin; modprobe uvesafb mode_option=1024x768-32; } @@ -69,9 +69,9 @@ done -#clean +#clean if [ -n "$quiet" ]; then - while [ "`pidof fbv`" ]; do + while [ "`pidof fbv`" ]; do usleep 500000 done umount /opt/000 /opt/001 2>/dev/null diff --git a/LiveCDGUI/initrd.sh b/LiveCDGUI/initrd.sh index 5cb23e23f50..101d0f224b1 100644 --- a/LiveCDGUI/initrd.sh +++ b/LiveCDGUI/initrd.sh @@ -34,7 +34,7 @@ mkdir ventoy tar -xf $VENTOY_PATH/INSTALL/ventoy-${version}-linux.tar.gz -C . mv ./ventoy-${version} ./ventoy/ventoy chmod -R 777 ./ventoy -mksquashfs ventoy ventoy.xzm -comp xz +mksquashfs ventoy ventoy.xzm -comp xz rm -rf ./ventoy diff --git a/Plugson/build.sh b/Plugson/build.sh index 829f0fd3a8d..e9f2405b7d4 100644 --- a/Plugson/build.sh +++ b/Plugson/build.sh @@ -4,15 +4,15 @@ if [ "$1" = "sim" ]; then exopt="-DVENTOY_SIM" fi -build_func() { +build_func() { libsuffix=$2 toolDir=$3 - + XXFLAG='-std=gnu99 -D_FILE_OFFSET_BITS=64 -O2' XXLIB="" - - echo "CC=$1 libsuffix=$libsuffix toolDir=$toolDir" - + + echo "CC=$1 libsuffix=$libsuffix toolDir=$toolDir" + echo "CC civetweb.o" $1 $XXFLAG -c -Wall -Wextra -Wshadow -Wformat-security -Winit-self \ -Wmissing-prototypes -DLINUX \ @@ -57,7 +57,7 @@ build_func() { -o Plugson$libsuffix rm -f *.o - + if [ "$libsuffix" = "aa64" ]; then aarch64-linux-gnu-strip Plugson$libsuffix elif [ "$libsuffix" = "m64e" ]; then @@ -65,10 +65,10 @@ build_func() { else strip Plugson$libsuffix fi - + rm -f ../INSTALL/tool/$toolDir/Plugson cp -a Plugson$libsuffix ../INSTALL/tool/$toolDir/Plugson - + } build_func "gcc" '64' 'x86_64' diff --git a/Plugson/pack.sh b/Plugson/pack.sh index cc2eb589e7c..ad2f9dcc4dc 100644 --- a/Plugson/pack.sh +++ b/Plugson/pack.sh @@ -25,17 +25,17 @@ fi VV=$(grep -m1 '\?v=' ./www/index.html | sed 's/.*v=\([0-9][0-9]*\).*/\1/g') let VV++ echo V=$VV -sed "s/\?v=[0-9][0-9]*/?v=$VV/g" -i ./www/index.html +sed "s/\?v=[0-9][0-9]*/?v=$VV/g" -i ./www/index.html [ -f ./www/helplist ] && rm -f ./www/helplist -ls -1 ../INSTALL/grub/help/ | while read line; do +ls -1 ../INSTALL/grub/help/ | while read line; do echo -n ${line:0:5} >> ./www/helplist -done +done [ -f ./www/menulist ] && rm -f ./www/menulist -ls -1 ../INSTALL/grub/menu/ | while read line; do +ls -1 ../INSTALL/grub/menu/ | while read line; do echo -n ${line:0:5} >> ./www/menulist -done +done echo -n "$plugson_verion" > ./www/buildtime tar cf www.tar www diff --git a/Plugson/src/Core/ventoy_crc32.c b/Plugson/src/Core/ventoy_crc32.c index a281ea6a7ec..5e8a4b78302 100644 --- a/Plugson/src/Core/ventoy_crc32.c +++ b/Plugson/src/Core/ventoy_crc32.c @@ -7,12 +7,12 @@ * 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 . * @@ -294,7 +294,7 @@ uint32_t ventoy_crc32(void *Buffer, uint32_t Length) uint8_t *Ptr = Buffer; uint32_t Crc = 0xFFFFFFFF; - for (i = 0; i < Length; i++, Ptr++) + for (i = 0; i < Length; i++, Ptr++) { Crc = (Crc >> 8) ^ g_crc_table[(uint8_t) Crc ^ *Ptr]; } diff --git a/Plugson/src/Core/ventoy_define.h b/Plugson/src/Core/ventoy_define.h index 8163f8899cf..c6011aa4b06 100644 --- a/Plugson/src/Core/ventoy_define.h +++ b/Plugson/src/Core/ventoy_define.h @@ -7,12 +7,12 @@ * 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 . * diff --git a/Plugson/src/Core/ventoy_disk.c b/Plugson/src/Core/ventoy_disk.c index 2b81d019ab8..d2c14489847 100644 --- a/Plugson/src/Core/ventoy_disk.c +++ b/Plugson/src/Core/ventoy_disk.c @@ -6,12 +6,12 @@ * 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 . * diff --git a/Plugson/src/Core/ventoy_disk.h b/Plugson/src/Core/ventoy_disk.h index e3c449a24ed..55d77bce99a 100644 --- a/Plugson/src/Core/ventoy_disk.h +++ b/Plugson/src/Core/ventoy_disk.h @@ -7,12 +7,12 @@ * 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 . * @@ -24,7 +24,7 @@ typedef struct ventoy_disk { char devname[64]; - + int pathcase; char cur_fsname[64]; char cur_capacity[64]; @@ -32,7 +32,7 @@ typedef struct ventoy_disk char cur_ventoy_ver[64]; int cur_secureboot; int cur_part_style; - + }ventoy_disk; #if defined(_MSC_VER) || defined(WIN32) @@ -41,7 +41,7 @@ typedef struct ventoy_disk #else -typedef enum +typedef enum { VTOY_DEVICE_UNKNOWN = 0, VTOY_DEVICE_SCSI, @@ -66,7 +66,7 @@ typedef enum VTOY_DEVICE_NVME, VTOY_DEVICE_RAM, VTOY_DEVICE_PMEM, - + VTOY_DEVICE_END }ventoy_dev_type; diff --git a/Plugson/src/Core/ventoy_disk_linux.c b/Plugson/src/Core/ventoy_disk_linux.c index f4ec853ce26..faad94f3c2a 100644 --- a/Plugson/src/Core/ventoy_disk_linux.c +++ b/Plugson/src/Core/ventoy_disk_linux.c @@ -6,12 +6,12 @@ * 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 . * @@ -39,7 +39,7 @@ static int g_fatlib_media_fd = 0; static uint64_t g_fatlib_media_offset = 0; -static const char *g_ventoy_dev_type_str[VTOY_DEVICE_END] = +static const char *g_ventoy_dev_type_str[VTOY_DEVICE_END] = { "unknown", "scsi", "USB", "ide", "dac960", "cpqarray", "file", "ataraid", "i2o", @@ -82,7 +82,7 @@ static int ventoy_check_blk_major(int major, const char *type) { if (strncmp(pos + 1, type, len) == 0) { - valid = 1; + valid = 1; } break; } @@ -103,7 +103,7 @@ static int ventoy_get_disk_devnum(const char *name, int *major, int* minor) int rc; char *pos; char devnum[16] = {0}; - + rc = ventoy_get_sys_file_line(devnum, sizeof(devnum), "/sys/block/%s/dev", name); if (rc) { @@ -130,63 +130,63 @@ static ventoy_dev_type ventoy_get_dev_type(const char *name, int major, int mino memset(syspath, 0, sizeof(syspath)); memset(dstpath, 0, sizeof(dstpath)); - + scnprintf(syspath, sizeof(syspath), "/sys/block/%s", name); rc = readlink(syspath, dstpath, sizeof(dstpath) - 1); if (rc > 0 && strstr(dstpath, "/usb")) { return VTOY_DEVICE_USB; } - - if (SCSI_BLK_MAJOR(major) && (minor % 0x10 == 0)) + + if (SCSI_BLK_MAJOR(major) && (minor % 0x10 == 0)) { return VTOY_DEVICE_SCSI; } - else if (IDE_BLK_MAJOR(major) && (minor % 0x40 == 0)) + else if (IDE_BLK_MAJOR(major) && (minor % 0x40 == 0)) { return VTOY_DEVICE_IDE; } - else if (major == DAC960_MAJOR && (minor % 0x8 == 0)) + else if (major == DAC960_MAJOR && (minor % 0x8 == 0)) { return VTOY_DEVICE_DAC960; } - else if (major == ATARAID_MAJOR && (minor % 0x10 == 0)) + else if (major == ATARAID_MAJOR && (minor % 0x10 == 0)) { return VTOY_DEVICE_ATARAID; } - else if (major == AOE_MAJOR && (minor % 0x10 == 0)) + else if (major == AOE_MAJOR && (minor % 0x10 == 0)) { return VTOY_DEVICE_AOE; } - else if (major == DASD_MAJOR && (minor % 0x4 == 0)) + else if (major == DASD_MAJOR && (minor % 0x4 == 0)) { return VTOY_DEVICE_DASD; } - else if (major == VIODASD_MAJOR && (minor % 0x8 == 0)) + else if (major == VIODASD_MAJOR && (minor % 0x8 == 0)) { return VTOY_DEVICE_VIODASD; } - else if (SX8_BLK_MAJOR(major) && (minor % 0x20 == 0)) + else if (SX8_BLK_MAJOR(major) && (minor % 0x20 == 0)) { return VTOY_DEVICE_SX8; } - else if (I2O_BLK_MAJOR(major) && (minor % 0x10 == 0)) + else if (I2O_BLK_MAJOR(major) && (minor % 0x10 == 0)) { return VTOY_DEVICE_I2O; } - else if (CPQARRAY_BLK_MAJOR(major) && (minor % 0x10 == 0)) + else if (CPQARRAY_BLK_MAJOR(major) && (minor % 0x10 == 0)) { return VTOY_DEVICE_CPQARRAY; } - else if (UBD_MAJOR == major && (minor % 0x10 == 0)) + else if (UBD_MAJOR == major && (minor % 0x10 == 0)) { return VTOY_DEVICE_UBD; } - else if (XVD_MAJOR == major && (minor % 0x10 == 0)) + else if (XVD_MAJOR == major && (minor % 0x10 == 0)) { return VTOY_DEVICE_XVD; } - else if (SDMMC_MAJOR == major && (minor % 0x8 == 0)) + else if (SDMMC_MAJOR == major && (minor % 0x8 == 0)) { return VTOY_DEVICE_SDMMC; } @@ -214,7 +214,7 @@ static ventoy_dev_type ventoy_get_dev_type(const char *name, int major, int mino { return VTOY_DEVICE_PMEM; } - + return VTOY_DEVICE_END; } @@ -230,7 +230,7 @@ static int ventoy_is_possible_blkdev(const char *name) { return 0; } - + /* /dev/zramX */ if (name[0] == 'z' && name[1] == 'r' && name[2] == 'a' && name[3] == 'm') { @@ -254,7 +254,7 @@ static int ventoy_is_possible_blkdev(const char *name) { return 0; } - + return 1; } @@ -271,7 +271,7 @@ uint64_t ventoy_get_disk_size_in_byte(const char *disk) if (access(diskpath, F_OK) >= 0) { vdebug("get disk size from sysfs for %s\n", disk); - + fd = open(diskpath, O_RDONLY | O_BINARY); if (fd >= 0) { @@ -316,8 +316,8 @@ int ventoy_get_disk_vendor(const char *name, char *vendorbuf, int bufsize) scnprintf(vendorbuf, bufsize, "Local"); return 0; } - - return ventoy_get_sys_file_line(vendorbuf, bufsize, "/sys/block/%s/device/vendor", name); + + return ventoy_get_sys_file_line(vendorbuf, bufsize, "/sys/block/%s/device/vendor", name); } int ventoy_get_disk_model(const char *name, char *modelbuf, int bufsize) @@ -328,21 +328,21 @@ int ventoy_get_disk_model(const char *name, char *modelbuf, int bufsize) return 0; } - return ventoy_get_sys_file_line(modelbuf, bufsize, "/sys/block/%s/device/model", name); + return ventoy_get_sys_file_line(modelbuf, bufsize, "/sys/block/%s/device/model", name); } static int fatlib_media_sector_read(uint32 sector, uint8 *buffer, uint32 sector_count) { lseek(g_fatlib_media_fd, (sector + g_fatlib_media_offset) * 512ULL, SEEK_SET); read(g_fatlib_media_fd, buffer, sector_count * 512); - + return 1; } static int fatlib_is_secure_boot_enable(void) { void *flfile = NULL; - + flfile = fl_fopen("/EFI/BOOT/grubx64_real.efi", "rb"); if (flfile) { @@ -354,7 +354,7 @@ static int fatlib_is_secure_boot_enable(void) { vlog("/EFI/BOOT/grubx64_real.efi not exist\n"); } - + return 0; } @@ -410,7 +410,7 @@ static int fatlib_get_ventoy_version(char *verbuf, int bufsize) { vdebug("No grub.cfg found\n"); } - + return rc; } @@ -430,9 +430,9 @@ int ventoy_get_vtoy_data(ventoy_disk *info, int *ppartstyle) uint64_t part2_sector_count; uint64_t preserved_space; char name[64] = {0}; - disk_ventoy_data *vtoy = NULL; + disk_ventoy_data *vtoy = NULL; VTOY_GPT_INFO *gpt = NULL; - + vtoy = &(info->vtoydata); gpt = &(vtoy->gptinfo); memset(vtoy, 0, sizeof(disk_ventoy_data)); @@ -475,7 +475,7 @@ int ventoy_get_vtoy_data(ventoy_disk *info, int *ppartstyle) if (gpt->PartTbl[0].StartLBA == 0 || gpt->PartTbl[1].StartLBA == 0) { - vdebug("NO ventoy efi part layout <%llu %llu>\n", + vdebug("NO ventoy efi part layout <%llu %llu>\n", (_ull)gpt->PartTbl[0].StartLBA, (_ull)gpt->PartTbl[1].StartLBA); goto end; @@ -505,7 +505,7 @@ int ventoy_get_vtoy_data(ventoy_disk *info, int *ppartstyle) { *ppartstyle = part_style; } - + part1_start_sector = gpt->MBR.PartTbl[0].StartSectorId; part1_sector_count = gpt->MBR.PartTbl[0].SectorCount; part2_start_sector = gpt->MBR.PartTbl[1].StartSectorId; @@ -518,12 +518,12 @@ int ventoy_get_vtoy_data(ventoy_disk *info, int *ppartstyle) part2_sector_count != VTOYEFI_PART_SECTORS || (part1_start_sector + part1_sector_count) != part2_start_sector) { - vdebug("Not valid ventoy partition layout [%llu %llu] [%llu %llu]\n", + vdebug("Not valid ventoy partition layout [%llu %llu] [%llu %llu]\n", part1_start_sector, part1_sector_count, part2_start_sector, part2_sector_count); goto end; } - vdebug("ventoy partition layout check OK: [%llu %llu] [%llu %llu]\n", + vdebug("ventoy partition layout check OK: [%llu %llu] [%llu %llu]\n", part1_start_sector, part1_sector_count, part2_start_sector, part2_sector_count); vtoy->ventoy_valid = 1; @@ -539,7 +539,7 @@ int ventoy_get_vtoy_data(ventoy_disk *info, int *ppartstyle) ret = fatlib_get_ventoy_version(vtoy->ventoy_ver, sizeof(vtoy->ventoy_ver)); if (ret == 0 && vtoy->ventoy_ver[0]) { - vtoy->secure_boot_flag = fatlib_is_secure_boot_enable(); + vtoy->secure_boot_flag = fatlib_is_secure_boot_enable(); } else { @@ -564,7 +564,7 @@ int ventoy_get_vtoy_data(ventoy_disk *info, int *ppartstyle) { goto end; } - + lseek(fd, 2040 * 512, SEEK_SET); read(fd, vtoy->rsvdata, sizeof(vtoy->rsvdata)); @@ -603,7 +603,7 @@ int ventoy_get_disk_info(char **argv) size = ventoy_get_disk_size_in_byte(disk); scnprintf(g_sysinfo.cur_capacity, sizeof(g_sysinfo.cur_capacity), "%dGB", (int)ventoy_get_human_readable_gb(size)); - + return 0; } diff --git a/Plugson/src/Core/ventoy_disk_windows.c b/Plugson/src/Core/ventoy_disk_windows.c index 02c157a0382..bc766b2839e 100644 --- a/Plugson/src/Core/ventoy_disk_windows.c +++ b/Plugson/src/Core/ventoy_disk_windows.c @@ -6,12 +6,12 @@ * 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 . * @@ -33,7 +33,7 @@ int ventoy_disk_init(void) char Letter = 'A'; DWORD Drives = GetLogicalDrives(); - vlog("ventoy disk init ...\n"); + vlog("ventoy disk init ...\n"); g_disk_list = zalloc(sizeof(ventoy_disk) * MAX_DISK); @@ -63,7 +63,7 @@ int ventoy_disk_init(void) void ventoy_disk_exit(void) { - vlog("ventoy disk exit ...\n"); + vlog("ventoy disk exit ...\n"); check_free(g_disk_list); g_disk_list = NULL; diff --git a/Plugson/src/Core/ventoy_json.h b/Plugson/src/Core/ventoy_json.h index be2b4341d81..1c516b36ef7 100644 --- a/Plugson/src/Core/ventoy_json.h +++ b/Plugson/src/Core/ventoy_json.h @@ -7,12 +7,12 @@ * 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 . * @@ -99,7 +99,7 @@ typedef struct tagVTOY_JSON struct tagVTOY_JSON *pstChild; JSON_TYPE enDataType; - union + union { char *pcStrVal; int iNumVal; @@ -114,16 +114,16 @@ typedef struct tagVTOY_JSON uint32_t __uiCurPos = (uiCurPos);\ uint32_t __uiBufLen = (uiBufLen);\ char *__pcBuf = (pcBuf); - + #define VTOY_JSON_FMT_END(uiCurPos) \ (uiCurPos) = __uiCurPos;\ } - + #define VTOY_JSON_FMT_OBJ_BEGIN() ssprintf(__uiCurPos, __pcBuf, __uiBufLen, "{") #define VTOY_JSON_FMT_OBJ_BEGIN_L(P) ssprintf(__uiCurPos, __pcBuf, __uiBufLen, "%s{", P) #define VTOY_JSON_FMT_OBJ_BEGIN_N() ssprintf(__uiCurPos, __pcBuf, __uiBufLen, "{\n") #define VTOY_JSON_FMT_OBJ_BEGIN_LN(P) ssprintf(__uiCurPos, __pcBuf, __uiBufLen, "%s{\n", P) - + #define VTOY_JSON_FMT_OBJ_END() \ {\ if (',' == *(__pcBuf + (__uiCurPos - 1)))\ @@ -143,7 +143,7 @@ typedef struct tagVTOY_JSON } - + #define VTOY_JSON_FMT_KEY(Key) ssprintf(__uiCurPos, __pcBuf, __uiBufLen, "\"%s\":", (Key)) #define VTOY_JSON_FMT_KEY_L(P, Key) ssprintf(__uiCurPos, __pcBuf, __uiBufLen, "%s\"%s\":", P, (Key)) @@ -177,7 +177,7 @@ typedef struct tagVTOY_JSON #define VTOY_JSON_FMT_ARY_BEGIN() ssprintf(__uiCurPos, __pcBuf, __uiBufLen, "[") #define VTOY_JSON_FMT_ARY_BEGIN_N() ssprintf(__uiCurPos, __pcBuf, __uiBufLen, "[\n") - + #define VTOY_JSON_FMT_ARY_END() \ {\ if (',' == *(__pcBuf + (__uiCurPos - 1)))\ @@ -267,7 +267,7 @@ typedef struct tagVTOY_JSON }\ ssprintf(__uiCurPos, __pcBuf, __uiBufLen, "%s],", P);\ } - + #define VTOY_JSON_FMT_ARY_ENDEX_LN(P) \ {\ @@ -281,7 +281,7 @@ typedef struct tagVTOY_JSON - + #define VTOY_JSON_FMT_UINT64(Key, Val) ssprintf(__uiCurPos, __pcBuf, __uiBufLen, "\"%s\": %llu,", Key, (_ull)Val) #define VTOY_JSON_FMT_ULONG(Key, Val) ssprintf(__uiCurPos, __pcBuf, __uiBufLen, "\"%s\": %lu,", Key, Val) @@ -297,7 +297,7 @@ typedef struct tagVTOY_JSON #define VTOY_JSON_FMT_STRUINT_N(Key, Val) ssprintf(__uiCurPos, __pcBuf, __uiBufLen, "\"%s\": \"%u\",\n", Key, Val) #define VTOY_JSON_FMT_STRUINT_L(P, Key, Val) ssprintf(__uiCurPos, __pcBuf, __uiBufLen, "%s\"%s\": \"%u\",", P, Key, Val) #define VTOY_JSON_FMT_STRUINT_LN(P, Key, Val) ssprintf(__uiCurPos, __pcBuf, __uiBufLen, "%s\"%s\": \"%u\",\n", P, Key, Val) - + #define VTOY_JSON_FMT_STRSINT(Key, Val) ssprintf(__uiCurPos, __pcBuf, __uiBufLen, "\"%s\": \"%d\",", Key, Val) #define VTOY_JSON_FMT_STRSINT_N(Key, Val) ssprintf(__uiCurPos, __pcBuf, __uiBufLen, "\"%s\": \"%d\",\n", Key, Val) #define VTOY_JSON_FMT_STRSINT_L(P, Key, Val) ssprintf(__uiCurPos, __pcBuf, __uiBufLen, "%s\"%s\": \"%d\",", P, Key, Val) @@ -309,19 +309,19 @@ typedef struct tagVTOY_JSON #define VTOY_JSON_FMT_CTRL_STRN(P, Key, Field) \ if (strcmp(def->Field, data->Field)) \ - ssprintf(__uiCurPos, __pcBuf, __uiBufLen, "%s{ \"%s\": \"%s\" },\n", P, Key, data->Field) - + ssprintf(__uiCurPos, __pcBuf, __uiBufLen, "%s{ \"%s\": \"%s\" },\n", P, Key, data->Field) + #define VTOY_JSON_FMT_CTRL_STRN_STR(P, Key, ptr) \ ssprintf(__uiCurPos, __pcBuf, __uiBufLen, "%s{ \"%s\": \"%s\" },\n", P, Key, ptr) - + #define VTOY_JSON_FMT_CTRL_PUB_STRN(P, Key, Field) \ if (strcmp(def->Field, g_pub_path)) \ - ssprintf(__uiCurPos, __pcBuf, __uiBufLen, "%s{ \"%s\": \"%s\" },\n", P, Key, g_pub_path) + ssprintf(__uiCurPos, __pcBuf, __uiBufLen, "%s{ \"%s\": \"%s\" },\n", P, Key, g_pub_path) #define VTOY_JSON_FMT_DIFF_STRN(P, Key, Field) \ if (strcmp(def->Field, data->Field)) \ - ssprintf(__uiCurPos, __pcBuf, __uiBufLen, "%s\"%s\": \"%s\",\n", P, Key, data->Field) + ssprintf(__uiCurPos, __pcBuf, __uiBufLen, "%s\"%s\": \"%s\",\n", P, Key, data->Field) #define VTOY_JSON_FMT_STRINT64(Key, Val) \ @@ -331,14 +331,14 @@ typedef struct tagVTOY_JSON #define VTOY_JSON_FMT_SINT_N(Key, Val) ssprintf(__uiCurPos, __pcBuf, __uiBufLen, "\"%s\": %d,\n", Key, Val) #define VTOY_JSON_FMT_SINT_L(P, Key, Val) ssprintf(__uiCurPos, __pcBuf, __uiBufLen, "%s\"%s\": %d,", P, Key, Val) #define VTOY_JSON_FMT_SINT_LN(P, Key, Val) ssprintf(__uiCurPos, __pcBuf, __uiBufLen, "%s\"%s\": %d,\n", P, Key, Val) - + #define VTOY_JSON_FMT_DUBL(Key, Val) ssprintf(__uiCurPos, __pcBuf, __uiBufLen, "\"%s\": %.1lf,", Key, Val) #define VTOY_JSON_FMT_DUBL2(Key, Val) ssprintf(__uiCurPos, __pcBuf, __uiBufLen, "\"%s\": %10.02lf,", Key, Val) -#define VTOY_JSON_FMT_STRN(Key, Val) ssprintf(__uiCurPos, __pcBuf, __uiBufLen, "\"%s\": \"%s\",", Key, Val) -#define VTOY_JSON_FMT_STRN_N(Key, Val) ssprintf(__uiCurPos, __pcBuf, __uiBufLen, "\"%s\": \"%s\",\n", Key, Val) -#define VTOY_JSON_FMT_STRN_L(P, Key, Val) ssprintf(__uiCurPos, __pcBuf, __uiBufLen, "%s\"%s\": \"%s\",", P, Key, Val) -#define VTOY_JSON_FMT_STRN_LN(P, Key, Val) ssprintf(__uiCurPos, __pcBuf, __uiBufLen, "%s\"%s\": \"%s\",\n", P, Key, Val) +#define VTOY_JSON_FMT_STRN(Key, Val) ssprintf(__uiCurPos, __pcBuf, __uiBufLen, "\"%s\": \"%s\",", Key, Val) +#define VTOY_JSON_FMT_STRN_N(Key, Val) ssprintf(__uiCurPos, __pcBuf, __uiBufLen, "\"%s\": \"%s\",\n", Key, Val) +#define VTOY_JSON_FMT_STRN_L(P, Key, Val) ssprintf(__uiCurPos, __pcBuf, __uiBufLen, "%s\"%s\": \"%s\",", P, Key, Val) +#define VTOY_JSON_FMT_STRN_LN(P, Key, Val) ssprintf(__uiCurPos, __pcBuf, __uiBufLen, "%s\"%s\": \"%s\",\n", P, Key, Val) #define VTOY_JSON_FMT_STRN_PATH_LN(P, Key, Val) \ ssprintf(__uiCurPos, __pcBuf, __uiBufLen, "%s\"%s\": \"%s\",\n", P, Key, ventoy_real_path(Val)) @@ -350,7 +350,7 @@ int vtoy_json_escape_string(char *buf, int buflen, const char *str, int newline) __uiCurPos += vtoy_json_escape_string(__pcBuf + __uiCurPos, __uiBufLen - __uiCurPos, Val, 1);\ } - + #define VTOY_JSON_FMT_NULL(Key) ssprintf(__uiCurPos, __pcBuf, __uiBufLen, "\"%s\": null,", Key) #define VTOY_JSON_FMT_TRUE(Key) ssprintf(__uiCurPos, __pcBuf, __uiBufLen, "\"%s\": true,", (Key)) @@ -383,7 +383,7 @@ int vtoy_json_parse_value ( char *pcNewStart, char *pcRawStart, - VTOY_JSON *pstJson, + VTOY_JSON *pstJson, const char *pcData, const char **ppcEnd ); @@ -405,32 +405,32 @@ int vtoy_json_scan_parse ); int vtoy_json_get_int ( - VTOY_JSON *pstJson, - const char *szKey, + VTOY_JSON *pstJson, + const char *szKey, int *piValue ); int vtoy_json_get_uint ( - VTOY_JSON *pstJson, - const char *szKey, + VTOY_JSON *pstJson, + const char *szKey, uint32_t *puiValue ); int vtoy_json_get_uint64 ( - VTOY_JSON *pstJson, - const char *szKey, + VTOY_JSON *pstJson, + const char *szKey, uint64_t *pui64Value ); int vtoy_json_get_bool ( VTOY_JSON *pstJson, - const char *szKey, + const char *szKey, uint8_t *pbValue ); int vtoy_json_get_string ( - VTOY_JSON *pstJson, - const char *szKey, + VTOY_JSON *pstJson, + const char *szKey, uint32_t uiBufLen, char *pcBuf ); diff --git a/Plugson/src/Core/ventoy_log.c b/Plugson/src/Core/ventoy_log.c index 2e089f7a229..b27ed35c008 100644 --- a/Plugson/src/Core/ventoy_log.c +++ b/Plugson/src/Core/ventoy_log.c @@ -7,12 +7,12 @@ * 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 . * @@ -61,7 +61,7 @@ void ventoy_syslog_printf(const char *Fmt, ...) time_t stamp; struct tm ttm; FILE *fp; - + time(&stamp); localtime_r(&stamp, &ttm); @@ -83,14 +83,14 @@ void ventoy_syslog_printf(const char *Fmt, ...) if (fp) { - fprintf(fp, "[%04u/%02u/%02u %02u:%02u:%02u] %s", + fprintf(fp, "[%04u/%02u/%02u %02u:%02u:%02u] %s", ttm.tm_year, ttm.tm_mon + 1, ttm.tm_mday, ttm.tm_hour, ttm.tm_min, ttm.tm_sec, log); fclose(fp); #ifdef VENTOY_SIM - printf("[%04u/%02u/%02u %02u:%02u:%02u] %s", + printf("[%04u/%02u/%02u %02u:%02u:%02u] %s", ttm.tm_year, ttm.tm_mon + 1, ttm.tm_mday, ttm.tm_hour, ttm.tm_min, ttm.tm_sec, log); @@ -106,7 +106,7 @@ void ventoy_syslog(int level, const char *Fmt, ...) time_t stamp; struct tm ttm; FILE *fp; - + if (level > g_ventoy_log_level) { return; @@ -131,14 +131,14 @@ void ventoy_syslog(int level, const char *Fmt, ...) #endif if (fp) { - fprintf(fp, "[%04u/%02u/%02u %02u:%02u:%02u] %s", + fprintf(fp, "[%04u/%02u/%02u %02u:%02u:%02u] %s", ttm.tm_year + 1900, ttm.tm_mon + 1, ttm.tm_mday, ttm.tm_hour, ttm.tm_min, ttm.tm_sec, log); fclose(fp); #ifdef VENTOY_SIM - printf("[%04u/%02u/%02u %02u:%02u:%02u] %s", + printf("[%04u/%02u/%02u %02u:%02u:%02u] %s", ttm.tm_year + 1900, ttm.tm_mon + 1, ttm.tm_mday, ttm.tm_hour, ttm.tm_min, ttm.tm_sec, log); diff --git a/Plugson/src/Core/ventoy_md5.c b/Plugson/src/Core/ventoy_md5.c index f6b8e400495..cec175ee661 100644 --- a/Plugson/src/Core/ventoy_md5.c +++ b/Plugson/src/Core/ventoy_md5.c @@ -7,12 +7,12 @@ * 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 . * @@ -23,7 +23,7 @@ #include #include -const static uint32_t k[64] = +const static uint32_t k[64] = { 0xd76aa478, 0xe8c7b756, 0x242070db, 0xc1bdceee, 0xf57c0faf, 0x4787c62a, 0xa8304613, 0xfd469501, @@ -40,10 +40,10 @@ const static uint32_t k[64] = 0xf4292244, 0x432aff97, 0xab9423a7, 0xfc93a039, 0x655b59c3, 0x8f0ccc92, 0xffeff47d, 0x85845dd1, 0x6fa87e4f, 0xfe2ce6e0, 0xa3014314, 0x4e0811a1, - 0xf7537e82, 0xbd3af235, 0x2ad7d2bb, 0xeb86d391 + 0xf7537e82, 0xbd3af235, 0x2ad7d2bb, 0xeb86d391 }; -const static uint32_t r[] = +const static uint32_t r[] = { 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, @@ -64,30 +64,30 @@ const static uint32_t r[] = } void ventoy_md5(const void *data, uint32_t len, uint8_t *md5) -{ +{ uint32_t h0, h1, h2, h3; uint32_t w[16]; uint32_t a, b, c, d, i, f, g, temp; uint32_t offset, mod, delta; uint8_t postbuf[128] = {0}; - + // Initialize variables - simple count in nibbles: h0 = 0x67452301; h1 = 0xefcdab89; h2 = 0x98badcfe; h3 = 0x10325476; - + //Pre-processing: - //append "1" bit to message + //append "1" bit to message //append "0" bits until message length in bits ¡Ô 448 (mod 512) //append length mod (2^64) to message mod = len % 64; if (mod) { - memcpy(postbuf, (const uint8_t *)data + len - mod, mod); + memcpy(postbuf, (const uint8_t *)data + len - mod, mod); } - + postbuf[mod] = 0x80; if (mod < 56) { @@ -103,7 +103,7 @@ void ventoy_md5(const void *data, uint32_t len, uint8_t *md5) } len -= mod; - + for (offset = 0; offset < len + delta; offset += 64) { if (offset < len) @@ -120,43 +120,43 @@ void ventoy_md5(const void *data, uint32_t len, uint8_t *md5) b = h1; c = h2; d = h3; - + // Main loop: for (i = 0; i < 16; i++) { f = (b & c) | ((~b) & d); - g = i; + g = i; ROTATE_CALC(); } - + for (i = 16; i < 32; i++) { f = (d & b) | ((~d) & c); g = (5 * i + 1) % 16; ROTATE_CALC(); } - + for (i = 32; i < 48; i++) { f = b ^ c ^ d; g = (3 * i + 5) % 16; ROTATE_CALC(); } - + for (i = 48; i < 64; i++) { f = c ^ (b | (~d)); g = (7 * i) % 16; ROTATE_CALC(); } - + // Add this chunk's hash to result so far: h0 += a; h1 += b; h2 += c; h3 += d; } - + //var char md5[16] := h0 append h1 append h2 append h3 //(Output is in little-endian) to_bytes(h0, md5); to_bytes(h1, md5 + 4); diff --git a/Plugson/src/Core/ventoy_utf.c b/Plugson/src/Core/ventoy_utf.c index 8c8a1aeb476..0f0c2529b7b 100644 --- a/Plugson/src/Core/ventoy_utf.c +++ b/Plugson/src/Core/ventoy_utf.c @@ -7,12 +7,12 @@ * 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 . * @@ -115,7 +115,7 @@ static codepoint_t decode_utf16(utf16_t const* utf16, size_t len, size_t* index) // BMP character if ((high & GENERIC_SURROGATE_MASK) != GENERIC_SURROGATE_VALUE) - return high; + return high; // Unmatched low surrogate, invalid if ((high & SURROGATE_MASK) != HIGH_SURROGATE_VALUE) @@ -124,7 +124,7 @@ static codepoint_t decode_utf16(utf16_t const* utf16, size_t len, size_t* index) // String ended with an unmatched high surrogate, invalid if (*index == len - 1) return INVALID_CODEPOINT; - + utf16_t low = utf16[*index + 1]; // Unmatched high surrogate, invalid @@ -141,7 +141,7 @@ static codepoint_t decode_utf16(utf16_t const* utf16, size_t len, size_t* index) result <<= SURROGATE_CODEPOINT_BITS; result |= low & SURROGATE_CODEPOINT_MASK; result += SURROGATE_CODEPOINT_OFFSET; - + // And if all else fails, it's valid return result; } @@ -240,7 +240,7 @@ static codepoint_t decode_utf8(utf8_t const* utf8, size_t len, size_t* index) utf8_pattern leading_pattern; // If the leading byte matches the current leading pattern int matches = 0; - + do { encoding_len++; diff --git a/Plugson/src/Core/ventoy_util.c b/Plugson/src/Core/ventoy_util.c index 50198e4db44..8663722cca4 100644 --- a/Plugson/src/Core/ventoy_util.c +++ b/Plugson/src/Core/ventoy_util.c @@ -6,12 +6,12 @@ * 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 . * @@ -86,7 +86,7 @@ ventoy_file * ventoy_tar_find_file(const char *path) ventoy_file *node = g_tar_filelist; len = (int)strlen(path); - + for (i = 0; i < g_tar_filenum; i++, node++) { if (node->pathlen == len && memcmp(node->path, path, len) == 0) @@ -138,7 +138,7 @@ int ventoy_decompress_tar(char *tarbuf, int buflen, int *tarsize) else { *tarsize = g_unxz_len; - rc = 0; + rc = 0; } free(buffer); @@ -224,7 +224,7 @@ int ventoy_www_init(void) } vlog("Total extract %d files from tar file.\n", g_tar_filenum); - + return 0; } @@ -253,7 +253,7 @@ if (backup) scnprintf(backup, 64, "%s/ventoy/ventoy_backup.json", g_cur_dir); } -#endif +#endif } static const char g_encoding_table[] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', @@ -265,13 +265,13 @@ static const char g_encoding_table[] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/'}; -char * ventoy_base64_encode(const char *data, int input_length, int *output_length) +char * ventoy_base64_encode(const char *data, int input_length, int *output_length) { int i = 0; int j = 0; char *encoded_data = NULL; int mod_table[] = {0, 2, 1}; - + *output_length = 4 * ((input_length + 2) / 3); encoded_data = malloc(*output_length + 4); if (!encoded_data) @@ -279,7 +279,7 @@ char * ventoy_base64_encode(const char *data, int input_length, int *output_leng return NULL; } - while (i < input_length) + while (i < input_length) { unsigned int octet_a = i < input_length ? (unsigned char)data[i++] : 0; unsigned int octet_b = i < input_length ? (unsigned char)data[i++] : 0; @@ -295,7 +295,7 @@ char * ventoy_base64_encode(const char *data, int input_length, int *output_leng for (i = 0; i < mod_table[input_length % 3]; i++) { - encoded_data[*output_length - 1 - i] = '='; + encoded_data[*output_length - 1 - i] = '='; } return encoded_data; diff --git a/Plugson/src/Core/ventoy_util.h b/Plugson/src/Core/ventoy_util.h index 769c42fd94b..8051f1abb2b 100644 --- a/Plugson/src/Core/ventoy_util.h +++ b/Plugson/src/Core/ventoy_util.h @@ -7,12 +7,12 @@ * 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 . * @@ -89,7 +89,7 @@ typedef struct SYSINFO int syntax_error; int invalid_config; int config_save_error; - + int language; int pathcase; char cur_fsname[64]; diff --git a/Plugson/src/Core/ventoy_util_linux.c b/Plugson/src/Core/ventoy_util_linux.c index c5bf838d68e..5b110ef650c 100644 --- a/Plugson/src/Core/ventoy_util_linux.c +++ b/Plugson/src/Core/ventoy_util_linux.c @@ -6,12 +6,12 @@ * 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 . * @@ -89,7 +89,7 @@ int ventoy_get_sys_file_line(char *buffer, int buflen, const char *fmt, ...) break; } } - + return 0; } else @@ -147,7 +147,7 @@ int ventoy_is_file_exist(const char *fmt, ...) va_list ap; struct stat sb; char fullpath[MAX_PATH]; - + va_start (ap, fmt); vsnprintf(fullpath, MAX_PATH, fmt, ap); va_end (ap); @@ -170,7 +170,7 @@ int ventoy_is_directory_exist(const char *fmt, ...) va_list ap; struct stat sb; char fullpath[MAX_PATH]; - + va_start (ap, fmt); vsnprintf(fullpath, MAX_PATH, fmt, ap); va_end (ap); @@ -192,7 +192,7 @@ int ventoy_get_file_size(const char *file) { int Size = -1; struct stat stStat; - + if (stat(file, &stStat) >= 0) { Size = (int)(stStat.st_size); @@ -220,7 +220,7 @@ int ventoy_write_buf_to_file(const char *FileName, void *Bufer, int BufLen) { vlog("Failed to chmod <%s> %d\n", FileName, errno); } - + size = write(fd, Bufer, BufLen); if ((int)size != BufLen) { @@ -228,7 +228,7 @@ int ventoy_write_buf_to_file(const char *FileName, void *Bufer, int BufLen) vlog("write file %s failed %d err:%d\n", FileName, (int)size, errno); return 1; } - + fsync(fd); close(fd); @@ -247,7 +247,7 @@ static void * ventoy_local_thread_run(void* data) { sem_wait(&g_writeback_sem); callback(); - } + } return NULL; } @@ -316,13 +316,13 @@ int ventoy_copy_file(const char *a, const char *b) { int len = 0; char *buf = NULL; - + if (0 == ventoy_read_file_to_buf(a, 0, (void **)&buf, &len)) { - ventoy_write_buf_to_file(b, buf, len); + ventoy_write_buf_to_file(b, buf, len); free(buf); } - + return 0; } diff --git a/Plugson/src/Core/ventoy_util_windows.c b/Plugson/src/Core/ventoy_util_windows.c index 6610894c0b2..d8b238f19fe 100644 --- a/Plugson/src/Core/ventoy_util_windows.c +++ b/Plugson/src/Core/ventoy_util_windows.c @@ -6,12 +6,12 @@ * 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 . * @@ -160,7 +160,7 @@ int ventoy_path_case(char *path, int slash) { break; } - + if (path[i] != FilePathA[j]) { path[i] = FilePathA[j]; @@ -412,7 +412,7 @@ int ventoy_get_file_size(const char *file) { int Size = -1; HANDLE hFile; - + hFile = CreateFileA(file, 0, 0, NULL, OPEN_EXISTING, 0, NULL); if (hFile != INVALID_HANDLE_VALUE) { @@ -432,7 +432,7 @@ const CHAR* ParseVentoyVersionFromString(CHAR *Buf) CHAR *Pos = NULL; CHAR *End = NULL; static CHAR LocalVersion[64] = { 0 }; - + Pos = strstr(Buf, "VENTOY_VERSION="); if (Pos) { @@ -504,7 +504,7 @@ static int VentoyFatDiskRead(uint32 Sector, uint8 *Buffer, uint32 SectorCount) bRet = ReadFile(g_FatPhyDrive, Buffer, ReadSize, &dwSize, NULL); if (bRet == FALSE || dwSize != ReadSize) { - + } return 1; @@ -520,7 +520,7 @@ static int GetVentoyVersion(int PhyDrive, ventoy_disk *disk) VTOY_GPT_INFO *pGPT = NULL; CHAR Drive[64]; void *flfile = NULL; - UCHAR MbrData[] = + UCHAR MbrData[] = { 0xEB, 0x63, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -569,7 +569,7 @@ static int GetVentoyVersion(int PhyDrive, ventoy_disk *disk) else { Part2Offset = pGPT->MBR.PartTbl[1].StartSectorId; - disk->cur_part_style = 0; + disk->cur_part_style = 0; } @@ -591,7 +591,7 @@ static int GetVentoyVersion(int PhyDrive, ventoy_disk *disk) } } } - + fl_shutdown(); out: @@ -643,7 +643,7 @@ int CheckRuntimeEnvironment(char Letter, ventoy_disk *disk) { disk->pathcase = 1; } - + strlcpy(disk->cur_fsname, FsName); if (GetVentoyVersion(PhyDrive, disk) != 0) @@ -702,7 +702,7 @@ void ventoy_stop_writeback_thread(void) { g_thread_stop = 1; ventoy_set_writeback_event(); - + WaitForSingleObject(g_writeback_thread, INFINITE); CHECK_CLOSE_HANDLE(g_writeback_thread); @@ -756,7 +756,7 @@ int ventoy_read_file_to_buf(const char *FileName, int ExtLen, void **Bufer, int *Bufer = buffer; *BufLen = Size; - + CloseHandle(hFile); return 0; } @@ -782,7 +782,7 @@ int ventoy_write_buf_to_file(const char *FileName, void *Bufer, int BufLen) CloseHandle(hFile); return 1; } - + FlushFileBuffers(hFile); CloseHandle(hFile); diff --git a/Plugson/src/Web/ventoy_http.c b/Plugson/src/Web/ventoy_http.c index ac5c1797b5a..b860c5b9d9d 100644 --- a/Plugson/src/Web/ventoy_http.c +++ b/Plugson/src/Web/ventoy_http.c @@ -6,12 +6,12 @@ * 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 . * @@ -47,16 +47,16 @@ #include #include "fat_filelib.h" -static const char *g_json_title_postfix[bios_max + 1] = +static const char *g_json_title_postfix[bios_max + 1] = { "", "_legacy", "_uefi", "_ia32", "_aa64", "_mips", "" }; static const char *g_ventoy_kbd_layout[] = { - "QWERTY_USA", "AZERTY", "CZECH_QWERTY", "CZECH_QWERTZ", "DANISH", - "DVORAK_USA", "FRENCH", "GERMAN", "ITALIANO", "JAPAN_106", "LATIN_USA", - "PORTU_BRAZIL", "QWERTY_UK", "QWERTZ", "QWERTZ_HUN", "QWERTZ_SLOV_CROAT", + "QWERTY_USA", "AZERTY", "CZECH_QWERTY", "CZECH_QWERTZ", "DANISH", + "DVORAK_USA", "FRENCH", "GERMAN", "ITALIANO", "JAPAN_106", "LATIN_USA", + "PORTU_BRAZIL", "QWERTY_UK", "QWERTZ", "QWERTZ_HUN", "QWERTZ_SLOV_CROAT", "SPANISH", "SWEDISH", "TURKISH_Q", "VIETNAMESE", NULL }; @@ -64,11 +64,11 @@ static const char *g_ventoy_kbd_layout[] = #define VTOY_DEL_ALL_PATH "4119ae33-98ea-448e-b9c0-569aafcf1fb4" static int g_json_exist[plugin_type_max][bios_max]; -static const char *g_plugin_name[plugin_type_max] = +static const char *g_plugin_name[plugin_type_max] = { - "control", "theme", "menu_alias", "menu_tip", - "menu_class", "auto_install", "persistence", "injection", - "conf_replace", "password", "image_list", + "control", "theme", "menu_alias", "menu_tip", + "menu_class", "auto_install", "persistence", "injection", + "conf_replace", "password", "image_list", "auto_memdisk", "dud" }; @@ -104,7 +104,7 @@ static struct mg_context *g_ventoy_http_ctx = NULL; static int ventoy_is_kbd_valid(const char *key) { int i = 0; - + for (i = 0; g_ventoy_kbd_layout[i]; i++) { if (strcmp(g_ventoy_kbd_layout[i], key) == 0) @@ -119,7 +119,7 @@ static int ventoy_is_kbd_valid(const char *key) static const char * ventoy_real_path(const char *org) { int count = 0; - + if (g_sysinfo.pathcase) { scnprintf(g_pub_path, MAX_PATH, "%s", org); @@ -139,7 +139,7 @@ static const char * ventoy_real_path(const char *org) static int ventoy_json_result(struct mg_connection *conn, const char *err) { - mg_printf(conn, + mg_printf(conn, "HTTP/1.1 200 OK \r\n" "Content-Type: application/json\r\n" "Content-Length: %d\r\n" @@ -151,12 +151,12 @@ static int ventoy_json_result(struct mg_connection *conn, const char *err) static int ventoy_json_buffer(struct mg_connection *conn, const char *json_buf, int json_len) { - mg_printf(conn, + mg_printf(conn, "HTTP/1.1 200 OK \r\n" "Content-Type: application/json\r\n" "Content-Length: %d\r\n" "\r\n%s", - json_len, json_buf); + json_len, json_buf); return 0; } @@ -171,7 +171,7 @@ static void ventoy_free_path_node_list(path_node *list) next = node->next; free(node); node = next; - } + } } static int ventoy_path_is_real_exist(const char *path, void *head, size_t pathoff, size_t nextoff) @@ -201,7 +201,7 @@ static int ventoy_path_is_real_exist(const char *path, void *head, size_t pathof return 1; } } - + memcpy(&node, node + nextoff, sizeof(node)); } @@ -219,7 +219,7 @@ static path_node * ventoy_path_node_add_array(VTOY_JSON *array) { node = zalloc(sizeof(path_node)); if (node) - { + { scnprintf(node->path, sizeof(node->path), "%s", item->unData.pcStrVal); vtoy_list_add(head, cur, node); } @@ -234,7 +234,7 @@ static int ventoy_check_fuzzy_path(char *path, int prefix) char c; char *cur = NULL; char *pos = NULL; - + if (!path) { return 0; @@ -250,7 +250,7 @@ static int ventoy_check_fuzzy_path(char *path, int prefix) return 0; } } - + while (pos != path) { if (*pos == '/') @@ -293,11 +293,11 @@ static int ventoy_check_fuzzy_path(char *path, int prefix) { if (prefix) { - return ventoy_is_file_exist("%s%s", g_cur_dir, path); + return ventoy_is_file_exist("%s%s", g_cur_dir, path); } else { - return ventoy_is_file_exist("%s", path); + return ventoy_is_file_exist("%s", path); } } } @@ -316,7 +316,7 @@ static int ventoy_path_list_cmp(path_node *list1, path_node *list2) { return 1; } - + list1 = list1->next; list2 = list2->next; } @@ -337,12 +337,12 @@ static int ventoy_path_list_cmp(path_node *list1, path_node *list2) static int ventoy_api_device_info(struct mg_connection *conn, VTOY_JSON *json) { int pos = 0; - + (void)json; VTOY_JSON_FMT_BEGIN(pos, JSON_BUFFER, JSON_BUF_MAX); VTOY_JSON_FMT_OBJ_BEGIN(); - + VTOY_JSON_FMT_STRN("dev_name", g_sysinfo.cur_model); VTOY_JSON_FMT_STRN("dev_capacity", g_sysinfo.cur_capacity); VTOY_JSON_FMT_STRN("dev_fs", g_sysinfo.cur_fsname); @@ -360,7 +360,7 @@ static int ventoy_api_device_info(struct mg_connection *conn, VTOY_JSON *json) static int ventoy_api_sysinfo(struct mg_connection *conn, VTOY_JSON *json) { int pos = 0; - + (void)json; VTOY_JSON_FMT_BEGIN(pos, JSON_BUFFER, JSON_BUF_MAX); @@ -371,10 +371,10 @@ static int ventoy_api_sysinfo(struct mg_connection *conn, VTOY_JSON *json) //read clear VTOY_JSON_FMT_SINT("syntax_error", g_sysinfo.syntax_error); g_sysinfo.syntax_error = 0; - + VTOY_JSON_FMT_SINT("invalid_config", g_sysinfo.invalid_config); g_sysinfo.invalid_config = 0; - + #if defined(_MSC_VER) || defined(WIN32) VTOY_JSON_FMT_STRN("os", "windows"); #else @@ -394,7 +394,7 @@ static int ventoy_api_handshake(struct mg_connection *conn, VTOY_JSON *json) int j = 0; int pos = 0; char key[128]; - + (void)json; VTOY_JSON_FMT_BEGIN(pos, JSON_BUFFER, JSON_BUF_MAX); @@ -414,7 +414,7 @@ static int ventoy_api_handshake(struct mg_connection *conn, VTOY_JSON *json) } VTOY_JSON_FMT_ARY_ENDEX(); } - + VTOY_JSON_FMT_OBJ_END(); VTOY_JSON_FMT_END(pos); @@ -483,7 +483,7 @@ static int ventoy_api_check_exist2(struct mg_connection *conn, VTOY_JSON *json) { if (fuzzy1) { - exist1 = ventoy_check_fuzzy_path((char *)path1, 0); + exist1 = ventoy_check_fuzzy_path((char *)path1, 0); } else { @@ -491,7 +491,7 @@ static int ventoy_api_check_exist2(struct mg_connection *conn, VTOY_JSON *json) } } } - + if (path2) { if (dir2) @@ -502,7 +502,7 @@ static int ventoy_api_check_exist2(struct mg_connection *conn, VTOY_JSON *json) { if (fuzzy2) { - exist2 = ventoy_check_fuzzy_path((char *)path2, 0); + exist2 = ventoy_check_fuzzy_path((char *)path2, 0); } else { @@ -559,7 +559,7 @@ void ventoy_data_default_control(data_control *data) data->secondary_menu_timeout = 0; data->win11_bypass_check = 1; data->win11_bypass_nro = 1; - + strlcpy(data->default_kbd_layout, "QWERTY_USA"); strlcpy(data->menu_language, "en_US"); } @@ -604,22 +604,22 @@ int ventoy_data_save_control(data_control *data, const char *title, char *buf, i { int pos = 0; data_control *def = g_data_control + bios_max; - + VTOY_JSON_FMT_BEGIN(pos, buf, buflen); VTOY_JSON_FMT_KEY_L(L1, title); VTOY_JSON_FMT_ARY_BEGIN_N(); - VTOY_JSON_FMT_CTRL_INT(L2, "VTOY_DEFAULT_MENU_MODE", default_menu_mode); + VTOY_JSON_FMT_CTRL_INT(L2, "VTOY_DEFAULT_MENU_MODE", default_menu_mode); VTOY_JSON_FMT_CTRL_INT(L2, "VTOY_TREE_VIEW_MENU_STYLE", treeview_style); VTOY_JSON_FMT_CTRL_INT(L2, "VTOY_FILT_DOT_UNDERSCORE_FILE", filter_dot_underscore); VTOY_JSON_FMT_CTRL_INT(L2, "VTOY_SORT_CASE_SENSITIVE", sort_casesensitive); if (data->max_search_level >= 0) { - VTOY_JSON_FMT_CTRL_INT(L2, "VTOY_MAX_SEARCH_LEVEL", max_search_level); + VTOY_JSON_FMT_CTRL_INT(L2, "VTOY_MAX_SEARCH_LEVEL", max_search_level); } - + VTOY_JSON_FMT_CTRL_INT(L2, "VTOY_VHD_NO_WARNING", vhd_no_warning); VTOY_JSON_FMT_CTRL_INT(L2, "VTOY_FILE_FLT_ISO", filter_iso); VTOY_JSON_FMT_CTRL_INT(L2, "VTOY_FILE_FLT_WIM", filter_wim); @@ -635,14 +635,14 @@ int ventoy_data_save_control(data_control *data, const char *title, char *buf, i VTOY_JSON_FMT_CTRL_INT(L2, "VTOY_MENU_TIMEOUT", menu_timeout); VTOY_JSON_FMT_CTRL_INT(L2, "VTOY_SECONDARY_TIMEOUT", secondary_menu_timeout); - VTOY_JSON_FMT_CTRL_STRN(L2, "VTOY_DEFAULT_KBD_LAYOUT", default_kbd_layout); - VTOY_JSON_FMT_CTRL_STRN(L2, "VTOY_MENU_LANGUAGE", menu_language); + VTOY_JSON_FMT_CTRL_STRN(L2, "VTOY_DEFAULT_KBD_LAYOUT", default_kbd_layout); + VTOY_JSON_FMT_CTRL_STRN(L2, "VTOY_MENU_LANGUAGE", menu_language); if (strcmp(def->default_search_root, data->default_search_root)) { VTOY_JSON_FMT_CTRL_STRN_STR(L2, "VTOY_DEFAULT_SEARCH_ROOT", ventoy_real_path(data->default_search_root)); } - + if (strcmp(def->default_image, data->default_image)) { VTOY_JSON_FMT_CTRL_STRN_STR(L2, "VTOY_DEFAULT_IMAGE", ventoy_real_path(data->default_image)); @@ -659,7 +659,7 @@ int ventoy_data_json_control(data_control *ctrl, char *buf, int buflen) int i = 0; int pos = 0; int valid = 0; - + VTOY_JSON_FMT_BEGIN(pos, buf, buflen); VTOY_JSON_FMT_OBJ_BEGIN(); @@ -667,9 +667,9 @@ int ventoy_data_json_control(data_control *ctrl, char *buf, int buflen) VTOY_JSON_FMT_SINT("treeview_style", ctrl->treeview_style); VTOY_JSON_FMT_SINT("filter_dot_underscore", ctrl->filter_dot_underscore); VTOY_JSON_FMT_SINT("sort_casesensitive", ctrl->sort_casesensitive); - VTOY_JSON_FMT_SINT("max_search_level", ctrl->max_search_level); + VTOY_JSON_FMT_SINT("max_search_level", ctrl->max_search_level); VTOY_JSON_FMT_SINT("vhd_no_warning", ctrl->vhd_no_warning); - + VTOY_JSON_FMT_SINT("filter_iso", ctrl->filter_iso); VTOY_JSON_FMT_SINT("filter_wim", ctrl->filter_wim); VTOY_JSON_FMT_SINT("filter_efi", ctrl->filter_efi); @@ -694,7 +694,7 @@ int ventoy_data_json_control(data_control *ctrl, char *buf, int buflen) VTOY_JSON_FMT_STRN("default_search_root", ctrl->default_search_root); VTOY_JSON_FMT_SINT("default_search_root_valid", valid); - + valid = 0; if (ctrl->default_image[0] && ventoy_is_file_exist("%s%s", g_cur_dir, ctrl->default_image)) { @@ -708,10 +708,10 @@ int ventoy_data_json_control(data_control *ctrl, char *buf, int buflen) for (i = 0; g_ventoy_menu_lang[i][0]; i++) { - VTOY_JSON_FMT_ITEM(g_ventoy_menu_lang[i]); + VTOY_JSON_FMT_ITEM(g_ventoy_menu_lang[i]); } VTOY_JSON_FMT_ARY_ENDEX(); - + VTOY_JSON_FMT_OBJ_END(); VTOY_JSON_FMT_END(pos); @@ -729,7 +729,7 @@ static int ventoy_api_save_control(struct mg_connection *conn, VTOY_JSON *json) int ret; int index = 0; data_control *ctrl = NULL; - + vtoy_json_get_int(json, "index", &index); ctrl = g_data_control + index; @@ -757,7 +757,7 @@ static int ventoy_api_save_control(struct mg_connection *conn, VTOY_JSON *json) VTOY_JSON_STR("default_search_root", ctrl->default_search_root); VTOY_JSON_STR("menu_language", ctrl->menu_language); VTOY_JSON_STR("default_kbd_layout", ctrl->default_kbd_layout); - + ret = ventoy_data_save_all(); ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); @@ -808,7 +808,7 @@ int ventoy_data_save_theme(data_theme *data, const char *title, char *buf, int b int pos = 0; path_node *node = NULL; data_theme *def = g_data_theme + bios_max; - + VTOY_JSON_FMT_BEGIN(pos, buf, buflen); VTOY_JSON_FMT_KEY_L(L1, title); @@ -827,15 +827,15 @@ int ventoy_data_save_theme(data_theme *data, const char *title, char *buf, int b } VTOY_JSON_FMT_ARY_ENDEX_LN(L2); - + if (def->default_file != data->default_file) { - VTOY_JSON_FMT_SINT_LN(L2, "default_file", data->default_file); + VTOY_JSON_FMT_SINT_LN(L2, "default_file", data->default_file); } - + if (def->resolution_fit != data->resolution_fit) { - VTOY_JSON_FMT_SINT_LN(L2, "resolution_fit", data->resolution_fit); + VTOY_JSON_FMT_SINT_LN(L2, "resolution_fit", data->resolution_fit); } } else @@ -865,11 +865,11 @@ int ventoy_data_save_theme(data_theme *data, const char *title, char *buf, int b } VTOY_JSON_FMT_DIFF_STRN(L2, "gfxmode", gfxmode); - + VTOY_JSON_FMT_DIFF_STRN(L2, "ventoy_left", ventoy_left); VTOY_JSON_FMT_DIFF_STRN(L2, "ventoy_top", ventoy_top); VTOY_JSON_FMT_DIFF_STRN(L2, "ventoy_color", ventoy_color); - + if (data->fontslist) { VTOY_JSON_FMT_KEY_L(L2, "fonts"); @@ -879,10 +879,10 @@ int ventoy_data_save_theme(data_theme *data, const char *title, char *buf, int b { VTOY_JSON_FMT_ITEM_PATH_LN(L3, node->path); } - + VTOY_JSON_FMT_ARY_ENDEX_LN(L2); } - + VTOY_JSON_FMT_OBJ_ENDEX_LN(L1); VTOY_JSON_FMT_END(pos); @@ -894,7 +894,7 @@ int ventoy_data_json_theme(data_theme *data, char *buf, int buflen) { int pos = 0; path_node *node = NULL; - + VTOY_JSON_FMT_BEGIN(pos, buf, buflen); VTOY_JSON_FMT_OBJ_BEGIN(); @@ -902,11 +902,11 @@ int ventoy_data_json_theme(data_theme *data, char *buf, int buflen) VTOY_JSON_FMT_SINT("resolution_fit", data->resolution_fit); VTOY_JSON_FMT_SINT("display_mode", data->display_mode); VTOY_JSON_FMT_STRN("gfxmode", data->gfxmode); - + VTOY_JSON_FMT_STRN("ventoy_color", data->ventoy_color); VTOY_JSON_FMT_STRN("ventoy_left", data->ventoy_left); VTOY_JSON_FMT_STRN("ventoy_top", data->ventoy_top); - + VTOY_JSON_FMT_KEY("filelist"); VTOY_JSON_FMT_ARY_BEGIN(); for (node = data->filelist; node; node = node->next) @@ -917,7 +917,7 @@ int ventoy_data_json_theme(data_theme *data, char *buf, int buflen) VTOY_JSON_FMT_OBJ_ENDEX(); } VTOY_JSON_FMT_ARY_ENDEX(); - + VTOY_JSON_FMT_KEY("fontslist"); VTOY_JSON_FMT_ARY_BEGIN(); for (node = data->fontslist; node; node = node->next) @@ -928,7 +928,7 @@ int ventoy_data_json_theme(data_theme *data, char *buf, int buflen) VTOY_JSON_FMT_OBJ_ENDEX(); } VTOY_JSON_FMT_ARY_ENDEX(); - + VTOY_JSON_FMT_OBJ_END(); VTOY_JSON_FMT_END(pos); @@ -946,7 +946,7 @@ static int ventoy_api_save_theme(struct mg_connection *conn, VTOY_JSON *json) int ret; int index = 0; data_theme *data = NULL; - + vtoy_json_get_int(json, "index", &index); data = g_data_theme + index; @@ -960,7 +960,7 @@ static int ventoy_api_save_theme(struct mg_connection *conn, VTOY_JSON *json) ret = ventoy_data_save_all(); - ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); + ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); return 0; } @@ -973,7 +973,7 @@ static int ventoy_api_theme_add_file(struct mg_connection *conn, VTOY_JSON *json path_node *node = NULL; path_node *cur = NULL; data_theme *data = NULL; - + vtoy_json_get_int(json, "index", &index); data = g_data_theme + index; @@ -991,13 +991,13 @@ static int ventoy_api_theme_add_file(struct mg_connection *conn, VTOY_JSON *json { scnprintf(node->path, sizeof(node->path), "%s", path); - vtoy_list_add(data->filelist, cur, node); + vtoy_list_add(data->filelist, cur, node); } } ret = ventoy_data_save_all(); - ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); + ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); return 0; } @@ -1009,7 +1009,7 @@ static int ventoy_api_theme_del_file(struct mg_connection *conn, VTOY_JSON *json path_node *node = NULL; path_node *last = NULL; data_theme *data = NULL; - + vtoy_json_get_int(json, "index", &index); data = g_data_theme + index; @@ -1023,12 +1023,12 @@ static int ventoy_api_theme_del_file(struct mg_connection *conn, VTOY_JSON *json else { vtoy_list_del(last, node, data->filelist, path); - } + } } ret = ventoy_data_save_all(); - ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); + ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); return 0; } @@ -1063,7 +1063,7 @@ static int ventoy_api_theme_add_font(struct mg_connection *conn, VTOY_JSON *json ret = ventoy_data_save_all(); - ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); + ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); return 0; } @@ -1076,7 +1076,7 @@ static int ventoy_api_theme_del_font(struct mg_connection *conn, VTOY_JSON *json path_node *node = NULL; path_node *last = NULL; data_theme *data = NULL; - + vtoy_json_get_int(json, "index", &index); data = g_data_theme + index; @@ -1089,13 +1089,13 @@ static int ventoy_api_theme_del_font(struct mg_connection *conn, VTOY_JSON *json } else { - vtoy_list_del(last, node, data->fontslist, path); - } + vtoy_list_del(last, node, data->fontslist, path); + } } ret = ventoy_data_save_all(); - ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); + ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); return 0; } @@ -1120,16 +1120,16 @@ int ventoy_data_cmp_menu_alias(data_alias *data1, data_alias *data2) { list1 = data1->list; list2 = data2->list; - + while (list1 && list2) { - if ((list1->type != list2->type) || - strcmp(list1->path, list2->path) || + if ((list1->type != list2->type) || + strcmp(list1->path, list2->path) || strcmp(list1->alias, list2->alias)) { return 1; } - + list1 = list1->next; list2 = list2->next; } @@ -1153,7 +1153,7 @@ int ventoy_data_save_menu_alias(data_alias *data, const char *title, char *buf, { int pos = 0; data_alias_node *node = NULL; - + VTOY_JSON_FMT_BEGIN(pos, buf, buflen); VTOY_JSON_FMT_KEY_L(L1, title); @@ -1165,15 +1165,15 @@ int ventoy_data_save_menu_alias(data_alias *data, const char *title, char *buf, if (node->type == path_type_file) { - VTOY_JSON_FMT_STRN_PATH_LN(L3, "image", node->path); + VTOY_JSON_FMT_STRN_PATH_LN(L3, "image", node->path); } else { VTOY_JSON_FMT_STRN_PATH_LN(L3, "dir", node->path); } - + VTOY_JSON_FMT_STRN_EX_LN(L3, "alias", node->alias); - + VTOY_JSON_FMT_OBJ_ENDEX_LN(L2); } @@ -1189,7 +1189,7 @@ int ventoy_data_json_menu_alias(data_alias *data, char *buf, int buflen) int pos = 0; int valid = 0; data_alias_node *node = NULL; - + VTOY_JSON_FMT_BEGIN(pos, buf, buflen); VTOY_JSON_FMT_ARY_BEGIN(); @@ -1207,10 +1207,10 @@ int ventoy_data_json_menu_alias(data_alias *data, char *buf, int buflen) { valid = ventoy_is_directory_exist("%s%s", g_cur_dir, node->path); } - + VTOY_JSON_FMT_SINT("valid", valid); VTOY_JSON_FMT_STRN("alias", node->alias); - + VTOY_JSON_FMT_OBJ_ENDEX(); } @@ -1231,7 +1231,7 @@ static int ventoy_api_save_alias(struct mg_connection *conn, VTOY_JSON *json) int ret; ret = ventoy_data_save_all(); - ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); + ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); return 0; } @@ -1245,7 +1245,7 @@ static int ventoy_api_alias_add(struct mg_connection *conn, VTOY_JSON *json) data_alias_node *node = NULL; data_alias_node *cur = NULL; data_alias *data = NULL; - + vtoy_json_get_int(json, "index", &index); data = g_data_menu_alias + index; @@ -1267,14 +1267,14 @@ static int ventoy_api_alias_add(struct mg_connection *conn, VTOY_JSON *json) node->type = type; scnprintf(node->path, sizeof(node->path), "%s", path); scnprintf(node->alias, sizeof(node->alias), "%s", alias); - + vtoy_list_add(data->list, cur, node); } } ret = ventoy_data_save_all(); - ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); + ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); return 0; } @@ -1286,7 +1286,7 @@ static int ventoy_api_alias_del(struct mg_connection *conn, VTOY_JSON *json) data_alias_node *last = NULL; data_alias_node *node = NULL; data_alias *data = NULL; - + vtoy_json_get_int(json, "index", &index); data = g_data_menu_alias + index; @@ -1295,17 +1295,17 @@ static int ventoy_api_alias_del(struct mg_connection *conn, VTOY_JSON *json) { if (strcmp(path, VTOY_DEL_ALL_PATH) == 0) { - vtoy_list_free(data_alias_node, data->list); + vtoy_list_free(data_alias_node, data->list); } else { - vtoy_list_del(last, node, data->list, path); + vtoy_list_del(last, node, data->list, path); } } ret = ventoy_data_save_all(); - ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); + ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); return 0; } @@ -1339,16 +1339,16 @@ int ventoy_data_cmp_menu_tip(data_tip *data1, data_tip *data2) { list1 = data1->list; list2 = data2->list; - + while (list1 && list2) { - if ((list1->type != list2->type) || - strcmp(list1->path, list2->path) || + if ((list1->type != list2->type) || + strcmp(list1->path, list2->path) || strcmp(list1->tip, list2->tip)) { return 1; } - + list1 = list1->next; list2 = list2->next; } @@ -1373,14 +1373,14 @@ int ventoy_data_save_menu_tip(data_tip *data, const char *title, char *buf, int int pos = 0; data_tip_node *node = NULL; data_tip *def = g_data_menu_tip + bios_max; - + VTOY_JSON_FMT_BEGIN(pos, buf, buflen); VTOY_JSON_FMT_KEY_L(L1, title); VTOY_JSON_FMT_OBJ_BEGIN_N(); - VTOY_JSON_FMT_DIFF_STRN(L2, "left", left); - VTOY_JSON_FMT_DIFF_STRN(L2, "top", top); - VTOY_JSON_FMT_DIFF_STRN(L2, "color", color); + VTOY_JSON_FMT_DIFF_STRN(L2, "left", left); + VTOY_JSON_FMT_DIFF_STRN(L2, "top", top); + VTOY_JSON_FMT_DIFF_STRN(L2, "color", color); if (data->list) { @@ -1393,22 +1393,22 @@ int ventoy_data_save_menu_tip(data_tip *data, const char *title, char *buf, int if (node->type == path_type_file) { - VTOY_JSON_FMT_STRN_PATH_LN(L4, "image", node->path); + VTOY_JSON_FMT_STRN_PATH_LN(L4, "image", node->path); } else { VTOY_JSON_FMT_STRN_PATH_LN(L4, "dir", node->path); } VTOY_JSON_FMT_STRN_EX_LN(L4, "tip", node->tip); - + VTOY_JSON_FMT_OBJ_ENDEX_LN(L3); } VTOY_JSON_FMT_ARY_ENDEX_LN(L2); } - + VTOY_JSON_FMT_OBJ_ENDEX_LN(L1); - + VTOY_JSON_FMT_END(pos); return pos; @@ -1420,11 +1420,11 @@ int ventoy_data_json_menu_tip(data_tip *data, char *buf, int buflen) int pos = 0; int valid = 0; data_tip_node *node = NULL; - + VTOY_JSON_FMT_BEGIN(pos, buf, buflen); VTOY_JSON_FMT_OBJ_BEGIN(); - + VTOY_JSON_FMT_STRN("left", data->left); VTOY_JSON_FMT_STRN("top", data->top); VTOY_JSON_FMT_STRN("color", data->color); @@ -1446,10 +1446,10 @@ int ventoy_data_json_menu_tip(data_tip *data, char *buf, int buflen) { valid = ventoy_is_directory_exist("%s%s", g_cur_dir, node->path); } - + VTOY_JSON_FMT_SINT("valid", valid); VTOY_JSON_FMT_STRN("tip", node->tip); - + VTOY_JSON_FMT_OBJ_ENDEX(); } @@ -1472,7 +1472,7 @@ static int ventoy_api_save_tip(struct mg_connection *conn, VTOY_JSON *json) int ret; int index = 0; data_tip *data = NULL; - + vtoy_json_get_int(json, "index", &index); data = g_data_menu_tip + index; @@ -1482,7 +1482,7 @@ static int ventoy_api_save_tip(struct mg_connection *conn, VTOY_JSON *json) ret = ventoy_data_save_all(); - ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); + ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); return 0; } @@ -1496,7 +1496,7 @@ static int ventoy_api_tip_add(struct mg_connection *conn, VTOY_JSON *json) data_tip_node *node = NULL; data_tip_node *cur = NULL; data_tip *data = NULL; - + vtoy_json_get_int(json, "index", &index); data = g_data_menu_tip + index; @@ -1511,21 +1511,21 @@ static int ventoy_api_tip_add(struct mg_connection *conn, VTOY_JSON *json) ventoy_json_result(conn, VTOY_JSON_DUPLICATE); return 0; } - + node = zalloc(sizeof(data_tip_node)); if (node) { node->type = type; scnprintf(node->path, sizeof(node->path), "%s", path); scnprintf(node->tip, sizeof(node->tip), "%s", tip); - + vtoy_list_add(data->list, cur, node); } } ret = ventoy_data_save_all(); - ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); + ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); return 0; } @@ -1537,7 +1537,7 @@ static int ventoy_api_tip_del(struct mg_connection *conn, VTOY_JSON *json) data_tip_node *last = NULL; data_tip_node *node = NULL; data_tip *data = NULL; - + vtoy_json_get_int(json, "index", &index); data = g_data_menu_tip + index; @@ -1546,17 +1546,17 @@ static int ventoy_api_tip_del(struct mg_connection *conn, VTOY_JSON *json) { if (strcmp(path, VTOY_DEL_ALL_PATH) == 0) { - vtoy_list_free(data_tip_node, data->list); + vtoy_list_free(data_tip_node, data->list); } else { - vtoy_list_del(last, node, data->list, path); + vtoy_list_del(last, node, data->list, path); } } ret = ventoy_data_save_all(); - ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); + ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); return 0; } @@ -1581,16 +1581,16 @@ int ventoy_data_cmp_menu_class(data_class *data1, data_class *data2) { list1 = data1->list; list2 = data2->list; - + while (list1 && list2) { - if ((list1->type != list2->type) || - strcmp(list1->path, list2->path) || + if ((list1->type != list2->type) || + strcmp(list1->path, list2->path) || strcmp(list1->class, list2->class)) { return 1; } - + list1 = list1->next; list2 = list2->next; } @@ -1614,7 +1614,7 @@ int ventoy_data_save_menu_class(data_class *data, const char *title, char *buf, { int pos = 0; data_class_node *node = NULL; - + VTOY_JSON_FMT_BEGIN(pos, buf, buflen); VTOY_JSON_FMT_KEY_L(L1, title); @@ -1626,7 +1626,7 @@ int ventoy_data_save_menu_class(data_class *data, const char *title, char *buf, if (node->type == class_type_key) { - VTOY_JSON_FMT_STRN_LN(L3, "key", node->path); + VTOY_JSON_FMT_STRN_LN(L3, "key", node->path); } else if (node->type == class_type_dir) { @@ -1637,7 +1637,7 @@ int ventoy_data_save_menu_class(data_class *data, const char *title, char *buf, VTOY_JSON_FMT_STRN_PATH_LN(L3, "parent", node->path); } VTOY_JSON_FMT_STRN_LN(L3, "class", node->class); - + VTOY_JSON_FMT_OBJ_ENDEX_LN(L2); } @@ -1653,7 +1653,7 @@ int ventoy_data_json_menu_class(data_class *data, char *buf, int buflen) int pos = 0; int valid = 0; data_class_node *node = NULL; - + VTOY_JSON_FMT_BEGIN(pos, buf, buflen); VTOY_JSON_FMT_ARY_BEGIN(); @@ -1662,7 +1662,7 @@ int ventoy_data_json_menu_class(data_class *data, char *buf, int buflen) VTOY_JSON_FMT_OBJ_BEGIN(); VTOY_JSON_FMT_UINT("type", node->type); - VTOY_JSON_FMT_STRN("path", node->path); + VTOY_JSON_FMT_STRN("path", node->path); if (node->type == class_type_key) { @@ -1673,9 +1673,9 @@ int ventoy_data_json_menu_class(data_class *data, char *buf, int buflen) valid = ventoy_is_directory_exist("%s%s", g_cur_dir, node->path); } VTOY_JSON_FMT_SINT("valid", valid); - + VTOY_JSON_FMT_STRN("class", node->class); - + VTOY_JSON_FMT_OBJ_ENDEX(); } @@ -1697,7 +1697,7 @@ static int ventoy_api_save_class(struct mg_connection *conn, VTOY_JSON *json) int ret; ret = ventoy_data_save_all(); - ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); + ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); return 0; } @@ -1711,7 +1711,7 @@ static int ventoy_api_class_add(struct mg_connection *conn, VTOY_JSON *json) data_class_node *node = NULL; data_class_node *cur = NULL; data_class *data = NULL; - + vtoy_json_get_int(json, "index", &index); data = g_data_menu_class + index; @@ -1725,17 +1725,17 @@ static int ventoy_api_class_add(struct mg_connection *conn, VTOY_JSON *json) if (node) { node->type = type; - + scnprintf(node->path, sizeof(node->path), "%s", path); scnprintf(node->class, sizeof(node->class), "%s", class); - + vtoy_list_add(data->list, cur, node); } } ret = ventoy_data_save_all(); - ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); + ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); return 0; } @@ -1747,7 +1747,7 @@ static int ventoy_api_class_del(struct mg_connection *conn, VTOY_JSON *json) data_class_node *last = NULL; data_class_node *node = NULL; data_class *data = NULL; - + vtoy_json_get_int(json, "index", &index); data = g_data_menu_class + index; @@ -1760,13 +1760,13 @@ static int ventoy_api_class_del(struct mg_connection *conn, VTOY_JSON *json) } else { - vtoy_list_del(last, node, data->list, path); + vtoy_list_del(last, node, data->list, path); } } ret = ventoy_data_save_all(); - ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); + ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); return 0; } @@ -1787,7 +1787,7 @@ int ventoy_data_save_auto_memdisk(data_auto_memdisk *data, const char *title, ch { int pos = 0; path_node *node = NULL; - + VTOY_JSON_FMT_BEGIN(pos, buf, buflen); VTOY_JSON_FMT_KEY_L(L1, title); @@ -1809,7 +1809,7 @@ int ventoy_data_json_auto_memdisk(data_auto_memdisk *data, char *buf, int buflen int pos = 0; int valid = 0; path_node *node = NULL; - + VTOY_JSON_FMT_BEGIN(pos, buf, buflen); VTOY_JSON_FMT_ARY_BEGIN(); @@ -1817,10 +1817,10 @@ int ventoy_data_json_auto_memdisk(data_auto_memdisk *data, char *buf, int buflen { VTOY_JSON_FMT_OBJ_BEGIN(); - VTOY_JSON_FMT_STRN("path", node->path); + VTOY_JSON_FMT_STRN("path", node->path); valid = ventoy_check_fuzzy_path(node->path, 1); - VTOY_JSON_FMT_SINT("valid", valid); - + VTOY_JSON_FMT_SINT("valid", valid); + VTOY_JSON_FMT_OBJ_ENDEX(); } @@ -1839,7 +1839,7 @@ static int ventoy_api_get_auto_memdisk(struct mg_connection *conn, VTOY_JSON *js static int ventoy_api_save_auto_memdisk(struct mg_connection *conn, VTOY_JSON *json) { int ret; - + ret = ventoy_data_save_all(); ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); @@ -1854,7 +1854,7 @@ static int ventoy_api_auto_memdisk_add(struct mg_connection *conn, VTOY_JSON *js path_node *node = NULL; path_node *cur = NULL; data_auto_memdisk *data = NULL; - + vtoy_json_get_int(json, "index", &index); data = g_data_auto_memdisk + index; @@ -1889,7 +1889,7 @@ static int ventoy_api_auto_memdisk_del(struct mg_connection *conn, VTOY_JSON *js path_node *last = NULL; path_node *node = NULL; data_auto_memdisk *data = NULL; - + vtoy_json_get_int(json, "index", &index); data = g_data_auto_memdisk + index; @@ -1902,13 +1902,13 @@ static int ventoy_api_auto_memdisk_del(struct mg_connection *conn, VTOY_JSON *js } else { - vtoy_list_del(last, node, data->list, path); + vtoy_list_del(last, node, data->list, path); } } ret = ventoy_data_save_all(); - ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); + ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); return 0; } @@ -1964,7 +1964,7 @@ int ventoy_data_save_image_list(data_image_list *data, const char *title, char * scnprintf(newtitle, sizeof(newtitle), "image_blacklist%s", title + prelen); } VTOY_JSON_FMT_KEY_L(L1, newtitle); - + VTOY_JSON_FMT_ARY_BEGIN_N(); for (node = data->list; node; node = node->next) @@ -1983,12 +1983,12 @@ int ventoy_data_json_image_list(data_image_list *data, char *buf, int buflen) int pos = 0; int valid = 0; path_node *node = NULL; - + VTOY_JSON_FMT_BEGIN(pos, buf, buflen); - + VTOY_JSON_FMT_OBJ_BEGIN(); - VTOY_JSON_FMT_SINT("type", data->type); - + VTOY_JSON_FMT_SINT("type", data->type); + VTOY_JSON_FMT_KEY("list"); VTOY_JSON_FMT_ARY_BEGIN(); @@ -1996,16 +1996,16 @@ int ventoy_data_json_image_list(data_image_list *data, char *buf, int buflen) { VTOY_JSON_FMT_OBJ_BEGIN(); - VTOY_JSON_FMT_STRN("path", node->path); + VTOY_JSON_FMT_STRN("path", node->path); valid = ventoy_check_fuzzy_path(node->path, 1); - VTOY_JSON_FMT_SINT("valid", valid); - + VTOY_JSON_FMT_SINT("valid", valid); + VTOY_JSON_FMT_OBJ_ENDEX(); } VTOY_JSON_FMT_ARY_ENDEX(); VTOY_JSON_FMT_OBJ_END(); - + VTOY_JSON_FMT_END(pos); return pos; @@ -2022,7 +2022,7 @@ static int ventoy_api_save_image_list(struct mg_connection *conn, VTOY_JSON *jso int ret; int index = 0; data_image_list *data = NULL; - + vtoy_json_get_int(json, "index", &index); data = g_data_image_list + index; @@ -2030,7 +2030,7 @@ static int ventoy_api_save_image_list(struct mg_connection *conn, VTOY_JSON *jso ret = ventoy_data_save_all(); - ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); + ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); return 0; } @@ -2042,7 +2042,7 @@ static int ventoy_api_image_list_add(struct mg_connection *conn, VTOY_JSON *json path_node *node = NULL; path_node *cur = NULL; data_image_list *data = NULL; - + vtoy_json_get_int(json, "index", &index); data = g_data_image_list + index; @@ -2077,7 +2077,7 @@ static int ventoy_api_image_list_del(struct mg_connection *conn, VTOY_JSON *json path_node *last = NULL; path_node *node = NULL; data_image_list *data = NULL; - + vtoy_json_get_int(json, "index", &index); data = g_data_image_list + index; @@ -2090,13 +2090,13 @@ static int ventoy_api_image_list_del(struct mg_connection *conn, VTOY_JSON *json } else { - vtoy_list_del(last, node, data->list, path); + vtoy_list_del(last, node, data->list, path); } } ret = ventoy_data_save_all(); - ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); + ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); return 0; } @@ -2113,12 +2113,12 @@ int ventoy_data_cmp_password(data_password *data1, data_password *data2) menu_password *list1 = NULL; menu_password *list2 = NULL; - if (strcmp(data1->bootpwd, data2->bootpwd) || - strcmp(data1->isopwd, data2->isopwd) || - strcmp(data1->wimpwd, data2->wimpwd) || - strcmp(data1->vhdpwd, data2->vhdpwd) || - strcmp(data1->imgpwd, data2->imgpwd) || - strcmp(data1->efipwd, data2->efipwd) || + if (strcmp(data1->bootpwd, data2->bootpwd) || + strcmp(data1->isopwd, data2->isopwd) || + strcmp(data1->wimpwd, data2->wimpwd) || + strcmp(data1->vhdpwd, data2->vhdpwd) || + strcmp(data1->imgpwd, data2->imgpwd) || + strcmp(data1->efipwd, data2->efipwd) || strcmp(data1->vtoypwd, data2->vtoypwd) ) { @@ -2133,14 +2133,14 @@ int ventoy_data_cmp_password(data_password *data1, data_password *data2) { list1 = data1->list; list2 = data2->list; - + while (list1 && list2) { if ((list1->type != list2->type) || strcmp(list1->path, list2->path)) { return 1; } - + list1 = list1->next; list2 = list2->next; } @@ -2165,7 +2165,7 @@ int ventoy_data_save_password(data_password *data, const char *title, char *buf, int pos = 0; menu_password *node = NULL; data_password *def = g_data_password + bios_max; - + VTOY_JSON_FMT_BEGIN(pos, buf, buflen); VTOY_JSON_FMT_KEY_L(L1, title); VTOY_JSON_FMT_OBJ_BEGIN_N(); @@ -2189,22 +2189,22 @@ int ventoy_data_save_password(data_password *data, const char *title, char *buf, if (node->type == 0) { - VTOY_JSON_FMT_STRN_PATH_LN(L4, "file", node->path); + VTOY_JSON_FMT_STRN_PATH_LN(L4, "file", node->path); } else { VTOY_JSON_FMT_STRN_PATH_LN(L4, "parent", node->path); } VTOY_JSON_FMT_STRN_LN(L4, "pwd", node->pwd); - + VTOY_JSON_FMT_OBJ_ENDEX_LN(L3); } VTOY_JSON_FMT_ARY_ENDEX_LN(L2); } - + VTOY_JSON_FMT_OBJ_ENDEX_LN(L1); - + VTOY_JSON_FMT_END(pos); return pos; @@ -2216,7 +2216,7 @@ int ventoy_data_json_password(data_password *data, char *buf, int buflen) int pos = 0; int valid = 0; menu_password *node = NULL; - + VTOY_JSON_FMT_BEGIN(pos, buf, buflen); VTOY_JSON_FMT_OBJ_BEGIN(); @@ -2246,10 +2246,10 @@ int ventoy_data_json_password(data_password *data, char *buf, int buflen) { valid = ventoy_is_directory_exist("%s%s", g_cur_dir, node->path); } - + VTOY_JSON_FMT_SINT("valid", valid); VTOY_JSON_FMT_STRN("pwd", node->pwd); - + VTOY_JSON_FMT_OBJ_ENDEX(); } @@ -2272,7 +2272,7 @@ static int ventoy_api_save_password(struct mg_connection *conn, VTOY_JSON *json) int ret; int index = 0; data_password *data = NULL; - + vtoy_json_get_int(json, "index", &index); data = g_data_password + index; @@ -2286,7 +2286,7 @@ static int ventoy_api_save_password(struct mg_connection *conn, VTOY_JSON *json) ret = ventoy_data_save_all(); - ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); + ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); return 0; } @@ -2300,7 +2300,7 @@ static int ventoy_api_password_add(struct mg_connection *conn, VTOY_JSON *json) menu_password *node = NULL; menu_password *cur = NULL; data_password *data = NULL; - + vtoy_json_get_int(json, "index", &index); data = g_data_password + index; @@ -2322,14 +2322,14 @@ static int ventoy_api_password_add(struct mg_connection *conn, VTOY_JSON *json) node->type = type; scnprintf(node->path, sizeof(node->path), "%s", path); scnprintf(node->pwd, sizeof(node->pwd), "%s", pwd); - + vtoy_list_add(data->list, cur, node); } } ret = ventoy_data_save_all(); - ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); + ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); return 0; } @@ -2341,7 +2341,7 @@ static int ventoy_api_password_del(struct mg_connection *conn, VTOY_JSON *json) menu_password *last = NULL; menu_password *node = NULL; data_password *data = NULL; - + vtoy_json_get_int(json, "index", &index); data = g_data_password + index; @@ -2354,13 +2354,13 @@ static int ventoy_api_password_del(struct mg_connection *conn, VTOY_JSON *json) } else { - vtoy_list_del(last, node, data->list, path); + vtoy_list_del(last, node, data->list, path); } } ret = ventoy_data_save_all(); - ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); + ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); return 0; } @@ -2385,18 +2385,18 @@ int ventoy_data_cmp_conf_replace(data_conf_replace *data1, data_conf_replace *da { list1 = data1->list; list2 = data2->list; - + while (list1 && list2) { if (list1->image != list2->image || - strcmp(list1->path, list2->path) || - strcmp(list1->org, list2->org) || + strcmp(list1->path, list2->path) || + strcmp(list1->org, list2->org) || strcmp(list1->new, list2->new) ) { return 1; } - + list1 = list1->next; list2 = list2->next; } @@ -2420,7 +2420,7 @@ int ventoy_data_save_conf_replace(data_conf_replace *data, const char *title, ch { int pos = 0; conf_replace_node *node = NULL; - + VTOY_JSON_FMT_BEGIN(pos, buf, buflen); VTOY_JSON_FMT_KEY_L(L1, title); @@ -2435,9 +2435,9 @@ int ventoy_data_save_conf_replace(data_conf_replace *data, const char *title, ch VTOY_JSON_FMT_STRN_PATH_LN(L3, "new", node->new); if (node->image) { - VTOY_JSON_FMT_SINT_LN(L3, "img", node->image); + VTOY_JSON_FMT_SINT_LN(L3, "img", node->image); } - + VTOY_JSON_FMT_OBJ_ENDEX_LN(L2); } @@ -2452,7 +2452,7 @@ int ventoy_data_json_conf_replace(data_conf_replace *data, char *buf, int buflen { int pos = 0; conf_replace_node *node = NULL; - + VTOY_JSON_FMT_BEGIN(pos, buf, buflen); VTOY_JSON_FMT_ARY_BEGIN(); @@ -2466,7 +2466,7 @@ int ventoy_data_json_conf_replace(data_conf_replace *data, char *buf, int buflen VTOY_JSON_FMT_STRN("new", node->new); VTOY_JSON_FMT_SINT("new_valid", ventoy_is_file_exist("%s%s", g_cur_dir, node->new)); VTOY_JSON_FMT_SINT("img", node->image); - + VTOY_JSON_FMT_OBJ_ENDEX(); } @@ -2487,7 +2487,7 @@ static int ventoy_api_save_conf_replace(struct mg_connection *conn, VTOY_JSON *j int ret; ret = ventoy_data_save_all(); - ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); + ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); return 0; } @@ -2502,9 +2502,9 @@ static int ventoy_api_conf_replace_add(struct mg_connection *conn, VTOY_JSON *js conf_replace_node *node = NULL; conf_replace_node *cur = NULL; data_conf_replace *data = NULL; - + vtoy_json_get_int(json, "img", &image); - + vtoy_json_get_int(json, "index", &index); data = g_data_conf_replace + index; @@ -2520,14 +2520,14 @@ static int ventoy_api_conf_replace_add(struct mg_connection *conn, VTOY_JSON *js scnprintf(node->path, sizeof(node->path), "%s", path); scnprintf(node->org, sizeof(node->org), "%s", org); scnprintf(node->new, sizeof(node->new), "%s", new); - + vtoy_list_add(data->list, cur, node); } } ret = ventoy_data_save_all(); - ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); + ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); return 0; } @@ -2539,7 +2539,7 @@ static int ventoy_api_conf_replace_del(struct mg_connection *conn, VTOY_JSON *js conf_replace_node *last = NULL; conf_replace_node *node = NULL; data_conf_replace *data = NULL; - + vtoy_json_get_int(json, "index", &index); data = g_data_conf_replace + index; @@ -2552,13 +2552,13 @@ static int ventoy_api_conf_replace_del(struct mg_connection *conn, VTOY_JSON *js } else { - vtoy_list_del(last, node, data->list, path); + vtoy_list_del(last, node, data->list, path); } } ret = ventoy_data_save_all(); - ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); + ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); return 0; } @@ -2584,7 +2584,7 @@ int ventoy_data_cmp_dud(data_dud *data1, data_dud *data2) { list1 = data1->list; list2 = data2->list; - + while (list1 && list2) { if (strcmp(list1->path, list2->path)) @@ -2617,7 +2617,7 @@ int ventoy_data_save_dud(data_dud *data, const char *title, char *buf, int bufle int pos = 0; dud_node *node = NULL; path_node *pathnode = NULL; - + VTOY_JSON_FMT_BEGIN(pos, buf, buflen); VTOY_JSON_FMT_KEY_L(L1, title); @@ -2626,7 +2626,7 @@ int ventoy_data_save_dud(data_dud *data, const char *title, char *buf, int bufle for (node = data->list; node; node = node->next) { VTOY_JSON_FMT_OBJ_BEGIN_LN(L2); - VTOY_JSON_FMT_STRN_PATH_LN(L3, "image", node->path); + VTOY_JSON_FMT_STRN_PATH_LN(L3, "image", node->path); VTOY_JSON_FMT_KEY_L(L3, "dud"); VTOY_JSON_FMT_ARY_BEGIN_N(); @@ -2634,8 +2634,8 @@ int ventoy_data_save_dud(data_dud *data, const char *title, char *buf, int bufle { VTOY_JSON_FMT_ITEM_PATH_LN(L4, pathnode->path); } - VTOY_JSON_FMT_ARY_ENDEX_LN(L3); - + VTOY_JSON_FMT_ARY_ENDEX_LN(L3); + VTOY_JSON_FMT_OBJ_ENDEX_LN(L2); } @@ -2652,7 +2652,7 @@ int ventoy_data_json_dud(data_dud *data, char *buf, int buflen) int valid = 0; dud_node *node = NULL; path_node *pathnode = NULL; - + VTOY_JSON_FMT_BEGIN(pos, buf, buflen); VTOY_JSON_FMT_ARY_BEGIN(); @@ -2663,7 +2663,7 @@ int ventoy_data_json_dud(data_dud *data, char *buf, int buflen) VTOY_JSON_FMT_STRN("path", node->path); valid = ventoy_check_fuzzy_path(node->path, 1); VTOY_JSON_FMT_SINT("valid", valid); - + VTOY_JSON_FMT_KEY("list"); VTOY_JSON_FMT_ARY_BEGIN(); @@ -2676,9 +2676,9 @@ int ventoy_data_json_dud(data_dud *data, char *buf, int buflen) VTOY_JSON_FMT_SINT("valid", valid); VTOY_JSON_FMT_OBJ_ENDEX(); } - VTOY_JSON_FMT_ARY_ENDEX(); + VTOY_JSON_FMT_ARY_ENDEX(); + - VTOY_JSON_FMT_OBJ_ENDEX(); } @@ -2699,7 +2699,7 @@ static int ventoy_api_save_dud(struct mg_connection *conn, VTOY_JSON *json) int ret; ret = ventoy_data_save_all(); - ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); + ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); return 0; } @@ -2713,7 +2713,7 @@ static int ventoy_api_dud_add(struct mg_connection *conn, VTOY_JSON *json) dud_node *cur = NULL; data_dud *data = NULL; VTOY_JSON *array = NULL; - + vtoy_json_get_int(json, "index", &index); data = g_data_dud + index; @@ -2726,20 +2726,20 @@ static int ventoy_api_dud_add(struct mg_connection *conn, VTOY_JSON *json) ventoy_json_result(conn, VTOY_JSON_DUPLICATE); return 0; } - + node = zalloc(sizeof(dud_node)); if (node) { scnprintf(node->path, sizeof(node->path), "%s", path); node->list = ventoy_path_node_add_array(array); - + vtoy_list_add(data->list, cur, node); } } ret = ventoy_data_save_all(); - ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); + ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); return 0; } @@ -2752,7 +2752,7 @@ static int ventoy_api_dud_del(struct mg_connection *conn, VTOY_JSON *json) dud_node *last = NULL; dud_node *node = NULL; data_dud *data = NULL; - + vtoy_json_get_int(json, "index", &index); data = g_data_dud + index; @@ -2777,7 +2777,7 @@ static int ventoy_api_dud_del(struct mg_connection *conn, VTOY_JSON *json) ret = ventoy_data_save_all(); - ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); + ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); return 0; } @@ -2792,7 +2792,7 @@ static int ventoy_api_dud_add_inner(struct mg_connection *conn, VTOY_JSON *json) path_node *pnode = NULL; dud_node *node = NULL; data_dud *data = NULL; - + vtoy_json_get_int(json, "index", &index); data = g_data_dud + index; @@ -2810,7 +2810,7 @@ static int ventoy_api_dud_add_inner(struct mg_connection *conn, VTOY_JSON *json) scnprintf(pnode->path, sizeof(pnode->path), "%s", path); vtoy_list_add(node->list, pcur, pnode); } - + break; } } @@ -2818,7 +2818,7 @@ static int ventoy_api_dud_add_inner(struct mg_connection *conn, VTOY_JSON *json) ret = ventoy_data_save_all(); - ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); + ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); return 0; } @@ -2832,7 +2832,7 @@ static int ventoy_api_dud_del_inner(struct mg_connection *conn, VTOY_JSON *json) path_node *pnode = NULL; dud_node *node = NULL; data_dud *data = NULL; - + vtoy_json_get_int(json, "index", &index); data = g_data_dud + index; @@ -2852,7 +2852,7 @@ static int ventoy_api_dud_del_inner(struct mg_connection *conn, VTOY_JSON *json) ret = ventoy_data_save_all(); - ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); + ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); return 0; } @@ -2878,7 +2878,7 @@ int ventoy_data_cmp_auto_install(data_auto_install *data1, data_auto_install *da { list1 = data1->list; list2 = data2->list; - + while (list1 && list2) { if (list1->timeout != list2->timeout || @@ -2913,7 +2913,7 @@ int ventoy_data_save_auto_install(data_auto_install *data, const char *title, ch int pos = 0; auto_install_node *node = NULL; path_node *pathnode = NULL; - + VTOY_JSON_FMT_BEGIN(pos, buf, buflen); VTOY_JSON_FMT_KEY_L(L1, title); @@ -2924,14 +2924,14 @@ int ventoy_data_save_auto_install(data_auto_install *data, const char *title, ch VTOY_JSON_FMT_OBJ_BEGIN_LN(L2); if (node->type == 0) { - VTOY_JSON_FMT_STRN_PATH_LN(L3, "image", node->path); + VTOY_JSON_FMT_STRN_PATH_LN(L3, "image", node->path); } else { - VTOY_JSON_FMT_STRN_PATH_LN(L3, "parent", node->path); + VTOY_JSON_FMT_STRN_PATH_LN(L3, "parent", node->path); } - + VTOY_JSON_FMT_KEY_L(L3, "template"); VTOY_JSON_FMT_ARY_BEGIN_N(); for (pathnode = node->list; pathnode; pathnode = pathnode->next) @@ -2947,7 +2947,7 @@ int ventoy_data_save_auto_install(data_auto_install *data, const char *title, ch if (node->autoselen) { - VTOY_JSON_FMT_SINT_LN(L3, "autosel", node->autosel); + VTOY_JSON_FMT_SINT_LN(L3, "autosel", node->autosel); } VTOY_JSON_FMT_OBJ_ENDEX_LN(L2); @@ -2966,7 +2966,7 @@ int ventoy_data_json_auto_install(data_auto_install *data, char *buf, int buflen int valid = 0; auto_install_node *node = NULL; path_node *pathnode = NULL; - + VTOY_JSON_FMT_BEGIN(pos, buf, buflen); VTOY_JSON_FMT_ARY_BEGIN(); @@ -2978,7 +2978,7 @@ int ventoy_data_json_auto_install(data_auto_install *data, char *buf, int buflen if (node->type == 0) { - valid = ventoy_check_fuzzy_path(node->path, 1); + valid = ventoy_check_fuzzy_path(node->path, 1); } else { @@ -2986,10 +2986,10 @@ int ventoy_data_json_auto_install(data_auto_install *data, char *buf, int buflen } VTOY_JSON_FMT_SINT("valid", valid); VTOY_JSON_FMT_SINT("type", node->type); - + VTOY_JSON_FMT_BOOL("timeouten", node->timeouten); VTOY_JSON_FMT_BOOL("autoselen", node->autoselen); - + VTOY_JSON_FMT_SINT("autosel", node->autosel); VTOY_JSON_FMT_SINT("timeout", node->timeout); @@ -3004,9 +3004,9 @@ int ventoy_data_json_auto_install(data_auto_install *data, char *buf, int buflen VTOY_JSON_FMT_SINT("valid", valid); VTOY_JSON_FMT_OBJ_ENDEX(); } - VTOY_JSON_FMT_ARY_ENDEX(); + VTOY_JSON_FMT_ARY_ENDEX(); + - VTOY_JSON_FMT_OBJ_ENDEX(); } @@ -3032,13 +3032,13 @@ static int ventoy_api_save_auto_install(struct mg_connection *conn, VTOY_JSON *j uint8_t autoselen = 0; auto_install_node *node = NULL; data_auto_install *data = NULL; - + vtoy_json_get_int(json, "index", &index); vtoy_json_get_int(json, "id", &id); vtoy_json_get_bool(json, "timeouten", &timeouten); vtoy_json_get_bool(json, "autoselen", &autoselen); - + data = g_data_auto_install + index; if (id >= 0) @@ -3058,7 +3058,7 @@ static int ventoy_api_save_auto_install(struct mg_connection *conn, VTOY_JSON *j ret = ventoy_data_save_all(); - ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); + ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); return 0; } @@ -3073,7 +3073,7 @@ static int ventoy_api_auto_install_add(struct mg_connection *conn, VTOY_JSON *js auto_install_node *cur = NULL; data_auto_install *data = NULL; VTOY_JSON *array = NULL; - + vtoy_json_get_int(json, "type", &type); vtoy_json_get_int(json, "index", &index); data = g_data_auto_install + index; @@ -3086,8 +3086,8 @@ static int ventoy_api_auto_install_add(struct mg_connection *conn, VTOY_JSON *js { ventoy_json_result(conn, VTOY_JSON_DUPLICATE); return 0; - } - + } + node = zalloc(sizeof(auto_install_node)); if (node) { @@ -3098,14 +3098,14 @@ static int ventoy_api_auto_install_add(struct mg_connection *conn, VTOY_JSON *js node->timeout = 0; scnprintf(node->path, sizeof(node->path), "%s", path); node->list = ventoy_path_node_add_array(array); - + vtoy_list_add(data->list, cur, node); } } ret = ventoy_data_save_all(); - ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); + ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); return 0; } @@ -3118,7 +3118,7 @@ static int ventoy_api_auto_install_del(struct mg_connection *conn, VTOY_JSON *js auto_install_node *next = NULL; auto_install_node *node = NULL; data_auto_install *data = NULL; - + vtoy_json_get_int(json, "index", &index); data = g_data_auto_install + index; @@ -3137,13 +3137,13 @@ static int ventoy_api_auto_install_del(struct mg_connection *conn, VTOY_JSON *js } else { - vtoy_list_del_ex(last, node, data->list, path, ventoy_free_path_node_list); + vtoy_list_del_ex(last, node, data->list, path, ventoy_free_path_node_list); } } ret = ventoy_data_save_all(); - ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); + ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); return 0; } @@ -3157,7 +3157,7 @@ static int ventoy_api_auto_install_add_inner(struct mg_connection *conn, VTOY_JS path_node *pnode = NULL; auto_install_node *node = NULL; data_auto_install *data = NULL; - + vtoy_json_get_int(json, "index", &index); data = g_data_auto_install + index; @@ -3175,7 +3175,7 @@ static int ventoy_api_auto_install_add_inner(struct mg_connection *conn, VTOY_JS scnprintf(pnode->path, sizeof(pnode->path), "%s", path); vtoy_list_add(node->list, pcur, pnode); } - + break; } } @@ -3183,7 +3183,7 @@ static int ventoy_api_auto_install_add_inner(struct mg_connection *conn, VTOY_JS ret = ventoy_data_save_all(); - ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); + ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); return 0; } @@ -3197,7 +3197,7 @@ static int ventoy_api_auto_install_del_inner(struct mg_connection *conn, VTOY_JS path_node *pnode = NULL; auto_install_node *node = NULL; data_auto_install *data = NULL; - + vtoy_json_get_int(json, "index", &index); data = g_data_auto_install + index; @@ -3217,7 +3217,7 @@ static int ventoy_api_auto_install_del_inner(struct mg_connection *conn, VTOY_JS ret = ventoy_data_save_all(); - ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); + ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); return 0; } @@ -3244,7 +3244,7 @@ int ventoy_data_cmp_persistence(data_persistence *data1, data_persistence *data2 { list1 = data1->list; list2 = data2->list; - + while (list1 && list2) { if (list1->timeout != list2->timeout || @@ -3279,7 +3279,7 @@ int ventoy_data_save_persistence(data_persistence *data, const char *title, char int pos = 0; persistence_node *node = NULL; path_node *pathnode = NULL; - + VTOY_JSON_FMT_BEGIN(pos, buf, buflen); VTOY_JSON_FMT_KEY_L(L1, title); @@ -3288,7 +3288,7 @@ int ventoy_data_save_persistence(data_persistence *data, const char *title, char for (node = data->list; node; node = node->next) { VTOY_JSON_FMT_OBJ_BEGIN_LN(L2); - VTOY_JSON_FMT_STRN_PATH_LN(L3, "image", node->path); + VTOY_JSON_FMT_STRN_PATH_LN(L3, "image", node->path); VTOY_JSON_FMT_KEY_L(L3, "backend"); VTOY_JSON_FMT_ARY_BEGIN_N(); for (pathnode = node->list; pathnode; pathnode = pathnode->next) @@ -3304,7 +3304,7 @@ int ventoy_data_save_persistence(data_persistence *data, const char *title, char if (node->autoselen) { - VTOY_JSON_FMT_SINT_LN(L3, "autosel", node->autosel); + VTOY_JSON_FMT_SINT_LN(L3, "autosel", node->autosel); } VTOY_JSON_FMT_OBJ_ENDEX_LN(L2); @@ -3323,7 +3323,7 @@ int ventoy_data_json_persistence(data_persistence *data, char *buf, int buflen) int valid = 0; persistence_node *node = NULL; path_node *pathnode = NULL; - + VTOY_JSON_FMT_BEGIN(pos, buf, buflen); VTOY_JSON_FMT_ARY_BEGIN(); @@ -3333,13 +3333,13 @@ int ventoy_data_json_persistence(data_persistence *data, char *buf, int buflen) VTOY_JSON_FMT_STRN("path", node->path); - valid = ventoy_check_fuzzy_path(node->path, 1); + valid = ventoy_check_fuzzy_path(node->path, 1); VTOY_JSON_FMT_SINT("valid", valid); VTOY_JSON_FMT_SINT("type", node->type); - + VTOY_JSON_FMT_BOOL("timeouten", node->timeouten); VTOY_JSON_FMT_BOOL("autoselen", node->autoselen); - + VTOY_JSON_FMT_SINT("autosel", node->autosel); VTOY_JSON_FMT_SINT("timeout", node->timeout); @@ -3354,9 +3354,9 @@ int ventoy_data_json_persistence(data_persistence *data, char *buf, int buflen) VTOY_JSON_FMT_SINT("valid", valid); VTOY_JSON_FMT_OBJ_ENDEX(); } - VTOY_JSON_FMT_ARY_ENDEX(); + VTOY_JSON_FMT_ARY_ENDEX(); + - VTOY_JSON_FMT_OBJ_ENDEX(); } @@ -3382,13 +3382,13 @@ static int ventoy_api_save_persistence(struct mg_connection *conn, VTOY_JSON *js uint8_t autoselen = 0; persistence_node *node = NULL; data_persistence *data = NULL; - + vtoy_json_get_int(json, "index", &index); vtoy_json_get_int(json, "id", &id); vtoy_json_get_bool(json, "timeouten", &timeouten); vtoy_json_get_bool(json, "autoselen", &autoselen); - + data = g_data_persistence + index; if (id >= 0) @@ -3408,7 +3408,7 @@ static int ventoy_api_save_persistence(struct mg_connection *conn, VTOY_JSON *js ret = ventoy_data_save_all(); - ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); + ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); return 0; } @@ -3422,7 +3422,7 @@ static int ventoy_api_persistence_add(struct mg_connection *conn, VTOY_JSON *jso persistence_node *cur = NULL; data_persistence *data = NULL; VTOY_JSON *array = NULL; - + vtoy_json_get_int(json, "index", &index); data = g_data_persistence + index; @@ -3435,7 +3435,7 @@ static int ventoy_api_persistence_add(struct mg_connection *conn, VTOY_JSON *jso ventoy_json_result(conn, VTOY_JSON_DUPLICATE); return 0; } - + node = zalloc(sizeof(persistence_node)); if (node) { @@ -3445,14 +3445,14 @@ static int ventoy_api_persistence_add(struct mg_connection *conn, VTOY_JSON *jso node->timeout = 0; scnprintf(node->path, sizeof(node->path), "%s", path); node->list = ventoy_path_node_add_array(array); - + vtoy_list_add(data->list, cur, node); } } ret = ventoy_data_save_all(); - ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); + ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); return 0; } @@ -3465,7 +3465,7 @@ static int ventoy_api_persistence_del(struct mg_connection *conn, VTOY_JSON *jso persistence_node *next = NULL; persistence_node *node = NULL; data_persistence *data = NULL; - + vtoy_json_get_int(json, "index", &index); data = g_data_persistence + index; @@ -3484,13 +3484,13 @@ static int ventoy_api_persistence_del(struct mg_connection *conn, VTOY_JSON *jso } else { - vtoy_list_del_ex(last, node, data->list, path, ventoy_free_path_node_list); - } + vtoy_list_del_ex(last, node, data->list, path, ventoy_free_path_node_list); + } } ret = ventoy_data_save_all(); - ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); + ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); return 0; } @@ -3504,7 +3504,7 @@ static int ventoy_api_persistence_add_inner(struct mg_connection *conn, VTOY_JSO path_node *pnode = NULL; persistence_node *node = NULL; data_persistence *data = NULL; - + vtoy_json_get_int(json, "index", &index); data = g_data_persistence + index; @@ -3522,7 +3522,7 @@ static int ventoy_api_persistence_add_inner(struct mg_connection *conn, VTOY_JSO scnprintf(pnode->path, sizeof(pnode->path), "%s", path); vtoy_list_add(node->list, pcur, pnode); } - + break; } } @@ -3530,7 +3530,7 @@ static int ventoy_api_persistence_add_inner(struct mg_connection *conn, VTOY_JSO ret = ventoy_data_save_all(); - ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); + ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); return 0; } @@ -3544,7 +3544,7 @@ static int ventoy_api_persistence_del_inner(struct mg_connection *conn, VTOY_JSO path_node *pnode = NULL; persistence_node *node = NULL; data_persistence *data = NULL; - + vtoy_json_get_int(json, "index", &index); data = g_data_persistence + index; @@ -3564,7 +3564,7 @@ static int ventoy_api_persistence_del_inner(struct mg_connection *conn, VTOY_JSO ret = ventoy_data_save_all(); - ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); + ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); return 0; } @@ -3590,16 +3590,16 @@ int ventoy_data_cmp_injection(data_injection *data1, data_injection *data2) { list1 = data1->list; list2 = data2->list; - + while (list1 && list2) { if ((list1->type != list2->type) || - strcmp(list1->path, list2->path) || + strcmp(list1->path, list2->path) || strcmp(list1->archive, list2->archive)) { return 1; } - + list1 = list1->next; list2 = list2->next; } @@ -3623,7 +3623,7 @@ int ventoy_data_save_injection(data_injection *data, const char *title, char *bu { int pos = 0; injection_node *node = NULL; - + VTOY_JSON_FMT_BEGIN(pos, buf, buflen); VTOY_JSON_FMT_KEY_L(L1, title); @@ -3635,14 +3635,14 @@ int ventoy_data_save_injection(data_injection *data, const char *title, char *bu if (node->type == 0) { - VTOY_JSON_FMT_STRN_PATH_LN(L3, "image", node->path); + VTOY_JSON_FMT_STRN_PATH_LN(L3, "image", node->path); } else { VTOY_JSON_FMT_STRN_PATH_LN(L3, "parent", node->path); } VTOY_JSON_FMT_STRN_PATH_LN(L3, "archive", node->archive); - + VTOY_JSON_FMT_OBJ_ENDEX_LN(L2); } @@ -3658,7 +3658,7 @@ int ventoy_data_json_injection(data_injection *data, char *buf, int buflen) int pos = 0; int valid = 0; injection_node *node = NULL; - + VTOY_JSON_FMT_BEGIN(pos, buf, buflen); VTOY_JSON_FMT_ARY_BEGIN(); @@ -3667,7 +3667,7 @@ int ventoy_data_json_injection(data_injection *data, char *buf, int buflen) VTOY_JSON_FMT_OBJ_BEGIN(); VTOY_JSON_FMT_UINT("type", node->type); - VTOY_JSON_FMT_STRN("path", node->path); + VTOY_JSON_FMT_STRN("path", node->path); if (node->type == 0) { @@ -3678,12 +3678,12 @@ int ventoy_data_json_injection(data_injection *data, char *buf, int buflen) valid = ventoy_is_directory_exist("%s%s", g_cur_dir, node->path); } VTOY_JSON_FMT_SINT("valid", valid); - + VTOY_JSON_FMT_STRN("archive", node->archive); valid = ventoy_is_file_exist("%s%s", g_cur_dir, node->archive); VTOY_JSON_FMT_SINT("archive_valid", valid); - + VTOY_JSON_FMT_OBJ_ENDEX(); } @@ -3705,7 +3705,7 @@ static int ventoy_api_save_injection(struct mg_connection *conn, VTOY_JSON *json int ret; ret = ventoy_data_save_all(); - ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); + ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); return 0; } @@ -3719,7 +3719,7 @@ static int ventoy_api_injection_add(struct mg_connection *conn, VTOY_JSON *json) injection_node *node = NULL; injection_node *cur = NULL; data_injection *data = NULL; - + vtoy_json_get_int(json, "index", &index); data = g_data_injection + index; @@ -3734,22 +3734,22 @@ static int ventoy_api_injection_add(struct mg_connection *conn, VTOY_JSON *json) ventoy_json_result(conn, VTOY_JSON_DUPLICATE); return 0; } - + node = zalloc(sizeof(injection_node)); if (node) { node->type = type; - + scnprintf(node->path, sizeof(node->path), "%s", path); scnprintf(node->archive, sizeof(node->archive), "%s", archive); - + vtoy_list_add(data->list, cur, node); } } ret = ventoy_data_save_all(); - ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); + ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); return 0; } @@ -3761,7 +3761,7 @@ static int ventoy_api_injection_del(struct mg_connection *conn, VTOY_JSON *json) injection_node *last = NULL; injection_node *node = NULL; data_injection *data = NULL; - + vtoy_json_get_int(json, "index", &index); data = g_data_injection + index; @@ -3774,13 +3774,13 @@ static int ventoy_api_injection_del(struct mg_connection *conn, VTOY_JSON *json) } else { - vtoy_list_del(last, node, data->list, path); + vtoy_list_del(last, node, data->list, path); } } ret = ventoy_data_save_all(); - ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); + ventoy_json_result(conn, ret == 0 ? VTOY_JSON_SUCCESS_RET : VTOY_JSON_FAILED_RET); return 0; } @@ -3795,14 +3795,14 @@ static int ventoy_api_preview_json(struct mg_connection *conn, VTOY_JSON *json) int utf16enclen = 0; char *encodebuf = NULL; unsigned short *utf16buf = NULL; - + (void)json; /* We can not use json directly, because it will be formated in the JS. */ len = ventoy_data_real_save_all(0); - utf16buf = (unsigned short *)malloc(2 * len + 16); + utf16buf = (unsigned short *)malloc(2 * len + 16); if (!utf16buf) { goto json; @@ -3853,7 +3853,7 @@ int ventoy_data_real_save_all(int apilock) if (apilock) { - pthread_mutex_lock(&g_api_mutex); + pthread_mutex_lock(&g_api_mutex); } ssprintf(pos, JSON_SAVE_BUFFER, JSON_BUF_MAX, "{\n"); @@ -3871,7 +3871,7 @@ int ventoy_data_real_save_all(int apilock) ventoy_save_plug(image_list); ventoy_save_plug(auto_memdisk); ventoy_save_plug(dud); - + if (JSON_SAVE_BUFFER[pos - 1] == '\n' && JSON_SAVE_BUFFER[pos - 2] == ',') { JSON_SAVE_BUFFER[pos - 2] = '\n'; @@ -3881,7 +3881,7 @@ int ventoy_data_real_save_all(int apilock) if (apilock) { - pthread_mutex_unlock(&g_api_mutex); + pthread_mutex_unlock(&g_api_mutex); } return pos; @@ -3896,11 +3896,11 @@ int ventoy_http_writeback(void) ventoy_get_json_path(filename, NULL); pos = ventoy_data_real_save_all(1); - + #ifdef VENTOY_SIM printf("%s", JSON_SAVE_BUFFER); #endif - + ret = ventoy_write_buf_to_file(filename, JSON_SAVE_BUFFER, pos); if (ret) { @@ -3912,88 +3912,88 @@ int ventoy_http_writeback(void) } -static JSON_CB g_ventoy_json_cb[] = +static JSON_CB g_ventoy_json_cb[] = { - { "sysinfo", ventoy_api_sysinfo }, - { "handshake", ventoy_api_handshake }, - { "check_path", ventoy_api_check_exist }, - { "check_path2", ventoy_api_check_exist2 }, + { "sysinfo", ventoy_api_sysinfo }, + { "handshake", ventoy_api_handshake }, + { "check_path", ventoy_api_check_exist }, + { "check_path2", ventoy_api_check_exist2 }, { "check_fuzzy", ventoy_api_check_fuzzy }, - - { "device_info", ventoy_api_device_info }, - - { "get_control", ventoy_api_get_control }, - { "save_control", ventoy_api_save_control }, - - { "get_theme", ventoy_api_get_theme }, - { "save_theme", ventoy_api_save_theme }, - { "theme_add_file", ventoy_api_theme_add_file }, - { "theme_del_file", ventoy_api_theme_del_file }, - { "theme_add_font", ventoy_api_theme_add_font }, + + { "device_info", ventoy_api_device_info }, + + { "get_control", ventoy_api_get_control }, + { "save_control", ventoy_api_save_control }, + + { "get_theme", ventoy_api_get_theme }, + { "save_theme", ventoy_api_save_theme }, + { "theme_add_file", ventoy_api_theme_add_file }, + { "theme_del_file", ventoy_api_theme_del_file }, + { "theme_add_font", ventoy_api_theme_add_font }, { "theme_del_font", ventoy_api_theme_del_font }, - + { "get_alias", ventoy_api_get_alias }, - { "save_alias", ventoy_api_save_alias }, + { "save_alias", ventoy_api_save_alias }, { "alias_add", ventoy_api_alias_add }, { "alias_del", ventoy_api_alias_del }, - + { "get_tip", ventoy_api_get_tip }, - { "save_tip", ventoy_api_save_tip }, + { "save_tip", ventoy_api_save_tip }, { "tip_add", ventoy_api_tip_add }, { "tip_del", ventoy_api_tip_del }, - + { "get_class", ventoy_api_get_class }, - { "save_class", ventoy_api_save_class }, + { "save_class", ventoy_api_save_class }, { "class_add", ventoy_api_class_add }, { "class_del", ventoy_api_class_del }, - + { "get_auto_memdisk", ventoy_api_get_auto_memdisk }, - { "save_auto_memdisk", ventoy_api_save_auto_memdisk }, + { "save_auto_memdisk", ventoy_api_save_auto_memdisk }, { "auto_memdisk_add", ventoy_api_auto_memdisk_add }, { "auto_memdisk_del", ventoy_api_auto_memdisk_del }, - + { "get_image_list", ventoy_api_get_image_list }, { "save_image_list", ventoy_api_save_image_list }, { "image_list_add", ventoy_api_image_list_add }, { "image_list_del", ventoy_api_image_list_del }, { "get_conf_replace", ventoy_api_get_conf_replace }, - { "save_conf_replace", ventoy_api_save_conf_replace }, + { "save_conf_replace", ventoy_api_save_conf_replace }, { "conf_replace_add", ventoy_api_conf_replace_add }, { "conf_replace_del", ventoy_api_conf_replace_del }, - + { "get_dud", ventoy_api_get_dud }, - { "save_dud", ventoy_api_save_dud }, + { "save_dud", ventoy_api_save_dud }, { "dud_add", ventoy_api_dud_add }, { "dud_del", ventoy_api_dud_del }, { "dud_add_inner", ventoy_api_dud_add_inner }, { "dud_del_inner", ventoy_api_dud_del_inner }, - + { "get_auto_install", ventoy_api_get_auto_install }, - { "save_auto_install", ventoy_api_save_auto_install }, + { "save_auto_install", ventoy_api_save_auto_install }, { "auto_install_add", ventoy_api_auto_install_add }, { "auto_install_del", ventoy_api_auto_install_del }, { "auto_install_add_inner", ventoy_api_auto_install_add_inner }, { "auto_install_del_inner", ventoy_api_auto_install_del_inner }, - + { "get_persistence", ventoy_api_get_persistence }, - { "save_persistence", ventoy_api_save_persistence }, + { "save_persistence", ventoy_api_save_persistence }, { "persistence_add", ventoy_api_persistence_add }, { "persistence_del", ventoy_api_persistence_del }, { "persistence_add_inner", ventoy_api_persistence_add_inner }, { "persistence_del_inner", ventoy_api_persistence_del_inner }, - + { "get_password", ventoy_api_get_password }, - { "save_password", ventoy_api_save_password }, + { "save_password", ventoy_api_save_password }, { "password_add", ventoy_api_password_add }, { "password_del", ventoy_api_password_del }, - + { "get_injection", ventoy_api_get_injection }, - { "save_injection", ventoy_api_save_injection }, + { "save_injection", ventoy_api_save_injection }, { "injection_add", ventoy_api_injection_add }, { "injection_del", ventoy_api_injection_del }, { "preview_json", ventoy_api_preview_json }, - + }; static int ventoy_json_handler(struct mg_connection *conn, VTOY_JSON *json, char *jsonstr) @@ -4034,8 +4034,8 @@ static int ventoy_request_handler(struct mg_connection *conn) char *post_data_buf = NULL; const struct mg_request_info *ri = NULL; char stack_buf[512]; - - ri = mg_get_request_info(conn); + + ri = mg_get_request_info(conn); if (strcmp(ri->uri, "/vtoy/json") == 0) { @@ -4049,7 +4049,7 @@ static int ventoy_request_handler(struct mg_connection *conn) post_data_buf = stack_buf; post_buf_len = sizeof(stack_buf); } - + post_data_len = mg_read(conn, post_data_buf, post_buf_len); post_data_buf[post_data_len] = 0; @@ -4089,7 +4089,7 @@ const char *ventoy_web_openfile(const struct mg_connection *conn, const char *pa { return NULL; } - + node = ventoy_tar_find_file(path); if (node) { @@ -4122,7 +4122,7 @@ static int ventoy_parse_control(VTOY_JSON *json, void *p) if (node->enDataType == JSON_TYPE_OBJECT) { child = node->pstChild; - + if (child->enDataType != JSON_TYPE_STRING) { continue; @@ -4241,7 +4241,7 @@ static int ventoy_parse_control(VTOY_JSON *json, void *p) { CONTROL_PARSE_INT_DEF_0(child, data->filter_vtoy); } - + } } @@ -4267,9 +4267,9 @@ static int ventoy_parse_theme(VTOY_JSON *json, void *p) vtoy_json_get_string(child, "ventoy_left", sizeof(data->ventoy_left), data->ventoy_left); vtoy_json_get_string(child, "ventoy_top", sizeof(data->ventoy_top), data->ventoy_top); vtoy_json_get_string(child, "ventoy_color", sizeof(data->ventoy_color), data->ventoy_color); - - vtoy_json_get_int(child, "default_file", &(data->default_file)); - vtoy_json_get_int(child, "resolution_fit", &(data->resolution_fit)); + + vtoy_json_get_int(child, "default_file", &(data->default_file)); + vtoy_json_get_int(child, "resolution_fit", &(data->resolution_fit)); vtoy_json_get_string(child, "gfxmode", sizeof(data->gfxmode), data->gfxmode); vtoy_json_get_string(child, "serial_param", sizeof(data->serial_param), data->serial_param); @@ -4334,7 +4334,7 @@ static int ventoy_parse_theme(VTOY_JSON *json, void *p) } } - + node = vtoy_json_find_item(child, JSON_TYPE_ARRAY, "fonts"); if (node) { @@ -4401,7 +4401,7 @@ static int ventoy_parse_menu_alias(VTOY_JSON *json, void *p) pnode->type = type; strlcpy(pnode->path, path); strlcpy(pnode->alias, alias); - + if (data->list) { tail->next = pnode; @@ -4413,7 +4413,7 @@ static int ventoy_parse_menu_alias(VTOY_JSON *json, void *p) } } } - } + } return 0; } @@ -4468,7 +4468,7 @@ static int ventoy_parse_menu_tip(VTOY_JSON *json, void *p) pnode->type = type; strlcpy(pnode->path, path); strlcpy(pnode->tip, tip); - + if (data->list) { tail->next = pnode; @@ -4480,7 +4480,7 @@ static int ventoy_parse_menu_tip(VTOY_JSON *json, void *p) } } } - } + } return 0; } @@ -4528,7 +4528,7 @@ static int ventoy_parse_menu_class(VTOY_JSON *json, void *p) pnode->type = type; strlcpy(pnode->path, path); strlcpy(pnode->class, class); - + if (data->list) { tail->next = pnode; @@ -4540,7 +4540,7 @@ static int ventoy_parse_menu_class(VTOY_JSON *json, void *p) } } } - } + } return 0; } @@ -4586,7 +4586,7 @@ static int ventoy_parse_auto_install(VTOY_JSON *json, void *p) { continue; } - + file = vtoy_json_get_string_ex(node->pstChild, "template"); if (file) { @@ -4674,7 +4674,7 @@ static int ventoy_parse_auto_install(VTOY_JSON *json, void *p) else { pnode->list = pathtail = pathnode; - } + } } } @@ -4738,7 +4738,7 @@ static int ventoy_parse_persistence(VTOY_JSON *json, void *p) { continue; } - + file = vtoy_json_get_string_ex(node->pstChild, "backend"); if (file) { @@ -4826,7 +4826,7 @@ static int ventoy_parse_persistence(VTOY_JSON *json, void *p) else { pnode->list = pathtail = pathnode; - } + } } } @@ -4894,7 +4894,7 @@ static int ventoy_parse_injection(VTOY_JSON *json, void *p) pnode->type = type; strlcpy(pnode->path, path); strlcpy(pnode->archive, archive); - + if (data->list) { tail->next = pnode; @@ -4906,7 +4906,7 @@ static int ventoy_parse_injection(VTOY_JSON *json, void *p) } } } - } + } return 0; } @@ -4950,9 +4950,9 @@ static int ventoy_parse_conf_replace(VTOY_JSON *json, void *p) strlcpy(pnode->new, new); if (img == 1) { - pnode->image = img; + pnode->image = img; } - + if (data->list) { tail->next = pnode; @@ -4964,7 +4964,7 @@ static int ventoy_parse_conf_replace(VTOY_JSON *json, void *p) } } } - } + } return 0; } @@ -5007,8 +5007,8 @@ static int ventoy_parse_password(VTOY_JSON *json, void *p) if (efipwd) strlcpy(data->efipwd, efipwd); if (vhdpwd) strlcpy(data->vhdpwd, vhdpwd); if (vtoypwd) strlcpy(data->vtoypwd, vtoypwd); - - + + menupwd = vtoy_json_find_item(json->pstChild, JSON_TYPE_ARRAY, "menupwd"); if (!menupwd) { @@ -5039,7 +5039,7 @@ static int ventoy_parse_password(VTOY_JSON *json, void *p) pnode->type = type; strlcpy(pnode->path, path); strlcpy(pnode->pwd, pwd); - + if (data->list) { tail->next = pnode; @@ -5051,7 +5051,7 @@ static int ventoy_parse_password(VTOY_JSON *json, void *p) } } } - } + } return 0; } @@ -5168,7 +5168,7 @@ static int ventoy_parse_dud(VTOY_JSON *json, void *p) { continue; } - + file = vtoy_json_get_string_ex(node->pstChild, "dud"); if (file) { @@ -5237,7 +5237,7 @@ static int ventoy_parse_dud(VTOY_JSON *json, void *p) else { pnode->list = pathtail = pathnode; - } + } } } @@ -5306,7 +5306,7 @@ static int ventoy_load_old_json(const char *filename) free(buffer); return 1; } - + if (vtoy_json_parse_ex(json, buffer + offset, buflen - offset) == JSON_SUCCESS) { vlog("parse ventoy.json success\n"); @@ -5343,7 +5343,7 @@ static int ventoy_load_old_json(const char *filename) } else { - vlog("ventoy.json has syntax error.\n"); + vlog("ventoy.json has syntax error.\n"); g_sysinfo.syntax_error = 1; ret = 1; } @@ -5364,7 +5364,7 @@ int ventoy_http_start(const char *ip, const char *port) char filename[128]; char backupname[128]; struct mg_callbacks callbacks; - const char *options[] = + const char *options[] = { "listening_ports", "24681", "document_root", "www", @@ -5381,7 +5381,7 @@ int ventoy_http_start(const char *ip, const char *port) ventoy_data_default_theme(g_data_theme + i); ventoy_data_default_menu_alias(g_data_menu_alias + i); ventoy_data_default_menu_class(g_data_menu_class + i); - ventoy_data_default_menu_tip(g_data_menu_tip + i); + ventoy_data_default_menu_tip(g_data_menu_tip + i); ventoy_data_default_auto_install(g_data_auto_install + i); ventoy_data_default_persistence(g_data_persistence + i); ventoy_data_default_injection(g_data_injection + i); @@ -5423,7 +5423,7 @@ int ventoy_http_stop(void) { if (g_ventoy_http_ctx) { - mg_stop(g_ventoy_http_ctx); + mg_stop(g_ventoy_http_ctx); } ventoy_stop_writeback_thread(); @@ -5433,7 +5433,7 @@ int ventoy_http_stop(void) int ventoy_http_init(void) { int i = 0; - + #ifdef VENTOY_SIM char *Buffer = NULL; int BufLen = 0; @@ -5450,7 +5450,7 @@ int ventoy_http_init(void) } #else ventoy_file *file; - + file = ventoy_tar_find_file("www/menulist"); if (file) { @@ -5466,7 +5466,7 @@ int ventoy_http_init(void) { g_pub_json_buffer = malloc(JSON_BUF_MAX * 2); g_pub_save_buffer = g_pub_json_buffer + JSON_BUF_MAX; - } + } pthread_mutex_init(&g_api_mutex, NULL); @@ -5478,7 +5478,7 @@ void ventoy_http_exit(void) check_free(g_pub_json_buffer); g_pub_json_buffer = NULL; g_pub_save_buffer = NULL; - + pthread_mutex_destroy(&g_api_mutex); } diff --git a/Plugson/src/Web/ventoy_http.h b/Plugson/src/Web/ventoy_http.h index f1c1737d3dd..769bed28cf3 100644 --- a/Plugson/src/Web/ventoy_http.h +++ b/Plugson/src/Web/ventoy_http.h @@ -7,12 +7,12 @@ * 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 . * @@ -37,7 +37,7 @@ typedef enum bios_mode bios_ia32, bios_aa64, bios_mips, - + bios_max }bios_mode; @@ -110,7 +110,7 @@ typedef struct data_theme char ventoy_top[32]; char ventoy_color[32]; char serial_param[256]; - + path_node *fontslist; }data_theme; diff --git a/Plugson/src/main_linux.c b/Plugson/src/main_linux.c index 7e3fdcbf5ca..ee32a279be8 100644 --- a/Plugson/src/main_linux.c +++ b/Plugson/src/main_linux.c @@ -27,10 +27,10 @@ void ventoy_signal_stop(int sig) { vlog("ventoy server exit due to signal ...\n"); printf("ventoy server exit ...\n"); - + ventoy_http_stop(); ventoy_http_exit(); -#ifndef VENTOY_SIM +#ifndef VENTOY_SIM ventoy_www_exit(); #endif ventoy_disk_exit(); @@ -54,7 +54,7 @@ int main(int argc, char **argv) { ip = argv[1]; } - + if (isdigit(argv[2][0])) { port = argv[2]; @@ -72,7 +72,7 @@ int main(int argc, char **argv) return 1; } - ventoy_get_disk_info(argv); + ventoy_get_disk_info(argv); vlog("===============================================\n"); vlog("===== Ventoy Plugson %s:%s =====\n", ip, port); @@ -90,7 +90,7 @@ int main(int argc, char **argv) } #endif ventoy_http_init(); - + rc = ventoy_http_start(ip, port); if (rc) { @@ -106,7 +106,7 @@ int main(int argc, char **argv) sleep(100); } } - + return 0; } diff --git a/Plugson/www/static/bootstrap/fonts/glyphicons-halflings-regular.svg b/Plugson/www/static/bootstrap/fonts/glyphicons-halflings-regular.svg index 94fb5490a2e..f155876e1b9 100644 --- a/Plugson/www/static/bootstrap/fonts/glyphicons-halflings-regular.svg +++ b/Plugson/www/static/bootstrap/fonts/glyphicons-halflings-regular.svg @@ -285,4 +285,4 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/Plugson/www/static/datatables/dataTables.bootstrap.css b/Plugson/www/static/datatables/dataTables.bootstrap.css index 2ccacaff890..c7b27147bc1 100644 --- a/Plugson/www/static/datatables/dataTables.bootstrap.css +++ b/Plugson/www/static/datatables/dataTables.bootstrap.css @@ -244,7 +244,7 @@ ul.DTTT_dropdown.dropdown-menu li:hover a { } div.DTTT_collection_background { - z-index: 2002; + z-index: 2002; } /* TableTools information display */ @@ -264,7 +264,7 @@ div.DTTT_print_info { background-color: white; border: 1px solid rgba(0, 0, 0, 0.2); border-radius: 6px; - + -webkit-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.5); box-shadow: 0 3px 7px rgba(0, 0, 0, 0.5); } @@ -315,7 +315,7 @@ table.DTFC_Cloned tr.even { background-color: white; margin-bottom: 0; } - + div.DTFC_RightHeadWrapper table , div.DTFC_LeftHeadWrapper table { border-bottom: none !important; @@ -324,7 +324,7 @@ div.DTFC_LeftHeadWrapper table { border-bottom-left-radius: 0 !important; border-bottom-right-radius: 0 !important; } - + div.DTFC_RightHeadWrapper table thead tr:last-child th:first-child, div.DTFC_RightHeadWrapper table thead tr:last-child td:first-child, div.DTFC_LeftHeadWrapper table thead tr:last-child th:first-child, @@ -332,20 +332,20 @@ div.DTFC_LeftHeadWrapper table thead tr:last-child td:first-child { border-bottom-left-radius: 0 !important; border-bottom-right-radius: 0 !important; } - + div.DTFC_RightBodyWrapper table, div.DTFC_LeftBodyWrapper table { border-top: none; margin: 0 !important; } - + div.DTFC_RightBodyWrapper tbody tr:first-child th, div.DTFC_RightBodyWrapper tbody tr:first-child td, div.DTFC_LeftBodyWrapper tbody tr:first-child th, div.DTFC_LeftBodyWrapper tbody tr:first-child td { border-top: none; } - + div.DTFC_RightFootWrapper table, div.DTFC_LeftFootWrapper table { border-top: none; diff --git a/README.md b/README.md index 33ddb386bb2..c7b5e2dbe08 100644 --- a/README.md +++ b/README.md @@ -12,8 +12,8 @@

Ventoy is an open source tool to create bootable USB drive for ISO/WIM/IMG/VHD(x)/EFI files.
-With ventoy, you don't need to format the disk over and over, you just need to copy the image files to the USB drive and boot it. -You can copy many image files at a time and ventoy will give you a boot menu to select them.
+With ventoy, you don't need to format the disk over and over, you just need to copy the image files to the USB drive and boot it. +You can copy many image files at a time and ventoy will give you a boot menu to select them.
You can also browse ISO/WIM/IMG/VHD(x)/EFI files in local disk and boot them.
x86 Legacy BIOS, IA32 UEFI, x86_64 UEFI, ARM64 UEFI and MIPS64EL UEFI are supported in the same way.
Both MBR and GPT partition style are supported in the same way.
@@ -23,19 +23,19 @@ Most type of OS supported(Windows/WinPE/Linux/Unix/ChromeOS/Vmware/Xen...)

# Tested OS -**Windows** +**Windows** 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(6/7/8/9), RHEL(6/7/8/9), Deepin, Fedora, Rocky Linux, AlmaLinux, EuroLinux(6/7/8/9), openEuler, OpenAnolis, SLES, openSUSE, MX Linux, Manjaro, Linux Mint, Endless OS, Elementary OS, Solus, Linx, Zorin, antiX, PClinuxOS, Arch, ArcoLinux, ArchLabs, BlackArch, Obarun, Artix Linux, Puppy Linux, Tails, Slax, Kali, Mageia, Slackware, Q4OS, Archman, Gentoo, Pentoo, NixOS, Kylin, openKylin, Ubuntu Kylin, KylinSec, 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, 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, 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, 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, NHVBOOT, pearOS, SeaTools, Easy Recovery Essentional, iKuai, StorageCraft SCRE, ZFSBootMenu, TROMjaro, BunsenLabs, Todo en Uno, ChallengerOS, Nobara, Holo, CachyOS, Peux OS, Vanilla OS, ShredOS, paladin, Palen1x, dban, ReviOS, HelenOS, XeroLinux, Tiny 11, chimera linux, CuteFish, DragonOs, Rhino Linux, vanilladpup, crystal, IGELOS, MiniOS, gnoppix, PikaOS, ...... -**Unix** +**Unix** DragonFly, FreeBSD, pfSense, GhostBSD, FreeNAS, TrueNAS, XigmaNAS, FuryBSD, OPNsense, HardenedBSD, MidnightBSD, ClonOS, EmergencyBootKit -**ChromeOS** +**ChromeOS** FydeOS, CloudReady, ChromeOS Flex -**Other** +**Other** VMware ESXi, Citrix XenServer, Xen XCP-ng @@ -44,7 +44,7 @@ VMware ESXi, Citrix XenServer, Xen XCP-ng # Ventoy Browser With Ventoy, you can also browse ISO/WIM/IMG/VHD(x)/EFI files in local disk and boot them. [Notes](https://www.ventoy.net/en/doc_browser.html) - + # VentoyPlugson A GUI Ventoy plugin configurator. [VentoyPlugson](https://www.ventoy.net/en/plugin_plugson.html) @@ -86,7 +86,7 @@ A GUI Ventoy plugin configurator. [VentoyPlugson](https://www.ventoy.net/en/plug # Installation Instructions -See [https://www.ventoy.net/en/doc_start.html](https://www.ventoy.net/en/doc_start.html) for detailed instructions. +See [https://www.ventoy.net/en/doc_start.html](https://www.ventoy.net/en/doc_start.html) for detailed instructions. # Compile Instructions Please refer to [BuildVentoyFromSource.txt](DOC/BuildVentoyFromSource.txt) @@ -97,25 +97,25 @@ Title | Link **Install & Update** | [https://www.ventoy.net/en/doc_start.html](https://www.ventoy.net/en/doc_start.html) **Browse/Boot Files In Local Disk** | [https://www.ventoy.net/en/doc_browser.html](https://www.ventoy.net/en/doc_browser.html) **Secure Boot** | [https://www.ventoy.net/en/doc_secure.html](https://www.ventoy.net/en/doc_secure.html) -**Customize Theme** | [https://www.ventoy.net/en/plugin_theme.html](https://www.ventoy.net/en/plugin_theme.html) -**Global Control** | [https://www.ventoy.net/en/plugin_control.html](https://www.ventoy.net/en/plugin_control.html) -**Image List** | [https://www.ventoy.net/en/plugin_imagelist.html](https://www.ventoy.net/en/plugin_imagelist.html) -**Auto Installation** | [https://www.ventoy.net/en/plugin_autoinstall.html](https://www.ventoy.net/en/plugin_autoinstall.html) -**Injection Plugin** | [https://www.ventoy.net/en/plugin_injection.html](https://www.ventoy.net/en/plugin_injection.html) -**Persistence Support** | [https://www.ventoy.net/en/plugin_persistence.html](https://www.ventoy.net/en/plugin_persistence.html) -**Boot WIM file** | [https://www.ventoy.net/en/plugin_wimboot.html](https://www.ventoy.net/en/plugin_wimboot.html) -**Windows VHD Boot** | [https://www.ventoy.net/en/plugin_vhdboot.html](https://www.ventoy.net/en/plugin_vhdboot.html) -**Linux vDisk Boot** | [https://www.ventoy.net/en/plugin_vtoyboot.html](https://www.ventoy.net/en/plugin_vtoyboot.html) -**DUD Plugin** | [https://www.ventoy.net/en/plugin_dud.html](https://www.ventoy.net/en/plugin_dud.html) -**Password Plugin** | [https://www.ventoy.net/en/plugin_password.html](https://www.ventoy.net/en/plugin_password.html) -**Conf Replace Plugin** | [https://www.ventoy.net/en/plugin_bootconf_replace.html](https://www.ventoy.net/en/plugin_bootconf_replace.html) -**Menu Class** | [https://www.ventoy.net/en/plugin_menuclass.html](https://www.ventoy.net/en/plugin_menuclass.html) -**Menu Alias** | [https://www.ventoy.net/en/plugin_menualias.html](https://www.ventoy.net/en/plugin_menualias.html) -**Menu Extension** | [https://www.ventoy.net/en/plugin_grubmenu.html](https://www.ventoy.net/en/plugin_grubmenu.html) -**Memdisk Mode** | [https://www.ventoy.net/en/doc_memdisk.html](https://www.ventoy.net/en/doc_memdisk.html) -**TreeView Mode** | [https://www.ventoy.net/en/doc_treeview.html](https://www.ventoy.net/en/doc_treeview.html) -**Disk Layout MBR** | [https://www.ventoy.net/en/doc_disk_layout.html](https://www.ventoy.net/en/doc_disk_layout.html) -**Disk Layout GPT** | [https://www.ventoy.net/en/doc_disk_layout_gpt.html](https://www.ventoy.net/en/doc_disk_layout_gpt.html) +**Customize Theme** | [https://www.ventoy.net/en/plugin_theme.html](https://www.ventoy.net/en/plugin_theme.html) +**Global Control** | [https://www.ventoy.net/en/plugin_control.html](https://www.ventoy.net/en/plugin_control.html) +**Image List** | [https://www.ventoy.net/en/plugin_imagelist.html](https://www.ventoy.net/en/plugin_imagelist.html) +**Auto Installation** | [https://www.ventoy.net/en/plugin_autoinstall.html](https://www.ventoy.net/en/plugin_autoinstall.html) +**Injection Plugin** | [https://www.ventoy.net/en/plugin_injection.html](https://www.ventoy.net/en/plugin_injection.html) +**Persistence Support** | [https://www.ventoy.net/en/plugin_persistence.html](https://www.ventoy.net/en/plugin_persistence.html) +**Boot WIM file** | [https://www.ventoy.net/en/plugin_wimboot.html](https://www.ventoy.net/en/plugin_wimboot.html) +**Windows VHD Boot** | [https://www.ventoy.net/en/plugin_vhdboot.html](https://www.ventoy.net/en/plugin_vhdboot.html) +**Linux vDisk Boot** | [https://www.ventoy.net/en/plugin_vtoyboot.html](https://www.ventoy.net/en/plugin_vtoyboot.html) +**DUD Plugin** | [https://www.ventoy.net/en/plugin_dud.html](https://www.ventoy.net/en/plugin_dud.html) +**Password Plugin** | [https://www.ventoy.net/en/plugin_password.html](https://www.ventoy.net/en/plugin_password.html) +**Conf Replace Plugin** | [https://www.ventoy.net/en/plugin_bootconf_replace.html](https://www.ventoy.net/en/plugin_bootconf_replace.html) +**Menu Class** | [https://www.ventoy.net/en/plugin_menuclass.html](https://www.ventoy.net/en/plugin_menuclass.html) +**Menu Alias** | [https://www.ventoy.net/en/plugin_menualias.html](https://www.ventoy.net/en/plugin_menualias.html) +**Menu Extension** | [https://www.ventoy.net/en/plugin_grubmenu.html](https://www.ventoy.net/en/plugin_grubmenu.html) +**Memdisk Mode** | [https://www.ventoy.net/en/doc_memdisk.html](https://www.ventoy.net/en/doc_memdisk.html) +**TreeView Mode** | [https://www.ventoy.net/en/doc_treeview.html](https://www.ventoy.net/en/doc_treeview.html) +**Disk Layout MBR** | [https://www.ventoy.net/en/doc_disk_layout.html](https://www.ventoy.net/en/doc_disk_layout.html) +**Disk Layout GPT** | [https://www.ventoy.net/en/doc_disk_layout_gpt.html](https://www.ventoy.net/en/doc_disk_layout_gpt.html) **Search Configuration** | [https://www.ventoy.net/en/doc_search_path.html](https://www.ventoy.net/en/doc_search_path.html) @@ -127,17 +127,17 @@ See [https://www.ventoy.net/en/faq.html](https://www.ventoy.net/en/faq.html) for [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 available for donation. You can choose any of them. +It would be much appreciated if you want to make a small donation to support my work! +Alipay, WeChat Pay, PayPal and Bitcoin are available for donation. You can choose any of them. Alipay | WeChat Pay -|- | -**PayPal** -You can transfer to my paypal account `admin@ventoy.net` or just click [https://www.paypal.me/ventoy](https://www.paypal.me/ventoy) +**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** Bitcoin Address `19mZDWzZgzkHCi9YX9H3fYCUuCHq3W6wfT` diff --git a/SQUASHFS/build.txt b/SQUASHFS/build.txt index 355be9ab42a..418f746359f 100644 --- a/SQUASHFS/build.txt +++ b/SQUASHFS/build.txt @@ -11,7 +11,7 @@ make && make install ======== squashfs ======== squashfs4.4.tar.gz do some modify: -1. delete -lm and implement log10 +1. delete -lm and implement log10 2. static link zlib/liblzma 3. make unsquashfs diff --git a/SQUASHFS/squashfs-tools-4.4/ACKNOWLEDGEMENTS b/SQUASHFS/squashfs-tools-4.4/ACKNOWLEDGEMENTS index 2097bb775c0..76828323be5 100644 --- a/SQUASHFS/squashfs-tools-4.4/ACKNOWLEDGEMENTS +++ b/SQUASHFS/squashfs-tools-4.4/ACKNOWLEDGEMENTS @@ -30,7 +30,7 @@ Acknowledgements for Squashfs 4.0 --------------------------------- Thanks to Tim Bird and CELF (Consumer Electronics Linux Forum) for helping -fund mainstreaming of Squashfs into the 2.6.29 kernel and the +fund mainstreaming of Squashfs into the 2.6.29 kernel and the changes to the Squashfs tools to support the new 4.0 file system layout. Acknowledgements for Squashfs-3.3 diff --git a/SQUASHFS/squashfs-tools-4.4/CHANGES b/SQUASHFS/squashfs-tools-4.4/CHANGES index c35107bd8b6..d6fd8e3fad0 100644 --- a/SQUASHFS/squashfs-tools-4.4/CHANGES +++ b/SQUASHFS/squashfs-tools-4.4/CHANGES @@ -152,7 +152,7 @@ - mksquashfs: add a new -mem option - mksquashfs: fix limit on the number of dynamic pseudo files - mksquashfs: make -mem take a normal byte value, optionally with a - K, M or G + K, M or G 4.2 28 FEB 2011 XZ compression, and compression options support @@ -181,7 +181,7 @@ 1.8 Add external CFLAGS and LDFLAGS support to Makefile, and allow build options to be specified on command line. Also don't over-write passed in CFLAGS definition. - + 4.1 19 SEPT 2010 Major filesystem and tools improvements @@ -201,7 +201,7 @@ 1.5 Fix floating point error in progress_bar when max == 0 1.6 Removed use of get_nproc() call unavailable in ulibc 1.7 Reorganised help text - + 3. Unsquashfs improvements: 1.1 New options for controlling extended attributes @@ -209,7 +209,7 @@ 1.3 Fix floating point error in progress_bar when max == 0 1.4 Removed use of get_nproc() call unavailable in ulibc - + 4.0 5 APR 2009 Major filesystems improvements 1. Kernel code improvements: @@ -234,7 +234,7 @@ code to be optimised and only added at compile time for big endian systems. 3.2 Support for pseudo files added. - + 3.4 26 AUG 2008 Performance improvements to Unsquashfs, Mksquashfs and the kernel code. Plus many small bug fixes. @@ -363,7 +363,7 @@ 5. Race condition occurring on S390 in readpage() fixed. 6. Odd behaviour of MIPS memcpy in read_data() routine worked-around. 7. Missing cache_flush in Squashfs symlink_readpage() added. - + 3.1-r2 30 AUG 2006 Mksquashfs -sort bug fix @@ -375,7 +375,7 @@ fixes, lots of small improvements/bug fixes, and new kernel patches. - + 1. Mksquashfs has been rewritten to be multi-threaded. It has the following improvements @@ -397,7 +397,7 @@ 1.5 The use of swap memory was found to significantly impact performance. The amount of memory used to cache files is now a command line option, by default this is 512 Mbytes. - + 2. Unsquashfs has the following improvements 2.1 Unsquashfs now allows you to specify the filename or the @@ -432,7 +432,7 @@ 4.5 Unsquashfs exit status fixed. 4.6 New patches for linux-2.6.18 and linux-2.4.33. - + 3.0 15 MAR 2006 Major filesystem improvements 1. Filesystems are no longer limited to 4 GB. In @@ -453,7 +453,7 @@ 2.2-r2 8 SEPT 2005 Second release of 2.2, this release fixes a couple of small bugs, a couple of small documentation - mistakes, and adds a patch for kernel 2.6.13. + mistakes, and adds a patch for kernel 2.6.13. 1. Mksquashfs now deletes the output filesystem image file if an error occurs whilst generating the filesystem. Previously on @@ -492,7 +492,7 @@ misaligned short read. This was to fix reading on an ARM7 running uCLinux without a misaligned read interrupt handler. 7. Checkdata bug introduced in 2.1 fixed. - + 2.1-r2 15 DEC 2004 Code changed so it can be compiled with gcc 2.x @@ -533,7 +533,7 @@ 1. New patch for kernel 2.6.8.1. This includes a workaround for a kernel bug introduced in 2.6.7bk14, which is present in all later - versions of the kernel. + versions of the kernel. If you're using a 2.6.8 kernel or later then you must use this 2.6.8.1 patch. If you've experienced hangs or oopses using Squashfs @@ -544,7 +544,7 @@ other filesystems. If you receive odd results with other filesystems you may be experiencing this bug with that filesystem. I submitted a patch but this has not yet gone into the - kernel, hopefully the bug will be fixed in later kernels. + kernel, hopefully the bug will be fixed in later kernels. 2.0 13 JULY 2004 A couple of new options, and some bug fixes diff --git a/SQUASHFS/squashfs-tools-4.4/README-4.4 b/SQUASHFS/squashfs-tools-4.4/README-4.4 index 404bf86e04a..e3c3b99b0ca 100644 --- a/SQUASHFS/squashfs-tools-4.4/README-4.4 +++ b/SQUASHFS/squashfs-tools-4.4/README-4.4 @@ -77,7 +77,7 @@ See https://reproducible-builds.org/ for more information. Mksquashfs now generates reproducible images by default. Images generated by Mksquashfs will be ordered identically to previous runs if the same input has been supplied, and the -same options used. +same options used. 1.1.1 Dealing with timestamps diff --git a/SQUASHFS/squashfs-tools-4.4/RELEASE-READMEs/PERFORMANCE.README b/SQUASHFS/squashfs-tools-4.4/RELEASE-READMEs/PERFORMANCE.README index 20c28279770..985744c4824 100644 --- a/SQUASHFS/squashfs-tools-4.4/RELEASE-READMEs/PERFORMANCE.README +++ b/SQUASHFS/squashfs-tools-4.4/RELEASE-READMEs/PERFORMANCE.README @@ -72,7 +72,7 @@ quality and accuracy. 1.2.1 Directory Lookup performance Time taken to perform "ls -lR --color=alawys | cat > /dev/null" on filesystem - mounted from Hard disk + mounted from Hard disk Zisofs 17.29 seconds (User 2.62 secs, Sys 11.08 secs) Cloop 16.46 seconds (User 2.63 secs, Sys 13.41 secs) @@ -157,7 +157,7 @@ quality and accuracy. 2.2.2 Sequential I/O performance Time taken to perform "tar cf - | cat > /dev/null" on filesystem mounted - from Hard disk + from Hard disk CRAMFS 6.80 seconds (User 0.36 secs, Sys 6.02 secs) Squashfs2.0 7.23 seconds (User 0.29 secs, Sys 6.62 secs) @@ -169,7 +169,7 @@ quality and accuracy. -g | awk '{ printf $2 }' > /tmp/sort Time taken to perform "cpio -o --quiet -H newc < /tmp/sort > /dev/null" - on filesystem mounted from Hard disk + on filesystem mounted from Hard disk CRAMFS 28.55 seconds (User 0.49 secs, Sys 6.49 secs) diff --git a/SQUASHFS/squashfs-tools-4.4/RELEASE-READMEs/README-4.1 b/SQUASHFS/squashfs-tools-4.4/RELEASE-READMEs/README-4.1 index d2712f94707..8a4dd8dbea3 100644 --- a/SQUASHFS/squashfs-tools-4.4/RELEASE-READMEs/README-4.1 +++ b/SQUASHFS/squashfs-tools-4.4/RELEASE-READMEs/README-4.1 @@ -59,7 +59,7 @@ New Mksquashfs options -comp - Select compression. + Select compression. The compression algorithms supported by the build of Mksquashfs can be found by typing mksquashfs without any arguments. The compressors available @@ -90,7 +90,7 @@ New Mksquashfs options by the -no-xattrs option. -no-xattrs don't store extended attributes (default) - -xattrs store extended attributes + -xattrs store extended attributes shows that extended attributes are not stored by default, storage can be enabled by the -xattrs option. diff --git a/SQUASHFS/squashfs-tools-4.4/RELEASE-READMEs/README-4.2 b/SQUASHFS/squashfs-tools-4.4/RELEASE-READMEs/README-4.2 index db28f53c76a..61ca98c92d4 100644 --- a/SQUASHFS/squashfs-tools-4.4/RELEASE-READMEs/README-4.2 +++ b/SQUASHFS/squashfs-tools-4.4/RELEASE-READMEs/README-4.2 @@ -23,7 +23,7 @@ mountable on 2.6.29 and later kernels. XZ compression -------------- -Squashfs now supports XZ compression. +Squashfs now supports XZ compression. XZ support is in 2.6.38 and newer kernels. @@ -37,7 +37,7 @@ options are prefixed by -X, and are passed to the compressor for handling. The compression specific options supported by each compressor can be found by typing mksquashfs without any arguments. They are displayed at the -end of the help message, e.g. +end of the help message, e.g. Compressors available and compressor specific options: gzip (no options) (default) diff --git a/SQUASHFS/squashfs-tools-4.4/USAGE b/SQUASHFS/squashfs-tools-4.4/USAGE index 3cf66b3c1b8..8e025987f50 100644 --- a/SQUASHFS/squashfs-tools-4.4/USAGE +++ b/SQUASHFS/squashfs-tools-4.4/USAGE @@ -413,7 +413,7 @@ If you're not building the squashfs-tools and kernel from source, then the tools and kernel may or may not have been built with support for LZ4, LZO or XZ compression. The compression algorithms supported by the build of Mksquashfs can be found by typing mksquashfs without any arguments. The -compressors available are displayed at the end of the help message, e.g. +compressors available are displayed at the end of the help message, e.g. Compressors available and compressor specific options: gzip (default) @@ -472,7 +472,7 @@ overhead (LZO/LZ4 by definition are intended for weaker processors). 3.3 Changing global compression defaults used in mksquashfs ----------------------------------------------------------- -There are a large number of options that can be used to control the +There are a large number of options that can be used to control the compression in mksquashfs. By and large the defaults are the most optimum settings and should only be changed in exceptional circumstances! Note, this does not apply to the block size, increasing the block size @@ -580,7 +580,7 @@ it will not match the "/a/b" sub-directory within directory "c", whereas a non-anchored exclude would. A couple of examples should make this clearer. - + Anchored excludes 1. mksquashfs example image.sqsh -wildcards -e 'test/*.gz' diff --git a/SQUASHFS/squashfs-tools-4.4/kernel/kernel-2.4/fs/squashfs/inode.c b/SQUASHFS/squashfs-tools-4.4/kernel/kernel-2.4/fs/squashfs/inode.c index 54061f6a34d..6b2e9b3c7cf 100644 --- a/SQUASHFS/squashfs-tools-4.4/kernel/kernel-2.4/fs/squashfs/inode.c +++ b/SQUASHFS/squashfs-tools-4.4/kernel/kernel-2.4/fs/squashfs/inode.c @@ -107,10 +107,10 @@ static struct buffer_head *get_block_length(struct super_block *s, goto out; if (msblk->swap) ((unsigned char *) &temp)[0] = *((unsigned char *) - bh->b_data); + bh->b_data); else ((unsigned char *) &temp)[1] = *((unsigned char *) - bh->b_data); + bh->b_data); *c_byte = temp; *offset = 1; } else { @@ -118,12 +118,12 @@ static struct buffer_head *get_block_length(struct super_block *s, ((unsigned char *) &temp)[1] = *((unsigned char *) (bh->b_data + *offset)); ((unsigned char *) &temp)[0] = *((unsigned char *) - (bh->b_data + *offset + 1)); + (bh->b_data + *offset + 1)); } else { ((unsigned char *) &temp)[0] = *((unsigned char *) (bh->b_data + *offset)); ((unsigned char *) &temp)[1] = *((unsigned char *) - (bh->b_data + *offset + 1)); + (bh->b_data + *offset + 1)); } *c_byte = temp; *offset += 2; @@ -241,7 +241,7 @@ SQSH_EXTERN unsigned int squashfs_read_data(struct super_block *s, char *buffer, bytes = 0; } else bytes = msblk->stream.total_out; - + up(&msblk->read_data_mutex); } @@ -273,10 +273,10 @@ SQSH_EXTERN int squashfs_get_cached_block(struct super_block *s, char *buffer, TRACE("Entered squashfs_get_cached_block [%llx:%x]\n", block, offset); while ( 1 ) { - for (i = 0; i < SQUASHFS_CACHED_BLKS; i++) + for (i = 0; i < SQUASHFS_CACHED_BLKS; i++) if (msblk->block_cache[i].block == block) - break; - + break; + down(&msblk->block_cache_mutex); if (i == SQUASHFS_CACHED_BLKS) { @@ -313,7 +313,7 @@ SQSH_EXTERN int squashfs_get_cached_block(struct super_block *s, char *buffer, goto out; } } - + msblk->block_cache[i].block = SQUASHFS_USED_BLK; up(&msblk->block_cache_mutex); @@ -452,7 +452,7 @@ SQSH_EXTERN struct squashfs_fragment_cache *get_cached_fragment(struct super_blo } msblk->next_fragment = (msblk->next_fragment + 1) % SQUASHFS_CACHED_FRAGMENTS; - + if (msblk->fragment[i].data == NULL) if (!(msblk->fragment[i].data = SQUASHFS_ALLOC (SQUASHFS_FILE_MAX_SIZE))) { @@ -556,7 +556,7 @@ static struct inode *squashfs_iget(struct super_block *s, squashfs_inode_t inode long long frag_blk; struct squashfs_reg_inode_header *inodep = &id.reg; struct squashfs_reg_inode_header *sinodep = &sid.reg; - + if (msblk->swap) { if (!squashfs_get_cached_block(s, (char *) sinodep, block, offset, @@ -576,7 +576,7 @@ static struct inode *squashfs_iget(struct super_block *s, squashfs_inode_t inode !get_fragment_location(s, inodep->fragment, &frag_blk, &frag_size)) goto failed_read; - + if((i = squashfs_new_inode(s, inodeb)) == NULL) goto failed_read1; @@ -609,7 +609,7 @@ static struct inode *squashfs_iget(struct super_block *s, squashfs_inode_t inode long long frag_blk; struct squashfs_lreg_inode_header *inodep = &id.lreg; struct squashfs_lreg_inode_header *sinodep = &sid.lreg; - + if (msblk->swap) { if (!squashfs_get_cached_block(s, (char *) sinodep, block, offset, @@ -629,7 +629,7 @@ static struct inode *squashfs_iget(struct super_block *s, squashfs_inode_t inode !get_fragment_location(s, inodep->fragment, &frag_blk, &frag_size)) goto failed_read; - + if((i = squashfs_new_inode(s, inodeb)) == NULL) goto failed_read1; @@ -741,7 +741,7 @@ static struct inode *squashfs_iget(struct super_block *s, squashfs_inode_t inode &id.symlink; struct squashfs_symlink_inode_header *sinodep = &sid.symlink; - + if (msblk->swap) { if (!squashfs_get_cached_block(s, (char *) sinodep, block, offset, @@ -786,7 +786,7 @@ static struct inode *squashfs_iget(struct super_block *s, squashfs_inode_t inode &next_offset)) goto failed_read; SQUASHFS_SWAP_DEV_INODE_HEADER(inodep, sinodep); - } else + } else if (!squashfs_get_cached_block(s, (char *) inodep, block, offset, sizeof(*inodep), &next_block, @@ -819,7 +819,7 @@ static struct inode *squashfs_iget(struct super_block *s, squashfs_inode_t inode &next_offset)) goto failed_read; SQUASHFS_SWAP_IPC_INODE_HEADER(inodep, sinodep); - } else + } else if (!squashfs_get_cached_block(s, (char *) inodep, block, offset, sizeof(*inodep), &next_block, @@ -840,7 +840,7 @@ static struct inode *squashfs_iget(struct super_block *s, squashfs_inode_t inode inodeb->inode_type); goto failed_read1; } - + insert_inode_hash(i); return i; @@ -862,7 +862,7 @@ int read_fragment_index_table(struct super_block *s) ERROR("Failed to allocate uid/gid table\n"); return 0; } - + if (SQUASHFS_FRAGMENT_INDEX_BYTES(sblk->fragments) && !squashfs_read_data(s, (char *) msblk->fragment_index, @@ -947,12 +947,12 @@ static struct super_block *squashfs_read_super(struct super_block *s, set_blocksize(dev, msblk->devblksize); s->s_blocksize = msblk->devblksize; s->s_blocksize_bits = msblk->devblksize_log2; - + init_MUTEX(&msblk->read_data_mutex); init_MUTEX(&msblk->read_page_mutex); init_MUTEX(&msblk->block_cache_mutex); init_MUTEX(&msblk->fragment_mutex); - + init_waitqueue_head(&msblk->waitq); init_waitqueue_head(&msblk->fragment_wait_queue); @@ -1048,7 +1048,7 @@ static struct super_block *squashfs_read_super(struct super_block *s, goto failed_mount; } msblk->guid = msblk->uid + sblk->no_uids; - + if (msblk->swap) { unsigned int suid[sblk->no_uids + sblk->no_guids]; @@ -1283,7 +1283,7 @@ static int read_block_index(struct super_block *s, int blocks, char *block_list, struct squashfs_sb_info *msblk = &s->u.squashfs_sb; unsigned int *block_listp; int block = 0; - + if (msblk->swap) { char sblock_list[blocks << 2]; @@ -1336,7 +1336,7 @@ static int get_meta_index(struct inode *inode, int index, int cur_offset = SQUASHFS_I(inode)->offset; long long cur_data_block = SQUASHFS_I(inode)->start_block; int i; - + index /= SQUASHFS_META_INDEXES * skip; while ( offset < index ) { @@ -1459,7 +1459,7 @@ static int squashfs_readpage(struct file *file, struct page *page) void *pageaddr; struct squashfs_fragment_cache *fragment = NULL; char *data_ptr = msblk->read_page; - + int mask = (1 << (sblk->block_log - PAGE_CACHE_SHIFT)) - 1; int start_index = page->index & ~mask; int end_index = start_index | mask; @@ -1480,7 +1480,7 @@ static int squashfs_readpage(struct file *file, struct page *page) goto skip_read; down(&msblk->read_page_mutex); - + if (!(bytes = squashfs_read_data(inode->i_sb, msblk->read_page, block, bsize, NULL))) { ERROR("Unable to read page, block %llx, size %x\n", block, @@ -1573,7 +1573,7 @@ static int squashfs_readpage4K(struct file *file, struct page *page) long long block; unsigned int bsize, bytes = 0; void *pageaddr; - + TRACE("Entered squashfs_readpage4K, page index %lx, start block %llx\n", page->index, SQUASHFS_I(inode)->start_block); @@ -1630,7 +1630,7 @@ static int squashfs_readpage4K(struct file *file, struct page *page) } -static int get_dir_index_using_offset(struct super_block *s, long long +static int get_dir_index_using_offset(struct super_block *s, long long *next_block, unsigned int *next_offset, long long index_start, unsigned int index_offset, int i_count, @@ -1729,7 +1729,7 @@ static int get_dir_index_using_name(struct super_block *s, long long return length + 3; } - + static int squashfs_readdir(struct file *file, void *dirent, filldir_t filldir) { struct inode *i = file->f_dentry->d_inode; @@ -1782,7 +1782,7 @@ static int squashfs_readdir(struct file *file, void *dirent, filldir_t filldir) /* read directory header */ if (msblk->swap) { struct squashfs_dir_header sdirh; - + if (!squashfs_get_cached_block(i->i_sb, (char *) &sdirh, next_block, next_offset, sizeof(sdirh), &next_block, &next_offset)) @@ -1808,7 +1808,7 @@ static int squashfs_readdir(struct file *file, void *dirent, filldir_t filldir) sizeof(sdire), &next_block, &next_offset)) goto failed_read; - + length += sizeof(sdire); SQUASHFS_SWAP_DIR_ENTRY(dire, &sdire); } else { @@ -1918,7 +1918,7 @@ static struct dentry *squashfs_lookup(struct inode *i, struct dentry *dentry) sizeof(sdire), &next_block, &next_offset)) goto failed_read; - + length += sizeof(sdire); SQUASHFS_SWAP_DIR_ENTRY(dire, &sdire); } else { @@ -1981,7 +1981,7 @@ static void squashfs_put_super(struct super_block *s) SQUASHFS_INVALID_BLK) kfree(sbi->block_cache[i].data); if (sbi->fragment) - for (i = 0; i < SQUASHFS_CACHED_FRAGMENTS; i++) + for (i = 0; i < SQUASHFS_CACHED_FRAGMENTS; i++) SQUASHFS_FREE(sbi->fragment[i].data); kfree(sbi->fragment); kfree(sbi->block_cache); diff --git a/SQUASHFS/squashfs-tools-4.4/kernel/kernel-2.4/fs/squashfs/squashfs2_0.c b/SQUASHFS/squashfs-tools-4.4/kernel/kernel-2.4/fs/squashfs/squashfs2_0.c index 6411a04a893..cbb406efb8b 100644 --- a/SQUASHFS/squashfs-tools-4.4/kernel/kernel-2.4/fs/squashfs/squashfs2_0.c +++ b/SQUASHFS/squashfs-tools-4.4/kernel/kernel-2.4/fs/squashfs/squashfs2_0.c @@ -66,7 +66,7 @@ static int read_fragment_index_table_2(struct super_block *s) ERROR("Failed to allocate uid/gid table\n"); return 0; } - + if (SQUASHFS_FRAGMENT_INDEX_BYTES_2(sblk->fragments) && !squashfs_read_data(s, (char *) msblk->fragment_index_2, @@ -193,7 +193,7 @@ static struct inode *squashfs_iget_2(struct super_block *s, squashfs_inode_t ino struct squashfs_reg_inode_header_2 *sinodep = &sid.reg; long long frag_blk; unsigned int frag_size; - + if (msblk->swap) { if (!squashfs_get_cached_block(s, (char *) sinodep, block, offset, @@ -213,7 +213,7 @@ static struct inode *squashfs_iget_2(struct super_block *s, squashfs_inode_t ino !get_fragment_location_2(s, inodep->fragment, &frag_blk, &frag_size)) goto failed_read; - + if((i = squashfs_new_inode(s, inodeb, ino)) == NULL) goto failed_read1; @@ -331,7 +331,7 @@ static struct inode *squashfs_iget_2(struct super_block *s, squashfs_inode_t ino &id.symlink; struct squashfs_symlink_inode_header_2 *sinodep = &sid.symlink; - + if (msblk->swap) { if (!squashfs_get_cached_block(s, (char *) sinodep, block, offset, @@ -375,7 +375,7 @@ static struct inode *squashfs_iget_2(struct super_block *s, squashfs_inode_t ino &next_offset)) goto failed_read; SQUASHFS_SWAP_DEV_INODE_HEADER_2(inodep, sinodep); - } else + } else if (!squashfs_get_cached_block(s, (char *) inodep, block, offset, sizeof(*inodep), &next_block, @@ -410,7 +410,7 @@ static struct inode *squashfs_iget_2(struct super_block *s, squashfs_inode_t ino inodeb->inode_type); goto failed_read1; } - + insert_inode_hash(i); return i; @@ -422,7 +422,7 @@ static struct inode *squashfs_iget_2(struct super_block *s, squashfs_inode_t ino } -static int get_dir_index_using_offset(struct super_block *s, long long +static int get_dir_index_using_offset(struct super_block *s, long long *next_block, unsigned int *next_offset, long long index_start, unsigned int index_offset, int i_count, @@ -520,7 +520,7 @@ static int get_dir_index_using_name(struct super_block *s, long long return length; } - + static int squashfs_readdir_2(struct file *file, void *dirent, filldir_t filldir) { struct inode *i = file->f_dentry->d_inode; @@ -546,7 +546,7 @@ static int squashfs_readdir_2(struct file *file, void *dirent, filldir_t filldir /* read directory header */ if (msblk->swap) { struct squashfs_dir_header_2 sdirh; - + if (!squashfs_get_cached_block(i->i_sb, (char *) &sdirh, next_block, next_offset, sizeof(sdirh), &next_block, &next_offset)) @@ -572,7 +572,7 @@ static int squashfs_readdir_2(struct file *file, void *dirent, filldir_t filldir sizeof(sdire), &next_block, &next_offset)) goto failed_read; - + length += sizeof(sdire); SQUASHFS_SWAP_DIR_ENTRY_2(dire, &sdire); } else { @@ -682,7 +682,7 @@ static struct dentry *squashfs_lookup_2(struct inode *i, struct dentry *dentry) sizeof(sdire), &next_block, &next_offset)) goto failed_read; - + length += sizeof(sdire); SQUASHFS_SWAP_DIR_ENTRY_2(dire, &sdire); } else { diff --git a/SQUASHFS/squashfs-tools-4.4/kernel/kernel-2.4/include/linux/squashfs_fs.h b/SQUASHFS/squashfs-tools-4.4/kernel/kernel-2.4/include/linux/squashfs_fs.h index eed48c3da11..6c9743e7514 100644 --- a/SQUASHFS/squashfs-tools-4.4/kernel/kernel-2.4/include/linux/squashfs_fs.h +++ b/SQUASHFS/squashfs-tools-4.4/kernel/kernel-2.4/include/linux/squashfs_fs.h @@ -271,7 +271,7 @@ struct squashfs_dev_inode_header { unsigned int nlink; unsigned short rdev; } __attribute__ ((packed)); - + struct squashfs_symlink_inode_header { SQUASHFS_BASE_INODE_HEADER; unsigned int nlink; @@ -328,7 +328,7 @@ union squashfs_inode_header { struct squashfs_ldir_inode_header ldir; struct squashfs_ipc_inode_header ipc; }; - + struct squashfs_dir_entry { unsigned int offset:13; unsigned int type:3; @@ -578,7 +578,7 @@ struct squashfs_dev_inode_header_1 { unsigned int guid:4; /* index into guid table */ unsigned short rdev; } __attribute__ ((packed)); - + struct squashfs_symlink_inode_header_1 { unsigned int inode_type:4; unsigned int mode:12; /* protection */ @@ -695,7 +695,7 @@ struct squashfs_dev_inode_header_2 { unsigned int guid:8; /* index into guid table */ unsigned short rdev; } __attribute__ ((packed)); - + struct squashfs_symlink_inode_header_2 { unsigned int inode_type:4; unsigned int mode:12; /* protection */ @@ -751,7 +751,7 @@ union squashfs_inode_header_2 { struct squashfs_ldir_inode_header_2 ldir; struct squashfs_ipc_inode_header_2 ipc; }; - + struct squashfs_dir_header_2 { unsigned int count:8; unsigned int start_block:24; @@ -894,7 +894,7 @@ struct squashfs_fragment_entry_2 { #define SQUASHFS_SWAP(value, p, pos, tbits) _SQUASHFS_SWAP(value, p, pos, \ tbits, b_pos) #else - /* convert from big endian to little endian */ + /* convert from big endian to little endian */ #define SQUASHFS_SWAP(value, p, pos, tbits) _SQUASHFS_SWAP(value, p, pos, \ tbits, 64 - tbits - b_pos) #endif diff --git a/SQUASHFS/squashfs-tools-4.4/squashfs-tools/Makefile b/SQUASHFS/squashfs-tools-4.4/squashfs-tools/Makefile index a772201850d..f196873d915 100644 --- a/SQUASHFS/squashfs-tools-4.4/squashfs-tools/Makefile +++ b/SQUASHFS/squashfs-tools-4.4/squashfs-tools/Makefile @@ -186,7 +186,7 @@ ifeq ($(LZMA_XZ_SUPPORT),1) CFLAGS += -DLZMA_SUPPORT MKSQUASHFS_OBJS += lzma_xz_wrapper.o UNSQUASHFS_OBJS += lzma_xz_wrapper.o -LIBS += +LIBS += COMPRESSORS += lzma endif @@ -285,7 +285,7 @@ mksquashfs: $(MKSQUASHFS_OBJS) mksquashfs.o: Makefile mksquashfs.c squashfs_fs.h squashfs_swap.h mksquashfs.h \ sort.h pseudo.h compressor.h xattr.h action.h error.h progressbar.h \ - info.h caches-queues-lists.h read_fs.h restore.h process_fragments.h + info.h caches-queues-lists.h read_fs.h restore.h process_fragments.h read_fs.o: read_fs.c squashfs_fs.h squashfs_swap.h compressor.h xattr.h \ error.h mksquashfs.h diff --git a/SQUASHFS/squashfs-tools-4.4/squashfs-tools/action.c b/SQUASHFS/squashfs-tools-4.4/squashfs-tools/action.c index 4b06ccb4c01..ebcd9059a30 100644 --- a/SQUASHFS/squashfs-tools-4.4/squashfs-tools/action.c +++ b/SQUASHFS/squashfs-tools-4.4/squashfs-tools/action.c @@ -360,7 +360,7 @@ static struct expr *parse_test(char *name) if (test->parse_args) { int res = test->parse_args(test, &expr->atom); - if (res == 0) + if (res == 0) goto failed; } @@ -421,7 +421,7 @@ static struct expr *parse_expr(int subexp) } break; } - + if (op != TOK_AND && op != TOK_OR) { free_parse_tree(expr); SYNTAX_ERROR("Unexpected token \"%s\", expected " @@ -540,7 +540,7 @@ int parse_action(char *s, int verbose) TOK_TO_STR(token, string)); goto failed; } - + parsing_action = action; expr = parse_expr(0); @@ -575,7 +575,7 @@ int parse_action(char *s, int verbose) spec_count = other_count ++; spec_list = &other_spec; } - + *spec_list = realloc(*spec_list, (spec_count + 1) * sizeof(struct action)); if (*spec_list == NULL) @@ -633,7 +633,7 @@ char *_expr_log(char *string, int cmnd) } /* if string is empty append '\0' */ - size = strlen(string) ? : 1; + size = strlen(string) ? : 1; if(alloc_size - cur_size < size) { /* buffer too small, expand */ @@ -645,7 +645,7 @@ char *_expr_log(char *string, int cmnd) } memcpy(expr_msg + cur_size, string, size); - cur_size += size; + cur_size += size; return expr_msg; } @@ -799,7 +799,7 @@ static int eval_expr_top(struct action *action, struct action_data *action_data) * action(arg1,arg2)@expr(arg1,arg2).... * * Actions can be split across multiple lines using "\". - * + * * Blank lines and comment lines indicated by # are supported. */ int parse_action_true(char *s) @@ -949,7 +949,7 @@ void *get_frag_action(void *fragment) if (fragment == &def_fragment) action = &fragment_spec[0] - 1; - else + else action = fragment - offsetof(struct action, data); if (++action == spec_list_end) @@ -1299,9 +1299,9 @@ static int parse_sym_mode_arg(char *arg, struct mode_data **head, "'%c'\n", *arg); goto failed; } - + arg ++; - + /* Parse PERMS */ if (*arg == 'u' || *arg == 'g' || *arg == 'o') { /* PERMS = [ugo] */ @@ -1340,11 +1340,11 @@ static int parse_sym_mode_arg(char *arg, struct mode_data **head, "'%c'\n", *arg); goto failed; } - + arg ++; } } - + perms_parsed: mode_data = malloc(sizeof(*mode_data)); if (mode_data == NULL) @@ -1544,7 +1544,7 @@ int eval_empty_actions(struct dir_info *root, struct dir_ent *dir_ent) if ((data->val == EMPTY_EXCLUDED && !dir->excluded) || (data->val == EMPTY_SOURCE && dir->excluded)) continue; - + match = eval_expr_top(&empty_spec[i], &action_data); } @@ -2137,7 +2137,7 @@ static int parse_range_args(struct test_entry *test, struct atom *atom) "expected\n"); return 0; } - + res = parse_number(atom->argv[1], &end, &type, &error); if (res == 0) { TEST_SYNTAX_ERROR(test, 1, "%s\n", error); @@ -2149,7 +2149,7 @@ static int parse_range_args(struct test_entry *test, struct atom *atom) "expected\n"); return 0; } - + range = malloc(sizeof(*range)); if (range == NULL) MEM_ERROR(); @@ -2197,19 +2197,19 @@ static int NAME##_fn(struct atom *atom, struct action_data *action_data) \ } \ \ return match; \ - }) + }) /* * Generic test code macro testing VAR for range [x, y] (value between x and y * inclusive). - */ + */ #define TEST_VAR_RANGE_FN(NAME, MATCH, VAR) TEST_FN(NAME##_range, MATCH, \ { \ struct test_range_args *range = atom->data; \ \ return range->start <= VAR && VAR <= range->end; \ - }) + }) /* @@ -2280,7 +2280,7 @@ static char *get_start(char *s, int n) return s; } - + static int subpathname_fn(struct atom *atom, struct action_data *action_data) { @@ -2465,7 +2465,7 @@ static int parse_type_arg(struct test_entry *test, struct atom *atom) "'c', 'b', 'l', 's' or 'p'\n"); return 0; } - + static int type_fn(struct atom *atom, struct action_data *action_data) { @@ -2578,7 +2578,7 @@ static int file_fn(struct atom *atom, struct action_data *action_data) if (res == -1) BAD_ERROR("file_fn waitpid failed\n"); - + if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) BAD_ERROR("file_fn file returned error\n"); @@ -2647,14 +2647,14 @@ static int exec_fn(struct atom *atom, struct action_data *action_data) } /* - * Parent process. + * Parent process. */ res = waitpid(child, &status, 0); if (res == -1) BAD_ERROR("exec_fn waitpid failed\n"); - + return WIFEXITED(status) ? WEXITSTATUS(status) == 0 : 0; } @@ -2994,7 +2994,7 @@ static int eval_fn(struct atom *atom, struct action_data *action_data) path ++; if(path[0] == '\0') dir_ent = dir_ent->our_dir->dir_ent; - else + else dir_ent = follow_path(dir_ent->our_dir, path); } else if(!file_type_match(buf->st_mode, ACTION_DIR)) dir_ent = NULL; @@ -3094,7 +3094,7 @@ static int parse_perm_args(struct test_entry *test, struct atom *atom) perm_data->mode = mode; atom->data = perm_data; - + finish: while(head) { struct mode_data *tmp = head; @@ -3248,7 +3248,7 @@ static struct action_entry action_table[] = { no_frag_action}, { "always-use-fragments", ALWAYS_FRAGS_ACTION, 0, ACTION_REG, NULL, always_frag_action}, - { "dont-always-use-fragments", NO_ALWAYS_FRAGS_ACTION, 0, ACTION_REG, + { "dont-always-use-fragments", NO_ALWAYS_FRAGS_ACTION, 0, ACTION_REG, NULL, no_always_frag_action}, { "compressed", COMPRESSED_ACTION, 0, ACTION_REG, NULL, comp_action}, { "uncompressed", UNCOMPRESSED_ACTION, 0, ACTION_REG, NULL, diff --git a/SQUASHFS/squashfs-tools-4.4/squashfs-tools/caches-queues-lists.c b/SQUASHFS/squashfs-tools-4.4/squashfs-tools/caches-queues-lists.c index e86a517e15b..710c4f1b07d 100644 --- a/SQUASHFS/squashfs-tools-4.4/squashfs-tools/caches-queues-lists.c +++ b/SQUASHFS/squashfs-tools-4.4/squashfs-tools/caches-queues-lists.c @@ -128,7 +128,7 @@ void dump_queue(struct queue *queue) pthread_cleanup_push((void *) pthread_mutex_unlock, &queue->mutex); pthread_mutex_lock(&queue->mutex); - printf("\tMax size %d, size %d%s\n", queue->size - 1, + printf("\tMax size %d, size %d%s\n", queue->size - 1, queue->readp <= queue->writep ? queue->writep - queue->readp : queue->size - queue->readp + queue->writep, queue->readp == queue->writep ? " (EMPTY)" : @@ -218,7 +218,7 @@ struct file_buffer *seq_queue_get(struct seq_queue *queue) break; } - /* entry not found, wait for it to arrive */ + /* entry not found, wait for it to arrive */ pthread_cond_wait(&queue->wait, &queue->mutex); } @@ -390,12 +390,12 @@ static struct file_buffer *_cache_get(struct cache *cache, long long index, { /* Get a free block out of the cache indexed on index. */ struct file_buffer *entry = NULL; - + pthread_cleanup_push((void *) pthread_mutex_unlock, &cache->mutex); pthread_mutex_lock(&cache->mutex); while(1) { - if(cache->noshrink_lookup) { + if(cache->noshrink_lookup) { /* first try to get a block from the free list */ if(cache->first_freelist && cache->free_list) entry = cache_freelist(cache); diff --git a/SQUASHFS/squashfs-tools-4.4/squashfs-tools/gzip_wrapper.c b/SQUASHFS/squashfs-tools-4.4/squashfs-tools/gzip_wrapper.c index ac32bb950be..94bf91b4450 100644 --- a/SQUASHFS/squashfs-tools-4.4/squashfs-tools/gzip_wrapper.c +++ b/SQUASHFS/squashfs-tools-4.4/squashfs-tools/gzip_wrapper.c @@ -128,7 +128,7 @@ static int gzip_options(char *argv[], int argc) goto failed; } } - + return 1; } @@ -265,7 +265,7 @@ static int gzip_extract_options(int block_size, void *buffer, int size) } else strategy[i].selected = 0; } - + return 0; failed: @@ -325,7 +325,7 @@ static void gzip_display_options(void *buffer, int size) failed: fprintf(stderr, "gzip: error reading stored compressor options from " "filesystem!\n"); -} +} /* @@ -371,7 +371,7 @@ static int gzip_init(void **strm, int block_size, int datablock) j++; } } - + stream->stream.zalloc = Z_NULL; stream->stream.zfree = Z_NULL; stream->stream.opaque = 0; diff --git a/SQUASHFS/squashfs-tools-4.4/squashfs-tools/lz4_wrapper.c b/SQUASHFS/squashfs-tools-4.4/squashfs-tools/lz4_wrapper.c index bc9c04d84cc..a9519e52976 100644 --- a/SQUASHFS/squashfs-tools-4.4/squashfs-tools/lz4_wrapper.c +++ b/SQUASHFS/squashfs-tools-4.4/squashfs-tools/lz4_wrapper.c @@ -96,7 +96,7 @@ static int lz4_options(char *argv[], int argc) * Currently LZ4 always returns a comp_opts structure, with * the version indicating LZ4_LEGACY stream fomat. This is to * easily accomodate changes in the kernel code to different - * stream formats + * stream formats */ static void *lz4_dump_options(int block_size, int *size) { @@ -241,7 +241,7 @@ static void lz4_display_options(void *buffer, int size) failed: fprintf(stderr, "lz4: error reading stored compressor options from " "filesystem!\n"); -} +} static int lz4_compress(void *strm, void *dest, void *src, int size, diff --git a/SQUASHFS/squashfs-tools-4.4/squashfs-tools/lzma_wrapper.c b/SQUASHFS/squashfs-tools-4.4/squashfs-tools/lzma_wrapper.c index 1e767331bcc..624a3a5a3c9 100644 --- a/SQUASHFS/squashfs-tools-4.4/squashfs-tools/lzma_wrapper.c +++ b/SQUASHFS/squashfs-tools-4.4/squashfs-tools/lzma_wrapper.c @@ -55,7 +55,7 @@ static int lzma_uncompress(void *dest, void *src, int size, int outsize, res = LzmaUncompress(dest, &outlen, src + LZMA_HEADER_SIZE, &inlen, src, LZMA_PROPS_SIZE); - + if(res == SZ_OK) return outlen; else { diff --git a/SQUASHFS/squashfs-tools-4.4/squashfs-tools/lzo_wrapper.c b/SQUASHFS/squashfs-tools-4.4/squashfs-tools/lzo_wrapper.c index 4d7c3db5463..a7384e5d934 100644 --- a/SQUASHFS/squashfs-tools-4.4/squashfs-tools/lzo_wrapper.c +++ b/SQUASHFS/squashfs-tools-4.4/squashfs-tools/lzo_wrapper.c @@ -37,7 +37,7 @@ static struct lzo_algorithm lzo[] = { { "lzo1x_1_12", LZO1X_1_12_MEM_COMPRESS, lzo1x_1_12_compress }, { "lzo1x_1_15", LZO1X_1_15_MEM_COMPRESS, lzo1x_1_15_compress }, { "lzo1x_999", LZO1X_999_MEM_COMPRESS, lzo1x_999_wrapper }, - { NULL, 0, NULL } + { NULL, 0, NULL } }; /* default LZO compression algorithm and compression level */ @@ -259,7 +259,7 @@ static void lzo_display_options(void *buffer, int size) failed: fprintf(stderr, "lzo: error reading stored compressor options from " "filesystem!\n"); -} +} /* @@ -296,7 +296,7 @@ static int squashfs_lzo_init(void **strm, int block_size, int datablock) static int lzo_compress(void *strm, void *dest, void *src, int size, int block_size, int *error) { - + return 0; } diff --git a/SQUASHFS/squashfs-tools-4.4/squashfs-tools/mksquashfs.c b/SQUASHFS/squashfs-tools-4.4/squashfs-tools/mksquashfs.c index a45b77f1fe9..5538fc0ee9c 100644 --- a/SQUASHFS/squashfs-tools-4.4/squashfs-tools/mksquashfs.c +++ b/SQUASHFS/squashfs-tools-4.4/squashfs-tools/mksquashfs.c @@ -375,7 +375,7 @@ int shift_overflow(int a, int shift) return (INT_MAX >> shift) < a; } - + int multiply_overflow(int a, int multiplier) { return (INT_MAX / multiplier) < a; @@ -623,7 +623,7 @@ long long write_inodes() c_byte = mangle(inode_table + inode_bytes + BLOCK_OFFSET, datap, avail_bytes, SQUASHFS_METADATA_SIZE, noI, 0); TRACE("Inode block @ 0x%x, size %d\n", inode_bytes, c_byte); - SQUASHFS_SWAP_SHORTS(&c_byte, inode_table + inode_bytes, 1); + SQUASHFS_SWAP_SHORTS(&c_byte, inode_table + inode_bytes, 1); inode_bytes += SQUASHFS_COMPRESSED_SIZE(c_byte) + BLOCK_OFFSET; total_inode_bytes += avail_bytes + BLOCK_OFFSET; datap += avail_bytes; @@ -771,7 +771,7 @@ char *_pathname(struct dir_ent *dir_ent, char *pathname, int *size) } for(;;) { - int res = snprintf(pathname, *size, "%s/%s", + int res = snprintf(pathname, *size, "%s/%s", dir_ent->our_dir->pathname, dir_ent->source_name ? : dir_ent->name); @@ -867,7 +867,7 @@ static inline unsigned int get_parent_no(struct dir_info *dir) return dir->depth ? get_inode_no(dir->dir_ent->inode) : inode_no; } - + static inline time_t get_time(time_t time) { if(all_time_opt) { @@ -927,7 +927,7 @@ int create_inode(squashfs_inode *i_no, struct dir_info *dir_info, type = SQUASHFS_LSOCKET_TYPE; break; } - + base->mode = SQUASHFS_MODE(buf->st_mode); base->uid = get_uid((unsigned int) global_uid == -1 ? buf->st_uid : global_uid); @@ -1159,7 +1159,7 @@ void add_dir(squashfs_inode inode, unsigned int inode_number, char *name, MEM_ERROR(); dir->p = (dir->p - dir->buff) + buff; - if(dir->entry_count_p) + if(dir->entry_count_p) dir->entry_count_p = (dir->entry_count_p - dir->buff + buff); dir->index_count_p = dir->index_count_p - dir->buff + buff; @@ -1547,7 +1547,7 @@ void unlock_fragments() */ while(!queue_empty(locked_fragment)) { write_buffer = queue_get(locked_fragment); - frg = write_buffer->block; + frg = write_buffer->block; size = SQUASHFS_COMPRESSED_SIZE_BLOCK(fragment_table[frg].size); fragment_table[frg].start_block = bytes; write_buffer->block = bytes; @@ -1667,7 +1667,7 @@ long long generic_write_table(int length, void *buffer, int length2, int compressed_size, i, list_size = meta_blocks * sizeof(long long); unsigned short c_byte; char cbuffer[(SQUASHFS_METADATA_SIZE << 2) + 2]; - + #ifdef SQUASHFS_TRACE long long obytes = bytes; int olength = length; @@ -1701,7 +1701,7 @@ long long generic_write_table(int length, void *buffer, int length2, bytes += length2; total_bytes += length2; } - + SQUASHFS_INSWAP_LONG_LONGS(list, meta_blocks); write_destination(fd, bytes, list_size, list); bytes += list_size; @@ -1795,7 +1795,7 @@ unsigned short get_checksum_disk(long long start, long long l, cache_block_put(write_buffer); } else { void *data = read_from_disk(start, bytes); - if(data == NULL) { + if(data == NULL) { ERROR("Failed to checksum data from output" " filesystem\n"); BAD_ERROR("Output filesystem corrupted?\n"); @@ -2166,7 +2166,7 @@ void reader_read_process(struct dir_ent *dir_ent) * read incase write_file_process() is running in parallel * with this. Otherwise the current progress bar position * may get ahead of the progress bar size. - */ + */ progress_bar_size(1); if(prev_buffer) @@ -2432,7 +2432,7 @@ void *deflator(void *arg) while(1) { struct file_buffer *file_buffer = queue_get(to_deflate); - if(sparse_files && all_zero(file_buffer)) { + if(sparse_files && all_zero(file_buffer)) { file_buffer->c_byte = 0; seq_queue_put(to_main, file_buffer); } else { @@ -3240,7 +3240,7 @@ void dir_scan(squashfs_inode *inode, char *pathname, { struct stat buf; struct dir_ent *dir_ent; - + root_dir = dir_scan1(pathname, "", paths, _readdir, 1); if(root_dir == NULL) return; @@ -3550,7 +3550,7 @@ struct dir_info *dir_scan1(char *filename, char *subpath, if(exclude_actions()) { subpath = subpathname(dir_ent); - + if(eval_exclude_actions(dir_name, filename, subpath, &buf, depth, dir_ent)) { add_excluded(dir); @@ -3621,7 +3621,7 @@ struct dir_ent *scan2_readdir(struct dir_info *dir, struct dir_ent *dir_ent) for(; dir_ent && dir_ent->inode->root_entry; dir_ent = dir_ent->next); - return dir_ent; + return dir_ent; } @@ -3642,7 +3642,7 @@ void dir_scan2(struct dir_info *dir, struct pseudo *pseudo) struct pseudo_entry *pseudo_ent; struct stat buf; static int pseudo_ino = 1; - + while((dir_ent = scan2_readdir(dir, dir_ent)) != NULL) { struct inode_info *inode_info = dir_ent->inode; struct stat *buf = &inode_info->buf; @@ -3790,7 +3790,7 @@ void free_dir(struct dir_info *dir) free(dir->subpath); free(dir); } - + void dir_scan4(struct dir_info *dir) { @@ -3822,7 +3822,7 @@ void dir_scan4(struct dir_info *dir) prev->next = dir_ent; else dir->list = dir_ent; - + /* free it */ free_dir_entry(tmp); @@ -3873,7 +3873,7 @@ void dir_scan5(struct dir_info *dir) prev->next = dir_ent; else dir->list = dir_ent; - + /* free it */ free_dir_entry(tmp); @@ -3904,7 +3904,7 @@ void dir_scan5(struct dir_info *dir) * is not ideal for arrays (as it needs an additonal n storage locations * as sorting is not done in place), but it is ideal for linked lists because * it doesn't require any extra storage, - */ + */ void sort_directory(struct dir_info *dir) { struct dir_ent *cur, *l1, *l2, *next; @@ -4041,7 +4041,7 @@ struct dir_ent *scan7_readdir(struct directory *dir, struct dir_info *dir_info, add_dir(dir_ent->inode->inode, dir_ent->inode->inode_number, dir_ent->name, dir_ent->inode->type, dir); - return dir_ent; + return dir_ent; } @@ -4059,9 +4059,9 @@ void dir_scan7(squashfs_inode *inode, struct dir_info *dir_info) int duplicate_file; struct directory dir; struct dir_ent *dir_ent = NULL; - + scan7_init_dir(&dir); - + while((dir_ent = scan7_readdir(&dir, dir_info, dir_ent)) != NULL) { struct stat *buf = &dir_ent->inode->buf; @@ -4185,7 +4185,7 @@ void dir_scan7(squashfs_inode *inode, struct dir_info *dir_info) break; } } - + add_dir(*inode, get_inode_no(dir_ent->inode), dir_ent->name, squashfs_type, &dir); } @@ -4605,10 +4605,10 @@ void add_exclude(char *target) if(target[0] == '/' || strncmp(target, "./", 2) == 0 || strncmp(target, "../", 3) == 0) BAD_ERROR("/, ./ and ../ prefixed excludes not supported with " - "-wildcards or -regex options\n"); + "-wildcards or -regex options\n"); else if(strncmp(target, "... ", 4) == 0) stickypath = add_path(stickypath, target + 4, target + 4); - else + else path = add_path(path, target, target); } @@ -4697,7 +4697,7 @@ int excluded_match(char *name, struct pathname *path, struct pathnames **new) int excluded(char *name, struct pathnames *paths, struct pathnames **new) { int n; - + if(stickypath && excluded_match(name, stickypath, NULL)) return TRUE; @@ -4817,7 +4817,7 @@ void write_recovery_data(struct squashfs_super_block *sBlk) if(recoverfd == -1) BAD_ERROR("Failed to create recovery file, because %s. " "Aborting\n", strerror(errno)); - + if(write_bytes(recoverfd, header, RECOVER_ID_SIZE) == -1) BAD_ERROR("Failed to write recovery file, because %s\n", strerror(errno)); @@ -4832,7 +4832,7 @@ void write_recovery_data(struct squashfs_super_block *sBlk) close(recoverfd); free(metadata); - + printf("Recovery file \"%s\" written\n", recovery_file); printf("If Mksquashfs aborts abnormally (i.e. power failure), run\n"); printf("mksquashfs dummy %s -recover %s\n", destination_file, @@ -4914,7 +4914,7 @@ void read_recovery_data(char *recovery_file, char *destination_file) printf("Successfully wrote recovery file \"%s\". Exiting\n", recovery_file); - + exit(0); } @@ -4945,7 +4945,7 @@ void write_filesystem_tables(struct squashfs_super_block *sBlk, int nopad) sBlk->compression = comp->id; - SQUASHFS_INSWAP_SUPER_BLOCK(sBlk); + SQUASHFS_INSWAP_SUPER_BLOCK(sBlk); write_destination(fd, SQUASHFS_START, sizeof(*sBlk), sBlk); if(!nopad && (i = bytes & (4096 - 1))) { @@ -5129,7 +5129,7 @@ int parse_number(char *start, int *res, int size) if(!_parse_numberll(start, &number, size, 10)) return 0; - + /* check if long result will overflow signed int */ if(number > INT_MAX) return 0; @@ -5145,7 +5145,7 @@ int parse_number_unsigned(char *start, unsigned int *res, int size) if(!_parse_numberll(start, &number, size, 10)) return 0; - + /* check if long result will overflow unsigned int */ if(number > UINT_MAX) return 0; @@ -5231,7 +5231,7 @@ void check_usable_phys_mem(int total_mem) int mem = get_physical_memory(); mem = (mem >> 1) + (mem >> 2); /* 75% */ - + if(total_mem > mem && mem) { ERROR("Total memory requested is more than 75%% of physical " "memory.\n"); @@ -5404,7 +5404,7 @@ int main(int argc, char *argv[]) */ for(; i < argc; i++) { struct compressor *prev_comp = comp; - + if(strcmp(argv[i], "-comp") == 0) { if(++i == argc) { ERROR("%s: -comp missing compression type\n", @@ -5849,7 +5849,7 @@ int main(int argc, char *argv[]) ERROR("%s: -root-becomes: missing name\n", argv[0]); exit(1); - } + } root_name = argv[i]; } else if(strcmp(argv[i], "-version") == 0) { VERSION(); @@ -6015,7 +6015,7 @@ int main(int argc, char *argv[]) */ if(!silent) progress = force_progress; - + #ifdef SQUASHFS_TRACE /* * Disable progress bar if full debug tracing is enabled. @@ -6174,7 +6174,7 @@ int main(int argc, char *argv[]) */ if(comp_data) { unsigned short c_byte = size | SQUASHFS_COMPRESSED_BIT; - + SQUASHFS_INSWAP_SHORTS(&c_byte, 1); write_destination(fd, sizeof(struct squashfs_super_block), sizeof(c_byte), &c_byte); @@ -6183,7 +6183,7 @@ int main(int argc, char *argv[]) bytes = sizeof(struct squashfs_super_block) + sizeof(c_byte) + size; comp_opts = TRUE; - } else + } else bytes = sizeof(struct squashfs_super_block); } else { unsigned int last_directory_block, inode_dir_offset, @@ -6216,7 +6216,7 @@ int main(int argc, char *argv[]) if((append_fragments = fragments = sBlk.fragments)) { fragment_table = realloc((char *) fragment_table, ((fragments + FRAG_SIZE - 1) & ~(FRAG_SIZE - 1)) - * sizeof(struct squashfs_fragment_entry)); + * sizeof(struct squashfs_fragment_entry)); if(fragment_table == NULL) BAD_ERROR("Out of memory in save filesystem state\n"); } @@ -6234,7 +6234,7 @@ int main(int argc, char *argv[]) ~(SQUASHFS_METADATA_SIZE - 1); uncompressed_data = (inode_dir_offset + inode_dir_file_size) & (SQUASHFS_METADATA_SIZE - 1); - + /* save original filesystem state for restoring ... */ sfragments = fragments; sbytes = bytes; @@ -6303,7 +6303,7 @@ int main(int argc, char *argv[]) "state\n"); memcpy(sdirectory_compressed, directory_table + inode_dir_start_block, - sdirectory_compressed_bytes); + sdirectory_compressed_bytes); sdirectory_bytes = inode_dir_start_block; root_inode_number = inode_dir_inode_number; inode_no = sBlk.inodes + 1; @@ -6319,7 +6319,7 @@ int main(int argc, char *argv[]) if(path) paths = add_subdir(paths, path); - dump_actions(); + dump_actions(); dump_pseudos(); if(delete && !keep_as_directory && source == 1 && diff --git a/SQUASHFS/squashfs-tools-4.4/squashfs-tools/pseudo.c b/SQUASHFS/squashfs-tools-4.4/squashfs-tools/pseudo.c index 48e6b27f0d6..3c4e5991adf 100644 --- a/SQUASHFS/squashfs-tools-4.4/squashfs-tools/pseudo.c +++ b/SQUASHFS/squashfs-tools-4.4/squashfs-tools/pseudo.c @@ -340,7 +340,7 @@ int read_pseudo_def(char *def) default: ERROR("Read filename, type, mode and uid, but failed " "to read or match gid\n"); - break; + break; } goto error; } @@ -364,8 +364,8 @@ int read_pseudo_def(char *def) "and major, but failed to read or " "match minor\n"); goto error; - } - + } + if(major > 0xfff) { ERROR("Major %d out of range\n", major); goto error; @@ -395,7 +395,7 @@ int read_pseudo_def(char *def) ERROR("Expected command, which can be an executable " "or a piece of shell script\n"); goto error; - } + } break; case 's': if(def[0] == '\0') { @@ -437,7 +437,7 @@ int read_pseudo_def(char *def) goto error; } } - + gid = strtoll(sgid, &ptr, 10); if(*ptr == '\0') { if(gid < 0 || gid > ((1LL << 32) - 1)) { diff --git a/SQUASHFS/squashfs-tools-4.4/squashfs-tools/pseudo.h b/SQUASHFS/squashfs-tools-4.4/squashfs-tools/pseudo.h index ef693c3c546..ded51ab1a21 100644 --- a/SQUASHFS/squashfs-tools-4.4/squashfs-tools/pseudo.h +++ b/SQUASHFS/squashfs-tools-4.4/squashfs-tools/pseudo.h @@ -43,7 +43,7 @@ struct pseudo_entry { struct pseudo *pseudo; struct pseudo_dev *dev; }; - + struct pseudo { int names; int count; diff --git a/SQUASHFS/squashfs-tools-4.4/squashfs-tools/read_file.c b/SQUASHFS/squashfs-tools-4.4/squashfs-tools/read_file.c index 22705a00378..1ae57e3b9b6 100644 --- a/SQUASHFS/squashfs-tools-4.4/squashfs-tools/read_file.c +++ b/SQUASHFS/squashfs-tools-4.4/squashfs-tools/read_file.c @@ -39,7 +39,7 @@ * parsing. * * Lines can be split across multiple lines using "\". - * + * * Blank lines and comment lines indicated by # are supported. */ int read_file(char *filename, char *type, int (parse_line)(char *)) @@ -102,7 +102,7 @@ int read_file(char *filename, char *type, int (parse_line)(char *)) break; else total --; - } + } if(err == NULL) { if(ferror(fd)) { diff --git a/SQUASHFS/squashfs-tools-4.4/squashfs-tools/read_fs.c b/SQUASHFS/squashfs-tools-4.4/squashfs-tools/read_fs.c index 0730e8caa7a..5ec870c6405 100644 --- a/SQUASHFS/squashfs-tools-4.4/squashfs-tools/read_fs.c +++ b/SQUASHFS/squashfs-tools-4.4/squashfs-tools/read_fs.c @@ -58,7 +58,7 @@ int read_block(int fd, long long start, long long *next, int expected, unsigned short c_byte; int res, compressed; int outlen = expected ? expected : SQUASHFS_METADATA_SIZE; - + /* Read block size */ res = read_fs_bytes(fd, start, 2, &c_byte); if(res == 0) @@ -201,7 +201,7 @@ unsigned char *scan_inode_table(int fd, long long start, long long end, *root_inode_size = bytes - (*root_inode_block + root_inode_offset); bytes = *root_inode_block + root_inode_offset; SQUASHFS_SWAP_DIR_INODE_HEADER(inode_table + bytes, &dir_inode->dir); - + if(dir_inode->base.inode_type == SQUASHFS_DIR_TYPE) directory_start_block = dir_inode->dir.start_block; else if(dir_inode->base.inode_type == SQUASHFS_LDIR_TYPE) { @@ -290,10 +290,10 @@ unsigned char *scan_inode_table(int fd, long long start, long long end, add_file(start, inode.file_size, file_bytes, block_list, blocks, inode.fragment, inode.offset, frag_bytes); - + cur_ptr += blocks * sizeof(unsigned int); break; - } + } case SQUASHFS_LREG_TYPE: { struct squashfs_lreg_inode_header inode; int frag_bytes, blocks, i; @@ -349,7 +349,7 @@ unsigned char *scan_inode_table(int fd, long long start, long long end, cur_ptr += blocks * sizeof(unsigned int); break; - } + } case SQUASHFS_SYMLINK_TYPE: case SQUASHFS_LSYMLINK_TYPE: { struct squashfs_symlink_inode_header inode; @@ -383,7 +383,7 @@ unsigned char *scan_inode_table(int fd, long long start, long long end, if(NO_INODE_BYTES(squashfs_dir_inode_header)) /* corrupted filesystem */ goto corrupted; - + SQUASHFS_SWAP_DIR_INODE_HEADER(cur_ptr, &dir_inode); if(dir_inode.start_block < directory_start_block) @@ -415,7 +415,7 @@ unsigned char *scan_inode_table(int fd, long long start, long long end, if(NO_BYTES(sizeof(index))) /* corrupted filesystem */ goto corrupted; - + SQUASHFS_SWAP_DIR_INDEX(cur_ptr, &index); if(NO_BYTES(index.size + 1)) @@ -482,7 +482,7 @@ unsigned char *scan_inode_table(int fd, long long start, long long end, goto corrupted; } } - + printf("Read existing filesystem, %d inodes scanned\n", files); return inode_table; @@ -559,7 +559,7 @@ struct compressor *read_super(int fd, struct squashfs_super_block *sBlk, char *s * been changed by the user specifying options on the command * line which need to be over-ridden). * - * Compressor_extract_options is also used to ensure that + * Compressor_extract_options is also used to ensure that * we know how decompress a filesystem compressed with these * compression options. */ @@ -634,7 +634,7 @@ unsigned char *squashfs_readdir(int fd, int root_entries, unsigned char *directory_table = NULL; int byte, bytes = 0, dir_count; long long start = sBlk->directory_table_start + directory_start_block, - last_start_block = start; + last_start_block = start; size += offset; directory_table = malloc((size + SQUASHFS_METADATA_SIZE * 2 - 1) & @@ -664,7 +664,7 @@ unsigned char *squashfs_readdir(int fd, int root_entries, goto all_done; bytes = offset; - while(bytes < size) { + while(bytes < size) { SQUASHFS_SWAP_DIR_HEADER(directory_table + bytes, &dirh); dir_count = dirh.count + 1; @@ -940,7 +940,7 @@ long long read_filesystem(char *root_name, int fd, struct squashfs_super_block * *inode_dir_start_block, *inode_dir_offset, *inode_dir_file_size, last_directory_block, sBlk, push_directory_entry); - if(directory_table == NULL) + if(directory_table == NULL) goto error; root_inode_start -= start; diff --git a/SQUASHFS/squashfs-tools-4.4/squashfs-tools/read_xattrs.c b/SQUASHFS/squashfs-tools-4.4/squashfs-tools/read_xattrs.c index 4debedfc566..90b3ae463fb 100644 --- a/SQUASHFS/squashfs-tools-4.4/squashfs-tools/read_xattrs.c +++ b/SQUASHFS/squashfs-tools-4.4/squashfs-tools/read_xattrs.c @@ -381,7 +381,7 @@ struct xattr_list *get_xattr(int i, unsigned int *count, int *failed) if(xattr_list == NULL) MEM_ERROR(); } - + SQUASHFS_SWAP_XATTR_ENTRY(xptr, &entry); xptr += sizeof(entry); @@ -396,9 +396,9 @@ struct xattr_list *get_xattr(int i, unsigned int *count, int *failed) } xptr += entry.size; - + TRACE("get_xattr: xattr %d, type %d, size %d, name %s\n", j, - entry.type, entry.size, xattr_list[j].full_name); + entry.type, entry.size, xattr_list[j].full_name); if(entry.type & SQUASHFS_XATTR_VALUE_OOL) { long long xattr; @@ -406,7 +406,7 @@ struct xattr_list *get_xattr(int i, unsigned int *count, int *failed) xptr += sizeof(val); SQUASHFS_SWAP_LONG_LONGS(xptr, &xattr, 1); - xptr += sizeof(xattr); + xptr += sizeof(xattr); start = SQUASHFS_XATTR_BLK(xattr) + xattr_table_start; offset = SQUASHFS_XATTR_OFFSET(xattr); ool_xptr = xattrs + get_xattr_block(start) + offset; diff --git a/SQUASHFS/squashfs-tools-4.4/squashfs-tools/sort.h b/SQUASHFS/squashfs-tools-4.4/squashfs-tools/sort.h index 98db62c4f92..98ef7240e4d 100644 --- a/SQUASHFS/squashfs-tools-4.4/squashfs-tools/sort.h +++ b/SQUASHFS/squashfs-tools-4.4/squashfs-tools/sort.h @@ -1,4 +1,4 @@ -#ifndef SORT_H +#ifndef SORT_H #define SORT_H /* diff --git a/SQUASHFS/squashfs-tools-4.4/squashfs-tools/squashfs_compat.h b/SQUASHFS/squashfs-tools-4.4/squashfs-tools/squashfs_compat.h index 9359fee5b39..610aacd4e20 100644 --- a/SQUASHFS/squashfs-tools-4.4/squashfs-tools/squashfs_compat.h +++ b/SQUASHFS/squashfs-tools-4.4/squashfs-tools/squashfs_compat.h @@ -100,7 +100,7 @@ struct squashfs_dev_inode_header_3 { unsigned int nlink; unsigned short rdev; } __attribute__ ((packed)); - + struct squashfs_symlink_inode_header_3 { unsigned int inode_type:4; unsigned int mode:12; @@ -182,7 +182,7 @@ union squashfs_inode_header_3 { struct squashfs_ldir_inode_header_3 ldir; struct squashfs_ipc_inode_header_3 ipc; }; - + struct squashfs_dir_entry_3 { unsigned int offset:13; unsigned int type:3; @@ -482,7 +482,7 @@ struct squashfs_dev_inode_header_1 { unsigned int guid:4; /* index into guid table */ unsigned short rdev; } __attribute__ ((packed)); - + struct squashfs_symlink_inode_header_1 { unsigned int inode_type:4; unsigned int mode:12; /* protection */ @@ -615,7 +615,7 @@ struct squashfs_dev_inode_header_2 { unsigned int guid:8; /* index into guid table */ unsigned short rdev; } __attribute__ ((packed)); - + struct squashfs_symlink_inode_header_2 { unsigned int inode_type:4; unsigned int mode:12; /* protection */ @@ -671,7 +671,7 @@ union squashfs_inode_header_2 { struct squashfs_ldir_inode_header_2 ldir; struct squashfs_ipc_inode_header_2 ipc; }; - + struct squashfs_dir_header_2 { unsigned int count:8; unsigned int start_block:24; diff --git a/SQUASHFS/squashfs-tools-4.4/squashfs-tools/squashfs_fs.h b/SQUASHFS/squashfs-tools-4.4/squashfs-tools/squashfs_fs.h index 79dfae483b6..52923fe137a 100644 --- a/SQUASHFS/squashfs-tools-4.4/squashfs-tools/squashfs_fs.h +++ b/SQUASHFS/squashfs-tools-4.4/squashfs-tools/squashfs_fs.h @@ -24,7 +24,7 @@ * squashfs_fs.h */ -#define SQUASHFS_CACHED_FRAGMENTS CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE +#define SQUASHFS_CACHED_FRAGMENTS CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE #define SQUASHFS_MAJOR 4 #define SQUASHFS_MINOR 0 #define SQUASHFS_MAGIC 0x73717368 @@ -355,7 +355,7 @@ struct squashfs_dev_inode_header { unsigned int nlink; unsigned int rdev; }; - + struct squashfs_ldev_inode_header { unsigned short inode_type; unsigned short mode; @@ -367,7 +367,7 @@ struct squashfs_ldev_inode_header { unsigned int rdev; unsigned int xattr; }; - + struct squashfs_symlink_inode_header { unsigned short inode_type; unsigned short mode; @@ -454,7 +454,7 @@ union squashfs_inode_header { struct squashfs_ipc_inode_header ipc; struct squashfs_lipc_inode_header lipc; }; - + struct squashfs_dir_entry { unsigned short offset; short inode_number; diff --git a/SQUASHFS/squashfs-tools-4.4/squashfs-tools/unsquash-1.c b/SQUASHFS/squashfs-tools-4.4/squashfs-tools/unsquash-1.c index 34eced36a31..e89d8cb05b1 100644 --- a/SQUASHFS/squashfs-tools-4.4/squashfs-tools/unsquash-1.c +++ b/SQUASHFS/squashfs-tools-4.4/squashfs-tools/unsquash-1.c @@ -62,7 +62,7 @@ static struct inode *read_inode(unsigned int start_block, unsigned int offset) if(bytes == -1) EXIT_UNSQUASH("read_inode: inode table block %lld not found\n", - start); + start); if(swap) { squashfs_base_inode_header_1 sinode; @@ -144,7 +144,7 @@ static struct inode *read_inode(unsigned int start_block, unsigned int offset) i.offset = 0; i.sparse = 0; break; - } + } case SQUASHFS_SYMLINK_TYPE: { squashfs_symlink_inode_header_1 *inodep = &header.symlink; @@ -236,7 +236,7 @@ static struct dir *squashfs_opendir(unsigned int block_start, unsigned int offse * returning -1 is incorrectly treated as an error */ return dir; - + start = sBlk.s.directory_table_start + (*i)->start; bytes = lookup_entry(directory_table_hash, start); if(bytes == -1) @@ -246,14 +246,14 @@ static struct dir *squashfs_opendir(unsigned int block_start, unsigned int offse bytes += (*i)->offset; size = (*i)->data + bytes; - while(bytes < size) { + while(bytes < size) { if(swap) { squashfs_dir_header_2 sdirh; memcpy(&sdirh, directory_table + bytes, sizeof(sdirh)); SQUASHFS_SWAP_DIR_HEADER_2(&dirh, &sdirh); } else memcpy(&dirh, directory_table + bytes, sizeof(dirh)); - + dir_count = dirh.count + 1; TRACE("squashfs_opendir: Read directory header @ byte position " "%d, %d directory entries\n", bytes, dir_count); diff --git a/SQUASHFS/squashfs-tools-4.4/squashfs-tools/unsquash-2.c b/SQUASHFS/squashfs-tools-4.4/squashfs-tools/unsquash-2.c index 4b3d767ed11..326e9ecda04 100644 --- a/SQUASHFS/squashfs-tools-4.4/squashfs-tools/unsquash-2.c +++ b/SQUASHFS/squashfs-tools-4.4/squashfs-tools/unsquash-2.c @@ -165,7 +165,7 @@ static struct inode *read_inode(unsigned int start_block, unsigned int offset) if(bytes == -1) EXIT_UNSQUASH("read_inode: inode table block %lld not found\n", - start); + start); if(swap) { squashfs_base_inode_header_2 sinode; @@ -246,7 +246,7 @@ static struct inode *read_inode(unsigned int start_block, unsigned int offset) i.sparse = 0; i.block_ptr = block_ptr + sizeof(*inode); break; - } + } case SQUASHFS_SYMLINK_TYPE: { squashfs_symlink_inode_header_2 *inodep = &header.symlink; diff --git a/SQUASHFS/squashfs-tools-4.4/squashfs-tools/unsquash-3.c b/SQUASHFS/squashfs-tools-4.4/squashfs-tools/unsquash-3.c index 02c31fc56ba..3a1a1a8ae30 100644 --- a/SQUASHFS/squashfs-tools-4.4/squashfs-tools/unsquash-3.c +++ b/SQUASHFS/squashfs-tools-4.4/squashfs-tools/unsquash-3.c @@ -103,7 +103,7 @@ static int read_fragment_table(long long *table_start) length, sfragment_table_index); if(res == FALSE) { ERROR("read_fragment_table: failed to read fragment " - "table index\n"); + "table index\n"); return FALSE; } SQUASHFS_SWAP_FRAGMENT_INDEXES_3(fragment_table_index, @@ -113,7 +113,7 @@ static int read_fragment_table(long long *table_start) length, fragment_table_index); if(res == FALSE) { ERROR("read_fragment_table: failed to read fragment " - "table index\n"); + "table index\n"); return FALSE; } } @@ -128,7 +128,7 @@ static int read_fragment_table(long long *table_start) i, fragment_table_index[i], length); if(length == FALSE) { ERROR("read_fragment_table: failed to read fragment " - "table block\n"); + "table block\n"); return FALSE; } } @@ -170,7 +170,7 @@ static struct inode *read_inode(unsigned int start_block, unsigned int offset) if(bytes == -1) EXIT_UNSQUASH("read_inode: inode table block %lld not found\n", - start); + start); if(swap) { squashfs_base_inode_header_3 sinode; @@ -248,7 +248,7 @@ static struct inode *read_inode(unsigned int start_block, unsigned int offset) i.sparse = 1; i.block_ptr = block_ptr + sizeof(*inode); break; - } + } case SQUASHFS_LREG_TYPE: { squashfs_lreg_inode_header_3 *inode = &header.lreg; @@ -273,7 +273,7 @@ static struct inode *read_inode(unsigned int start_block, unsigned int offset) i.sparse = 1; i.block_ptr = block_ptr + sizeof(*inode); break; - } + } case SQUASHFS_SYMLINK_TYPE: { squashfs_symlink_inode_header_3 *inodep = &header.symlink; @@ -374,14 +374,14 @@ static struct dir *squashfs_opendir(unsigned int block_start, unsigned int offse bytes += (*i)->offset; size = (*i)->data + bytes - 3; - while(bytes < size) { + while(bytes < size) { if(swap) { squashfs_dir_header_3 sdirh; memcpy(&sdirh, directory_table + bytes, sizeof(sdirh)); SQUASHFS_SWAP_DIR_HEADER_3(&dirh, &sdirh); } else memcpy(&dirh, directory_table + bytes, sizeof(dirh)); - + dir_count = dirh.count + 1; TRACE("squashfs_opendir: Read directory header @ byte position " "%d, %d directory entries\n", bytes, dir_count); diff --git a/SQUASHFS/squashfs-tools-4.4/squashfs-tools/unsquash-4.c b/SQUASHFS/squashfs-tools-4.4/squashfs-tools/unsquash-4.c index 8475835cde8..b464a0d0f6c 100644 --- a/SQUASHFS/squashfs-tools-4.4/squashfs-tools/unsquash-4.c +++ b/SQUASHFS/squashfs-tools-4.4/squashfs-tools/unsquash-4.c @@ -98,7 +98,7 @@ static int read_fragment_table(long long *table_start) } } - for(i = 0; i < sBlk.s.fragments; i++) + for(i = 0; i < sBlk.s.fragments; i++) SQUASHFS_INSWAP_FRAGMENT_ENTRY(&fragment_table[i]); *table_start = fragment_table_index[0]; @@ -130,7 +130,7 @@ static struct inode *read_inode(unsigned int start_block, unsigned int offset) if(bytes == -1) EXIT_UNSQUASH("read_inode: inode table block %lld not found\n", - start); + start); SQUASHFS_SWAP_BASE_INODE_HEADER(block_ptr, &header.base); @@ -183,7 +183,7 @@ static struct inode *read_inode(unsigned int start_block, unsigned int offset) i.block_ptr = block_ptr + sizeof(*inode); i.xattr = SQUASHFS_INVALID_XATTR; break; - } + } case SQUASHFS_LREG_TYPE: { struct squashfs_lreg_inode_header *inode = &header.lreg; @@ -203,7 +203,7 @@ static struct inode *read_inode(unsigned int start_block, unsigned int offset) i.block_ptr = block_ptr + sizeof(*inode); i.xattr = inode->xattr; break; - } + } case SQUASHFS_SYMLINK_TYPE: case SQUASHFS_LSYMLINK_TYPE: { struct squashfs_symlink_inode_header *inode = &header.symlink; @@ -321,9 +321,9 @@ static struct dir *squashfs_opendir(unsigned int block_start, unsigned int offse bytes += (*i)->offset; size = (*i)->data + bytes - 3; - while(bytes < size) { + while(bytes < size) { SQUASHFS_SWAP_DIR_HEADER(directory_table + bytes, &dirh); - + dir_count = dirh.count + 1; TRACE("squashfs_opendir: Read directory header @ byte position " "%d, %d directory entries\n", bytes, dir_count); diff --git a/SQUASHFS/squashfs-tools-4.4/squashfs-tools/unsquashfs.c b/SQUASHFS/squashfs-tools-4.4/squashfs-tools/unsquashfs.c index 2fc549a94df..27da010bc4e 100644 --- a/SQUASHFS/squashfs-tools-4.4/squashfs-tools/unsquashfs.c +++ b/SQUASHFS/squashfs-tools-4.4/squashfs-tools/unsquashfs.c @@ -59,7 +59,7 @@ typedef struct fs_disk_map { char diskname[32]; uint64_t filesize; - + //fs_disk_region[N]; }fs_disk_map; #pragma pack() @@ -190,7 +190,7 @@ int shift_overflow(int a, int shift) return (INT_MAX >> shift) < a; } - + int multiply_overflow(int a, int multiplier) { return (INT_MAX / multiplier) < a; @@ -259,7 +259,7 @@ void dump_queue(struct queue *queue) { pthread_mutex_lock(&queue->mutex); - printf("Max size %d, size %d%s\n", queue->size - 1, + printf("Max size %d, size %d%s\n", queue->size - 1, queue->readp <= queue->writep ? queue->writep - queue->readp : queue->size - queue->readp + queue->writep, queue->readp == queue->writep ? " (EMPTY)" : @@ -442,13 +442,13 @@ struct cache_entry *cache_get(struct cache *cache, long long block, int size) return entry; } - + void cache_block_ready(struct cache_entry *entry, int error) { /* * mark cache entry as being complete, reading and (if necessary) * decompression has taken place, and the buffer is valid for use. - * If an error occurs reading or decompressing, the buffer also + * If an error occurs reading or decompressing, the buffer also * becomes ready but with an error... */ pthread_mutex_lock(&entry->cache->mutex); @@ -570,7 +570,7 @@ int print_filename(char *pathname, struct inode *inode) userstr = dummy; } else userstr = user->pw_name; - + group = numeric ? NULL : getgrgid(inode->gid); if(group == NULL) { int res = snprintf(dummy2, 12, "%d", inode->gid); @@ -602,7 +602,7 @@ int print_filename(char *pathname, struct inode *inode) case S_IFCHR: case S_IFBLK: padchars = TOTALCHARS - strlen(userstr) - - strlen(groupstr) - 7; + strlen(groupstr) - 7; printf("%*s%3d,%3d ", padchars > 0 ? padchars : 0, " ", (int) inode->data >> 8, (int) inode->data & @@ -617,10 +617,10 @@ int print_filename(char *pathname, struct inode *inode) if((inode->mode & S_IFMT) == S_IFLNK) printf(" -> %s", inode->symlink); printf("\n"); - + return 1; } - + void add_entry(struct hash_table_entry *hash_table[], long long start, long long bytes) @@ -671,7 +671,7 @@ int read_fs_sectors(int fd, uint32_t sector, uint32_t count, char *buf) offset = sector - total; left = region->count - offset; readcnt = (count <= left) ? count : left; - + lseek(fd, (uint64_t)(offset + region->sector) * 512ULL, SEEK_SET); read(fd, buf, (uint64_t)readcnt * 512ULL); @@ -792,7 +792,7 @@ int read_block(int fd, long long start, long long *next, int expected, if(read_fs_bytes(fd, start, 2, &c_byte) == FALSE) goto failed; c_byte = (c_byte >> 8) | ((c_byte & 0xff) << 8); - } else + } else if(read_fs_bytes(fd, start, 2, &c_byte) == FALSE) goto failed; @@ -900,7 +900,7 @@ void *read_inode_table(long long start, long long end) ERROR("read_inode_table: metadata block should be %d " "bytes in length, it is %d bytes\n", SQUASHFS_METADATA_SIZE, res); - + goto failed; } } @@ -1228,7 +1228,7 @@ int create_inode(char *pathname, struct inode *i) res = write_xattr(pathname, i->xattr); if(res == FALSE) failed = TRUE; - + if(root_process) { res = lchown(pathname, i->uid, i->gid); if(res == -1) { @@ -1483,7 +1483,7 @@ struct pathname *add_path(struct pathname *paths, char *target, char *alltarget) paths->name = realloc(paths->name, (i + 1) * sizeof(struct path_entry)); if(paths->name == NULL) - EXIT_UNSQUASH("Out of memory in add_path\n"); + EXIT_UNSQUASH("Out of memory in add_path\n"); paths->name[i].name = targname; paths->name[i].paths = NULL; if(use_regex) { @@ -1734,7 +1734,7 @@ int dir_scan(char *parent_name, unsigned int start_block, unsigned int offset, strerror(errno)); squashfs_closedir(dir); return FALSE; - } + } /* * Try to change permissions of existing directory so @@ -2044,7 +2044,7 @@ int read_super(char *source) sBlk.guid_start = sBlk_3.guid_start_2; sBlk.s.inode_table_start = sBlk_3.inode_table_start_2; sBlk.s.directory_table_start = sBlk_3.directory_table_start_2; - + if(sBlk.s.s_major == 1) { sBlk.s.block_size = sBlk_3.block_size_1; sBlk.s.fragment_table_start = sBlk.uid_start; @@ -2129,7 +2129,7 @@ struct pathname *process_extract_files(struct pathname *path, char *filename) fclose(fd); return path; } - + /* * reader thread. This thread processes read requests queued by the @@ -2295,7 +2295,7 @@ void *inflator(void *arg) * block has been either successfully decompressed, or an error * occurred, clear pending flag, set error appropriately and * wake up any threads waiting on this block - */ + */ cache_block_ready(entry, res == -1); } } @@ -2572,7 +2572,7 @@ void progressbar_info(char *fmt, ...) static int get_max_digits(long long max) { int digits = 0; - + while (max > 10) { max /= 10; digits++; @@ -2755,18 +2755,18 @@ int ventoy_parse_disk_map(void) read(fd, &g_fs_disk_map, sizeof(fs_disk_map)); - debug("diskname=<%s> filesize=<%llu> region_num=<%u>\n", + debug("diskname=<%s> filesize=<%llu> region_num=<%u>\n", g_fs_disk_map.diskname, g_fs_disk_map.filesize, g_fs_region_num); g_fs_region_num = (len - sizeof(fs_disk_map)) / sizeof(fs_disk_region); g_fs_region_list = malloc(g_fs_region_num * sizeof(fs_disk_region)); read(fd, g_fs_region_list, g_fs_region_num * sizeof(fs_disk_region)); - close(fd); - + close(fd); + fd = open(g_fs_disk_map.diskname, O_RDONLY); debug("ventoy_parse_disk_map end fd=%d\n", fd); - + return 0; } @@ -2805,7 +2805,7 @@ int main(int argc, char *argv[]) root_process = geteuid() == 0; if(root_process) umask(0); - + for(i = 1; i < argc; i++) { if(*argv[i] != '-') break; @@ -2860,7 +2860,7 @@ int main(int argc, char *argv[]) dest = argv[i]; } else if(strcmp(argv[i], "-processors") == 0 || strcmp(argv[i], "-p") == 0) { - if((++i == argc) || + if((++i == argc) || !parse_number(argv[i], &processors)) { ERROR("%s: -processors missing or invalid " @@ -3153,7 +3153,7 @@ int main(int argc, char *argv[]) printf("created %d fifos\n", fifo_count); } - close(fd); + close(fd); return exit_code; } diff --git a/SQUASHFS/squashfs-tools-4.4/squashfs-tools/unsquashfs_xattr.c b/SQUASHFS/squashfs-tools-4.4/squashfs-tools/unsquashfs_xattr.c index 7742dfe2bf8..a3680779ae7 100644 --- a/SQUASHFS/squashfs-tools-4.4/squashfs-tools/unsquashfs_xattr.c +++ b/SQUASHFS/squashfs-tools-4.4/squashfs-tools/unsquashfs_xattr.c @@ -73,7 +73,7 @@ int write_xattr(char *pathname, unsigned int xattr) * is rather annoying */ ERROR("write_xattr: failed to write " - "xattr %s for file %s because " + "xattr %s for file %s because " "extended attributes are not " "supported by the destination " "filesystem\n", @@ -97,7 +97,7 @@ int write_xattr(char *pathname, unsigned int xattr) * then suppress the error messsage */ EXIT_UNSQUASH_IGNORE("write_xattr: failed to write " - "xattr %s for file %s because " + "xattr %s for file %s because " "no extended attribute space " "remaining (per file or " "filesystem limit)\n", diff --git a/SQUASHFS/squashfs-tools-4.4/squashfs-tools/xattr.c b/SQUASHFS/squashfs-tools-4.4/squashfs-tools/xattr.c index 64dfd82d484..443e57763c3 100644 --- a/SQUASHFS/squashfs-tools-4.4/squashfs-tools/xattr.c +++ b/SQUASHFS/squashfs-tools-4.4/squashfs-tools/xattr.c @@ -110,7 +110,7 @@ static int get_prefix(struct xattr_list *xattr, char *name) return prefix_table[i].type; } - + static int read_xattrs_from_system(char *filename, struct xattr_list **xattrs) { ssize_t size, vsize; @@ -201,7 +201,7 @@ static int read_xattrs_from_system(char *filename, struct xattr_list **xattrs) goto failed; } } - + break; } xattr_list[i].vsize = vsize; @@ -324,7 +324,7 @@ static struct dupl_id *check_id_dupl(struct xattr_list *xattr_list, int xattrs) if(memcmp(xattr->value, dup_xattr->value, xattr->vsize)) break; } - + if(i == xattrs) break; } @@ -340,7 +340,7 @@ static struct dupl_id *check_id_dupl(struct xattr_list *xattr_list, int xattrs) entry->next = dupl_id[checksum]; dupl_id[checksum] = entry; } - + return entry; } @@ -357,7 +357,7 @@ static void check_value_dupl(struct xattr_list *xattr) for(entry = dupl_value[xattr->vchecksum]; entry; entry = entry->vnext) { if(entry->vsize != xattr->vsize) continue; - + if(memcmp(entry->value, xattr->value, xattr->vsize) == 0) break; } @@ -417,7 +417,7 @@ static int get_xattr_id(int xattrs, struct xattr_list *xattr_list, xattr_dupl->xattr_id = xattr_ids ++; return xattr_dupl->xattr_id; } - + long long write_xattrs() { @@ -490,7 +490,7 @@ int generate_xattrs(int xattrs, struct xattr_list *xattr_list) xattr_dupl = check_id_dupl(xattr_list, xattrs); if(xattr_dupl->xattr_id != SQUASHFS_INVALID_XATTR) return xattr_dupl->xattr_id; - + /* * Scan the xattr_list deciding which type to assign to each * xattr. The choice is fairly straightforward, and depends on the diff --git a/SQUASHFS/squashfs-tools-4.4/squashfs-tools/xz_wrapper.c b/SQUASHFS/squashfs-tools-4.4/squashfs-tools/xz_wrapper.c index 0977f744a64..89e81fac243 100644 --- a/SQUASHFS/squashfs-tools-4.4/squashfs-tools/xz_wrapper.c +++ b/SQUASHFS/squashfs-tools-4.4/squashfs-tools/xz_wrapper.c @@ -97,7 +97,7 @@ static int xz_options(char *argv[], int argc) goto failed; } } - + return 1; } else if(strcmp(argv[0], "-Xdict-size") == 0) { char *b; @@ -144,7 +144,7 @@ static int xz_options(char *argv[], int argc) } return -1; - + failed: return -2; } @@ -190,7 +190,7 @@ static int xz_options_post(int block_size) * 2^n or as 2^n+2^(n+1) */ n = ffs(dictionary_size) - 1; - if(dictionary_size != (1 << n) && + if(dictionary_size != (1 << n) && dictionary_size != ((1 << n) + (1 << (n + 1)))) { fprintf(stderr, "xz: -Xdict-size is an unsupported " "value, dict-size must be storable in xz " @@ -287,7 +287,7 @@ static int xz_extract_options(int block_size, void *buffer, int size) /* check passed comp opts struct is of the correct length */ if(size != sizeof(struct comp_opts)) goto failed; - + SQUASHFS_INSWAP_COMP_OPTS(comp_opts); dictionary_size = comp_opts->dictionary_size; @@ -298,7 +298,7 @@ static int xz_extract_options(int block_size, void *buffer, int size) * size should 2^n or 2^n+2^(n+1) */ n = ffs(dictionary_size) - 1; - if(dictionary_size != (1 << n) && + if(dictionary_size != (1 << n) && dictionary_size != ((1 << n) + (1 << (n + 1)))) goto failed; } @@ -342,7 +342,7 @@ static void xz_display_options(void *buffer, int size) * size should 2^n or 2^n+2^(n+1) */ n = ffs(dictionary_size) - 1; - if(dictionary_size != (1 << n) && + if(dictionary_size != (1 << n) && dictionary_size != ((1 << n) + (1 << (n + 1)))) goto failed; @@ -370,7 +370,7 @@ static void xz_display_options(void *buffer, int size) failed: fprintf(stderr, "xz: error reading stored compressor options from " "filesystem!\n"); -} +} /* @@ -455,7 +455,7 @@ static int xz_compress(void *strm, void *dest, void *src, int size, res = lzma_stream_buffer_encode(filter->filter, LZMA_CHECK_CRC32, NULL, src, size, filter->buffer, &filter->length, block_size); - + if(res == LZMA_OK) { if(!selected || selected->length > filter->length) selected = filter; diff --git a/Unix/pack_unix.sh b/Unix/pack_unix.sh index 1515d8ccd34..e5d0a5e330d 100644 --- a/Unix/pack_unix.sh +++ b/Unix/pack_unix.sh @@ -4,7 +4,7 @@ VENTOY_PATH=$PWD/../ rm -f ventoy_unix.cpio -mv ./ventoy_unix/DragonFly ./ +mv ./ventoy_unix/DragonFly ./ find ./ventoy_unix | cpio -o -H newc>ventoy_unix.cpio mv ./DragonFly ./ventoy_unix/ diff --git a/Unix/ventoy_unix/DragonFly/mkinitrd.sh b/Unix/ventoy_unix/DragonFly/mkinitrd.sh index 4bcf903b3e9..eea1a7da4fa 100644 --- a/Unix/ventoy_unix/DragonFly/mkinitrd.sh +++ b/Unix/ventoy_unix/DragonFly/mkinitrd.sh @@ -19,7 +19,7 @@ mkdir /mnt/tmp dd if=/dev/zero of=./data bs=1M count=8 -cat ./dmtable ./data ./dmtable > /mnt/dmtable +cat ./dmtable ./data ./dmtable > /mnt/dmtable umount /mnt diff --git a/Unix/ventoy_unix_src/DragonFly/mount_cd9660.c b/Unix/ventoy_unix_src/DragonFly/mount_cd9660.c index 5827154945c..f119accfd42 100644 --- a/Unix/ventoy_unix_src/DragonFly/mount_cd9660.c +++ b/Unix/ventoy_unix_src/DragonFly/mount_cd9660.c @@ -204,7 +204,7 @@ get_ssector(const char *dev) return -1; } close(fd); - + for (i = ntocentries - 1; i >= 0; i--) if ((toc_buffer[i].control & 4) != 0) /* found a data track */ diff --git a/Unix/ventoy_unix_src/DragonFly/mount_null.c b/Unix/ventoy_unix_src/DragonFly/mount_null.c index cf6f746aa60..2aeead5fff2 100644 --- a/Unix/ventoy_unix_src/DragonFly/mount_null.c +++ b/Unix/ventoy_unix_src/DragonFly/mount_null.c @@ -91,7 +91,7 @@ mount_null(const char *src, const char *dst) if (mount(vfc.vfc_name, source, mntflags, &args)) err(1, NULL); - + return 0; } diff --git a/Unix/ventoy_unix_src/DragonFly/oinit.c b/Unix/ventoy_unix_src/DragonFly/oinit.c index 532333454eb..a78a7555664 100644 --- a/Unix/ventoy_unix_src/DragonFly/oinit.c +++ b/Unix/ventoy_unix_src/DragonFly/oinit.c @@ -171,7 +171,7 @@ int main(int argc __unused, char **argv) signal(SIGTERM, SIG_IGN); if ((pid = fork()) == 0) { - + setctty(_PATH_CONSOLE); sysctlbyname("debug.bootverbose", &boot_verbose, &varsize, NULL, 0); diff --git a/Unix/ventoy_unix_src/DragonFly/vtutil.h b/Unix/ventoy_unix_src/DragonFly/vtutil.h index 4b2c6651e72..1960e212aeb 100644 --- a/Unix/ventoy_unix_src/DragonFly/vtutil.h +++ b/Unix/ventoy_unix_src/DragonFly/vtutil.h @@ -3,7 +3,7 @@ #define __UTIL_H__ extern int boot_verbose; -//#define vdebug(fmt, ...) +//#define vdebug(fmt, ...) //#define verror #define vdebug(fmt, ...) if (boot_verbose) { printf(fmt, ##__VA_ARGS__); usleep(500000); } #define verror printf diff --git a/Unix/ventoy_unix_src/DragonFly/walk_disk.c b/Unix/ventoy_unix_src/DragonFly/walk_disk.c index 93d0d0dedec..060f9565ab5 100644 --- a/Unix/ventoy_unix_src/DragonFly/walk_disk.c +++ b/Unix/ventoy_unix_src/DragonFly/walk_disk.c @@ -154,15 +154,15 @@ int prepare_dmtable(void) char prefix[MAXPATHLEN]; ventoy_image_desc desc; ventoy_img_chunk chunk; - + fIn = fopen("/dmtable", "rb"); if (!fIn) { printf("Failed to open dmtable\n"); return 1; } - - fOut = fopen("/tmp/dmtable", "w+"); + + fOut = fopen("/tmp/dmtable", "w+"); if (!fOut) { printf("Failed to create /tmp/dmtable %d\n", errno); @@ -171,9 +171,9 @@ int prepare_dmtable(void) } fread(&desc, 1, sizeof(desc), fIn); - + vdebug("[VTOY] disksize:%lu part1size:%lu chunkcount:%u\n", desc.disk_size, desc.part1_size, desc.img_chunk_count); - + for (i = 0; count <= 0 && i < 10; i++) { sleep(2); @@ -207,18 +207,18 @@ int prepare_dmtable(void) sector_start = chunk.img_start_sector; disk_sector_num = (uint32_t)(chunk.disk_end_sector + 1 - chunk.disk_start_sector); - fprintf(fOut, "%u %u linear /dev/%s %llu\n", - (sector_start << 2), disk_sector_num, + fprintf(fOut, "%u %u linear /dev/%s %llu\n", + (sector_start << 2), disk_sector_num, disk, (unsigned long long)chunk.disk_start_sector - 2048); - - vdebug("%u %u linear /dev/%s %llu\n", - (sector_start << 2), disk_sector_num, + + vdebug("%u %u linear /dev/%s %llu\n", + (sector_start << 2), disk_sector_num, disk, (unsigned long long)chunk.disk_start_sector - 2048); } -end: - fclose(fIn); - fclose(fOut); +end: + fclose(fIn); + fclose(fOut); return 0; } diff --git a/Unix/ventoy_unix_src/FreeBSD/geom_ventoy_src/10.x/sys/geom/ventoy/g_ventoy.c b/Unix/ventoy_unix_src/FreeBSD/geom_ventoy_src/10.x/sys/geom/ventoy/g_ventoy.c index a618140ef17..7b5b232ea82 100644 --- a/Unix/ventoy_unix_src/FreeBSD/geom_ventoy_src/10.x/sys/geom/ventoy/g_ventoy.c +++ b/Unix/ventoy_unix_src/FreeBSD/geom_ventoy_src/10.x/sys/geom/ventoy/g_ventoy.c @@ -72,7 +72,7 @@ static off_t g_disk_map_start = 0; static off_t g_disk_map_end = 0; static int g_ventoy_remount = 0; -struct g_ventoy_map g_ventoy_map_data __attribute__((aligned (4096))) = +struct g_ventoy_map g_ventoy_map_data __attribute__((aligned (4096))) = { { VENTOY_UNIX_SEG_MAGIC0, VENTOY_UNIX_SEG_MAGIC1, VENTOY_UNIX_SEG_MAGIC2, VENTOY_UNIX_SEG_MAGIC3 }, { 0, 0, 0, 0 }, @@ -385,7 +385,7 @@ g_ventoy_start(struct bio *bp) * Fill in the component buf structure. */ cbp->bio_done = g_std_done; - cbp->bio_offset = off + disk->d_map_start; + cbp->bio_offset = off + disk->d_map_start; cbp->bio_data = addr; addr += len; cbp->bio_length = len; @@ -433,7 +433,7 @@ g_ventoy_check_and_run(struct g_ventoy_softc *sc) sectorsize = dp->sectorsize; else { sectorsize = lcm(sectorsize, dp->sectorsize); - + } } pp->sectorsize = sectorsize; @@ -536,7 +536,7 @@ g_ventoy_add_disk(struct g_ventoy_softc *sc, struct g_provider *pp, u_int no) disk->d_start = 0; /* not yet */ disk->d_end = 0; /* not yet */ disk->d_removed = 0; - + disk->d_map_start = g_disk_map_start; disk->d_map_end = g_disk_map_end; @@ -660,7 +660,7 @@ g_ventoy_destroy_geom(struct gctl_req *req __unused, static bool g_vtoy_check_disk(struct g_class *mp, struct g_provider *pp) { int i; - int vlnk = 0; + int vlnk = 0; bool ret = true; uint8_t *buf; char uuid[64]; @@ -670,10 +670,10 @@ static bool g_vtoy_check_disk(struct g_class *mp, struct g_provider *pp) uint8_t mbrdata[] = { 0xEB, 0x63, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x54, 0x00, 0x47, 0x65, 0x00, 0x48, 0x44, 0x00, 0x52, 0x64, 0x00, 0x20, 0x45, 0x72, 0x0D, }; - + if (g_ventoy_disk_size == 0) { if (VENTOY_MAP_VALID(g_ventoy_map_data.magic2)) @@ -686,14 +686,14 @@ static bool g_vtoy_check_disk(struct g_class *mp, struct g_provider *pp) } snprintf(g_ventoy_disk_uuid, sizeof(g_ventoy_disk_uuid), "%s", uuid); g_ventoy_disk_size = g_ventoy_map_data.disksize; - + G_DEBUG("ventoy.disksize: %llu\n", (unsigned long long)g_ventoy_disk_size); G_DEBUG("ventoy.diskuuid: <%s>\n", g_ventoy_disk_uuid); } else { G_DEBUG("ventoy map data is invalid, get from resource\n"); - + if (resource_string_value("ventoy", 0, "disksize", &value) == 0) { G_DEBUG("ventoy.disksize: %s\n", value); @@ -728,10 +728,10 @@ static bool g_vtoy_check_disk(struct g_class *mp, struct g_provider *pp) g_access(cp, 1, 0, 0); g_topology_unlock(); - buf = g_read_data(cp, 0, pp->sectorsize, NULL); + buf = g_read_data(cp, 0, pp->sectorsize, NULL); g_topology_lock(); g_access(cp, -1, 0, 0); - + g_detach(cp); g_destroy_consumer(cp); g_destroy_geom(gp); @@ -811,7 +811,7 @@ g_ventoy_taste(struct g_class *mp, struct g_provider *pp, int flags __unused) g_ventoy_remount = 1; G_DEBUG("###### ventoy remount enabled ######\n"); } - + /* hint.ventoy.0.alias=xxx */ if (resource_string_value("ventoy", 0, "alias", &alias) == 0 && alias) { @@ -852,10 +852,10 @@ g_ventoy_taste(struct g_class *mp, struct g_provider *pp, int flags __unused) { if (VENTOY_MAP_VALID(g_ventoy_map_data.magic2)) { - G_DEBUG("[map] ventoy segment%d: 0x%llx@0x%llx\n", i, + G_DEBUG("[map] ventoy segment%d: 0x%llx@0x%llx\n", i, (long long)g_ventoy_map_data.seglist[i].seg_start_bytes, (long long)g_ventoy_map_data.seglist[i].seg_end_bytes); - + g_disk_map_start = (off_t)g_ventoy_map_data.seglist[i].seg_start_bytes; g_disk_map_end = (off_t)g_ventoy_map_data.seglist[i].seg_end_bytes; } @@ -873,7 +873,7 @@ g_ventoy_taste(struct g_class *mp, struct g_provider *pp, int flags __unused) } G_DEBUG("[resource] ventoy segment%d: %s\n", i, value); } - + G_VENTOY_DEBUG(1, "Adding disk %s to %s.", pp->name, gp->name); error = g_ventoy_add_disk(sc, pp, i); if (error != 0) { @@ -883,7 +883,7 @@ g_ventoy_taste(struct g_class *mp, struct g_provider *pp, int flags __unused) g_ventoy_destroy(sc, 1); return (NULL); } - + g_disk_map_start = 0; g_disk_map_end = 0; } @@ -1053,9 +1053,9 @@ g_ventoy_config(struct gctl_req *req, struct g_class *mp, const char *verb) uint32_t *version; return; - + g_topology_assert(); - + version = gctl_get_paraml(req, "version", sizeof(*version)); if (version == NULL) { gctl_error(req, "No '%s' argument.", "version"); diff --git a/Unix/ventoy_unix_src/FreeBSD/geom_ventoy_src/11.x/sys/geom/ventoy/g_ventoy.c b/Unix/ventoy_unix_src/FreeBSD/geom_ventoy_src/11.x/sys/geom/ventoy/g_ventoy.c index be9780ee9a5..1e819c55ce8 100644 --- a/Unix/ventoy_unix_src/FreeBSD/geom_ventoy_src/11.x/sys/geom/ventoy/g_ventoy.c +++ b/Unix/ventoy_unix_src/FreeBSD/geom_ventoy_src/11.x/sys/geom/ventoy/g_ventoy.c @@ -72,7 +72,7 @@ static off_t g_disk_map_start = 0; static off_t g_disk_map_end = 0; static int g_ventoy_remount = 0; -struct g_ventoy_map g_ventoy_map_data __attribute__((aligned (4096))) = +struct g_ventoy_map g_ventoy_map_data __attribute__((aligned (4096))) = { { VENTOY_UNIX_SEG_MAGIC0, VENTOY_UNIX_SEG_MAGIC1, VENTOY_UNIX_SEG_MAGIC2, VENTOY_UNIX_SEG_MAGIC3 }, { 0, 0, 0, 0 }, @@ -570,7 +570,7 @@ g_ventoy_add_disk(struct g_ventoy_softc *sc, struct g_provider *pp, u_int no) disk->d_start = 0; /* not yet */ disk->d_end = 0; /* not yet */ disk->d_removed = 0; - + disk->d_map_start = g_disk_map_start; disk->d_map_end = g_disk_map_end; @@ -696,7 +696,7 @@ g_ventoy_destroy_geom(struct gctl_req *req __unused, static bool g_vtoy_check_disk(struct g_class *mp, struct g_provider *pp) { int i; - int vlnk = 0; + int vlnk = 0; bool ret = true; uint8_t *buf; char uuid[64]; @@ -706,10 +706,10 @@ static bool g_vtoy_check_disk(struct g_class *mp, struct g_provider *pp) uint8_t mbrdata[] = { 0xEB, 0x63, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x54, 0x00, 0x47, 0x65, 0x00, 0x48, 0x44, 0x00, 0x52, 0x64, 0x00, 0x20, 0x45, 0x72, 0x0D, }; - + if (g_ventoy_disk_size == 0) { if (VENTOY_MAP_VALID(g_ventoy_map_data.magic2)) @@ -722,14 +722,14 @@ static bool g_vtoy_check_disk(struct g_class *mp, struct g_provider *pp) } snprintf(g_ventoy_disk_uuid, sizeof(g_ventoy_disk_uuid), "%s", uuid); g_ventoy_disk_size = g_ventoy_map_data.disksize; - + G_DEBUG("ventoy.disksize: %llu\n", (unsigned long long)g_ventoy_disk_size); G_DEBUG("ventoy.diskuuid: <%s>\n", g_ventoy_disk_uuid); } else { G_DEBUG("ventoy map data is invalid, get from resource\n"); - + if (resource_string_value("ventoy", 0, "disksize", &value) == 0) { G_DEBUG("ventoy.disksize: %s\n", value); @@ -764,10 +764,10 @@ static bool g_vtoy_check_disk(struct g_class *mp, struct g_provider *pp) g_access(cp, 1, 0, 0); g_topology_unlock(); - buf = g_read_data(cp, 0, pp->sectorsize, NULL); + buf = g_read_data(cp, 0, pp->sectorsize, NULL); g_topology_lock(); g_access(cp, -1, 0, 0); - + g_detach(cp); g_destroy_consumer(cp); g_destroy_geom(gp); @@ -822,7 +822,7 @@ static int g_ventoy_devalias(struct g_provider *pp) struct g_consumer *cp; struct cdev *adev; struct g_dev_softc *sc; - + if (firstflag == 0) { /* hint.ventoy.0.alias=xxx */ @@ -850,12 +850,12 @@ static int g_ventoy_devalias(struct g_provider *pp) } return 0; } - + LIST_FOREACH(cp, &ventoy_pp->consumers, consumers) { if (cp->geom && cp->geom->class && cp->geom->class->name) { printf("111 cp->geom->class->name=<%s>\n", cp->geom->class->name); - + if (strcmp(cp->geom->class->name, "DEV") == 0) { sc = cp->private; @@ -913,7 +913,7 @@ g_ventoy_taste(struct g_class *mp, struct g_provider *pp, int flags __unused) g_ventoy_remount = 1; G_DEBUG("###### ventoy remount enabled ######\n"); } - + if (VENTOY_MAP_VALID(g_ventoy_map_data.magic2)) { disknum = (int)g_ventoy_map_data.segnum; @@ -947,10 +947,10 @@ g_ventoy_taste(struct g_class *mp, struct g_provider *pp, int flags __unused) { if (VENTOY_MAP_VALID(g_ventoy_map_data.magic2)) { - G_DEBUG("[map] ventoy segment%d: 0x%llx@0x%llx\n", i, + G_DEBUG("[map] ventoy segment%d: 0x%llx@0x%llx\n", i, (long long)g_ventoy_map_data.seglist[i].seg_start_bytes, (long long)g_ventoy_map_data.seglist[i].seg_end_bytes); - + g_disk_map_start = (off_t)g_ventoy_map_data.seglist[i].seg_start_bytes; g_disk_map_end = (off_t)g_ventoy_map_data.seglist[i].seg_end_bytes; } @@ -968,7 +968,7 @@ g_ventoy_taste(struct g_class *mp, struct g_provider *pp, int flags __unused) } G_DEBUG("[resource] ventoy segment%d: %s\n", i, value); } - + G_VENTOY_DEBUG(1, "Adding disk %s to %s.", pp->name, gp->name); error = g_ventoy_add_disk(sc, pp, i); if (error != 0) { @@ -978,7 +978,7 @@ g_ventoy_taste(struct g_class *mp, struct g_provider *pp, int flags __unused) g_ventoy_destroy(sc, 1); return (NULL); } - + g_disk_map_start = 0; g_disk_map_end = 0; } @@ -1148,9 +1148,9 @@ g_ventoy_config(struct gctl_req *req, struct g_class *mp, const char *verb) uint32_t *version; return; - + g_topology_assert(); - + version = gctl_get_paraml(req, "version", sizeof(*version)); if (version == NULL) { gctl_error(req, "No '%s' argument.", "version"); diff --git a/Unix/ventoy_unix_src/FreeBSD/geom_ventoy_src/12.x/sys/geom/ventoy/g_ventoy.c b/Unix/ventoy_unix_src/FreeBSD/geom_ventoy_src/12.x/sys/geom/ventoy/g_ventoy.c index 9e43f33aa7f..cdac0fe1f2e 100644 --- a/Unix/ventoy_unix_src/FreeBSD/geom_ventoy_src/12.x/sys/geom/ventoy/g_ventoy.c +++ b/Unix/ventoy_unix_src/FreeBSD/geom_ventoy_src/12.x/sys/geom/ventoy/g_ventoy.c @@ -72,7 +72,7 @@ static off_t g_disk_map_start = 0; static off_t g_disk_map_end = 0; static int g_ventoy_remount = 0; -struct g_ventoy_map g_ventoy_map_data __attribute__((aligned (4096))) = +struct g_ventoy_map g_ventoy_map_data __attribute__((aligned (4096))) = { { VENTOY_UNIX_SEG_MAGIC0, VENTOY_UNIX_SEG_MAGIC1, VENTOY_UNIX_SEG_MAGIC2, VENTOY_UNIX_SEG_MAGIC3 }, { 0, 0, 0, 0 }, @@ -569,7 +569,7 @@ g_ventoy_add_disk(struct g_ventoy_softc *sc, struct g_provider *pp, u_int no) disk->d_start = 0; /* not yet */ disk->d_end = 0; /* not yet */ disk->d_removed = 0; - + disk->d_map_start = g_disk_map_start; disk->d_map_end = g_disk_map_end; @@ -695,7 +695,7 @@ g_ventoy_destroy_geom(struct gctl_req *req __unused, static bool g_vtoy_check_disk(struct g_class *mp, struct g_provider *pp) { int i; - int vlnk = 0; + int vlnk = 0; bool ret = true; uint8_t *buf; char uuid[64]; @@ -705,10 +705,10 @@ static bool g_vtoy_check_disk(struct g_class *mp, struct g_provider *pp) uint8_t mbrdata[] = { 0xEB, 0x63, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x54, 0x00, 0x47, 0x65, 0x00, 0x48, 0x44, 0x00, 0x52, 0x64, 0x00, 0x20, 0x45, 0x72, 0x0D, }; - + if (g_ventoy_disk_size == 0) { if (VENTOY_MAP_VALID(g_ventoy_map_data.magic2)) @@ -721,14 +721,14 @@ static bool g_vtoy_check_disk(struct g_class *mp, struct g_provider *pp) } snprintf(g_ventoy_disk_uuid, sizeof(g_ventoy_disk_uuid), "%s", uuid); g_ventoy_disk_size = g_ventoy_map_data.disksize; - + G_DEBUG("ventoy.disksize: %llu\n", (unsigned long long)g_ventoy_disk_size); G_DEBUG("ventoy.diskuuid: <%s>\n", g_ventoy_disk_uuid); } else { G_DEBUG("ventoy map data is invalid, get from resource\n"); - + if (resource_string_value("ventoy", 0, "disksize", &value) == 0) { G_DEBUG("ventoy.disksize: %s\n", value); @@ -763,10 +763,10 @@ static bool g_vtoy_check_disk(struct g_class *mp, struct g_provider *pp) g_access(cp, 1, 0, 0); g_topology_unlock(); - buf = g_read_data(cp, 0, pp->sectorsize, NULL); + buf = g_read_data(cp, 0, pp->sectorsize, NULL); g_topology_lock(); g_access(cp, -1, 0, 0); - + g_detach(cp); g_destroy_consumer(cp); g_destroy_geom(gp); @@ -846,7 +846,7 @@ g_ventoy_taste(struct g_class *mp, struct g_provider *pp, int flags __unused) g_ventoy_remount = 1; G_DEBUG("###### ventoy remount enabled ######\n"); } - + /* hint.ventoy.0.alias=xxx */ if (resource_string_value("ventoy", 0, "alias", &alias) == 0) { @@ -890,10 +890,10 @@ g_ventoy_taste(struct g_class *mp, struct g_provider *pp, int flags __unused) { if (VENTOY_MAP_VALID(g_ventoy_map_data.magic2)) { - G_DEBUG("[map] ventoy segment%d: 0x%llx@0x%llx\n", i, + G_DEBUG("[map] ventoy segment%d: 0x%llx@0x%llx\n", i, (long long)g_ventoy_map_data.seglist[i].seg_start_bytes, (long long)g_ventoy_map_data.seglist[i].seg_end_bytes); - + g_disk_map_start = (off_t)g_ventoy_map_data.seglist[i].seg_start_bytes; g_disk_map_end = (off_t)g_ventoy_map_data.seglist[i].seg_end_bytes; } @@ -911,7 +911,7 @@ g_ventoy_taste(struct g_class *mp, struct g_provider *pp, int flags __unused) } G_DEBUG("[resource] ventoy segment%d: %s\n", i, value); } - + G_VENTOY_DEBUG(1, "Adding disk %s to %s.", pp->name, gp->name); error = g_ventoy_add_disk(sc, pp, i); if (error != 0) { @@ -921,7 +921,7 @@ g_ventoy_taste(struct g_class *mp, struct g_provider *pp, int flags __unused) g_ventoy_destroy(sc, 1); return (NULL); } - + g_disk_map_start = 0; g_disk_map_end = 0; } @@ -1096,9 +1096,9 @@ g_ventoy_config(struct gctl_req *req, struct g_class *mp, const char *verb) uint32_t *version; return; - + g_topology_assert(); - + version = gctl_get_paraml(req, "version", sizeof(*version)); if (version == NULL) { gctl_error(req, "No '%s' argument.", "version"); diff --git a/Unix/ventoy_unix_src/FreeBSD/geom_ventoy_src/13.x/sys/geom/ventoy/g_ventoy.c b/Unix/ventoy_unix_src/FreeBSD/geom_ventoy_src/13.x/sys/geom/ventoy/g_ventoy.c index 3bb39a190a5..3b799efe7cc 100644 --- a/Unix/ventoy_unix_src/FreeBSD/geom_ventoy_src/13.x/sys/geom/ventoy/g_ventoy.c +++ b/Unix/ventoy_unix_src/FreeBSD/geom_ventoy_src/13.x/sys/geom/ventoy/g_ventoy.c @@ -72,7 +72,7 @@ static off_t g_disk_map_start = 0; static off_t g_disk_map_end = 0; static int g_ventoy_remount = 0; -struct g_ventoy_map g_ventoy_map_data __attribute__((aligned (4096))) = +struct g_ventoy_map g_ventoy_map_data __attribute__((aligned (4096))) = { { VENTOY_UNIX_SEG_MAGIC0, VENTOY_UNIX_SEG_MAGIC1, VENTOY_UNIX_SEG_MAGIC2, VENTOY_UNIX_SEG_MAGIC3 }, { 0, 0, 0, 0 }, @@ -603,7 +603,7 @@ g_ventoy_add_disk(struct g_ventoy_softc *sc, struct g_provider *pp, u_int no) disk->d_start = 0; /* not yet */ disk->d_end = 0; /* not yet */ disk->d_removed = 0; - + disk->d_map_start = g_disk_map_start; disk->d_map_end = g_disk_map_end; @@ -729,7 +729,7 @@ g_ventoy_destroy_geom(struct gctl_req *req __unused, static bool g_vtoy_check_disk(struct g_class *mp, struct g_provider *pp) { int i; - int vlnk = 0; + int vlnk = 0; bool ret = true; uint8_t *buf; char uuid[64]; @@ -739,10 +739,10 @@ static bool g_vtoy_check_disk(struct g_class *mp, struct g_provider *pp) uint8_t mbrdata[] = { 0xEB, 0x63, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x54, 0x00, 0x47, 0x65, 0x00, 0x48, 0x44, 0x00, 0x52, 0x64, 0x00, 0x20, 0x45, 0x72, 0x0D, }; - + if (g_ventoy_disk_size == 0) { if (VENTOY_MAP_VALID(g_ventoy_map_data.magic2)) @@ -755,14 +755,14 @@ static bool g_vtoy_check_disk(struct g_class *mp, struct g_provider *pp) } snprintf(g_ventoy_disk_uuid, sizeof(g_ventoy_disk_uuid), "%s", uuid); g_ventoy_disk_size = g_ventoy_map_data.disksize; - + G_DEBUG("ventoy.disksize: %llu\n", (unsigned long long)g_ventoy_disk_size); G_DEBUG("ventoy.diskuuid: <%s>\n", g_ventoy_disk_uuid); } else { G_DEBUG("ventoy map data is invalid, get from resource\n"); - + if (resource_string_value("ventoy", 0, "disksize", &value) == 0) { G_DEBUG("ventoy.disksize: %s\n", value); @@ -797,10 +797,10 @@ static bool g_vtoy_check_disk(struct g_class *mp, struct g_provider *pp) g_access(cp, 1, 0, 0); g_topology_unlock(); - buf = g_read_data(cp, 0, pp->sectorsize, NULL); + buf = g_read_data(cp, 0, pp->sectorsize, NULL); g_topology_lock(); g_access(cp, -1, 0, 0); - + g_detach(cp); g_destroy_consumer(cp); g_destroy_geom(gp); @@ -880,7 +880,7 @@ g_ventoy_taste(struct g_class *mp, struct g_provider *pp, int flags __unused) g_ventoy_remount = 1; G_DEBUG("###### ventoy remount enabled ######\n"); } - + /* hint.ventoy.0.alias=xxx */ if (resource_string_value("ventoy", 0, "alias", &alias) == 0) { @@ -924,10 +924,10 @@ g_ventoy_taste(struct g_class *mp, struct g_provider *pp, int flags __unused) { if (VENTOY_MAP_VALID(g_ventoy_map_data.magic2)) { - G_DEBUG("[map] ventoy segment%d: 0x%llx@0x%llx\n", i, + G_DEBUG("[map] ventoy segment%d: 0x%llx@0x%llx\n", i, (long long)g_ventoy_map_data.seglist[i].seg_start_bytes, (long long)g_ventoy_map_data.seglist[i].seg_end_bytes); - + g_disk_map_start = (off_t)g_ventoy_map_data.seglist[i].seg_start_bytes; g_disk_map_end = (off_t)g_ventoy_map_data.seglist[i].seg_end_bytes; } @@ -945,7 +945,7 @@ g_ventoy_taste(struct g_class *mp, struct g_provider *pp, int flags __unused) } G_DEBUG("[resource] ventoy segment%d: %s\n", i, value); } - + G_VENTOY_DEBUG(1, "Adding disk %s to %s.", pp->name, gp->name); error = g_ventoy_add_disk(sc, pp, i); if (error != 0) { @@ -955,7 +955,7 @@ g_ventoy_taste(struct g_class *mp, struct g_provider *pp, int flags __unused) g_ventoy_destroy(sc, 1); return (NULL); } - + g_disk_map_start = 0; g_disk_map_end = 0; } @@ -1121,9 +1121,9 @@ g_ventoy_config(struct gctl_req *req, struct g_class *mp, const char *verb) uint32_t *version; return; - + g_topology_assert(); - + version = gctl_get_paraml(req, "version", sizeof(*version)); if (version == NULL) { gctl_error(req, "No '%s' argument.", "version"); diff --git a/Unix/ventoy_unix_src/FreeBSD/geom_ventoy_src/14.x/sys/geom/ventoy/g_ventoy.c b/Unix/ventoy_unix_src/FreeBSD/geom_ventoy_src/14.x/sys/geom/ventoy/g_ventoy.c index d12a7194990..ff578814fc3 100644 --- a/Unix/ventoy_unix_src/FreeBSD/geom_ventoy_src/14.x/sys/geom/ventoy/g_ventoy.c +++ b/Unix/ventoy_unix_src/FreeBSD/geom_ventoy_src/14.x/sys/geom/ventoy/g_ventoy.c @@ -73,7 +73,7 @@ static off_t g_disk_map_start = 0; static off_t g_disk_map_end = 0; static int g_ventoy_remount = 0; -struct g_ventoy_map g_ventoy_map_data __attribute__((aligned (4096))) = +struct g_ventoy_map g_ventoy_map_data __attribute__((aligned (4096))) = { { VENTOY_UNIX_SEG_MAGIC0, VENTOY_UNIX_SEG_MAGIC1, VENTOY_UNIX_SEG_MAGIC2, VENTOY_UNIX_SEG_MAGIC3 }, { 0, 0, 0, 0 }, @@ -206,7 +206,7 @@ g_ventoy_access(struct g_provider *pp, int dr, int dw, int de) g_topology_assert(); gp = pp->geom; sc = gp->softc; - + if (g_ventoy_remount) { de = 0; @@ -257,7 +257,7 @@ g_ventoy_candelete(struct bio *bp) TAILQ_FOREACH(disk, &sc->sc_disks, d_next) { if (!disk->d_removed && disk->d_candelete) break; - } + } val = disk != NULL; g_handleattr(bp, "GEOM::candelete", &val, sizeof(val)); } @@ -326,7 +326,7 @@ g_ventoy_flush(struct g_ventoy_softc *sc, struct bio *bp) struct g_ventoy_disk *disk; sx_assert(&sc->sc_disks_lock, SX_LOCKED); - + bioq_init(&queue); TAILQ_FOREACH(disk, &sc->sc_disks, d_next) { cbp = g_clone_bio(bp); @@ -566,7 +566,7 @@ g_ventoy_add_disk(struct g_ventoy_softc *sc, struct g_provider *pp, u_int no) g_topology_assert(); sx_slock(&sc->sc_disks_lock); - + /* Metadata corrupted? */ if (no >= sc->sc_ndisks) { sx_sunlock(&sc->sc_disks_lock); @@ -609,11 +609,11 @@ g_ventoy_add_disk(struct g_ventoy_softc *sc, struct g_provider *pp, u_int no) // temporarily give up the lock to avoid lock order violation // due to topology unlock in g_concat_read_metadata - sx_sunlock(&sc->sc_disks_lock); + sx_sunlock(&sc->sc_disks_lock); /* Re-read metadata. */ error = g_ventoy_read_metadata(cp, &md); sx_slock(&sc->sc_disks_lock); - + if (error != 0) goto fail; @@ -623,7 +623,7 @@ g_ventoy_add_disk(struct g_ventoy_softc *sc, struct g_provider *pp, u_int no) G_VENTOY_DEBUG(0, "Metadata on %s changed.", pp->name); goto fail; } - + disk->d_hardcoded = md.md_provider[0] != '\0'; } else { disk->d_hardcoded = false; @@ -635,7 +635,7 @@ g_ventoy_add_disk(struct g_ventoy_softc *sc, struct g_provider *pp, u_int no) disk->d_start = 0; /* not yet */ disk->d_end = 0; /* not yet */ disk->d_removed = 0; - + disk->d_map_start = g_disk_map_start; disk->d_map_end = g_disk_map_end; @@ -714,7 +714,7 @@ g_ventoy_destroy(struct g_ventoy_softc *sc, boolean_t force) struct g_consumer *cp, *cp1; struct g_geom *gp; struct g_ventoy_disk *disk; - + g_topology_assert(); if (sc == NULL) @@ -744,7 +744,7 @@ g_ventoy_destroy(struct g_ventoy_softc *sc, boolean_t force) gp->softc = NULL; KASSERT(sc->sc_provider == NULL, ("Provider still exists? (device=%s)", - gp->name)); + gp->name)); while ((disk = TAILQ_FIRST(&sc->sc_disks)) != NULL) { TAILQ_REMOVE(&sc->sc_disks, disk, d_next); free(disk, M_VENTOY); @@ -771,7 +771,7 @@ g_ventoy_destroy_geom(struct gctl_req *req __unused, static bool g_vtoy_check_disk(struct g_class *mp, struct g_provider *pp) { int i; - int vlnk = 0; + int vlnk = 0; bool ret = true; uint8_t *buf; char uuid[64]; @@ -781,10 +781,10 @@ static bool g_vtoy_check_disk(struct g_class *mp, struct g_provider *pp) uint8_t mbrdata[] = { 0xEB, 0x63, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x54, 0x00, 0x47, 0x65, 0x00, 0x48, 0x44, 0x00, 0x52, 0x64, 0x00, 0x20, 0x45, 0x72, 0x0D, }; - + if (g_ventoy_disk_size == 0) { if (VENTOY_MAP_VALID(g_ventoy_map_data.magic2)) @@ -797,14 +797,14 @@ static bool g_vtoy_check_disk(struct g_class *mp, struct g_provider *pp) } snprintf(g_ventoy_disk_uuid, sizeof(g_ventoy_disk_uuid), "%s", uuid); g_ventoy_disk_size = g_ventoy_map_data.disksize; - + G_DEBUG("ventoy.disksize: %llu\n", (unsigned long long)g_ventoy_disk_size); G_DEBUG("ventoy.diskuuid: <%s>\n", g_ventoy_disk_uuid); } else { G_DEBUG("ventoy map data is invalid, get from resource\n"); - + if (resource_string_value("ventoy", 0, "disksize", &value) == 0) { G_DEBUG("ventoy.disksize: %s\n", value); @@ -840,10 +840,10 @@ static bool g_vtoy_check_disk(struct g_class *mp, struct g_provider *pp) g_access(cp, 1, 0, 0); g_topology_unlock(); - buf = g_read_data(cp, 0, pp->sectorsize, NULL); + buf = g_read_data(cp, 0, pp->sectorsize, NULL); g_topology_lock(); g_access(cp, -1, 0, 0); - + g_detach(cp); g_destroy_consumer(cp); g_destroy_geom(gp); @@ -923,7 +923,7 @@ g_ventoy_taste(struct g_class *mp, struct g_provider *pp, int flags __unused) g_ventoy_remount = 1; G_DEBUG("###### ventoy remount enabled ######\n"); } - + /* hint.ventoy.0.alias=xxx */ if (resource_string_value("ventoy", 0, "alias", &alias) == 0) { @@ -967,10 +967,10 @@ g_ventoy_taste(struct g_class *mp, struct g_provider *pp, int flags __unused) { if (VENTOY_MAP_VALID(g_ventoy_map_data.magic2)) { - G_DEBUG("[map] ventoy segment%d: 0x%llx@0x%llx\n", i, + G_DEBUG("[map] ventoy segment%d: 0x%llx@0x%llx\n", i, (long long)g_ventoy_map_data.seglist[i].seg_start_bytes, (long long)g_ventoy_map_data.seglist[i].seg_end_bytes); - + g_disk_map_start = (off_t)g_ventoy_map_data.seglist[i].seg_start_bytes; g_disk_map_end = (off_t)g_ventoy_map_data.seglist[i].seg_end_bytes; } @@ -988,7 +988,7 @@ g_ventoy_taste(struct g_class *mp, struct g_provider *pp, int flags __unused) } G_DEBUG("[resource] ventoy segment%d: %s\n", i, value); } - + G_VENTOY_DEBUG(1, "Adding disk %s to %s.", pp->name, gp->name); error = g_ventoy_add_disk(sc, pp, i); if (error != 0) { @@ -998,7 +998,7 @@ g_ventoy_taste(struct g_class *mp, struct g_provider *pp, int flags __unused) g_ventoy_destroy(sc, 1); return (NULL); } - + g_disk_map_start = 0; g_disk_map_end = 0; } @@ -1164,9 +1164,9 @@ g_ventoy_config(struct gctl_req *req, struct g_class *mp, const char *verb) uint32_t *version; return; - + g_topology_assert(); - + version = gctl_get_paraml(req, "version", sizeof(*version)); if (version == NULL) { gctl_error(req, "No '%s' argument.", "version"); diff --git a/Unix/ventoy_unix_src/FreeBSD/geom_ventoy_src/9.x/sys/geom/ventoy/g_ventoy.c b/Unix/ventoy_unix_src/FreeBSD/geom_ventoy_src/9.x/sys/geom/ventoy/g_ventoy.c index a618140ef17..7b5b232ea82 100644 --- a/Unix/ventoy_unix_src/FreeBSD/geom_ventoy_src/9.x/sys/geom/ventoy/g_ventoy.c +++ b/Unix/ventoy_unix_src/FreeBSD/geom_ventoy_src/9.x/sys/geom/ventoy/g_ventoy.c @@ -72,7 +72,7 @@ static off_t g_disk_map_start = 0; static off_t g_disk_map_end = 0; static int g_ventoy_remount = 0; -struct g_ventoy_map g_ventoy_map_data __attribute__((aligned (4096))) = +struct g_ventoy_map g_ventoy_map_data __attribute__((aligned (4096))) = { { VENTOY_UNIX_SEG_MAGIC0, VENTOY_UNIX_SEG_MAGIC1, VENTOY_UNIX_SEG_MAGIC2, VENTOY_UNIX_SEG_MAGIC3 }, { 0, 0, 0, 0 }, @@ -385,7 +385,7 @@ g_ventoy_start(struct bio *bp) * Fill in the component buf structure. */ cbp->bio_done = g_std_done; - cbp->bio_offset = off + disk->d_map_start; + cbp->bio_offset = off + disk->d_map_start; cbp->bio_data = addr; addr += len; cbp->bio_length = len; @@ -433,7 +433,7 @@ g_ventoy_check_and_run(struct g_ventoy_softc *sc) sectorsize = dp->sectorsize; else { sectorsize = lcm(sectorsize, dp->sectorsize); - + } } pp->sectorsize = sectorsize; @@ -536,7 +536,7 @@ g_ventoy_add_disk(struct g_ventoy_softc *sc, struct g_provider *pp, u_int no) disk->d_start = 0; /* not yet */ disk->d_end = 0; /* not yet */ disk->d_removed = 0; - + disk->d_map_start = g_disk_map_start; disk->d_map_end = g_disk_map_end; @@ -660,7 +660,7 @@ g_ventoy_destroy_geom(struct gctl_req *req __unused, static bool g_vtoy_check_disk(struct g_class *mp, struct g_provider *pp) { int i; - int vlnk = 0; + int vlnk = 0; bool ret = true; uint8_t *buf; char uuid[64]; @@ -670,10 +670,10 @@ static bool g_vtoy_check_disk(struct g_class *mp, struct g_provider *pp) uint8_t mbrdata[] = { 0xEB, 0x63, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x54, 0x00, 0x47, 0x65, 0x00, 0x48, 0x44, 0x00, 0x52, 0x64, 0x00, 0x20, 0x45, 0x72, 0x0D, }; - + if (g_ventoy_disk_size == 0) { if (VENTOY_MAP_VALID(g_ventoy_map_data.magic2)) @@ -686,14 +686,14 @@ static bool g_vtoy_check_disk(struct g_class *mp, struct g_provider *pp) } snprintf(g_ventoy_disk_uuid, sizeof(g_ventoy_disk_uuid), "%s", uuid); g_ventoy_disk_size = g_ventoy_map_data.disksize; - + G_DEBUG("ventoy.disksize: %llu\n", (unsigned long long)g_ventoy_disk_size); G_DEBUG("ventoy.diskuuid: <%s>\n", g_ventoy_disk_uuid); } else { G_DEBUG("ventoy map data is invalid, get from resource\n"); - + if (resource_string_value("ventoy", 0, "disksize", &value) == 0) { G_DEBUG("ventoy.disksize: %s\n", value); @@ -728,10 +728,10 @@ static bool g_vtoy_check_disk(struct g_class *mp, struct g_provider *pp) g_access(cp, 1, 0, 0); g_topology_unlock(); - buf = g_read_data(cp, 0, pp->sectorsize, NULL); + buf = g_read_data(cp, 0, pp->sectorsize, NULL); g_topology_lock(); g_access(cp, -1, 0, 0); - + g_detach(cp); g_destroy_consumer(cp); g_destroy_geom(gp); @@ -811,7 +811,7 @@ g_ventoy_taste(struct g_class *mp, struct g_provider *pp, int flags __unused) g_ventoy_remount = 1; G_DEBUG("###### ventoy remount enabled ######\n"); } - + /* hint.ventoy.0.alias=xxx */ if (resource_string_value("ventoy", 0, "alias", &alias) == 0 && alias) { @@ -852,10 +852,10 @@ g_ventoy_taste(struct g_class *mp, struct g_provider *pp, int flags __unused) { if (VENTOY_MAP_VALID(g_ventoy_map_data.magic2)) { - G_DEBUG("[map] ventoy segment%d: 0x%llx@0x%llx\n", i, + G_DEBUG("[map] ventoy segment%d: 0x%llx@0x%llx\n", i, (long long)g_ventoy_map_data.seglist[i].seg_start_bytes, (long long)g_ventoy_map_data.seglist[i].seg_end_bytes); - + g_disk_map_start = (off_t)g_ventoy_map_data.seglist[i].seg_start_bytes; g_disk_map_end = (off_t)g_ventoy_map_data.seglist[i].seg_end_bytes; } @@ -873,7 +873,7 @@ g_ventoy_taste(struct g_class *mp, struct g_provider *pp, int flags __unused) } G_DEBUG("[resource] ventoy segment%d: %s\n", i, value); } - + G_VENTOY_DEBUG(1, "Adding disk %s to %s.", pp->name, gp->name); error = g_ventoy_add_disk(sc, pp, i); if (error != 0) { @@ -883,7 +883,7 @@ g_ventoy_taste(struct g_class *mp, struct g_provider *pp, int flags __unused) g_ventoy_destroy(sc, 1); return (NULL); } - + g_disk_map_start = 0; g_disk_map_end = 0; } @@ -1053,9 +1053,9 @@ g_ventoy_config(struct gctl_req *req, struct g_class *mp, const char *verb) uint32_t *version; return; - + g_topology_assert(); - + version = gctl_get_paraml(req, "version", sizeof(*version)); if (version == NULL) { gctl_error(req, "No '%s' argument.", "version"); diff --git a/VBLADE/vblade-master/NEWS b/VBLADE/vblade-master/NEWS index 5caf8ff1f46..a23f5557252 100644 --- a/VBLADE/vblade-master/NEWS +++ b/VBLADE/vblade-master/NEWS @@ -40,7 +40,7 @@ add Chris Webb's bpf fix for FreeBSD add Ryan Thomas's fix to stop bufcnt being overridden vblade-19 - + 2008-07-14 Ed Cashin add Chris Webb's block device options patch add Chris Webb's socket options patch for better jumbo handling @@ -51,7 +51,7 @@ add Chris Webb's latest BPF patch to vblade, remove from contrib update contributed AIO patch for compatibility with current sources vblade-17 - + 2008-05-07 Ed Cashin add Chris Webb's AIO patch to the contributions add Chris Webb's BPF patch to the contributions @@ -63,7 +63,7 @@ make sure the packet length agrees with the amount to write remove newline embedded in fw version field of ATA dev ID response vblade-15 - + 2006-11-20 Sam Hopkins apply contrib jumbo patch to standard distribution add jumbo configuration app. note in README @@ -92,19 +92,19 @@ 2006-09-21 "Adam J. Richter" add install target for makefile vblade-11 - + 2005-12-06 Ed Cashin fix u64 configuration on FreeBSD release vblade-10 - + 2005-12-06 Valeriy Glushkov implemented config string support added handler for ATA Check power mode command - + 2005-11-15 Ed Cashin add compatibility with platforms lacking u64 (e.g., Slackware) release vblade-9 - + 2005-11-10 Ed Cashin call atainit on program startup put VBLADE_VERSION in dat.h and use it in firmware version @@ -115,30 +115,30 @@ fix config string length specification include Stacey's patch to avoid compile warnings on FreeBSD release vblade-8 - + 2005-11-10 "Stacey D. Son" include FreeBSD support - + 2005-10-03 Ed Cashin don't invoke vblade with dash from vbladed - + 2005-08-31 20:14:12 GMT Ed Cashin ATA identify: don't juggle bytes in shorts on big endian arch add manpage for vblade, vbladed release vblade-6 - + 2005-03-17 15:24:30 GMT Ed Cashin follow up on vblade-2's off-by-one patch, making end of device usable release vblade-5 - + 2005-03-15 22:03:17 GMT Ed Cashin don't rely on kernel headers for defining the aoe type 0x88a2 release vblade-4 - + 2005-03-15 17:27:01 GMT Ed Cashin docs: aoe-2.6-7 is the first driver to support multiple blades per mac release vblade-3 - + 2005-03-11 18:30:26 GMT Ed Cashin put 64-bit configuration into config.h file don't use uninitialized variables @@ -147,7 +147,7 @@ add sah@coraid.com's vblade-1.ata.c.patch: fix off-by-one and ext LBA add docs, remove daemonizing code from vblade release vblade-2 - + 2005-02-08 20:21:52 GMT Ed Cashin starting documentation add script that daemonizes vblade process, logging output diff --git a/VBLADE/vblade-master/README b/VBLADE/vblade-master/README index 72799a8a9c1..6aa905625bb 100644 --- a/VBLADE/vblade-master/README +++ b/VBLADE/vblade-master/README @@ -52,15 +52,15 @@ use any seekable file instead of /dev/loop7.) cc -Wall -c -o ata.o ata.c cc -o vblade aoe.o linux.o ata.o ecashin@kokone vblade$ su - Password: + Password: root@kokone vblade# modprobe loop root@kokone vblade# dd if=/dev/zero bs=1k count=1 seek=`expr 1024 \* 4096` of=bd -file 1+0 records in 1+0 records out 1024 bytes transferred in 0.009901 seconds (103423 bytes/sec) - root@kokone vblade# losetup /dev/loop7 bd-file - root@kokone vblade# ./vblade 9 0 eth0 /dev/loop7 + root@kokone vblade# losetup /dev/loop7 bd-file + root@kokone vblade# ./vblade 9 0 eth0 /dev/loop7 ioctl returned 0 4294968320 bytes pid 16967: e9.0, 8388610 sectors @@ -71,7 +71,7 @@ another host on the LAN. ecashin@kokone ecashin$ ssh makki Last login: Mon Feb 7 10:25:04 2005 ecashin@makki ~$ su - Password: + Password: root@makki ecashin# modprobe aoe root@makki ecashin# aoe-stat e9.0 eth1 up @@ -80,7 +80,7 @@ another host on the LAN. ... Creating journal (8192 blocks): done Writing superblocks and filesystem accounting information: done - + This filesystem will be automatically checked every 24 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override. root@makki ecashin# mkdir /mnt/e9.0 @@ -95,7 +95,7 @@ Jumbo Frame Compatibility ------------------------- Vblade can use jumbo frames provided your initiator is jumbo frame -capable. There is one small configuration gotcha to consider +capable. There is one small configuration gotcha to consider to avoid having the vblade kernel frequently drop frames. Vblade uses a raw socket to perform AoE. The linux kernel will diff --git a/VBLADE/vblade-master/aoe.c b/VBLADE/vblade-master/aoe.c index 9fd7ed59c16..daef5cfff0e 100644 --- a/VBLADE/vblade-master/aoe.c +++ b/VBLADE/vblade-master/aoe.c @@ -68,7 +68,7 @@ static ventoy_disk_map * vtoydm_get_img_map_data(const char *img_map_file, int * FILE *fp = NULL; ventoy_img_chunk *chunk = NULL; ventoy_disk_map *map = NULL; - + fp = fopen(img_map_file, "rb"); if (NULL == fp) { @@ -95,7 +95,7 @@ static ventoy_disk_map * vtoydm_get_img_map_data(const char *img_map_file, int * if (len % sizeof(ventoy_img_chunk)) { - fprintf(stderr, "image map file size %d is not aligned with %d\n", + fprintf(stderr, "image map file size %d is not aligned with %d\n", len, (int)sizeof(ventoy_img_chunk)); goto end; } @@ -106,12 +106,12 @@ static ventoy_disk_map * vtoydm_get_img_map_data(const char *img_map_file, int * fprintf(stderr, "Failed to malloc memory\n"); goto end; } - + for (i = 0; i < len / sizeof(ventoy_img_chunk); i++) { sector_num = chunk[i].img_end_sector - chunk[i].img_start_sector + 1; g_iso_file_size += sector_num * 2048; - + map[i].img_start_sector = chunk[i].img_start_sector << 2; map[i].img_end_sector = (chunk[i].img_end_sector << 2) + 3; map[i].disk_start_sector = chunk[i].disk_start_sector; @@ -147,7 +147,7 @@ static u64_t get_disk_sector(u64_t lba) { int i; ventoy_disk_map *cur = g_img_map; - + for (i = 0; i < g_img_map_num; i++, cur++) { if (lba >= cur->img_start_sector && lba <= cur->img_end_sector) @@ -168,7 +168,7 @@ int getsec(int fd, uchar *place, vlong lba, int nsec) count = 1; last_sector = get_disk_sector((u64_t)lba); - + for (i = 1; i < nsec; i++) { sector = get_disk_sector((u64_t)(lba + i)); @@ -509,7 +509,7 @@ aoe(void) if ((pagesz = sysconf(_SC_PAGESIZE)) < 0) { perror("sysconf"); exit(1); - } + } if ((buf = malloc(bufsz + pagesz)) == NULL) { perror("malloc"); exit(1); @@ -547,7 +547,7 @@ aoe(void) void usage(void) { - fprintf(stderr, "usage: %s [-b bufcnt] [-o offset] [-l length] [-d ] [-s] [-r] [ -m mac[,mac...] ] shelf slot netif filename\n", + fprintf(stderr, "usage: %s [-b bufcnt] [-o offset] [-l length] [-d ] [-s] [-r] [ -m mac[,mac...] ] shelf slot netif filename\n", progname); exit(1); } @@ -636,7 +636,7 @@ main(int argc, char **argv) /* Avoid to be killed by systemd */ if (access("/etc/initrd-release", F_OK) >= 0) - { + { argv[0][0] = '@'; } @@ -731,7 +731,7 @@ main(int argc, char **argv) (long) getpid(), shelf, slot, size, readonly ? "O_RDONLY" : "O_RDWR"); } - + fflush(stdout); atainit(); aoe(); diff --git a/VBLADE/vblade-master/config.h b/VBLADE/vblade-master/config.h index c40d51436f1..649a44da2a4 100644 --- a/VBLADE/vblade-master/config.h +++ b/VBLADE/vblade-master/config.h @@ -1,2 +1,2 @@ -#define _FILE_OFFSET_BITS 64 +#define _FILE_OFFSET_BITS 64 typedef unsigned long long u64; diff --git a/VBLADE/vblade-master/config/config.h.in b/VBLADE/vblade-master/config/config.h.in index 6b49a0bc07f..16cd24f483f 100644 --- a/VBLADE/vblade-master/config/config.h.in +++ b/VBLADE/vblade-master/config/config.h.in @@ -1,2 +1,2 @@ -#define _FILE_OFFSET_BITS 64 +#define _FILE_OFFSET_BITS 64 //u64 typedef unsigned long long u64; diff --git a/VBLADE/vblade-master/contrib/README b/VBLADE/vblade-master/contrib/README index e44a8c26647..7115c436cc9 100644 --- a/VBLADE/vblade-master/contrib/README +++ b/VBLADE/vblade-master/contrib/README @@ -1,7 +1,7 @@ The patches in the contrib directory enable features that either don't work completely, aren't well tested, or -are of limited general use. They can be applied by +are of limited general use. They can be applied by using patch in the vblade source directory as follows: forfeit:~/vblade-12 # patch -p1 #include "dat.h" #include "fns.h" - + @@ -22,6 +25,11 @@ char config[Nconfig]; int nconfig = 0; int maxscnt = 2; @@ -20,12 +20,12 @@ diff -uprN vblade-17.orig/aoe.c vblade-17/aoe.c +Ata *pkt[Nplaces]; +Ataregs regs[Nplaces]; +struct aiocb aiocb[Nplaces]; - + void aoead(int fd) // advertise the virtual blade @@ -78,32 +86,52 @@ getlba(uchar *p) } - + int -aoeata(Ata *p, int pktlen) // do ATA reqeust +aoeata(int place) // do ATA reqeust @@ -34,7 +34,7 @@ diff -uprN vblade-17.orig/aoe.c vblade-17/aoe.c - int len = 60; int n; + int len = 60; // minimum ethernet packet size - + - r.lba = getlba(p->lba); - r.sectors = p->sectors; - r.feature = p->err; @@ -87,14 +87,14 @@ diff -uprN vblade-17.orig/aoe.c vblade-17/aoe.c + pending[place] = 0; return len; } - + + #define QCMD(x) ((x)->vercmd & 0xf) - + // yes, this makes unnecessary copies. @@ -156,8 +184,9 @@ confcmd(Conf *p, int payload) // process } - + void -doaoe(Aoehdr *p, int n) +doaoe(int place) @@ -104,7 +104,7 @@ diff -uprN vblade-17.orig/aoe.c vblade-17/aoe.c enum { // config query header size CHDR_SIZ = sizeof(Conf) - sizeof(((Conf *)0)->data), @@ -165,14 +194,16 @@ doaoe(Aoehdr *p, int n) - + switch (p->cmd) { case ATAcmd: - if (n < sizeof(Ata)) @@ -126,7 +126,7 @@ diff -uprN vblade-17.orig/aoe.c vblade-17/aoe.c break; @@ -193,25 +224,129 @@ doaoe(Aoehdr *p, int n) } - + void +doaoecomplete(int place) +{ @@ -171,7 +171,7 @@ diff -uprN vblade-17.orig/aoe.c vblade-17/aoe.c +} + +void -+sigio(int signo) ++sigio(int signo) +{ + const char dummy = 0; + write(queuepipe[1], &dummy, 1); @@ -198,7 +198,7 @@ diff -uprN vblade-17.orig/aoe.c vblade-17/aoe.c + pending[n] = 0; + } aoead(sfd); - + + pipe(queuepipe); + fcntl(queuepipe[0], F_SETFL, O_NONBLOCK); + fcntl(queuepipe[1], F_SETFL, O_NONBLOCK); @@ -240,7 +240,7 @@ diff -uprN vblade-17.orig/aoe.c vblade-17/aoe.c + + if ((pollfds[1].revents & POLLIN) == 0) + continue; -+ ++ + for (place = 0; pending[place] && place < Nplaces; place++); + if (place >= Nplaces) { + pollfds[1].events = 0; @@ -273,7 +273,7 @@ diff -uprN vblade-17.orig/aoe.c vblade-17/aoe.c + for (place = 0; place < Nplaces; place++) + free(freeme[place]); } - + void @@ -317,7 +453,7 @@ main(int argc, char **argv) } @@ -295,7 +295,7 @@ diff -uprN vblade-17.orig/ata.c vblade-17/ata.c +#include #include "dat.h" #include "fns.h" - + @@ -98,7 +100,7 @@ atainit(void) * check for that. */ @@ -348,28 +348,28 @@ diff -uprN vblade-17.orig/dat.h vblade-17/dat.h +++ vblade-17/dat.h 2008-06-09 11:05:23.000000000 -0400 @@ -111,6 +111,8 @@ enum { Nconfig = 1024, - + Bufcount = 16, + + Nplaces = 32, }; - + int shelf, slot; diff -uprN vblade-17.orig/fns.h vblade-17/fns.h --- vblade-17.orig/fns.h 2008-06-09 10:53:07.000000000 -0400 +++ vblade-17/fns.h 2008-06-09 11:07:21.000000000 -0400 @@ -15,7 +15,8 @@ int maskok(uchar *); // ata.c - + void atainit(void); -int atacmd(Ataregs *, uchar *, int, int); +int atacmd(Ataregs *, uchar *, int, int, struct aiocb *); +int atacmdcomplete(Ataregs *, struct aiocb *); - + // bpf.c - + @@ -26,8 +27,9 @@ void free_bpf_program(void *); - + int dial(char *); int getea(int, char *, uchar *); -int putsec(int, uchar *, vlong, int); @@ -386,7 +386,7 @@ diff -uprN vblade-17.orig/freebsd.c vblade-17/freebsd.c @@ -209,19 +209,40 @@ getea(int s, char *eth, uchar *ea) return(0); } - + - int -getsec(int fd, uchar *place, vlong lba, int nsec) @@ -395,13 +395,13 @@ diff -uprN vblade-17.orig/freebsd.c vblade-17/freebsd.c - return pread(fd, place, nsec * 512, lba * 512); + return open(disk, omode); } - + int -putsec(int fd, uchar *place, vlong lba, int nsec) -{ - return pwrite(fd, place, nsec * 512, lba * 512); +getsec(int fd, uchar *place, vlong lba, int nsec, struct aiocb *aiocb) -+{ ++{ + bzero((char *) aiocb, sizeof(struct aiocb)); + aiocb->aio_fildes = fd; + aiocb->aio_buf = place; @@ -412,10 +412,10 @@ diff -uprN vblade-17.orig/freebsd.c vblade-17/freebsd.c + aiocb->aio_sigevent.sigev_value.sival_ptr = aiocb; + return aio_read(aiocb); } - + +int +putsec(int fd, uchar *place, vlong lba, int nsec, struct aiocb *aiocb) -+{ ++{ + bzero((char *) aiocb, sizeof(struct aiocb)); + aiocb->aio_fildes = fd; + aiocb->aio_buf = place; @@ -425,11 +425,11 @@ diff -uprN vblade-17.orig/freebsd.c vblade-17/freebsd.c + aiocb->aio_sigevent.sigev_signo = SIGIO; + aiocb->aio_sigevent.sigev_value.sival_ptr = aiocb; + return aio_write(aiocb); -+} ++} + static int pktn = 0; static uchar *pktbp = NULL; - + diff -uprN vblade-17.orig/linux.c vblade-17/linux.c --- vblade-17.orig/linux.c 2008-06-09 10:53:07.000000000 -0400 +++ vblade-17/linux.c 2008-06-09 11:05:23.000000000 -0400 @@ -447,13 +447,13 @@ diff -uprN vblade-17.orig/linux.c vblade-17/linux.c +#include +#include +#include - + #include "dat.h" #include "fns.h" @@ -29,8 +33,6 @@ int getindx(int, char *); int getea(int, char *, uchar *); - + - - int @@ -462,7 +462,7 @@ diff -uprN vblade-17.orig/linux.c vblade-17/linux.c @@ -84,7 +86,7 @@ getea(int s, char *name, uchar *ea) struct ifreq xx; int n; - + - strcpy(xx.ifr_name, name); + strcpy(xx.ifr_name, name); n = ioctl(s, SIOCGIFHWADDR, &xx); @@ -470,7 +470,7 @@ diff -uprN vblade-17.orig/linux.c vblade-17/linux.c perror("Can't get hw addr"); @@ -110,17 +112,37 @@ getmtu(int s, char *name) } - + int -getsec(int fd, uchar *place, vlong lba, int nsec) +opendisk(const char *disk, int omode) @@ -493,7 +493,7 @@ diff -uprN vblade-17.orig/linux.c vblade-17/linux.c + aiocb->aio_sigevent.sigev_value.sival_ptr = aiocb; + return aio_read(aiocb); } - + int -putsec(int fd, uchar *place, vlong lba, int nsec) +putsec(int fd, uchar *place, vlong lba, int nsec, struct aiocb *aiocb) @@ -510,7 +510,7 @@ diff -uprN vblade-17.orig/linux.c vblade-17/linux.c + aiocb->aio_sigevent.sigev_value.sival_ptr = aiocb; + return aio_write(aiocb); } - + int diff -uprN vblade-17.orig/linux.h vblade-17/linux.h --- vblade-17.orig/linux.h 2008-06-09 10:53:07.000000000 -0400 @@ -529,10 +529,10 @@ diff -uprN vblade-17.orig/makefile vblade-17/makefile +++ vblade-17/makefile 2008-06-09 11:05:23.000000000 -0400 @@ -13,7 +13,7 @@ CFLAGS += -Wall -g -O2 CC = gcc - + vblade: $O - ${CC} -o vblade $O + ${CC} -lrt -o vblade $O - + aoe.o : aoe.c config.h dat.h fns.h makefile ${CC} ${CFLAGS} -c $< diff --git a/VBLADE/vblade-master/freebsd.c b/VBLADE/vblade-master/freebsd.c index bf47bed6d6e..422787010bb 100644 --- a/VBLADE/vblade-master/freebsd.c +++ b/VBLADE/vblade-master/freebsd.c @@ -53,7 +53,7 @@ dial(char *eth, int bufcnt) struct ifreq ifr; struct bpf_program *bpf_program = create_bpf_program(shelf, slot); - + strncpy(device, BPF_DEV, sizeof BPF_DEV); /* find a bpf device we can use, check /dev/bpf[0-9] */ @@ -102,7 +102,7 @@ dial(char *eth, int bufcnt) } } if (v == 0) { - fprintf(stderr, + fprintf(stderr, "BIOCSBLEN: %s: No buffer size worked\n", eth); goto bad; } @@ -152,7 +152,7 @@ dial(char *eth, int bufcnt) if (ioctl(fd, BIOCSETF, (caddr_t)bpf_program) < 0) { perror("BIOSETF"); goto bad; - } + } free_bpf_program(bpf_program); return(fd); @@ -171,7 +171,7 @@ getea(int s, char *eth, uchar *ea) char *buf, *next, *end; struct if_msghdr *ifm; struct sockaddr_dl *sdl; - + mib[0] = CTL_NET; mib[1] = AF_ROUTE; mib[2] = 0; mib[3] = AF_LINK; @@ -184,7 +184,7 @@ getea(int s, char *eth, uchar *ea) if (!(buf = (char *) malloc(len))) { return (-1); } - + if (sysctl(mib, 6, buf, &len, NULL, 0) < 0) { free(buf); return (-1); @@ -195,7 +195,7 @@ getea(int s, char *eth, uchar *ea) ifm = (struct if_msghdr *)next; if (ifm->ifm_type == RTM_IFINFO) { sdl = (struct sockaddr_dl *)(ifm + 1); - if (strncmp(&sdl->sdl_data[0], eth, + if (strncmp(&sdl->sdl_data[0], eth, sdl->sdl_nlen) == 0) { memcpy(ea, LLADDR(sdl), ETHER_ADDR_LEN); break; @@ -232,8 +232,8 @@ getpkt(int fd, uchar *buf, int sz) { register struct bpf_hdr *bh; register int pktlen, retlen; - - if (pktn <= 0) { + + if (pktn <= 0) { if ((pktn = read(fd, pktbuf, pktbufsz)) < 0) { perror("read"); exit(1); @@ -243,15 +243,15 @@ getpkt(int fd, uchar *buf, int sz) bh = (struct bpf_hdr *) pktbp; retlen = (int) bh->bh_caplen; - /* This memcpy() is currently needed */ + /* This memcpy() is currently needed */ memcpy(buf, (void *)(pktbp + bh->bh_hdrlen), retlen > sz ? sz : retlen); - pktlen = bh->bh_hdrlen + bh->bh_caplen; - + pktlen = bh->bh_hdrlen + bh->bh_caplen; + pktbp = pktbp + BPF_WORDALIGN(pktlen); pktn -= (int) BPF_WORDALIGN(pktlen); - return retlen; + return retlen; } int diff --git a/VBLADE/vblade-master/vblade.8 b/VBLADE/vblade-master/vblade.8 index 3457cb752a0..0f2666c3115 100644 --- a/VBLADE/vblade-master/vblade.8 +++ b/VBLADE/vblade-master/vblade.8 @@ -11,7 +11,7 @@ The command starts a process that uses raw sockets to perform ATA over Ethernet, acting like a virtual EtherDrive (R) blade. .PP -The +The .I vbladed script can be used to daemonize the vblade process, detaching it from your terminal and sending its output to the system diff --git a/Ventoy2Disk/Ventoy2Disk/fat_io_lib/API.txt b/Ventoy2Disk/Ventoy2Disk/fat_io_lib/API.txt index 666cbe52df0..cca2ce4f6e0 100644 --- a/Ventoy2Disk/Ventoy2Disk/fat_io_lib/API.txt +++ b/Ventoy2Disk/Ventoy2Disk/fat_io_lib/API.txt @@ -14,7 +14,7 @@ void fl_attach_locks(void (*lock)(void), void (*unlock)(void)) int fl_attach_media(fn_diskio_read rd, fn_diskio_write wr) - This function is used to attach system specific disk/media access functions. + This function is used to attach system specific disk/media access functions. This should be done subsequent to calling fl_init() and fl_attach_locks() (if locking required). void fl_shutdown(void) diff --git a/Ventoy2Disk/Ventoy2Disk/fat_io_lib/Configuration.txt b/Ventoy2Disk/Ventoy2Disk/fat_io_lib/Configuration.txt index 370f1da6ccd..388eb38e581 100644 --- a/Ventoy2Disk/Ventoy2Disk/fat_io_lib/Configuration.txt +++ b/Ventoy2Disk/Ventoy2Disk/fat_io_lib/Configuration.txt @@ -9,7 +9,7 @@ FATFS_IS_LITTLE_ENDIAN [1/0] FATFS_MAX_LONG_FILENAME [260] By default, 260 characters (max LFN length). Increase this to support greater path depths. -FATFS_MAX_OPEN_FILES +FATFS_MAX_OPEN_FILES The more files you wish to have concurrently open, the greater this number should be. This increases the number of FL_FILE file structures in the library, each of these is around 1K in size (assuming 512 byte sectors). @@ -29,7 +29,7 @@ FAT_SECTOR_SIZE Sector size used by buffers. Most likely to be 512 bytes (standard for ATA/IDE). FAT_PRINTF - A define that allows the File IO library to print to console/stdout. + A define that allows the File IO library to print to console/stdout. Provide your own printf function if printf not available. FAT_CLUSTER_CACHE_ENTRIES diff --git a/Ventoy2Disk/Ventoy2Disk/fat_io_lib/History.txt b/Ventoy2Disk/Ventoy2Disk/fat_io_lib/History.txt index b0bdc90fc19..00356d2636a 100644 --- a/Ventoy2Disk/Ventoy2Disk/fat_io_lib/History.txt +++ b/Ventoy2Disk/Ventoy2Disk/fat_io_lib/History.txt @@ -13,12 +13,12 @@ V2.6.3 V2.6 - Basic support for FAT16 added (18-04-10). V2.5 - Code cleaned up. Many bugs fixed. Thread safety functions added. V2.x - Write support added as well as better stdio like API. -V1.0 - Rewrite of all code to enable multiple files to be opened and provides a +V1.0 - Rewrite of all code to enable multiple files to be opened and provides a better file API. - Also better string matching, and generally better C code than origonal + Also better string matching, and generally better C code than origonal version. -V0.1c - Fetch_ID_Max_LBA() function added to retrieve Drive infomation and stoping +V0.1c - Fetch_ID_Max_LBA() function added to retrieve Drive infomation and stoping the drive reads from addressing a sector that is out of range. -V0.1b - fopen(), fgetc(), fopenDIR() using new software stack for IDE and FAT32 +V0.1b - fopen(), fgetc(), fopenDIR() using new software stack for IDE and FAT32 access. V0.1a - First release (27/12/03); fopen(), fgetc() unbuffered reads. diff --git a/Ventoy2Disk/Ventoy2Disk/fat_io_lib/Media Access API.txt b/Ventoy2Disk/Ventoy2Disk/fat_io_lib/Media Access API.txt index 14ceed3a34d..b922a82a6db 100644 --- a/Ventoy2Disk/Ventoy2Disk/fat_io_lib/Media Access API.txt +++ b/Ventoy2Disk/Ventoy2Disk/fat_io_lib/Media Access API.txt @@ -8,7 +8,7 @@ Params: Buffer: Target buffer to read n sectors of data into. Sector_count: Number of sectors to read. -Return: +Return: int, 1 = success, 0 = failure. Description: @@ -24,7 +24,7 @@ Params: Buffer: Target buffer to write n sectors of data from. Sector_count: Number of sectors to write. -Return: +Return: int, 1 = success, 0 = failure. Description: diff --git a/Ventoy2Disk/Ventoy2Disk/fat_io_lib/example.c.txt b/Ventoy2Disk/Ventoy2Disk/fat_io_lib/example.c.txt index 340f0bdb915..8372fa68f33 100644 --- a/Ventoy2Disk/Ventoy2Disk/fat_io_lib/example.c.txt +++ b/Ventoy2Disk/Ventoy2Disk/fat_io_lib/example.c.txt @@ -55,7 +55,7 @@ void main() if (fl_attach_media(media_read, media_write) != FAT_INIT_OK) { printf("ERROR: Media attach failed\n"); - return; + return; } // List root directory diff --git a/Ventoy2Disk/Ventoy2Disk/process.c b/Ventoy2Disk/Ventoy2Disk/process.c index 39a5485d95e..84d6957f985 100644 --- a/Ventoy2Disk/Ventoy2Disk/process.c +++ b/Ventoy2Disk/Ventoy2Disk/process.c @@ -455,7 +455,7 @@ static __inline DWORD GetModuleFileNameExU(HANDLE hProcess, HMODULE hModule, cha int FindProcessOccupyDisk(HANDLE hDrive, PHY_DRIVE_INFO *pPhyDrive) { WCHAR wDevPath[MAX_PATH] = { 0 }; - const char *access_rights_str[8] = { "n", "r", "w", "rw", "x", "rx", "wx", "rwx" }; + const char *access_rights_str[8] = { "n", "r", "w", "rw", "x", "rx", "wx", "rwx" }; NTSTATUS status = STATUS_SUCCESS; PSYSTEM_HANDLE_INFORMATION_EX handles = NULL; POBJECT_NAME_INFORMATION buffer = NULL; @@ -582,12 +582,12 @@ int FindProcessOccupyDisk(HANDLE hDrive, PHY_DRIVE_INFO *pPhyDrive) last_access_denied_pid = handleInfo->UniqueProcessId; } continue; - } + } } // Now duplicate this handle onto our own process, so that we can access its properties if (processHandle == NtCurrentProcess()) { - continue; + continue; } else { status = pfNtDuplicateObject(processHandle, (HANDLE)handleInfo->HandleValue, diff --git a/Vlnk/VentoyVlnk.sh b/Vlnk/VentoyVlnk.sh index c0b83a76179..27cb3f14073 100644 --- a/Vlnk/VentoyVlnk.sh +++ b/Vlnk/VentoyVlnk.sh @@ -1,6 +1,6 @@ #!/bin/sh -print_usage() { +print_usage() { echo 'Usage: sudo sh VentoyVlnk.sh CMD FILE' echo ' CMD:' echo ' -c FILE create vlnk for FILE' @@ -47,7 +47,7 @@ elif echo $machine | grep -E -q 'mips64'; then elif echo $machine | grep -E -q 'i[3-6]86'; then TOOLDIR=i386 else - echo "Unsupported machine type $machine" + echo "Unsupported machine type $machine" exit 1 fi @@ -91,72 +91,72 @@ while [ -n "$1" ]; do echo "invalid option $1" exit 1 fi - + shift done -if [ "$CMD" = "c" ]; then +if [ "$CMD" = "c" ]; then vlog "Create vlnk for $IMG" - + if [ ! -f "$IMG" ]; then echo "$IMG does not exist!" exit 1 fi - + if echo $IMG | grep -E -q -i '.*(.iso|.img|.wim|.vhd|.vhdx|.efi|.vtoy|.dat)$'; then : else echo "This file is not supported for vlnk!" exit 1 fi - + if vlnk_suffix "$IMG"; then echo "This is already a vlnk file!" exit 1 fi - + if $VLNKCMD -t "$IMG"; then echo "This is already a vlnk file!" exit 1 fi - + FULLIMG=$(readlink -f "$IMG") if [ ! -f "$FULLIMG" ]; then echo "$FULLIMG does not exist!" exit 1 fi vlog "Full file path is $FULLIMG" - - + + #check img file position is a valid mountpoint FULLDIR=${FULLIMG%/*} while [ -n "${FULLDIR}" ]; do if mountpoint -q "${FULLDIR}"; then break - fi + fi FULLDIR="${FULLDIR%/*}" done - + if [ -z "${FULLDIR}" ]; then FULLDIR=/ IMGPATH="${FULLIMG}" else IMGPATH="${FULLIMG#$FULLDIR}" fi - + IMGFILE=$(basename "$IMGPATH") vlog "IMGPATH=$IMGPATH IMGFILE=$IMGFILE" - - + + mntdev=$(mountpoint -d "${FULLDIR}") vlog "mountpoint is ${FULLDIR} dev $mntdev" - + #check fs if grep -q " ${FULLDIR} " /proc/mounts; then DEV=$(grep " ${FULLDIR} " /proc/mounts | awk '{print $1}') FS=$(grep " ${FULLDIR} " /proc/mounts | awk '{print $3}') vlog "File system of $DEV is $FS" - + if echo $FS | grep -E -q "ext2|ext3|ext4|exfat|vfat|fat32|fat16|fat12|ntfs|xfs|udf"; then vlog "FS OK" elif [ "$FS" = "fuseblk" ]; then @@ -178,29 +178,29 @@ if [ "$CMD" = "c" ]; then echo "${FULLDIR} not found in /proc/mounts" exit 1 fi - - + + Major=$(echo $mntdev | awk -F: '{print $1}') Minor=$(echo $mntdev | awk -F: '{print $2}') vlog "Major=$Major Minor=$Minor" - + IMGPARTITION="" while read line; do M1=$(echo $line | awk '{print $1}') - M2=$(echo $line | awk '{print $2}') + M2=$(echo $line | awk '{print $2}') if [ "$Major" = "$M1" -a "$Minor" = "$M2" ]; then IMGPARTITION=$(echo $line | awk '{print $4}') vlog "disk partition is $IMGPARTITION" break fi done < /proc/partitions - + if [ -z "$IMGPARTITION" ]; then echo "Disk partition not found for $FULLDIR" grep " $FULLDIR " /proc/mounts exit 1 fi - + if [ -f "/sys/class/block/$IMGPARTITION/start" ]; then PARTSTART=$(cat "/sys/class/block/$IMGPARTITION/start") if echo $IMGPARTITION | grep -E -q 'mmc|nbd|nvme'; then @@ -208,12 +208,12 @@ if [ "$CMD" = "c" ]; then else DISK=$(echo /dev/$IMGPARTITION | sed "s/^\(.*[^0-9]\)[0-9][0-9]*$/\1/") fi - + if [ ! -b $DISK ]; then echo "Device $DISK not exist!" exit 1 fi - + vlog "PARTSTART=$PARTSTART DISK=$DISK" else if echo $IMGPARTITION | grep -q '^dm-[0-9][0-9]*'; then @@ -222,10 +222,10 @@ if [ "$CMD" = "c" ]; then echo "/sys/class/block/$IMGPARTITION/start not exist!" exit 1 fi - - + + if [ -n "$OUT" ]; then - lowersuffix=$(echo ${IMG##*.} | tr 'A-Z' 'a-z') + lowersuffix=$(echo ${IMG##*.} | tr 'A-Z' 'a-z') OUT="${OUT}.vlnk.${lowersuffix}" else name=${IMGFILE%.*} @@ -235,7 +235,7 @@ if [ "$CMD" = "c" ]; then echo "Output VLNK file is $OUT" [ -f "${OUT}" ] && rm -f "${OUT}" - + touch "${OUT}" if [ -f "${OUT}" ]; then rm -f "${OUT}" @@ -243,7 +243,7 @@ if [ "$CMD" = "c" ]; then echo "Failed to create ${OUT}" exit 1 fi - + if $VLNKCMD -c "$IMGPATH" -d $DISK -p $PARTSTART -o "${OUT}"; then echo "====== Vlnk file create success =========" echo "" @@ -254,7 +254,7 @@ if [ "$CMD" = "c" ]; then fi elif [ "$CMD" = "l" ]; then vlog "Parse vlnk for $VLNK" - + if [ ! -f "$VLNK" ]; then echo "$VLNK does not exist!" exit 1 diff --git a/Vlnk/build.sh b/Vlnk/build.sh index c00eb1763c0..2d1a64ae211 100644 --- a/Vlnk/build.sh +++ b/Vlnk/build.sh @@ -16,12 +16,12 @@ mips64el-linux-musl-gcc -mips64r2 -mabi=64 -static -O2 -D_FILE_OFFSET_BITS=64 $S if [ -e vlnk_64 ] && [ -e vlnk_32 ] && [ -e vlnk_aa64 ] && [ -e vlnk_m64e ]; then echo -e "\n===== success =======\n" - + strip --strip-all vlnk_32 strip --strip-all vlnk_64 aarch64-buildroot-linux-uclibc-strip --strip-all vlnk_aa64 mips64el-linux-musl-strip --strip-all vlnk_m64e - + [ -d ../INSTALL/tool/i386/ ] && mv vlnk_32 ../INSTALL/tool/i386/vlnk [ -d ../INSTALL/tool/x86_64/ ] && mv vlnk_64 ../INSTALL/tool/x86_64/vlnk [ -d ../INSTALL/tool/aarch64/ ] && mv vlnk_aa64 ../INSTALL/tool/aarch64/vlnk diff --git a/Vlnk/src/crc32.c b/Vlnk/src/crc32.c index 831a60501ca..bbf29be2113 100644 --- a/Vlnk/src/crc32.c +++ b/Vlnk/src/crc32.c @@ -1,5 +1,5 @@ /****************************************************************************** - * crc32.c ---- + * crc32.c ---- * * Copyright (c) 2022, longpanda * @@ -7,12 +7,12 @@ * 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 . * diff --git a/Vlnk/src/main_linux.c b/Vlnk/src/main_linux.c index fa276002341..af9515ed828 100644 --- a/Vlnk/src/main_linux.c +++ b/Vlnk/src/main_linux.c @@ -26,7 +26,7 @@ static uint8_t g_vlnk_buf[VLNK_FILE_LEN]; static int64_t get_file_size(char *file) { struct stat stStat; - + if (stat(file, &stStat) < 0) { return -1; @@ -39,7 +39,7 @@ static int get_disk_sig(char *diskname, uint32_t *sig) { int fd; uint8_t buf[512] = {0}; - + fd = open(diskname, O_RDONLY); if (fd < 0) { @@ -50,7 +50,7 @@ static int get_disk_sig(char *diskname, uint32_t *sig) read(fd, buf, 512); close(fd); - memcpy(sig, buf + 0x1b8, 4); + memcpy(sig, buf + 0x1b8, 4); return 0; } @@ -61,13 +61,13 @@ static int vtoy_get_disk_guid(const char *diskname, uint8_t *vtguid, uint8_t *vt char devdisk[128] = {0}; snprintf(devdisk, sizeof(devdisk) - 1, "/dev/%s", diskname); - + fd = open(devdisk, O_RDONLY); if (fd >= 0) { lseek(fd, 0x180, SEEK_SET); read(fd, vtguid, 16); - + lseek(fd, 0x1b8, SEEK_SET); read(fd, vtsig, 4); close(fd); @@ -110,7 +110,7 @@ static int vtoy_is_possible_blkdev(const char *name) { return 0; } - + return 1; } @@ -129,14 +129,14 @@ static int find_disk_by_sig(uint8_t *sig, char *diskname) { return 0; } - + while ((p = readdir(dir)) != NULL) { if (!vtoy_is_possible_blkdev(p->d_name)) { continue; } - + rc = vtoy_get_disk_guid(p->d_name, vtguid, vtsig); if (rc == 0 && memcmp(vtsig, sig, 4) == 0) { @@ -145,8 +145,8 @@ static int find_disk_by_sig(uint8_t *sig, char *diskname) } } closedir(dir); - - return count; + + return count; } static uint64_t get_part_offset(char *partname) @@ -180,7 +180,7 @@ static int create_vlnk(char *infile, char *diskname, uint64_t partoff, char *out uint32_t sig = 0; debug("create vlnk\n"); - + if (infile[0] == 0 || outfile[0] == 0 || diskname[0] == 0 || partoff == 0) { debug("Invalid parameters: %d %d %d %llu\n", infile[0], outfile[0], diskname[0], (unsigned long long)partoff); @@ -240,7 +240,7 @@ static int get_mount_point(char *partname, char *mntpoint) { line[i] = 0; rc = 0; - strncpy(mntpoint, line + len, PATH_MAX - 1); + strncpy(mntpoint, line + len, PATH_MAX - 1); break; } } @@ -265,7 +265,7 @@ static int parse_vlnk(char *infile) ventoy_vlnk vlnk; debug("parse vlnk\n"); - + if (infile[0] == 0) { debug("input file null\n"); @@ -286,7 +286,7 @@ static int parse_vlnk(char *infile) debug("disk_signature:%08X\n", vlnk.disk_signature); debug("file path:<%s>\n", vlnk.filepath); debug("part offset: %llu\n", (unsigned long long)vlnk.part_offset); - + cnt = find_disk_by_sig((uint8_t *)&(vlnk.disk_signature), diskname); if (cnt != 1) { @@ -305,11 +305,11 @@ static int parse_vlnk(char *infile) { if (pflag) { - snprintf(partname, sizeof(partname) - 1, "%sp%d", diskname, i); + snprintf(partname, sizeof(partname) - 1, "%sp%d", diskname, i); } else { - snprintf(partname, sizeof(partname) - 1, "%s%d", diskname, i); + snprintf(partname, sizeof(partname) - 1, "%s%d", diskname, i); } if (get_part_offset(partname) == vlnk.part_offset) @@ -337,11 +337,11 @@ static int parse_vlnk(char *infile) printf("Vlnk Point: %s\n", mntpoint); if (access(mntpoint, F_OK) >= 0) { - printf("File Exist: YES\n"); + printf("File Exist: YES\n"); } else { - printf("File Exist: NO\n"); + printf("File Exist: NO\n"); } return 0; @@ -354,7 +354,7 @@ static int check_vlnk(char *infile) ventoy_vlnk vlnk; debug("check vlnk\n"); - + if (infile[0] == 0) { debug("input file null\n"); @@ -416,7 +416,7 @@ int main(int argc, char **argv) { cmd = 3; strncpy(infile, optarg, sizeof(infile) - 1); - } + } else if (ch == 'd') { strncpy(diskname, optarg, sizeof(diskname) - 1); diff --git a/VtoyTool/BabyISO/biso.c b/VtoyTool/BabyISO/biso.c index 27249e1ecc1..39e36fd5af4 100644 --- a/VtoyTool/BabyISO/biso.c +++ b/VtoyTool/BabyISO/biso.c @@ -7,12 +7,12 @@ * 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 . * @@ -27,7 +27,7 @@ #include "biso_joliet.h" #include "biso_dump.h" -CONST STATIC CHAR *g_aszErrMsg[] = +CONST STATIC CHAR *g_aszErrMsg[] = { "Success", /* BISO_SUCCESS */ "General failed", /* BISO_ERR_FAILED */ @@ -79,20 +79,20 @@ VOID BISO_GetNow(OUT BISO_DATE_S *pstTM) { return; } - + time(&ulTime); - pstGMTM = gmtime(&ulTime); + pstGMTM = gmtime(&ulTime); iGMTHour = pstGMTM->tm_hour; pstLocalTM = localtime(&ulTime); iLocalHour = pstLocalTM->tm_hour; - iTimeZone = iLocalHour - iGMTHour; - if (iTimeZone < -12) - { + iTimeZone = iLocalHour - iGMTHour; + if (iTimeZone < -12) + { iTimeZone += 24; - } - else if (iTimeZone > 12) + } + else if (iTimeZone > 12) { iTimeZone -= 24; } @@ -123,7 +123,7 @@ VOID BISO_TimeConv(IN ULONG ulTime, OUT BISO_DATE_S *pstTM) pstTM->ucSecond = pstLocalTM->tm_sec; pstTM->usMillSec = 0; pstTM->cZone = (CHAR)BISO_UTIL_GetTimeZone(); - + return; } @@ -258,7 +258,7 @@ ULONG BISO_OpenImageWithSVD(IN CONST CHAR *pcFileName, OUT BISO_READ_S *pstRead) ULONG BISO_GetVolumeSummary ( - IN CONST BISO_READ_S *pstRead, + IN CONST BISO_READ_S *pstRead, OUT BISO_VOLUME_SUMMARY_S *pstSummary ) { @@ -299,14 +299,14 @@ ULONG BISO_GetVolumeSummary ULONG BISO_GetDate ( - IN CONST BISO_READ_S *pstRead, - IN BISO_DATE_TYPE_E enType, + IN CONST BISO_READ_S *pstRead, + IN BISO_DATE_TYPE_E enType, OUT BISO_DATE_S *pstDate ) { CONST CHAR *pcDate = NULL; BISO_PVD_S *pstPVD = NULL; - + if ((NULL == pstRead) || (enType >= BISO_DATE_TYPE_BUTT) || (NULL == pstDate)) { BISO_DIAG("Invalid param %p %d %p.", pstRead, enType, pstDate); @@ -349,25 +349,25 @@ ULONG BISO_GetDate /* 获å–Rock Ridge扩展的Version 0: 没有使用Rock Ridge扩展 具体版本å·: 一般都是1 */ UINT BISO_GetRockRidgeVer(IN CONST BISO_READ_S *pstRead) -{ +{ if ((NULL == pstRead) || (BOOL_TRUE != BISO_IS_READ_HANDLE_VALID(pstRead))) { return 0; } - return ((BISO_PARSER_S *)pstRead)->ucRRIPVersion; + return ((BISO_PARSER_S *)pstRead)->ucRRIPVersion; } /* 获å–Joliet扩展的Level */ UINT BISO_GetJolietLevel(IN CONST BISO_READ_S *pstRead) -{ +{ BISO_PARSER_S *pstParser = NULL; if ((NULL == pstRead) || (BOOL_TRUE != BISO_IS_READ_HANDLE_VALID(pstRead))) { return 0; } - + pstParser = (BISO_PARSER_S *)pstRead; if (NULL == pstParser->pstSVD) { @@ -379,7 +379,7 @@ UINT BISO_GetJolietLevel(IN CONST BISO_READ_S *pstRead) BISO_HANDLE BISO_GetRoot(IN CONST BISO_READ_S *pstRead) { BISO_PARSER_S *pstParser = (BISO_PARSER_S *)pstRead; - + if (NULL == pstParser) { return NULL; @@ -389,7 +389,7 @@ BISO_HANDLE BISO_GetRoot(IN CONST BISO_READ_S *pstRead) ULONG BISO_GetFileNodeByHdl ( - IN BISO_HANDLE hFileHdl, + IN BISO_HANDLE hFileHdl, OUT BISO_FILE_NODE_S *pstFileNode ) { @@ -426,7 +426,7 @@ ULONG BISO_GetFileNodeByHdl ULONG BISO_GetFileNodeByName ( IN CONST BISO_READ_S *pstRead, - IN CONST CHAR *pcFullPath, + IN CONST CHAR *pcFullPath, IN UCHAR ucFollowLink, OUT BISO_FILE_NODE_S *pstFileNode ) @@ -458,7 +458,7 @@ ULONG BISO_GetFileNodeByName if ((0 == pcFullPath[0]) || ((1 == strlen(pcFullPath)) && ('/' == pcFullPath[0]))) { /* 出å‚赋值 */ - memset(pstFileNode, 0, sizeof(BISO_FILE_NODE_S)); + memset(pstFileNode, 0, sizeof(BISO_FILE_NODE_S)); BISO_SET_FLAG(pstFileNode, pstCurDir); scnprintf(pstFileNode->szName, sizeof(pstFileNode->szName), "%s", pstCurDir->szName); pstFileNode->hParent = 0; @@ -491,7 +491,7 @@ ULONG BISO_GetFileNodeByName if (pstRootDir) { pstCurDir = pstRootDir->pstChild; - } + } for (i = 0; (i < uiDirNum) && (NULL != pstRootDir) && (NULL != pstCurDir); i++) { usPos = auiDirPos[i] >> 16; @@ -555,12 +555,12 @@ ULONG BISO_GetFileNodeByName else { /* 出å‚赋值 */ - memset(pstFileNode, 0, sizeof(BISO_FILE_NODE_S)); + memset(pstFileNode, 0, sizeof(BISO_FILE_NODE_S)); BISO_SET_FLAG(pstFileNode, pstCurDir); scnprintf(pstFileNode->szName, sizeof(pstFileNode->szName), "%s", pstCurDir->szName); if (BOOL_TRUE == BISO_DIR_TREE_IS_SYMLINK(pstCurDir)) { - scnprintf(pstFileNode->szLinkTgt, sizeof(pstFileNode->szLinkTgt), "%s", + scnprintf(pstFileNode->szLinkTgt, sizeof(pstFileNode->szLinkTgt), "%s", pstCurDir->pstPosixInfo->pcLinkSrc); } pstFileNode->ui64FileSize = pstCurDir->uiSize; @@ -606,7 +606,7 @@ ULONG BISO_GetFileNodeByExtent BISO_QUEUE_Push(pstQueue, pstCurDir); pstCurDir = pstCurDir->pstNext; } - + pstFileList = pstDirTree->pstFileList; pstCurDir = pstFileList; while (pstCurDir) @@ -631,12 +631,12 @@ ULONG BISO_GetFileNodeByExtent else { /* 出å‚赋值 */ - memset(pstFileNode, 0, sizeof(BISO_FILE_NODE_S)); + memset(pstFileNode, 0, sizeof(BISO_FILE_NODE_S)); BISO_SET_FLAG(pstFileNode, pstCurDir); scnprintf(pstFileNode->szName, sizeof(pstFileNode->szName), "%s", pstCurDir->szName); if (BOOL_TRUE == BISO_DIR_TREE_IS_SYMLINK(pstCurDir)) { - scnprintf(pstFileNode->szLinkTgt, sizeof(pstFileNode->szLinkTgt), "%s", + scnprintf(pstFileNode->szLinkTgt, sizeof(pstFileNode->szLinkTgt), "%s", pstCurDir->pstPosixInfo->pcLinkSrc); } pstFileNode->ui64FileSize = pstCurDir->uiSize; @@ -683,7 +683,7 @@ ULONG BISO_GetSVDFileNodeByExtent BISO_QUEUE_Push(pstQueue, pstCurDir); pstCurDir = pstCurDir->pstNext; } - + pstFileList = pstDirTree->pstFileList; pstCurDir = pstFileList; while (pstCurDir) @@ -708,7 +708,7 @@ ULONG BISO_GetSVDFileNodeByExtent else { /* 出å‚赋值 */ - memset(pstFileNode, 0, sizeof(BISO_SVD_FILE_NODE_S)); + memset(pstFileNode, 0, sizeof(BISO_SVD_FILE_NODE_S)); pstFileNode->ui64FileSize = pstCurDir->uiSize; pstFileNode->ui64DirRecOffet = pstCurDir->ui64FileRecordOffset; pstFileNode->ui64Seek = (UINT64)((UINT64)pstCurDir->uiExtent * BISO_BLOCK_SIZE); @@ -718,16 +718,16 @@ ULONG BISO_GetSVDFileNodeByExtent ULONG BISO_GetFileTree ( - IN BISO_HANDLE hTopDir, + IN BISO_HANDLE hTopDir, IN UINT uiFlag, OUT BISO_HANDLE *phFileTree, OUT UINT *puiNodeNum ) -{ +{ BISO_DIR_STAT_S *pstDirStat = NULL; BISO_DIR_TREE_S *pstCurNode = NULL; BISO_DIR_TREE_S *pstDirTree = (BISO_DIR_TREE_S *)hTopDir; - + if ((NULL == pstDirTree) || (NULL == phFileTree) || (NULL == puiNodeNum)) { return BISO_ERR_NULL_PTR; @@ -746,7 +746,7 @@ ULONG BISO_GetFileTree case BISO_TREE_FLAG_CUR: { pstCurNode = pstDirTree->pstChild; - + while (NULL != pstCurNode) { *phFileTree++ = (BISO_HANDLE)pstCurNode; @@ -759,7 +759,7 @@ ULONG BISO_GetFileTree *phFileTree++ = (BISO_HANDLE)pstCurNode; pstCurNode = pstCurNode->pstNext; } - + break; } case BISO_TREE_FLAG_DFS: @@ -781,12 +781,12 @@ ULONG BISO_GetFileTree ULONG BISO_GetDirStat ( - IN BISO_HANDLE hTopDir, + IN BISO_HANDLE hTopDir, OUT BISO_DIR_STAT_S *pstDirStat ) { BISO_DIR_TREE_S *pstDirTree = NULL; - + if ((NULL == hTopDir) || (NULL == pstDirStat)) { return BISO_ERR_NULL_PTR; @@ -797,7 +797,7 @@ ULONG BISO_GetDirStat { return BISO_ERR_INVALID_PARAM; } - + memcpy(pstDirStat, pstDirTree->pstDirStat, sizeof(BISO_DIR_STAT_S)); return BISO_SUCCESS; } @@ -819,24 +819,24 @@ VOID BISO_Fill733(IN UINT uiData, OUT VOID *pBuf) #else puiData[0] = uiSwap; puiData[1] = uiData; -#endif +#endif } UINT BISO_Get733(IN CONST VOID *pBuf) { UINT *puiData = (UINT *)pBuf; - + #if (__BYTE_ORDER == __LITTLE_ENDIAN) return puiData[0]; #else return puiData[1]; -#endif +#endif } UINT BISO_GetFileOccupySize(IN UINT uiRawSize) { UINT uiAlign = uiRawSize % BISO_SECTOR_SIZE; - + if (0 == uiAlign) { return uiRawSize; diff --git a/VtoyTool/BabyISO/biso.h b/VtoyTool/BabyISO/biso.h index 3b864a98333..e257decc969 100644 --- a/VtoyTool/BabyISO/biso.h +++ b/VtoyTool/BabyISO/biso.h @@ -7,12 +7,12 @@ * 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 . * @@ -159,17 +159,17 @@ typedef CONST VOID * BISO_HANDLE; typedef struct tagBISO_VOLUME_SUMMARY { - CHAR szVolumeId[33]; - CHAR szSystemId[33]; - CHAR szPublisherId[129]; - CHAR szPreparerId[129]; - CHAR szApplicationId[129]; + CHAR szVolumeId[33]; + CHAR szSystemId[33]; + CHAR szPublisherId[129]; + CHAR szPreparerId[129]; + CHAR szApplicationId[129]; CHAR szCopyrightFileId[38]; - CHAR szAbstractFileId[38]; + CHAR szAbstractFileId[38]; UINT uiRockRidgeVer; UINT uiJolietLevel; - + UINT uiTotDirNum; UINT uiTotFileNum; UINT uiTotLinkNum; @@ -182,14 +182,14 @@ typedef struct tagBISO_VOLUME_SUMMARY /* time */ typedef struct tagBISO_DATE { - USHORT usYear; - UCHAR ucMonth; - UCHAR ucDay; - UCHAR ucHour; - UCHAR ucMin; - UCHAR ucSecond; - USHORT usMillSec; - CHAR cZone; + USHORT usYear; + UCHAR ucMonth; + UCHAR ucDay; + UCHAR ucHour; + UCHAR ucMin; + UCHAR ucSecond; + USHORT usMillSec; + CHAR cZone; }BISO_DATE_S; typedef enum tagBISO_DATE_TYPE @@ -204,16 +204,16 @@ typedef enum tagBISO_DATE_TYPE /* dir stat */ typedef struct tagBISO_DIR_STAT { - UINT uiCurDirNum; - UINT uiCurFileNum; - UINT uiCurLinkNum; - UINT uiCurUsedSec; - UINT64 ui64CurSpace; - UINT uiTotDirNum; - UINT uiTotFileNum; - UINT uiTotLinkNum; - UINT64 ui64TotSpace; - UINT uiTotUsedSec; + UINT uiCurDirNum; + UINT uiCurFileNum; + UINT uiCurLinkNum; + UINT uiCurUsedSec; + UINT64 ui64CurSpace; + UINT uiTotDirNum; + UINT uiTotFileNum; + UINT uiTotLinkNum; + UINT64 ui64TotSpace; + UINT uiTotUsedSec; }BISO_DIR_STAT_S; #define BISO_NODE_REGFILE 1 @@ -230,12 +230,12 @@ typedef struct tagBISO_FILE_NODE * BISO_NODE_DIRECTORY */ UCHAR ucFlag; - CHAR szName[256]; - CHAR szLinkTgt[256]; - UINT64 ui64FileSize; - UINT64 ui64Seek; + CHAR szName[256]; + CHAR szLinkTgt[256]; + UINT64 ui64FileSize; + UINT64 ui64Seek; UINT64 ui64DirRecOffet; - BISO_HANDLE hParent; + BISO_HANDLE hParent; BISO_HANDLE hCurrent; }BISO_FILE_NODE_S; @@ -291,14 +291,14 @@ BOOL_T BISO_HasSVD(IN CONST BISO_READ_S *pstRead); ULONG BISO_GetVolumeSummary ( - IN CONST BISO_READ_S *pstRead, + IN CONST BISO_READ_S *pstRead, OUT BISO_VOLUME_SUMMARY_S *pstSummary ); ULONG BISO_GetDate ( - IN CONST BISO_READ_S *pstRead, - IN BISO_DATE_TYPE_E enType, + IN CONST BISO_READ_S *pstRead, + IN BISO_DATE_TYPE_E enType, OUT BISO_DATE_S *pstDate ); @@ -310,14 +310,14 @@ BISO_HANDLE BISO_GetRoot(IN CONST BISO_READ_S *pstRead); ULONG BISO_GetFileNodeByHdl ( - IN BISO_HANDLE hFileHdl, + IN BISO_HANDLE hFileHdl, OUT BISO_FILE_NODE_S *pstFileNode ); ULONG BISO_GetFileNodeByName ( IN CONST BISO_READ_S *pstRead, - IN CONST CHAR *pcFullPath, + IN CONST CHAR *pcFullPath, IN UCHAR ucFollowLink, OUT BISO_FILE_NODE_S *pstFileNode ); @@ -338,7 +338,7 @@ ULONG BISO_GetSVDFileNodeByExtent ULONG BISO_GetFileTree ( - IN BISO_HANDLE hTopDir, + IN BISO_HANDLE hTopDir, IN UINT uiFlag, OUT BISO_HANDLE *phFileTree, OUT UINT *puiNodeNum @@ -346,7 +346,7 @@ ULONG BISO_GetFileTree ULONG BISO_GetDirStat ( - IN BISO_HANDLE hTopDir, + IN BISO_HANDLE hTopDir, OUT BISO_DIR_STAT_S *pstDirStat ); diff --git a/VtoyTool/BabyISO/biso_9660.c b/VtoyTool/BabyISO/biso_9660.c index c829be77c00..6961cc1a135 100644 --- a/VtoyTool/BabyISO/biso_9660.c +++ b/VtoyTool/BabyISO/biso_9660.c @@ -7,12 +7,12 @@ * 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 . * @@ -36,7 +36,7 @@ STATIC ULONG BISO_9660_ReadPathTable(IN BISO_FILE_S *pstFile, OUT BISO_PARSER_S DBGASSERT(NULL != pstFile); DBGASSERT(NULL != pstParser); - + pstPVD = pstParser->pstPVD; ui64Seek = BISO_PATHTBL_LOCATION(pstPVD); ui64Seek = ui64Seek * BISO_BLOCK_SIZE; @@ -70,12 +70,12 @@ STATIC ULONG BISO_9660_ReadPathTable(IN BISO_FILE_S *pstFile, OUT BISO_PARSER_S /* 深度优先文件树目录节点入栈 注æ„è¿™é‡Œåªæ˜¯é’ˆå¯¹ç›®å½•节点入栈, æ–‡ä»¶èŠ‚ç‚¹æ²¡æœ‰å¤„ç† */ VOID BISO_9660_FillDfsStack ( - IN BISO_DIR_TREE_S *pstTop, + IN BISO_DIR_TREE_S *pstTop, INOUT BISO_QUEUE_S *pstQueue ) { BISO_DIR_TREE_S *pstCurDir = NULL; - + DBGASSERT(NULL != pstTop); DBGASSERT(NULL != pstQueue); @@ -90,14 +90,14 @@ VOID BISO_9660_FillDfsStack for ( ; ; ) { - /* + /* * 按照以下顺åºä¾æ¬¡å…¥æ ˆ: * 1. 自己入栈 * 2. å­èŠ‚ç‚¹å…¥æ ˆ * 3. Next节点入栈 * 4. Parentçš„Next节点入栈 */ - + BISO_QUEUE_Push(pstQueue, pstCurDir); if (NULL != pstCurDir->pstChild) @@ -128,14 +128,14 @@ VOID BISO_9660_FillDfsStack /* æ ¹æ®Extent的值查找å­ç›®å½•节点 */ STATIC BISO_DIR_TREE_S *BISO_9660_FindChild ( - IN BISO_DIR_TREE_S *pstParent, + IN BISO_DIR_TREE_S *pstParent, IN UINT uiChildExtent ) { BISO_DIR_TREE_S *pstCurNode = NULL; - + DBGASSERT(NULL != pstParent); - + pstCurNode = pstParent->pstChild; while (NULL != pstCurNode) { @@ -173,9 +173,9 @@ STATIC ULONG BISO_9660_ReadVD(IN BISO_FILE_S *pstFile, OUT BISO_PARSER_S *pstPar /* æ ¹æ®IDæ£€éªŒæ˜¯å¦æ˜¯åˆæ³•çš„ISO-9660æ ¼å¼ */ if (0 != strncmp(stVolDesc.szId, BISO_VD_ID, strlen(BISO_VD_ID))) { - BISO_DIAG("Invalid cdid: %02x %02x %02x %02x %02x\n", - (UCHAR)stVolDesc.szId[0], (UCHAR)stVolDesc.szId[1], - (UCHAR)stVolDesc.szId[2], (UCHAR)stVolDesc.szId[3], + BISO_DIAG("Invalid cdid: %02x %02x %02x %02x %02x\n", + (UCHAR)stVolDesc.szId[0], (UCHAR)stVolDesc.szId[1], + (UCHAR)stVolDesc.szId[2], (UCHAR)stVolDesc.szId[3], (UCHAR)stVolDesc.szId[4]); return BISO_ERR_INVALID_ISO9660; } @@ -235,14 +235,14 @@ STATIC ULONG BISO_9660_ReadVD(IN BISO_FILE_S *pstFile, OUT BISO_PARSER_S *pstPar BISO_DIAG("Unsupported block size %u.", pstParser->pstPVD->usBlockSize); return BISO_ERR_UNSUPPORTED_BLKSIZE; } - + return BISO_SUCCESS; } STATIC UCHAR * BISO_9660_ReadDirRecord ( - IN BISO_FILE_S *pstFile, - IN UINT uiExtent, + IN BISO_FILE_S *pstFile, + IN UINT uiExtent, OUT UINT *puiSize ) { @@ -294,7 +294,7 @@ STATIC BISO_DIR_TREE_S * BISO_9660_CreateDirNode ) { BISO_DIR_TREE_S *pstNew = NULL; - + DBGASSERT(NULL != pstRecord); DBGASSERT(NULL != pstPre); DBGASSERT(NULL != pstParent); @@ -305,7 +305,7 @@ STATIC BISO_DIR_TREE_S * BISO_9660_CreateDirNode { return NULL; } - + /* 目录节点属性赋值 */ BISO_UTIL_CopyStr(pstRecord->szName, pstRecord->ucNameLen, pstNew->szName); pstNew->uiExtent = pstRecord->uiExtent; @@ -348,7 +348,7 @@ STATIC BISO_SVD_DIR_TREE_S * BISO_9660_CreateSVDDirNode ) { BISO_SVD_DIR_TREE_S *pstNew = NULL; - + DBGASSERT(NULL != pstRecord); DBGASSERT(NULL != pstPre); DBGASSERT(NULL != pstParent); @@ -359,7 +359,7 @@ STATIC BISO_SVD_DIR_TREE_S * BISO_9660_CreateSVDDirNode { return NULL; } - + /* 目录节点属性赋值 */ pstNew->uiExtent = pstRecord->uiExtent; @@ -444,7 +444,7 @@ STATIC ULONG BISO_9660_ProcRawFileNameFmt(INOUT CHAR *szFileName, INOUT USHORT * { if (szFileName[i] >= 'A' && szFileName[i] <= 'Z') { - szFileName[i] = 'a' + (szFileName[i] - 'A'); + szFileName[i] = 'a' + (szFileName[i] - 'A'); } } return BISO_SUCCESS; @@ -458,10 +458,10 @@ STATIC BISO_DIR_TREE_S * BISO_9660_CreateFileNode INOUT BISO_DIR_TREE_S *pstPre, INOUT BISO_DIR_TREE_S *pstParent ) -{ +{ UINT uiSecNum = 0; BISO_DIR_TREE_S *pstNew = NULL; - + DBGASSERT(NULL != pstRecord); DBGASSERT(NULL != pstPre); DBGASSERT(NULL != pstParent); @@ -472,13 +472,13 @@ STATIC BISO_DIR_TREE_S * BISO_9660_CreateFileNode { return NULL; } - + /* 目录节点属性赋值 */ BISO_UTIL_CopyStr(pstRecord->szName, pstRecord->ucNameLen, pstNew->szName); pstNew->uiExtent = pstRecord->uiExtent; pstNew->usNameLen = (USHORT)strlen(pstNew->szName); pstNew->uiSize = pstRecord->uiSize; - + /* è¯»å–æ–‡ä»¶çš„Rock Ridgeæ‰©å±•ä¿¡æ¯ */ (VOID)BISO_RRIP_ReadExtInfo(pstFile, pstParser, pstRecord, pstNew); @@ -493,7 +493,7 @@ STATIC BISO_DIR_TREE_S * BISO_9660_CreateFileNode pstParent->pstDirStat->uiCurFileNum++; pstParent->pstDirStat->uiCurUsedSec += uiSecNum; pstParent->pstDirStat->ui64CurSpace += pstNew->uiSize; - } + } /* 节点挂接到当å‰ç›®å½•çš„FileList上 */ if (NULL == pstPre) @@ -510,7 +510,7 @@ STATIC BISO_DIR_TREE_S * BISO_9660_CreateFileNode { BISO_9660_ProcRawFileNameFmt(pstNew->szName, &pstNew->usNameLen); } - + return pstNew; } @@ -522,9 +522,9 @@ STATIC BISO_SVD_DIR_TREE_S * BISO_9660_CreateSVDFileNode INOUT BISO_SVD_DIR_TREE_S *pstPre, INOUT BISO_SVD_DIR_TREE_S *pstParent ) -{ +{ BISO_SVD_DIR_TREE_S *pstNew = NULL; - + DBGASSERT(NULL != pstRecord); DBGASSERT(NULL != pstPre); DBGASSERT(NULL != pstParent); @@ -535,11 +535,11 @@ STATIC BISO_SVD_DIR_TREE_S * BISO_9660_CreateSVDFileNode { return NULL; } - + /* 目录节点属性赋值 */ pstNew->uiExtent = pstRecord->uiExtent; pstNew->uiSize = pstRecord->uiSize; - + /* 节点挂接到当å‰ç›®å½•çš„FileList上 */ if (NULL == pstPre) { @@ -569,7 +569,7 @@ STATIC ULONG BISO_9660_BuildFileList BISO_DIR_TREE_S *pstNew = NULL; BISO_DIR_TREE_S *pstChild = NULL; BISO_DIR_RECORD_S *pstCurrent = NULL; - + DBGASSERT(NULL != pstFile); DBGASSERT(NULL != pstDirTree); @@ -582,7 +582,7 @@ STATIC ULONG BISO_9660_BuildFileList pstCurrent = (BISO_DIR_RECORD_S *)pucBuf; pstChild = pstDirTree->pstChild; - + while (uiTotSize < uiBufSize) { if (BOOL_TRUE != BISO_DIR_RECORD_IS_PATH(pstCurrent)) /* åªå¤„ç†æ–‡ä»¶ */ @@ -602,12 +602,12 @@ STATIC ULONG BISO_9660_BuildFileList { /* 对于å­ç›®å½•在这里更新目录的Rock Ridgeæ‰©å±•ä¿¡æ¯ */ if ((BOOL_TRUE != BISO_9660_IS_CURRENT(pstCurrent)) && - (BOOL_TRUE != BISO_9660_IS_PARENT(pstCurrent))) + (BOOL_TRUE != BISO_9660_IS_PARENT(pstCurrent))) { /* * 这里首先按照Path Table里记录的å­ç›®å½•é¡ºåºæ¥åˆ¤æ–­, 如果是就ä¸ç”¨æœç´¢äº† * å¦‚æžœä¸æ˜¯åˆ™å†ä»Žå­ç›®å½•列表中查询. - * 这里实际上å–决于: + * 这里实际上å–决于: * Path Table里的å­ç›®å½•记录和Directory Record里é¢çš„å­ç›®å½•è®°å½•é¡ºåºæ˜¯å¦ä¸€è‡´!!!! * ç»å¤§å¤šæ•°æƒ…况下都是按照字æ¯é¡ºåº,两者是一致的, 所以BISO_9660_FindChild一般情况下 * 是ä¸ä¼šè°ƒç”¨çš„ @@ -621,7 +621,7 @@ STATIC ULONG BISO_9660_BuildFileList { pstNew = BISO_9660_FindChild(pstDirTree, pstCurrent->uiExtent); } - + if (NULL != pstNew) { (VOID)BISO_RRIP_ReadExtInfo(pstFile, pstParser, pstCurrent, pstNew); @@ -631,7 +631,7 @@ STATIC ULONG BISO_9660_BuildFileList uiTotSize += pstCurrent->ucLength; pstCurrent = (BISO_DIR_RECORD_S *)(pucBuf + uiTotSize); - + /* * !!!!!!!!!!!!!!!!!!!!!!!! * ISO-9660规定Directory Record记录ä¸èƒ½è·¨é€»è¾‘å—,所以如果一个逻辑å—çš„æœ€åŽ @@ -649,11 +649,11 @@ STATIC ULONG BISO_9660_BuildFileList return BISO_SUCCESS; } -/* 通过PathTable构建目录树(åªåŒ…å«ç›®å½•) +/* 通过PathTable构建目录树(åªåŒ…å«ç›®å½•) 这里利用Path Table,因此超过65535个文件夹的ISO文件åªèƒ½è¯»å–å‰ 65535个目录里的内容 */ STATIC ULONG BISO_9660_BuildPathTree ( - IN BISO_FILE_S *pstFile, + IN BISO_FILE_S *pstFile, INOUT BISO_PARSER_S *pstParser, OUT UINT *puiTotDirNum ) @@ -683,8 +683,8 @@ STATIC ULONG BISO_9660_BuildPathTree /* ROOT根目录 */ pstPathTable = (BISO_PATH_TABLE_S *)(pstParser->pucPathTable); pstDirTree = &(pstParser->stDirTree); - pstDirTree->uiPathTblId = 1; - pstDirTree->uiExtent = pstPathTable->uiExtent; + pstDirTree->uiPathTblId = 1; + pstDirTree->uiExtent = pstPathTable->uiExtent; /* 申请统计信æ¯çš„节点 */ pstDirTree->pstDirStat = (BISO_DIR_STAT_S *)BISO_ZALLOC(sizeof(BISO_DIR_STAT_S)); @@ -710,7 +710,7 @@ STATIC ULONG BISO_9660_BuildPathTree BISO_QUEUE_Destroy(pstQueue); return BISO_ERR_ALLOC_MEM; } - + /* 目录节点属性赋值 */ BISO_UTIL_CopyStr(pstPathTable->szDirName, pstPathTable->ucDirNameLen, pstNew->szName); pstNew->uiExtent = pstPathTable->uiExtent; @@ -757,9 +757,9 @@ ULONG BISO_9660_UpdateTreeStat(INOUT BISO_DIR_TREE_S *pstRoot) BISO_DIR_TREE_S *pstCurDir = NULL; BISO_DIR_STAT_S *pstDirStat = NULL; BISO_DIR_STAT_S *pstPreDirStat = NULL; - + DBGASSERT(NULL != pstRoot); - + pstQueue = BISO_QUEUE_Create(); if (NULL == pstQueue) { @@ -811,7 +811,7 @@ ULONG BISO_9660_UpdateNodeStat BISO_DIR_STAT_S *pstCurStat = NULL; BISO_DIR_STAT_S *pstPreStat = NULL; BISO_DIR_STAT_S stExDirStat; - + DBGASSERT(NULL != pstCurNode); memset(&stExDirStat, 0, sizeof(stExDirStat)); @@ -822,7 +822,7 @@ ULONG BISO_9660_UpdateNodeStat if (BOOL_TRUE == BISO_DIR_TREE_IS_SYMLINK(pstCurNode)) /* 符å·é“¾æŽ¥ */ { /* 更新当å‰ç›®å½•链接数统计, 大å°ä¸º0ä¸ç”¨æ›´æ–° */ - BISO_STAT_UPDATE(bAdd, pstPreStat->uiCurLinkNum, 1); + BISO_STAT_UPDATE(bAdd, pstPreStat->uiCurLinkNum, 1); stExDirStat.uiTotLinkNum = 1; } else @@ -867,10 +867,10 @@ ULONG BISO_9660_UpdateNodeStat ULONG BISO_9660_BuildFileTreeByTable ( - IN BISO_FILE_S *pstFile, + IN BISO_FILE_S *pstFile, OUT BISO_PARSER_S *pstParser ) -{ +{ ULONG ulRet; UINT uiTotDirNum = 0; BISO_QUEUE_S *pstQueue = NULL; @@ -922,14 +922,14 @@ ULONG BISO_9660_BuildFileTreeByTable BISO_QUEUE_Push(pstQueue, pstDirTree->pstNext); } } - + BISO_QUEUE_Destroy(pstQueue); return BISO_SUCCESS; } ULONG BISO_9660_BuildFileTreeRecursively ( - IN BISO_FILE_S *pstFile, + IN BISO_FILE_S *pstFile, OUT BISO_PARSER_S *pstParser ) { @@ -949,8 +949,8 @@ ULONG BISO_9660_BuildFileTreeRecursively /* 先对ROOTè¿›è¡Œå¤„ç† */ pstDirTree = &(pstParser->stDirTree); - pstDirTree->uiPathTblId = 1; - pstDirTree->uiExtent = pstParser->pstPVD->stRootDirRecord.uiExtent; + pstDirTree->uiPathTblId = 1; + pstDirTree->uiExtent = pstParser->pstPVD->stRootDirRecord.uiExtent; /* 申请统计信æ¯çš„内存 */ pstDirTree->pstDirStat = (BISO_DIR_STAT_S *)BISO_ZALLOC(sizeof(BISO_DIR_STAT_S)); @@ -969,7 +969,7 @@ ULONG BISO_9660_BuildFileTreeRecursively pstPreDir = NULL; pstPreFile = NULL; pstDirTree->uiPathTblId = BISO_UINT_MAX; - + /* 读å–Directory Record记录 */ pucBuf = BISO_9660_ReadDirRecord(pstFile, pstDirTree->uiExtent, &uiBufSize); if (NULL == pucBuf) @@ -979,13 +979,13 @@ ULONG BISO_9660_BuildFileTreeRecursively } pstCurrent = (BISO_DIR_RECORD_S *)pucBuf; - + while (uiTotSize < uiBufSize) { if (BOOL_TRUE == BISO_DIR_RECORD_IS_PATH(pstCurrent)) { if ((BOOL_TRUE != BISO_9660_IS_CURRENT(pstCurrent)) && - (BOOL_TRUE != BISO_9660_IS_PARENT(pstCurrent))) + (BOOL_TRUE != BISO_9660_IS_PARENT(pstCurrent))) { /* 创建新目录节点 */ pstNew = BISO_9660_CreateDirNode(pstFile, pstParser, pstCurrent, pstPreDir, pstDirTree); @@ -1017,7 +1017,7 @@ ULONG BISO_9660_BuildFileTreeRecursively uiTotSize += pstCurrent->ucLength; pstCurrent = (BISO_DIR_RECORD_S *)(pucBuf + uiTotSize); - + /* * !!!!!!!!!!!!!!!!!!!!!!!! * ISO-9660规定Directory Record记录ä¸èƒ½è·¨é€»è¾‘å—,所以如果一个逻辑å—çš„æœ€åŽ @@ -1040,7 +1040,7 @@ ULONG BISO_9660_BuildFileTreeRecursively ULONG BISO_9660_BuildSVDFileTreeRecursively ( - IN BISO_FILE_S *pstFile, + IN BISO_FILE_S *pstFile, OUT BISO_PARSER_S *pstParser ) { @@ -1060,7 +1060,7 @@ ULONG BISO_9660_BuildSVDFileTreeRecursively /* 先对ROOTè¿›è¡Œå¤„ç† */ pstDirTree = &(pstParser->stSVDDirTree); - pstDirTree->uiExtent = pstParser->pstSVD->stRootDirRecord.uiExtent; + pstDirTree->uiExtent = pstParser->pstSVD->stRootDirRecord.uiExtent; /* 创建堆栈,åŒæ—¶ROOT入栈 */ pstQueue = BISO_QUEUE_Create(); @@ -1071,7 +1071,7 @@ ULONG BISO_9660_BuildSVDFileTreeRecursively uiTotSize = 0; pstPreDir = NULL; pstPreFile = NULL; - + /* 读å–Directory Record记录 */ pucBuf = BISO_9660_ReadDirRecord(pstFile, pstDirTree->uiExtent, &uiBufSize); if (NULL == pucBuf) @@ -1081,13 +1081,13 @@ ULONG BISO_9660_BuildSVDFileTreeRecursively } pstCurrent = (BISO_DIR_RECORD_S *)pucBuf; - + while (uiTotSize < uiBufSize) { if (BOOL_TRUE == BISO_DIR_RECORD_IS_PATH(pstCurrent)) { if ((BOOL_TRUE != BISO_9660_IS_CURRENT(pstCurrent)) && - (BOOL_TRUE != BISO_9660_IS_PARENT(pstCurrent))) + (BOOL_TRUE != BISO_9660_IS_PARENT(pstCurrent))) { /* 创建新目录节点 */ pstNew = BISO_9660_CreateSVDDirNode(pstFile, pstParser, pstCurrent, pstPreDir, pstDirTree); @@ -1119,7 +1119,7 @@ ULONG BISO_9660_BuildSVDFileTreeRecursively uiTotSize += pstCurrent->ucLength; pstCurrent = (BISO_DIR_RECORD_S *)(pucBuf + uiTotSize); - + /* * !!!!!!!!!!!!!!!!!!!!!!!! * ISO-9660规定Directory Record记录ä¸èƒ½è·¨é€»è¾‘å—,所以如果一个逻辑å—çš„æœ€åŽ @@ -1205,7 +1205,7 @@ VOID BISO_9660_FreeSVDDirTree(IN BISO_PARSER_S *pstParser) BISO_SVD_DIR_TREE_S *pstPre = NULL; BISO_SVD_DIR_TREE_S *pstNext = NULL; - if (NULL == pstParser || + if (NULL == pstParser || 0 == pstParser->stSVDDirTree.uiExtent || 0 == pstParser->stSVDDirTree.uiSize) { @@ -1255,7 +1255,7 @@ VOID BISO_9660_FreeSVDDirTree(IN BISO_PARSER_S *pstParser) BISO_PARSER_S * BISO_9660_CreateParser(VOID) { BISO_PARSER_S *pstParser = NULL; - + pstParser = (BISO_PARSER_S *)BISO_ZALLOC(sizeof(BISO_PARSER_S)); if (NULL == pstParser) { @@ -1304,7 +1304,7 @@ VOID BISO_9660_DestroyParser(INOUT BISO_PARSER_S *pstParser) /* 清ç†è§£æžå™¨ */ BISO_9660_CleanParser(pstParser); - + /* 释放解æžå™¨è‡ªå·± */ BISO_FREE(pstParser); } @@ -1312,14 +1312,14 @@ VOID BISO_9660_DestroyParser(INOUT BISO_PARSER_S *pstParser) ULONG BISO_9660_OpenImage ( IN BOOL_T bParseSVDDirTree, - IN CONST CHAR *pcFileName, + IN CONST CHAR *pcFileName, OUT BISO_PARSER_S *pstParser ) { UINT64 ui64FileSize = 0; ULONG ulRet = BISO_SUCCESS; BISO_FILE_S *pstFile = NULL; - + if ((NULL == pcFileName) || (NULL == pstParser)) { return BISO_ERR_NULL_PTR; @@ -1405,8 +1405,8 @@ ULONG BISO_9660_ParseDate84261 return BISO_ERR_NULL_PTR; } - /* - * ECMA-119 8.4.26.1节定义的日期格å¼ï¼Œå…±17个字节 + /* + * ECMA-119 8.4.26.1节定义的日期格å¼ï¼Œå…±17个字节 * å‰16个字节是字符,第17ä¸ªå­—èŠ‚æ˜¯æœ‰ç¬¦å·æ•´æ•° * 如果å‰16个字节是字符'0', 最åŽä¸€ä¸ªæ˜¯'\0'则表示时间无效 * 形如 "2014122013000500*" @@ -1416,9 +1416,9 @@ ULONG BISO_9660_ParseDate84261 { return BISO_ERR_NOT_RECORD; } - - sscanf(pcDate, "%4d%2d%2d%2d%2d%2d%2d", - aiBuf + 0, aiBuf + 1, aiBuf + 2, + + sscanf(pcDate, "%4d%2d%2d%2d%2d%2d%2d", + aiBuf + 0, aiBuf + 1, aiBuf + 2, aiBuf + 3, aiBuf + 4, aiBuf + 5, aiBuf + 6); pstDate->usYear = (USHORT)aiBuf[0]; pstDate->ucMonth = (UCHAR)aiBuf[1]; @@ -1429,8 +1429,8 @@ ULONG BISO_9660_ParseDate84261 pstDate->usMillSec = (UCHAR)(aiBuf[6] * 10); /* 表示百分之一秒 */ /* 第17字节表示时区信æ¯, 15分钟为1个å•ä½ï¼Œ4个å•ä½å°±æ˜¯1个时区 */ - pstDate->cZone = pcDate[16] / 4; - + pstDate->cZone = pcDate[16] / 4; + return BISO_SUCCESS; } @@ -1438,7 +1438,7 @@ VOID BISO_9660_FmtDate84261(IN time_t ulTime, IN UINT uiBufSize, OUT CHAR *pcDat { INT iTimeZone = BISO_UTIL_GetTimeZone(); struct tm *pstTm = NULL; - + if (NULL != pcDate) { pstTm = localtime(&ulTime); diff --git a/VtoyTool/BabyISO/biso_9660.h b/VtoyTool/BabyISO/biso_9660.h index 9bf33f6584e..86d9e635d30 100644 --- a/VtoyTool/BabyISO/biso_9660.h +++ b/VtoyTool/BabyISO/biso_9660.h @@ -7,12 +7,12 @@ * 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 . * @@ -29,7 +29,7 @@ /* Volume Descriptor */ #define BISO_VD_TYPE_BOOT 0 -#define BISO_VD_TYPE_PVD 1 +#define BISO_VD_TYPE_PVD 1 #define BISO_VD_TYPE_SVD 2 #define BISO_VD_TYPE_PART 3 #define BISO_VD_TYPE_END 255 @@ -105,12 +105,12 @@ typedef struct tagBISO_DATE_915 { UCHAR ucYear; /* 1900+ */ - UCHAR ucMonth; - UCHAR ucDay; - UCHAR ucHour; - UCHAR ucMin; - UCHAR ucSec; - CHAR cTimeZone; + UCHAR ucMonth; + UCHAR ucDay; + UCHAR ucHour; + UCHAR ucMin; + UCHAR ucSec; + CHAR cTimeZone; }BISO_DATE_915_S; typedef struct tagBISO_PATH_TABLE @@ -124,7 +124,7 @@ typedef struct tagBISO_PATH_TABLE UINT16 usParentDirNum; CHAR szDirName[1]; - + /* UCHAR ucPadding; */ }BISO_PATH_TABLE_S; @@ -140,7 +140,7 @@ typedef struct tagBISO_DIR_RECORD BISO_DEF_733(uiSize) - BISO_DATE_915_S stDate; + BISO_DATE_915_S stDate; UCHAR ucFlags; @@ -160,7 +160,7 @@ typedef struct tagBISO_DIR_RECORD #define BISO_DIR_RECORD_IS_PATH(pstDirRecord) \ ((1 == ((pstDirRecord->ucFlags >> 1) & 0x01)) ? BOOL_TRUE : BOOL_FALSE) -typedef struct tagBISO_VOLUME_DESC +typedef struct tagBISO_VOLUME_DESC { UCHAR ucType; @@ -183,8 +183,8 @@ typedef struct tagBISO_PRIMARY_VOLUME_DESC /* ucResv1: unused1 [ISODCL ( 8, 8)] */ UCHAR ucResv1; - /* - * szSystemId[32]: system_id [ISODCL ( 9, 40)] + /* + * szSystemId[32]: system_id [ISODCL ( 9, 40)] */ CHAR szSystemId[32]; @@ -201,18 +201,18 @@ typedef struct tagBISO_PRIMARY_VOLUME_DESC BISO_DEF_723(usVolumeSet) - /* - * usVolumeSeq: volume_sequence_number [ISODCL (125, 128)] + /* + * usVolumeSeq: volume_sequence_number [ISODCL (125, 128)] */ BISO_DEF_723(usVolumeSeq) - - /* + + /* * usBlockSize: logical_block_size [ISODCL (129, 132)] */ BISO_DEF_723(usBlockSize) /* - * uiPathTblSize: path_table_size [ISODCL (133, 140)] + * uiPathTblSize: path_table_size [ISODCL (133, 140)] */ BISO_DEF_733(uiPathTblSize) @@ -221,50 +221,50 @@ typedef struct tagBISO_PRIMARY_VOLUME_DESC UINT32 uiOptTypeLPathTblLoc; UINT32 uiTypeMPathTblLoc; - + UINT32 uiOptTypeMPathTblLoc; BISO_DIR_RECORD_S stRootDirRecord; /* szVolumeSetId: volume_set_id [ISODCL (191, 318)] */ CHAR szVolumeSetId[128]; - + /* szPublisherId: publisher_id [ISODCL (319, 446)] */ CHAR szPublisherId[128]; - + /* szPreparerId: preparer_id [ISODCL (447, 574)] */ CHAR szPreparerId[128]; - + /* szApplicationId: application_id [ISODCL (575, 702)] */ CHAR szApplicationId[128]; - + /* szCopyrightFileId: copyright_file_id [ISODCL (703, 739)] [1] */ CHAR szCopyrightFileId[37]; - + /* szAbstractFileId: abstract_file_id [ISODCL (740, 776)] */ CHAR szAbstractFileId[37]; - + /* szBibliographicFileId: bibliographic_file_id [ISODCL (777, 813)] */ CHAR szBibliographicFileId[37]; /* szCreationDate: creation_date [ISODCL (814, 830)] */ CHAR szCreationDate[17]; - + /* szModifyDate: modification_date [ISODCL (831, 847)] */ CHAR szModifyDate[17]; - + /* szExpirationDate: expiration_date [ISODCL (848, 864)] */ CHAR szExpirationDate[17]; - + /* szEffectiveDate: effective_date [ISODCL (865, 881)] */ CHAR szEffectiveDate[17]; - + /* ucFileStructVer: file_structure_version [ISODCL (882, 882)] */ UCHAR ucFileStructVer; - + /* ucResv4: unused4 [ISODCL (883, 883)] */ UCHAR ucResv4; - + /* aucApplicationData: application_data [ISODCL (884, 1395)] */ UCHAR aucApplicationData[512]; @@ -276,21 +276,21 @@ typedef struct tagBISO_SUPPLEMENTARY_VOLUME_DESC { UCHAR ucType; - /* - * szId[5]: id [ISODCL ( 2, 6)] + /* + * szId[5]: id [ISODCL ( 2, 6)] */ CHAR szId[5]; /* ucVersion: version [ISODCL ( 7, 7)] */ UCHAR ucVersion; - /* - * ucFlags: flags [ISODCL ( 8, 8)] + /* + * ucFlags: flags [ISODCL ( 8, 8)] */ UCHAR ucFlags; - /* - * szSystemId[32]: system_id [ISODCL ( 9, 40)] + /* + * szSystemId[32]: system_id [ISODCL ( 9, 40)] */ CHAR szSystemId[32]; @@ -300,8 +300,8 @@ typedef struct tagBISO_SUPPLEMENTARY_VOLUME_DESC /* aucResv2[8]: unused2 [ISODCL ( 73, 80)] */ UCHAR aucResv2[8]; - /* - * uiVolumeSpace: volume_space_size [ISODCL ( 81, 88)] + /* + * uiVolumeSpace: volume_space_size [ISODCL ( 81, 88)] */ BISO_DEF_733(uiVolumeSpace) @@ -309,16 +309,16 @@ typedef struct tagBISO_SUPPLEMENTARY_VOLUME_DESC UCHAR aucEscape[32]; /* - * usVolumeSet: volume_set_size [ISODCL (121, 124)] + * usVolumeSet: volume_set_size [ISODCL (121, 124)] */ BISO_DEF_723(usVolumeSet) - /* - * usVolumeSeq: volume_sequence_number [ISODCL (125, 128)] + /* + * usVolumeSeq: volume_sequence_number [ISODCL (125, 128)] */ BISO_DEF_723(usVolumeSeq) - - /* + + /* * usBlockSize: logical_block_size [ISODCL (129, 132)] */ BISO_DEF_723(usBlockSize) @@ -330,50 +330,50 @@ typedef struct tagBISO_SUPPLEMENTARY_VOLUME_DESC UINT32 uiOptTypeLPathTblLoc; UINT32 uiTypeMPathTblLoc; - + UINT32 uiOptTypeMPathTblLoc; BISO_DIR_RECORD_S stRootDirRecord; /* szVolumeSetId: volume_set_id [ISODCL (191, 318)] */ CHAR szVolumeSetId[128]; - + /* szPublisherId: publisher_id [ISODCL (319, 446)] */ CHAR szPublisherId[128]; - + /* szPreparerId: preparer_id [ISODCL (447, 574)] */ CHAR szPreparerId[128]; - + /* szApplicationId: application_id [ISODCL (575, 702)] */ CHAR szApplicationId[128]; - + /* szCopyrightFileId: copyright_file_id [ISODCL (703, 739)] */ CHAR szCopyrightFileId[37]; - + /* szAbstractFileId: abstract_file_id [ISODCL (740, 776)]*/ CHAR szAbstractFileId[37]; - + /* szBibliographicFileId: bibliographic_file_id [ISODCL (777, 813)] */ CHAR szBibliographicFileId[37]; /* szCreationDate: creation_date [ISODCL (814, 830)]*/ CHAR szCreationDate[17]; - + /* szModifyDate: modification_date [ISODCL (831, 847)] */ CHAR szModifyDate[17]; - + /* szExpirationDate: expiration_date [ISODCL (848, 864)] */ CHAR szExpirationDate[17]; - + /* szEffectiveDate: effective_date [ISODCL (865, 881)] */ CHAR szEffectiveDate[17]; - + /* ucFileStructVer: file_structure_version [ISODCL (882, 882)] */ UCHAR ucFileStructVer; - + /* ucResv4: unused4 [ISODCL (883, 883)] */ UCHAR ucResv4; - + /* aucApplicationData: application_data [ISODCL (884, 1395)] */ UCHAR aucApplicationData[512]; @@ -384,8 +384,8 @@ typedef struct tagBISO_SUPPLEMENTARY_VOLUME_DESC typedef struct tagBISO_BOOT_DESC { UCHAR ucType; - /* - * szId[5]: id [ISODCL ( 2, 6)] + /* + * szId[5]: id [ISODCL ( 2, 6)] */ CHAR szId[5]; @@ -430,7 +430,7 @@ typedef struct tagBISO_EXTATTR_RECORD UCHAR aucResv[64]; BISO_DEF_723(usAppDataLen) - + /* UCHAR aucAppData[xxx]; */ /* UCHAR aucEscape[xxx]; */ }BISO_EXTATTR_RECORD_S; @@ -520,14 +520,14 @@ typedef struct tagBISO_PARSER UCHAR ucRRIPSkipLen; BISO_DIR_TREE_S stDirTree; - + BISO_SVD_DIR_TREE_S stSVDDirTree; }BISO_PARSER_S; ULONG BISO_9660_OpenImage ( IN BOOL_T bParseSVDDirTree, - IN CONST CHAR *pcFileName, + IN CONST CHAR *pcFileName, OUT BISO_PARSER_S *pstParser ); BISO_PARSER_S * BISO_9660_CreateParser(VOID); @@ -540,12 +540,12 @@ ULONG BISO_9660_ParseDate84261 VOID BISO_9660_FmtDate84261(IN time_t ulTime, IN UINT uiBufSize, OUT CHAR *pcDate); VOID BISO_9660_FillDfsStack ( - IN BISO_DIR_TREE_S *pstTop, + IN BISO_DIR_TREE_S *pstTop, INOUT BISO_QUEUE_S *pstQueue ); ULONG BISO_9660_ExtractFile ( - IN BISO_FILE_S *pstFile, + IN BISO_FILE_S *pstFile, IN CONST CHAR *pcDstFullPath, IN CONST BISO_DIR_TREE_S *pstFileNode, IN CONST BISO_EXTRACT_CTRL_S *pstCtrl diff --git a/VtoyTool/BabyISO/biso_dump.c b/VtoyTool/BabyISO/biso_dump.c index 695ccde91e1..a7ef3dbdbd3 100644 --- a/VtoyTool/BabyISO/biso_dump.c +++ b/VtoyTool/BabyISO/biso_dump.c @@ -7,12 +7,12 @@ * 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 . * @@ -35,7 +35,7 @@ VOID BISO_DUMP_ShowFileTree ) { UINT i; - + if (NULL == pstDirTree) { return; @@ -48,7 +48,7 @@ VOID BISO_DUMP_ShowFileTree if (BOOL_TRUE == BISO_DIR_TREE_IS_SYMLINK(pstDirTree)) { - BISO_DUMP("|-- %s --> %s", pstDirTree->szName, pstDirTree->pstPosixInfo->pcLinkSrc); + BISO_DUMP("|-- %s --> %s", pstDirTree->szName, pstDirTree->pstPosixInfo->pcLinkSrc); } else { @@ -56,18 +56,18 @@ VOID BISO_DUMP_ShowFileTree } BISO_DUMP(" %u %u\n", pstDirTree->uiExtent, pstDirTree->uiSize); - - + + #if 0 if (NULL != pstDirTree->pstDirStat) { - BISO_DUMP(" ([%u %u %u] [%u %u %u]\n", - pstDirTree->pstDirStat->uiCurDirNum, - pstDirTree->pstDirStat->uiCurFileNum, - pstDirTree->pstDirStat->uiCurLinkNum, - pstDirTree->pstDirStat->uiTotDirNum, + BISO_DUMP(" ([%u %u %u] [%u %u %u]\n", + pstDirTree->pstDirStat->uiCurDirNum, + pstDirTree->pstDirStat->uiCurFileNum, + pstDirTree->pstDirStat->uiCurLinkNum, + pstDirTree->pstDirStat->uiTotDirNum, pstDirTree->pstDirStat->uiTotFileNum, - pstDirTree->pstDirStat->uiTotLinkNum); + pstDirTree->pstDirStat->uiTotLinkNum); } else { diff --git a/VtoyTool/BabyISO/biso_dump.h b/VtoyTool/BabyISO/biso_dump.h index e1d67faa8f4..1e2c3aaa010 100644 --- a/VtoyTool/BabyISO/biso_dump.h +++ b/VtoyTool/BabyISO/biso_dump.h @@ -7,12 +7,12 @@ * 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 . * diff --git a/VtoyTool/BabyISO/biso_eltorito.c b/VtoyTool/BabyISO/biso_eltorito.c index 173c505d92a..c0bee656f16 100644 --- a/VtoyTool/BabyISO/biso_eltorito.c +++ b/VtoyTool/BabyISO/biso_eltorito.c @@ -7,17 +7,17 @@ * 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 . * */ - + #include "biso.h" #include "biso_list.h" #include "biso_util.h" @@ -26,7 +26,7 @@ ULONG BISO_ELTORITO_ReadBootInfo ( - IN BISO_FILE_S *pstFile, + IN BISO_FILE_S *pstFile, OUT BISO_PARSER_S *pstParser ) { @@ -37,7 +37,7 @@ ULONG BISO_ELTORITO_ReadBootInfo BISO_MBUF_S stMBuf; BISO_TORITO_SECHDR_ENTRY_S *pstSecHdr = NULL; BISO_TORITO_SECTION_ENTRY_S *pstSection = NULL; - + DBGASSERT(NULL != pstFile); DBGASSERT(NULL != pstParser); @@ -69,18 +69,18 @@ ULONG BISO_ELTORITO_ReadBootInfo for (i = 0; i < pstSecHdr->usSecEntryNum; ) { - /* - * Section Entryå’ŒExtension Entry都是由ucFlagçš„Bit5决定是å¦ç»“æŸ + /* + * Section Entryå’ŒExtension Entry都是由ucFlagçš„Bit5决定是å¦ç»“æŸ * 因此这里全部都用Section Entry的结构åšåˆ¤æ–­ */ if (0 == (pstSection->ucFlag & 0x10)) { i++; } - - BISO_ELTORITO_ENTRY_STEP(pstSection, pstFile, aucBuf, stMBuf); + + BISO_ELTORITO_ENTRY_STEP(pstSection, pstFile, aucBuf, stMBuf); } - + if (0x91 == pstSecHdr->ucFlag) /* 91代表最åŽä¸€ä¸ª */ { break; @@ -93,7 +93,7 @@ ULONG BISO_ELTORITO_ReadBootInfo } /* ä¿å­˜åˆ°å…¨å±€ç»“构中 */ - pstParser->uiElToritoLen = stMBuf.uiTotDataSize; + pstParser->uiElToritoLen = stMBuf.uiTotDataSize; pstParser->pucElToritoEntry = (UCHAR *)BISO_MALLOC(pstParser->uiElToritoLen); if (NULL == pstParser->pucElToritoEntry) { @@ -107,7 +107,7 @@ ULONG BISO_ELTORITO_ReadBootInfo } VOID BISO_ELTORITO_Dump(IN CONST BISO_PARSER_S *pstParser) -{ +{ BISO_DUMP("uiElToritoLen=%u\n", pstParser->uiElToritoLen); } @@ -119,7 +119,7 @@ UINT BISO_ELTORITO_GetBootEntryNum(IN CONST BISO_PARSER_S *pstParser) UCHAR *pucData = NULL; BISO_TORITO_VALIDATION_ENTRY_S *pstValidation = NULL; BISO_TORITO_INITIAL_ENTRY_S *pstInitial = NULL; - + if (NULL == pstParser->pucElToritoEntry) { return 0; diff --git a/VtoyTool/BabyISO/biso_eltorito.h b/VtoyTool/BabyISO/biso_eltorito.h index 6afa98762f8..3453cafc72a 100644 --- a/VtoyTool/BabyISO/biso_eltorito.h +++ b/VtoyTool/BabyISO/biso_eltorito.h @@ -7,12 +7,12 @@ * 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 . * @@ -22,13 +22,13 @@ /* * EL TORITO扩展规范相关定义 * 注æ„点: - * [1] EL TORITO扩展规范里定义的数æ®éƒ½æ˜¯å°å­—节åºçš„ + * [1] EL TORITO扩展规范里定义的数æ®éƒ½æ˜¯å°å­—节åºçš„ */ #ifndef __BISO_ELTORITO_H__ #define __BISO_ELTORITO_H__ -/* +/* * EL TORITO规范里对于Boot Record里é¢BootCatlog指å‘的扩展区域åšäº† * 结构定义,分æˆä¸€æ¡æ¡çš„表项,æ¯ä¸€æ¡è¡¨é¡¹å›ºå®š32个字节长,1个扇区 * å¯ä»¥ä¿å­˜64æ¡è¡¨é¡¹ã€‚BootCatlogå¯ä»¥å ç”¨å¤šä¸ªæ‰‡åŒºã€‚ @@ -59,7 +59,7 @@ typedef struct tagBISO_TORITO_VALIDATION_ENTRY { UCHAR ucHeaderID; /* Must be 01 */ - /* + /* * PlatID: CPU平尿ž¶æž„ * 0x00: x86 * 0x01: PowerPC @@ -73,10 +73,10 @@ typedef struct tagBISO_TORITO_VALIDATION_ENTRY /* ID,一般用æ¥ä¿å­˜CD-ROMçš„åˆ¶é€ å•†ä¿¡æ¯ */ CHAR szID[24]; - /* + /* * 校验补充字段, 注æ„[1] * 这个字段用æ¥ä¿è¯æ•´ä¸ªValidation Entryçš„æ•°æ® - * 按照WORD(åŒå­—节)累加起æ¥ä¸º0(截å–之åŽ) + * 按照WORD(åŒå­—节)累加起æ¥ä¸º0(截å–之åŽ) */ UINT16 usCheckSum; @@ -91,7 +91,7 @@ typedef struct tagBISO_TORITO_INITIAL_ENTRY /* BOOTID: 0x88:Bootable, 00:Not Bootable */ UCHAR ucBootId; - /* + /* * ucBootMedia: * Bit0 - Bit3的值: * 0: No Emulation @@ -134,7 +134,7 @@ typedef struct tagBISO_TORITO_SECHDR_ENTRY /* ucFlag: 0x90:表示åŽé¢è¿˜æœ‰Header, 0x91:表示最åŽä¸€ä¸ªHeader */ UCHAR ucFlag; - /* + /* * PlatID: CPU平尿ž¶æž„ * 0x00: x86 * 0x01: PowerPC @@ -155,8 +155,8 @@ typedef struct tagBISO_TORITO_SECTION_ENTRY { /* BOOTID: 88:Bootable, 00:Not Bootable */ UCHAR ucBootId; - - /* + + /* * ucBootMedia: * Bit0 - Bit3的值: * 0: No Emulation @@ -186,7 +186,7 @@ typedef struct tagBISO_TORITO_SECTION_ENTRY /* å¯åŠ¨æ–‡ä»¶æ‰€åœ¨çš„èµ·å§‹é€»è¾‘å—ç¼–å·ï¼Œä¾‹å¦‚isolinux.bin文件的ä½ç½®, 注æ„[1] */ UINT32 uiLoadRBA; - /* + /* * 它的值æè¿°äº†åŽé¢çš„aucCriteriaçš„æ ¼å¼ * 0: 没有 * 1: Language and Version Information (IBM) @@ -204,7 +204,7 @@ typedef struct tagBISO_TORITO_SECEXT_ENTRY /* ucExtId: 必须为44 */ UCHAR ucExtId; - /* + /* * ucFlag: åªæœ‰Bit5有用 * Bit5: 1表示åŽé¢è¿˜æœ‰Extension Record 0表示最åŽä¸€ä¸ª */ @@ -217,7 +217,7 @@ typedef struct tagBISO_TORITO_SECEXT_ENTRY #pragma pack() /* - * 当å‰ç¼“冲区指针ä½ç½®å‘å‰1æ¡Entry + * 当å‰ç¼“冲区指针ä½ç½®å‘å‰1æ¡Entry * 如果已ç»è¶…过了2048字节,则继续从文件中读 */ #define BISO_ELTORITO_ENTRY_STEP(pstSection, pstFile, aucBuf, stMBuf) \ diff --git a/VtoyTool/BabyISO/biso_joliet.c b/VtoyTool/BabyISO/biso_joliet.c index 0235f65332e..19de262c0e2 100644 --- a/VtoyTool/BabyISO/biso_joliet.c +++ b/VtoyTool/BabyISO/biso_joliet.c @@ -7,12 +7,12 @@ * 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 . * @@ -24,14 +24,14 @@ UCHAR BISO_JOLIET_GetLevel(IN CONST UCHAR *pucEscape) { UCHAR ucLevel = 0; - + /* * Standard Level Decimal Hex Bytes ASCII - * UCS-2 Level 1 2/5, 2/15, 4/0 (25)(2F)(40) '%\@' - * UCS-2 Level 2 2/5, 2/15, 4/3 (25)(2F)(43) '%\C' + * UCS-2 Level 1 2/5, 2/15, 4/0 (25)(2F)(40) '%\@' + * UCS-2 Level 2 2/5, 2/15, 4/3 (25)(2F)(43) '%\C' * UCS-2 Level 3 2/5, 2/15, 4/5 (25)(2F)(45) '%\E */ - + if ((NULL != pucEscape) && (0x25 == pucEscape[0]) && (0x2F == pucEscape[1])) { if (0x40 == pucEscape[2]) diff --git a/VtoyTool/BabyISO/biso_joliet.h b/VtoyTool/BabyISO/biso_joliet.h index eac1b9168ac..665f9821015 100644 --- a/VtoyTool/BabyISO/biso_joliet.h +++ b/VtoyTool/BabyISO/biso_joliet.h @@ -7,17 +7,17 @@ * 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 . * */ - + #ifndef __BISO_JOLIET_H__ #define __BISO_JOLIET_H__ diff --git a/VtoyTool/BabyISO/biso_list.c b/VtoyTool/BabyISO/biso_list.c index fb3c807c992..e16edaab966 100644 --- a/VtoyTool/BabyISO/biso_list.c +++ b/VtoyTool/BabyISO/biso_list.c @@ -7,17 +7,17 @@ * 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 . * */ - + #include "biso.h" #include "biso_list.h" #include "biso_util.h" @@ -32,7 +32,7 @@ VOID BISO_DLL_Init(OUT BISO_DLL_S *pstList) VOID BISO_DLL_AddTail ( - IN BISO_DLL_S *pstList, + IN BISO_DLL_S *pstList, IN BISO_DLL_NODE_S *pstNode ) { @@ -46,7 +46,7 @@ VOID BISO_DLL_AddTail VOID BISO_DLL_DelHead(IN BISO_DLL_S *pstList) { BISO_DLL_NODE_S *pstFirst = BISO_DLL_First(pstList); - + if (NULL != pstFirst) { if (1 == BISO_DLL_Count(pstList)) /* 唯一节点 */ diff --git a/VtoyTool/BabyISO/biso_list.h b/VtoyTool/BabyISO/biso_list.h index 675fe76dae6..eff82b7fc23 100644 --- a/VtoyTool/BabyISO/biso_list.h +++ b/VtoyTool/BabyISO/biso_list.h @@ -7,17 +7,17 @@ * 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 . * */ - + #ifndef __BISO_LIST_H__ #define __BISO_LIST_H__ @@ -39,12 +39,12 @@ typedef struct tagBISO_DLL{ #define BISO_DLL_Next(pList, pNode) \ (((pNode) == NULL) ? BISO_DLL_First(pList) : \ - (((pNode)->pstNext == &(pList)->stHead) ? NULL : (pNode)->pstNext)) + (((pNode)->pstNext == &(pList)->stHead) ? NULL : (pNode)->pstNext)) VOID BISO_DLL_Init(OUT BISO_DLL_S *pstList); VOID BISO_DLL_AddTail ( - IN BISO_DLL_S *pstList, + IN BISO_DLL_S *pstList, IN BISO_DLL_NODE_S *pstNode ); VOID BISO_DLL_DelHead(IN BISO_DLL_S *pstList); diff --git a/VtoyTool/BabyISO/biso_plat.h b/VtoyTool/BabyISO/biso_plat.h index ff248987aa7..c7c6e004b90 100644 --- a/VtoyTool/BabyISO/biso_plat.h +++ b/VtoyTool/BabyISO/biso_plat.h @@ -7,17 +7,17 @@ * 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 . * */ - + #ifndef __BISO_PLAT_H__ #define __BISO_PLAT_H__ diff --git a/VtoyTool/BabyISO/biso_plat_linux.c b/VtoyTool/BabyISO/biso_plat_linux.c index 5ba42c74e92..dd0a5f460c3 100644 --- a/VtoyTool/BabyISO/biso_plat_linux.c +++ b/VtoyTool/BabyISO/biso_plat_linux.c @@ -7,17 +7,17 @@ * 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 . * */ - + #ifdef __cplusplus extern "C"{ @@ -40,21 +40,21 @@ void vtoydm_close_file(BISO_FILE_S *pstFile); INT64 vtoydm_seek_file(BISO_FILE_S *pstFile, INT64 i64Offset, INT iFromWhere); UINT64 vtoydm_read_file ( - BISO_FILE_S *pstFile, - UINT uiBlkSize, - UINT uiBlkNum, + BISO_FILE_S *pstFile, + UINT uiBlkSize, + UINT uiBlkNum, VOID *pBuf ); UINT64 BISO_PLAT_GetFileSize(IN CONST CHAR *pcFileName) { - return vtoydm_get_file_size(pcFileName); + return vtoydm_get_file_size(pcFileName); } BISO_FILE_S * BISO_PLAT_OpenExistFile(IN CONST CHAR *pcFileName) { - return vtoydm_open_file(pcFileName); + return vtoydm_open_file(pcFileName); } VOID BISO_PLAT_CloseFile(IN BISO_FILE_S *pstFile) @@ -69,9 +69,9 @@ INT64 BISO_PLAT_SeekFile(BISO_FILE_S *pstFile, INT64 i64Offset, INT iFromWhere) UINT64 BISO_PLAT_ReadFile ( - IN BISO_FILE_S *pstFile, - IN UINT uiBlkSize, - IN UINT uiBlkNum, + IN BISO_FILE_S *pstFile, + IN UINT uiBlkSize, + IN UINT uiBlkNum, OUT VOID *pBuf ) { diff --git a/VtoyTool/BabyISO/biso_rockridge.c b/VtoyTool/BabyISO/biso_rockridge.c index fd2096c1c95..9badb94ecd6 100644 --- a/VtoyTool/BabyISO/biso_rockridge.c +++ b/VtoyTool/BabyISO/biso_rockridge.c @@ -7,17 +7,17 @@ * 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 . * */ - + #include "biso.h" #include "biso_list.h" @@ -27,7 +27,7 @@ #include "biso_rockridge.h" /* Rock Ridge扩展处ç†å‡½æ•°æ•°ç»„, NULL表示暂时ä¸å¤„ç†è¿™ç±»è¡¨é¡¹ */ -STATIC BISO_RRIP_PARSE_ENTRY_CB_S g_astBISO_RRIP_ParseFunc[] = +STATIC BISO_RRIP_PARSE_ENTRY_CB_S g_astBISO_RRIP_ParseFunc[] = { { "CE", NULL }, { "PD", NULL }, @@ -55,7 +55,7 @@ STATIC VOID BISO_RRIP_AddLinkBuf ) { CHAR *pcNewBuf = NULL; - + DBGASSERT(NULL != pstPosixInfo); DBGASSERT(NULL != pcBuf); @@ -91,7 +91,7 @@ STATIC VOID BISO_RRIP_AddLinkBuf STATIC UINT BISO_RRIP_CalcLinkLen ( - IN CONST CHAR *pcComponet, + IN CONST CHAR *pcComponet, IN UINT uiComponetLen ) { @@ -102,7 +102,7 @@ STATIC UINT BISO_RRIP_CalcLinkLen DBGASSERT(NULL != pcComponet); DBGASSERT(uiComponetLen > 0); - + /* 拼接出链接的æºè·¯å¾„ */ while (uiOffset < uiComponetLen) { @@ -149,13 +149,13 @@ STATIC UINT BISO_RRIP_CalcLinkLen STATIC UINT BISO_RRIP_GetPartLink ( - IN CONST BISO_RRIP_SL_COMPONENT_S *pstComponent, + IN CONST BISO_RRIP_SL_COMPONENT_S *pstComponent, IN UINT uiBufSize, OUT CHAR *pcBuf ) { UINT uiBufLen = 0; - + DBGASSERT(NULL != pstComponent); DBGASSERT(NULL != pcBuf); @@ -199,7 +199,7 @@ STATIC BOOL_T BISO_RRIP_IsThisType(IN BISO_SUSP_ENTRY_S *pstEntry, IN CONST CHAR STATIC UCHAR * BISO_RRIP_GetSysUseArea ( - IN BISO_FILE_S *pstFile, + IN BISO_FILE_S *pstFile, IN UCHAR *pucSysUseField, IN UINT uiSysUseFieldLen, OUT UINT *puiAreaSize @@ -217,7 +217,7 @@ STATIC UCHAR * BISO_RRIP_GetSysUseArea DBGASSERT(NULL != pucSysUseField); DBGASSERT(NULL != puiAreaSize); - /* + /* * 虽然Rock Ridge扩展标准中å…许整个System Use Area中有多个CEè¡¨é¡¹æ¥æ‰©å±•, * 但是由于一æ¡CE表项å¯ä»¥æ‰©å±•的长度就足够了(32bit) 所以这里我感觉正常情况下 * 没有必è¦ä½¿ç”¨å¤šä¸ªCEè¡¨é¡¹æ‰©å±•ç©ºé—´ã€‚å› æ­¤è¿™é‡Œåªæ”¯æŒ1æ¡CE表项的情况。 @@ -302,9 +302,9 @@ VOID BISO_RRIP_GetNMInfo(IN VOID *pEntry, OUT BISO_DIR_TREE_S *pstDirTree) memset(pstDirTree->szName, 0, sizeof(pstDirTree->szName)); pstDirTree->usNameLen = 0; } - + /* - * 拼接文件å, 有å¯èƒ½æœ¬å‡½æ•°ä¼šå¤šæ¬¡è°ƒç”¨,多次拼接(文件å超长的情况) + * 拼接文件å, 有å¯èƒ½æœ¬å‡½æ•°ä¼šå¤šæ¬¡è°ƒç”¨,多次拼接(文件å超长的情况) * TODO: 是å¦éœ€è¦å…³æ³¨å­—符编ç ??? */ strncat(pstDirTree->szName, pstNMEntry->szFileName, pstNMEntry->ucEntryLen - 5); @@ -317,7 +317,7 @@ VOID BISO_RRIP_GetTFInfo(IN VOID *pEntry, OUT BISO_DIR_TREE_S *pstDirTree) UCHAR *pucCur = NULL; BISO_DATE_915_S *pst915Date = NULL; BISO_ROCK_RIDGE_ENTRY_TF_S *pstTFEntry = NULL; - BISO_DATE_S *apstDate[] = + BISO_DATE_S *apstDate[] = { &(pstDirTree->pstPosixInfo->stCreateTime), &(pstDirTree->pstPosixInfo->stModifyTime), @@ -375,7 +375,7 @@ VOID BISO_RRIP_GetPNInfo(IN VOID *pEntry, OUT BISO_DIR_TREE_S *pstDirTree) DBGASSERT(NULL != pstDirTree->pstPosixInfo); pstPNEntry = (BISO_ROCK_RIDGE_ENTRY_PN_S *)pEntry; - + pstDirTree->pstPosixInfo->ui64DevNum = ((UINT64)(pstPNEntry->uiDevNumHigh) << 32) | pstPNEntry->uiDevNumLow; } @@ -456,8 +456,8 @@ ULONG BISO_RRIP_ReadExtInfo ( IN BISO_FILE_S *pstFile, IN BISO_PARSER_S *pstParser, - IN BISO_DIR_RECORD_S *pstRecord, - OUT BISO_DIR_TREE_S *pstDirTree + IN BISO_DIR_RECORD_S *pstRecord, + OUT BISO_DIR_TREE_S *pstDirTree ) { UINT i = 0; @@ -495,7 +495,7 @@ ULONG BISO_RRIP_ReadExtInfo uiOffset += pstParser->ucRRIPSkipLen; /* èŽ·å–æ•´ä¸ªSyetem Use区域的数æ®(包括CE扩展区) */ - pucSysUseArea = BISO_RRIP_GetSysUseArea(pstFile, (UCHAR *)pstRecord + uiOffset, + pucSysUseArea = BISO_RRIP_GetSysUseArea(pstFile, (UCHAR *)pstRecord + uiOffset, pstRecord->ucLength - (UCHAR)uiOffset, &uiAreaSize); if (NULL == pucSysUseArea) { @@ -533,7 +533,7 @@ ULONG BISO_RRIP_ReadIndicator(INOUT BISO_PARSER_S *pstParser) BISO_DIR_RECORD_S *pstRootDir = NULL; BISO_SUSP_ENTRY_SP_S *pstSPEntry = NULL; UCHAR aucBuf[sizeof(BISO_DIR_RECORD_S) + sizeof(BISO_SUSP_ENTRY_SP_S)]; - + DBGASSERT(NULL != pstParser); /* 读出Root Directory Record */ @@ -557,9 +557,9 @@ ULONG BISO_RRIP_ReadIndicator(INOUT BISO_PARSER_S *pstParser) else { pstParser->ucRRIPVersion = pstSPEntry->ucVersion; - pstParser->ucRRIPSkipLen = pstSPEntry->ucSkipLen; + pstParser->ucRRIPSkipLen = pstSPEntry->ucSkipLen; } - + return BISO_SUCCESS; } diff --git a/VtoyTool/BabyISO/biso_rockridge.h b/VtoyTool/BabyISO/biso_rockridge.h index 61aa08e773f..32432c83bfa 100644 --- a/VtoyTool/BabyISO/biso_rockridge.h +++ b/VtoyTool/BabyISO/biso_rockridge.h @@ -7,17 +7,17 @@ * 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 . * */ - + /* @@ -28,14 +28,14 @@ * 详细的说明请å‚考标准文档(IEEE P1281ã€IEEE P1282) * SUSP定义的æ¯ä¸€æ¡Entry都是ä¸å®šé•¿çš„ï¼Œå…¶é•¿åº¦åœ¨ç»“æž„é‡Œé¢æè¿° */ - + #ifndef __BISO_ROCKRIDGE_H__ #define __BISO_ROCKRIDGE_H__ #ifndef S_IFLNK -#define S_IFLNK 0120000 +#define S_IFLNK 0120000 #define S_IFREG 0100000 -#define S_IFDIR 0040000 +#define S_IFDIR 0040000 #endif typedef VOID (* BISO_DUMP_ENTRY_PF)(IN VOID *pEntry); @@ -77,10 +77,10 @@ typedef struct tagBISO_SUSP_ENTRY UCHAR ucVersion; /* æ•°æ®ï¼Œå…·ä½“长度有ucEntryLen确定 */ - UCHAR aucData[1]; + UCHAR aucData[1]; }BISO_SUSP_ENTRY_S; -/* +/* * Continuation Area(å¯é€‰) * !!!!!!!!!!!!!!!!! * !!!!!!!!!!!!!!!!! @@ -123,7 +123,7 @@ typedef struct tagBISO_SUSP_ENTRY_PD UCHAR ucVersion; /* æ•°æ®ï¼Œå…·ä½“长度有ucEntryLen确定 */ - UCHAR aucData[1]; + UCHAR aucData[1]; }BISO_SUSP_ENTRY_PD_S; /* @@ -150,8 +150,8 @@ typedef struct tagBISO_SUSP_ENTRY_SP UCHAR ucVersion; /* 检查字段 */ - UCHAR ucChkBE; - UCHAR ucChkEF; + UCHAR ucChkBE; + UCHAR ucChkEF; UCHAR ucSkipLen; }BISO_SUSP_ENTRY_SP_S; @@ -249,10 +249,10 @@ typedef struct tagBISO_ROCK_RIDGE_ENTRY_PX CHAR cSignature2; /* 必须为 'X' */ /* 长度,包括控制字, 必须为44 - * !!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!! + * !!!!!!!!!!!!!!!!!!!!!!!!!! + * !!!!!!!!!!!!!!!!!!!!!!!!!! + * !!!!!!!!!!!!!!!!!!!!!!!!!! + * !!!!!!!!!!!!!!!!!!!!!!!!!! * IEEE P1282 V1.10之剿˜¯36䏿˜¯44 */ UCHAR ucEntryLen; @@ -265,13 +265,13 @@ typedef struct tagBISO_ROCK_RIDGE_ENTRY_PX /* st_nlink字段 */ BISO_DEF_733(uiPosixFileLink) - + /* st_uid字段 */ BISO_DEF_733(uiPosixFileUserId) - + /* st_gid字段 */ BISO_DEF_733(uiPosixFileGroupId) - + /* st_ino字段, 注æ„这个字段在IEEE P1282 V1.10之剿˜¯æ²¡æœ‰çš„ */ BISO_DEF_733(uiPosixFileSNO) }BISO_ROCK_RIDGE_ENTRY_PX_S; @@ -307,20 +307,20 @@ typedef struct tagBISO_ROCK_RIDGE_ENTRY_SL /* 版本å·ï¼Œ 必须为1 */ UCHAR ucVersion; - /* - * 0:最åŽä¸€ä¸ªè½¯é“¾æŽ¥ + /* + * 0:最åŽä¸€ä¸ªè½¯é“¾æŽ¥ * 1:åŽé¢è¿˜æœ‰ */ UCHAR ucFlags; /* Componet内容,有具体的格å¼å®šä¹‰ISO_RRIP_SL_COMPONENT_S */ - UCHAR aucComponet[1]; + UCHAR aucComponet[1]; }BISO_ROCK_RIDGE_ENTRY_SL_S; typedef struct tagBISO_RRIP_SL_COMPONENT { - /* ucFlags - * Bit0: Continue + /* ucFlags + * Bit0: Continue * Bit1: Current当å‰ç›®å½• '.' * Bit2: Parent父目录 '..' * Bit3: Root 目录 '/' @@ -357,9 +357,9 @@ typedef struct tagBISO_ROCK_RIDGE_ENTRY_NM /* 版本å·ï¼Œ 必须为1 */ UCHAR ucVersion; - /* - * ucFlags - * Bit0: Continue + /* + * ucFlags + * Bit0: Continue * Bit1: Current当å‰ç›®å½• '.' * Bit2: Parent父目录 '..' * å…¶ä»–ä½ä¿ç•™ @@ -441,8 +441,8 @@ typedef struct tagBISO_ROCK_RIDGE_ENTRY_TF * Bit4: Last Backup Time 是å¦è®°å½• * Bit5: Expiration Time 是å¦è®°å½• * Bit6: Effective Time 是å¦è®°å½• - * Bit7: Long-Form æ—¶é—´æ ¼å¼ - * 0 表示7字节数组格å¼(ECMA-119 9.1.5) + * Bit7: Long-Form æ—¶é—´æ ¼å¼ + * 0 表示7字节数组格å¼(ECMA-119 9.1.5) * 1 表示17字符串格å¼(ECMA-119 8.4.26.1) */ UCHAR ucFlags; @@ -468,7 +468,7 @@ typedef struct tagBISO_ROCK_RIDGE_ENTRY_SF BISO_DEF_733(uiVirFileSizeLow) /* - * ucDepth: + * ucDepth: * 1-->64KB * 2-->16MB * 3-->4GB @@ -487,8 +487,8 @@ ULONG BISO_RRIP_ReadExtInfo ( IN BISO_FILE_S *pstFile, IN BISO_PARSER_S *pstParser, - IN BISO_DIR_RECORD_S *pstRecord, - OUT BISO_DIR_TREE_S *pstDirTree + IN BISO_DIR_RECORD_S *pstRecord, + OUT BISO_DIR_TREE_S *pstDirTree ); VOID BISO_RRIP_GetPXInfo(IN VOID *pEntry, OUT BISO_DIR_TREE_S *pstDirTree); VOID BISO_RRIP_GetNMInfo(IN VOID *pEntry, OUT BISO_DIR_TREE_S *pstDirTree); diff --git a/VtoyTool/BabyISO/biso_util.c b/VtoyTool/BabyISO/biso_util.c index bcf12aab70e..aa223e01b21 100644 --- a/VtoyTool/BabyISO/biso_util.c +++ b/VtoyTool/BabyISO/biso_util.c @@ -7,17 +7,17 @@ * 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 . * */ - + #include "biso.h" #include "biso_list.h" @@ -47,7 +47,7 @@ VOID *g_apstBISOFree[7000]; VOID * BISO_UTIL_Malloc(IN size_t ulSize) { VOID *pData = malloc(ulSize + 4); - + #if (1 == MEMORY_DEBUG_DUMP) printf("ID %u Malloc %p %lu\n", g_uiBISOMallocTime, (UCHAR *)pData + 4, ulSize); g_apstBISOMalloc[g_uiBISOMallocTime] = (UCHAR *)pData + 4; @@ -60,7 +60,7 @@ VOID * BISO_UTIL_Malloc(IN size_t ulSize) { g_uiBISOPeekMalloc = g_uiBISOTotMalloc; } - + return (UCHAR *)pData + 4; } @@ -80,12 +80,12 @@ VOID *BISO_UTIL_Zalloc(IN size_t ulSize) { g_uiBISOPeekMalloc = g_uiBISOTotMalloc; } - + return (UCHAR *)pData + 4; } VOID BISO_UTIL_Free(IN VOID *pData) -{ +{ #if (1 == MEMORY_DEBUG_DUMP) printf("ID %u Free %p %u\n", g_uiBISOFreeTime, pData, *(UINT32 *)((UCHAR *)pData - 4)); g_apstBISOFree[g_uiBISOFreeTime] = pData; @@ -97,13 +97,13 @@ VOID BISO_UTIL_Free(IN VOID *pData) { g_uiBISOPeekMalloc = g_uiBISOTotMalloc; } - + free((UCHAR *)pData - 4); } VOID BISO_UTIL_DumpMemOp(VOID) { - BISO_DUMP("\n Memory Operation: Malloc(%u) Free(%u) \nTotal current use %u, Peek memory use %u.\n", + BISO_DUMP("\n Memory Operation: Malloc(%u) Free(%u) \nTotal current use %u, Peek memory use %u.\n", g_uiBISOMallocTime, g_uiBISOFreeTime, g_uiBISOTotMalloc, g_uiBISOPeekMalloc); #if (1 == MEMORY_DEBUG_DUMP) @@ -138,20 +138,20 @@ INT BISO_UTIL_GetTimeZone(VOID) time_t ulTime; struct tm *pstLocalTM = NULL; struct tm *pstGMTM = NULL; - + time(&ulTime); - pstGMTM = gmtime(&ulTime); + pstGMTM = gmtime(&ulTime); iGMTHour = pstGMTM->tm_hour; pstLocalTM = localtime(&ulTime); iLocalHour = pstLocalTM->tm_hour; - iTimeZone = iLocalHour - iGMTHour; - if (iTimeZone < -12) - { + iTimeZone = iLocalHour - iGMTHour; + if (iTimeZone < -12) + { iTimeZone += 24; - } - else if (iTimeZone > 12) + } + else if (iTimeZone > 12) { iTimeZone -= 24; } @@ -161,15 +161,15 @@ INT BISO_UTIL_GetTimeZone(VOID) ULONG BISO_UTIL_ReadFile ( - IN CONST CHAR *pcFileName, - IN UINT64 ui64Seek, + IN CONST CHAR *pcFileName, + IN UINT64 ui64Seek, IN UINT uiDataLen, OUT VOID *pDataBuf ) { UINT uiReadLen = 0; BISO_FILE_S *pstFile = NULL; - + if ((NULL == pcFileName) || (NULL == pDataBuf)) { return BISO_ERR_NULL_PTR; @@ -197,8 +197,8 @@ ULONG BISO_UTIL_ReadFile CHAR * BISO_UTIL_CopyStr ( - IN CONST CHAR *szSrc, - IN UINT uiSrcSize, + IN CONST CHAR *szSrc, + IN UINT uiSrcSize, OUT CHAR *szDest ) { @@ -235,18 +235,18 @@ CHAR * BISO_UTIL_CopyStr scnprintf(szDest, uiSrcSize, "*Empty*"); /* no safe */ } - return szDest; + return szDest; } CHAR * BISO_UTIL_CopyUCS2Str ( - IN CONST CHAR *szSrc, - IN UINT uiSrcSize, + IN CONST CHAR *szSrc, + IN UINT uiSrcSize, OUT CHAR *szDest ) { UINT i; - + memcpy(szDest, szSrc, uiSrcSize); for (i = 0; (i * 2 + 1) < uiSrcSize; i++) @@ -255,13 +255,13 @@ CHAR * BISO_UTIL_CopyUCS2Str } szDest[i] = 0; - return szDest; + return szDest; } VOID BISO_UTIL_PathProc(INOUT CHAR *pcPath, INOUT UINT *puiLen) { UINT i; - + if ((NULL == pcPath) || (NULL == puiLen) || (0 == *puiLen)) { return; @@ -286,8 +286,8 @@ VOID BISO_UTIL_PathProc(INOUT CHAR *pcPath, INOUT UINT *puiLen) ULONG BISO_UTIL_PathSplit ( - IN CONST CHAR *pcFullPath, - OUT UINT *puiDirNum, + IN CONST CHAR *pcFullPath, + OUT UINT *puiDirNum, OUT UINT *puiDirPos ) { @@ -296,7 +296,7 @@ ULONG BISO_UTIL_PathSplit UINT uiDirNum = 0; CONST CHAR *pcLastPos = pcFullPath; CONST CHAR *pcCurPos = pcFullPath; - + DBGASSERT(NULL != pcFullPath); DBGASSERT(NULL != puiDirNum); DBGASSERT(NULL != puiDirPos); @@ -311,13 +311,13 @@ ULONG BISO_UTIL_PathSplit { return BISO_ERR_FAILED; } - + puiDirPos[uiDirNum] = (UINT)((UINT)usPos << 16) | usLen; uiDirNum++; pcLastPos = pcCurPos + 1; } - + pcCurPos++; } @@ -326,9 +326,9 @@ ULONG BISO_UTIL_PathSplit if (usLen <= 0) { return BISO_ERR_FAILED; - } + } puiDirPos[uiDirNum++] = (UINT)((UINT)usPos << 16) | usLen; - + *puiDirNum = uiDirNum; return BISO_SUCCESS; } @@ -338,13 +338,13 @@ BISO_DIR_TREE_S * BISO_UTIL_FindLinkTgt(IN BISO_DIR_TREE_S *pstCurNode) UINT i = 0; UINT uiDirNum = 0; UINT auiDirPos[32]; - CHAR szDirName[1024]; + CHAR szDirName[1024]; USHORT usPos = 0; USHORT usLen = 0; CHAR *pcLink = NULL; BISO_DIR_TREE_S *pstFileList = NULL; BISO_DIR_TREE_S *pstRootDir = NULL; - + DBGASSERT(NULL != pstCurNode); /* å¦‚æžœä¸æ˜¯ç¬¦å·é“¾æŽ¥åˆ™è¿”回自己 */ @@ -354,7 +354,7 @@ BISO_DIR_TREE_S * BISO_UTIL_FindLinkTgt(IN BISO_DIR_TREE_S *pstCurNode) } pcLink = pstCurNode->pstPosixInfo->pcLinkSrc; - + if ('/' == pcLink[0]) { return NULL; @@ -428,8 +428,8 @@ BISO_DIR_TREE_S * BISO_UTIL_FindLinkTgt(IN BISO_DIR_TREE_S *pstCurNode) ULONG BISO_MBUF_Append ( - IN BISO_MBUF_S *pstMBuf, - IN UINT uiDataSize, + IN BISO_MBUF_S *pstMBuf, + IN UINT uiDataSize, IN VOID *pData ) { @@ -446,17 +446,17 @@ ULONG BISO_MBUF_Append if (NULL == pData) { - memset(pstMBuf->apucDataBuf[pstMBuf->uiCurBufNum], 0, uiDataSize); + memset(pstMBuf->apucDataBuf[pstMBuf->uiCurBufNum], 0, uiDataSize); } else { - memcpy(pstMBuf->apucDataBuf[pstMBuf->uiCurBufNum], pData, uiDataSize); + memcpy(pstMBuf->apucDataBuf[pstMBuf->uiCurBufNum], pData, uiDataSize); } - + pstMBuf->auiBufSize[pstMBuf->uiCurBufNum] = uiDataSize; pstMBuf->uiTotDataSize += uiDataSize; pstMBuf->uiCurBufNum++; - + return BISO_SUCCESS; } @@ -477,7 +477,7 @@ VOID BISO_MBUF_CopyToBuf(IN CONST BISO_MBUF_S *pstMBuf, OUT VOID *pDataBuf) { UINT i; UCHAR *pucDataBuf = (UCHAR *)pDataBuf; - + if ((NULL != pstMBuf) && (NULL != pucDataBuf)) { for (i = 0; i < pstMBuf->uiCurBufNum; i++) @@ -495,7 +495,7 @@ VOID BISO_MBUF_PULLUP(INOUT BISO_MBUF_S *pstMBuf) { UINT uiSize = 0; VOID *pData = NULL; - + DBGASSERT(NULL != pstMBuf); if (pstMBuf->uiCurBufNum <= 1) @@ -535,13 +535,13 @@ BISO_QUEUE_S * BISO_QUEUE_Create(VOID) VOID BISO_QUEUE_Destroy(IN BISO_QUEUE_S *pstQueue) { BISO_DLL_Free(pstQueue); - BISO_FREE(pstQueue); + BISO_FREE(pstQueue); } VOID BISO_QUEUE_Push(IN BISO_QUEUE_S *pstQueue, IN VOID *pData) { BISO_QUEUE_NODE_S *pstNode = NULL; - + pstNode = (BISO_QUEUE_NODE_S *)BISO_DLL_Last(pstQueue); /* 当å‰èŠ‚ç‚¹å·²æ»¡éœ€è¦æ‰©å±•新内存节点 */ @@ -564,7 +564,7 @@ VOID * BISO_QUEUE_PopHead(IN BISO_QUEUE_S *pstQueue) { VOID *pData = NULL; BISO_QUEUE_NODE_S *pstNode = NULL; - + pstNode = (BISO_QUEUE_NODE_S *)BISO_DLL_First(pstQueue); if (NULL == pstNode) { @@ -588,7 +588,7 @@ VOID * BISO_QUEUE_PopTail(IN BISO_QUEUE_S *pstQueue) { VOID *pData = NULL; BISO_QUEUE_NODE_S *pstNode = NULL; - + pstNode = (BISO_QUEUE_NODE_S *)BISO_DLL_Last(pstQueue); if ((NULL == pstNode) || (0 == pstNode->usLast)) { diff --git a/VtoyTool/BabyISO/biso_util.h b/VtoyTool/BabyISO/biso_util.h index 2dbeba17f04..39f3ce1cd49 100644 --- a/VtoyTool/BabyISO/biso_util.h +++ b/VtoyTool/BabyISO/biso_util.h @@ -7,17 +7,17 @@ * 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 . * */ - + #ifndef __BISO_UTIL_H__ #define __BISO_UTIL_H__ @@ -174,15 +174,15 @@ CHAR * BISO_UTIL_CopyStr ); CHAR * BISO_UTIL_CopyUCS2Str ( - IN CONST CHAR *szSrc, - IN UINT uiSrcSize, + IN CONST CHAR *szSrc, + IN UINT uiSrcSize, OUT CHAR *szDest ); VOID BISO_UTIL_PathProc(INOUT CHAR *pcPath, INOUT UINT *puiLen); ULONG BISO_UTIL_PathSplit ( - IN CONST CHAR *pcFullPath, - OUT UINT *puiDirNum, + IN CONST CHAR *pcFullPath, + OUT UINT *puiDirNum, OUT UINT *puiDirPos ); diff --git a/VtoyTool/build.sh b/VtoyTool/build.sh index 13e056d5ffc..5ca47b47299 100644 --- a/VtoyTool/build.sh +++ b/VtoyTool/build.sh @@ -14,7 +14,7 @@ mips64el-linux-musl-gcc -mips64r2 -mabi=64 -Os -static -DVTOY_MIPS64 -D_FILE_OFF if [ -e vtoytool_64 ] && [ -e vtoytool_32 ] && [ -e vtoytool_aa64 ] && [ -e vtoytool_m64e ]; then echo -e '\n############### SUCCESS ###############\n' - + aarch64-buildroot-linux-uclibc-strip --strip-all vtoytool_aa64 mips64el-linux-musl-strip --strip-all vtoytool_m64e mv vtoytool_m64e vtoytool/00/ diff --git a/VtoyTool/vtoydm.c b/VtoyTool/vtoydm.c index 46de17268b8..1dda91a2c15 100644 --- a/VtoyTool/vtoydm.c +++ b/VtoyTool/vtoydm.c @@ -7,12 +7,12 @@ * 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 . * @@ -82,7 +82,7 @@ ventoy_img_chunk * vtoydm_get_img_map_data(const char *img_map_file, int *plen) int rc = 1; FILE *fp = NULL; ventoy_img_chunk *chunk = NULL; - + fp = fopen(img_map_file, "rb"); if (NULL == fp) { @@ -111,7 +111,7 @@ ventoy_img_chunk * vtoydm_get_img_map_data(const char *img_map_file, int *plen) if (len % sizeof(ventoy_img_chunk)) { - fprintf(stderr, "image map file size %d is not aligned with %d\n", + fprintf(stderr, "image map file size %d is not aligned with %d\n", len, (int)sizeof(ventoy_img_chunk)); goto end; } @@ -139,7 +139,7 @@ UINT64 vtoydm_get_file_size(const char *pcFileName) (void)pcFileName; debug("vtoydm_get_file_size %s %lu\n", pcFileName, (unsigned long)g_iso_file_size); - + return g_iso_file_size; } @@ -157,14 +157,14 @@ BISO_FILE_S * vtoydm_open_file(const char *pcFileName) file->FileSize = g_iso_file_size; file->CurPos = 0; } - + return file; } void vtoydm_close_file(BISO_FILE_S *pstFile) { debug("vtoydm_close_file\n"); - + if (pstFile) { free(pstFile); @@ -187,7 +187,7 @@ UINT64 vtoydm_map_iso_sector(UINT64 sector) { int i; UINT64 disk_sector = 0; - + for (i = 0; i < g_img_chunk_num; i++) { if (sector >= g_img_chunk[i].img_start_sector && sector <= g_img_chunk[i].img_end_sector) @@ -205,7 +205,7 @@ int vtoydm_read_iso_sector(UINT64 sector, void *buf) int i; int fd; UINT64 disk_sector = 0; - + for (i = 0; i < g_img_chunk_num; i++) { if (sector >= g_img_chunk[i].img_start_sector && sector <= g_img_chunk[i].img_end_sector) @@ -232,9 +232,9 @@ int vtoydm_read_iso_sector(UINT64 sector, void *buf) UINT64 vtoydm_read_file ( - BISO_FILE_S *pstFile, - UINT uiBlkSize, - UINT uiBlkNum, + BISO_FILE_S *pstFile, + UINT uiBlkSize, + UINT uiBlkNum, VOID *pBuf ) { @@ -249,7 +249,7 @@ UINT64 vtoydm_read_file if (pos > 0) { align = 2048 - pos; - + vtoydm_read_iso_sector(pstFile->CurPos / 2048, g_iso_sector_buf); if (readlen > align) { @@ -270,7 +270,7 @@ UINT64 vtoydm_read_file { vtoydm_read_iso_sector(pstFile->CurPos / 2048, curbuf); pstFile->CurPos += 2048; - + curbuf += 2048; readlen -= 2048; } @@ -281,7 +281,7 @@ UINT64 vtoydm_read_file memcpy(curbuf, g_iso_sector_buf, readlen); pstFile->CurPos += readlen; } - + return uiBlkSize * uiBlkNum; } @@ -295,7 +295,7 @@ int vtoydm_dump_iso(const char *img_map_file, const char *diskname) BISO_READ_S *iso; BISO_PARSER_S *parser = NULL; char label[64] = {0}; - + chunk = vtoydm_get_img_map_data(img_map_file, &len); if (NULL == chunk) { @@ -324,7 +324,7 @@ int vtoydm_dump_iso(const char *img_map_file, const char *diskname) ret = BISO_OpenImage("XXX", iso); debug("open iso image ret=0x%lx\n", ret); - parser = (BISO_PARSER_S *)iso; + parser = (BISO_PARSER_S *)iso; memcpy(label, parser->pstPVD->szVolumeId, 32); for (i = 32; i >=0; i--) { @@ -340,11 +340,11 @@ int vtoydm_dump_iso(const char *img_map_file, const char *diskname) if (label[0]) { - printf("VENTOY_ISO_LABEL %s\n", label); + printf("VENTOY_ISO_LABEL %s\n", label); } - + BISO_DumpFileTree(iso); - + BISO_FreeReadHandle(iso); free(chunk); @@ -353,7 +353,7 @@ int vtoydm_dump_iso(const char *img_map_file, const char *diskname) static int vtoydm_extract_iso ( - const char *img_map_file, + const char *img_map_file, const char *diskname, unsigned long first_sector, unsigned long long file_size, @@ -394,7 +394,7 @@ static int vtoydm_extract_iso file_size = 0; } } - + fclose(fp); free(g_img_chunk); return 0; @@ -403,7 +403,7 @@ static int vtoydm_extract_iso static int vtoydm_print_extract_iso ( - const char *img_map_file, + const char *img_map_file, const char *diskname, unsigned long first_sector, unsigned long long file_size, @@ -461,7 +461,7 @@ static int vtoydm_print_extract_iso last = sector; count = 4; } - + if (file_size > 2048) { file_size -= 2048; @@ -478,7 +478,7 @@ static int vtoydm_print_extract_iso buf[1] = count; fwrite(buf, 1, sizeof(buf), fp); } - + fclose(fp); free(g_img_chunk); return 0; @@ -494,7 +494,7 @@ static int vtoydm_print_linear_table(const char *img_map_file, const char *diskn uint32_t disk_sector_num; uint32_t sector_start; ventoy_img_chunk *chunk = NULL; - + chunk = vtoydm_get_img_map_data(img_map_file, &len); if (NULL == chunk) { @@ -508,20 +508,20 @@ static int vtoydm_print_linear_table(const char *img_map_file, const char *diskn /* TBD: to be more flexible */ #if 0 - printf("%u %u linear %s %llu\n", - (sector_start << 2), disk_sector_num, + printf("%u %u linear %s %llu\n", + (sector_start << 2), disk_sector_num, diskname, (unsigned long long)chunk[i].disk_start_sector); #else if (strstr(diskname, "nvme") || strstr(diskname, "mmc") || strstr(diskname, "nbd")) { - printf("%u %u linear %sp%d %llu\n", - (sector_start << 2), disk_sector_num, + printf("%u %u linear %sp%d %llu\n", + (sector_start << 2), disk_sector_num, diskname, part, (unsigned long long)chunk[i].disk_start_sector - offset); } else { - printf("%u %u linear %s%d %llu\n", - (sector_start << 2), disk_sector_num, + printf("%u %u linear %s%d %llu\n", + (sector_start << 2), disk_sector_num, diskname, part, (unsigned long long)chunk[i].disk_start_sector - offset); } #endif @@ -539,7 +539,7 @@ static int vtoydm_print_help(FILE *fp) " vtoydm -i -f img_map_file -d diskname [ -v ] \n" " vtoydm -e -f img_map_file -d diskname -s sector -l len -o file [ -v ] \n" ); - return 0; + return 0; } static uint64_t vtoydm_get_part_start(const char *diskname, int part) @@ -561,7 +561,7 @@ static uint64_t vtoydm_get_part_start(const char *diskname, int part) if (access(diskpath, F_OK) >= 0) { debug("get part start from sysfs for %s %d\n", diskname, part); - + fd = open(diskpath, O_RDONLY | O_BINARY); if (fd >= 0) { @@ -600,7 +600,7 @@ static uint64_t vtoydm_get_part_secnum(const char *diskname, int part) if (access(diskpath, F_OK) >= 0) { debug("get part size from sysfs for %s %d\n", diskname, part); - + fd = open(diskpath, O_RDONLY | O_BINARY); if (fd >= 0) { @@ -647,12 +647,12 @@ static int vtoydm_vlnk_convert(char *disk, int len, int *part, uint64_t *offset) if (param.vtoy_reserved[6]) { cnt = vtoy_find_disk_by_guid(¶m, diskname); - debug("vtoy_find_disk_by_guid cnt=%d\n", cnt); + debug("vtoy_find_disk_by_guid cnt=%d\n", cnt); if (cnt == 1) { *part = param.vtoy_disk_part_id; *offset = vtoydm_get_part_start(diskname, *part); - + debug("VLNK <%s> <%s> <%llu>\n", disk, diskname, *part, (unsigned long long)(*offset)); snprintf(disk, len, "/dev/%s", diskname); @@ -681,7 +681,7 @@ static int vtoydm_print_raw_linear_table(const char *img_map_file, const char *d { printf("0 %lu linear %s%d 0\n", (unsigned long)disk_sector_num, diskname, part); } - + return 0; } @@ -764,11 +764,11 @@ int vtoydm_main(int argc, char **argv) return 1; } - debug("cmd=%d file=<%s> disk=<%s> first_sector=%lu file_size=%llu\n", + debug("cmd=%d file=<%s> disk=<%s> first_sector=%lu file_size=%llu\n", cmd, filepath, diskname, first_sector, file_size); vtoydm_vlnk_convert(diskname, sizeof(diskname), &part, &offset); - + switch (cmd) { case CMD_PRINT_TABLE: diff --git a/VtoyTool/vtoydump.c b/VtoyTool/vtoydump.c index 25c288b0bd0..6cbcfa5b191 100644 --- a/VtoyTool/vtoydump.c +++ b/VtoyTool/vtoydump.c @@ -1,5 +1,5 @@ /****************************************************************************** - * vtoydump.c ---- Dump ventoy os parameters + * vtoydump.c ---- Dump ventoy os parameters * * Copyright (c) 2020, longpanda * @@ -7,12 +7,12 @@ * 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 . * @@ -51,7 +51,7 @@ static int verbose = 0; static ventoy_guid vtoy_guid = VENTOY_GUID; -static const char *g_ventoy_fs[ventoy_fs_max] = +static const char *g_ventoy_fs[ventoy_fs_max] = { "exfat", "ntfs", "ext*", "xfs", "udf", "fat" }; @@ -61,12 +61,12 @@ static int vtoy_check_os_param(ventoy_os_param *param) uint32_t i; uint8_t chksum = 0; uint8_t *buf = (uint8_t *)param; - + if (memcmp(¶m->guid, &vtoy_guid, sizeof(ventoy_guid))) { uint8_t *data1 = (uint8_t *)(¶m->guid); uint8_t *data2 = (uint8_t *)(&vtoy_guid); - + for (i = 0; i < 16; i++) { if (data1[i] != data2[i]) @@ -114,7 +114,7 @@ static int vtoy_os_param_from_file(const char *filename, ventoy_os_param *param) debug("ventoy os pararm NOT found in file %s\n", filename); rc = 1; } - + close(fd); return rc; } @@ -124,14 +124,14 @@ static void vtoy_dump_os_param(ventoy_os_param *param) printf("################# dump os param ################\n"); printf("param->chksum = 0x%x\n", param->chksum); - printf("param->vtoy_disk_guid = %02x %02x %02x %02x\n", - param->vtoy_disk_guid[0], param->vtoy_disk_guid[1], + printf("param->vtoy_disk_guid = %02x %02x %02x %02x\n", + param->vtoy_disk_guid[0], param->vtoy_disk_guid[1], param->vtoy_disk_guid[2], param->vtoy_disk_guid[3]); - - printf("param->vtoy_disk_signature = %02x %02x %02x %02x\n", - param->vtoy_disk_signature[0], param->vtoy_disk_signature[1], + + printf("param->vtoy_disk_signature = %02x %02x %02x %02x\n", + param->vtoy_disk_signature[0], param->vtoy_disk_signature[1], param->vtoy_disk_signature[2], param->vtoy_disk_signature[3]); - + printf("param->vtoy_disk_size = %llu\n", (unsigned long long)param->vtoy_disk_size); printf("param->vtoy_disk_part_id = %u\n", param->vtoy_disk_part_id); printf("param->vtoy_disk_part_type = %u\n", param->vtoy_disk_part_type); @@ -139,7 +139,7 @@ static void vtoy_dump_os_param(ventoy_os_param *param) printf("param->vtoy_img_size = <%llu>\n", (unsigned long long)param->vtoy_img_size); printf("param->vtoy_img_location_addr = <0x%llx>\n", (unsigned long long)param->vtoy_img_location_addr); printf("param->vtoy_img_location_len = <%u>\n", param->vtoy_img_location_len); - printf("param->vtoy_reserved = %02x %02x %02x %02x %02x %02x %02x %02x\n", + printf("param->vtoy_reserved = %02x %02x %02x %02x %02x %02x %02x %02x\n", param->vtoy_reserved[0], param->vtoy_reserved[1], param->vtoy_reserved[2], @@ -149,7 +149,7 @@ static void vtoy_dump_os_param(ventoy_os_param *param) param->vtoy_reserved[6], param->vtoy_reserved[7] ); - + printf("\n"); } @@ -160,13 +160,13 @@ static int vtoy_get_disk_guid(const char *diskname, uint8_t *vtguid, uint8_t *vt char devdisk[128] = {0}; snprintf(devdisk, sizeof(devdisk) - 1, "/dev/%s", diskname); - + fd = open(devdisk, O_RDONLY | O_BINARY); if (fd >= 0) { lseek(fd, 0x180, SEEK_SET); read(fd, vtguid, 16); - + lseek(fd, 0x1b8, SEEK_SET); read(fd, vtsig, 4); close(fd); @@ -177,7 +177,7 @@ static int vtoy_get_disk_guid(const char *diskname, uint8_t *vtguid, uint8_t *vt debug("%02x", vtguid[i]); } debug(">\n"); - + return 0; } else @@ -200,7 +200,7 @@ static unsigned long long vtoy_get_disk_size_in_byte(const char *disk) if (access(diskpath, F_OK) >= 0) { debug("get disk size from sysfs for %s\n", disk); - + fd = open(diskpath, O_RDONLY | O_BINARY); if (fd >= 0) { @@ -268,7 +268,7 @@ static int vtoy_is_possible_blkdev(const char *name) { return 0; } - + return 1; } @@ -284,7 +284,7 @@ static int vtoy_find_disk_by_size(unsigned long long size, char *diskname) { return 0; } - + while ((p = readdir(dir)) != NULL) { if (!vtoy_is_possible_blkdev(p->d_name)) @@ -292,7 +292,7 @@ static int vtoy_find_disk_by_size(unsigned long long size, char *diskname) debug("disk %s is filted by name\n", p->d_name); continue; } - + cursize = vtoy_get_disk_size_in_byte(p->d_name); debug("disk %s size %llu\n", p->d_name, (unsigned long long)cursize); if (cursize == size) @@ -302,7 +302,7 @@ static int vtoy_find_disk_by_size(unsigned long long size, char *diskname) } } closedir(dir); - return rc; + return rc; } int vtoy_find_disk_by_guid(ventoy_os_param *param, char *diskname) @@ -319,19 +319,19 @@ int vtoy_find_disk_by_guid(ventoy_os_param *param, char *diskname) { return 0; } - + while ((p = readdir(dir)) != NULL) { if (!vtoy_is_possible_blkdev(p->d_name)) { - debug("disk %s is filted by name\n", p->d_name); + debug("disk %s is filted by name\n", p->d_name); continue; } - + memset(vtguid, 0, sizeof(vtguid)); memset(vtsig, 0, sizeof(vtsig)); rc = vtoy_get_disk_guid(p->d_name, vtguid, vtsig); - if (rc == 0 && memcmp(vtguid, param->vtoy_disk_guid, 16) == 0 && + if (rc == 0 && memcmp(vtguid, param->vtoy_disk_guid, 16) == 0 && memcmp(vtsig, param->vtoy_disk_signature, 4) == 0) { sprintf(diskname, "%s", p->d_name); @@ -339,8 +339,8 @@ int vtoy_find_disk_by_guid(ventoy_os_param *param, char *diskname) } } closedir(dir); - - return count; + + return count; } static int vtoy_find_disk_by_sig(uint8_t *sig, char *diskname) @@ -357,12 +357,12 @@ static int vtoy_find_disk_by_sig(uint8_t *sig, char *diskname) { return 0; } - + while ((p = readdir(dir)) != NULL) { if (!vtoy_is_possible_blkdev(p->d_name)) { - debug("disk %s is filted by name\n", p->d_name); + debug("disk %s is filted by name\n", p->d_name); continue; } @@ -376,8 +376,8 @@ static int vtoy_find_disk_by_sig(uint8_t *sig, char *diskname) } } closedir(dir); - - return count; + + return count; } static int vtoy_printf_iso_path(ventoy_os_param *param) @@ -388,7 +388,7 @@ static int vtoy_printf_iso_path(ventoy_os_param *param) static int vtoy_printf_fs(ventoy_os_param *param) { - const char *fs[] = + const char *fs[] = { "exfat", "ntfs", "ext", "xfs", "udf", "fat" }; @@ -412,7 +412,7 @@ static int vtoy_vlnk_printf(ventoy_os_param *param, char *diskname) int fd = -1; char diskpath[128]; uint8_t check[8] = { 0x56, 0x54, 0x00, 0x47, 0x65, 0x00, 0x48, 0x44 }; - + memcpy(disk_sig, param->vtoy_reserved + 7, 4); debug("vlnk disk sig: %02x %02x %02x %02x \n", disk_sig[0], disk_sig[1], disk_sig[2], disk_sig[3]); @@ -431,7 +431,7 @@ static int vtoy_vlnk_printf(ventoy_os_param *param, char *diskname) if (memcmp(mbr + 0x190, check, 8) == 0) { printf("/dev/%s", diskname); - return 0; + return 0; } else { @@ -449,14 +449,14 @@ static int vtoy_check_iso_path_alpnum(ventoy_os_param *param) { char c; int i = 0; - + while (param->vtoy_img_path[i]) { - c = param->vtoy_img_path[i]; - + c = param->vtoy_img_path[i]; + if (isalnum(c) || c == '_' || c == '-') { - + } else { @@ -470,7 +470,7 @@ static int vtoy_check_iso_path_alpnum(ventoy_os_param *param) static int vtoy_check_device(ventoy_os_param *param, const char *device) { - unsigned long long size; + unsigned long long size; uint8_t vtguid[16] = {0}; uint8_t vtsig[4] = {0}; @@ -479,7 +479,7 @@ static int vtoy_check_device(ventoy_os_param *param, const char *device) size = vtoy_get_disk_size_in_byte(device); vtoy_get_disk_guid(device, vtguid, vtsig); - debug("param->vtoy_disk_size=%llu size=%llu\n", + debug("param->vtoy_disk_size=%llu size=%llu\n", (unsigned long long)param->vtoy_disk_size, (unsigned long long)size); if (memcmp(vtguid, param->vtoy_disk_guid, 16) == 0 && @@ -503,7 +503,7 @@ static int vtoy_print_os_param(ventoy_os_param *param, char *diskname) const char *fs; char diskpath[256] = {0}; char sizebuf[64] = {0}; - + cnt = vtoy_find_disk_by_size(param->vtoy_disk_size, diskname); debug("find disk by size %llu, cnt=%d...\n", (unsigned long long)param->vtoy_disk_size, cnt); if (1 == cnt) @@ -518,7 +518,7 @@ static int vtoy_print_os_param(ventoy_os_param *param, char *diskname) cnt = vtoy_find_disk_by_guid(param, diskname); debug("find disk by guid cnt=%d...\n", cnt); } - + if (param->vtoy_disk_part_type < ventoy_fs_max) { fs = g_ventoy_fs[param->vtoy_disk_part_type]; @@ -573,11 +573,11 @@ static int vtoy_print_os_param(ventoy_os_param *param, char *diskname) /* * Find disk and image path from ventoy runtime data. * By default data is read from phymem(legacy bios) or efivar(UEFI), if -f is input, data is read from file. - * - * -f datafile os param data file. + * + * -f datafile os param data file. * -c /dev/xxx check ventoy disk * -v be verbose - * -l also print image disk location + * -l also print image disk location */ int vtoydump_main(int argc, char **argv) { @@ -642,11 +642,11 @@ int vtoydump_main(int argc, char **argv) param = malloc(sizeof(ventoy_os_param)); if (NULL == param) { - fprintf(stderr, "failed to alloc memory with size %d error %d\n", + fprintf(stderr, "failed to alloc memory with size %d error %d\n", (int)sizeof(ventoy_os_param), errno); return 1; } - + memset(param, 0, sizeof(ventoy_os_param)); debug("get os pararm from file %s\n", filename); @@ -665,8 +665,8 @@ int vtoydump_main(int argc, char **argv) } else { - goto end; - } + goto end; + } } if (verbose) diff --git a/VtoyTool/vtoyexpand.c b/VtoyTool/vtoyexpand.c index c0a15d37b5e..3b52823689a 100644 --- a/VtoyTool/vtoyexpand.c +++ b/VtoyTool/vtoyexpand.c @@ -7,12 +7,12 @@ * 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 . * @@ -70,7 +70,7 @@ static void vlog(const char *fmt, ...) n += vsnprintf(log, sizeof(log) - 1, fmt, arg); va_end(arg); - fwrite(log, 1, n, fp); + fwrite(log, 1, n, fp); fclose(fp); } } @@ -90,7 +90,7 @@ static int copy_file(const char *file1, const char *file2) vlog("Failed to read file <%s>\n", file1); goto end; } - + fp2 = fopen(file2, "wb+"); if (!fp2) { @@ -115,7 +115,7 @@ static int copy_file(const char *file1, const char *file2) vlog("Failed to read <%s> %d %d\n", file1, n, size); goto end; } - + n = fwrite(buf, 1, size, fp2); if (n != size) { @@ -167,7 +167,7 @@ static int vtoy_is_possible_blkdev(const char *name) { return 0; } - + return 1; } @@ -184,7 +184,7 @@ static ulonglong vtoy_get_disk_size_in_byte(const char *disk) if (access(diskpath, F_OK) >= 0) { vlog("get disk size from sysfs for %s\n", disk); - + fd = open(diskpath, O_RDONLY | O_BINARY); if (fd >= 0) { @@ -233,7 +233,7 @@ static int get_disk_num(void) { return 0; } - + while ((p = readdir(dir)) != NULL) { n++; @@ -248,7 +248,7 @@ static int is_usb_disk(const char *diskname) int rc; char dstpath[1024] = { 0 }; char syspath[1024] = { 0 }; - + snprintf(syspath, sizeof(syspath), "/sys/block/%s", diskname); rc = readlink(syspath, dstpath, sizeof(dstpath) - 1); if (rc > 0 && strstr(dstpath, "/usb")) @@ -296,13 +296,13 @@ static int get_all_disk(void) vlog("disk %s is filted by name\n", p->d_name); continue; } - + cursize = vtoy_get_disk_size_in_byte(p->d_name); node = g_disk_list + g_disk_num; g_disk_num++; - + snprintf(node->name, sizeof(node->name), p->d_name); node->size = cursize; node->isUSB = is_usb_disk(p->d_name); @@ -338,7 +338,7 @@ static int get_all_disk(void) node->size / 1024 / 1024 / 1024, node->size, node->isUSB); } vlog("============ DISK DUMP END ===========\n"); - + return 0; } @@ -410,7 +410,7 @@ static int expand_var(const char *var, char *value, int len) { uiDst = strtoul(var + 22, NULL, 10); uiDst = uiDst * (1024ULL * 1024ULL * 1024ULL); - + for (i = 0; i < g_disk_num; i++) { node = g_disk_list + i; @@ -418,7 +418,7 @@ static int expand_var(const char *var, char *value, int len) { continue; } - + if (node->size > uiDst) { delta = node->size - uiDst; @@ -427,7 +427,7 @@ static int expand_var(const char *var, char *value, int len) { delta = uiDst - node->size; } - + if (delta < maxdelta) { index = i; @@ -481,10 +481,10 @@ int vtoyexpand_main(int argc, char **argv) { g_vtoy_disk_name += 5; } - vlog("<%s> <%s> <%s>\n", argv[1], argv[2], g_vtoy_disk_name); + vlog("<%s> <%s> <%s>\n", argv[1], argv[2], g_vtoy_disk_name); get_all_disk(); - + fp = fopen(argv[1], "r"); if (!fp) { @@ -502,7 +502,7 @@ int vtoyexpand_main(int argc, char **argv) memset(line, 0, sizeof(line)); memset(value, 0, sizeof(value)); - + while (fgets(line, sizeof(line), fp)) { start = strstr(line, "$$VT_"); @@ -519,7 +519,7 @@ int vtoyexpand_main(int argc, char **argv) *end = 0; expand_var(start + 2, value, sizeof(value)); fprintf(fout, "%s", value); - + fprintf(fout, "%s", end + 2); memset(value, 0, sizeof(value)); @@ -531,7 +531,7 @@ int vtoyexpand_main(int argc, char **argv) line[0] = line[4095] = 0; } - + fclose(fp); fclose(fout); @@ -540,7 +540,7 @@ int vtoyexpand_main(int argc, char **argv) vlog("Copy file <%s> --> <%s>\n", TMP_FILE, argv[1]); copy_file(TMP_FILE, argv[1]); - + return 0; } diff --git a/VtoyTool/vtoykmod.c b/VtoyTool/vtoykmod.c index 1e73db2a1c2..d4cf629dc72 100644 --- a/VtoyTool/vtoykmod.c +++ b/VtoyTool/vtoykmod.c @@ -7,12 +7,12 @@ * 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 . * @@ -211,7 +211,7 @@ static int vtoykmod_write_file(char *name, void *buf, int size) { return -1; } - + fwrite(buf, 1, size, fp); fclose(fp); @@ -230,7 +230,7 @@ static int vtoykmod_read_file(char *name, char **buf) debug("failed to open %s %d\n", name, errno); return -1; } - + fseek(fp, 0, SEEK_END); size = (int)ftell(fp); fseek(fp, 0, SEEK_SET); @@ -241,7 +241,7 @@ static int vtoykmod_read_file(char *name, char **buf) debug("failed to open malloc %d\n", size); return -1; } - + fread(databuf, 1, size, fp); fclose(fp); @@ -402,7 +402,7 @@ static int vtoykmod_update_vermagic(char *oldbuf, int oldsize, char *newbuf, int break; } } - + for (i = 0; i < newsize - 9; i++) { if (strncmp(newbuf + i, "vermagic=", 9) == 0) @@ -451,7 +451,7 @@ int vtoykmod_update(int kvMajor, int kvMinor, char *oldko, char *newko) if (oldbuf[EI_CLASS] == ELFCLASS64) { rc = vtoykmod_find_section64(oldbuf, "__versions", &oldoff, &oldlen, NULL); - rc += vtoykmod_find_section64(newbuf, "__versions", &newoff, &newlen, NULL); + rc += vtoykmod_find_section64(newbuf, "__versions", &newoff, &newlen, NULL); } else { @@ -468,23 +468,23 @@ int vtoykmod_update(int kvMajor, int kvMinor, char *oldko, char *newko) { debug("no need to proc modversions\n"); } - + /* 3: update relocate address */ if (oldbuf[EI_CLASS] == ELFCLASS64) { Elf64_Rela *oldRela, *newRela; - + rc = vtoykmod_find_section64(oldbuf, ".rela.gnu.linkonce.this_module", &oldoff, &oldlen, NULL); rc += vtoykmod_find_section64(newbuf, ".rela.gnu.linkonce.this_module", &newoff, &newlen, NULL); if (rc == 0) { oldRela = (Elf64_Rela *)(oldbuf + oldoff); newRela = (Elf64_Rela *)(newbuf + newoff); - + debug("init_module rela: 0x%llx --> 0x%llx\n", (_ull)(oldRela[0].r_offset), (_ull)(newRela[0].r_offset)); oldRela[0].r_offset = newRela[0].r_offset; oldRela[0].r_addend = newRela[0].r_addend; - + debug("cleanup_module rela: 0x%llx --> 0x%llx\n", (_ull)(oldRela[1].r_offset), (_ull)(newRela[1].r_offset)); oldRela[1].r_offset = newRela[1].r_offset; oldRela[1].r_addend = newRela[1].r_addend; @@ -503,7 +503,7 @@ int vtoykmod_update(int kvMajor, int kvMinor, char *oldko, char *newko) debug("section .gnu.linkonce.this_module change oldlen:0x%x to newlen:0x%x\n", oldlen, newlen); if (sec) { - sec->sh_size = newlen; + sec->sh_size = newlen; } } else @@ -515,7 +515,7 @@ int vtoykmod_update(int kvMajor, int kvMinor, char *oldko, char *newko) else { Elf32_Rel *oldRel, *newRel; - + rc = vtoykmod_find_section32(oldbuf, ".rel.gnu.linkonce.this_module", &oldoff, &oldlen, NULL); rc += vtoykmod_find_section32(newbuf, ".rel.gnu.linkonce.this_module", &newoff, &newlen, NULL); if (rc == 0) @@ -550,7 +550,7 @@ int vtoykmod_fill_param(char **argv) char *buf = NULL; ko_param *param; unsigned char magic[16] = { magic_sig }; - + size = vtoykmod_read_file(argv[0], &buf); if (size < 0) { @@ -563,7 +563,7 @@ int vtoykmod_fill_param(char **argv) { debug("Find param magic at %d\n", i); param = (ko_param *)(buf + i); - + param->struct_size = (unsigned long)sizeof(ko_param); param->pgsize = strtoul(argv[1], NULL, 10); param->printk_addr = strtoul(argv[2], NULL, 16); @@ -602,7 +602,7 @@ int vtoykmod_fill_param(char **argv) debug("kv_subminor=%lu (%s)\n", param->kv_subminor, argv[16]); debug("bdev_open_addr=0x%lx (%s)\n", param->bdev_open_addr, argv[17]); debug("bdev_file_open_addr=0x%lx (%s)\n", param->bdev_file_open_addr, argv[18]); - + break; } } @@ -611,7 +611,7 @@ int vtoykmod_fill_param(char **argv) { debug("### param magic not found \n"); } - + vtoykmod_write_file(argv[0], buf, size); free(buf); @@ -622,9 +622,9 @@ int vtoykmod_fill_param(char **argv) static int vtoykmod_check_ibt(void) { uint32_t eax = 0, ebx = 0, ecx = 0, edx = 0; - + __cpuid_count(7, 0, eax, ebx, ecx, edx); - + if (edx & (1 << 20)) { return 0; diff --git a/VtoyTool/vtoyksym.c b/VtoyTool/vtoyksym.c index e06290f37d8..6357bac8c42 100644 --- a/VtoyTool/vtoyksym.c +++ b/VtoyTool/vtoyksym.c @@ -7,12 +7,12 @@ * 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 . * @@ -48,7 +48,7 @@ int vtoyksym_main(int argc, char **argv) return 0; } } - + for (i = 0; i < argc; i++) { if (argv[i][0] == '-' && argv[i][1] == 'v') @@ -85,7 +85,7 @@ int vtoyksym_main(int argc, char **argv) } else { - addr2 = strtoull(line, NULL, 16); + addr2 = strtoull(line, NULL, 16); } debug("addr1=<0x%llx> addr2=<0x%llx>\n", addr1, addr2); diff --git a/VtoyTool/vtoyloader.c b/VtoyTool/vtoyloader.c index 3db190bc47d..75db853c3d9 100644 --- a/VtoyTool/vtoyloader.c +++ b/VtoyTool/vtoyloader.c @@ -7,12 +7,12 @@ * 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 . * @@ -74,7 +74,7 @@ int vtoyloader_main(int argc, char **argv) } debug("ventoy loader ...\n"); - + rc = vtoy_read_file_to_buf(EXEC_PATH_FILE, g_exec_file, sizeof(g_exec_file) - 1); if (rc) { @@ -124,7 +124,7 @@ int vtoyloader_main(int argc, char **argv) { cmdlist[i] = argv[i]; } - + cmdlist[0] = g_exec_file; debug("g_exec_file=<%s>\n", g_exec_file); @@ -145,7 +145,7 @@ int vtoyloader_main(int argc, char **argv) pos++; break; } - + pos++; } } @@ -156,11 +156,11 @@ int vtoyloader_main(int argc, char **argv) if (g_hook_cmd[0]) { rc = system(g_hook_cmd); - debug("system return code =<%d> errno=<%d>\n", rc, errno); + debug("system return code =<%d> errno=<%d>\n", rc, errno); } execv(cmdlist[0], cmdlist); - + return 0; } diff --git a/VtoyTool/vtoytool.c b/VtoyTool/vtoytool.c index 48cd9ff30ca..98c7e5c10a2 100644 --- a/VtoyTool/vtoytool.c +++ b/VtoyTool/vtoytool.c @@ -7,12 +7,12 @@ * 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 . * @@ -41,7 +41,7 @@ int vtoykmod_main(int argc, char **argv); int vtoyexpand_main(int argc, char **argv); static char *g_vtoytool_name = NULL; -static cmd_def g_cmd_list[] = +static cmd_def g_cmd_list[] = { { "vine_patch_loader", vtoyvine_main }, { "vtoydump", vtoydump_main }, @@ -60,7 +60,7 @@ int vtoytool_install(int argc, char **argv) int i; char toolpath[128]; char filepath[128]; - + for (i = 0; i < sizeof(g_cmd_list) / sizeof(g_cmd_list[0]); i++) { if (g_cmd_list[i].cmd[0] != '-') @@ -70,14 +70,14 @@ int vtoytool_install(int argc, char **argv) link(toolpath, filepath); } } - + return 0; } int main(int argc, char **argv) { int i; - + if ((g_vtoytool_name = strstr(argv[0], "vtoytool")) != NULL) { argc--; diff --git a/VtoyTool/vtoytool.h b/VtoyTool/vtoytool.h index e2ddce34c55..0bce92fa5eb 100644 --- a/VtoyTool/vtoytool.h +++ b/VtoyTool/vtoytool.h @@ -7,12 +7,12 @@ * 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 . * @@ -67,7 +67,7 @@ typedef struct ventoy_image_disk_region typedef struct ventoy_image_location { ventoy_guid guid; - + /* image sector size, currently this value is always 2048 */ uint32_t image_sector_size; @@ -75,12 +75,12 @@ typedef struct ventoy_image_location uint32_t disk_sector_size; uint32_t region_count; - + /* * disk region data - * If the image file has more than one fragments in disk, + * If the image file has more than one fragments in disk, * there will be more than one region data here. - * You can calculate the region count by + * You can calculate the region count by */ ventoy_image_disk_region regions[1]; @@ -99,7 +99,7 @@ typedef struct ventoy_os_param char vtoy_img_path[384]; // It seems to be enough, utf-8 format uint64_t vtoy_img_size; // image file size in bytes - /* + /* * Ventoy will write a copy of ventoy_image_location data into runtime memory * this is the physically address and length of that memory. * Address 0 means no such data exist. @@ -112,7 +112,7 @@ typedef struct ventoy_os_param uint8_t vtoy_reserved[32]; // Internal use by ventoy uint8_t vtoy_disk_signature[4]; - + uint8_t reserved[27]; }ventoy_os_param; diff --git a/VtoyTool/vtoyvine.c b/VtoyTool/vtoyvine.c index 33e299c6e2a..de39db8e4da 100644 --- a/VtoyTool/vtoyvine.c +++ b/VtoyTool/vtoyvine.c @@ -7,12 +7,12 @@ * 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 . * @@ -53,7 +53,7 @@ static int vine_patch_loader(unsigned char *buf, int len, int major) */ ptrlen = (buf[4] == 1) ? 4 : 8; - debug("ELF %d bit major:%d ptrlen:%d\n", (buf[4] == 1) ? 32 : 64, major, ptrlen); + debug("ELF %d bit major:%d ptrlen:%d\n", (buf[4] == 1) ? 32 : 64, major, ptrlen); for (i = 0; i < len - 8 - 8 - ptrlen; i++) { @@ -145,7 +145,7 @@ int vtoyvine_main(int argc, char **argv) fclose(fp); free(buf); - + return 0; } diff --git a/vtoycli/build.sh b/vtoycli/build.sh index a5468b53cfa..63011567dba 100644 --- a/vtoycli/build.sh +++ b/vtoycli/build.sh @@ -21,12 +21,12 @@ mips64el-linux-musl-gcc -mips64r2 -mabi=64 -static -O2 -D_FILE_OFFSET_BITS=64 $S 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 diff --git a/vtoycli/crc32.c b/vtoycli/crc32.c index 5f0f777836d..2313582a538 100644 --- a/vtoycli/crc32.c +++ b/vtoycli/crc32.c @@ -7,12 +7,12 @@ * 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 . * @@ -295,7 +295,7 @@ UINT32 VtoyCrc32(VOID *Buffer, UINT32 Length) UINT8 *Ptr = Buffer; UINT32 Crc = 0xFFFFFFFF; - for (i = 0; i < Length; i++, Ptr++) + for (i = 0; i < Length; i++, Ptr++) { Crc = (Crc >> 8) ^ g_crc_table[(UINT8) Crc ^ *Ptr]; } diff --git a/vtoycli/partresize.c b/vtoycli/partresize.c index d47618c9633..c4a3a1dd0fd 100644 --- a/vtoycli/partresize.c +++ b/vtoycli/partresize.c @@ -7,12 +7,12 @@ * 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 . * @@ -41,20 +41,20 @@ static GUID g_WindowsDataPartGuid = { 0xebd0a0a2, 0xb9e5, 0x4433, { 0x87, 0xc0, static int vtoy_disk_read(uint32 sector, uint8 *buffer, uint32 sector_count) { UINT64 offset = sector * 512ULL; - + lseek(g_disk_fd, g_disk_offset + offset, SEEK_SET); read(g_disk_fd, buffer, sector_count * 512); - + return 1; } static int vtoy_disk_write(uint32 sector, uint8 *buffer, uint32 sector_count) { UINT64 offset = sector * 512ULL; - + lseek(g_disk_fd, g_disk_offset + offset, SEEK_SET); write(g_disk_fd, buffer, sector_count * 512); - + return 1; } @@ -78,7 +78,7 @@ static int gpt_check(const char *disk) goto out; } memset(pGPT, 0, sizeof(VTOY_GPT_INFO)); - + read(fd, pGPT, sizeof(VTOY_GPT_INFO)); if (pGPT->MBR.PartTbl[0].FsFlag == 0xEE && memcmp(pGPT->Head.Signature, "EFI PART", 8) == 0) @@ -87,7 +87,7 @@ static int gpt_check(const char *disk) } out: - check_close(fd); + check_close(fd); check_free(pGPT); return rc; } @@ -112,7 +112,7 @@ static int part_check(const char *disk) printf("Failed to get disk size of %s\n", disk); goto out; } - + fd = open(disk, O_RDONLY); if (fd < 0) { @@ -126,7 +126,7 @@ static int part_check(const char *disk) goto out; } memset(pGPT, 0, sizeof(VTOY_GPT_INFO)); - + read(fd, pGPT, sizeof(VTOY_GPT_INFO)); if (pGPT->MBR.PartTbl[0].FsFlag == 0xEE && memcmp(pGPT->Head.Signature, "EFI PART", 8) == 0) @@ -181,7 +181,7 @@ static int part_check(const char *disk) } NextPartStart *= 512ULL; - printf("DiskSize:%llu NextPartStart:%llu(LBA:%llu) Index:%d\n", + printf("DiskSize:%llu NextPartStart:%llu(LBA:%llu) Index:%d\n", DiskSizeInBytes, NextPartStart, NextPartStart / 512ULL, Index); } else @@ -236,7 +236,7 @@ static int part_check(const char *disk) Part1Start *= 512ULL; Part1End *= 512ULL; - printf("Partition 1 start at: %llu %lluKB, end:%llu, NextPartStart:%llu\n", + printf("Partition 1 start at: %llu %lluKB, end:%llu, NextPartStart:%llu\n", Part1Start, Part1Start / 1024, Part1End, NextPartStart); if (Part1Start != SIZE_1MB) { @@ -263,7 +263,7 @@ static int part_check(const char *disk) } out: - check_close(fd); + check_close(fd); check_free(pGPT); return rc; } @@ -323,7 +323,7 @@ static int secureboot_proc(char *disk, UINT64 part2start) { fl_fwrite(filebuf, 1, size, file); } - + fl_fflush(file); fl_fclose(file); } @@ -355,7 +355,7 @@ static int secureboot_proc(char *disk, UINT64 part2start) fl_remove("/EFI/BOOT/BOOTIA32.EFI"); fl_remove("/EFI/BOOT/grubia32.efi"); fl_remove("/EFI/BOOT/grubia32_real.efi"); - fl_remove("/EFI/BOOT/mmia32.efi"); + fl_remove("/EFI/BOOT/mmia32.efi"); file = fl_fopen("/EFI/BOOT/BOOTIA32.EFI", "wb"); printf("Open bootia32 efi file %p\n", file); @@ -393,7 +393,7 @@ static int VentoyFillMBRLocation(UINT64 DiskSizeInBytes, UINT32 StartSectorId, U UINT8 Head; UINT8 Sector; UINT8 nSector = 63; - UINT8 nHead = 8; + UINT8 nHead = 8; UINT32 Cylinder; UINT32 EndSectorId; @@ -435,21 +435,21 @@ static int WriteDataToPhyDisk(int fd, UINT64 offset, void *buffer, int len) { ssize_t wrlen; off_t newseek; - + newseek = lseek(fd, offset, SEEK_SET); if (newseek != offset) { printf("Failed to lseek %llu %lld %d\n", offset, (long long)newseek, errno); return 0; } - + wrlen = write(fd, buffer, len); if ((int)wrlen != len) { printf("Failed to write %d %d %d\n", len, (int)wrlen, errno); return 0; } - + return 1; } @@ -462,7 +462,7 @@ static int VentoyFillBackupGptHead(VTOY_GPT_INFO *pInfo, VTOY_GPT_HDR *pHead) LBA = pHead->EfiStartLBA; BackupLBA = pHead->EfiBackupLBA; - + pHead->EfiStartLBA = BackupLBA; pHead->EfiBackupLBA = LBA; pHead->PartTblStartLBA = BackupLBA + 1 - 33; @@ -491,7 +491,7 @@ static int update_part_table(char *disk, UINT64 part2start) printf("Failed to get disk size of %s\n", disk); goto out; } - + fd = open(disk, O_RDWR); if (fd < 0) { @@ -507,7 +507,7 @@ static int update_part_table(char *disk, UINT64 part2start) memset(pGPT, 0, sizeof(VTOY_GPT_INFO) + sizeof(VTOY_GPT_HDR)); pBack = (VTOY_GPT_HDR *)(pGPT + 1); - + len = read(fd, pGPT, sizeof(VTOY_GPT_INFO)); if (len != (ssize_t)sizeof(VTOY_GPT_INFO)) { @@ -555,7 +555,7 @@ static int update_part_table(char *disk, UINT64 part2start) PartTbl[0].Active = 0x80; // bootable PartTbl[0].SectorCount = (UINT32)part2start - 2048; - + if (!WriteDataToPhyDisk(fd, 0, &(pGPT->MBR), 512)) { printf("MBR write MBR failed\n"); @@ -642,7 +642,7 @@ static int update_part_table(char *disk, UINT64 part2start) } out: - check_close(fd); + check_close(fd); check_free(pGPT); return rc; } @@ -650,7 +650,7 @@ static int update_part_table(char *disk, UINT64 part2start) int partresize_main(int argc, char **argv) { UINT64 sector; - + if (argc != 3 && argc != 4) { printf("usage: partresize -c/-f /dev/sdb\n"); @@ -668,7 +668,7 @@ int partresize_main(int argc, char **argv) } else if (strcmp(argv[1], "-p") == 0) { - sector = strtoull(argv[3], NULL, 10); + sector = strtoull(argv[3], NULL, 10); return update_part_table(argv[2], sector); } else if (strcmp(argv[1], "-t") == 0) diff --git a/vtoycli/vtoycli.c b/vtoycli/vtoycli.c index 3a9291764de..5e31db22f3a 100644 --- a/vtoycli/vtoycli.c +++ b/vtoycli/vtoycli.c @@ -7,12 +7,12 @@ * 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 . * diff --git a/vtoycli/vtoycli.h b/vtoycli/vtoycli.h index 006e1f30246..26e9ee75b7e 100644 --- a/vtoycli/vtoycli.h +++ b/vtoycli/vtoycli.h @@ -7,12 +7,12 @@ * 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 . * @@ -133,6 +133,6 @@ int vtoyfat_main(int argc, char **argv); int partresize_main(int argc, char **argv); void ventoy_gen_preudo_uuid(void *uuid); UINT64 get_disk_size_in_byte(const char *disk); - + #endif /* __VTOYCLI_H__ */ diff --git a/vtoycli/vtoyfat.c b/vtoycli/vtoyfat.c index 8f3225f326b..1ba2f240252 100644 --- a/vtoycli/vtoyfat.c +++ b/vtoycli/vtoyfat.c @@ -7,12 +7,12 @@ * 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 . * @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include @@ -34,21 +34,21 @@ static int vtoy_disk_read(uint32 sector, uint8 *buffer, uint32 sector_count) { lseek(g_disk_fd, sector * 512, SEEK_SET); read(g_disk_fd, buffer, sector_count * 512); - + return 1; } static int check_secure_boot(void) { void *flfile = NULL; - + flfile = fl_fopen("/EFI/BOOT/grubx64_real.efi", "rb"); if (flfile) { fl_fclose(flfile); return 0; } - + return 1; } @@ -111,24 +111,24 @@ int vtoyfat_main(int argc, char **argv) char *disk; if (argc != 2 && argc != 3) - { + { printf("Usage: vtoyfat /dev/sdbs \n"); printf("Usage: vtoyfat -s /dev/sdbs \n"); return 1; } - + if (argv[1][0] == '-' && argv[1][1] == 'T') { return 0; } - + disk = argv[1]; if (argv[1][0] == '-' && argv[1][1] == 's') { op = 1; disk = argv[2]; - } - + } + g_disk_fd = open(disk, O_RDONLY); if (g_disk_fd < 0) { @@ -147,7 +147,7 @@ int vtoyfat_main(int argc, char **argv) else { rc = check_secure_boot(); - } + } } fl_shutdown(); diff --git a/vtoycli/vtoygpt.c b/vtoycli/vtoygpt.c index f0e2e62a74f..f34a721cd02 100644 --- a/vtoycli/vtoygpt.c +++ b/vtoycli/vtoygpt.c @@ -7,12 +7,12 @@ * 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 . * @@ -46,7 +46,7 @@ void DumpHead(VTOY_GPT_HDR *pHead) { UINT32 CrcRead; UINT32 CrcCalc; - + printf("Signature:<%s>\n", pHead->Signature); printf("Version:<%02x %02x %02x %02x>\n", pHead->Version[0], pHead->Version[1], pHead->Version[2], pHead->Version[3]); printf("Length:%u\n", pHead->Length); @@ -56,7 +56,7 @@ void DumpHead(VTOY_GPT_HDR *pHead) printf("PartAreaStartLBA:%lu\n", pHead->PartAreaStartLBA); printf("PartAreaEndLBA:%lu\n", pHead->PartAreaEndLBA); DumpGuid("DiskGuid", &pHead->DiskGuid); - + printf("PartTblStartLBA:%lu\n", pHead->PartTblStartLBA); printf("PartTblTotNum:%u\n", pHead->PartTblTotNum); printf("PartTblEntryLen:%u\n", pHead->PartTblEntryLen); @@ -90,7 +90,7 @@ void DumpHead(VTOY_GPT_HDR *pHead) void DumpPartTable(VTOY_GPT_PART_TBL *Tbl) { int i; - + DumpGuid("PartType", &Tbl->PartType); DumpGuid("PartGuid", &Tbl->PartGuid); printf("StartLBA:%lu\n", Tbl->StartLBA); @@ -102,13 +102,13 @@ void DumpPartTable(VTOY_GPT_PART_TBL *Tbl) { printf("%c", (CHAR)(Tbl->Name[i])); } - printf("\n"); + printf("\n"); } void DumpMBR(MBR_HEAD *pMBR) { int i; - + for (i = 0; i < 4; i++) { printf("=========== Partition Table %d ============\n", i + 1); @@ -138,7 +138,7 @@ int DumpGptInfo(VTOY_GPT_INFO *pGptInfo) { break; } - + printf("=====Part %d=====\n", i); DumpPartTable(pGptInfo->PartTbl + i); } @@ -177,7 +177,7 @@ int vtoygpt_main(int argc, char **argv) } read(fd, pMainGptInfo, sizeof(VTOY_GPT_INFO)); - + if (argv[1][0] == '-' && argv[1][1] == 'd') { DumpGptInfo(pMainGptInfo); @@ -192,7 +192,7 @@ int vtoygpt_main(int argc, char **argv) if (Name[0] == 'V' && Name[1] == 'T' && Name[2] == 'O' && Name[3] == 'Y') { if (pMainGptInfo->PartTbl[1].Attr != VENTOY_EFI_PART_ATTR) - { + { pMainGptInfo->PartTbl[1].Attr = VENTOY_EFI_PART_ATTR; pMainGptInfo->Head.PartTblCrc = VtoyCrc32(pMainGptInfo->PartTbl, sizeof(pMainGptInfo->PartTbl)); pMainGptInfo->Head.Crc = 0; diff --git a/vtoyfat/build.sh b/vtoyfat/build.sh index acc4528cabd..1e6a31c7087 100644 --- a/vtoyfat/build.sh +++ b/vtoyfat/build.sh @@ -14,12 +14,12 @@ mips64el-linux-musl-gcc -mips64r2 -mabi=64 -static -O2 -D_FILE_OFFSET_BITS=64 vt if [ -e vtoyfat_64 ] && [ -e vtoyfat_32 ] && [ -e vtoyfat_aa64 ] && [ -e vtoyfat_m64e ]; then echo -e "\n===== success $name =======\n" - + strip --strip-all vtoyfat_32 strip --strip-all vtoyfat_64 aarch64-buildroot-linux-uclibc-strip --strip-all vtoyfat_aa64 mips64el-linux-musl-strip --strip-all vtoyfat_m64e - + [ -d ../INSTALL/tool/i386/ ] && mv vtoyfat_32 ../INSTALL/tool/i386/vtoyfat [ -d ../INSTALL/tool/x86_64/ ] && mv vtoyfat_64 ../INSTALL/tool/x86_64/vtoyfat [ -d ../INSTALL/tool/aarch64/ ] && mv vtoyfat_aa64 ../INSTALL/tool/aarch64/vtoyfat diff --git a/vtoyfat/vtoyfat_linux.c b/vtoyfat/vtoyfat_linux.c index 55e4e2b0d07..52122eea781 100644 --- a/vtoyfat/vtoyfat_linux.c +++ b/vtoyfat/vtoyfat_linux.c @@ -7,12 +7,12 @@ * 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 . * @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include @@ -34,21 +34,21 @@ static int vtoy_disk_read(uint32 sector, uint8 *buffer, uint32 sector_count) { lseek(g_disk_fd, sector * 512, SEEK_SET); read(g_disk_fd, buffer, sector_count * 512); - + return 1; } static int check_secure_boot(void) { void *flfile = NULL; - + flfile = fl_fopen("/EFI/BOOT/grubx64_real.efi", "rb"); if (flfile) { fl_fclose(flfile); return 0; } - + return 1; } @@ -111,24 +111,24 @@ int main(int argc, char **argv) char *disk; if (argc != 2 && argc != 3) - { + { printf("Usage: vtoyfat /dev/sdbs \n"); printf("Usage: vtoyfat -s /dev/sdbs \n"); return 1; } - + if (argv[1][0] == '-' && argv[1][1] == 'T') { return 0; } - + disk = argv[1]; if (argv[1][0] == '-' && argv[1][1] == 's') { op = 1; disk = argv[2]; - } - + } + g_disk_fd = open(disk, O_RDONLY); if (g_disk_fd < 0) { @@ -147,7 +147,7 @@ int main(int argc, char **argv) else { rc = check_secure_boot(); - } + } } fl_shutdown(); diff --git a/vtoygpt/build.sh b/vtoygpt/build.sh index 533331b2639..c30fda9d01d 100644 --- a/vtoygpt/build.sh +++ b/vtoygpt/build.sh @@ -18,13 +18,13 @@ if [ -e vtoygpt_64 ] && [ -e vtoygpt_32 ] && [ -e vtoygpt_aa64 ] && [ -e vtoygpt echo -e '\n############### SUCCESS ###############\n' mv vtoygpt_64 ../INSTALL/tool/x86_64/vtoygpt mv vtoygpt_32 ../INSTALL/tool/i386/vtoygpt - + aarch64-buildroot-linux-uclibc-strip --strip-all vtoygpt_aa64 mv vtoygpt_aa64 ../INSTALL/tool/aarch64/vtoygpt - + mips64el-linux-musl-strip --strip-all vtoygpt_m64e mv vtoygpt_m64e ../INSTALL/tool/mips64el/vtoygpt - + else echo -e '\n############### FAILED ################\n' exit 1 diff --git a/vtoygpt/crc32.c b/vtoygpt/crc32.c index 354372b89f7..2f9749a2872 100644 --- a/vtoygpt/crc32.c +++ b/vtoygpt/crc32.c @@ -7,12 +7,12 @@ * 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 . * @@ -305,7 +305,7 @@ UINT32 VtoyCrc32(VOID *Buffer, UINT32 Length) UINT8 *Ptr = Buffer; UINT32 Crc = 0xFFFFFFFF; - for (i = 0; i < Length; i++, Ptr++) + for (i = 0; i < Length; i++, Ptr++) { Crc = (Crc >> 8) ^ g_crc_table[(UINT8) Crc ^ *Ptr]; } diff --git a/vtoygpt/vtoygpt.c b/vtoygpt/vtoygpt.c index 97e4f0f8457..5838cbff6fc 100644 --- a/vtoygpt/vtoygpt.c +++ b/vtoygpt/vtoygpt.c @@ -7,12 +7,12 @@ * 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 . * @@ -144,7 +144,7 @@ void DumpHead(VTOY_GPT_HDR *pHead) { UINT32 CrcRead; UINT32 CrcCalc; - + printf("Signature:<%s>\n", pHead->Signature); printf("Version:<%02x %02x %02x %02x>\n", pHead->Version[0], pHead->Version[1], pHead->Version[2], pHead->Version[3]); printf("Length:%u\n", pHead->Length); @@ -154,7 +154,7 @@ void DumpHead(VTOY_GPT_HDR *pHead) printf("PartAreaStartLBA:%lu\n", pHead->PartAreaStartLBA); printf("PartAreaEndLBA:%lu\n", pHead->PartAreaEndLBA); DumpGuid("DiskGuid", &pHead->DiskGuid); - + printf("PartTblStartLBA:%lu\n", pHead->PartTblStartLBA); printf("PartTblTotNum:%u\n", pHead->PartTblTotNum); printf("PartTblEntryLen:%u\n", pHead->PartTblEntryLen); @@ -188,7 +188,7 @@ void DumpHead(VTOY_GPT_HDR *pHead) void DumpPartTable(VTOY_GPT_PART_TBL *Tbl) { int i; - + DumpGuid("PartType", &Tbl->PartType); DumpGuid("PartGuid", &Tbl->PartGuid); printf("StartLBA:%lu\n", Tbl->StartLBA); @@ -200,13 +200,13 @@ void DumpPartTable(VTOY_GPT_PART_TBL *Tbl) { printf("%c", (CHAR)(Tbl->Name[i])); } - printf("\n"); + printf("\n"); } void DumpMBR(MBR_HEAD *pMBR) { int i; - + for (i = 0; i < 4; i++) { printf("=========== Partition Table %d ============\n", i + 1); @@ -236,7 +236,7 @@ int DumpGptInfo(VTOY_GPT_INFO *pGptInfo) { break; } - + printf("=====Part %d=====\n", i); DumpPartTable(pGptInfo->PartTbl + i); } @@ -277,7 +277,7 @@ int main(int argc, const char **argv) } read(fd, pMainGptInfo, sizeof(VTOY_GPT_INFO)); - + if (argv[1][0] == '-' && argv[1][1] == 'd') { DumpGptInfo(pMainGptInfo); @@ -292,7 +292,7 @@ int main(int argc, const char **argv) if (Name[0] == 'V' && Name[1] == 'T' && Name[2] == 'O' && Name[3] == 'Y') { if (pMainGptInfo->PartTbl[1].Attr != VENTOY_EFI_PART_ATTR) - { + { pMainGptInfo->PartTbl[1].Attr = VENTOY_EFI_PART_ATTR; pMainGptInfo->Head.PartTblCrc = VtoyCrc32(pMainGptInfo->PartTbl, sizeof(pMainGptInfo->PartTbl)); pMainGptInfo->Head.Crc = 0; diff --git a/vtoyjump/vtoyjump/fat_io_lib/API.txt b/vtoyjump/vtoyjump/fat_io_lib/API.txt index 666cbe52df0..cca2ce4f6e0 100644 --- a/vtoyjump/vtoyjump/fat_io_lib/API.txt +++ b/vtoyjump/vtoyjump/fat_io_lib/API.txt @@ -14,7 +14,7 @@ void fl_attach_locks(void (*lock)(void), void (*unlock)(void)) int fl_attach_media(fn_diskio_read rd, fn_diskio_write wr) - This function is used to attach system specific disk/media access functions. + This function is used to attach system specific disk/media access functions. This should be done subsequent to calling fl_init() and fl_attach_locks() (if locking required). void fl_shutdown(void) diff --git a/vtoyjump/vtoyjump/fat_io_lib/Configuration.txt b/vtoyjump/vtoyjump/fat_io_lib/Configuration.txt index 370f1da6ccd..388eb38e581 100644 --- a/vtoyjump/vtoyjump/fat_io_lib/Configuration.txt +++ b/vtoyjump/vtoyjump/fat_io_lib/Configuration.txt @@ -9,7 +9,7 @@ FATFS_IS_LITTLE_ENDIAN [1/0] FATFS_MAX_LONG_FILENAME [260] By default, 260 characters (max LFN length). Increase this to support greater path depths. -FATFS_MAX_OPEN_FILES +FATFS_MAX_OPEN_FILES The more files you wish to have concurrently open, the greater this number should be. This increases the number of FL_FILE file structures in the library, each of these is around 1K in size (assuming 512 byte sectors). @@ -29,7 +29,7 @@ FAT_SECTOR_SIZE Sector size used by buffers. Most likely to be 512 bytes (standard for ATA/IDE). FAT_PRINTF - A define that allows the File IO library to print to console/stdout. + A define that allows the File IO library to print to console/stdout. Provide your own printf function if printf not available. FAT_CLUSTER_CACHE_ENTRIES diff --git a/vtoyjump/vtoyjump/fat_io_lib/History.txt b/vtoyjump/vtoyjump/fat_io_lib/History.txt index b0bdc90fc19..00356d2636a 100644 --- a/vtoyjump/vtoyjump/fat_io_lib/History.txt +++ b/vtoyjump/vtoyjump/fat_io_lib/History.txt @@ -13,12 +13,12 @@ V2.6.3 V2.6 - Basic support for FAT16 added (18-04-10). V2.5 - Code cleaned up. Many bugs fixed. Thread safety functions added. V2.x - Write support added as well as better stdio like API. -V1.0 - Rewrite of all code to enable multiple files to be opened and provides a +V1.0 - Rewrite of all code to enable multiple files to be opened and provides a better file API. - Also better string matching, and generally better C code than origonal + Also better string matching, and generally better C code than origonal version. -V0.1c - Fetch_ID_Max_LBA() function added to retrieve Drive infomation and stoping +V0.1c - Fetch_ID_Max_LBA() function added to retrieve Drive infomation and stoping the drive reads from addressing a sector that is out of range. -V0.1b - fopen(), fgetc(), fopenDIR() using new software stack for IDE and FAT32 +V0.1b - fopen(), fgetc(), fopenDIR() using new software stack for IDE and FAT32 access. V0.1a - First release (27/12/03); fopen(), fgetc() unbuffered reads. diff --git a/vtoyjump/vtoyjump/fat_io_lib/Media Access API.txt b/vtoyjump/vtoyjump/fat_io_lib/Media Access API.txt index 14ceed3a34d..b922a82a6db 100644 --- a/vtoyjump/vtoyjump/fat_io_lib/Media Access API.txt +++ b/vtoyjump/vtoyjump/fat_io_lib/Media Access API.txt @@ -8,7 +8,7 @@ Params: Buffer: Target buffer to read n sectors of data into. Sector_count: Number of sectors to read. -Return: +Return: int, 1 = success, 0 = failure. Description: @@ -24,7 +24,7 @@ Params: Buffer: Target buffer to write n sectors of data from. Sector_count: Number of sectors to write. -Return: +Return: int, 1 = success, 0 = failure. Description: diff --git a/vtoyjump/vtoyjump/fat_io_lib/example.c.txt b/vtoyjump/vtoyjump/fat_io_lib/example.c.txt index 340f0bdb915..8372fa68f33 100644 --- a/vtoyjump/vtoyjump/fat_io_lib/example.c.txt +++ b/vtoyjump/vtoyjump/fat_io_lib/example.c.txt @@ -55,7 +55,7 @@ void main() if (fl_attach_media(media_read, media_write) != FAT_INIT_OK) { printf("ERROR: Media attach failed\n"); - return; + return; } // List root directory diff --git a/wimboot/wimboot-2.7.3/src/cmdline.c b/wimboot/wimboot-2.7.3/src/cmdline.c index e070ccbca9c..6185aec5bfe 100644 --- a/wimboot/wimboot-2.7.3/src/cmdline.c +++ b/wimboot/wimboot-2.7.3/src/cmdline.c @@ -113,7 +113,7 @@ void process_cmdline ( char *cmdline ) { die("Too many vf\n"); snprintf(cmdline_vf_path[cmdline_vf_num], 64, "%s", value); cmdline_vf_num++; - }else if ( strcmp ( key, "pfsize" ) == 0 ) { + }else if ( strcmp ( key, "pfsize" ) == 0 ) { pfventoy_file_size = (file_size_pf)strtoul(value, &endp, 0); } else if ( strcmp ( key, "pfread" ) == 0 ) { pfventoy_file_read = (file_read_pf)strtoul(value, &endp, 0 ); @@ -146,6 +146,6 @@ void process_cmdline ( char *cmdline ) { } /* Show command line (after parsing "quiet" option) */ - DBG ( "Command line: \"%s\" vf=%d pfsize=%p pfread=%p\n", + DBG ( "Command line: \"%s\" vf=%d pfsize=%p pfread=%p\n", cmdline, cmdline_vf_num, pfventoy_file_size, pfventoy_file_read); } diff --git a/wimboot/wimboot-2.7.3/src/efifile.c b/wimboot/wimboot-2.7.3/src/efifile.c index 93353874e2b..40ab9cc4a92 100644 --- a/wimboot/wimboot-2.7.3/src/efifile.c +++ b/wimboot/wimboot-2.7.3/src/efifile.c @@ -156,7 +156,7 @@ void efi_extract ( EFI_HANDLE handle ) { *pos = 0; k = (int)strlen(cmdline_vf_path[i]); - + memset(wname, 0, sizeof(wname)); for (j = 0; j < k; j++) { diff --git a/wimboot/wimboot-2.7.3/src/ipxe/vsprintf.c b/wimboot/wimboot-2.7.3/src/ipxe/vsprintf.c index 5cc72310870..90005326e53 100644 --- a/wimboot/wimboot-2.7.3/src/ipxe/vsprintf.c +++ b/wimboot/wimboot-2.7.3/src/ipxe/vsprintf.c @@ -262,7 +262,7 @@ size_t vcprintf ( struct printf_context *ctx, const char *fmt, va_list args ) { intptr_t ptrval; ptrval = ( intptr_t ) va_arg ( args, void * ); - ptr = format_hex ( ptr, ptrval, width, + ptr = format_hex ( ptr, ptrval, width, ( ALT_FORM | LCASE ) ); } else if ( ( *fmt & ~0x20 ) == 'X' ) { unsigned long long hex; @@ -312,7 +312,7 @@ struct sputc_context { /** Buffer for formatted string (used by printf_sputc()) */ char *buf; /** Buffer length (used by printf_sputc()) */ - size_t max_len; + size_t max_len; }; /** @@ -444,8 +444,8 @@ int vprintf ( const char *fmt, va_list args ) { struct printf_context ctx; /* Hand off to vcprintf */ - ctx.handler = printf_putchar; - return vcprintf ( &ctx, fmt, args ); + ctx.handler = printf_putchar; + return vcprintf ( &ctx, fmt, args ); } /** diff --git a/wimboot/wimboot-2.7.3/src/vdisk.c b/wimboot/wimboot-2.7.3/src/vdisk.c index 7885a5b47da..d620218f26c 100644 --- a/wimboot/wimboot-2.7.3/src/vdisk.c +++ b/wimboot/wimboot-2.7.3/src/vdisk.c @@ -604,7 +604,7 @@ void vdisk_read ( uint64_t lba, unsigned int count, void *data ) { memset ( data, 0, ( frag_count * VDISK_SECTOR_SIZE ) ); } - /* Move to next fragment */ + /* Move to next fragment */ frag_start += frag_count; data += ( frag_count * VDISK_SECTOR_SIZE ); diff --git a/wimboot/wimboot-2.7.3/src/vdisk.h b/wimboot/wimboot-2.7.3/src/vdisk.h index 7cae51c74a1..eedb8f583ff 100644 --- a/wimboot/wimboot-2.7.3/src/vdisk.h +++ b/wimboot/wimboot-2.7.3/src/vdisk.h @@ -138,7 +138,7 @@ struct vdisk_partition { } __attribute__ (( packed )); /** Master Boot Record */ -struct vdisk_mbr { +struct vdisk_mbr { /** Code area */ uint8_t code[440]; /** Disk signature */ diff --git a/wimboot/wimboot-2.7.3/src/wim.h b/wimboot/wimboot-2.7.3/src/wim.h index 7ef95d6058a..acae465d392 100644 --- a/wimboot/wimboot-2.7.3/src/wim.h +++ b/wimboot/wimboot-2.7.3/src/wim.h @@ -27,7 +27,7 @@ * * The file format is documented in the document "Windows Imaging File * Format (WIM)", available from - * + * * http://www.microsoft.com/en-us/download/details.aspx?id=13096 * * The wimlib source code is also a useful reference.