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