mirror of
https://github.com/ventoy/Ventoy.git
synced 2026-04-09 07:16:18 +00:00
Compare commits
62 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
167c87402c | ||
|
|
d35b8431fe | ||
|
|
a1771bd9b8 | ||
|
|
ed61a955bf | ||
|
|
e7cf29fd9d | ||
|
|
b5d87d394a | ||
|
|
36da0e0f3d | ||
|
|
903fd7aa01 | ||
|
|
81728a817c | ||
|
|
f68d4a8076 | ||
|
|
f6c248e983 | ||
|
|
0906cd34fe | ||
|
|
d3b911d249 | ||
|
|
5c6e1c2446 | ||
|
|
3a97ab9165 | ||
|
|
6fe6231790 | ||
|
|
9564f125a7 | ||
|
|
e380575b91 | ||
|
|
0fd49126bd | ||
|
|
a466d787b8 | ||
|
|
ab5d00bafb | ||
|
|
450caa6654 | ||
|
|
ef93b55c91 | ||
|
|
4d7fcc26d4 | ||
|
|
3597f15814 | ||
|
|
f7e4a7a6ec | ||
|
|
65b88aabc5 | ||
|
|
c42abd33c2 | ||
|
|
af34df278f | ||
|
|
68fd17df5b | ||
|
|
628a72db2f | ||
|
|
a20ee878df | ||
|
|
3de3a36e9f | ||
|
|
06f164ef70 | ||
|
|
40fbc041ea | ||
|
|
935516ed49 | ||
|
|
a71d4513e4 | ||
|
|
82fef5314b | ||
|
|
052a0152e4 | ||
|
|
5fae0ca35f | ||
|
|
6482f2e7b3 | ||
|
|
bd8aebf166 | ||
|
|
3c05d55b8a | ||
|
|
92ed0c995e | ||
|
|
dc7e310828 | ||
|
|
67d7091255 | ||
|
|
2ab1474694 | ||
|
|
aa7a77df5a | ||
|
|
4790dedbb1 | ||
|
|
de085ba086 | ||
|
|
bb94ec6d6f | ||
|
|
b9892660b5 | ||
|
|
0e9d34422a | ||
|
|
c7c9c62ec7 | ||
|
|
9e13955af1 | ||
|
|
2dafe75509 | ||
|
|
6fbc08cfcb | ||
|
|
6034b25cba | ||
|
|
c5fd64d21c | ||
|
|
32fac72b5b | ||
|
|
022322c8fa | ||
|
|
96f11252d9 |
194
BLOB_List.md
Normal file
194
BLOB_List.md
Normal file
@@ -0,0 +1,194 @@
|
|||||||
|
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>BLOB</th>
|
||||||
|
<th>File Source</th>
|
||||||
|
<th>Desc</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr> <td>./BUSYBOX/chmod/vtchmod32</td> <td rowspan=5>build</td> <td rowspan=5>Build Instructions:<br/> ./BUSYBOX/chmod/build.sh</td> </tr>
|
||||||
|
<tr> <td>./BUSYBOX/chmod/vtchmod64</td> </tr>
|
||||||
|
<tr> <td>./BUSYBOX/chmod/vtchmod64_musl</td> </tr>
|
||||||
|
<tr> <td>./BUSYBOX/chmod/vtchmodaa64</td> </tr>
|
||||||
|
<tr> <td>./BUSYBOX/chmod/vtchmodm64e</td> </tr>
|
||||||
|
<tr> <td>./cryptsetup/veritysetup32</td> <td rowspan=2>build</td> <td rowspan=2>Build Instructions:<br/> ./cryptsetup/cryptsetup-build.txt</td> </tr>
|
||||||
|
<tr> <td>./cryptsetup/veritysetup64</td> </tr>
|
||||||
|
<tr> <td>./DMSETUP/dmsetup32</td> <td rowspan=4>build</td> <td rowspan=4>Build Instructions:<br/> ./DMSETUP/build.txt</td> </tr>
|
||||||
|
<tr> <td>./DMSETUP/dmsetup64</td> </tr>
|
||||||
|
<tr> <td>./DMSETUP/dmsetupaa64</td> </tr>
|
||||||
|
<tr> <td>./DMSETUP/dmsetupm64e</td> </tr>
|
||||||
|
<tr> <td>./FUSEISO/vtoy_fuse_iso_32</td> <td rowspan=3>build</td> <td rowspan=3>Build Instructions:<br/> ./FUSEISO/build.sh<br/>./FUSEISO/build_aarch64.sh<br/>./FUSEISO/build_libfuse.sh<br/>./FUSEISO/build_libfuse_aarch64.sh </td> </tr>
|
||||||
|
<tr> <td>./FUSEISO/vtoy_fuse_iso_64</td> </tr>
|
||||||
|
<tr> <td>./FUSEISO/vtoy_fuse_iso_aa64</td> </tr>
|
||||||
|
<tr> <td>./IMG/cpio_arm64/ventoy/busybox/a64</td> <td>build</td> <td>Build Instructions:<br/>./BUSYBOX/build.txt ash</td> </tr>
|
||||||
|
<tr> <td>./IMG/cpio_arm64/ventoy/busybox/vtchmodaa64</td> <td>build</td> <td>Same with ./BUSYBOX/chmod/vtchmodaa64<br/>Check the file hash to confirm</td> </tr>
|
||||||
|
<tr> <td>./IMG/cpio_arm64/ventoy/busybox/xzminidecaa64</td> <td>build</td> <td>Build Instructions:<br/>./DOC/BuildVentoyFromSource.txt 4.17</td> </tr>
|
||||||
|
<tr> <td>./IMG/cpio_arm64/ventoy/tool/lz4cataa64</td> <td>build</td> <td>Same with ./LZIP/lz4cataa64<br/>Check the file hash to confirm</td> </tr>
|
||||||
|
<tr> <td>./IMG/cpio_arm64/ventoy/tool/zstdcataa64</td> <td>build</td> <td>Same with ./ZSTD/zstdcataa64<br/>Check the file hash to confirm</td> </tr>
|
||||||
|
<tr> <td>./IMG/cpio_mips64/ventoy/busybox/m64</td> <td>build</td> <td>Build Instructions:<br/>./BUSYBOX/build.txt ash</td> </tr>
|
||||||
|
<tr> <td>./IMG/cpio_mips64/ventoy/busybox/vtchmodm64e</td> <td>build</td> <td>Same with ./BUSYBOX/chmod/vtchmodm64e<br/>Check the file hash to confirm</td> </tr>
|
||||||
|
<tr> <td>./IMG/cpio_mips64/ventoy/busybox/xzminidecm64e</td> <td>build</td> <td>Build Instructions:<br/>./DOC/BuildVentoyFromSource.txt 4.18</td> </tr>
|
||||||
|
<tr> <td>./IMG/cpio_mips64/ventoy/tool/lz4catm64e</td> <td>build</td> <td>Same with ./LZIP/lz4catm64e<br/>Check the file hash to confirm</td> </tr>
|
||||||
|
<tr> <td>./IMG/cpio_x86/ventoy/busybox/64h</td> <td>build</td> <td>Build Instructions:<br/>./BUSYBOX/build.txt ash</td> </tr>
|
||||||
|
<tr> <td>./IMG/cpio_x86/ventoy/busybox/ash</td> <td>upstream</td> <td>Download from BusyBox website.<br/>URL & File Hash documented in<br/> ./DOC/BuildVentoyFromSource.txt 5.4</td> </tr>
|
||||||
|
<tr> <td>./IMG/cpio_x86/ventoy/busybox/vtchmod32</td> <td>build</td> <td>Same with ./BUSYBOX/chmod/vtchmod32<br/>Check the file hash to confirm</td> </tr>
|
||||||
|
<tr> <td>./IMG/cpio_x86/ventoy/busybox/vtchmod64</td> <td>build</td> <td>Same with ./BUSYBOX/chmod/vtchmod64<br/>Check the file hash to confirm</td> </tr>
|
||||||
|
<tr> <td>./IMG/cpio_x86/ventoy/busybox/vtchmod64_musl</td> <td>build</td> <td>Same with ./BUSYBOX/chmod/vtchmod64_musl<br/>Check the file hash to confirm</td> </tr>
|
||||||
|
<tr> <td>./IMG/cpio_x86/ventoy/busybox/xzminidec32</td> <td>build</td> <td>Build Instructions:<br/>./DOC/BuildVentoyFromSource.txt 4.15</td> </tr>
|
||||||
|
<tr> <td>./IMG/cpio_x86/ventoy/busybox/xzminidec64</td> <td>build</td> <td>Build Instructions:<br/>./DOC/BuildVentoyFromSource.txt 4.16</td> </tr>
|
||||||
|
<tr> <td>./IMG/cpio_x86/ventoy/busybox/xzminidec64_musl</td> <td>build</td> <td>Build Instructions:<br/>./DOC/BuildVentoyFromSource.txt 4.16</td> </tr>
|
||||||
|
<tr> <td>./IMG/cpio_x86/ventoy/tool/ar</td> <td>upstream</td> <td>Download from BusyBox website.<br/>URL & File Hash documented in<br/> ./DOC/BuildVentoyFromSource.txt 5.2</td> </tr>
|
||||||
|
<tr> <td>./IMG/cpio_x86/ventoy/tool/inotifyd</td> <td>upstream</td> <td>Download from BusyBox website.<br/>URL & File Hash documented in<br/> ./DOC/BuildVentoyFromSource.txt 5.3</td> </tr>
|
||||||
|
<tr> <td>./IMG/cpio_x86/ventoy/tool/lz4cat</td> <td>upstream</td> <td>URL & File Hash documented in<br/> ./DOC/BuildVentoyFromSource.txt 5.1</td> </tr>
|
||||||
|
<tr> <td>./IMG/cpio_x86/ventoy/tool/lz4cat64</td> <td>build</td> <td>Build Instructions:<br/>./LZIP/buildlz4.txt</td> </tr>
|
||||||
|
<tr> <td>./IMG/cpio_x86/ventoy/tool/zstdcat</td> <td>build</td> <td>Same with ./ZSTD/zstdcat<br/>Check the file hash to confirm</td> </tr>
|
||||||
|
<tr> <td>./IMG/cpio_x86/ventoy/tool/zstdcat64</td> <td>build</td> <td>Same with ./ZSTD/zstdcat64<br/>Check the file hash to confirm</td> </tr>
|
||||||
|
<tr> <td>./INSTALL/EFI/BOOT/BOOTAA64.EFI</td> <td rowspan=4>build</td> <td rowspan=4>Build Instructions:<br/> ./DOC/BuildVentoyFromSource.txt 4.1-Build grub2</td> </tr>
|
||||||
|
<tr> <td>./INSTALL/EFI/BOOT/BOOTMIPS.EFI</td>
|
||||||
|
<tr> <td>./INSTALL/EFI/BOOT/grubia32_real.efi</td>
|
||||||
|
<tr> <td>./INSTALL/EFI/BOOT/grubx64_real.efi</td>
|
||||||
|
<tr> <td>./INSTALL/EFI/BOOT/grub.efi</td> <td rowspan=6>upstream</td> <td rowspan=6>https://github.com/ValdikSS/Super-UEFIinSecureBoot-Disk </td> </tr>
|
||||||
|
<tr> <td>./INSTALL/EFI/BOOT/BOOTIA32.EFI</td>
|
||||||
|
<tr> <td>./INSTALL/EFI/BOOT/BOOTX64.EFI</td>
|
||||||
|
<tr> <td>./INSTALL/EFI/BOOT/grubia32.efi</td>
|
||||||
|
<tr> <td>./INSTALL/EFI/BOOT/mmia32.efi</td>
|
||||||
|
<tr> <td>./INSTALL/EFI/BOOT/MokManager.efi</td>
|
||||||
|
<tr> <td>./INSTALL/tool/aarch64/ash</td> <td rowspan=12>build</td> <td rowspan=12>Build Instructions:<br/>./DOC/BUSYBOX/build.txt</td> </tr>
|
||||||
|
<tr> <td>./INSTALL/tool/aarch64/hexdump</td>
|
||||||
|
<tr> <td>./INSTALL/tool/aarch64/xzcat</td>
|
||||||
|
<tr> <td>./INSTALL/tool/i386/ash</td>
|
||||||
|
<tr> <td>./INSTALL/tool/i386/hexdump</td>
|
||||||
|
<tr> <td>./INSTALL/tool/i386/xzcat</td>
|
||||||
|
<tr> <td>./INSTALL/tool/mips64el/ash</td>
|
||||||
|
<tr> <td>./INSTALL/tool/mips64el/hexdump</td>
|
||||||
|
<tr> <td>./INSTALL/tool/mips64el/xzcat</td>
|
||||||
|
<tr> <td>./INSTALL/tool/x86_64/ash</td>
|
||||||
|
<tr> <td>./INSTALL/tool/x86_64/hexdump</td>
|
||||||
|
<tr> <td>./INSTALL/tool/x86_64/xzcat</td>
|
||||||
|
<tr> <td>./INSTALL/tool/aarch64/Ventoy2Disk.gtk3</td> <td rowspan=6>build</td> <td rowspan=6>Build Instructions:<br/>./LinuxGUI/build_gtk.sh</td> </tr>
|
||||||
|
<tr> <td>./INSTALL/tool/i386/Ventoy2Disk.gtk3</td>
|
||||||
|
<tr> <td>./INSTALL/tool/i386/Ventoy2Disk.gtk2</td>
|
||||||
|
<tr> <td>./INSTALL/tool/mips64el/Ventoy2Disk.gtk3</td>
|
||||||
|
<tr> <td>./INSTALL/tool/x86_64/Ventoy2Disk.gtk3</td>
|
||||||
|
<tr> <td>./INSTALL/tool/x86_64/Ventoy2Disk.gtk2</td>
|
||||||
|
<tr> <td>./INSTALL/tool/aarch64/Ventoy2Disk.qt5</td> <td rowspan=4>build</td> <td rowspan=4>Build Instructions:<br/>./LinuxGUI/build_qt.sh</td> </tr>
|
||||||
|
<tr> <td>./INSTALL/tool/i386/Ventoy2Disk.qt5</td>
|
||||||
|
<tr> <td>./INSTALL/tool/mips64el/Ventoy2Disk.qt5</td>
|
||||||
|
<tr> <td>./INSTALL/tool/x86_64/Ventoy2Disk.qt5</td>
|
||||||
|
<tr> <td>./INSTALL/tool/aarch64/Plugson</td> <td rowspan=4>build</td> <td rowspan=4>Build Instructions:<br/>./Plugson/build.sh</td> </tr>
|
||||||
|
<tr> <td>./INSTALL/tool/i386/Plugson</td>
|
||||||
|
<tr> <td>./INSTALL/tool/mips64el/Plugson</td>
|
||||||
|
<tr> <td>./INSTALL/tool/x86_64/Plugson</td>
|
||||||
|
<tr> <td>./INSTALL/tool/aarch64/V2DServer</td> <td rowspan=4>build</td> <td rowspan=4>Build Instructions:<br/>./LinuxGUI/build.sh</td> </tr>
|
||||||
|
<tr> <td>./INSTALL/tool/i386/V2DServer</td>
|
||||||
|
<tr> <td>./INSTALL/tool/mips64el/V2DServer</td>
|
||||||
|
<tr> <td>./INSTALL/tool/x86_64/V2DServer</td>
|
||||||
|
<tr> <td>./INSTALL/tool/aarch64/mkexfatfs</td> <td rowspan=9>build</td> <td rowspan=8>Build Instructions:<br/>./DOC/BuildVentoyFromSource.txt 4.9<br/>./ExFAT/buidexfat.sh<br/>./ExFAT/buidexfat_aarch64.sh<br/>./ExFAT/buidlibfuse.sh<br/>./ExFAT/buidlibfuse_aarch64.sh<br/></td> </tr>
|
||||||
|
<tr> <td>./INSTALL/tool/aarch64/mount.exfat-fuse</td>
|
||||||
|
<tr> <td>./INSTALL/tool/i386/mkexfatfs</td>
|
||||||
|
<tr> <td>./INSTALL/tool/i386/mount.exfat-fuse</td>
|
||||||
|
<tr> <td>./INSTALL/tool/mips64el/mkexfatfs</td>
|
||||||
|
<tr> <td>./INSTALL/tool/mips64el/mount.exfat-fuse</td>
|
||||||
|
<tr> <td>./INSTALL/tool/x86_64/mkexfatfs</td>
|
||||||
|
<tr> <td>./INSTALL/tool/x86_64/mkexfatfs_static</td>
|
||||||
|
<tr> <td>./INSTALL/tool/x86_64/mount.exfat-fuse</td>
|
||||||
|
<tr> <td>./INSTALL/tool/aarch64/vlnk</td> <td rowspan=4>build</td> <td rowspan=4>Build Instructions:<br/>./Vlnk/build.sh</td> </tr>
|
||||||
|
<tr> <td>./INSTALL/tool/i386/vlnk</td>
|
||||||
|
<tr> <td>./INSTALL/tool/mips64el/vlnk</td>
|
||||||
|
<tr> <td>./INSTALL/tool/x86_64/vlnk</td>
|
||||||
|
<tr> <td>./INSTALL/tool/aarch64/vtoycli</td> <td rowspan=4>build</td> <td rowspan=4>Build Instructions:<br/>./vtoycli/build.sh</td> </tr>
|
||||||
|
<tr> <td>./INSTALL/tool/i386/vtoycli</td>
|
||||||
|
<tr> <td>./INSTALL/tool/mips64el/vtoycli</td>
|
||||||
|
<tr> <td>./INSTALL/tool/x86_64/vtoycli</td>
|
||||||
|
<tr> <td>./INSTALL/ventoy/imdisk/32/imdisk.cpl</td> <td rowspan=6>upstream</td> <td rowspan=6>Download from imdisk project.<br/>URL & File Hash documented in<br/> ./DOC/BuildVentoyFromSource.txt 5.8</td> </tr>
|
||||||
|
<tr> <td>./INSTALL/ventoy/imdisk/32/imdisk.exe</td>
|
||||||
|
<tr> <td>./INSTALL/ventoy/imdisk/32/imdisk.sys</td>
|
||||||
|
<tr> <td>./INSTALL/ventoy/imdisk/64/imdisk.cpl</td>
|
||||||
|
<tr> <td>./INSTALL/ventoy/imdisk/64/imdisk.exe</td>
|
||||||
|
<tr> <td>./INSTALL/ventoy/imdisk/64/imdisk.sys</td>
|
||||||
|
<tr> <td>./INSTALL/ventoy/iso9660_aa64.efi</td> <td rowspan=6>build</td> <td rowspan=6>Build Instructions:<br/>./DOC/BuildVentoyFromSource.txt 4.17</td> </tr>
|
||||||
|
<tr> <td>./INSTALL/ventoy/udf_aa64.efi</td>
|
||||||
|
<tr> <td>./INSTALL/ventoy/iso9660_ia32.efi</td>
|
||||||
|
<tr> <td>./INSTALL/ventoy/udf_ia32.efi</td>
|
||||||
|
<tr> <td>./INSTALL/ventoy/iso9660_x64.efi</td>
|
||||||
|
<tr> <td>./INSTALL/ventoy/udf_x64.efi</td>
|
||||||
|
<tr> <td>./INSTALL/VentoyGUI.aarch64</td> <td rowspan=4>build</td> <td rowspan=4>Build Instructions:<br/>./LinuxGUI/build_gtk.sh</td> </tr>
|
||||||
|
<tr> <td>./INSTALL/VentoyGUI.i386</td>
|
||||||
|
<tr> <td>./INSTALL/VentoyGUI.mips64el</td>
|
||||||
|
<tr> <td>./INSTALL/VentoyGUI.x86_64</td>
|
||||||
|
<tr> <td>./INSTALL/Ventoy2Disk.exe</td> <td rowspan=4>build</td> <td rowspan=4>Build Instructions:<br/>./Ventoy2Disk/Ventoy2Disk.sln</td> </tr>
|
||||||
|
<tr> <td>./INSTALL/Ventoy2Disk_ARM.exe</td>
|
||||||
|
<tr> <td>./INSTALL/Ventoy2Disk_ARM64.exe</td>
|
||||||
|
<tr> <td>./INSTALL/Ventoy2Disk_X64.exe</td>
|
||||||
|
<tr> <td>./INSTALL/ventoy/vtoyjump32.exe</td> <td rowspan=2>build</td> <td rowspan=2>Build Instructions:<br/>./vtoyjump/vtoyjump.sln</td> </tr>
|
||||||
|
<tr> <td>./INSTALL/ventoy/vtoyjump64.exe</td>
|
||||||
|
<tr> <td>./INSTALL/ventoy/ventoy_aa64.efi</td> <td rowspan=6>build</td> <td rowspan=6>Build Instructions:<br/>./EDK2/buildedk.sh</td> </tr>
|
||||||
|
<tr> <td>./INSTALL/ventoy/ventoy_ia32.efi</td>
|
||||||
|
<tr> <td>./INSTALL/ventoy/ventoy_x64.efi</td>
|
||||||
|
<tr> <td>./INSTALL/ventoy/vtoyutil_aa64.efi</td>
|
||||||
|
<tr> <td>./INSTALL/ventoy/vtoyutil_ia32.efi</td>
|
||||||
|
<tr> <td>./INSTALL/ventoy/vtoyutil_x64.efi</td>
|
||||||
|
<tr> <td>./INSTALL/ventoy/ipxe.krn</td> <td>build</td> <td>Build Instructions:<br/>./IPXE/buildipxe.sh</td> </tr>
|
||||||
|
<tr> <td>./INSTALL/ventoy/memdisk</td> <td>upstream</td> <td>Download from syslinux project.<br/>URL & File Hash documented in<br/> ./DOC/BuildVentoyFromSource.txt 5.9</td> </tr>
|
||||||
|
<tr> <td>./LiveCD/ISO/EFI/boot/vmlinuz64</td> <td>upstream</td> <td>Download from TinyLinux website.<br/>URL & File Hash documented in<br/> ./DOC/BuildVentoyFromSource.txt 5.14</td> </tr>
|
||||||
|
<tr> <td>./LiveCDGUI/EXT/busybox-x86_64</td> <td>build</td> <td>Same with ./IMG/cpio_x86/ventoy/busybox/busybox64<br/>Check the file hash to confirm</td> </tr>
|
||||||
|
<tr> <td>./LiveCDGUI/GRUB/bootx64.efi</td> <td rowspan=2>build</td> <td rowspan=2>./DOC/BuildVentoyFromSource.txt 4.1-Build grub2</td> </tr>
|
||||||
|
<tr> <td>./LiveCD/GRUB/bootx64.efi</td>
|
||||||
|
<tr> <td>./LZIP/lunzip32</td> <td rowspan=3>build</td> <td rowspan=3>Build Instructions:<br/>./DOC/BuildVentoyFromSource.txt 4.19</td> </tr>
|
||||||
|
<tr> <td>./LZIP/lunzip64</td>
|
||||||
|
<tr> <td>./LZIP/lunzipaa64</td>
|
||||||
|
<tr> <td>./LZIP/lz4cat64</td> <td rowspan=3>build</td> <td rowspan=3>Build Instructions:<br/>./LZIP/buildlz4.txt</td> </tr>
|
||||||
|
<tr> <td>./LZIP/lz4cataa64</td>
|
||||||
|
<tr> <td>./LZIP/lz4catm64e</td>
|
||||||
|
<tr> <td>./Plugson/vs/VentoyPlugson/Release/VentoyPlugson.exe</td> <td rowspan=2>build</td> <td rowspan=2>Build Instructions:<br/>./Plugson/vs/VentoyPlugson/VentoyPlugson.sln</td> </tr>
|
||||||
|
<tr> <td>./Plugson/vs/VentoyPlugson/x64/Release/VentoyPlugson_X64.exe</td>
|
||||||
|
<tr> <td>./SQUASHFS/unsquashfs_32</td> <td rowspan=3>build</td> <td rowspan=3>Build Instructions:<br/>./SQUASHFS/build.sh</td> </tr>
|
||||||
|
<tr> <td>./SQUASHFS/unsquashfs_64</td>
|
||||||
|
<tr> <td>./SQUASHFS/unsquashfs_aa64</td>
|
||||||
|
<tr> <td>./Unix/ventoy_unix/DragonFly/sbin/dmsetup</td> <td>upstream</td> <td>Get from DragonFly ISO.<br/>URL & File Hash documented in<br/> ./DOC/BuildVentoyFromSource.txt 5.13</td> </tr>
|
||||||
|
<tr> <td>./Unix/ventoy_unix/DragonFly/sbin/init</td> <td>build</td> <td>Build Instructions:<br/>./Unix/ventoy_unix_src/DragonFly/build.sh</td> </tr>
|
||||||
|
<tr> <td>./VBLADE/vblade-master/vblade_32</td> <td rowspan=3>build</td> <td rowspan=3>Build Instructions:<br/>./VBLADE/vblade-master/build.sh</td> </tr>
|
||||||
|
<tr> <td>./VBLADE/vblade-master/vblade_64</td>
|
||||||
|
<tr> <td>./VBLADE/vblade-master/vblade_aa64</td>
|
||||||
|
<tr> <td>./Vlnk/vs/VentoyVlnk/Release/VentoyVlnk.exe</td> <td>build</td> <td>Build Instructions:<br/>./Vlnk/vs/VentoyVlnk/VentoyVlnk.sln</td> </tr>
|
||||||
|
<tr> <td>./VtoyTool/vtoytool/00/vtoytool_32</td> <td rowspan=6>build</td> <td rowspan=6>Build Instructions:<br/>./VtoyTool/build.sh</td> </tr>
|
||||||
|
<tr> <td>./VtoyTool/vtoytool/00/vtoytool_64</td>
|
||||||
|
<tr> <td>./VtoyTool/vtoytool/00/vtoytool_aa64</td>
|
||||||
|
<tr> <td>./VtoyTool/vtoytool/00/vtoytool_m64e</td>
|
||||||
|
<tr> <td>./VtoyTool/vtoytool/01/vtoytool_64</td>
|
||||||
|
<tr> <td>./VtoyTool/vtoytool/02/vtoytool_64</td>
|
||||||
|
<tr> <td>./ZSTD/zstdcat</td> <td rowspan=3>build</td> <td rowspan=3>Build Instructions:<br/>./ZSTD/build.txt</td> </tr>
|
||||||
|
<tr> <td>./ZSTD/zstdcat64</td>
|
||||||
|
<tr> <td>./ZSTD/zstdcataa64</td>
|
||||||
|
<tr> <td>./IMG/cpio_x86/ventoy/busybox/busybox32</td> <td rowspan=6>build</td> <td rowspan=6>Build Instructions:<br/>./BUSYBOX/build.txt full busybox</td> </tr>
|
||||||
|
<tr> <td>./IMG/cpio_x86/ventoy/busybox/busybox64</td>
|
||||||
|
<tr> <td>./IMG/cpio_x86/ventoy/busybox/xzcat32_musl</td>
|
||||||
|
<tr> <td>./IMG/cpio_x86/ventoy/busybox/xzcat64_musl</td>
|
||||||
|
<tr> <td>./IMG/cpio_arm64/ventoy/busybox/busyboxaa64</td>
|
||||||
|
<tr> <td>./IMG/cpio_mips64/ventoy/busybox/busyboxm64e</td>
|
||||||
|
<tr> <td>ISNTALL/ventoy/7z/64/7za.exe</td> <td rowspan=2>upstream</td> <td>Download from 7z project.<br/>URL & File Hash documented in<br/> ./DOC/BuildVentoyFromSource.txt 5.12</td> </tr>
|
||||||
|
<tr> <td>ISNTALL/ventoy/7z/32/7za.exe</td>
|
||||||
|
<tr> <td>./INSTALL/ventoy/wimboot.i386.efi</td> <td rowspan=2>build</td> <td rowspan=2>Build Instructions:<br/>./wimboot/build.sh</td> </tr>
|
||||||
|
<tr> <td>./INSTALL/ventoy/wimboot.x86_64</td>
|
||||||
|
<tr> <td> ./Unix/ventoy_unix/ClonOS/geom_ventoy_ko/13.x/64/geom_ventoy.ko</td> <td rowspan=18>build</td> <td rowspan=18>Build Instructions:<br/>./Unix/BuildUnixKmod.txt</td> </tr>
|
||||||
|
<tr> <td> ./Unix/ventoy_unix/FreeBSD/geom_ventoy_ko/10.x/32/geom_ventoy.ko</td></tr>
|
||||||
|
<tr> <td> ./Unix/ventoy_unix/FreeBSD/geom_ventoy_ko/10.x/64/geom_ventoy.ko</td></tr>
|
||||||
|
<tr> <td> ./Unix/ventoy_unix/FreeBSD/geom_ventoy_ko/11.x/32/geom_ventoy.ko</td></tr>
|
||||||
|
<tr> <td> ./Unix/ventoy_unix/FreeBSD/geom_ventoy_ko/11.x/64/geom_ventoy.ko</td></tr>
|
||||||
|
<tr> <td> ./Unix/ventoy_unix/FreeBSD/geom_ventoy_ko/12.x/32/geom_ventoy.ko</td></tr>
|
||||||
|
<tr> <td> ./Unix/ventoy_unix/FreeBSD/geom_ventoy_ko/12.x/64/geom_ventoy.ko</td></tr>
|
||||||
|
<tr> <td> ./Unix/ventoy_unix/FreeBSD/geom_ventoy_ko/13.x/32/geom_ventoy.ko</td></tr>
|
||||||
|
<tr> <td> ./Unix/ventoy_unix/FreeBSD/geom_ventoy_ko/13.x/64/geom_ventoy.ko</td></tr>
|
||||||
|
<tr> <td> ./Unix/ventoy_unix/FreeBSD/geom_ventoy_ko/14.x/32/geom_ventoy.ko</td></tr>
|
||||||
|
<tr> <td> ./Unix/ventoy_unix/FreeBSD/geom_ventoy_ko/14.x/64/geom_ventoy.ko</td></tr>
|
||||||
|
<tr> <td> ./Unix/ventoy_unix/FreeBSD/geom_ventoy_ko/9.x/32/geom_ventoy.ko</td></tr>
|
||||||
|
<tr> <td> ./Unix/ventoy_unix/FreeBSD/geom_ventoy_ko/9.x/64/geom_ventoy.ko</td></tr>
|
||||||
|
<tr> <td> ./Unix/ventoy_unix/MidnightBSD/geom_ventoy_ko/11.x/32/geom_ventoy.ko</td></tr>
|
||||||
|
<tr> <td> ./Unix/ventoy_unix/MidnightBSD/geom_ventoy_ko/11.x/64/geom_ventoy.ko</td></tr>
|
||||||
|
<tr> <td> ./Unix/ventoy_unix/MidnightBSD/geom_ventoy_ko/2.x/32/geom_ventoy.ko</td></tr>
|
||||||
|
<tr> <td> ./Unix/ventoy_unix/MidnightBSD/geom_ventoy_ko/2.x/64/geom_ventoy.ko</td></tr>
|
||||||
|
<tr> <td> ./Unix/ventoy_unix/pfSense/geom_ventoy_ko/14.x/64/geom_ventoy.ko</td></tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
|
|
||||||
obj-m += dm_patch.o
|
|
||||||
|
|
||||||
EXTRA_CFLAGS := -Wall
|
|
||||||
|
|
||||||
dm_patch-objs := dmpatch.o
|
|
||||||
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
|
|
||||||
obj-m += dm_patch_ibt.o
|
|
||||||
|
|
||||||
EXTRA_CFLAGS := -Wall -DVTOY_IBT -fcf-protection=branch -mindirect-branch-register
|
|
||||||
|
|
||||||
dm_patch_ibt-objs := dmpatch.o
|
|
||||||
|
|
||||||
@@ -1,632 +0,0 @@
|
|||||||
/******************************************************************************
|
|
||||||
* dmpatch.c ---- patch for device-mapper
|
|
||||||
*
|
|
||||||
* Copyright (c) 2021, longpanda <admin@ventoy.net>
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU General Public License as
|
|
||||||
* published by the Free Software Foundation; either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but
|
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <linux/init.h>
|
|
||||||
#include <linux/module.h>
|
|
||||||
#include <linux/kallsyms.h>
|
|
||||||
#include <linux/mutex.h>
|
|
||||||
#include <linux/mempool.h>
|
|
||||||
#include <linux/delay.h>
|
|
||||||
#include <linux/wait.h>
|
|
||||||
#include <linux/slab.h>
|
|
||||||
|
|
||||||
#define MAX_PATCH 4
|
|
||||||
|
|
||||||
#define magic_sig 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xBD, 0xBE, 0xBF
|
|
||||||
|
|
||||||
typedef int (*kprobe_reg_pf)(void *);
|
|
||||||
typedef void (*kprobe_unreg_pf)(void *);
|
|
||||||
typedef int (*printk_pf)(const char *fmt, ...);
|
|
||||||
typedef int (*set_memory_attr_pf)(unsigned long addr, int numpages);
|
|
||||||
|
|
||||||
#pragma pack(1)
|
|
||||||
typedef struct ko_param
|
|
||||||
{
|
|
||||||
unsigned char magic[16];
|
|
||||||
unsigned long struct_size;
|
|
||||||
unsigned long pgsize;
|
|
||||||
unsigned long printk_addr;
|
|
||||||
unsigned long ro_addr;
|
|
||||||
unsigned long rw_addr;
|
|
||||||
unsigned long reg_kprobe_addr;
|
|
||||||
unsigned long unreg_kprobe_addr;
|
|
||||||
unsigned long sym_get_addr;
|
|
||||||
unsigned long sym_get_size;
|
|
||||||
unsigned long sym_put_addr;
|
|
||||||
unsigned long sym_put_size;
|
|
||||||
unsigned long kv_major;
|
|
||||||
unsigned long ibt;
|
|
||||||
unsigned long kv_minor;
|
|
||||||
unsigned long blkdev_get_addr;
|
|
||||||
unsigned long blkdev_put_addr;
|
|
||||||
unsigned long bdev_open_addr;
|
|
||||||
unsigned long kv_subminor;
|
|
||||||
unsigned long bdev_file_open_addr;
|
|
||||||
unsigned long padding[1];
|
|
||||||
}ko_param;
|
|
||||||
|
|
||||||
#pragma pack()
|
|
||||||
|
|
||||||
static printk_pf kprintf = NULL;
|
|
||||||
static set_memory_attr_pf set_mem_ro = NULL;
|
|
||||||
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 =
|
|
||||||
{
|
|
||||||
{ magic_sig },
|
|
||||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
|
||||||
};
|
|
||||||
|
|
||||||
#if defined(CONFIG_X86_64)
|
|
||||||
#define PATCH_OP_POS1 3
|
|
||||||
#define CODE_MATCH1(code, i) \
|
|
||||||
(code[i] == 0x40 && code[i + 1] == 0x80 && code[i + 2] == 0xce && code[i + 3] == 0x80)
|
|
||||||
|
|
||||||
#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)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#elif defined(CONFIG_X86_32)
|
|
||||||
#define PATCH_OP_POS1 2
|
|
||||||
#define CODE_MATCH1(code, i) \
|
|
||||||
(code[i] == 0x80 && code[i + 1] == 0xca && code[i + 2] == 0x80 && code[i + 3] == 0xe8)
|
|
||||||
|
|
||||||
#define PATCH_OP_POS2 PATCH_OP_POS1
|
|
||||||
#define CODE_MATCH2 CODE_MATCH1
|
|
||||||
#define PATCH_OP_POS3 PATCH_OP_POS1
|
|
||||||
#define CODE_MATCH3 CODE_MATCH1
|
|
||||||
|
|
||||||
|
|
||||||
#else
|
|
||||||
#error "unsupported arch"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef VTOY_IBT
|
|
||||||
#ifdef CONFIG_X86_64
|
|
||||||
/* Using 64-bit values saves one instruction clearing the high half of low */
|
|
||||||
#define DECLARE_ARGS(val, low, high) unsigned long low, high
|
|
||||||
#define EAX_EDX_VAL(val, low, high) ((low) | (high) << 32)
|
|
||||||
#define EAX_EDX_RET(val, low, high) "=a" (low), "=d" (high)
|
|
||||||
#else
|
|
||||||
#define DECLARE_ARGS(val, low, high) unsigned long long val
|
|
||||||
#define EAX_EDX_VAL(val, low, high) (val)
|
|
||||||
#define EAX_EDX_RET(val, low, high) "=A" (val)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define EX_TYPE_WRMSR 8
|
|
||||||
#define EX_TYPE_RDMSR 9
|
|
||||||
#define MSR_IA32_S_CET 0x000006a2 /* kernel mode cet */
|
|
||||||
#define CET_ENDBR_EN (1ULL << 2)
|
|
||||||
|
|
||||||
/* Exception table entry */
|
|
||||||
#ifdef __ASSEMBLY__
|
|
||||||
|
|
||||||
#define _ASM_EXTABLE_TYPE(from, to, type) \
|
|
||||||
.pushsection "__ex_table","a" ; \
|
|
||||||
.balign 4 ; \
|
|
||||||
.long (from) - . ; \
|
|
||||||
.long (to) - . ; \
|
|
||||||
.long type ; \
|
|
||||||
.popsection
|
|
||||||
|
|
||||||
#else /* ! __ASSEMBLY__ */
|
|
||||||
|
|
||||||
#define _ASM_EXTABLE_TYPE(from, to, type) \
|
|
||||||
" .pushsection \"__ex_table\",\"a\"\n" \
|
|
||||||
" .balign 4\n" \
|
|
||||||
" .long (" #from ") - .\n" \
|
|
||||||
" .long (" #to ") - .\n" \
|
|
||||||
" .long " __stringify(type) " \n" \
|
|
||||||
" .popsection\n"
|
|
||||||
|
|
||||||
#endif /* __ASSEMBLY__ */
|
|
||||||
#endif /* VTOY_IBT */
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define vdebug(fmt, args...) if(kprintf) kprintf(KERN_ERR fmt, ##args)
|
|
||||||
|
|
||||||
static unsigned int g_claim_ptr = 0;
|
|
||||||
static unsigned char *g_get_patch[MAX_PATCH] = { NULL };
|
|
||||||
static unsigned char *g_put_patch[MAX_PATCH] = { NULL };
|
|
||||||
|
|
||||||
static int notrace dmpatch_kv_above(unsigned long Major, unsigned long Minor, unsigned long SubMinor)
|
|
||||||
{
|
|
||||||
if (g_ko_param.kv_major != Major)
|
|
||||||
{
|
|
||||||
return (g_ko_param.kv_major > Major) ? 1 : 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (g_ko_param.kv_minor != Minor)
|
|
||||||
{
|
|
||||||
return (g_ko_param.kv_minor > Minor) ? 1 : 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (g_ko_param.kv_subminor != SubMinor)
|
|
||||||
{
|
|
||||||
return (g_ko_param.kv_subminor > SubMinor) ? 1 : 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void notrace dmpatch_restore_code(int bytes, unsigned char *opCode, unsigned int code)
|
|
||||||
{
|
|
||||||
unsigned long align;
|
|
||||||
|
|
||||||
if (opCode)
|
|
||||||
{
|
|
||||||
align = (unsigned long)opCode / g_ko_param.pgsize * g_ko_param.pgsize;
|
|
||||||
set_mem_rw(align, 1);
|
|
||||||
if (bytes == 1)
|
|
||||||
{
|
|
||||||
*opCode = (unsigned char)code;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
*(unsigned int *)opCode = code;
|
|
||||||
}
|
|
||||||
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 char **patch
|
|
||||||
)
|
|
||||||
{
|
|
||||||
int i = 0;
|
|
||||||
int cnt = 0;
|
|
||||||
unsigned long align;
|
|
||||||
unsigned char *opCode = (unsigned char *)addr;
|
|
||||||
|
|
||||||
vdebug("patch for %s style[%d] 0x%lx %d\n", desc, style, addr, (int)size);
|
|
||||||
|
|
||||||
for (i = 0; i < (int)size - 8; i++)
|
|
||||||
{
|
|
||||||
if (style == 1)
|
|
||||||
{
|
|
||||||
if (CODE_MATCH1(opCode, i) && cnt < MAX_PATCH)
|
|
||||||
{
|
|
||||||
patch[cnt] = opCode + i + PATCH_OP_POS1;
|
|
||||||
cnt++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (style == 2)
|
|
||||||
{
|
|
||||||
if (CODE_MATCH2(opCode, i) && cnt < MAX_PATCH)
|
|
||||||
{
|
|
||||||
patch[cnt] = opCode + i + PATCH_OP_POS2;
|
|
||||||
cnt++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (style == 3)
|
|
||||||
{
|
|
||||||
if (CODE_MATCH3(opCode, i) && cnt < MAX_PATCH)
|
|
||||||
{
|
|
||||||
patch[cnt] = opCode + i + PATCH_OP_POS3;
|
|
||||||
cnt++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (cnt != expect || cnt >= MAX_PATCH)
|
|
||||||
{
|
|
||||||
vdebug("patch error: cnt=%d expect=%d\n", cnt, expect);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
for (i = 0; i < cnt; i++)
|
|
||||||
{
|
|
||||||
opCode = patch[i];
|
|
||||||
align = (unsigned long)opCode / g_ko_param.pgsize * g_ko_param.pgsize;
|
|
||||||
|
|
||||||
set_mem_rw(align, 1);
|
|
||||||
*opCode = 0;
|
|
||||||
set_mem_ro(align, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static unsigned long notrace dmpatch_find_call_offset(unsigned long addr, unsigned long size, unsigned long func)
|
|
||||||
{
|
|
||||||
unsigned long i = 0;
|
|
||||||
unsigned long dest;
|
|
||||||
unsigned char *opCode = NULL;
|
|
||||||
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)
|
|
||||||
{
|
|
||||||
aucOffset[0] = opCode[i + 1];
|
|
||||||
aucOffset[1] = opCode[i + 2];
|
|
||||||
aucOffset[2] = opCode[i + 3];
|
|
||||||
aucOffset[3] = opCode[i + 4];
|
|
||||||
|
|
||||||
dest = addr + i + 5 + *(unsigned long *)aucOffset;
|
|
||||||
if (dest == func)
|
|
||||||
{
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static unsigned int notrace dmpatch_patch_claim_ptr(void)
|
|
||||||
{
|
|
||||||
unsigned long i = 0;
|
|
||||||
unsigned long t = 0;
|
|
||||||
unsigned long offset1 = 0;
|
|
||||||
unsigned long offset2 = 0;
|
|
||||||
unsigned long align = 0;
|
|
||||||
unsigned char *opCode = NULL;
|
|
||||||
|
|
||||||
opCode = (unsigned char *)g_ko_param.sym_get_addr;
|
|
||||||
for (i = 0; i < 4; i++)
|
|
||||||
{
|
|
||||||
vdebug("%02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X\n",
|
|
||||||
opCode[i + 0], opCode[i + 1], opCode[i + 2], opCode[i + 3],
|
|
||||||
opCode[i + 4], opCode[i + 5], opCode[i + 6], opCode[i + 7],
|
|
||||||
opCode[i + 8], opCode[i + 9], opCode[i + 10], opCode[i + 11],
|
|
||||||
opCode[i + 12], opCode[i + 13], opCode[i + 14], opCode[i + 15]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (dmpatch_kv_above(6, 7, 0)) /* >= 6.7 kernel */
|
|
||||||
{
|
|
||||||
vdebug("Get addr: 0x%lx %lu open 0x%lx\n", g_ko_param.sym_get_addr, g_ko_param.sym_get_size, g_ko_param.bdev_open_addr);
|
|
||||||
offset1 = dmpatch_find_call_offset(g_ko_param.sym_get_addr, g_ko_param.sym_get_size, g_ko_param.bdev_open_addr);
|
|
||||||
if (offset1 == 0)
|
|
||||||
{
|
|
||||||
vdebug("call bdev_open_addr Not found\n");
|
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
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);
|
|
||||||
|
|
||||||
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);
|
|
||||||
if (offset1 == 0 || offset2 == 0)
|
|
||||||
{
|
|
||||||
vdebug("call blkdev_get or blkdev_put Not found, %lu %lu\n", offset1, offset2);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
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++)
|
|
||||||
{
|
|
||||||
/* rdx */
|
|
||||||
if (opCode[i] == 0x48 && opCode[i + 1] == 0xc7 && opCode[i + 2] == 0xc2)
|
|
||||||
{
|
|
||||||
g_claim_ptr = *(unsigned int *)(opCode + i + 3);
|
|
||||||
g_get_patch[0] = opCode + i + 3;
|
|
||||||
vdebug("claim_ptr(%08X) found at get addr 0x%lx\n", g_claim_ptr, g_ko_param.sym_get_addr + i + 3);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (g_claim_ptr == 0)
|
|
||||||
{
|
|
||||||
vdebug("Claim_ptr not found in get\n");
|
|
||||||
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);
|
|
||||||
|
|
||||||
|
|
||||||
if (offset2 > 0)
|
|
||||||
{
|
|
||||||
opCode = (unsigned char *)g_ko_param.sym_put_addr;
|
|
||||||
for (i = offset2 - 1, t = 0; (i > 0) && (t < 24); i--, t++)
|
|
||||||
{
|
|
||||||
/* rsi */
|
|
||||||
if (opCode[i] == 0x48 && opCode[i + 1] == 0xc7 && opCode[i + 2] == 0xc6)
|
|
||||||
{
|
|
||||||
if (*(unsigned int *)(opCode + i + 3) == g_claim_ptr)
|
|
||||||
{
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef VTOY_IBT
|
|
||||||
static __always_inline unsigned long long dmpatch_rdmsr(unsigned int msr)
|
|
||||||
{
|
|
||||||
DECLARE_ARGS(val, low, high);
|
|
||||||
|
|
||||||
asm volatile("1: rdmsr\n"
|
|
||||||
"2:\n"
|
|
||||||
_ASM_EXTABLE_TYPE(1b, 2b, EX_TYPE_RDMSR)
|
|
||||||
: EAX_EDX_RET(val, low, high) : "c" (msr));
|
|
||||||
|
|
||||||
return EAX_EDX_VAL(val, low, high);
|
|
||||||
}
|
|
||||||
|
|
||||||
static __always_inline void dmpatch_wrmsr(unsigned int msr, u32 low, u32 high)
|
|
||||||
{
|
|
||||||
asm volatile("1: wrmsr\n"
|
|
||||||
"2:\n"
|
|
||||||
_ASM_EXTABLE_TYPE(1b, 2b, EX_TYPE_WRMSR)
|
|
||||||
: : "c" (msr), "a"(low), "d" (high) : "memory");
|
|
||||||
}
|
|
||||||
|
|
||||||
static u64 notrace dmpatch_ibt_save(void)
|
|
||||||
{
|
|
||||||
u64 msr = 0;
|
|
||||||
u64 val = 0;
|
|
||||||
|
|
||||||
msr = dmpatch_rdmsr(MSR_IA32_S_CET);
|
|
||||||
val = msr & ~CET_ENDBR_EN;
|
|
||||||
dmpatch_wrmsr(MSR_IA32_S_CET, (u32)(val & 0xffffffffULL), (u32)(val >> 32));
|
|
||||||
|
|
||||||
return msr;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void notrace dmpatch_ibt_restore(u64 save)
|
|
||||||
{
|
|
||||||
u64 msr;
|
|
||||||
|
|
||||||
msr = dmpatch_rdmsr(MSR_IA32_S_CET);
|
|
||||||
|
|
||||||
msr &= ~CET_ENDBR_EN;
|
|
||||||
msr |= (save & CET_ENDBR_EN);
|
|
||||||
|
|
||||||
dmpatch_wrmsr(MSR_IA32_S_CET, (u32)(msr & 0xffffffffULL), (u32)(msr >> 32));
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
static u64 notrace dmpatch_ibt_save(void) { return 0; }
|
|
||||||
static void notrace dmpatch_ibt_restore(u64 save) { (void)save; }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static int notrace dmpatch_process(unsigned long a, unsigned long b, unsigned long c)
|
|
||||||
{
|
|
||||||
int r = 0;
|
|
||||||
int rc = 0;
|
|
||||||
unsigned long kv_major = 0;
|
|
||||||
unsigned long kv_minor = 0;
|
|
||||||
unsigned long kv_subminor = 0;
|
|
||||||
|
|
||||||
vdebug("dmpatch_process as KV %d.%d.%d ...\n", (int)a, (int)b, (int)c);
|
|
||||||
|
|
||||||
kv_major = g_ko_param.kv_major;
|
|
||||||
kv_minor = g_ko_param.kv_minor;
|
|
||||||
kv_subminor = g_ko_param.kv_subminor;
|
|
||||||
|
|
||||||
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");
|
|
||||||
r = dmpatch_patch_claim_ptr();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
r = dmpatch_replace_code(1, g_ko_param.sym_get_addr, g_ko_param.sym_get_size, 2, "dm_get_table_device", g_get_patch);
|
|
||||||
if (r && g_ko_param.kv_major >= 5)
|
|
||||||
{
|
|
||||||
vdebug("new2 patch dm_get_table_device...\n");
|
|
||||||
r = dmpatch_replace_code(2, g_ko_param.sym_get_addr, g_ko_param.sym_get_size, 1, "dm_get_table_device", g_get_patch);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (r && g_ko_param.kv_major >= 5)
|
|
||||||
{
|
|
||||||
vdebug("new3 patch dm_get_table_device...\n");
|
|
||||||
r = dmpatch_replace_code(3, g_ko_param.sym_get_addr, g_ko_param.sym_get_size, 1, "dm_get_table_device", g_get_patch);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (r)
|
|
||||||
{
|
|
||||||
rc = -EFAULT;
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
vdebug("patch dm_get_table_device success\n");
|
|
||||||
|
|
||||||
if (dmpatch_kv_above(6, 5, 0))
|
|
||||||
{
|
|
||||||
r = 0;
|
|
||||||
}
|
|
||||||
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);
|
|
||||||
if (r)
|
|
||||||
{
|
|
||||||
rc = -EFAULT;
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
vdebug("patch dm_put_table_device success\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
vdebug("#####################################\n");
|
|
||||||
vdebug("######## dm patch success ###########\n");
|
|
||||||
vdebug("#####################################\n");
|
|
||||||
|
|
||||||
out:
|
|
||||||
|
|
||||||
g_ko_param.kv_major = kv_major;
|
|
||||||
g_ko_param.kv_minor = kv_minor;
|
|
||||||
g_ko_param.kv_subminor = kv_subminor;
|
|
||||||
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
|
|
||||||
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",
|
|
||||||
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 ||
|
|
||||||
g_ko_param.ro_addr == 0 || g_ko_param.rw_addr == 0)
|
|
||||||
{
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
set_mem_ro = (set_memory_attr_pf)(g_ko_param.ro_addr);
|
|
||||||
set_mem_rw = (set_memory_attr_pf)(g_ko_param.rw_addr);
|
|
||||||
reg_kprobe = (kprobe_reg_pf)g_ko_param.reg_kprobe_addr;
|
|
||||||
unreg_kprobe = (kprobe_unreg_pf)g_ko_param.unreg_kprobe_addr;
|
|
||||||
|
|
||||||
rc = dmpatch_process(g_ko_param.kv_major, g_ko_param.kv_minor, g_ko_param.kv_subminor);
|
|
||||||
if (rc)
|
|
||||||
{
|
|
||||||
if (g_ko_param.kv_major >= 5)
|
|
||||||
{
|
|
||||||
rc = dmpatch_process(6, 5, 0);
|
|
||||||
if (rc)
|
|
||||||
{
|
|
||||||
rc = dmpatch_process(6, 7, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (g_ko_param.ibt == 0x8888)
|
|
||||||
{
|
|
||||||
dmpatch_ibt_restore(msr);
|
|
||||||
}
|
|
||||||
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void notrace dmpatch_exit(void)
|
|
||||||
{
|
|
||||||
int i = 0;
|
|
||||||
u64 msr;
|
|
||||||
|
|
||||||
if (g_ko_param.ibt == 0x8888)
|
|
||||||
{
|
|
||||||
msr = dmpatch_ibt_save();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (g_claim_ptr)
|
|
||||||
{
|
|
||||||
dmpatch_restore_code(4, g_get_patch[0], g_claim_ptr);
|
|
||||||
if (g_put_patch[0])
|
|
||||||
{
|
|
||||||
dmpatch_restore_code(4, g_put_patch[0], g_claim_ptr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
for (i = 0; i < MAX_PATCH; i++)
|
|
||||||
{
|
|
||||||
dmpatch_restore_code(1, g_get_patch[i], 0x80);
|
|
||||||
dmpatch_restore_code(1, g_put_patch[i], 0x80);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
vdebug("dmpatch_exit success\n");
|
|
||||||
|
|
||||||
if (g_ko_param.ibt == 0x8888)
|
|
||||||
{
|
|
||||||
dmpatch_ibt_restore(msr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
module_init(dmpatch_init);
|
|
||||||
module_exit(dmpatch_exit);
|
|
||||||
|
|
||||||
|
|
||||||
MODULE_DESCRIPTION("dmpatch driver");
|
|
||||||
MODULE_AUTHOR("longpanda <admin@ventoy.net>");
|
|
||||||
MODULE_LICENSE("GPL");
|
|
||||||
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
1. install ubuntu 22.04 5.15.0-25
|
|
||||||
2. apt-get install build-essential flex libncurses-dev linux-headers-generic linux-source libssl-dev bison yacc vim libelf-dev ...... and so on
|
|
||||||
3. cp /lib/modules/5.15.0-25-generic/build/Module.symvers ./
|
|
||||||
4. /boot/config-5.15.0-25-generic as .config make oldconfig
|
|
||||||
5. make menuconfig
|
|
||||||
1. close CONFIG_STACKPROTECTOR
|
|
||||||
2. close CONFIG_RETPOLINE
|
|
||||||
3. close CONFIG_UBSAN_BOUNDS
|
|
||||||
4. close CONFIG_UBSAN_ENUM
|
|
||||||
|
|
||||||
6. modify ./scripts/mod/modpost.c
|
|
||||||
1. skip add_srcversion (just return)
|
|
||||||
2. force add_retpoline (#ifdef --> #ifndef)
|
|
||||||
3. force add_intree_flag
|
|
||||||
|
|
||||||
7. make modules_prepare LOCALVERSION=-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
|
||||||
|
|
||||||
8. Append padding at the end of struct module <include/linux/module.h>
|
|
||||||
struct module {
|
|
||||||
enum module_state state;
|
|
||||||
|
|
||||||
/* Member of list of modules */
|
|
||||||
struct list_head list;
|
|
||||||
|
|
||||||
/* Unique handle for this module */
|
|
||||||
char name[MODULE_NAME_LEN];
|
|
||||||
|
|
||||||
....
|
|
||||||
|
|
||||||
char padding[1024];
|
|
||||||
};
|
|
||||||
|
|
||||||
This is because struct module size is different in different kernel versions or with different CONFIG item.
|
|
||||||
|
|
||||||
|
|
||||||
9. make modules M=/home/dmpatch
|
|
||||||
10. strip --strip-debug /home/dmpatch/dm_patch.ko
|
|
||||||
|
|
||||||
@@ -1,65 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
FTPIP=192.168.44.1
|
|
||||||
FTPUSR='a:a'
|
|
||||||
|
|
||||||
rm -f dmpatch.c Makefile Makefile_IBT
|
|
||||||
|
|
||||||
for f in dmpatch.c Makefile Makefile_IBT; do
|
|
||||||
curl -s -u $FTPUSR ftp://$FTPIP/$f -o $f
|
|
||||||
if [ -f $f ]; then
|
|
||||||
echo "download $f OK ..."
|
|
||||||
else
|
|
||||||
echo "download $f FAILED ..."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
rm -f *.ko
|
|
||||||
|
|
||||||
|
|
||||||
echo "build dm_patch.ko ..."
|
|
||||||
rm -rf ./aa
|
|
||||||
mkdir ./aa
|
|
||||||
|
|
||||||
cp -a *.c aa/
|
|
||||||
cp -a Makefile aa/
|
|
||||||
|
|
||||||
cd /home/panda/linux-source-5.15.0
|
|
||||||
make modules M=/home/panda/build/aa/
|
|
||||||
strip --strip-debug /home/panda/build/aa/dm_patch.ko
|
|
||||||
cd -
|
|
||||||
|
|
||||||
cp -a aa/dm_patch.ko ./
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
echo "build dm_patch_ibt.ko ..."
|
|
||||||
rm -rf ./aa
|
|
||||||
mkdir ./aa
|
|
||||||
|
|
||||||
cp -a *.c aa/
|
|
||||||
cp -a Makefile_IBT aa/Makefile
|
|
||||||
|
|
||||||
cd /home/panda/linux-source-5.15.0
|
|
||||||
make modules M=/home/panda/build/aa/
|
|
||||||
strip --strip-debug /home/panda/build/aa/dm_patch_ibt.ko
|
|
||||||
cd -
|
|
||||||
|
|
||||||
cp -a aa/dm_patch_ibt.ko ./
|
|
||||||
|
|
||||||
rm -rf ./aa
|
|
||||||
|
|
||||||
|
|
||||||
curl -s -T dm_patch.ko -u $FTPUSR ftp://$FTPIP/dm_patch_64.ko || exit 1
|
|
||||||
curl -s -T dm_patch_ibt.ko -u $FTPUSR ftp://$FTPIP/dm_patch_ibt_64.ko || exit 1
|
|
||||||
|
|
||||||
|
|
||||||
if [ -f ./dm_patch.ko -a -f ./dm_patch_ibt.ko ]; then
|
|
||||||
echo -e "\n\n=============== SUCCESS =============\n\n"
|
|
||||||
else
|
|
||||||
echo -e "\n\n=============== FAILED ==============\n\n"
|
|
||||||
fi
|
|
||||||
|
|
||||||
@@ -159,12 +159,12 @@
|
|||||||
make -f ventoy_makefile
|
make -f ventoy_makefile
|
||||||
strip --strip-all xzminidec
|
strip --strip-all xzminidec
|
||||||
|
|
||||||
4.16 == Build xzminidec64 ==
|
4.16 == Build xzminidec64/xzminidec64_musl ==
|
||||||
cd /home/Ventoy-master/Ventoy2Disk/Ventoy2Disk/xz-embedded-20130513/userspace
|
cd /home/Ventoy-master/Ventoy2Disk/Ventoy2Disk/xz-embedded-20130513/userspace
|
||||||
make -f ventoy_makefile64
|
make -f ventoy_makefile64 or make -f ventoy_makefile64_musl
|
||||||
strip --strip-all xzminidec
|
strip --strip-all xzminidec
|
||||||
|
|
||||||
4.17 == Build iso9660_x64.efi ==
|
4.17 == Build iso9660_x64.efi/udf_x64.efi/iso9660_ia32.efi/udf_ia32.efi/iso9660_aa64.efi/udf_aa64.efi/ ==
|
||||||
This efi driver is from https://github.com/pbatard/efifs
|
This efi driver is from https://github.com/pbatard/efifs
|
||||||
Follow all the build instructions in this project. I modified 3 files (the original and modified source are at /home/Ventoy-master/EDK2/efiffs)
|
Follow all the build instructions in this project. I modified 3 files (the original and modified source are at /home/Ventoy-master/EDK2/efiffs)
|
||||||
|
|
||||||
@@ -185,6 +185,16 @@
|
|||||||
make
|
make
|
||||||
aarch64-buildroot-linux-uclibc-strip --strip-all lunzip
|
aarch64-buildroot-linux-uclibc-strip --strip-all lunzip
|
||||||
|
|
||||||
|
4.17 == Build xzminidecaa64 ==
|
||||||
|
cd /home/Ventoy-master/Ventoy2Disk/Ventoy2Disk/xz-embedded-20130513/userspace
|
||||||
|
make -f ventoy_makefileaa64
|
||||||
|
strip --strip-all xzminidec
|
||||||
|
|
||||||
|
4.18 == Build xzminidecm64e ==
|
||||||
|
cd /home/Ventoy-master/Ventoy2Disk/Ventoy2Disk/xz-embedded-20130513/userspace
|
||||||
|
make -f ventoy_makefilem64e
|
||||||
|
strip --strip-all xzminidec
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
==========================================
|
==========================================
|
||||||
@@ -222,7 +232,7 @@
|
|||||||
SHA-256: cde08b6a2cf5ad914f05203e18e3f7c2ed6060a63604e3d75536f19b55e8e0af
|
SHA-256: cde08b6a2cf5ad914f05203e18e3f7c2ed6060a63604e3d75536f19b55e8e0af
|
||||||
|
|
||||||
5.8 imdisk
|
5.8 imdisk
|
||||||
download http://www.ltr-data.se/files/imdiskinst.exe and extract it by 7zip.
|
download http://static.ltr-data.se/files/imdiskinst_2.0.10.exe and extract it by 7zip.
|
||||||
|
|
||||||
INSTALL/ventoy/imdisk/64/imdisk.sys --> sys/amd64/imdisk.sys SHA-256: 6702202220268787e361f5a82dae53362c8e6c6dcd240bb01b44dd77ae0788da
|
INSTALL/ventoy/imdisk/64/imdisk.sys --> sys/amd64/imdisk.sys SHA-256: 6702202220268787e361f5a82dae53362c8e6c6dcd240bb01b44dd77ae0788da
|
||||||
INSTALL/ventoy/imdisk/64/imdisk.exe --> cli/amd64/imdisk.exe SHA-256: 9759175380af836869443e5f21ce2e33022125d154bc6b3d1c04dc36b190de04
|
INSTALL/ventoy/imdisk/64/imdisk.exe --> cli/amd64/imdisk.exe SHA-256: 9759175380af836869443e5f21ce2e33022125d154bc6b3d1c04dc36b190de04
|
||||||
@@ -256,5 +266,12 @@
|
|||||||
ISNTALL/ventoy/7z/64/7za.exe SHA-256: 8117e40ee7f824f63373a4f5625bb62749f69159d0c449b3ce2f35aad3b83549
|
ISNTALL/ventoy/7z/64/7za.exe SHA-256: 8117e40ee7f824f63373a4f5625bb62749f69159d0c449b3ce2f35aad3b83549
|
||||||
ISNTALL/ventoy/7z/32/7za.exe SHA-256: ea308c76a2f927b160a143d94072b0dce232e04b751f0c6432a94e05164e716d
|
ISNTALL/ventoy/7z/32/7za.exe SHA-256: ea308c76a2f927b160a143d94072b0dce232e04b751f0c6432a94e05164e716d
|
||||||
|
|
||||||
|
5.13 ./Ventoy/Unix/ventoy_unix/DragonFly/sbin/dmsetup
|
||||||
|
download from https://cdimage.debian.org/mirror/dragonflybsd.org/iso-images/dfly-x86_64-5.8.3_REL.iso.bz2
|
||||||
|
extract from the ISO file sbin/dmsetup
|
||||||
|
dmsetup SHA-256: bedcf26650e87edfe961e33bae20d832bce73efd4b6239f9a6a5785661e4e698
|
||||||
|
|
||||||
|
5.14 ./LiveCD/ISO/EFI/boot/vmlinuz64
|
||||||
|
download from http://www.tinycorelinux.net/11.x/x86_64/archive/11.0/distribution_files/vmlinuz64
|
||||||
|
vmlinuz64 SHA-256: 641077fc1f9914af244c248453005f56536ba9e7f54ba3e52402f26709ddb8a5
|
||||||
|
|
||||||
|
|||||||
@@ -7,12 +7,12 @@
|
|||||||
* modify it under the terms of the GNU General Public License as
|
* modify it under the terms of the GNU General Public License as
|
||||||
* published by the Free Software Foundation; either version 3 of the
|
* published by the Free Software Foundation; either version 3 of the
|
||||||
* License, or (at your option) any later version.
|
* License, or (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
* General Public License for more details.
|
* General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||||
*
|
*
|
||||||
@@ -76,7 +76,7 @@ STATIC EFI_EXIT_BOOT_SERVICES g_org_exit_boot_service = NULL;
|
|||||||
|
|
||||||
/* Boot filename */
|
/* Boot filename */
|
||||||
UINTN gBootFileStartIndex = 1;
|
UINTN gBootFileStartIndex = 1;
|
||||||
CONST CHAR16 *gEfiBootFileName[] =
|
CONST CHAR16 *gEfiBootFileName[] =
|
||||||
{
|
{
|
||||||
L"@",
|
L"@",
|
||||||
EFI_REMOVABLE_MEDIA_FILE_NAME,
|
EFI_REMOVABLE_MEDIA_FILE_NAME,
|
||||||
@@ -101,7 +101,7 @@ CONST CHAR16 *gEfiBootFileName[] =
|
|||||||
L"\\EFI\\BOOT\\bootaa64.efi",
|
L"\\EFI\\BOOT\\bootaa64.efi",
|
||||||
L"\\efi\\boot\\bootaa64.efi",
|
L"\\efi\\boot\\bootaa64.efi",
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
VOID EFIAPI VtoyDebug(IN CONST CHAR8 *Format, ...)
|
VOID EFIAPI VtoyDebug(IN CONST CHAR8 *Format, ...)
|
||||||
@@ -112,14 +112,14 @@ VOID EFIAPI VtoyDebug(IN CONST CHAR8 *Format, ...)
|
|||||||
VA_START (Marker, Format);
|
VA_START (Marker, Format);
|
||||||
UnicodeVSPrintAsciiFormat(Buffer, sizeof(Buffer), Format, Marker);
|
UnicodeVSPrintAsciiFormat(Buffer, sizeof(Buffer), Format, Marker);
|
||||||
VA_END (Marker);
|
VA_END (Marker);
|
||||||
|
|
||||||
gST->ConOut->OutputString(gST->ConOut, Buffer);
|
gST->ConOut->OutputString(gST->ConOut, Buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID EFIAPI ventoy_clear_input(VOID)
|
VOID EFIAPI ventoy_clear_input(VOID)
|
||||||
{
|
{
|
||||||
EFI_INPUT_KEY Key;
|
EFI_INPUT_KEY Key;
|
||||||
|
|
||||||
gST->ConIn->Reset(gST->ConIn, FALSE);
|
gST->ConIn->Reset(gST->ConIn, FALSE);
|
||||||
while (EFI_SUCCESS == gST->ConIn->ReadKeyStroke(gST->ConIn, &Key))
|
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++)
|
for (i = 0; i < chain->img_chunk_num; i++)
|
||||||
{
|
{
|
||||||
debug("%2u: [ %u - %u ] <==> [ %llu - %llu ]",
|
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);
|
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))
|
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);
|
debug("image chunk size check failed %d", errcnt);
|
||||||
}
|
}
|
||||||
|
|
||||||
ventoy_debug_pause();
|
ventoy_debug_pause();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -169,7 +169,7 @@ static void EFIAPI ventoy_dump_override_chunk(ventoy_chain_head *chain)
|
|||||||
{
|
{
|
||||||
UINT32 i;
|
UINT32 i;
|
||||||
ventoy_override_chunk *chunk;
|
ventoy_override_chunk *chunk;
|
||||||
|
|
||||||
chunk = (ventoy_override_chunk *)((char *)chain + chain->override_chunk_offset);
|
chunk = (ventoy_override_chunk *)((char *)chain + chain->override_chunk_offset);
|
||||||
|
|
||||||
debug("##################### ventoy_dump_override_chunk #######################");
|
debug("##################### ventoy_dump_override_chunk #######################");
|
||||||
@@ -186,7 +186,7 @@ static void EFIAPI ventoy_dump_virt_chunk(ventoy_chain_head *chain)
|
|||||||
{
|
{
|
||||||
UINT32 i;
|
UINT32 i;
|
||||||
ventoy_virt_chunk *node;
|
ventoy_virt_chunk *node;
|
||||||
|
|
||||||
debug("##################### ventoy_dump_virt_chunk #######################");
|
debug("##################### ventoy_dump_virt_chunk #######################");
|
||||||
debug("virt_chunk_offset=%u", chain->virt_chunk_offset);
|
debug("virt_chunk_offset=%u", chain->virt_chunk_offset);
|
||||||
debug("virt_chunk_num=%u", chain->virt_chunk_num);
|
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);
|
node = (ventoy_virt_chunk *)((char *)chain + chain->virt_chunk_offset);
|
||||||
for (i = 0; i < chain->virt_chunk_num; i++, node++)
|
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_start,
|
||||||
node->mem_sector_end,
|
node->mem_sector_end,
|
||||||
node->mem_sector_offset,
|
node->mem_sector_offset,
|
||||||
@@ -202,7 +202,7 @@ static void EFIAPI ventoy_dump_virt_chunk(ventoy_chain_head *chain)
|
|||||||
node->remap_sector_end,
|
node->remap_sector_end,
|
||||||
node->org_sector_start);
|
node->org_sector_start);
|
||||||
}
|
}
|
||||||
|
|
||||||
ventoy_debug_pause();
|
ventoy_debug_pause();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -211,7 +211,7 @@ static void EFIAPI ventoy_dump_chain(ventoy_chain_head *chain)
|
|||||||
UINT32 i = 0;
|
UINT32 i = 0;
|
||||||
UINT8 chksum = 0;
|
UINT8 chksum = 0;
|
||||||
UINT8 *guid;
|
UINT8 *guid;
|
||||||
|
|
||||||
guid = chain->os_param.vtoy_disk_guid;
|
guid = chain->os_param.vtoy_disk_guid;
|
||||||
for (i = 0; i < sizeof(ventoy_os_param); i++)
|
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_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_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_img_location_len=<%u>", chain->os_param.vtoy_img_location_len);
|
||||||
debug("os_param->vtoy_reserved=<%u %u %u %u %u %u %u>",
|
debug("os_param->vtoy_reserved=<%u %u %u %u %u %u %u>",
|
||||||
g_os_param_reserved[0],
|
g_os_param_reserved[0],
|
||||||
g_os_param_reserved[1],
|
g_os_param_reserved[1],
|
||||||
g_os_param_reserved[2],
|
g_os_param_reserved[2],
|
||||||
g_os_param_reserved[3],
|
g_os_param_reserved[3],
|
||||||
g_os_param_reserved[4],
|
g_os_param_reserved[4],
|
||||||
g_os_param_reserved[5],
|
g_os_param_reserved[5],
|
||||||
@@ -240,7 +240,7 @@ static void EFIAPI ventoy_dump_chain(ventoy_chain_head *chain)
|
|||||||
);
|
);
|
||||||
|
|
||||||
ventoy_debug_pause();
|
ventoy_debug_pause();
|
||||||
|
|
||||||
debug("chain->disk_drive=0x%x", chain->disk_drive);
|
debug("chain->disk_drive=0x%x", chain->disk_drive);
|
||||||
debug("chain->disk_sector_size=%u", chain->disk_sector_size);
|
debug("chain->disk_sector_size=%u", chain->disk_sector_size);
|
||||||
debug("chain->real_img_size_in_bytes=%llu", chain->real_img_size_in_bytes);
|
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);
|
debug("chain->override_chunk_num=%u", chain->override_chunk_num);
|
||||||
|
|
||||||
ventoy_debug_pause();
|
ventoy_debug_pause();
|
||||||
|
|
||||||
ventoy_dump_img_chunk(chain);
|
ventoy_dump_img_chunk(chain);
|
||||||
ventoy_dump_override_chunk(chain);
|
ventoy_dump_override_chunk(chain);
|
||||||
ventoy_dump_virt_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 *pLastNode = NULL;
|
||||||
EFI_DEVICE_PATH_PROTOCOL *pCurNode = NULL;
|
EFI_DEVICE_PATH_PROTOCOL *pCurNode = NULL;
|
||||||
EFI_DEVICE_PATH_PROTOCOL *pTmpDevPath = NULL;
|
EFI_DEVICE_PATH_PROTOCOL *pTmpDevPath = NULL;
|
||||||
|
|
||||||
pTmpDevPath = DuplicateDevicePath(pDevPath);
|
pTmpDevPath = DuplicateDevicePath(pDevPath);
|
||||||
if (!pTmpDevPath)
|
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);
|
debug("find previous ramdisk variable <%llu>", g_backup_ramdisk_param.DiskSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = gRT->SetVariable(L"VentoyRamDisk", &VarGuid,
|
Status = gRT->SetVariable(L"VentoyRamDisk", &VarGuid,
|
||||||
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
|
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
|
||||||
sizeof(g_ramdisk_param), &(g_ramdisk_param));
|
sizeof(g_ramdisk_param), &(g_ramdisk_param));
|
||||||
debug("set ramdisk variable %r", Status);
|
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)
|
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,
|
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
|
||||||
sizeof(g_backup_ramdisk_param), &g_backup_ramdisk_param);
|
sizeof(g_backup_ramdisk_param), &g_backup_ramdisk_param);
|
||||||
debug("resotre ramdisk variable %r", Status);
|
debug("resotre ramdisk variable %r", Status);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Status = gRT->SetVariable(L"VentoyRamDisk", &VarGuid,
|
Status = gRT->SetVariable(L"VentoyRamDisk", &VarGuid,
|
||||||
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
|
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
|
||||||
0, NULL);
|
0, NULL);
|
||||||
debug("delete ramdisk variable %r", Status);
|
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);
|
debug("find previous efi variable <%a>", g_backup_os_param_var.vtoy_img_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = gRT->SetVariable(L"VentoyOsParam", &VarGuid,
|
Status = gRT->SetVariable(L"VentoyOsParam", &VarGuid,
|
||||||
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
|
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
|
||||||
sizeof(g_chain->os_param), &(g_chain->os_param));
|
sizeof(g_chain->os_param), &(g_chain->os_param));
|
||||||
debug("set efi variable %r", Status);
|
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)))
|
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,
|
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
|
||||||
sizeof(g_backup_os_param_var), &(g_backup_os_param_var));
|
sizeof(g_backup_os_param_var), &(g_backup_os_param_var));
|
||||||
debug("restore efi variable %r", Status);
|
debug("restore efi variable %r", Status);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Status = gRT->SetVariable(L"VentoyOsParam", &VarGuid,
|
Status = gRT->SetVariable(L"VentoyOsParam", &VarGuid,
|
||||||
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
|
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
|
||||||
0, NULL);
|
0, NULL);
|
||||||
debug("delete efi variable %r", Status);
|
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"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"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 ...... ");
|
gST->ConOut->OutputString(gST->ConOut, L"\r\n\r\nWill exit after 10 seconds ...... ");
|
||||||
|
|
||||||
sleep(10);
|
sleep(10);
|
||||||
@@ -489,7 +489,7 @@ STATIC VOID ventoy_warn_invalid_device(VOID)
|
|||||||
#else
|
#else
|
||||||
STATIC VOID ventoy_warn_invalid_device(VOID)
|
STATIC VOID ventoy_warn_invalid_device(VOID)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif
|
#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[0] = FileNameLen + sizeof(EFI_DEVICE_PATH_PROTOCOL);
|
||||||
pFilePath->Header.Length[1] = 0;
|
pFilePath->Header.Length[1] = 0;
|
||||||
CopyMem(pFilePath->PathName, FileName, FileNameLen);
|
CopyMem(pFilePath->PathName, FileName, FileNameLen);
|
||||||
|
|
||||||
pImgPath = AppendDevicePathNode(pDevicePath, (EFI_DEVICE_PATH_PROTOCOL *)pFilePath);
|
pImgPath = AppendDevicePathNode(pDevicePath, (EFI_DEVICE_PATH_PROTOCOL *)pFilePath);
|
||||||
if (!pImgPath)
|
if (!pImgPath)
|
||||||
{
|
{
|
||||||
return EFI_NOT_FOUND;
|
return EFI_NOT_FOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = gBS->LoadImage(FALSE, ImageHandle, pImgPath, NULL, 0, Image);
|
Status = gBS->LoadImage(FALSE, ImageHandle, pImgPath, NULL, 0, Image);
|
||||||
|
|
||||||
debug("Load Image File %r DP: <%s>", Status, ConvertDevicePathToText(pImgPath, FALSE, FALSE));
|
debug("Load Image File %r DP: <%s>", Status, ConvertDevicePathToText(pImgPath, FALSE, FALSE));
|
||||||
|
|
||||||
FreePool(pImgPath);
|
FreePool(pImgPath);
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -547,7 +547,7 @@ STATIC EFI_STATUS EFIAPI ventoy_find_iso_disk(IN EFI_HANDLE ImageHandle)
|
|||||||
return EFI_OUT_OF_RESOURCES;
|
return EFI_OUT_OF_RESOURCES;
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiBlockIoProtocolGuid,
|
Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiBlockIoProtocolGuid,
|
||||||
NULL, &Count, &Handles);
|
NULL, &Count, &Handles);
|
||||||
if (EFI_ERROR(Status))
|
if (EFI_ERROR(Status))
|
||||||
{
|
{
|
||||||
@@ -591,16 +591,16 @@ STATIC EFI_STATUS EFIAPI ventoy_find_iso_disk(IN EFI_HANDLE ImageHandle)
|
|||||||
ventoy_warn_invalid_device();
|
ventoy_warn_invalid_device();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gBlockData.RawBlockIoHandle = Handles[i];
|
gBlockData.RawBlockIoHandle = Handles[i];
|
||||||
gBlockData.pRawBlockIo = pBlockIo;
|
gBlockData.pRawBlockIo = pBlockIo;
|
||||||
gBS->OpenProtocol(Handles[i], &gEfiDevicePathProtocolGuid,
|
gBS->OpenProtocol(Handles[i], &gEfiDevicePathProtocolGuid,
|
||||||
(VOID **)&(gBlockData.pDiskDevPath),
|
(VOID **)&(gBlockData.pDiskDevPath),
|
||||||
ImageHandle,
|
ImageHandle,
|
||||||
Handles[i],
|
Handles[i],
|
||||||
EFI_OPEN_PROTOCOL_GET_PROTOCOL);
|
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));
|
ConvertDevicePathToText(gBlockData.pDiskDevPath, FALSE, FALSE));
|
||||||
break;
|
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_SIMPLE_FILE_SYSTEM_PROTOCOL *pFile = NULL;
|
||||||
EFI_DEVICE_PATH_PROTOCOL *pDevPath = NULL;
|
EFI_DEVICE_PATH_PROTOCOL *pDevPath = NULL;
|
||||||
|
|
||||||
Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiSimpleFileSystemProtocolGuid,
|
Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiSimpleFileSystemProtocolGuid,
|
||||||
NULL, &Count, &Handles);
|
NULL, &Count, &Handles);
|
||||||
if (EFI_ERROR(Status))
|
if (EFI_ERROR(Status))
|
||||||
{
|
{
|
||||||
@@ -646,7 +646,7 @@ STATIC EFI_STATUS EFIAPI ventoy_find_iso_disk_fs(IN EFI_HANDLE ImageHandle)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = gBS->OpenProtocol(Handles[i], &gEfiDevicePathProtocolGuid,
|
Status = gBS->OpenProtocol(Handles[i], &gEfiDevicePathProtocolGuid,
|
||||||
(VOID **)&pDevPath,
|
(VOID **)&pDevPath,
|
||||||
ImageHandle,
|
ImageHandle,
|
||||||
Handles[i],
|
Handles[i],
|
||||||
@@ -683,29 +683,29 @@ STATIC EFI_STATUS EFIAPI ventoy_load_isoefi_driver(IN EFI_HANDLE ImageHandle)
|
|||||||
|
|
||||||
if (gIsoUdf)
|
if (gIsoUdf)
|
||||||
{
|
{
|
||||||
Status = ventoy_load_image(ImageHandle, gBlockData.pDiskFsDevPath,
|
Status = ventoy_load_image(ImageHandle, gBlockData.pDiskFsDevPath,
|
||||||
gUdfEfiDriverPath,
|
gUdfEfiDriverPath,
|
||||||
sizeof(gUdfEfiDriverPath),
|
sizeof(gUdfEfiDriverPath),
|
||||||
&Image);
|
&Image);
|
||||||
debug("load iso UDF efi driver status:%r", Status);
|
debug("load iso UDF efi driver status:%r", Status);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Status = ventoy_load_image(ImageHandle, gBlockData.pDiskFsDevPath,
|
Status = ventoy_load_image(ImageHandle, gBlockData.pDiskFsDevPath,
|
||||||
gIso9660EfiDriverPath,
|
gIso9660EfiDriverPath,
|
||||||
sizeof(gIso9660EfiDriverPath),
|
sizeof(gIso9660EfiDriverPath),
|
||||||
&Image);
|
&Image);
|
||||||
debug("load iso 9660 efi driver status:%r", Status);
|
debug("load iso 9660 efi driver status:%r", Status);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gDebugPrint)
|
if (gDebugPrint)
|
||||||
{
|
{
|
||||||
gRT->SetVariable(L"FS_LOGGING", &gShellVariableGuid,
|
gRT->SetVariable(L"FS_LOGGING", &gShellVariableGuid,
|
||||||
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
|
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
|
||||||
sizeof(LogVar), LogVar);
|
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,
|
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
|
||||||
sizeof(LogVar), LogVar);
|
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]);
|
AsciiStrCpyS(tmp, sizeof(tmp), replace->old_file_name[0]);
|
||||||
|
|
||||||
for (i = 0; i < 256 && tmp[i]; i++)
|
for (i = 0; i < 256 && tmp[i]; i++)
|
||||||
{
|
{
|
||||||
if (tmp[i] == '/')
|
if (tmp[i] == '/')
|
||||||
@@ -755,7 +755,7 @@ EFI_STATUS EFIAPI ventoy_get_variable_wrapper
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
EFI_STATUS Status = EFI_SUCCESS;
|
EFI_STATUS Status = EFI_SUCCESS;
|
||||||
|
|
||||||
Status = g_org_get_variable(VariableName, VendorGuid, Attributes, DataSize, Data);
|
Status = g_org_get_variable(VariableName, VendorGuid, Attributes, DataSize, Data);
|
||||||
if (StrCmp(VariableName, L"SecureBoot") == 0)
|
if (StrCmp(VariableName, L"SecureBoot") == 0)
|
||||||
{
|
{
|
||||||
@@ -779,7 +779,7 @@ EFI_STATUS EFIAPI ventoy_exit_boot_service_wrapper
|
|||||||
gRT->GetVariable = g_org_get_variable;
|
gRT->GetVariable = g_org_get_variable;
|
||||||
g_org_get_variable = NULL;
|
g_org_get_variable = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return g_org_exit_boot_service(ImageHandle, MapKey);
|
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. */
|
/* step1: wrapper security protocol. */
|
||||||
/* Do we still need it since we have been loaded ? */
|
/* Do we still need it since we have been loaded ? */
|
||||||
|
|
||||||
|
|
||||||
/* step2: fake SecureBoot variable */
|
/* step2: fake SecureBoot variable */
|
||||||
g_org_exit_boot_service = gBS->ExitBootServices;
|
g_org_exit_boot_service = gBS->ExitBootServices;
|
||||||
gBS->ExitBootServices = ventoy_exit_boot_service_wrapper;
|
gBS->ExitBootServices = ventoy_exit_boot_service_wrapper;
|
||||||
|
|
||||||
g_org_get_variable = gRT->GetVariable;
|
g_org_get_variable = gRT->GetVariable;
|
||||||
gRT->GetVariable = ventoy_get_variable_wrapper;
|
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)
|
STATIC EFI_STATUS EFIAPI ventoy_parse_cmdline(IN EFI_HANDLE ImageHandle)
|
||||||
{
|
{
|
||||||
UINT32 i = 0;
|
UINT32 i = 0;
|
||||||
UINT32 old_cnt = 0;
|
UINT32 old_cnt = 0;
|
||||||
UINTN size = 0;
|
UINTN size = 0;
|
||||||
@@ -846,12 +846,12 @@ STATIC EFI_STATUS EFIAPI ventoy_parse_cmdline(IN EFI_HANDLE ImageHandle)
|
|||||||
{
|
{
|
||||||
gDebugPrint = TRUE;
|
gDebugPrint = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (StrStr(pCmdLine, L"fallback"))
|
if (StrStr(pCmdLine, L"fallback"))
|
||||||
{
|
{
|
||||||
gBootFallBack = TRUE;
|
gBootFallBack = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (StrStr(pCmdLine, L"dotefi"))
|
if (StrStr(pCmdLine, L"dotefi"))
|
||||||
{
|
{
|
||||||
gDotEfiBoot = TRUE;
|
gDotEfiBoot = TRUE;
|
||||||
@@ -861,7 +861,7 @@ STATIC EFI_STATUS EFIAPI ventoy_parse_cmdline(IN EFI_HANDLE ImageHandle)
|
|||||||
{
|
{
|
||||||
gLoadIsoEfi = TRUE;
|
gLoadIsoEfi = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (StrStr(pCmdLine, L"iso_udf"))
|
if (StrStr(pCmdLine, L"iso_udf"))
|
||||||
{
|
{
|
||||||
gIsoUdf = TRUE;
|
gIsoUdf = TRUE;
|
||||||
@@ -899,7 +899,7 @@ STATIC EFI_STATUS EFIAPI ventoy_parse_cmdline(IN EFI_HANDLE ImageHandle)
|
|||||||
{
|
{
|
||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
pGrubParam = (ventoy_grub_param *)StrHexToUintn(pPos + StrLen(L"env_param="));
|
pGrubParam = (ventoy_grub_param *)StrHexToUintn(pPos + StrLen(L"env_param="));
|
||||||
grub_env_set = pGrubParam->grub_env_set;
|
grub_env_set = pGrubParam->grub_env_set;
|
||||||
grub_env_get = pGrubParam->grub_env_get;
|
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();
|
ventoy_warn_invalid_device();
|
||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_file_replace_list = &pGrubParam->file_replace;
|
g_file_replace_list = &pGrubParam->file_replace;
|
||||||
old_cnt = g_file_replace_list->old_file_cnt;
|
old_cnt = g_file_replace_list->old_file_cnt;
|
||||||
debug("file replace: magic:0x%x virtid:%u name count:%u <%a> <%a> <%a> <%a>",
|
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] : ""
|
old_cnt > 3 ? g_file_replace_list->old_file_name[3] : ""
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
for (i = 0; i < VTOY_MAX_CONF_REPLACE; i++)
|
for (i = 0; i < VTOY_MAX_CONF_REPLACE; i++)
|
||||||
{
|
{
|
||||||
replace = pGrubParam->img_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:");
|
pPos = StrStr(pCmdLine, L"mem:");
|
||||||
chain = (ventoy_chain_head *)StrHexToUintn(pPos + 4);
|
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");
|
debug("This is normal mode");
|
||||||
g_chain = AllocatePool(size);
|
g_chain = AllocatePool(size);
|
||||||
CopyMem(g_chain, chain, size);
|
CopyMem(g_chain, chain, size);
|
||||||
|
|
||||||
g_chunk = (ventoy_img_chunk *)((char *)g_chain + g_chain->img_chunk_offset);
|
g_chunk = (ventoy_img_chunk *)((char *)g_chain + g_chain->img_chunk_offset);
|
||||||
g_img_chunk_num = g_chain->img_chunk_num;
|
g_img_chunk_num = g_chain->img_chunk_num;
|
||||||
g_override_chunk = (ventoy_override_chunk *)((char *)g_chain + g_chain->override_chunk_offset);
|
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;
|
g_hook_keyboard = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_os_param_reserved[5] == 1 && g_os_param_reserved[2] == ventoy_chain_linux)
|
if (g_os_param_reserved[5] == 1 && g_os_param_reserved[2] == ventoy_chain_linux)
|
||||||
{
|
{
|
||||||
ventoy_disable_secure_boot(ImageHandle);
|
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;
|
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])
|
ventoy_chain_wim == g_os_param_reserved[2])
|
||||||
{
|
{
|
||||||
if (ventoy_is_cdrom_dp_exist())
|
if (ventoy_is_cdrom_dp_exist())
|
||||||
@@ -1066,7 +1066,7 @@ EFI_STATUS EFIAPI ventoy_clean_env(VOID)
|
|||||||
|
|
||||||
if (!gMemdiskMode)
|
if (!gMemdiskMode)
|
||||||
{
|
{
|
||||||
FreePool(g_chain);
|
FreePool(g_chain);
|
||||||
}
|
}
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
@@ -1126,7 +1126,7 @@ EFI_STATUS EFIAPI ventoy_boot(IN EFI_HANDLE ImageHandle)
|
|||||||
Count = 0;
|
Count = 0;
|
||||||
Handles = NULL;
|
Handles = NULL;
|
||||||
|
|
||||||
Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiSimpleFileSystemProtocolGuid,
|
Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiSimpleFileSystemProtocolGuid,
|
||||||
NULL, &Count, &Handles);
|
NULL, &Count, &Handles);
|
||||||
if (EFI_ERROR(Status))
|
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);
|
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,
|
(VOID **)&pDevPath,
|
||||||
ImageHandle,
|
ImageHandle,
|
||||||
Handles[i],
|
Handles[i],
|
||||||
@@ -1165,7 +1165,7 @@ EFI_STATUS EFIAPI ventoy_boot(IN EFI_HANDLE ImageHandle)
|
|||||||
|
|
||||||
for (j = gBootFileStartIndex; j < ARRAY_SIZE(gEfiBootFileName); j++)
|
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);
|
StrSize(gEfiBootFileName[j]), &Image);
|
||||||
if (EFI_SUCCESS == Status)
|
if (EFI_SUCCESS == Status)
|
||||||
{
|
{
|
||||||
@@ -1187,7 +1187,7 @@ EFI_STATUS EFIAPI ventoy_boot(IN EFI_HANDLE ImageHandle)
|
|||||||
{
|
{
|
||||||
gST->ConIn->Reset(gST->ConIn, FALSE);
|
gST->ConIn->Reset(gST->ConIn, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((g_file_replace_list && g_file_replace_list->magic == GRUB_FILE_REPLACE_MAGIC) || g_img_replace_list)
|
if ((g_file_replace_list && g_file_replace_list->magic == GRUB_FILE_REPLACE_MAGIC) || g_img_replace_list)
|
||||||
{
|
{
|
||||||
ventoy_wrapper_push_openvolume(pFile->OpenVolume);
|
ventoy_wrapper_push_openvolume(pFile->OpenVolume);
|
||||||
@@ -1199,7 +1199,7 @@ EFI_STATUS EFIAPI ventoy_boot(IN EFI_HANDLE ImageHandle)
|
|||||||
//ventoy_wrapper_system();
|
//ventoy_wrapper_system();
|
||||||
Status = gBS->StartImage(Image, NULL, NULL);
|
Status = gBS->StartImage(Image, NULL, NULL);
|
||||||
ventoy_hook_stop();
|
ventoy_hook_stop();
|
||||||
|
|
||||||
if (EFI_ERROR(Status))
|
if (EFI_ERROR(Status))
|
||||||
{
|
{
|
||||||
debug("Failed to start image %r", Status);
|
debug("Failed to start image %r", Status);
|
||||||
@@ -1217,7 +1217,7 @@ EFI_STATUS EFIAPI ventoy_boot(IN EFI_HANDLE ImageHandle)
|
|||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
debug("Fs not found, now wait and retry...");
|
debug("Fs not found, now wait and retry...");
|
||||||
sleep(1);
|
sleep(1);
|
||||||
}
|
}
|
||||||
@@ -1239,7 +1239,7 @@ EFI_STATUS EFIAPI VentoyEfiMain
|
|||||||
{
|
{
|
||||||
EFI_STATUS Status = EFI_SUCCESS;
|
EFI_STATUS Status = EFI_SUCCESS;
|
||||||
EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *Protocol;
|
EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *Protocol;
|
||||||
|
|
||||||
g_sector_flag_num = 512; /* initial value */
|
g_sector_flag_num = 512; /* initial value */
|
||||||
|
|
||||||
g_sector_flag = AllocatePool(g_sector_flag_num * sizeof(ventoy_sector_flag));
|
g_sector_flag = AllocatePool(g_sector_flag_num * sizeof(ventoy_sector_flag));
|
||||||
@@ -1263,6 +1263,11 @@ EFI_STATUS EFIAPI VentoyEfiMain
|
|||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (g_os_param_reserved[11] == 1)
|
||||||
|
{
|
||||||
|
ventoy_lock_max_res();
|
||||||
|
}
|
||||||
|
|
||||||
ventoy_disable_ex_filesystem();
|
ventoy_disable_ex_filesystem();
|
||||||
|
|
||||||
if (gMemdiskMode)
|
if (gMemdiskMode)
|
||||||
@@ -1278,12 +1283,12 @@ EFI_STATUS EFIAPI VentoyEfiMain
|
|||||||
ventoy_find_iso_disk_fs(ImageHandle);
|
ventoy_find_iso_disk_fs(ImageHandle);
|
||||||
ventoy_load_isoefi_driver(ImageHandle);
|
ventoy_load_isoefi_driver(ImageHandle);
|
||||||
}
|
}
|
||||||
|
|
||||||
ventoy_install_blockio(ImageHandle, g_iso_buf_size);
|
ventoy_install_blockio(ImageHandle, g_iso_buf_size);
|
||||||
ventoy_debug_pause();
|
ventoy_debug_pause();
|
||||||
|
|
||||||
Status = ventoy_boot(ImageHandle);
|
Status = ventoy_boot(ImageHandle);
|
||||||
|
|
||||||
ventoy_delete_ramdisk_param();
|
ventoy_delete_ramdisk_param();
|
||||||
|
|
||||||
if (gLoadIsoEfi && gBlockData.IsoDriverImage)
|
if (gLoadIsoEfi && gBlockData.IsoDriverImage)
|
||||||
@@ -1310,14 +1315,14 @@ EFI_STATUS EFIAPI VentoyEfiMain
|
|||||||
}
|
}
|
||||||
|
|
||||||
ventoy_debug_pause();
|
ventoy_debug_pause();
|
||||||
|
|
||||||
ventoy_install_blockio(ImageHandle, g_chain->virt_img_size_in_bytes);
|
ventoy_install_blockio(ImageHandle, g_chain->virt_img_size_in_bytes);
|
||||||
|
|
||||||
ventoy_debug_pause();
|
ventoy_debug_pause();
|
||||||
|
|
||||||
Status = ventoy_boot(ImageHandle);
|
Status = ventoy_boot(ImageHandle);
|
||||||
}
|
}
|
||||||
|
|
||||||
ventoy_clean_env();
|
ventoy_clean_env();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1330,17 +1335,22 @@ EFI_STATUS EFIAPI VentoyEfiMain
|
|||||||
sleep(30);
|
sleep(30);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ventoy_clear_input();
|
ventoy_clear_input();
|
||||||
gST->ConOut->ClearScreen(gST->ConOut);
|
gST->ConOut->ClearScreen(gST->ConOut);
|
||||||
|
|
||||||
if (gDotEfiBoot && (EFI_NOT_FOUND == Status))
|
if (gDotEfiBoot && (EFI_NOT_FOUND == Status))
|
||||||
{
|
{
|
||||||
grub_env_set("vtoy_dotefi_retry", "YES");
|
grub_env_set("vtoy_dotefi_retry", "YES");
|
||||||
}
|
}
|
||||||
|
|
||||||
ventoy_enable_ex_filesystem();
|
ventoy_enable_ex_filesystem();
|
||||||
|
|
||||||
|
if (g_os_param_reserved[11] == 1)
|
||||||
|
{
|
||||||
|
ventoy_unlock_max_res();
|
||||||
|
}
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,17 +7,17 @@
|
|||||||
* modify it under the terms of the GNU General Public License as
|
* modify it under the terms of the GNU General Public License as
|
||||||
* published by the Free Software Foundation; either version 3 of the
|
* published by the Free Software Foundation; either version 3 of the
|
||||||
* License, or (at your option) any later version.
|
* License, or (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
* General Public License for more details.
|
* General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __VENTOY_H__
|
#ifndef __VENTOY_H__
|
||||||
#define __VENTOY_H__
|
#define __VENTOY_H__
|
||||||
|
|
||||||
@@ -54,7 +54,7 @@ typedef struct ventoy_image_disk_region
|
|||||||
typedef struct ventoy_image_location
|
typedef struct ventoy_image_location
|
||||||
{
|
{
|
||||||
ventoy_guid guid;
|
ventoy_guid guid;
|
||||||
|
|
||||||
/* image sector size, currently this value is always 2048 */
|
/* image sector size, currently this value is always 2048 */
|
||||||
UINT32 image_sector_size;
|
UINT32 image_sector_size;
|
||||||
|
|
||||||
@@ -62,10 +62,10 @@ typedef struct ventoy_image_location
|
|||||||
UINT32 disk_sector_size;
|
UINT32 disk_sector_size;
|
||||||
|
|
||||||
UINT32 region_count;
|
UINT32 region_count;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* disk region data
|
* 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.
|
* 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
|
char vtoy_img_path[384]; // It seems to be enough, utf-8 format
|
||||||
UINT64 vtoy_img_size; // image file size in bytes
|
UINT64 vtoy_img_size; // image file size in bytes
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Ventoy will write a copy of ventoy_image_location data into runtime memory
|
* Ventoy will write a copy of ventoy_image_location data into runtime memory
|
||||||
* this is the physically address and length of that memory.
|
* this is the physically address and length of that memory.
|
||||||
* Address 0 means no such data exist.
|
* Address 0 means no such data exist.
|
||||||
@@ -95,7 +95,7 @@ typedef struct ventoy_os_param
|
|||||||
*/
|
*/
|
||||||
UINT64 vtoy_img_location_addr;
|
UINT64 vtoy_img_location_addr;
|
||||||
UINT32 vtoy_img_location_len;
|
UINT32 vtoy_img_location_len;
|
||||||
|
|
||||||
UINT64 vtoy_reserved[4]; // Internal use by ventoy
|
UINT64 vtoy_reserved[4]; // Internal use by ventoy
|
||||||
|
|
||||||
UINT8 vtoy_disk_signature[4];
|
UINT8 vtoy_disk_signature[4];
|
||||||
@@ -124,7 +124,7 @@ typedef struct ventoy_chain_head
|
|||||||
UINT64 virt_img_size_in_bytes;
|
UINT64 virt_img_size_in_bytes;
|
||||||
UINT32 boot_catalog;
|
UINT32 boot_catalog;
|
||||||
UINT8 boot_catalog_sector[2048];
|
UINT8 boot_catalog_sector[2048];
|
||||||
|
|
||||||
UINT32 img_chunk_offset;
|
UINT32 img_chunk_offset;
|
||||||
UINT32 img_chunk_num;
|
UINT32 img_chunk_num;
|
||||||
|
|
||||||
@@ -199,11 +199,11 @@ typedef struct ventoy_virt_chunk
|
|||||||
typedef struct ventoy_sector_flag
|
typedef struct ventoy_sector_flag
|
||||||
{
|
{
|
||||||
UINT8 flag; // 0:init 1:mem 2:remap
|
UINT8 flag; // 0:init 1:mem 2:remap
|
||||||
UINT64 remap_lba;
|
UINT64 remap_lba;
|
||||||
}ventoy_sector_flag;
|
}ventoy_sector_flag;
|
||||||
|
|
||||||
|
|
||||||
typedef struct vtoy_block_data
|
typedef struct vtoy_block_data
|
||||||
{
|
{
|
||||||
EFI_HANDLE Handle;
|
EFI_HANDLE Handle;
|
||||||
EFI_BLOCK_IO_MEDIA Media; /* Media descriptor */
|
EFI_BLOCK_IO_MEDIA Media; /* Media descriptor */
|
||||||
@@ -272,7 +272,7 @@ typedef struct ventoy_grub_param
|
|||||||
grub_env_set_pf grub_env_set;
|
grub_env_set_pf grub_env_set;
|
||||||
ventoy_grub_param_file_replace file_replace;
|
ventoy_grub_param_file_replace file_replace;
|
||||||
ventoy_grub_param_file_replace img_replace[VTOY_MAX_CONF_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;
|
}ventoy_grub_param;
|
||||||
|
|
||||||
typedef struct ventoy_ram_disk
|
typedef struct ventoy_ram_disk
|
||||||
@@ -318,7 +318,7 @@ typedef struct MBR_HEAD
|
|||||||
#pragma pack()
|
#pragma pack()
|
||||||
|
|
||||||
|
|
||||||
typedef struct well_known_guid
|
typedef struct well_known_guid
|
||||||
{
|
{
|
||||||
EFI_GUID *guid;
|
EFI_GUID *guid;
|
||||||
const char *name;
|
const char *name;
|
||||||
@@ -331,7 +331,7 @@ typedef struct ventoy_system_wrapper
|
|||||||
|
|
||||||
EFI_HANDLE_PROTOCOL NewHandleProtocol;
|
EFI_HANDLE_PROTOCOL NewHandleProtocol;
|
||||||
EFI_HANDLE_PROTOCOL OriHandleProtocol;
|
EFI_HANDLE_PROTOCOL OriHandleProtocol;
|
||||||
|
|
||||||
EFI_OPEN_PROTOCOL NewOpenProtocol;
|
EFI_OPEN_PROTOCOL NewOpenProtocol;
|
||||||
EFI_OPEN_PROTOCOL OriOpenProtocol;
|
EFI_OPEN_PROTOCOL OriOpenProtocol;
|
||||||
|
|
||||||
@@ -382,7 +382,7 @@ typedef struct DriverBindWrapper
|
|||||||
extern BOOLEAN gDebugPrint;
|
extern BOOLEAN gDebugPrint;
|
||||||
VOID EFIAPI VtoyDebug(IN CONST CHAR8 *Format, ...);
|
VOID EFIAPI VtoyDebug(IN CONST CHAR8 *Format, ...);
|
||||||
EFI_STATUS EFIAPI ventoy_wrapper_system(VOID);
|
EFI_STATUS EFIAPI ventoy_wrapper_system(VOID);
|
||||||
EFI_STATUS EFIAPI ventoy_block_io_read
|
EFI_STATUS EFIAPI ventoy_block_io_read
|
||||||
(
|
(
|
||||||
IN EFI_BLOCK_IO_PROTOCOL *This,
|
IN EFI_BLOCK_IO_PROTOCOL *This,
|
||||||
IN UINT32 MediaId,
|
IN UINT32 MediaId,
|
||||||
@@ -428,6 +428,8 @@ EFI_STATUS ventoy_hook_1st_cdrom_start(VOID);
|
|||||||
EFI_STATUS ventoy_hook_1st_cdrom_stop(VOID);
|
EFI_STATUS ventoy_hook_1st_cdrom_stop(VOID);
|
||||||
EFI_STATUS ventoy_disable_ex_filesystem(VOID);
|
EFI_STATUS ventoy_disable_ex_filesystem(VOID);
|
||||||
EFI_STATUS ventoy_enable_ex_filesystem(VOID);
|
EFI_STATUS ventoy_enable_ex_filesystem(VOID);
|
||||||
|
EFI_STATUS ventoy_lock_max_res(VOID);
|
||||||
|
EFI_STATUS ventoy_unlock_max_res(VOID);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -7,12 +7,12 @@
|
|||||||
* modify it under the terms of the GNU General Public License as
|
* modify it under the terms of the GNU General Public License as
|
||||||
* published by the Free Software Foundation; either version 3 of the
|
* published by the Free Software Foundation; either version 3 of the
|
||||||
* License, or (at your option) any later version.
|
* License, or (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
* General Public License for more details.
|
* General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||||
*
|
*
|
||||||
@@ -85,7 +85,7 @@ BOOLEAN ventoy_is_cdrom_dp_exist(VOID)
|
|||||||
EFI_STATUS Status = EFI_SUCCESS;
|
EFI_STATUS Status = EFI_SUCCESS;
|
||||||
EFI_DEVICE_PATH_PROTOCOL *DevicePath = NULL;
|
EFI_DEVICE_PATH_PROTOCOL *DevicePath = NULL;
|
||||||
|
|
||||||
Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiDevicePathProtocolGuid,
|
Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiDevicePathProtocolGuid,
|
||||||
NULL, &Count, &Handles);
|
NULL, &Count, &Handles);
|
||||||
if (EFI_ERROR(Status))
|
if (EFI_ERROR(Status))
|
||||||
{
|
{
|
||||||
@@ -107,24 +107,24 @@ BOOLEAN ventoy_is_cdrom_dp_exist(VOID)
|
|||||||
FreePool(Handles);
|
FreePool(Handles);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
DevicePath = NextDevicePathNode(DevicePath);
|
DevicePath = NextDevicePathNode(DevicePath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FreePool(Handles);
|
FreePool(Handles);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
/* Block IO procotol */
|
/* Block IO procotol */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
EFI_STATUS EFIAPI ventoy_block_io_reset
|
EFI_STATUS EFIAPI ventoy_block_io_reset
|
||||||
(
|
(
|
||||||
IN EFI_BLOCK_IO_PROTOCOL *This,
|
IN EFI_BLOCK_IO_PROTOCOL *This,
|
||||||
IN BOOLEAN ExtendedVerification
|
IN BOOLEAN ExtendedVerification
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
(VOID)This;
|
(VOID)This;
|
||||||
(VOID)ExtendedVerification;
|
(VOID)ExtendedVerification;
|
||||||
@@ -151,8 +151,8 @@ STATIC EFI_STATUS EFIAPI ventoy_read_iso_sector
|
|||||||
ventoy_img_chunk *pchunk = g_chunk;
|
ventoy_img_chunk *pchunk = g_chunk;
|
||||||
ventoy_override_chunk *pOverride = g_override_chunk;
|
ventoy_override_chunk *pOverride = g_override_chunk;
|
||||||
EFI_BLOCK_IO_PROTOCOL *pRawBlockIo = gBlockData.pRawBlockIo;
|
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);
|
Sector, Count, Buffer, pRawBlockIo->Media->IoAlign, pRawBlockIo->Media->BlockSize);
|
||||||
|
|
||||||
ReadStart = Sector * 2048;
|
ReadStart = Sector * 2048;
|
||||||
@@ -207,7 +207,7 @@ STATIC EFI_STATUS EFIAPI ventoy_read_iso_sector
|
|||||||
{
|
{
|
||||||
OverrideStart = pOverride->img_offset;
|
OverrideStart = pOverride->img_offset;
|
||||||
OverrideEnd = pOverride->img_offset + pOverride->override_size;
|
OverrideEnd = pOverride->img_offset + pOverride->override_size;
|
||||||
|
|
||||||
if (OverrideStart >= ReadEnd || ReadStart >= OverrideEnd)
|
if (OverrideStart >= ReadEnd || ReadStart >= OverrideEnd)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
@@ -217,7 +217,7 @@ STATIC EFI_STATUS EFIAPI ventoy_read_iso_sector
|
|||||||
{
|
{
|
||||||
if (ReadEnd <= OverrideEnd)
|
if (ReadEnd <= OverrideEnd)
|
||||||
{
|
{
|
||||||
CopyMem(pCurBuf + OverrideStart - ReadStart, pOverride->override_data, ReadEnd - OverrideStart);
|
CopyMem(pCurBuf + OverrideStart - ReadStart, pOverride->override_data, ReadEnd - OverrideStart);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -228,7 +228,7 @@ STATIC EFI_STATUS EFIAPI ventoy_read_iso_sector
|
|||||||
{
|
{
|
||||||
if (ReadEnd <= OverrideEnd)
|
if (ReadEnd <= OverrideEnd)
|
||||||
{
|
{
|
||||||
CopyMem(pCurBuf, pOverride->override_data + ReadStart - OverrideStart, ReadEnd - ReadStart);
|
CopyMem(pCurBuf, pOverride->override_data + ReadStart - OverrideStart, ReadEnd - ReadStart);
|
||||||
}
|
}
|
||||||
else
|
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))
|
pOverride->override_size == sizeof(ventoy_iso9660_override))
|
||||||
{
|
{
|
||||||
ventoy_iso9660_override *dirent = (ventoy_iso9660_override *)pOverride->override_data;
|
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
|
STATIC EFI_STATUS EFIAPI ventoy_write_iso_sector
|
||||||
@@ -276,7 +276,7 @@ STATIC EFI_STATUS EFIAPI ventoy_write_iso_sector
|
|||||||
UINT8 *pCurBuf = (UINT8 *)Buffer;
|
UINT8 *pCurBuf = (UINT8 *)Buffer;
|
||||||
ventoy_img_chunk *pchunk = g_chunk;
|
ventoy_img_chunk *pchunk = g_chunk;
|
||||||
EFI_BLOCK_IO_PROTOCOL *pRawBlockIo = gBlockData.pRawBlockIo;
|
EFI_BLOCK_IO_PROTOCOL *pRawBlockIo = gBlockData.pRawBlockIo;
|
||||||
|
|
||||||
debug("write iso sector %lu count %u", Sector, Count);
|
debug("write iso sector %lu count %u", Sector, Count);
|
||||||
|
|
||||||
ReadStart = Sector * 2048;
|
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 EFI_BLOCK_IO_PROTOCOL *This,
|
||||||
IN UINT32 MediaId,
|
IN UINT32 MediaId,
|
||||||
IN EFI_LBA Lba,
|
IN EFI_LBA Lba,
|
||||||
IN UINTN BufferSize,
|
IN UINTN BufferSize,
|
||||||
IN VOID *Buffer
|
IN VOID *Buffer
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
(VOID)This;
|
(VOID)This;
|
||||||
(VOID)MediaId;
|
(VOID)MediaId;
|
||||||
@@ -349,14 +349,14 @@ EFI_STATUS EFIAPI ventoy_block_io_ramdisk_write
|
|||||||
return EFI_SUCCESS;
|
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 EFI_BLOCK_IO_PROTOCOL *This,
|
||||||
IN UINT32 MediaId,
|
IN UINT32 MediaId,
|
||||||
IN EFI_LBA Lba,
|
IN EFI_LBA Lba,
|
||||||
IN UINTN BufferSize,
|
IN UINTN BufferSize,
|
||||||
OUT VOID *Buffer
|
OUT VOID *Buffer
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
//debug("### ventoy_block_io_ramdisk_read sector:%u count:%u", (UINT32)Lba, (UINT32)BufferSize / 2048);
|
//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;
|
(VOID)MediaId;
|
||||||
|
|
||||||
CopyMem(Buffer, g_iso_data_buf + (Lba * 2048), BufferSize);
|
CopyMem(Buffer, g_iso_data_buf + (Lba * 2048), BufferSize);
|
||||||
|
|
||||||
if (g_blockio_start_record_bcd && FALSE == g_blockio_bcd_read_done)
|
if (g_blockio_start_record_bcd && FALSE == g_blockio_bcd_read_done)
|
||||||
{
|
{
|
||||||
if (*(UINT32 *)Buffer == 0x66676572)
|
if (*(UINT32 *)Buffer == 0x66676572)
|
||||||
{
|
{
|
||||||
g_blockio_bcd_read_done = TRUE;
|
g_blockio_bcd_read_done = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -429,14 +429,14 @@ end:
|
|||||||
return Lba;
|
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 EFI_BLOCK_IO_PROTOCOL *This,
|
||||||
IN UINT32 MediaId,
|
IN UINT32 MediaId,
|
||||||
IN EFI_LBA Lba,
|
IN EFI_LBA Lba,
|
||||||
IN UINTN BufferSize,
|
IN UINTN BufferSize,
|
||||||
OUT VOID *Buffer
|
OUT VOID *Buffer
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
UINT32 i = 0;
|
UINT32 i = 0;
|
||||||
UINT32 j = 0;
|
UINT32 j = 0;
|
||||||
@@ -450,7 +450,7 @@ EFI_STATUS EFIAPI ventoy_block_io_read_real
|
|||||||
UINT8 *lastbuffer;
|
UINT8 *lastbuffer;
|
||||||
ventoy_sector_flag *cur_flag;
|
ventoy_sector_flag *cur_flag;
|
||||||
ventoy_virt_chunk *node;
|
ventoy_virt_chunk *node;
|
||||||
|
|
||||||
debug("### block_io_read_real sector:%u count:%u Buffer:%p", (UINT32)Lba, (UINT32)BufferSize / 2048, Buffer);
|
debug("### block_io_read_real sector:%u count:%u Buffer:%p", (UINT32)Lba, (UINT32)BufferSize / 2048, Buffer);
|
||||||
|
|
||||||
secNum = BufferSize / 2048;
|
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)
|
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,
|
(char *)g_virt_chunk + node->mem_sector_offset + (curlba - node->mem_sector_start) * 2048,
|
||||||
2048);
|
2048);
|
||||||
cur_flag->flag = 1;
|
cur_flag->flag = 1;
|
||||||
@@ -564,7 +564,7 @@ EFI_STATUS EFIAPI ventoy_block_io_read
|
|||||||
IN EFI_LBA Lba,
|
IN EFI_LBA Lba,
|
||||||
IN UINTN BufferSize,
|
IN UINTN BufferSize,
|
||||||
OUT VOID *Buffer
|
OUT VOID *Buffer
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
UINT32 IoAlign = 0;
|
UINT32 IoAlign = 0;
|
||||||
VOID *NewBuf = NULL;
|
VOID *NewBuf = NULL;
|
||||||
@@ -593,18 +593,18 @@ EFI_STATUS EFIAPI ventoy_block_io_read
|
|||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
EFI_STATUS EFIAPI ventoy_block_io_write
|
EFI_STATUS EFIAPI ventoy_block_io_write
|
||||||
(
|
(
|
||||||
IN EFI_BLOCK_IO_PROTOCOL *This,
|
IN EFI_BLOCK_IO_PROTOCOL *This,
|
||||||
IN UINT32 MediaId,
|
IN UINT32 MediaId,
|
||||||
IN EFI_LBA Lba,
|
IN EFI_LBA Lba,
|
||||||
IN UINTN BufferSize,
|
IN UINTN BufferSize,
|
||||||
IN VOID *Buffer
|
IN VOID *Buffer
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
UINT32 secNum = 0;
|
UINT32 secNum = 0;
|
||||||
UINT64 offset = 0;
|
UINT64 offset = 0;
|
||||||
|
|
||||||
(VOID)This;
|
(VOID)This;
|
||||||
(VOID)MediaId;
|
(VOID)MediaId;
|
||||||
|
|
||||||
@@ -636,8 +636,8 @@ STATIC UINTN ventoy_get_current_device_path_id(VOID)
|
|||||||
EFI_STATUS Status = EFI_SUCCESS;
|
EFI_STATUS Status = EFI_SUCCESS;
|
||||||
EFI_DEVICE_PATH_PROTOCOL *DevicePath = NULL;
|
EFI_DEVICE_PATH_PROTOCOL *DevicePath = NULL;
|
||||||
VENDOR_DEVICE_PATH *venPath = NULL;
|
VENDOR_DEVICE_PATH *venPath = NULL;
|
||||||
|
|
||||||
Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiDevicePathProtocolGuid,
|
Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiDevicePathProtocolGuid,
|
||||||
NULL, &Count, &Handles);
|
NULL, &Count, &Handles);
|
||||||
if (EFI_ERROR(Status))
|
if (EFI_ERROR(Status))
|
||||||
{
|
{
|
||||||
@@ -688,7 +688,7 @@ EFI_STATUS EFIAPI ventoy_fill_device_path(VOID)
|
|||||||
venPath->Header.Length[1] = 0;
|
venPath->Header.Length[1] = 0;
|
||||||
CopyMem(&venPath->Guid, &gVtoyBlockDevicePathGuid, sizeof(EFI_GUID));
|
CopyMem(&venPath->Guid, &gVtoyBlockDevicePathGuid, sizeof(EFI_GUID));
|
||||||
CopyMem(venPath + 1, VtoyDpName, NameLen);
|
CopyMem(venPath + 1, VtoyDpName, NameLen);
|
||||||
|
|
||||||
gBlockData.Path = AppendDevicePathNode(NULL, (EFI_DEVICE_PATH_PROTOCOL *)TmpBuf);
|
gBlockData.Path = AppendDevicePathNode(NULL, (EFI_DEVICE_PATH_PROTOCOL *)TmpBuf);
|
||||||
gBlockData.DevicePathCompareLen = sizeof(VENDOR_DEVICE_PATH) + NameLen;
|
gBlockData.DevicePathCompareLen = sizeof(VENDOR_DEVICE_PATH) + NameLen;
|
||||||
|
|
||||||
@@ -710,7 +710,7 @@ EFI_STATUS EFIAPI ventoy_connect_driver(IN EFI_HANDLE ControllerHandle, IN CONST
|
|||||||
|
|
||||||
debug("ventoy_connect_driver <%s>...", DrvName);
|
debug("ventoy_connect_driver <%s>...", DrvName);
|
||||||
|
|
||||||
Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiComponentName2ProtocolGuid,
|
Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiComponentName2ProtocolGuid,
|
||||||
NULL, &Count, &Handles);
|
NULL, &Count, &Handles);
|
||||||
if (EFI_ERROR(Status))
|
if (EFI_ERROR(Status))
|
||||||
{
|
{
|
||||||
@@ -748,7 +748,7 @@ EFI_STATUS EFIAPI ventoy_connect_driver(IN EFI_HANDLE ControllerHandle, IN CONST
|
|||||||
FreePool(Handles);
|
FreePool(Handles);
|
||||||
Handles = NULL;
|
Handles = NULL;
|
||||||
|
|
||||||
Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiComponentNameProtocolGuid,
|
Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiComponentNameProtocolGuid,
|
||||||
NULL, &Count, &Handles);
|
NULL, &Count, &Handles);
|
||||||
if (EFI_ERROR(Status))
|
if (EFI_ERROR(Status))
|
||||||
{
|
{
|
||||||
@@ -781,10 +781,10 @@ EFI_STATUS EFIAPI ventoy_connect_driver(IN EFI_HANDLE ControllerHandle, IN CONST
|
|||||||
}
|
}
|
||||||
|
|
||||||
Status = EFI_NOT_FOUND;
|
Status = EFI_NOT_FOUND;
|
||||||
|
|
||||||
end:
|
end:
|
||||||
FreePool(Handles);
|
FreePool(Handles);
|
||||||
|
|
||||||
return Status;
|
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
|
* 1. rEFInd File System Driver
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (StrStr(UpperDrvName, L"REFIND") && StrStr(UpperDrvName, L"FILE SYSTEM"))
|
if (StrStr(UpperDrvName, L"REFIND") && StrStr(UpperDrvName, L"FILE SYSTEM"))
|
||||||
{
|
{
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -820,7 +820,7 @@ STATIC BOOLEAN ventoy_filesystem_need_wrapper(IN CONST CHAR16 *DrvName)
|
|||||||
|
|
||||||
STATIC VOID ventoy_add_filesystem_wrapper
|
STATIC VOID ventoy_add_filesystem_wrapper
|
||||||
(
|
(
|
||||||
IN EFI_DRIVER_BINDING_PROTOCOL *DriverBindProtocol,
|
IN EFI_DRIVER_BINDING_PROTOCOL *DriverBindProtocol,
|
||||||
IN CONST CHAR16 *DriverName
|
IN CONST CHAR16 *DriverName
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@@ -865,10 +865,10 @@ STATIC EFI_STATUS ventoy_find_filesystem_driverbind(VOID)
|
|||||||
EFI_COMPONENT_NAME_PROTOCOL *NameProtocol = NULL;
|
EFI_COMPONENT_NAME_PROTOCOL *NameProtocol = NULL;
|
||||||
EFI_COMPONENT_NAME2_PROTOCOL *Name2Protocol = NULL;
|
EFI_COMPONENT_NAME2_PROTOCOL *Name2Protocol = NULL;
|
||||||
EFI_DRIVER_BINDING_PROTOCOL *DriverBindProtocol = NULL;
|
EFI_DRIVER_BINDING_PROTOCOL *DriverBindProtocol = NULL;
|
||||||
|
|
||||||
debug("ventoy_find_filesystem_driverbind...");
|
debug("ventoy_find_filesystem_driverbind...");
|
||||||
|
|
||||||
Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiComponentName2ProtocolGuid,
|
Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiComponentName2ProtocolGuid,
|
||||||
NULL, &Count, &Handles);
|
NULL, &Count, &Handles);
|
||||||
if (EFI_ERROR(Status))
|
if (EFI_ERROR(Status))
|
||||||
{
|
{
|
||||||
@@ -899,7 +899,7 @@ STATIC EFI_STATUS ventoy_find_filesystem_driverbind(VOID)
|
|||||||
FreePool(Handles);
|
FreePool(Handles);
|
||||||
Handles = NULL;
|
Handles = NULL;
|
||||||
|
|
||||||
Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiComponentNameProtocolGuid,
|
Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiComponentNameProtocolGuid,
|
||||||
NULL, &Count, &Handles);
|
NULL, &Count, &Handles);
|
||||||
if (EFI_ERROR(Status))
|
if (EFI_ERROR(Status))
|
||||||
{
|
{
|
||||||
@@ -927,7 +927,7 @@ STATIC EFI_STATUS ventoy_find_filesystem_driverbind(VOID)
|
|||||||
}
|
}
|
||||||
|
|
||||||
FreePool(Handles);
|
FreePool(Handles);
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -988,7 +988,7 @@ EFI_STATUS ventoy_disable_ex_filesystem(VOID)
|
|||||||
|
|
||||||
debug("Wrapper Ex Driver Binding %lu", g_DriverBindWrapperCnt);
|
debug("Wrapper Ex Driver Binding %lu", g_DriverBindWrapperCnt);
|
||||||
ventoy_debug_pause();
|
ventoy_debug_pause();
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1046,10 +1046,10 @@ EFI_STATUS EFIAPI ventoy_block_io_read_512
|
|||||||
if (BufferSize >= 2048)
|
if (BufferSize >= 2048)
|
||||||
{
|
{
|
||||||
ReadSize = BufferSize / 2048 * 2048;
|
ReadSize = BufferSize / 2048 * 2048;
|
||||||
|
|
||||||
Status |= g_sector_2048_read(This, MediaId, Lba / 4, ReadSize, CurBuf);
|
Status |= g_sector_2048_read(This, MediaId, Lba / 4, ReadSize, CurBuf);
|
||||||
CurBuf += ReadSize;
|
CurBuf += ReadSize;
|
||||||
|
|
||||||
Lba += ReadSize / 512;
|
Lba += ReadSize / 512;
|
||||||
BufferSize -= ReadSize;
|
BufferSize -= ReadSize;
|
||||||
}
|
}
|
||||||
@@ -1096,7 +1096,7 @@ EFI_STATUS EFIAPI ventoy_block_io_write_512
|
|||||||
ReadSize = (4 - Mod) * 512;
|
ReadSize = (4 - Mod) * 512;
|
||||||
CopyMem(g_sector_buf + Mod * 512, CurBuf, ReadSize);
|
CopyMem(g_sector_buf + Mod * 512, CurBuf, ReadSize);
|
||||||
g_sector_2048_write(This, MediaId, Lba / 4, 2048, g_sector_buf);
|
g_sector_2048_write(This, MediaId, Lba / 4, 2048, g_sector_buf);
|
||||||
|
|
||||||
CurBuf += ReadSize;
|
CurBuf += ReadSize;
|
||||||
Lba += (4 - Mod);
|
Lba += (4 - Mod);
|
||||||
BufferSize -= ReadSize;
|
BufferSize -= ReadSize;
|
||||||
@@ -1106,10 +1106,10 @@ EFI_STATUS EFIAPI ventoy_block_io_write_512
|
|||||||
if (BufferSize >= 2048)
|
if (BufferSize >= 2048)
|
||||||
{
|
{
|
||||||
ReadSize = BufferSize / 2048 * 2048;
|
ReadSize = BufferSize / 2048 * 2048;
|
||||||
|
|
||||||
Status |= g_sector_2048_write(This, MediaId, Lba / 4, ReadSize, CurBuf);
|
Status |= g_sector_2048_write(This, MediaId, Lba / 4, ReadSize, CurBuf);
|
||||||
CurBuf += ReadSize;
|
CurBuf += ReadSize;
|
||||||
|
|
||||||
Lba += ReadSize / 512;
|
Lba += ReadSize / 512;
|
||||||
BufferSize -= ReadSize;
|
BufferSize -= ReadSize;
|
||||||
}
|
}
|
||||||
@@ -1117,7 +1117,7 @@ EFI_STATUS EFIAPI ventoy_block_io_write_512
|
|||||||
if (BufferSize > 0)
|
if (BufferSize > 0)
|
||||||
{
|
{
|
||||||
Status |= g_sector_2048_read(This, MediaId, Lba / 4, 2048, g_sector_buf);
|
Status |= g_sector_2048_read(This, MediaId, Lba / 4, 2048, g_sector_buf);
|
||||||
|
|
||||||
CopyMem(g_sector_buf, CurBuf, BufferSize);
|
CopyMem(g_sector_buf, CurBuf, BufferSize);
|
||||||
g_sector_2048_write(This, MediaId, Lba / 4, 2048, g_sector_buf);
|
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 EFIAPI ventoy_install_blockio(IN EFI_HANDLE ImageHandle, IN UINT64 ImgSize)
|
||||||
{
|
{
|
||||||
EFI_STATUS Status = EFI_SUCCESS;
|
EFI_STATUS Status = EFI_SUCCESS;
|
||||||
EFI_BLOCK_IO_PROTOCOL *pBlockIo = &(gBlockData.BlockIo);
|
EFI_BLOCK_IO_PROTOCOL *pBlockIo = &(gBlockData.BlockIo);
|
||||||
|
|
||||||
ventoy_fill_device_path();
|
ventoy_fill_device_path();
|
||||||
|
|
||||||
debug("install block io protocol %p", ImageHandle);
|
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
|
else
|
||||||
{
|
{
|
||||||
gBlockData.Media.BlockSize = 2048;
|
gBlockData.Media.BlockSize = 2048;
|
||||||
gBlockData.Media.LastBlock = ImgSize / 2048 - 1;
|
gBlockData.Media.LastBlock = ImgSize / 2048 - 1;
|
||||||
gBlockData.Media.ReadOnly = TRUE;
|
gBlockData.Media.ReadOnly = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
gBlockData.Media.MediaPresent = 1;
|
gBlockData.Media.MediaPresent = 1;
|
||||||
gBlockData.Media.LogicalBlocksPerPhysicalBlock = 1;
|
gBlockData.Media.LogicalBlocksPerPhysicalBlock = 1;
|
||||||
|
|
||||||
@@ -1164,10 +1164,10 @@ EFI_STATUS EFIAPI ventoy_install_blockio(IN EFI_HANDLE ImageHandle, IN UINT64 Im
|
|||||||
}
|
}
|
||||||
else
|
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->WriteBlocks = ventoy_block_io_write;
|
||||||
}
|
}
|
||||||
|
|
||||||
pBlockIo->FlushBlocks = ventoy_block_io_flush;
|
pBlockIo->FlushBlocks = ventoy_block_io_flush;
|
||||||
|
|
||||||
Status = gBS->InstallMultipleProtocolInterfaces(&gBlockData.Handle,
|
Status = gBS->InstallMultipleProtocolInterfaces(&gBlockData.Handle,
|
||||||
@@ -1295,7 +1295,7 @@ DEF_WRAP_FUNC(7);
|
|||||||
#error "VTOY_MAX_CONF_REPLACE overflow"
|
#error "VTOY_MAX_CONF_REPLACE overflow"
|
||||||
#endif
|
#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_img0,
|
||||||
ventoy_wrapper_file_flush_ex_img1,
|
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 g_img_file_replace + i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1369,7 +1369,7 @@ ventoy_wrapper_file_set_pos(EFI_FILE_HANDLE This, UINT64 Position)
|
|||||||
ventoy_efi_file_replace *replace = NULL;
|
ventoy_efi_file_replace *replace = NULL;
|
||||||
|
|
||||||
replace = ventoy_wrapper_get_replace(This);
|
replace = ventoy_wrapper_get_replace(This);
|
||||||
|
|
||||||
if (Position <= replace->FileSizeBytes)
|
if (Position <= replace->FileSizeBytes)
|
||||||
{
|
{
|
||||||
replace->CurPos = Position;
|
replace->CurPos = Position;
|
||||||
@@ -1378,7 +1378,7 @@ ventoy_wrapper_file_set_pos(EFI_FILE_HANDLE This, UINT64 Position)
|
|||||||
{
|
{
|
||||||
replace->CurPos = replace->FileSizeBytes;
|
replace->CurPos = replace->FileSizeBytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
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;
|
//Info->FileName = EFI_FILE_READ_ONLY;
|
||||||
|
|
||||||
*Len = Info->Size;
|
*Len = Info->Size;
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
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;
|
ventoy_efi_file_replace *replace = NULL;
|
||||||
|
|
||||||
replace = ventoy_wrapper_get_replace(This);
|
replace = ventoy_wrapper_get_replace(This);
|
||||||
|
|
||||||
debug("ventoy_wrapper_file_read ... %u", *Len);
|
debug("ventoy_wrapper_file_read ... %u", *Len);
|
||||||
|
|
||||||
if (replace->CurPos + ReadLen > replace->FileSizeBytes)
|
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)
|
STATIC BOOLEAN EFIAPI ventoy_replace_name_match(CHAR8 *pReplace, CHAR8 *pName)
|
||||||
{
|
{
|
||||||
UINTN Len1, Len2;
|
UINTN Len1, Len2;
|
||||||
|
|
||||||
Len1 = AsciiStrLen(pReplace);
|
Len1 = AsciiStrLen(pReplace);
|
||||||
Len2 = AsciiStrLen(pName);
|
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
|
STATIC EFI_STATUS EFIAPI ventoy_wrapper_file_open
|
||||||
(
|
(
|
||||||
EFI_FILE_HANDLE This,
|
EFI_FILE_HANDLE This,
|
||||||
EFI_FILE_HANDLE *New,
|
EFI_FILE_HANDLE *New,
|
||||||
CHAR16 *Name,
|
CHAR16 *Name,
|
||||||
UINT64 Mode,
|
UINT64 Mode,
|
||||||
UINT64 Attributes
|
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;
|
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);
|
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.BlockIoSectorStart = virt->mem_sector_start;
|
||||||
g_efi_file_replace.FileSizeBytes = Sectors * 2048;
|
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);
|
g_efi_file_replace.BlockIoSectorStart, Sectors, Sectors * 2048);
|
||||||
sleep(3);
|
sleep(3);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1605,9 +1605,9 @@ STATIC EFI_STATUS EFIAPI ventoy_wrapper_file_open
|
|||||||
{
|
{
|
||||||
AsciiStrCpyS(OldName, sizeof(OldName), replace->old_file_name[j]);
|
AsciiStrCpyS(OldName, sizeof(OldName), replace->old_file_name[j]);
|
||||||
if ((0 == AsciiStrCmp(OldName, TmpName)) ||
|
if ((0 == AsciiStrCmp(OldName, TmpName)) ||
|
||||||
(AsciiStrnCmp(OldName, "\\loader\\entries\\", 16) == 0 &&
|
(AsciiStrnCmp(OldName, "\\loader\\entries\\", 16) == 0 &&
|
||||||
AsciiStrCmp(OldName + 16, TmpName) == 0
|
AsciiStrCmp(OldName + 16, TmpName) == 0
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
g_original_fclose(*New);
|
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;
|
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);
|
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].BlockIoSectorStart = virt->mem_sector_start;
|
||||||
g_img_file_replace[i].FileSizeBytes = Sectors * 2048;
|
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);
|
g_img_file_replace[i].BlockIoSectorStart, Sectors, Sectors * 2048);
|
||||||
sleep(3);
|
sleep(3);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1648,7 +1648,7 @@ EFI_STATUS EFIAPI ventoy_wrapper_open_volume
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
EFI_STATUS Status = EFI_SUCCESS;
|
EFI_STATUS Status = EFI_SUCCESS;
|
||||||
|
|
||||||
Status = g_original_open_volume(This, Root);
|
Status = g_original_open_volume(This, Root);
|
||||||
if (!EFI_ERROR(Status))
|
if (!EFI_ERROR(Status))
|
||||||
{
|
{
|
||||||
@@ -1685,10 +1685,10 @@ STATIC EFI_STATUS EFIAPI ventoy_wrapper_read_key_ex
|
|||||||
KeyData->Key.UnicodeChar = 0;
|
KeyData->Key.UnicodeChar = 0;
|
||||||
KeyData->KeyState.KeyShiftState = 0;
|
KeyData->KeyState.KeyShiftState = 0;
|
||||||
KeyData->KeyState.KeyToggleState = 0;
|
KeyData->KeyState.KeyToggleState = 0;
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
return g_org_read_key_ex(This, KeyData);
|
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;
|
g_org_read_key = gST->ConIn->ReadKeyStroke;
|
||||||
gST->ConIn->ReadKeyStroke = ventoy_wrapper_read_key;
|
gST->ConIn->ReadKeyStroke = ventoy_wrapper_read_key;
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1763,7 +1763,7 @@ STATIC EFI_STATUS EFIAPI ventoy_wrapper_locate_handle
|
|||||||
EFI_STATUS Status = EFI_SUCCESS;
|
EFI_STATUS Status = EFI_SUCCESS;
|
||||||
|
|
||||||
Status = g_org_locate_handle(SearchType, Protocol, SearchKey, BufferSize, Buffer);
|
Status = g_org_locate_handle(SearchType, Protocol, SearchKey, BufferSize, Buffer);
|
||||||
|
|
||||||
if (EFI_SUCCESS == Status && Protocol && CompareGuid(&gEfiBlockIoProtocolGuid, Protocol))
|
if (EFI_SUCCESS == Status && Protocol && CompareGuid(&gEfiBlockIoProtocolGuid, Protocol))
|
||||||
{
|
{
|
||||||
for (i = 0; i < (*BufferSize) / sizeof(EFI_HANDLE); i++)
|
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;
|
g_org_locate_handle = gBS->LocateHandle;
|
||||||
gBS->LocateHandle = ventoy_wrapper_locate_handle;
|
gBS->LocateHandle = ventoy_wrapper_locate_handle;
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1793,7 +1793,112 @@ EFI_STATUS ventoy_hook_1st_cdrom_stop(VOID)
|
|||||||
{
|
{
|
||||||
gBS->LocateHandle = g_org_locate_handle;
|
gBS->LocateHandle = g_org_locate_handle;
|
||||||
g_org_locate_handle = NULL;
|
g_org_locate_handle = NULL;
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
/* For force highest resolution for Windows/WinPE */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
STATIC UINT32 g_org_mode_num;
|
||||||
|
STATIC EFI_GRAPHICS_OUTPUT_PROTOCOL_SET_MODE g_org_set_mode = NULL;
|
||||||
|
|
||||||
|
STATIC EFI_STATUS EFIAPI ventoy_set_mode
|
||||||
|
(
|
||||||
|
IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,
|
||||||
|
IN UINT32 ModeNumber
|
||||||
|
)
|
||||||
|
{
|
||||||
|
(void)This;
|
||||||
|
(void)ModeNumber;
|
||||||
|
|
||||||
|
/* Force highest resolution */
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_STATUS ventoy_lock_max_res(VOID)
|
||||||
|
{
|
||||||
|
UINT32 i = 0;
|
||||||
|
UINT32 x = 0;
|
||||||
|
UINT32 y = 0;
|
||||||
|
UINT32 CurMode = 0;
|
||||||
|
UINT32 Highest = 0;
|
||||||
|
UINTN Size;
|
||||||
|
EFI_STATUS rc;
|
||||||
|
EFI_GRAPHICS_OUTPUT_PROTOCOL *gop = NULL;
|
||||||
|
EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *info = NULL;
|
||||||
|
|
||||||
|
/* already hook */
|
||||||
|
if (g_org_set_mode)
|
||||||
|
{
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
rc = gBS->LocateProtocol(&gEfiGraphicsOutputProtocolGuid, NULL, (void **)&gop);
|
||||||
|
if (rc != EFI_SUCCESS)
|
||||||
|
{
|
||||||
|
debug("Failed to locate GOP protocol");
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
CurMode = gop->Mode->Mode;
|
||||||
|
|
||||||
|
for (i = 0 ; i < gop->Mode->MaxMode ; i++)
|
||||||
|
{
|
||||||
|
/* Get mode information */
|
||||||
|
if (gop->QueryMode(gop, i, &Size, &info) == EFI_SUCCESS)
|
||||||
|
{
|
||||||
|
if (x < info->HorizontalResolution ||
|
||||||
|
(x == info->HorizontalResolution && y < info->VerticalResolution))
|
||||||
|
{
|
||||||
|
Highest = i;
|
||||||
|
x = info->HorizontalResolution;
|
||||||
|
y = info->VerticalResolution;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Highest != CurMode)
|
||||||
|
{
|
||||||
|
gop->SetMode(gop, Highest);
|
||||||
|
}
|
||||||
|
|
||||||
|
debug("Lock resolution to Mode:%d %d x %d", Highest, x, y);
|
||||||
|
|
||||||
|
g_org_mode_num = CurMode;
|
||||||
|
g_org_set_mode = gop->SetMode;
|
||||||
|
gop->SetMode = ventoy_set_mode;
|
||||||
|
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_STATUS ventoy_unlock_max_res(VOID)
|
||||||
|
{
|
||||||
|
EFI_STATUS rc;
|
||||||
|
EFI_GRAPHICS_OUTPUT_PROTOCOL *gop = NULL;
|
||||||
|
|
||||||
|
/* not hooked yet */
|
||||||
|
if (!g_org_set_mode)
|
||||||
|
{
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
rc = gBS->LocateProtocol(&gEfiGraphicsOutputProtocolGuid, NULL, (void **)&gop);
|
||||||
|
if (rc != EFI_SUCCESS)
|
||||||
|
{
|
||||||
|
debug("Failed to locate GOP protocol");
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
g_org_set_mode(gop, g_org_mode_num);
|
||||||
|
|
||||||
|
gop->SetMode = g_org_set_mode;
|
||||||
|
g_org_set_mode = NULL;
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
2282
GRUB2/MOD_SRC/grub-2.04/grub-core/fs/btrfs.c
Normal file
2282
GRUB2/MOD_SRC/grub-2.04/grub-core/fs/btrfs.c
Normal file
File diff suppressed because it is too large
Load Diff
@@ -23,11 +23,25 @@
|
|||||||
#include <grub/misc.h>
|
#include <grub/misc.h>
|
||||||
#include <grub/disk.h>
|
#include <grub/disk.h>
|
||||||
#include <grub/dl.h>
|
#include <grub/dl.h>
|
||||||
|
#include <grub/time.h>
|
||||||
#include <grub/types.h>
|
#include <grub/types.h>
|
||||||
#include <grub/fshelp.h>
|
#include <grub/fshelp.h>
|
||||||
|
|
||||||
GRUB_MOD_LICENSE ("GPLv3+");
|
GRUB_MOD_LICENSE ("GPLv3+");
|
||||||
|
|
||||||
|
#define NSEC_PER_SEC ((grub_int64_t) 1000000000)
|
||||||
|
|
||||||
|
// GRUB 2.04 doesn't have safemath.h
|
||||||
|
// #include <grub/safemath.h>
|
||||||
|
|
||||||
|
// gcc < 5.1 doesn't support __builtin_add_overflow and __builtin_mul_overflow
|
||||||
|
// #define grub_add(a, b, res) __builtin_add_overflow(a, b, res)
|
||||||
|
// #define grub_mul(a, b, res) __builtin_mul_overflow(a, b, res)
|
||||||
|
// Warning: This is unsafe!
|
||||||
|
#define grub_add(a, b, res) ({ *(res) = (a) + (b); 0; })
|
||||||
|
|
||||||
|
#define grub_mul(a, b, res) ({ *(res) = (a) * (b); 0; })
|
||||||
|
|
||||||
#define XFS_INODE_EXTENTS 9
|
#define XFS_INODE_EXTENTS 9
|
||||||
|
|
||||||
#define XFS_INODE_FORMAT_INO 1
|
#define XFS_INODE_FORMAT_INO 1
|
||||||
@@ -74,10 +88,22 @@ GRUB_MOD_LICENSE ("GPLv3+");
|
|||||||
XFS_SB_VERSION2_PROJID32BIT | \
|
XFS_SB_VERSION2_PROJID32BIT | \
|
||||||
XFS_SB_VERSION2_FTYPE)
|
XFS_SB_VERSION2_FTYPE)
|
||||||
|
|
||||||
|
/* Inode flags2 flags */
|
||||||
|
#define XFS_DIFLAG2_BIGTIME_BIT 3
|
||||||
|
#define XFS_DIFLAG2_BIGTIME (1 << XFS_DIFLAG2_BIGTIME_BIT)
|
||||||
|
#define XFS_DIFLAG2_NREXT64_BIT 4
|
||||||
|
#define XFS_DIFLAG2_NREXT64 (1 << XFS_DIFLAG2_NREXT64_BIT)
|
||||||
|
|
||||||
/* incompat feature flags */
|
/* incompat feature flags */
|
||||||
#define XFS_SB_FEAT_INCOMPAT_FTYPE (1 << 0) /* filetype in dirent */
|
#define XFS_SB_FEAT_INCOMPAT_FTYPE (1 << 0) /* filetype in dirent */
|
||||||
#define XFS_SB_FEAT_INCOMPAT_SPINODES (1 << 1) /* sparse inode chunks */
|
#define XFS_SB_FEAT_INCOMPAT_SPINODES (1 << 1) /* sparse inode chunks */
|
||||||
#define XFS_SB_FEAT_INCOMPAT_META_UUID (1 << 2) /* metadata UUID */
|
#define XFS_SB_FEAT_INCOMPAT_META_UUID (1 << 2) /* metadata UUID */
|
||||||
|
#define XFS_SB_FEAT_INCOMPAT_BIGTIME (1 << 3) /* large timestamps */
|
||||||
|
#define XFS_SB_FEAT_INCOMPAT_NEEDSREPAIR (1 << 4) /* needs xfs_repair */
|
||||||
|
#define XFS_SB_FEAT_INCOMPAT_NREXT64 (1 << 5) /* large extent counters */
|
||||||
|
#define XFS_SB_FEAT_INCOMPAT_EXCHRANGE (1 << 6) /* exchangerange supported */
|
||||||
|
#define XFS_SB_FEAT_INCOMPAT_PARENT (1 << 7) /* parent pointers */
|
||||||
|
#define XFS_SB_FEAT_INCOMPAT_METADIR (1 << 8) /* metadata dir tree */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Directory entries with ftype are explicitly handled by GRUB code.
|
* Directory entries with ftype are explicitly handled by GRUB code.
|
||||||
@@ -87,11 +113,26 @@ GRUB_MOD_LICENSE ("GPLv3+");
|
|||||||
*
|
*
|
||||||
* We do not currently verify metadata UUID, so it is safe to read filesystems
|
* We do not currently verify metadata UUID, so it is safe to read filesystems
|
||||||
* with the XFS_SB_FEAT_INCOMPAT_META_UUID feature.
|
* with the XFS_SB_FEAT_INCOMPAT_META_UUID feature.
|
||||||
|
*
|
||||||
|
* We do not currently replay the log, so it is safe to read filesystems
|
||||||
|
* with the XFS_SB_FEAT_INCOMPAT_EXCHRANGE feature.
|
||||||
|
*
|
||||||
|
* We do not currently read directory parent pointers, so it is safe to read
|
||||||
|
* filesystems with the XFS_SB_FEAT_INCOMPAT_PARENT feature.
|
||||||
|
*
|
||||||
|
* We do not currently look at realtime or quota metadata, so it is safe to
|
||||||
|
* read filesystems with the XFS_SB_FEAT_INCOMPAT_METADIR feature.
|
||||||
*/
|
*/
|
||||||
#define XFS_SB_FEAT_INCOMPAT_SUPPORTED \
|
#define XFS_SB_FEAT_INCOMPAT_SUPPORTED \
|
||||||
(XFS_SB_FEAT_INCOMPAT_FTYPE | \
|
(XFS_SB_FEAT_INCOMPAT_FTYPE | \
|
||||||
XFS_SB_FEAT_INCOMPAT_SPINODES | \
|
XFS_SB_FEAT_INCOMPAT_SPINODES | \
|
||||||
XFS_SB_FEAT_INCOMPAT_META_UUID)
|
XFS_SB_FEAT_INCOMPAT_META_UUID | \
|
||||||
|
XFS_SB_FEAT_INCOMPAT_BIGTIME | \
|
||||||
|
XFS_SB_FEAT_INCOMPAT_NEEDSREPAIR | \
|
||||||
|
XFS_SB_FEAT_INCOMPAT_NREXT64 | \
|
||||||
|
XFS_SB_FEAT_INCOMPAT_EXCHRANGE | \
|
||||||
|
XFS_SB_FEAT_INCOMPAT_PARENT | \
|
||||||
|
XFS_SB_FEAT_INCOMPAT_METADIR)
|
||||||
|
|
||||||
struct grub_xfs_sblock
|
struct grub_xfs_sblock
|
||||||
{
|
{
|
||||||
@@ -176,33 +217,49 @@ struct grub_xfs_btree_root
|
|||||||
grub_uint64_t keys[1];
|
grub_uint64_t keys[1];
|
||||||
} GRUB_PACKED;
|
} GRUB_PACKED;
|
||||||
|
|
||||||
struct grub_xfs_time
|
struct grub_xfs_time_legacy
|
||||||
{
|
{
|
||||||
grub_uint32_t sec;
|
grub_uint32_t sec;
|
||||||
grub_uint32_t nanosec;
|
grub_uint32_t nanosec;
|
||||||
} GRUB_PACKED;
|
} GRUB_PACKED;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The struct grub_xfs_inode layout was taken from the
|
||||||
|
* struct xfs_dinode_core which is described here:
|
||||||
|
* https://mirrors.edge.kernel.org/pub/linux/utils/fs/xfs/docs/xfs_filesystem_structure.pdf
|
||||||
|
*/
|
||||||
struct grub_xfs_inode
|
struct grub_xfs_inode
|
||||||
{
|
{
|
||||||
grub_uint8_t magic[2];
|
grub_uint8_t magic[2];
|
||||||
grub_uint16_t mode;
|
grub_uint16_t mode;
|
||||||
grub_uint8_t version;
|
grub_uint8_t version;
|
||||||
grub_uint8_t format;
|
grub_uint8_t format;
|
||||||
grub_uint8_t unused2[26];
|
grub_uint8_t unused2[18];
|
||||||
struct grub_xfs_time atime;
|
grub_uint64_t nextents_big;
|
||||||
struct grub_xfs_time mtime;
|
grub_uint64_t atime;
|
||||||
struct grub_xfs_time ctime;
|
grub_uint64_t mtime;
|
||||||
|
grub_uint64_t ctime;
|
||||||
grub_uint64_t size;
|
grub_uint64_t size;
|
||||||
grub_uint64_t nblocks;
|
grub_uint64_t nblocks;
|
||||||
grub_uint32_t extsize;
|
grub_uint32_t extsize;
|
||||||
grub_uint32_t nextents;
|
grub_uint32_t nextents;
|
||||||
grub_uint16_t unused3;
|
grub_uint16_t unused3;
|
||||||
grub_uint8_t fork_offset;
|
grub_uint8_t fork_offset;
|
||||||
grub_uint8_t unused4[17];
|
grub_uint8_t unused4[17]; /* Last member of inode v2. */
|
||||||
|
grub_uint8_t unused5[20]; /* First member of inode v3. */
|
||||||
|
grub_uint64_t flags2;
|
||||||
|
grub_uint8_t unused6[48]; /* Last member of inode v3. */
|
||||||
} GRUB_PACKED;
|
} GRUB_PACKED;
|
||||||
|
|
||||||
#define XFS_V2_INODE_SIZE sizeof(struct grub_xfs_inode)
|
#define XFS_V3_INODE_SIZE sizeof(struct grub_xfs_inode)
|
||||||
#define XFS_V3_INODE_SIZE (XFS_V2_INODE_SIZE + 76)
|
/* Size of struct grub_xfs_inode v2, up to unused4 member included. */
|
||||||
|
#define XFS_V2_INODE_SIZE (XFS_V3_INODE_SIZE - 76)
|
||||||
|
|
||||||
|
struct grub_xfs_dir_leaf_entry
|
||||||
|
{
|
||||||
|
grub_uint32_t hashval;
|
||||||
|
grub_uint32_t address;
|
||||||
|
} GRUB_PACKED;
|
||||||
|
|
||||||
struct grub_xfs_dirblock_tail
|
struct grub_xfs_dirblock_tail
|
||||||
{
|
{
|
||||||
@@ -220,6 +277,7 @@ struct grub_fshelp_node
|
|||||||
|
|
||||||
struct grub_xfs_data
|
struct grub_xfs_data
|
||||||
{
|
{
|
||||||
|
grub_size_t data_size;
|
||||||
struct grub_xfs_sblock sblock;
|
struct grub_xfs_sblock sblock;
|
||||||
grub_disk_t disk;
|
grub_disk_t disk;
|
||||||
int pos;
|
int pos;
|
||||||
@@ -232,8 +290,6 @@ struct grub_xfs_data
|
|||||||
|
|
||||||
static grub_dl_t my_mod;
|
static grub_dl_t my_mod;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static int grub_xfs_sb_hascrc(struct grub_xfs_data *data)
|
static int grub_xfs_sb_hascrc(struct grub_xfs_data *data)
|
||||||
{
|
{
|
||||||
return (data->sblock.version & grub_cpu_to_be16_compile_time(XFS_SB_VERSION_NUMBITS)) ==
|
return (data->sblock.version & grub_cpu_to_be16_compile_time(XFS_SB_VERSION_NUMBITS)) ==
|
||||||
@@ -296,9 +352,21 @@ static int grub_xfs_sb_valid(struct grub_xfs_data *data)
|
|||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
grub_error (GRUB_ERR_BAD_FS, "unsupported XFS filesystem version");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
grub_xfs_sb_needs_repair (struct grub_xfs_data *data)
|
||||||
|
{
|
||||||
|
return ((data->sblock.version &
|
||||||
|
grub_cpu_to_be16_compile_time (XFS_SB_VERSION_NUMBITS)) ==
|
||||||
|
grub_cpu_to_be16_compile_time (XFS_SB_VERSION_5) &&
|
||||||
|
(data->sblock.sb_features_incompat &
|
||||||
|
grub_cpu_to_be32_compile_time (XFS_SB_FEAT_INCOMPAT_NEEDSREPAIR)));
|
||||||
|
}
|
||||||
|
|
||||||
/* Filetype information as used in inodes. */
|
/* Filetype information as used in inodes. */
|
||||||
#define FILETYPE_INO_MASK 0170000
|
#define FILETYPE_INO_MASK 0170000
|
||||||
#define FILETYPE_INO_REG 0100000
|
#define FILETYPE_INO_REG 0100000
|
||||||
@@ -354,7 +422,6 @@ GRUB_XFS_EXTENT_SIZE (struct grub_xfs_extent *exts, int ex)
|
|||||||
return (grub_be_to_cpu32 (exts[ex].raw[3]) & ((1 << 21) - 1));
|
return (grub_be_to_cpu32 (exts[ex].raw[3]) & ((1 << 21) - 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static inline grub_uint64_t
|
static inline grub_uint64_t
|
||||||
grub_xfs_inode_block (struct grub_xfs_data *data,
|
grub_xfs_inode_block (struct grub_xfs_data *data,
|
||||||
grub_uint64_t ino)
|
grub_uint64_t ino)
|
||||||
@@ -489,7 +556,7 @@ grub_xfs_read_inode (struct grub_xfs_data *data, grub_uint64_t ino,
|
|||||||
grub_uint64_t block = grub_xfs_inode_block (data, ino);
|
grub_uint64_t block = grub_xfs_inode_block (data, ino);
|
||||||
int offset = grub_xfs_inode_offset (data, ino);
|
int offset = grub_xfs_inode_offset (data, ino);
|
||||||
|
|
||||||
grub_dprintf("xfs", "Reading inode (%"PRIuGRUB_UINT64_T") - %"PRIuGRUB_UINT64_T", %d\n",
|
grub_dprintf("xfs", "Reading inode (%" PRIuGRUB_UINT64_T ") - %" PRIuGRUB_UINT64_T ", %d\n",
|
||||||
ino, block, offset);
|
ino, block, offset);
|
||||||
/* Read the inode. */
|
/* Read the inode. */
|
||||||
if (grub_disk_read (data->disk, block, offset, grub_xfs_inode_size(data),
|
if (grub_disk_read (data->disk, block, offset, grub_xfs_inode_size(data),
|
||||||
@@ -509,11 +576,26 @@ get_fsb (const void *keys, int idx)
|
|||||||
return grub_be_to_cpu64 (grub_get_unaligned64 (p));
|
return grub_be_to_cpu64 (grub_get_unaligned64 (p));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
grub_xfs_inode_has_large_extent_counts (const struct grub_xfs_inode *inode)
|
||||||
|
{
|
||||||
|
return inode->version >= 3 &&
|
||||||
|
(inode->flags2 & grub_cpu_to_be64_compile_time (XFS_DIFLAG2_NREXT64));
|
||||||
|
}
|
||||||
|
|
||||||
|
static grub_uint64_t
|
||||||
|
grub_xfs_get_inode_nextents (struct grub_xfs_inode *inode)
|
||||||
|
{
|
||||||
|
return (grub_xfs_inode_has_large_extent_counts (inode)) ?
|
||||||
|
grub_be_to_cpu64 (inode->nextents_big) :
|
||||||
|
grub_be_to_cpu32 (inode->nextents);
|
||||||
|
}
|
||||||
|
|
||||||
static grub_disk_addr_t
|
static grub_disk_addr_t
|
||||||
grub_xfs_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock)
|
grub_xfs_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock)
|
||||||
{
|
{
|
||||||
struct grub_xfs_btree_node *leaf = 0;
|
struct grub_xfs_btree_node *leaf = 0;
|
||||||
int ex, nrec;
|
grub_uint64_t ex, nrec;
|
||||||
struct grub_xfs_extent *exts;
|
struct grub_xfs_extent *exts;
|
||||||
grub_uint64_t ret = 0;
|
grub_uint64_t ret = 0;
|
||||||
|
|
||||||
@@ -538,7 +620,18 @@ grub_xfs_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock)
|
|||||||
/ (2 * sizeof (grub_uint64_t));
|
/ (2 * sizeof (grub_uint64_t));
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
int i;
|
grub_uint64_t i;
|
||||||
|
grub_addr_t keys_end, data_end;
|
||||||
|
|
||||||
|
if (grub_mul (sizeof (grub_uint64_t), nrec, &keys_end) ||
|
||||||
|
grub_add ((grub_addr_t) keys, keys_end, &keys_end) ||
|
||||||
|
grub_add ((grub_addr_t) node->data, node->data->data_size, &data_end) ||
|
||||||
|
keys_end > data_end)
|
||||||
|
{
|
||||||
|
grub_error (GRUB_ERR_BAD_FS, "invalid number of XFS root keys");
|
||||||
|
grub_free (leaf);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0; i < nrec; i++)
|
for (i = 0; i < nrec; i++)
|
||||||
{
|
{
|
||||||
@@ -556,7 +649,10 @@ grub_xfs_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock)
|
|||||||
if (grub_disk_read (node->data->disk,
|
if (grub_disk_read (node->data->disk,
|
||||||
GRUB_XFS_FSB_TO_BLOCK (node->data, get_fsb (keys, i - 1 + recoffset)) << (node->data->sblock.log2_bsize - GRUB_DISK_SECTOR_BITS),
|
GRUB_XFS_FSB_TO_BLOCK (node->data, get_fsb (keys, i - 1 + recoffset)) << (node->data->sblock.log2_bsize - GRUB_DISK_SECTOR_BITS),
|
||||||
0, node->data->bsize, leaf))
|
0, node->data->bsize, leaf))
|
||||||
return 0;
|
{
|
||||||
|
grub_free (leaf);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if ((!node->data->hascrc &&
|
if ((!node->data->hascrc &&
|
||||||
grub_strncmp ((char *) leaf->magic, "BMAP", 4)) ||
|
grub_strncmp ((char *) leaf->magic, "BMAP", 4)) ||
|
||||||
@@ -579,8 +675,20 @@ grub_xfs_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock)
|
|||||||
}
|
}
|
||||||
else if (node->inode.format == XFS_INODE_FORMAT_EXT)
|
else if (node->inode.format == XFS_INODE_FORMAT_EXT)
|
||||||
{
|
{
|
||||||
nrec = grub_be_to_cpu32 (node->inode.nextents);
|
grub_addr_t exts_end = 0;
|
||||||
|
grub_addr_t data_end = 0;
|
||||||
|
|
||||||
|
nrec = grub_xfs_get_inode_nextents (&node->inode);
|
||||||
exts = (struct grub_xfs_extent *) grub_xfs_inode_data(&node->inode);
|
exts = (struct grub_xfs_extent *) grub_xfs_inode_data(&node->inode);
|
||||||
|
|
||||||
|
if (grub_mul (sizeof (struct grub_xfs_extent), nrec, &exts_end) ||
|
||||||
|
grub_add ((grub_addr_t) node->data, exts_end, &exts_end) ||
|
||||||
|
grub_add ((grub_addr_t) node->data, node->data->data_size, &data_end) ||
|
||||||
|
exts_end > data_end)
|
||||||
|
{
|
||||||
|
grub_error (GRUB_ERR_BAD_FS, "invalid number of XFS extents");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -634,6 +742,7 @@ static char *
|
|||||||
grub_xfs_read_symlink (grub_fshelp_node_t node)
|
grub_xfs_read_symlink (grub_fshelp_node_t node)
|
||||||
{
|
{
|
||||||
grub_ssize_t size = grub_be_to_cpu64 (node->inode.size);
|
grub_ssize_t size = grub_be_to_cpu64 (node->inode.size);
|
||||||
|
grub_size_t sz;
|
||||||
|
|
||||||
if (size < 0)
|
if (size < 0)
|
||||||
{
|
{
|
||||||
@@ -655,7 +764,12 @@ grub_xfs_read_symlink (grub_fshelp_node_t node)
|
|||||||
if (node->data->hascrc)
|
if (node->data->hascrc)
|
||||||
off = 56;
|
off = 56;
|
||||||
|
|
||||||
symlink = grub_malloc (size + 1);
|
if (grub_add (size, 1, &sz))
|
||||||
|
{
|
||||||
|
grub_error (GRUB_ERR_OUT_OF_RANGE, N_("symlink size overflow"));
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
symlink = grub_malloc (sz);
|
||||||
if (!symlink)
|
if (!symlink)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@@ -705,8 +819,15 @@ static int iterate_dir_call_hook (grub_uint64_t ino, const char *filename,
|
|||||||
{
|
{
|
||||||
struct grub_fshelp_node *fdiro;
|
struct grub_fshelp_node *fdiro;
|
||||||
grub_err_t err;
|
grub_err_t err;
|
||||||
|
grub_size_t sz;
|
||||||
|
|
||||||
fdiro = grub_malloc (grub_xfs_fshelp_size(ctx->diro->data) + 1);
|
if (grub_add (grub_xfs_fshelp_size(ctx->diro->data), 1, &sz))
|
||||||
|
{
|
||||||
|
grub_error (GRUB_ERR_OUT_OF_RANGE, N_("directory data size overflow"));
|
||||||
|
grub_print_error ();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
fdiro = grub_malloc (sz);
|
||||||
if (!fdiro)
|
if (!fdiro)
|
||||||
{
|
{
|
||||||
grub_print_error ();
|
grub_print_error ();
|
||||||
@@ -722,6 +843,7 @@ static int iterate_dir_call_hook (grub_uint64_t ino, const char *filename,
|
|||||||
if (err)
|
if (err)
|
||||||
{
|
{
|
||||||
grub_print_error ();
|
grub_print_error ();
|
||||||
|
grub_free (fdiro);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -764,12 +886,20 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir,
|
|||||||
if (iterate_dir_call_hook (parent, "..", &ctx))
|
if (iterate_dir_call_hook (parent, "..", &ctx))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
for (i = 0; i < head->count; i++)
|
for (i = 0; i < head->count &&
|
||||||
|
(grub_uint8_t *) de < ((grub_uint8_t *) dir + grub_xfs_fshelp_size (dir->data)); i++)
|
||||||
{
|
{
|
||||||
grub_uint64_t ino;
|
grub_uint64_t ino;
|
||||||
grub_uint8_t *inopos = grub_xfs_inline_de_inopos(dir->data, de);
|
grub_uint8_t *inopos = grub_xfs_inline_de_inopos(dir->data, de);
|
||||||
grub_uint8_t c;
|
grub_uint8_t c;
|
||||||
|
|
||||||
|
if ((inopos + (smallino ? 4 : 8)) > (grub_uint8_t *) dir + grub_xfs_fshelp_size (dir->data))
|
||||||
|
{
|
||||||
|
grub_error (GRUB_ERR_BAD_FS, "invalid XFS inode");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* inopos might be unaligned. */
|
/* inopos might be unaligned. */
|
||||||
if (smallino)
|
if (smallino)
|
||||||
ino = (((grub_uint32_t) inopos[0]) << 24)
|
ino = (((grub_uint32_t) inopos[0]) << 24)
|
||||||
@@ -824,24 +954,49 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir,
|
|||||||
{
|
{
|
||||||
struct grub_xfs_dir2_entry *direntry =
|
struct grub_xfs_dir2_entry *direntry =
|
||||||
grub_xfs_first_de(dir->data, dirblock);
|
grub_xfs_first_de(dir->data, dirblock);
|
||||||
int entries;
|
int entries = -1;
|
||||||
struct grub_xfs_dirblock_tail *tail =
|
char *end = dirblock + dirblk_size;
|
||||||
grub_xfs_dir_tail(dir->data, dirblock);
|
grub_uint32_t magic;
|
||||||
|
|
||||||
numread = grub_xfs_read_file (dir, 0, 0,
|
numread = grub_xfs_read_file (dir, 0, 0,
|
||||||
blk << dirblk_log2,
|
blk << dirblk_log2,
|
||||||
dirblk_size, dirblock, 0);
|
dirblk_size, dirblock, 0);
|
||||||
if (numread != dirblk_size)
|
if (numread != dirblk_size)
|
||||||
return 0;
|
{
|
||||||
|
grub_free (dirblock);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
entries = (grub_be_to_cpu32 (tail->leaf_count)
|
/*
|
||||||
- grub_be_to_cpu32 (tail->leaf_stale));
|
* If this data block isn't actually part of the extent list then
|
||||||
|
* grub_xfs_read_file() returns a block of zeros. So, if the magic
|
||||||
if (!entries)
|
* number field is all zeros then this block should be skipped.
|
||||||
|
*/
|
||||||
|
magic = *(grub_uint32_t *)(void *) dirblock;
|
||||||
|
if (!magic)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Leaf and tail information are only in the data block if the number
|
||||||
|
* of extents is 1.
|
||||||
|
*/
|
||||||
|
if (grub_xfs_get_inode_nextents (&dir->inode) == 1)
|
||||||
|
{
|
||||||
|
struct grub_xfs_dirblock_tail *tail = grub_xfs_dir_tail (dir->data, dirblock);
|
||||||
|
|
||||||
|
end = (char *) tail;
|
||||||
|
|
||||||
|
/* Subtract the space used by leaf nodes. */
|
||||||
|
end -= grub_be_to_cpu32 (tail->leaf_count) * sizeof (struct grub_xfs_dir_leaf_entry);
|
||||||
|
|
||||||
|
entries = grub_be_to_cpu32 (tail->leaf_count) - grub_be_to_cpu32 (tail->leaf_stale);
|
||||||
|
|
||||||
|
if (!entries)
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
/* Iterate over all entries within this block. */
|
/* Iterate over all entries within this block. */
|
||||||
while ((char *)direntry < (char *)tail)
|
while ((char *) direntry < (char *) end)
|
||||||
{
|
{
|
||||||
grub_uint8_t *freetag;
|
grub_uint8_t *freetag;
|
||||||
char *filename;
|
char *filename;
|
||||||
@@ -861,22 +1016,34 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir,
|
|||||||
}
|
}
|
||||||
|
|
||||||
filename = (char *)(direntry + 1);
|
filename = (char *)(direntry + 1);
|
||||||
|
if (filename + direntry->len + 1 > (char *) end)
|
||||||
|
{
|
||||||
|
grub_error (GRUB_ERR_BAD_FS, "invalid XFS directory entry");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* The byte after the filename is for the filetype, padding, or
|
/* The byte after the filename is for the filetype, padding, or
|
||||||
tag, which is not used by GRUB. So it can be overwritten. */
|
tag, which is not used by GRUB. So it can be overwritten. */
|
||||||
filename[direntry->len] = '\0';
|
filename[direntry->len] = '\0';
|
||||||
|
|
||||||
if (iterate_dir_call_hook (grub_be_to_cpu64(direntry->inode),
|
if (iterate_dir_call_hook (grub_be_to_cpu64(direntry->inode),
|
||||||
filename, &ctx))
|
filename, &ctx))
|
||||||
{
|
{
|
||||||
grub_free (dirblock);
|
grub_free (dirblock);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check if last direntry in this block is
|
/*
|
||||||
reached. */
|
* The expected number of directory entries is only tracked for the
|
||||||
entries--;
|
* single extent case.
|
||||||
if (!entries)
|
*/
|
||||||
break;
|
if (grub_xfs_get_inode_nextents (&dir->inode) == 1)
|
||||||
|
{
|
||||||
|
/* Check if last direntry in this block is reached. */
|
||||||
|
entries--;
|
||||||
|
if (!entries)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
/* Select the next directory entry. */
|
/* Select the next directory entry. */
|
||||||
direntry = grub_xfs_next_de(dir->data, direntry);
|
direntry = grub_xfs_next_de(dir->data, direntry);
|
||||||
@@ -899,11 +1066,14 @@ static struct grub_xfs_data *
|
|||||||
grub_xfs_mount (grub_disk_t disk)
|
grub_xfs_mount (grub_disk_t disk)
|
||||||
{
|
{
|
||||||
struct grub_xfs_data *data = 0;
|
struct grub_xfs_data *data = 0;
|
||||||
|
grub_size_t sz;
|
||||||
|
|
||||||
data = grub_zalloc (sizeof (struct grub_xfs_data));
|
data = grub_zalloc (sizeof (struct grub_xfs_data));
|
||||||
if (!data)
|
if (!data)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
data->data_size = sizeof (struct grub_xfs_data);
|
||||||
|
|
||||||
grub_dprintf("xfs", "Reading sb\n");
|
grub_dprintf("xfs", "Reading sb\n");
|
||||||
/* Read the superblock. */
|
/* Read the superblock. */
|
||||||
if (grub_disk_read (disk, 0, 0,
|
if (grub_disk_read (disk, 0, 0,
|
||||||
@@ -913,14 +1083,19 @@ grub_xfs_mount (grub_disk_t disk)
|
|||||||
if (!grub_xfs_sb_valid(data))
|
if (!grub_xfs_sb_valid(data))
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
data = grub_realloc (data,
|
if (grub_xfs_sb_needs_repair (data))
|
||||||
sizeof (struct grub_xfs_data)
|
grub_dprintf ("xfs", "XFS filesystem needs repair, boot may fail\n");
|
||||||
- sizeof (struct grub_xfs_inode)
|
|
||||||
+ grub_xfs_inode_size(data) + 1);
|
if (grub_add (grub_xfs_inode_size (data),
|
||||||
|
sizeof (struct grub_xfs_data) - sizeof (struct grub_xfs_inode) + 1, &sz))
|
||||||
|
goto fail;
|
||||||
|
|
||||||
|
data = grub_realloc (data, sz);
|
||||||
|
|
||||||
if (! data)
|
if (! data)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
|
data->data_size = sz;
|
||||||
data->diropen.data = data;
|
data->diropen.data = data;
|
||||||
data->diropen.ino = grub_be_to_cpu64(data->sblock.rootino);
|
data->diropen.ino = grub_be_to_cpu64(data->sblock.rootino);
|
||||||
data->diropen.inode_read = 1;
|
data->diropen.inode_read = 1;
|
||||||
@@ -931,7 +1106,7 @@ grub_xfs_mount (grub_disk_t disk)
|
|||||||
|
|
||||||
data->disk = disk;
|
data->disk = disk;
|
||||||
data->pos = 0;
|
data->pos = 0;
|
||||||
grub_dprintf("xfs", "Reading root ino %"PRIuGRUB_UINT64_T"\n",
|
grub_dprintf("xfs", "Reading root ino %" PRIuGRUB_UINT64_T "\n",
|
||||||
grub_cpu_to_be64(data->sblock.rootino));
|
grub_cpu_to_be64(data->sblock.rootino));
|
||||||
|
|
||||||
grub_xfs_read_inode (data, data->diropen.ino, &data->diropen.inode);
|
grub_xfs_read_inode (data, data->diropen.ino, &data->diropen.inode);
|
||||||
@@ -939,7 +1114,7 @@ grub_xfs_mount (grub_disk_t disk)
|
|||||||
return data;
|
return data;
|
||||||
fail:
|
fail:
|
||||||
|
|
||||||
if (grub_errno == GRUB_ERR_OUT_OF_RANGE)
|
if (grub_errno == GRUB_ERR_OUT_OF_RANGE || grub_errno == GRUB_ERR_NONE)
|
||||||
grub_error (GRUB_ERR_BAD_FS, "not an XFS filesystem");
|
grub_error (GRUB_ERR_BAD_FS, "not an XFS filesystem");
|
||||||
|
|
||||||
grub_free (data);
|
grub_free (data);
|
||||||
@@ -947,7 +1122,6 @@ grub_xfs_mount (grub_disk_t disk)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Context for grub_xfs_dir. */
|
/* Context for grub_xfs_dir. */
|
||||||
struct grub_xfs_dir_ctx
|
struct grub_xfs_dir_ctx
|
||||||
{
|
{
|
||||||
@@ -955,6 +1129,27 @@ struct grub_xfs_dir_ctx
|
|||||||
void *hook_data;
|
void *hook_data;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* Bigtime inodes helpers. */
|
||||||
|
#define XFS_BIGTIME_EPOCH_OFFSET (-(grub_int64_t) GRUB_INT32_MIN)
|
||||||
|
|
||||||
|
static int grub_xfs_inode_has_bigtime (const struct grub_xfs_inode *inode)
|
||||||
|
{
|
||||||
|
return inode->version >= 3 &&
|
||||||
|
(inode->flags2 & grub_cpu_to_be64_compile_time (XFS_DIFLAG2_BIGTIME));
|
||||||
|
}
|
||||||
|
|
||||||
|
static grub_int64_t
|
||||||
|
grub_xfs_get_inode_time (struct grub_xfs_inode *inode)
|
||||||
|
{
|
||||||
|
struct grub_xfs_time_legacy *lts;
|
||||||
|
|
||||||
|
if (grub_xfs_inode_has_bigtime (inode))
|
||||||
|
return grub_divmod64 (grub_be_to_cpu64 (inode->mtime), NSEC_PER_SEC, NULL) - XFS_BIGTIME_EPOCH_OFFSET;
|
||||||
|
|
||||||
|
lts = (struct grub_xfs_time_legacy *) &inode->mtime;
|
||||||
|
return grub_be_to_cpu32 (lts->sec);
|
||||||
|
}
|
||||||
|
|
||||||
/* Helper for grub_xfs_dir. */
|
/* Helper for grub_xfs_dir. */
|
||||||
static int
|
static int
|
||||||
grub_xfs_dir_iter (const char *filename, enum grub_fshelp_filetype filetype,
|
grub_xfs_dir_iter (const char *filename, enum grub_fshelp_filetype filetype,
|
||||||
@@ -967,7 +1162,7 @@ grub_xfs_dir_iter (const char *filename, enum grub_fshelp_filetype filetype,
|
|||||||
if (node->inode_read)
|
if (node->inode_read)
|
||||||
{
|
{
|
||||||
info.mtimeset = 1;
|
info.mtimeset = 1;
|
||||||
info.mtime = grub_be_to_cpu32 (node->inode.mtime.sec);
|
info.mtime = grub_xfs_get_inode_time (&node->inode);
|
||||||
}
|
}
|
||||||
info.dir = ((filetype & GRUB_FSHELP_TYPE_MASK) == GRUB_FSHELP_DIR);
|
info.dir = ((filetype & GRUB_FSHELP_TYPE_MASK) == GRUB_FSHELP_DIR);
|
||||||
grub_free (node);
|
grub_free (node);
|
||||||
@@ -1132,8 +1327,6 @@ grub_xfs_uuid (grub_device_t device, char **uuid)
|
|||||||
return grub_errno;
|
return grub_errno;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static struct grub_fs grub_xfs_fs =
|
static struct grub_fs grub_xfs_fs =
|
||||||
{
|
{
|
||||||
.name = "xfs",
|
.name = "xfs",
|
||||||
@@ -1152,6 +1345,7 @@ static struct grub_fs grub_xfs_fs =
|
|||||||
|
|
||||||
GRUB_MOD_INIT(xfs)
|
GRUB_MOD_INIT(xfs)
|
||||||
{
|
{
|
||||||
|
//grub_xfs_fs.mod = mod;
|
||||||
grub_fs_register (&grub_xfs_fs);
|
grub_fs_register (&grub_xfs_fs);
|
||||||
my_mod = mod;
|
my_mod = mod;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -466,6 +466,37 @@ grub_err_t grub_disk_blocklist_read(void *chunklist, grub_uint64_t sector,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
grub_err_t grub_disk_blocklist_read2(grub_disk_t disk, grub_uint64_t sector,
|
||||||
|
grub_uint64_t size, char *buf)
|
||||||
|
{
|
||||||
|
ventoy_img_chunk_list *chunk_list = (ventoy_img_chunk_list *)(disk->read_hook_data);
|
||||||
|
|
||||||
|
if (buf < chunk_list->buf || buf >= chunk_list->buf + VTOY_CHUNK_BUF_SIZE)
|
||||||
|
{
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((chunk_list->buf + chunk_list->last_off) != buf)
|
||||||
|
{
|
||||||
|
chunk_list->err_code = VTOY_CHUNK_ERR_NOT_FLAT;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (chunk_list->last_off + size > VTOY_CHUNK_BUF_SIZE)
|
||||||
|
{
|
||||||
|
chunk_list->err_code = VTOY_CHUNK_ERR_OVER_FLOW;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
chunk_list->last_off += (grub_uint32_t)size;
|
||||||
|
if (chunk_list->last_off == VTOY_CHUNK_BUF_SIZE)
|
||||||
|
{
|
||||||
|
chunk_list->last_off = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return grub_disk_blocklist_read(chunk_list, sector, size, disk->log_sector_size);
|
||||||
|
}
|
||||||
|
|
||||||
/* Read data from the disk. */
|
/* Read data from the disk. */
|
||||||
grub_err_t
|
grub_err_t
|
||||||
grub_disk_read (grub_disk_t disk, grub_disk_addr_t sector,
|
grub_disk_read (grub_disk_t disk, grub_disk_addr_t sector,
|
||||||
@@ -475,6 +506,14 @@ grub_disk_read (grub_disk_t disk, grub_disk_addr_t sector,
|
|||||||
{
|
{
|
||||||
return grub_disk_blocklist_read((ventoy_img_chunk_list *)disk->read_hook_data, sector, size, disk->log_sector_size);
|
return grub_disk_blocklist_read((ventoy_img_chunk_list *)disk->read_hook_data, sector, size, disk->log_sector_size);
|
||||||
}
|
}
|
||||||
|
else if (disk->read_hook == (grub_disk_read_hook_t)(void *)grub_disk_blocklist_read2)
|
||||||
|
{
|
||||||
|
grub_err_t rv = grub_disk_blocklist_read2(disk, sector, size, (char *)buf);
|
||||||
|
if (rv != 2)
|
||||||
|
{
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* First of all, check if the region is within the disk. */
|
/* First of all, check if the region is within the disk. */
|
||||||
if (grub_disk_adjust_range (disk, §or, &offset, size) != GRUB_ERR_NONE)
|
if (grub_disk_adjust_range (disk, §or, &offset, size) != GRUB_ERR_NONE)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* ventoy.c
|
* ventoy.c
|
||||||
*
|
*
|
||||||
* Copyright (c) 2020, longpanda <admin@ventoy.net>
|
* Copyright (c) 2020, longpanda <admin@ventoy.net>
|
||||||
*
|
*
|
||||||
@@ -7,12 +7,12 @@
|
|||||||
* modify it under the terms of the GNU General Public License as
|
* modify it under the terms of the GNU General Public License as
|
||||||
* published by the Free Software Foundation; either version 3 of the
|
* published by the Free Software Foundation; either version 3 of the
|
||||||
* License, or (at your option) any later version.
|
* License, or (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
* General Public License for more details.
|
* General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||||
*
|
*
|
||||||
@@ -137,7 +137,7 @@ int ventoy_str_len_alnum(const char *str, int len)
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
int slen;
|
int slen;
|
||||||
|
|
||||||
if (NULL == str || 0 == *str)
|
if (NULL == str || 0 == *str)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
@@ -168,7 +168,7 @@ int ventoy_str_len_alnum(const char *str, int len)
|
|||||||
char * ventoy_str_basename(char *path)
|
char * ventoy_str_basename(char *path)
|
||||||
{
|
{
|
||||||
char *pos = NULL;
|
char *pos = NULL;
|
||||||
|
|
||||||
pos = grub_strrchr(path, '/');
|
pos = grub_strrchr(path, '/');
|
||||||
if (pos)
|
if (pos)
|
||||||
{
|
{
|
||||||
@@ -185,17 +185,17 @@ char * ventoy_str_basename(char *path)
|
|||||||
int ventoy_str_chrcnt(const char *str, char c)
|
int ventoy_str_chrcnt(const char *str, char c)
|
||||||
{
|
{
|
||||||
int n = 0;
|
int n = 0;
|
||||||
|
|
||||||
if (str)
|
if (str)
|
||||||
{
|
{
|
||||||
while (*str)
|
while (*str)
|
||||||
{
|
{
|
||||||
if (*str == c)
|
if (*str == c)
|
||||||
{
|
{
|
||||||
n++;
|
n++;
|
||||||
}
|
}
|
||||||
str++;
|
str++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return n;
|
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)
|
grub_err_t ventoy_env_int_set(const char *name, int value)
|
||||||
{
|
{
|
||||||
char buf[16];
|
char buf[16];
|
||||||
|
|
||||||
grub_snprintf(buf, sizeof(buf), "%d", value);
|
grub_snprintf(buf, sizeof(buf), "%d", value);
|
||||||
return grub_env_set(name, buf);
|
return grub_env_set(name, buf);
|
||||||
}
|
}
|
||||||
@@ -248,13 +248,13 @@ void ventoy_debug_dump_guid(const char *prefix, grub_uint8_t *guid)
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
debug("%s", prefix);
|
debug("%s", prefix);
|
||||||
for (i = 0; i < 16; i++)
|
for (i = 0; i < 16; i++)
|
||||||
{
|
{
|
||||||
grub_printf("%02x ", guid[i]);
|
grub_printf("%02x ", guid[i]);
|
||||||
}
|
}
|
||||||
grub_printf("\n");
|
grub_printf("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
int ventoy_is_efi_os(void)
|
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(name, sizeof(name), "%s_addr", prefix);
|
||||||
grub_snprintf(val, sizeof(val), "0x%llx", (ulonglong)(ulong)buf);
|
grub_snprintf(val, sizeof(val), "0x%llx", (ulonglong)(ulong)buf);
|
||||||
grub_env_set(name, val);
|
grub_env_set(name, val);
|
||||||
|
|
||||||
grub_snprintf(name, sizeof(name), "%s_size", prefix);
|
grub_snprintf(name, sizeof(name), "%s_size", prefix);
|
||||||
grub_snprintf(val, sizeof(val), "%llu", len);
|
grub_snprintf(val, sizeof(val), "%llu", len);
|
||||||
grub_env_set(name, val);
|
grub_env_set(name, val);
|
||||||
@@ -374,7 +374,7 @@ static int ventoy_hwinfo_init(void)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static global_var_cfg g_global_vars[] =
|
static global_var_cfg g_global_vars[] =
|
||||||
{
|
{
|
||||||
{ "gfxmode", "1024x768", NULL },
|
{ "gfxmode", "1024x768", NULL },
|
||||||
{ ventoy_left_key, "5%", NULL },
|
{ ventoy_left_key, "5%", NULL },
|
||||||
@@ -422,19 +422,20 @@ int ventoy_global_var_init(void)
|
|||||||
for (i = 0; g_global_vars[i].name; i++)
|
for (i = 0; g_global_vars[i].name; i++)
|
||||||
{
|
{
|
||||||
g_global_vars[i].value = grub_strdup(g_global_vars[i].defval);
|
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);
|
grub_register_variable_hook(g_global_vars[i].name, ventoy_global_var_read_hook, ventoy_global_var_write_hook);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ctrl_var_cfg g_ctrl_vars[] =
|
static ctrl_var_cfg g_ctrl_vars[] =
|
||||||
{
|
{
|
||||||
{ "VTOY_WIN11_BYPASS_CHECK", 1 },
|
{ "VTOY_WIN11_BYPASS_CHECK", 1 },
|
||||||
{ "VTOY_WIN11_BYPASS_NRO", 1 },
|
{ "VTOY_WIN11_BYPASS_NRO", 1 },
|
||||||
{ "VTOY_LINUX_REMOUNT", 0 },
|
{ "VTOY_LINUX_REMOUNT", 0 },
|
||||||
{ "VTOY_SECONDARY_BOOT_MENU", 1 },
|
{ "VTOY_SECONDARY_BOOT_MENU", 1 },
|
||||||
|
{ "VTOY_WIN_UEFI_MAX_RES", 1 },
|
||||||
{ NULL, 0 }
|
{ NULL, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -37,6 +37,7 @@
|
|||||||
#define VTOY_SIZE_4MB (4 * 1024 * 1024)
|
#define VTOY_SIZE_4MB (4 * 1024 * 1024)
|
||||||
#define VTOY_SIZE_512KB (512 * 1024)
|
#define VTOY_SIZE_512KB (512 * 1024)
|
||||||
#define VTOY_SIZE_1KB 1024
|
#define VTOY_SIZE_1KB 1024
|
||||||
|
#define VTOY_SIZE_4KB 4096
|
||||||
#define VTOY_SIZE_32KB (32 * 1024)
|
#define VTOY_SIZE_32KB (32 * 1024)
|
||||||
#define VTOY_SIZE_128KB (128 * 1024)
|
#define VTOY_SIZE_128KB (128 * 1024)
|
||||||
|
|
||||||
@@ -95,6 +96,12 @@
|
|||||||
return (err);\
|
return (err);\
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define vtoy_tip(wait_seconds, fmt, ...) \
|
||||||
|
grub_printf(fmt, __VA_ARGS__); \
|
||||||
|
grub_refresh(); \
|
||||||
|
grub_sleep(wait_seconds)
|
||||||
|
|
||||||
|
|
||||||
#define VTOY_APPEND_NEWBUF(buf) \
|
#define VTOY_APPEND_NEWBUF(buf) \
|
||||||
{\
|
{\
|
||||||
char *__c = buf;\
|
char *__c = buf;\
|
||||||
@@ -656,6 +663,7 @@ grub_uint32_t ventoy_get_iso_boot_catlog(grub_file_t file);
|
|||||||
int ventoy_has_efi_eltorito(grub_file_t file, grub_uint32_t sector);
|
int ventoy_has_efi_eltorito(grub_file_t file, grub_uint32_t sector);
|
||||||
grub_err_t ventoy_cmd_linux_chain_data(grub_extcmd_context_t ctxt, int argc, char **args);
|
grub_err_t ventoy_cmd_linux_chain_data(grub_extcmd_context_t ctxt, int argc, char **args);
|
||||||
grub_err_t ventoy_cmd_linux_systemd_menu(grub_extcmd_context_t ctxt, int argc, char **args);
|
grub_err_t ventoy_cmd_linux_systemd_menu(grub_extcmd_context_t ctxt, int argc, char **args);
|
||||||
|
grub_err_t ventoy_cmd_linux_initrd(grub_extcmd_context_t ctxt, int argc, char **args);
|
||||||
grub_err_t ventoy_cmd_linux_limine_menu(grub_extcmd_context_t ctxt, int argc, char **args);
|
grub_err_t ventoy_cmd_linux_limine_menu(grub_extcmd_context_t ctxt, int argc, char **args);
|
||||||
grub_err_t ventoy_cmd_linux_locate_initrd(grub_extcmd_context_t ctxt, int argc, char **args);
|
grub_err_t ventoy_cmd_linux_locate_initrd(grub_extcmd_context_t ctxt, int argc, char **args);
|
||||||
grub_err_t ventoy_cmd_initrd_count(grub_extcmd_context_t ctxt, int argc, char **args);
|
grub_err_t ventoy_cmd_initrd_count(grub_extcmd_context_t ctxt, int argc, char **args);
|
||||||
@@ -1150,7 +1158,7 @@ int ventoy_plugin_find_conf_replace(const char *iso, conf_replace *nodes[VTOY_MA
|
|||||||
dud * ventoy_plugin_find_dud(const char *iso);
|
dud * ventoy_plugin_find_dud(const char *iso);
|
||||||
int ventoy_plugin_load_dud(dud *node, const char *isopart);
|
int ventoy_plugin_load_dud(dud *node, const char *isopart);
|
||||||
int ventoy_get_block_list(grub_file_t file, ventoy_img_chunk_list *chunklist, grub_disk_addr_t start);
|
int ventoy_get_block_list(grub_file_t file, ventoy_img_chunk_list *chunklist, grub_disk_addr_t start);
|
||||||
int ventoy_check_block_list(grub_file_t file, ventoy_img_chunk_list *chunklist, grub_disk_addr_t start);
|
int ventoy_check_block_list(grub_file_t file, ventoy_img_chunk_list *chunklist, grub_disk_addr_t start, char *err, grub_uint32_t len);
|
||||||
void ventoy_plugin_dump_persistence(void);
|
void ventoy_plugin_dump_persistence(void);
|
||||||
grub_err_t ventoy_cmd_set_theme(grub_extcmd_context_t ctxt, int argc, char **args);
|
grub_err_t ventoy_cmd_set_theme(grub_extcmd_context_t ctxt, int argc, char **args);
|
||||||
grub_err_t ventoy_cmd_set_theme_path(grub_extcmd_context_t ctxt, int argc, char **args);
|
grub_err_t ventoy_cmd_set_theme_path(grub_extcmd_context_t ctxt, int argc, char **args);
|
||||||
@@ -1273,6 +1281,7 @@ typedef struct systemd_menu_ctx
|
|||||||
{
|
{
|
||||||
char *dev;
|
char *dev;
|
||||||
char *buf;
|
char *buf;
|
||||||
|
const char *initrd_cmd;
|
||||||
int pos;
|
int pos;
|
||||||
int len;
|
int len;
|
||||||
}systemd_menu_ctx;
|
}systemd_menu_ctx;
|
||||||
|
|||||||
@@ -1867,7 +1867,7 @@ static int ventoy_systemd_conf_hook(const char *filename, const struct grub_dirh
|
|||||||
ctx->pos = oldpos;
|
ctx->pos = oldpos;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
vtoy_len_ssprintf(ctx->buf, ctx->pos, ctx->len, " echo \"Downloading kernel ...\"\n linux %s ", tag);
|
vtoy_len_ssprintf(ctx->buf, ctx->pos, ctx->len, " echo \"Loading kernel ...\"\n linux %s ", tag);
|
||||||
|
|
||||||
/* kernel options */
|
/* kernel options */
|
||||||
grub_memcpy(filebuf, bkbuf, file->size);
|
grub_memcpy(filebuf, bkbuf, file->size);
|
||||||
@@ -1876,7 +1876,7 @@ static int ventoy_systemd_conf_hook(const char *filename, const struct grub_dirh
|
|||||||
|
|
||||||
|
|
||||||
/* initrd xxx xxx xxx */
|
/* initrd xxx xxx xxx */
|
||||||
vtoy_len_ssprintf(ctx->buf, ctx->pos, ctx->len, " echo \"Downloading initrd ...\"\n initrd ");
|
vtoy_len_ssprintf(ctx->buf, ctx->pos, ctx->len, " echo \"Loading initrd ...\"\n %s ", ctx->initrd_cmd);
|
||||||
grub_memcpy(filebuf, bkbuf, file->size);
|
grub_memcpy(filebuf, bkbuf, file->size);
|
||||||
tag = ventoy_systemd_conf_tag(filebuf, "initrd", 1);
|
tag = ventoy_systemd_conf_tag(filebuf, "initrd", 1);
|
||||||
while (tag)
|
while (tag)
|
||||||
@@ -1893,6 +1893,34 @@ out:
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
grub_err_t ventoy_cmd_linux_initrd(grub_extcmd_context_t ctxt, int argc, char **args)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
int pos = 0;
|
||||||
|
char *buf = NULL;
|
||||||
|
|
||||||
|
(void)ctxt;
|
||||||
|
|
||||||
|
buf = (char *)grub_malloc(VTOY_SIZE_4KB);
|
||||||
|
if (!buf)
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
pos += grub_snprintf(buf + pos, VTOY_SIZE_4KB - pos, "initrd mem:%s:size:%s",
|
||||||
|
grub_env_get("ventoy_cpio_addr"), grub_env_get("ventoy_cpio_size"));
|
||||||
|
|
||||||
|
for (i = 0; i < argc; i++)
|
||||||
|
{
|
||||||
|
pos += grub_snprintf(buf + pos, VTOY_SIZE_4KB - pos, " newc:initrd%03d:%s", i + 1, args[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
grub_script_execute_sourcecode(buf);
|
||||||
|
grub_free(buf);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
grub_err_t ventoy_cmd_linux_systemd_menu(grub_extcmd_context_t ctxt, int argc, char **args)
|
grub_err_t ventoy_cmd_linux_systemd_menu(grub_extcmd_context_t ctxt, int argc, char **args)
|
||||||
{
|
{
|
||||||
static char *buf = NULL;
|
static char *buf = NULL;
|
||||||
@@ -1936,6 +1964,7 @@ grub_err_t ventoy_cmd_linux_systemd_menu(grub_extcmd_context_t ctxt, int argc, c
|
|||||||
|
|
||||||
ctx.dev = args[0];
|
ctx.dev = args[0];
|
||||||
ctx.buf = buf;
|
ctx.buf = buf;
|
||||||
|
ctx.initrd_cmd = args[2] ? args[2] : "initrd";
|
||||||
ctx.pos = 0;
|
ctx.pos = 0;
|
||||||
ctx.len = VTOY_LINUX_SYSTEMD_MENU_MAX_BUF;
|
ctx.len = VTOY_LINUX_SYSTEMD_MENU_MAX_BUF;
|
||||||
fs->fs_dir(dev, "/loader/entries", ventoy_systemd_conf_hook, &ctx);
|
fs->fs_dir(dev, "/loader/entries", ventoy_systemd_conf_hook, &ctx);
|
||||||
|
|||||||
@@ -2765,7 +2765,7 @@ int ventoy_plugin_get_persistent_chunklist(const char *isopath, int index, vento
|
|||||||
start = file->device->disk->partition->start;
|
start = file->device->disk->partition->start;
|
||||||
ventoy_get_block_list(file, chunk_list, start);
|
ventoy_get_block_list(file, chunk_list, start);
|
||||||
|
|
||||||
if (0 != ventoy_check_block_list(file, chunk_list, start))
|
if (0 != ventoy_check_block_list(file, chunk_list, start, NULL, 0))
|
||||||
{
|
{
|
||||||
grub_free(chunk_list->chunk);
|
grub_free(chunk_list->chunk);
|
||||||
chunk_list->chunk = NULL;
|
chunk_list->chunk = NULL;
|
||||||
|
|||||||
@@ -197,6 +197,8 @@ grub_disk_t EXPORT_FUNC(grub_disk_open) (const char *name);
|
|||||||
void EXPORT_FUNC(grub_disk_close) (grub_disk_t disk);
|
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_uint64_t size, grub_uint32_t log_sector_size);
|
||||||
|
grub_err_t EXPORT_FUNC(grub_disk_blocklist_read2)(grub_disk_t disk, grub_uint64_t sector,
|
||||||
|
grub_uint64_t size, char *buf);
|
||||||
|
|
||||||
grub_err_t EXPORT_FUNC(grub_disk_read) (grub_disk_t disk,
|
grub_err_t EXPORT_FUNC(grub_disk_read) (grub_disk_t disk,
|
||||||
grub_disk_addr_t sector,
|
grub_disk_addr_t sector,
|
||||||
|
|||||||
@@ -7,12 +7,12 @@
|
|||||||
* modify it under the terms of the GNU General Public License as
|
* modify it under the terms of the GNU General Public License as
|
||||||
* published by the Free Software Foundation; either version 3 of the
|
* published by the Free Software Foundation; either version 3 of the
|
||||||
* License, or (at your option) any later version.
|
* License, or (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
* General Public License for more details.
|
* General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||||
*
|
*
|
||||||
@@ -36,6 +36,7 @@ typedef enum ventoy_fs_type
|
|||||||
ventoy_fs_xfs, /* 3: XFS */
|
ventoy_fs_xfs, /* 3: XFS */
|
||||||
ventoy_fs_udf, /* 4: UDF */
|
ventoy_fs_udf, /* 4: UDF */
|
||||||
ventoy_fs_fat, /* 5: FAT */
|
ventoy_fs_fat, /* 5: FAT */
|
||||||
|
ventoy_fs_btrfs, /* 6: BTRFS */
|
||||||
|
|
||||||
ventoy_fs_max
|
ventoy_fs_max
|
||||||
}ventoy_fs_type;
|
}ventoy_fs_type;
|
||||||
@@ -81,7 +82,7 @@ typedef struct ventoy_image_location
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* disk region data (region_count)
|
* 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.
|
* there will be more than one region data here.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -103,7 +104,7 @@ typedef struct ventoy_os_param
|
|||||||
char vtoy_img_path[384]; // It seems to be enough, utf-8 format
|
char vtoy_img_path[384]; // It seems to be enough, utf-8 format
|
||||||
grub_uint64_t vtoy_img_size; // image file size in bytes
|
grub_uint64_t vtoy_img_size; // image file size in bytes
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Ventoy will write a copy of ventoy_image_location data into runtime memory
|
* Ventoy will write a copy of ventoy_image_location data into runtime memory
|
||||||
* this is the physically address and length of that memory.
|
* this is the physically address and length of that memory.
|
||||||
* Address 0 means no such data exist.
|
* Address 0 means no such data exist.
|
||||||
@@ -113,7 +114,7 @@ typedef struct ventoy_os_param
|
|||||||
grub_uint64_t vtoy_img_location_addr;
|
grub_uint64_t vtoy_img_location_addr;
|
||||||
grub_uint32_t vtoy_img_location_len;
|
grub_uint32_t vtoy_img_location_len;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* These 32 bytes are reserved by ventoy.
|
* These 32 bytes are reserved by ventoy.
|
||||||
*
|
*
|
||||||
* vtoy_reserved[0]: vtoy_break_level
|
* vtoy_reserved[0]: vtoy_break_level
|
||||||
@@ -124,6 +125,7 @@ typedef struct ventoy_os_param
|
|||||||
* vtoy_reserved[5]: vtoy_linux_remount
|
* vtoy_reserved[5]: vtoy_linux_remount
|
||||||
* vtoy_reserved[6]: vtoy_vlnk
|
* vtoy_reserved[6]: vtoy_vlnk
|
||||||
* vtoy_reserved[7~10]: vtoy_disk_sig[4] used for vlnk
|
* vtoy_reserved[7~10]: vtoy_disk_sig[4] used for vlnk
|
||||||
|
* vtoy_reserved[11]: vtoy_win_uefi_max_res
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
grub_uint8_t vtoy_reserved[32]; // Internal use by ventoy
|
grub_uint8_t vtoy_reserved[32]; // Internal use by ventoy
|
||||||
@@ -154,8 +156,8 @@ typedef struct ventoy_windows_data
|
|||||||
typedef struct ventoy_secure_data
|
typedef struct ventoy_secure_data
|
||||||
{
|
{
|
||||||
grub_uint8_t magic1[16]; /* VENTOY_GUID */
|
grub_uint8_t magic1[16]; /* VENTOY_GUID */
|
||||||
grub_uint8_t diskuuid[16];
|
grub_uint8_t diskuuid[16];
|
||||||
grub_uint8_t Checksum[16];
|
grub_uint8_t Checksum[16];
|
||||||
grub_uint8_t adminSHA256[32];
|
grub_uint8_t adminSHA256[32];
|
||||||
grub_uint8_t reserved[4000];
|
grub_uint8_t reserved[4000];
|
||||||
grub_uint8_t magic2[16]; /* VENTOY_GUID */
|
grub_uint8_t magic2[16]; /* VENTOY_GUID */
|
||||||
@@ -199,7 +201,7 @@ typedef struct ventoy_chain_head
|
|||||||
grub_uint64_t virt_img_size_in_bytes;
|
grub_uint64_t virt_img_size_in_bytes;
|
||||||
grub_uint32_t boot_catalog;
|
grub_uint32_t boot_catalog;
|
||||||
grub_uint8_t boot_catalog_sector[2048];
|
grub_uint8_t boot_catalog_sector[2048];
|
||||||
|
|
||||||
grub_uint32_t img_chunk_offset;
|
grub_uint32_t img_chunk_offset;
|
||||||
grub_uint32_t img_chunk_num;
|
grub_uint32_t img_chunk_num;
|
||||||
|
|
||||||
@@ -252,12 +254,15 @@ typedef struct ventoy_virt_chunk
|
|||||||
#define DEFAULT_CHUNK_NUM 1024
|
#define DEFAULT_CHUNK_NUM 1024
|
||||||
typedef struct ventoy_img_chunk_list
|
typedef struct ventoy_img_chunk_list
|
||||||
{
|
{
|
||||||
|
char *buf;
|
||||||
|
grub_uint32_t last_off;
|
||||||
|
grub_uint32_t err_code;
|
||||||
|
|
||||||
grub_uint32_t max_chunk;
|
grub_uint32_t max_chunk;
|
||||||
grub_uint32_t cur_chunk;
|
grub_uint32_t cur_chunk;
|
||||||
ventoy_img_chunk *chunk;
|
ventoy_img_chunk *chunk;
|
||||||
}ventoy_img_chunk_list;
|
}ventoy_img_chunk_list;
|
||||||
|
|
||||||
|
|
||||||
#pragma pack()
|
#pragma pack()
|
||||||
|
|
||||||
#define ventoy_filt_register grub_file_filter_register
|
#define ventoy_filt_register grub_file_filter_register
|
||||||
@@ -291,7 +296,21 @@ typedef struct ventoy_grub_param
|
|||||||
|
|
||||||
#pragma pack()
|
#pragma pack()
|
||||||
|
|
||||||
|
#define VTOY_CHUNK_BUF_SIZE (4 * 1024 * 1024)
|
||||||
|
|
||||||
|
typedef enum vtoy_chunk_err
|
||||||
|
{
|
||||||
|
VTOY_CHUNK_ERR_NONE = 0,
|
||||||
|
VTOY_CHUNK_ERR_MULTI_DEV,
|
||||||
|
VTOY_CHUNK_ERR_RAID,
|
||||||
|
VTOY_CHUNK_ERR_COMPRESS,
|
||||||
|
VTOY_CHUNK_ERR_NOT_FLAT,
|
||||||
|
VTOY_CHUNK_ERR_OVER_FLOW,
|
||||||
|
VTOY_CHUNK_ERR_MAX
|
||||||
|
}vtoy_chunk_err;
|
||||||
|
|
||||||
int grub_ext_get_file_chunk(grub_uint64_t part_start, grub_file_t file, ventoy_img_chunk_list *chunk_list);
|
int grub_ext_get_file_chunk(grub_uint64_t part_start, grub_file_t file, ventoy_img_chunk_list *chunk_list);
|
||||||
|
int grub_btrfs_get_file_chunk(grub_uint64_t part_start, grub_file_t file, ventoy_img_chunk_list *chunk_list);
|
||||||
int grub_fat_get_file_chunk(grub_uint64_t part_start, grub_file_t file, ventoy_img_chunk_list *chunk_list);
|
int grub_fat_get_file_chunk(grub_uint64_t part_start, grub_file_t file, ventoy_img_chunk_list *chunk_list);
|
||||||
void grub_iso9660_set_nojoliet(int nojoliet);
|
void grub_iso9660_set_nojoliet(int nojoliet);
|
||||||
int grub_iso9660_is_joliet(void);
|
int grub_iso9660_is_joliet(void);
|
||||||
@@ -301,7 +320,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_pd_size_offset(void);
|
||||||
grub_uint64_t grub_udf_get_last_file_attr_offset
|
grub_uint64_t grub_udf_get_last_file_attr_offset
|
||||||
(
|
(
|
||||||
grub_file_t file,
|
grub_file_t file,
|
||||||
grub_uint32_t *startBlock,
|
grub_uint32_t *startBlock,
|
||||||
grub_uint64_t *fe_entry_size_offset
|
grub_uint64_t *fe_entry_size_offset
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -48,3 +48,6 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
PATH=$VTPATH_OLD
|
PATH=$VTPATH_OLD
|
||||||
|
|
||||||
|
set_ventoy_hook_finish
|
||||||
|
|
||||||
|
|||||||
@@ -67,4 +67,5 @@ fi
|
|||||||
|
|
||||||
if [ -f $VTOY_PATH/ventoy_persistent_map ]; then
|
if [ -f $VTOY_PATH/ventoy_persistent_map ]; then
|
||||||
$SED "1 aexport cow_label=vtoycow" -i /init
|
$SED "1 aexport cow_label=vtoycow" -i /init
|
||||||
|
$SED "/parse.*cmdline/aecho cow_label=vtoycow>>/tmp/cmdline" -i /init
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -49,3 +49,6 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
PATH=$VTPATH_OLD
|
PATH=$VTPATH_OLD
|
||||||
|
|
||||||
|
set_ventoy_hook_finish
|
||||||
|
|
||||||
|
|||||||
@@ -52,3 +52,6 @@ ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2"
|
|||||||
# fi
|
# fi
|
||||||
|
|
||||||
PATH=$VTPATH_OLD
|
PATH=$VTPATH_OLD
|
||||||
|
|
||||||
|
|
||||||
|
set_ventoy_hook_finish
|
||||||
|
|||||||
@@ -36,3 +36,6 @@ ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2"
|
|||||||
|
|
||||||
PATH=$VTPATH_OLD
|
PATH=$VTPATH_OLD
|
||||||
|
|
||||||
|
|
||||||
|
set_ventoy_hook_finish
|
||||||
|
|
||||||
|
|||||||
@@ -30,3 +30,6 @@ for i in 0 1 2 3 4 5 6 7 8 9; do
|
|||||||
done
|
done
|
||||||
|
|
||||||
ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2"
|
ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2"
|
||||||
|
|
||||||
|
set_ventoy_hook_finish
|
||||||
|
|
||||||
|
|||||||
@@ -47,3 +47,6 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2"
|
ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2"
|
||||||
|
|
||||||
|
set_ventoy_hook_finish
|
||||||
|
|
||||||
|
|||||||
@@ -39,3 +39,6 @@ ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2" "noreplace"
|
|||||||
|
|
||||||
$BUSYBOX_PATH/rm -f /dev/dm-*
|
$BUSYBOX_PATH/rm -f /dev/dm-*
|
||||||
|
|
||||||
|
|
||||||
|
set_ventoy_hook_finish
|
||||||
|
|
||||||
|
|||||||
@@ -119,3 +119,6 @@ fi
|
|||||||
|
|
||||||
PATH=$VTPATH_OLD
|
PATH=$VTPATH_OLD
|
||||||
|
|
||||||
|
|
||||||
|
set_ventoy_hook_finish
|
||||||
|
|
||||||
|
|||||||
43
IMG/cpio/ventoy/hook/debian/devuan-disk.sh
Normal file
43
IMG/cpio/ventoy/hook/debian/devuan-disk.sh
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
#!/ventoy/busybox/sh
|
||||||
|
#************************************************************************************
|
||||||
|
# Copyright (c) 2020, longpanda <admin@ventoy.net>
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU General Public License as
|
||||||
|
# published by the Free Software Foundation; either version 3 of the
|
||||||
|
# License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful, but
|
||||||
|
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
# General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||||
|
#
|
||||||
|
#************************************************************************************
|
||||||
|
|
||||||
|
. /ventoy/hook/ventoy-hook-lib.sh
|
||||||
|
|
||||||
|
if is_ventoy_hook_finished; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
vtlog "####### $0 $* ########"
|
||||||
|
|
||||||
|
VTPATH_OLD=$PATH; PATH=$BUSYBOX_PATH:$VTOY_PATH/tool:$PATH
|
||||||
|
|
||||||
|
wait_for_usb_disk_ready
|
||||||
|
|
||||||
|
vtdiskname=$(get_ventoy_disk_name)
|
||||||
|
if [ "$vtdiskname" = "unknown" ]; then
|
||||||
|
vtlog "ventoy disk not found"
|
||||||
|
PATH=$VTPATH_OLD
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2"
|
||||||
|
|
||||||
|
PATH=$VTPATH_OLD
|
||||||
|
|
||||||
|
set_ventoy_hook_finish
|
||||||
21
IMG/cpio/ventoy/hook/debian/devuan-hook.sh
Normal file
21
IMG/cpio/ventoy/hook/debian/devuan-hook.sh
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
#!/ventoy/busybox/sh
|
||||||
|
#************************************************************************************
|
||||||
|
# Copyright (c) 2020, longpanda <admin@ventoy.net>
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU General Public License as
|
||||||
|
# published by the Free Software Foundation; either version 3 of the
|
||||||
|
# License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful, but
|
||||||
|
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
# General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||||
|
#
|
||||||
|
#************************************************************************************
|
||||||
|
|
||||||
|
$SED "/Mount.*cdrom/a\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/debian/devuan-disk.sh" -i /init
|
||||||
|
|
||||||
@@ -41,3 +41,6 @@ fi
|
|||||||
|
|
||||||
PATH=$VTPATH_OLD
|
PATH=$VTPATH_OLD
|
||||||
|
|
||||||
|
|
||||||
|
set_ventoy_hook_finish
|
||||||
|
|
||||||
|
|||||||
@@ -80,3 +80,6 @@ ventoy_os_install_dmsetup $vtdiskname
|
|||||||
ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2" "noreplace"
|
ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2" "noreplace"
|
||||||
|
|
||||||
PATH=$VTPATH_OLD
|
PATH=$VTPATH_OLD
|
||||||
|
|
||||||
|
set_ventoy_hook_finish
|
||||||
|
|
||||||
|
|||||||
@@ -75,3 +75,6 @@ ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2" "noreplace"
|
|||||||
|
|
||||||
PATH=$VTPATH_OLD
|
PATH=$VTPATH_OLD
|
||||||
|
|
||||||
|
|
||||||
|
set_ventoy_hook_finish
|
||||||
|
|
||||||
|
|||||||
@@ -33,11 +33,13 @@ echo "_vtRet1=$_vtRet1 _vtRet2=$_vtRet2 ..." >> $VTLOG
|
|||||||
|
|
||||||
if [ $_vtRet1 -ne 0 -a $_vtRet2 -eq 0 ]; then
|
if [ $_vtRet1 -ne 0 -a $_vtRet2 -eq 0 ]; then
|
||||||
vtFindFlag=0
|
vtFindFlag=0
|
||||||
$GREP '`value from`' /usr/* -r | $AWK -F: '{print $1}' | while read vtline; do
|
$GREP '`value from`' /usr/* -r | $AWK -F: '{print $1}' > $VTOY_PATH/.porteus
|
||||||
|
while read vtline; do
|
||||||
echo "hooking $vtline ..." >> $VTLOG
|
echo "hooking $vtline ..." >> $VTLOG
|
||||||
$SED "s#\`value from\`#$vtPath#g" -i $vtline
|
$SED "s#\`value from\`#$vtPath#g" -i $vtline
|
||||||
vtFindFlag=1
|
vtFindFlag=1
|
||||||
done
|
done < $VTOY_PATH/.porteus
|
||||||
|
rm -f $VTOY_PATH/.porteus
|
||||||
|
|
||||||
if [ $vtFindFlag -eq 0 ]; then
|
if [ $vtFindFlag -eq 0 ]; then
|
||||||
if $GREP -q '`value from`' /linuxrc; then
|
if $GREP -q '`value from`' /linuxrc; then
|
||||||
|
|||||||
@@ -81,3 +81,6 @@ ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2" "noreplace"
|
|||||||
|
|
||||||
PATH=$VTPATH_OLD
|
PATH=$VTPATH_OLD
|
||||||
|
|
||||||
|
|
||||||
|
set_ventoy_hook_finish
|
||||||
|
|
||||||
|
|||||||
25
IMG/cpio/ventoy/hook/debian/truenas-bottom.sh
Normal file
25
IMG/cpio/ventoy/hook/debian/truenas-bottom.sh
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
#!/ventoy/busybox/sh
|
||||||
|
#************************************************************************************
|
||||||
|
# Copyright (c) 2020, longpanda <admin@ventoy.net>
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU General Public License as
|
||||||
|
# published by the Free Software Foundation; either version 3 of the
|
||||||
|
# License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful, but
|
||||||
|
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
# General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||||
|
#
|
||||||
|
#************************************************************************************
|
||||||
|
|
||||||
|
. /ventoy/hook/ventoy-hook-lib.sh
|
||||||
|
|
||||||
|
vtlog "mount ventoy.iso"
|
||||||
|
mkdir -p /root/cdrom >>$VTLOG 2>&1
|
||||||
|
mount -t iso9660 $VTOY_PATH/mnt/fuse/ventoy.iso /root/cdrom >>$VTLOG 2>&1
|
||||||
|
|
||||||
52
IMG/cpio/ventoy/hook/debian/truenas-disk.sh
Normal file
52
IMG/cpio/ventoy/hook/debian/truenas-disk.sh
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
#!/ventoy/busybox/sh
|
||||||
|
#************************************************************************************
|
||||||
|
# Copyright (c) 2020, longpanda <admin@ventoy.net>
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU General Public License as
|
||||||
|
# published by the Free Software Foundation; either version 3 of the
|
||||||
|
# License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful, but
|
||||||
|
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
# General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||||
|
#
|
||||||
|
#************************************************************************************
|
||||||
|
|
||||||
|
. /ventoy/hook/ventoy-hook-lib.sh
|
||||||
|
|
||||||
|
vtlog "####### $0 $* ########"
|
||||||
|
|
||||||
|
VTPATH_OLD=$PATH; PATH=$BUSYBOX_PATH:$VTOY_PATH/tool:$PATH
|
||||||
|
|
||||||
|
|
||||||
|
ventoy_run_fuse() {
|
||||||
|
vtlog "ventoy_run_fuse $*"
|
||||||
|
|
||||||
|
mkdir -p $VTOY_PATH/mnt/fuse $VTOY_PATH/mnt/iso
|
||||||
|
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
wait_for_usb_disk_ready
|
||||||
|
|
||||||
|
vtdiskname=$(get_ventoy_disk_name)
|
||||||
|
if [ "$vtdiskname" = "unknown" ]; then
|
||||||
|
vtlog "ventoy disk not found"
|
||||||
|
PATH=$VTPATH_OLD
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
ventoy_run_fuse $vtdiskname
|
||||||
|
|
||||||
|
if [ -f /ventoy/autoinstall ]; then
|
||||||
|
sh /ventoy/hook/default/auto_install_varexp.sh /ventoy/autoinstall
|
||||||
|
fi
|
||||||
27
IMG/cpio/ventoy/hook/debian/truenas-hook.sh
Normal file
27
IMG/cpio/ventoy/hook/debian/truenas-hook.sh
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
#!/ventoy/busybox/sh
|
||||||
|
#************************************************************************************
|
||||||
|
# Copyright (c) 2020, longpanda <admin@ventoy.net>
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU General Public License as
|
||||||
|
# published by the Free Software Foundation; either version 3 of the
|
||||||
|
# License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful, but
|
||||||
|
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
# General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||||
|
#
|
||||||
|
#************************************************************************************
|
||||||
|
|
||||||
|
if [ -e /init ] && $GREP -q '^mountroot$' /init; then
|
||||||
|
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 "/exec *run-init/i\\$BUSYBOX_PATH/sh $VTOY_PATH/hook/debian/truenas-bottom.sh" -i /init
|
||||||
|
fi
|
||||||
@@ -58,6 +58,9 @@ ventoy_get_debian_distro() {
|
|||||||
if $GREP -q 'Tails' /etc/os-release; then
|
if $GREP -q 'Tails' /etc/os-release; then
|
||||||
echo 'tails'; return
|
echo 'tails'; return
|
||||||
fi
|
fi
|
||||||
|
if $GREP -q 'NAME="Kylin"' /etc/os-release; then
|
||||||
|
echo 'kylin'; return
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if $GREP -q 'slax/' /proc/cmdline; then
|
if $GREP -q 'slax/' /proc/cmdline; then
|
||||||
@@ -110,6 +113,14 @@ ventoy_get_debian_distro() {
|
|||||||
echo 'pyabr'; return
|
echo 'pyabr'; return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -e /devuan-logo.txt ]; then
|
||||||
|
echo 'devuan'; return
|
||||||
|
fi
|
||||||
|
|
||||||
|
if $GREP -q 'truenas' /proc/version; then
|
||||||
|
echo 'truenas'; return
|
||||||
|
fi
|
||||||
|
|
||||||
echo 'default'
|
echo 'default'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -39,3 +39,6 @@ $BUSYBOX_PATH/insmod $vtLoopExDir/dm-mod/$(uname -r)/64/dm-mod.ko
|
|||||||
ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2" "noreplace"
|
ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2" "noreplace"
|
||||||
|
|
||||||
PATH=$VTPATH_OLD
|
PATH=$VTPATH_OLD
|
||||||
|
|
||||||
|
set_ventoy_hook_finish
|
||||||
|
|
||||||
|
|||||||
@@ -84,3 +84,6 @@ cp -a /dev/$vtDM /dev/ventoy
|
|||||||
ln -s /dev/$vtDM /dev/root
|
ln -s /dev/$vtDM /dev/root
|
||||||
|
|
||||||
PATH=$VTPATH_OLD
|
PATH=$VTPATH_OLD
|
||||||
|
|
||||||
|
set_ventoy_hook_finish
|
||||||
|
|
||||||
|
|||||||
@@ -34,3 +34,6 @@ for i in 0 1 2 3 4 5 6 7 8 9; do
|
|||||||
done
|
done
|
||||||
|
|
||||||
ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2" "noreplace"
|
ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2" "noreplace"
|
||||||
|
|
||||||
|
set_ventoy_hook_finish
|
||||||
|
|
||||||
|
|||||||
@@ -48,3 +48,6 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
PATH=$VTPATH_OLD
|
PATH=$VTPATH_OLD
|
||||||
|
|
||||||
|
set_ventoy_hook_finish
|
||||||
|
|
||||||
|
|||||||
@@ -68,3 +68,6 @@ ventoy_os_install_dmsetup_by_unsquashfs $vtdiskname
|
|||||||
ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2" "noreplace"
|
ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2" "noreplace"
|
||||||
|
|
||||||
PATH=$VTPATH_OLD
|
PATH=$VTPATH_OLD
|
||||||
|
|
||||||
|
set_ventoy_hook_finish
|
||||||
|
|
||||||
|
|||||||
@@ -72,3 +72,6 @@ ventoy_os_install_device_mapper $vtdiskname
|
|||||||
ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2"
|
ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2"
|
||||||
|
|
||||||
PATH=$VTPATH_OLD
|
PATH=$VTPATH_OLD
|
||||||
|
|
||||||
|
set_ventoy_hook_finish
|
||||||
|
|
||||||
|
|||||||
@@ -36,3 +36,6 @@ blkdev_num=$($VTOY_PATH/tool/dmsetup ls | grep ventoy | sed 's/.*(\([0-9][0-9]*\
|
|||||||
mknod -m 0660 /dev/ventoy b $blkdev_num
|
mknod -m 0660 /dev/ventoy b $blkdev_num
|
||||||
|
|
||||||
PATH=$VTPATH_OLD
|
PATH=$VTPATH_OLD
|
||||||
|
|
||||||
|
set_ventoy_hook_finish
|
||||||
|
|
||||||
|
|||||||
@@ -36,3 +36,6 @@ vtDM=$(ventoy_find_dm_id ${blkdev_num})
|
|||||||
echo -n "/dev/$vtDM" > /ventoy/rootdev
|
echo -n "/dev/$vtDM" > /ventoy/rootdev
|
||||||
|
|
||||||
PATH=$VTPATH_OLD
|
PATH=$VTPATH_OLD
|
||||||
|
|
||||||
|
set_ventoy_hook_finish
|
||||||
|
|
||||||
|
|||||||
@@ -36,3 +36,6 @@ blkdev_num=$($VTOY_PATH/tool/dmsetup ls | grep ventoy | sed 's/.*(\([0-9][0-9]*\
|
|||||||
mknod -m 0660 /dev/ventoy b $blkdev_num
|
mknod -m 0660 /dev/ventoy b $blkdev_num
|
||||||
|
|
||||||
PATH=$VTPATH_OLD
|
PATH=$VTPATH_OLD
|
||||||
|
|
||||||
|
set_ventoy_hook_finish
|
||||||
|
|
||||||
|
|||||||
@@ -33,3 +33,6 @@ fi
|
|||||||
ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2" "noreplace"
|
ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2" "noreplace"
|
||||||
|
|
||||||
PATH=$VTPATH_OLD
|
PATH=$VTPATH_OLD
|
||||||
|
|
||||||
|
set_ventoy_hook_finish
|
||||||
|
|
||||||
|
|||||||
@@ -40,3 +40,6 @@ mknod -m 660 /dev/ventoy b $blkdev_num
|
|||||||
echo "/dev/ventoy" > cdrom.hint
|
echo "/dev/ventoy" > cdrom.hint
|
||||||
|
|
||||||
PATH=$VTPATH_OLD
|
PATH=$VTPATH_OLD
|
||||||
|
|
||||||
|
set_ventoy_hook_finish
|
||||||
|
|
||||||
|
|||||||
@@ -50,3 +50,6 @@ if [ "$1" = "fakecdrom" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
PATH=$VTPATH_OLD
|
PATH=$VTPATH_OLD
|
||||||
|
|
||||||
|
set_ventoy_hook_finish
|
||||||
|
|
||||||
|
|||||||
@@ -63,3 +63,6 @@ blkdev_num=$($VTOY_PATH/tool/dmsetup ls | grep ventoy | sed 's/.*(\([0-9][0-9]*\
|
|||||||
mknod -m 0660 /dev/ventoy b $blkdev_num
|
mknod -m 0660 /dev/ventoy b $blkdev_num
|
||||||
|
|
||||||
PATH=$VTPATH_OLD
|
PATH=$VTPATH_OLD
|
||||||
|
|
||||||
|
set_ventoy_hook_finish
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,19 @@ fi
|
|||||||
|
|
||||||
VTPATH_OLD=$PATH; PATH=$BUSYBOX_PATH:$VTOY_PATH/tool:$PATH
|
VTPATH_OLD=$PATH; PATH=$BUSYBOX_PATH:$VTOY_PATH/tool:$PATH
|
||||||
|
|
||||||
modprobe dm-mod
|
vtlog "Loading dax and dm-mod module ..."
|
||||||
|
$BUSYBOX_PATH/modprobe dax > /dev/null 2>&1
|
||||||
|
$BUSYBOX_PATH/modprobe dm-mod > /dev/null 2>&1
|
||||||
|
|
||||||
|
if $GREP -q 'device-mapper' /proc/devices; then
|
||||||
|
vtlog "dm-mod module check success ..."
|
||||||
|
else
|
||||||
|
vtlog "Need to extract dax and dm-mod module ..."
|
||||||
|
$VTOY_PATH/tool/zstdcat /lib/modules/$(uname -r)/drivers/dax/dax.ko.zst > $VTOY_PATH/extract_dax.ko
|
||||||
|
$BUSYBOX_PATH/insmod $VTOY_PATH/extract_dax.ko
|
||||||
|
$VTOY_PATH/tool/zstdcat /lib/modules/$(uname -r)/drivers/md/dm-mod.ko.zst > $VTOY_PATH/extract_dm_mod.ko
|
||||||
|
$BUSYBOX_PATH/insmod $VTOY_PATH/extract_dm_mod.ko
|
||||||
|
fi
|
||||||
|
|
||||||
wait_for_usb_disk_ready
|
wait_for_usb_disk_ready
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,8 @@
|
|||||||
|
|
||||||
. $VTOY_PATH/hook/ventoy-os-lib.sh
|
. $VTOY_PATH/hook/ventoy-os-lib.sh
|
||||||
|
|
||||||
|
$SED "/Searching/i $BUSYBOX_PATH/sh $VTOY_PATH/hook/t2/disk_hook.sh" -i /init
|
||||||
|
$SED "/disktype/i x=/dev/ventoy" -i /init
|
||||||
$SED "/getdevice *devicefile/i $BUSYBOX_PATH/sh $VTOY_PATH/hook/t2/disk_hook.sh" -i /init
|
$SED "/getdevice *devicefile/i $BUSYBOX_PATH/sh $VTOY_PATH/hook/t2/disk_hook.sh" -i /init
|
||||||
$SED "/getdevice *devicefile/a devicefile=/dev/ventoy" -i /init
|
$SED "/getdevice *devicefile/a devicefile=/dev/ventoy" -i /init
|
||||||
|
|
||||||
|
|||||||
@@ -64,6 +64,15 @@ is_ventoy_hook_finished() {
|
|||||||
|
|
||||||
set_ventoy_hook_finish() {
|
set_ventoy_hook_finish() {
|
||||||
echo 'Y' > $VTOY_PATH/hook_finish
|
echo 'Y' > $VTOY_PATH/hook_finish
|
||||||
|
|
||||||
|
if [ -f /ventoy/ventoy_iso_part_dm_cmd ]; then
|
||||||
|
echo "### create iso part raw dm" >> $VTLOG
|
||||||
|
$CAT $VTOY_PATH/ventoy_raw_table >> $VTLOG
|
||||||
|
echo "### iso part dm cmd" >> $VTLOG
|
||||||
|
$CAT /ventoy/ventoy_iso_part_dm_cmd >> $VTLOG
|
||||||
|
$BUSYBOX_PATH/sh /ventoy/ventoy_iso_part_dm_cmd >>$VTLOG 2>&1
|
||||||
|
#$BUSYBOX_PATH/rm -f /ventoy/ventoy_iso_part_dm_cmd
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
get_ventoy_disk_name() {
|
get_ventoy_disk_name() {
|
||||||
@@ -153,16 +162,15 @@ ventoy_get_vblade_bin() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
ventoy_find_bin_path() {
|
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
|
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
|
if [ -e "$vt_path/$1" ]; then
|
||||||
echo "$vt_path/$1"; return
|
echo "$vt_path/$1"; return
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
if $BUSYBOX_PATH/which "$1" > /dev/null; then
|
||||||
|
$BUSYBOX_PATH/which "$1"; return
|
||||||
|
fi
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
}
|
}
|
||||||
@@ -259,8 +267,10 @@ create_ventoy_device_mapper() {
|
|||||||
$VT_DM_BIN "$2" create ventoy $VTOY_PATH/ventoy_dm_table >>$VTLOG 2>&1
|
$VT_DM_BIN "$2" create ventoy $VTOY_PATH/ventoy_dm_table >>$VTLOG 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
RAWDISKNAME=$($HEAD -n1 $VTOY_PATH/ventoy_raw_table | $AWK '{print $4}')
|
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
|
echo "$VT_DM_BIN create ${RAWDISKNAME#/dev/} $VTOY_PATH/ventoy_raw_table" > /ventoy/ventoy_iso_part_dm_cmd
|
||||||
|
echo "$VT_DM_BIN mknodes ${RAWDISKNAME#/dev/}" >> /ventoy/ventoy_iso_part_dm_cmd
|
||||||
|
echo "$VT_DM_BIN ls" >> /ventoy/ventoy_iso_part_dm_cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
create_persistent_device_mapper() {
|
create_persistent_device_mapper() {
|
||||||
|
|||||||
@@ -46,3 +46,6 @@ done
|
|||||||
|
|
||||||
|
|
||||||
PATH=$VTPATH_OLD
|
PATH=$VTPATH_OLD
|
||||||
|
|
||||||
|
set_ventoy_hook_finish
|
||||||
|
|
||||||
|
|||||||
@@ -40,3 +40,6 @@ if ! [ -e $VTOY_DM_PATH ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
PATH=$VTPATH_OLD
|
PATH=$VTPATH_OLD
|
||||||
|
|
||||||
|
set_ventoy_hook_finish
|
||||||
|
|
||||||
|
|||||||
@@ -52,6 +52,11 @@ ventoy_get_os_type() {
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Parted Magic
|
||||||
|
if [ -d /pmagic ]; then
|
||||||
|
echo 'pmagic'; return
|
||||||
|
fi
|
||||||
|
|
||||||
# PrimeOS :
|
# PrimeOS :
|
||||||
if $GREP -q 'PrimeOS' /proc/version; then
|
if $GREP -q 'PrimeOS' /proc/version; then
|
||||||
echo 'primeos'; return
|
echo 'primeos'; return
|
||||||
@@ -164,7 +169,7 @@ ventoy_get_os_type() {
|
|||||||
echo 'debian'; return
|
echo 'debian'; return
|
||||||
elif $GREP -q 'Solus' /etc/os-release; then
|
elif $GREP -q 'Solus' /etc/os-release; then
|
||||||
echo 'rhel7'; return
|
echo 'rhel7'; return
|
||||||
elif $GREP -q 'openEuler' /etc/os-release; then
|
elif $GREP -q -i 'openEuler' /etc/os-release; then
|
||||||
echo 'openEuler'; return
|
echo 'openEuler'; return
|
||||||
elif $GREP -q 'fuyu' /etc/os-release; then
|
elif $GREP -q 'fuyu' /etc/os-release; then
|
||||||
echo 'openEuler'; return
|
echo 'openEuler'; return
|
||||||
@@ -172,6 +177,10 @@ ventoy_get_os_type() {
|
|||||||
echo 'deepin'; return
|
echo 'deepin'; return
|
||||||
elif $GREP -q 'chinauos' /etc/os-release; then
|
elif $GREP -q 'chinauos' /etc/os-release; then
|
||||||
echo 'deepin'; return
|
echo 'deepin'; return
|
||||||
|
elif $GREP -qi 'aerynos' /etc/os-release; then
|
||||||
|
echo 'rhel7'; return
|
||||||
|
elif $GREP -qi 'ID_LIKE=debian' /etc/os-release; then
|
||||||
|
echo 'debian'; return
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -237,10 +246,6 @@ ventoy_get_os_type() {
|
|||||||
echo 'adelie'; return
|
echo 'adelie'; return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if $GREP -q 'pmagic' /proc/version; then
|
|
||||||
echo 'pmagic'; return
|
|
||||||
fi
|
|
||||||
|
|
||||||
if $GREP -q 'CDlinux' /proc/cmdline; then
|
if $GREP -q 'CDlinux' /proc/cmdline; then
|
||||||
echo 'cdlinux'; return
|
echo 'cdlinux'; return
|
||||||
fi
|
fi
|
||||||
@@ -311,8 +316,8 @@ ventoy_get_os_type() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [ -e /init ]; then
|
if [ -e /etc/initrd-release ]; then
|
||||||
if $GREP -q -m1 'T2 SDE' /init; then
|
if $GREP -q -m1 't2sde' /etc/initrd-release; then
|
||||||
echo 't2'; return
|
echo 't2'; return
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@@ -372,6 +377,13 @@ ventoy_get_os_type() {
|
|||||||
echo 'openEuler'; return
|
echo 'openEuler'; return
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
if [ -f /etc/kylin-release ]; then
|
||||||
|
if $GREP -i -q -m1 'Kylin.*Server.* V1[1-9] ' /etc/kylin-release; then
|
||||||
|
echo 'openEuler'; return
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if $GREP -q 'chimera' /proc/version; then
|
if $GREP -q 'chimera' /proc/version; then
|
||||||
echo 'chimera'; return
|
echo 'chimera'; return
|
||||||
|
|||||||
@@ -101,6 +101,11 @@ ventoy_get_os_type() {
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Parted Magic
|
||||||
|
if [ -d /pmagic ]; then
|
||||||
|
echo 'pmagic'; return
|
||||||
|
fi
|
||||||
|
|
||||||
# rhel5/CentOS5 and all other distributions based on them
|
# rhel5/CentOS5 and all other distributions based on them
|
||||||
if $GREP -q 'el5' /proc/version; then
|
if $GREP -q 'el5' /proc/version; then
|
||||||
echo 'rhel5'; return
|
echo 'rhel5'; return
|
||||||
@@ -200,7 +205,7 @@ ventoy_get_os_type() {
|
|||||||
echo 'debian'; return
|
echo 'debian'; return
|
||||||
elif $GREP -q 'Solus' /etc/os-release; then
|
elif $GREP -q 'Solus' /etc/os-release; then
|
||||||
echo 'rhel7'; return
|
echo 'rhel7'; return
|
||||||
elif $GREP -q 'openEuler' /etc/os-release; then
|
elif $GREP -q -i 'openEuler' /etc/os-release; then
|
||||||
echo 'openEuler'; return
|
echo 'openEuler'; return
|
||||||
elif $GREP -q 'fuyu' /etc/os-release; then
|
elif $GREP -q 'fuyu' /etc/os-release; then
|
||||||
echo 'openEuler'; return
|
echo 'openEuler'; return
|
||||||
@@ -269,10 +274,6 @@ ventoy_get_os_type() {
|
|||||||
echo 'adelie'; return
|
echo 'adelie'; return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if $GREP -q 'pmagic' /proc/version; then
|
|
||||||
echo 'pmagic'; return
|
|
||||||
fi
|
|
||||||
|
|
||||||
if $GREP -q 'CDlinux' /proc/cmdline; then
|
if $GREP -q 'CDlinux' /proc/cmdline; then
|
||||||
echo 'cdlinux'; return
|
echo 'cdlinux'; return
|
||||||
fi
|
fi
|
||||||
@@ -343,8 +344,8 @@ ventoy_get_os_type() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [ -e /init ]; then
|
if [ -e /etc/initrd-release ]; then
|
||||||
if $GREP -q -m1 'T2 SDE' /init; then
|
if $GREP -q -m1 't2sde' /etc/initrd-release; then
|
||||||
echo 't2'; return
|
echo 't2'; return
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -11,7 +11,8 @@ Ventoy2Disk.sh CMD [ OPTION ] /dev/sdX
|
|||||||
|
|
||||||
OPTION: (optional)
|
OPTION: (optional)
|
||||||
-r SIZE_MB preserve some space at the bottom of the disk (only for install)
|
-r SIZE_MB preserve some space at the bottom of the disk (only for install)
|
||||||
-s enable secure boot support (default is disabled)
|
-s enable secure boot support (default is enabled)
|
||||||
|
-S disable secure boot support (default is enabled)
|
||||||
-g use GPT partition style, default is MBR style (only for install)
|
-g use GPT partition style, default is MBR style (only for install)
|
||||||
|
|
||||||
Please refer https://www.ventoy.net/en/doc_start.html for details.
|
Please refer https://www.ventoy.net/en/doc_start.html for details.
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ elif uname -m | grep -E -q 'mips64'; then
|
|||||||
else
|
else
|
||||||
export TOOLDIR=i386
|
export TOOLDIR=i386
|
||||||
fi
|
fi
|
||||||
export PATH="./tool/$TOOLDIR:$PATH"
|
export PATH="$OLDDIR/tool/$TOOLDIR:$PATH"
|
||||||
|
|
||||||
|
|
||||||
echo ''
|
echo ''
|
||||||
@@ -61,6 +61,24 @@ if [ $? -eq 0 ]; then
|
|||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
#use static linked mkexfatfs for musl-libc environment
|
||||||
|
if [ -f mkexfatfs_static ]; then
|
||||||
|
if ldd --version 2>&1 | grep -qi musl; then
|
||||||
|
mv mkexfatfs mkexfatfs_shared
|
||||||
|
mv mkexfatfs_static mkexfatfs
|
||||||
|
else
|
||||||
|
if ./mkexfatfs -V > /dev/null 2>&1; then
|
||||||
|
echo "mkexfatfs can not run, check static version" >> ./log.txt
|
||||||
|
else
|
||||||
|
if ./mkexfatfs_static -V > /dev/null 2>&1; then
|
||||||
|
echo "Use static version of mkexfatfs" >> ./log.txt
|
||||||
|
mv mkexfatfs mkexfatfs_shared
|
||||||
|
mv mkexfatfs_static mkexfatfs
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
cd ../../
|
cd ../../
|
||||||
chmod +x -R ./tool/$TOOLDIR
|
chmod +x -R ./tool/$TOOLDIR
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -22,13 +22,22 @@ submenu "$VTLANG_CTRL_TEMP_SET" --class=debug_temp_set --class=F5tool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
menuentry "[ $VTOY_SECONDARY_BOOT_MENU ] $VTLANG_SECONDARY_BOOT_MENU" --class=debug_temp_second_menu --class=debug_temp_set --class=F5tool \
|
menuentry "[ $VTOY_SECONDARY_BOOT_MENU ] $VTLANG_SECONDARY_BOOT_MENU" --class=debug_temp_second_menu --class=debug_temp_set --class=F5tool \
|
||||||
VTOY_RUN_SET3 {
|
VTOY_RUN_SET2 {
|
||||||
if [ "$VTOY_SECONDARY_BOOT_MENU" = "0" ]; then
|
if [ "$VTOY_SECONDARY_BOOT_MENU" = "0" ]; then
|
||||||
set VTOY_SECONDARY_BOOT_MENU=1
|
set VTOY_SECONDARY_BOOT_MENU=1
|
||||||
else
|
else
|
||||||
set VTOY_SECONDARY_BOOT_MENU=0
|
set VTOY_SECONDARY_BOOT_MENU=0
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
menuentry "[ $VTOY_WIN_UEFI_MAX_RES ] $VTLANG_WIN_UEFI_MAX_RES" --class=debug_temp_win_uefi_res --class=debug_temp_set --class=F5tool \
|
||||||
|
VTOY_RUN_SET3 {
|
||||||
|
if [ "$VTOY_WIN_UEFI_MAX_RES" = "0" ]; then
|
||||||
|
set VTOY_WIN_UEFI_MAX_RES=1
|
||||||
|
else
|
||||||
|
set VTOY_WIN_UEFI_MAX_RES=0
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
menuentry "$VTLANG_RETURN_PREVIOUS" --class=vtoyret VTOY_RET {
|
menuentry "$VTLANG_RETURN_PREVIOUS" --class=vtoyret VTOY_RET {
|
||||||
echo "Return ..."
|
echo "Return ..."
|
||||||
|
|||||||
@@ -33,6 +33,21 @@ function ventoy_debug_pause {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function ventoy_max_resolution {
|
||||||
|
#Skip this for VirtualBox
|
||||||
|
smbios -t 1 -s 0x05 --set=system_product;
|
||||||
|
if vt_str_casebegin "$system_product" "VirtualBox"; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
vt_enum_video_mode
|
||||||
|
vt_get_video_mode 0 vtCurMode
|
||||||
|
terminal_output console
|
||||||
|
set gfxmode=$vtCurMode
|
||||||
|
terminal_output gfxterm
|
||||||
|
}
|
||||||
|
|
||||||
function ventoy_cli_console {
|
function ventoy_cli_console {
|
||||||
if [ -z "$vtoy_display_mode" ]; then
|
if [ -z "$vtoy_display_mode" ]; then
|
||||||
terminal_output console
|
terminal_output console
|
||||||
@@ -55,6 +70,12 @@ function ventoy_acpi_param {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function vt_vcfg_pre_proc {
|
||||||
|
vt_img_sector "${vtoy_iso_part}${vt_chosen_path}"
|
||||||
|
vt_load_cpio $vtoy_path "${vt_chosen_path}" ${vtoy_iso_part} "busybox=$ventoy_busybox_ver"
|
||||||
|
vt_trailer_cpio $vtoy_iso_part "$vt_chosen_path"
|
||||||
|
}
|
||||||
|
|
||||||
function ventoy_vcfg_proc {
|
function ventoy_vcfg_proc {
|
||||||
if vt_check_custom_boot "${1}" vt_vcfg; then
|
if vt_check_custom_boot "${1}" vt_vcfg; then
|
||||||
set vtoy_chosen_path="${1}"
|
set vtoy_chosen_path="${1}"
|
||||||
@@ -405,6 +426,18 @@ function distro_specify_initrd_file_phase2 {
|
|||||||
vt_linux_specify_initrd_file /live/initrd
|
vt_linux_specify_initrd_file /live/initrd
|
||||||
elif [ -f (loop)/initramfs-linux.img ]; then
|
elif [ -f (loop)/initramfs-linux.img ]; then
|
||||||
vt_linux_specify_initrd_file /initramfs-linux.img
|
vt_linux_specify_initrd_file /initramfs-linux.img
|
||||||
|
elif [ -f (loop)/boot/isolinux/initrd.gz ]; then
|
||||||
|
vt_linux_specify_initrd_file /boot/isolinux/initrd.gz
|
||||||
|
elif vt_str_begin "$vt_volume_id" "AERYNOS"; then
|
||||||
|
vt_vcfg_pre_proc
|
||||||
|
|
||||||
|
loopback va "${vtoy_iso_part}${vt_chosen_path}"
|
||||||
|
loopback vb (va)/EFI/Boot/efiboot.img
|
||||||
|
|
||||||
|
set root=(vb)
|
||||||
|
vt_systemd_menu (vb) vt_sys_menu_mem vt_linux_initrd
|
||||||
|
configfile "mem:${vt_sys_menu_mem_addr}:size:${vt_sys_menu_mem_size}"
|
||||||
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -470,19 +503,19 @@ function ventoy_freebsd_proc {
|
|||||||
ventoy_get_truenas_ver "$1" "${chosen_path}"
|
ventoy_get_truenas_ver "$1" "${chosen_path}"
|
||||||
elif vt_strstr "$vt_volume_id" "FURYBSD"; then
|
elif vt_strstr "$vt_volume_id" "FURYBSD"; then
|
||||||
ventoy_get_furybsd_ver "$1" "${chosen_path}"
|
ventoy_get_furybsd_ver "$1" "${chosen_path}"
|
||||||
elif regexp --set 1:vtBsdVerNum "^(14|13|12|11|10|9)_[0-9]" "$vt_volume_id"; then
|
elif regexp --set 1:vtBsdVerNum "^(15|14|13|12|11|10|9)_[0-9]" "$vt_volume_id"; then
|
||||||
set vt_freebsd_ver=${vtBsdVerNum}.x
|
set vt_freebsd_ver=${vtBsdVerNum}.x
|
||||||
elif [ -d (loop)/usr/midnightbsd-dist ]; then
|
elif [ -d (loop)/usr/midnightbsd-dist ]; then
|
||||||
ventoy_get_midnightbsd_ver "$1" "${chosen_path}"
|
ventoy_get_midnightbsd_ver "$1" "${chosen_path}"
|
||||||
set vtFreeBsdDistro=MidnightBSD
|
set vtFreeBsdDistro=MidnightBSD
|
||||||
elif [ -e (loop)/bin/freebsd-version ]; then
|
elif [ -e (loop)/bin/freebsd-version ]; then
|
||||||
vt_unix_parse_freebsd_ver (loop)/bin/freebsd-version vt_userland_ver
|
vt_unix_parse_freebsd_ver (loop)/bin/freebsd-version vt_userland_ver
|
||||||
if regexp --set 1:vtBsdVerNum "\"(14|13|12|11|10|9)\.[0-9]-" "$vt_userland_ver"; then
|
if regexp --set 1:vtBsdVerNum "\"(15|14|13|12|11|10|9)\.[0-9]-" "$vt_userland_ver"; then
|
||||||
set vt_freebsd_ver=${vtBsdVerNum}.x
|
set vt_freebsd_ver=${vtBsdVerNum}.x
|
||||||
fi
|
fi
|
||||||
elif [ -e (loop)/README.TXT ]; then
|
elif [ -e (loop)/README.TXT ]; then
|
||||||
vt_1st_line (loop)/README.TXT vt_freebsd_line1
|
vt_1st_line (loop)/README.TXT vt_freebsd_line1
|
||||||
if regexp --set 1:vtBsdVerNum "FreeBSD (14|13|12|11|10|9)\.[0-9]-" "$vt_freebsd_line1"; then
|
if regexp --set 1:vtBsdVerNum "FreeBSD (15|14|13|12|11|10|9)\.[0-9]-" "$vt_freebsd_line1"; then
|
||||||
set vt_freebsd_ver=${vtBsdVerNum}.x
|
set vt_freebsd_ver=${vtBsdVerNum}.x
|
||||||
fi
|
fi
|
||||||
elif vt_strstr "${chosen_path}" "MidnightBSD"; then
|
elif vt_strstr "${chosen_path}" "MidnightBSD"; then
|
||||||
@@ -629,7 +662,7 @@ function uefi_windows_menu_func {
|
|||||||
|
|
||||||
if [ -n "$vtoy_chain_mem_addr" ]; then
|
if [ -n "$vtoy_chain_mem_addr" ]; then
|
||||||
ventoy_acpi_param ${vtoy_chain_mem_addr} 2048
|
ventoy_acpi_param ${vtoy_chain_mem_addr} 2048
|
||||||
ventoy_cli_console
|
ventoy_max_resolution
|
||||||
chainloader ${vtoy_path}/ventoy_${VTOY_EFI_ARCH}.efi env_param=${env_param} isoefi=${LoadIsoEfiDriver} iso_${ventoy_fs_probe} ${vtdebug_flag} mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size}
|
chainloader ${vtoy_path}/ventoy_${VTOY_EFI_ARCH}.efi env_param=${env_param} isoefi=${LoadIsoEfiDriver} iso_${ventoy_fs_probe} ${vtdebug_flag} mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size}
|
||||||
boot
|
boot
|
||||||
else
|
else
|
||||||
@@ -1411,7 +1444,7 @@ function ventoy_iso_busybox_ver {
|
|||||||
|
|
||||||
#special process for deepin-live iso
|
#special process for deepin-live iso
|
||||||
if [ "$vt_chosen_size" = "403701760" ]; then
|
if [ "$vt_chosen_size" = "403701760" ]; then
|
||||||
if vt_str_str "$vt_chosen_path" "/deepin-live"; then
|
if vt_strstr "$vt_chosen_path" "/deepin-live"; then
|
||||||
set ventoy_busybox_ver=64
|
set ventoy_busybox_ver=64
|
||||||
fi
|
fi
|
||||||
elif vt_str_begin "$vt_volume_id" "PHOTON_"; then
|
elif vt_str_begin "$vt_volume_id" "PHOTON_"; then
|
||||||
@@ -1422,6 +1455,8 @@ function ventoy_iso_busybox_ver {
|
|||||||
set ventoy_busybox_ver=64
|
set ventoy_busybox_ver=64
|
||||||
elif vt_str_begin "$vt_volume_id" "KAOS_"; then
|
elif vt_str_begin "$vt_volume_id" "KAOS_"; then
|
||||||
set ventoy_busybox_ver=64
|
set ventoy_busybox_ver=64
|
||||||
|
elif vt_strstr "$vt_volume_id" "x86_64"; then
|
||||||
|
set ventoy_busybox_ver=64
|
||||||
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@@ -1900,6 +1935,12 @@ function ventoy_img_volumio {
|
|||||||
function ventoy_img_openelec {
|
function ventoy_img_openelec {
|
||||||
elec_ver=$1
|
elec_ver=$1
|
||||||
|
|
||||||
|
if [ "$elec_ver" = "LibreELEC" ]; then
|
||||||
|
if vt_strstr "$vt_chosen_name" "x86_64"; then
|
||||||
|
set ventoy_busybox_ver=64
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
vt_load_cpio $vtoy_path "${vt_chosen_path}" ${vtoy_iso_part} "busybox=$ventoy_busybox_ver"
|
vt_load_cpio $vtoy_path "${vt_chosen_path}" ${vtoy_iso_part} "busybox=$ventoy_busybox_ver"
|
||||||
vt_trailer_cpio ${vtoy_iso_part} "${vt_chosen_path}" noinit
|
vt_trailer_cpio ${vtoy_iso_part} "${vt_chosen_path}" noinit
|
||||||
|
|
||||||
@@ -2408,7 +2449,7 @@ function mimg_common_menuentry {
|
|||||||
#############################################################
|
#############################################################
|
||||||
#############################################################
|
#############################################################
|
||||||
|
|
||||||
set VENTOY_VERSION="1.1.04"
|
set VENTOY_VERSION="1.1.11"
|
||||||
|
|
||||||
#ACPI not compatible with Window7/8, so disable by default
|
#ACPI not compatible with Window7/8, so disable by default
|
||||||
set VTOY_PARAM_NO_ACPI=1
|
set VTOY_PARAM_NO_ACPI=1
|
||||||
|
|||||||
19
INSTALL/grub/help/fa_IR.txt
Normal file
19
INSTALL/grub/help/fa_IR.txt
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
L - انتخاب زبان
|
||||||
|
F1 - نمایش راهنما
|
||||||
|
F2 - مرور و بوت کردن فایلها در دیسک محلی
|
||||||
|
F3 - تغییر حالت منو بین درختی <-> لیستی
|
||||||
|
F4 - بوت کردن ویندوز/لینوکس روی دیسک محلی
|
||||||
|
F5 - ابزار های کمکی
|
||||||
|
F6 - بارگیری منوی سفارشی Grub2
|
||||||
|
F7 - تغییر حالت بین حالت GUI <-> حالت TEXT
|
||||||
|
|
||||||
|
m/Ctrl+m - اعتبارسنجی فایل ایمیج (md5/sha1/sha256/sha512)
|
||||||
|
d/Ctrl+d - حالت Memdisk (فقط برای ایمیج های کوچک WinPE/LiveCD ISO/IMG)
|
||||||
|
w/Ctrl+w - حالت WIMBOOT (فقط برای فایل های ایزو Windows/WinPE)
|
||||||
|
r/Ctrl+r - حالت Grub2 (فقط برای برخی از توزیع های لینوکس)
|
||||||
|
i/Ctrl+i - حالت سازگار (فقط برای مشکل زدایی)
|
||||||
|
u/Ctrl+u - بارگیری درایور ISO EFI (تنها برای مشکل زدایی، نمیتوان به صورت رسمی استفاده کرد)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
جهت بازگشت دکمه ESC را کلیک کنید ......
|
||||||
@@ -7,10 +7,10 @@ F5 - 유틸리티
|
|||||||
F6 - 사용자 지정 Grub2 메뉴 불러오기
|
F6 - 사용자 지정 Grub2 메뉴 불러오기
|
||||||
F7 - 그래픽 모드 <-> 텍스트 모드 간에 전환
|
F7 - 그래픽 모드 <-> 텍스트 모드 간에 전환
|
||||||
|
|
||||||
m/Ctrl+m - 체크섬 이미지 파일 (md5/sha1/sha256/sha512)
|
m/Ctrl+m - 이미지 파일 체크섬 (md5/sha1/sha256/sha512)
|
||||||
d/Ctrl+d - Memdisk 모드 (작은 WinPE/LiveCD ISO/IMG 전용)
|
d/Ctrl+d - Memdisk 모드 (작은 WinPE/LiveCD ISO/IMG에만 해당)
|
||||||
w/Ctrl+w - WIMBOOT 모드 (표준 Windows/WinPE ISO 전용)
|
w/Ctrl+w - WIMBOOT 모드 (표준 Windows/WinPE ISO에만 해당)
|
||||||
r/Ctrl+r - Grub2 모드 (일부 Linux 배포판에만 해당)
|
r/Ctrl+r - Grub2 모드 (일반 Linux 배포판에만 해당)
|
||||||
i/Ctrl+i - 호환 모드 (디버그 전용, 공식적으로 사용할 수 없음)
|
i/Ctrl+i - 호환 모드 (디버그 전용, 공식적으로 사용할 수 없음)
|
||||||
u/Ctrl+u - ISO EFI 드라이버 불러오기 (디버그 전용, 공식적으로 사용할 수 없음)
|
u/Ctrl+u - ISO EFI 드라이버 불러오기 (디버그 전용, 공식적으로 사용할 수 없음)
|
||||||
|
|
||||||
|
|||||||
19
INSTALL/grub/help/lg_UG.txt
Normal file
19
INSTALL/grub/help/lg_UG.txt
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
L - Londako Olulimi
|
||||||
|
F1 - Laga obuyambi
|
||||||
|
F2 - Nnoonya era kozesa Fayiro eziri ku Disk
|
||||||
|
F3 - Kyusa endabika ya Menu wakati wa Masaasana (Treeview) ne y'olukalala (ListView)
|
||||||
|
F4 - Ttandika Windows/Linux ku disk erimu
|
||||||
|
F5 - Ebikozesebwa ebirala
|
||||||
|
F6 - Kozesa Grub2 menu gyewerobozza
|
||||||
|
F7 - Okukyuusa okuva mu Bifaananyi (GUI Mode) <-> Bigambo (TEXT Mode)
|
||||||
|
|
||||||
|
m/Ctrl+m - Okukebera Checksum image files (md5/sha1/sha256/sha512)
|
||||||
|
d/Ctrl+d - Memdisk Mode (Ya WinPE/LiveCD ISO/IMG entono zokka)
|
||||||
|
w/Ctrl+w - WIMBOOT Mode (Ya Windows/WinPE ISO zokka)
|
||||||
|
r/Ctrl+r - Grub2 Mode (Ya nkola za Linux ezimu)
|
||||||
|
i/Ctrl+i - Compatible Mode (Ya kutereeza kwokka (debugging))
|
||||||
|
u/Ctrl+u - Kozesa ISO EFI driver (Ya kutereeza kwokka (debugging), tesobola kukozesebwa mu butongole)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
nyiga ESC to okudda emabega ......
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
L - Sele<EFBFBD><EFBFBD>o de Idiomas
|
L - Seleção de Idiomas
|
||||||
F1 - Exibir informa<EFBFBD><EFBFBD>es de ajuda
|
F1 - Exibir informações de ajuda
|
||||||
F2 - Explorar e inicializar os arquivos no disco local
|
F2 - Explorar e inicializar os arquivos no disco local
|
||||||
F3 - Trocar o modo do menu entre Visualiza<EFBFBD><EFBFBD>o em <EFBFBD>rvore <-> Visualiza<EFBFBD><EFBFBD>o em Lista
|
F3 - Trocar o modo do menu entre Visualização em Árvore <-> Visualização em Lista
|
||||||
F4 - Inicializar o Windows/Linux no disco local
|
F4 - Inicializar o Windows/Linux no disco local
|
||||||
F5 - Utilit<EFBFBD>rios
|
F5 - Utilitários
|
||||||
F6 - Carregar o Menu Personalizado do Grub2
|
F6 - Carregar o Menu Personalizado do Grub2
|
||||||
F7 - Trocar entre o Modo GUI <-> Modo TEXTO
|
F7 - Trocar entre o Modo GUI <-> Modo TEXTO
|
||||||
|
|
||||||
m/Ctrl+m - Checksum dos arquivos de imagem (md5/sha1/sha256/sha512)
|
m/Ctrl+m - Checksum dos arquivos de imagem (md5/sha1/sha256/sha512)
|
||||||
d/Ctrl+d - Modo Memdisk (S<EFBFBD> pros pequenos WinPE/LiveCD ISO/IMG)
|
d/Ctrl+d - Modo Memdisk (Só pros pequenos WinPE/LiveCD ISO/IMG)
|
||||||
w/Ctrl+w - Modo WIMBOOT (S<EFBFBD> pra arquivos ISO do Windows/WinPE)
|
w/Ctrl+w - Modo WIMBOOT (Só pra arquivos ISO do Windows/WinPE)
|
||||||
r/Ctrl+r - Modo Grub2 (S<EFBFBD> pra algumas distros do Linux)
|
r/Ctrl+r - Modo Grub2 (Só pra algumas distros do Linux)
|
||||||
i/Ctrl+i - Modo Compat<EFBFBD>vel (S<EFBFBD> pra debugging)
|
i/Ctrl+i - Modo Compatível (Só pra debugging)
|
||||||
u/Ctrl+u - Carregar o driver EFI da ISO (S<EFBFBD> pra debugging, n<EFBFBD>o pode ser usado oficialmente)
|
u/Ctrl+u - Carregar o driver EFI da ISO (Só pra debugging, não pode ser usado oficialmente)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
19
INSTALL/grub/help/sl_SI.txt
Normal file
19
INSTALL/grub/help/sl_SI.txt
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
L - Izbira jezika
|
||||||
|
F1 - Prikaz informacij o pomoči
|
||||||
|
F2 - Brskanje in zagon datotek na lokalnem disku
|
||||||
|
F3 - Preklop med načinom menija Treeview <-> ListView
|
||||||
|
F4 - Zagon Windows/Linux na lokalnem disku
|
||||||
|
F5 - Pripomočki
|
||||||
|
F6 - Naložitev prilagojenega menija Grub2
|
||||||
|
F7 - Preklop med načinom GUI <-> načinom TEXT
|
||||||
|
|
||||||
|
m/Ctrl+m - Preveri kontrolno vsoto slikovnih datotek (md5/sha1/sha256/sha512)
|
||||||
|
d/Ctrl+d - Način Memdisk (samo za majhne WinPE/LiveCD ISO/IMG)
|
||||||
|
w/Ctrl+w - Način WIMBOOT (samo za datoteke Windows/WinPE ISO)
|
||||||
|
r/Ctrl+r – Način Grub2 (samo za nekatere distribucije Linux)
|
||||||
|
i/Ctrl+i – Združljiv način (samo za odpravljanje napak)
|
||||||
|
u/Ctrl+u – Naloži ISO EFI gonilnik (samo za odpravljanje napak, uradno se ne more uporabljati)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Pritisnite ESC za vrnitev ......
|
||||||
@@ -40,17 +40,17 @@ menuentry "$VTLANG_HWINFO" --class=debug_hwinfo --class=F5tool {
|
|||||||
echo "Physical RAM $grub_total_ram MB"
|
echo "Physical RAM $grub_total_ram MB"
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "Manufacture $system_vendor"
|
echo "Manufacturer $system_vendor"
|
||||||
echo "Product Name $system_product"
|
echo "Product Name $system_product"
|
||||||
echo "Version $system_version"
|
echo "Version $system_version"
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "Board Manufacture $board_vendor"
|
echo "Board Manufacturer $board_vendor"
|
||||||
echo "Board Name $board_product"
|
echo "Board Name $board_product"
|
||||||
echo "Board Version $board_version"
|
echo "Board Version $board_version"
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "BIOS Manufacture $bios_vendor"
|
echo "BIOS Manufacturer $bios_vendor"
|
||||||
echo "BIOS Version $bios_ver"
|
echo "BIOS Version $bios_ver"
|
||||||
echo "BIOS Date $bios_date"
|
echo "BIOS Date $bios_date"
|
||||||
echo "BIOS ROM Size $bios_size"
|
echo "BIOS ROM Size $bios_size"
|
||||||
|
|||||||
93
INSTALL/grub/menu/fa_IR.json
Normal file
93
INSTALL/grub/menu/fa_IR.json
Normal file
@@ -0,0 +1,93 @@
|
|||||||
|
{
|
||||||
|
"VTLANG_LANGUAGE_NAME": "Persian (فارسی)",
|
||||||
|
|
||||||
|
"VTLANG_STR_HOTKEY_LIST": "L:زبان F1:راهنما F2:مرور F3:نمای لیستی F4:بوت محلی F5:ابزار F6:بازگشت",
|
||||||
|
"VTLANG_STR_HOTKEY_TREE": "L:زبان F1:راهنما F2:مرور F3:نمای درختی F4:بوت محلی F5:ابزار F6:بازگشت",
|
||||||
|
"VTLANG_RETURN_PREVIOUS": "بازگشت به منوی قبلی [Esc]",
|
||||||
|
"VTLANG_RETURN_PRV_NOESC": "بازگشت به منوی قبلی",
|
||||||
|
|
||||||
|
"VTLANG_MENU_LANG": "منوی انتخاب زبان",
|
||||||
|
|
||||||
|
"VTLANG_LB_SBOOT_WINDOWS": "جستجو و بوت ویندوز",
|
||||||
|
"VTLANG_LB_SBOOT_G4D": "جستجو و بوت Grub4dos",
|
||||||
|
"VTLANG_LB_SBOOT_HDD1": "بوت اولین دیسک محلی",
|
||||||
|
"VTLANG_LB_SBOOT_HDD2": "بوت دومین دیسک محلی",
|
||||||
|
"VTLANG_LB_SBOOT_HDD3": "بوت سومین دیسک محلی",
|
||||||
|
"VTLANG_LB_SBOOT_X64EFI": "جستجو و بوت BOOTX64.EFI",
|
||||||
|
"VTLANG_LB_SBOOT_IA32EFI": "جستجو و بوت BOOTIA32.EFI",
|
||||||
|
"VTLANG_LB_SBOOT_AA64EFI": "جستجو و بوت BOOTAA64.EFI",
|
||||||
|
"VTLANG_LB_SBOOT_XORBOOT": "جستجو و بوت xorboot",
|
||||||
|
|
||||||
|
"VTLANG_FILE_CHKSUM": "اعتبارسنجی فایل",
|
||||||
|
"VTLANG_CHKSUM_MD5_CALC": "محاسبه md5sum",
|
||||||
|
"VTLANG_CHKSUM_SHA1_CALC": "محاسبه sha1sum",
|
||||||
|
"VTLANG_CHKSUM_SHA256_CALC": "محاسبه sha256sum",
|
||||||
|
"VTLANG_CHKSUM_SHA512_CALC": "محاسبه sha512sum",
|
||||||
|
"VTLANG_CHKSUM_MD5_CALC_CHK": "محاسبه و بررسی md5sum",
|
||||||
|
"VTLANG_CHKSUM_SHA1_CALC_CHK": "محاسبه و بررسی sha1sum",
|
||||||
|
"VTLANG_CHKSUM_SHA256_CALC_CHK": "محاسبه و بررسی sha256sum",
|
||||||
|
"VTLANG_CHKSUM_SHA512_CALC_CHK": "محاسبه و بررسی sha512sum",
|
||||||
|
|
||||||
|
"VTLANG_POWER": "انرژی",
|
||||||
|
"VTLANG_POWER_REBOOT": "ریبوت",
|
||||||
|
"VTLANG_POWER_HALT": "توقف",
|
||||||
|
"VTLANG_POWER_BOOT_EFIFW": "ریبوت به تنظیمات EFI",
|
||||||
|
|
||||||
|
"VTLANG_KEYBRD_LAYOUT": "نمایه صفحه کلید",
|
||||||
|
"VTLANG_HWINFO": "اطلاعات سخت افزار",
|
||||||
|
|
||||||
|
"VTLANG_RESOLUTION_CFG": "پیکربندی رزولوشن",
|
||||||
|
"VTLANG_SCREEN_MODE": "حالت نمایش صفحه",
|
||||||
|
"VTLANG_SCREEN_TEXT_MODE": "حالت متنی اجباری",
|
||||||
|
"VTLANG_SCREEN_GUI_MODE": "حالت گرافیکی اجباری",
|
||||||
|
|
||||||
|
"VTLANG_THEME_SELECT": "انتخاب تم",
|
||||||
|
|
||||||
|
"VTLANG_UEFI_UTIL": "ابزار های کمکی Ventoy UEFI",
|
||||||
|
"VTLANG_UTIL_SHOW_EFI_DRV": "نمایش درایور های EFI",
|
||||||
|
"VTLANG_UTIL_FIX_BLINIT_FAIL": "رفع خطای Windows BlinitializeLibrary",
|
||||||
|
|
||||||
|
"VTLANG_JSON_CHK_JSON": "بررسی پیکربندی json افزونه (ventoy.json)",
|
||||||
|
"VTLANG_JSON_CHK_CONTROL": "بررسی پیکربندی افزونه کنترل سراسری",
|
||||||
|
"VTLANG_JSON_CHK_THEME": "بررسی پیکربندی افزونه قالب",
|
||||||
|
"VTLANG_JSON_CHK_AUTOINS": "بررسی پیکربندی افزونه نصب خودکار",
|
||||||
|
"VTLANG_JSON_CHK_PERSIST": "بررسی پیکربندی افزونهی تداوم",
|
||||||
|
"VTLANG_JSON_CHK_MENU_ALIAS": "بررسی پیکربندی افزونه نام مستعار منو",
|
||||||
|
"VTLANG_JSON_CHK_MENU_TIP": "بررسی پیکربندی افزونه نکته منو",
|
||||||
|
"VTLANG_JSON_CHK_MENU_CLASS": "بررسی پیکربندی افزونه کلاس منو",
|
||||||
|
"VTLANG_JSON_CHK_INJECTION": "بررسی پیکربندی افزونه تزریق",
|
||||||
|
"VTLANG_JSON_CHK_AUTO_MEMDISK": "بررسی پیکربندی افزونه memdisk خودکار",
|
||||||
|
"VTLANG_JSON_CHK_IMG_LIST": "بررسی پیکربندی افزونه لیست ایمیج ها",
|
||||||
|
"VTLANG_JSON_CHK_IMG_BLIST": "بررسی پیکربندی افزونه لیست سیاه ایمیج",
|
||||||
|
"VTLANG_JSON_CHK_CONF_REPLACE": "بررسی پیکربندی افزونه جایگزینی فایل پیکربندی بوت",
|
||||||
|
"VTLANG_JSON_CHK_DUD": "بررسی پیکربندی افزونه dud",
|
||||||
|
"VTLANG_JSON_CHK_PASSWORD": "بررسی پیکربندی افزونه کلمه عبور",
|
||||||
|
|
||||||
|
"VTLANG_NORMAL_MODE": "بوت در حالت عادی",
|
||||||
|
"VTLANG_WIMBOOT_MODE": "بوت در حالت wimboot",
|
||||||
|
"VTLANG_GRUB2_MODE": "بوت در حالت grub2",
|
||||||
|
"VTLANG_MEMDISK_MODE": "بوت در حالت memdisk",
|
||||||
|
|
||||||
|
"VTLANG_RET_TO_LISTVIEW": "بازگشت به نمای لیستی",
|
||||||
|
"VTLANG_RET_TO_TREEVIEW": "بازگشت به نمای درختی",
|
||||||
|
|
||||||
|
"VTLANG_NO_AUTOINS_SCRIPT": "بوت بدون قالب نصب خودکار",
|
||||||
|
"VTLANG_AUTOINS_USE": "بوت با",
|
||||||
|
|
||||||
|
"VTLANG_NO_PERSIST": "بوت بدون تداوم",
|
||||||
|
"VTLANG_PERSIST_USE": "بوت با",
|
||||||
|
|
||||||
|
"VTLANG_BROWER_RETURN": "بازگشت",
|
||||||
|
|
||||||
|
"VTLANG_ENTER_EXIT": "جهت خروج دکمه Enter را فشار دهید",
|
||||||
|
"VTLANG_ENTER_REBOOT": "جهت ریبوت دکمه Enter را فشار دهید",
|
||||||
|
"VTLANG_ENTER_CONTINUE": "جهت ادامه دکمه Enter را فشار دهید",
|
||||||
|
|
||||||
|
"VTLANG_CTRL_TEMP_SET": "تنظیمات کنترل موقت",
|
||||||
|
"VTLANG_WIN11_BYPASS_CHECK": "دور زدن بررسی CPU/TPM/SecureBoot در هنگام نصب ویندوز 11",
|
||||||
|
"VTLANG_WIN11_BYPASS_NRO": "دور زدن نیاز به حساب کاربری آنلاین هنگام نصب ویندوز 11",
|
||||||
|
"VTLANG_LINUX_REMOUNT": "اتصال پارتیشن Ventoy بعد از بوت لینوکس",
|
||||||
|
"VTLANG_SECONDARY_BOOT_MENU": "نمایش منوی بوت ثانویه",
|
||||||
|
|
||||||
|
"MENU_STR_XXX": ""
|
||||||
|
}
|
||||||
@@ -43,7 +43,7 @@
|
|||||||
|
|
||||||
"VTLANG_THEME_SELECT": "Pilih Tema",
|
"VTLANG_THEME_SELECT": "Pilih Tema",
|
||||||
|
|
||||||
"VTLANG_UEFI_UTIL": "Ventoy UEFI Utilities",
|
"VTLANG_UEFI_UTIL": "Utilitas UEFI Ventoy",
|
||||||
"VTLANG_UTIL_SHOW_EFI_DRV": "Tampilkan Driver EFI",
|
"VTLANG_UTIL_SHOW_EFI_DRV": "Tampilkan Driver EFI",
|
||||||
"VTLANG_UTIL_FIX_BLINIT_FAIL": "Memperbaiki Kegagalan Windows BlinitializeLibrary",
|
"VTLANG_UTIL_FIX_BLINIT_FAIL": "Memperbaiki Kegagalan Windows BlinitializeLibrary",
|
||||||
|
|
||||||
@@ -80,14 +80,14 @@
|
|||||||
"VTLANG_BROWER_RETURN": "Kembali",
|
"VTLANG_BROWER_RETURN": "Kembali",
|
||||||
|
|
||||||
"VTLANG_ENTER_EXIT": "tekan tombol Enter untuk keluar",
|
"VTLANG_ENTER_EXIT": "tekan tombol Enter untuk keluar",
|
||||||
"VTLANG_ENTER_REBOOT": "tekan tombol Enter untuk reboot",
|
"VTLANG_ENTER_REBOOT": "tekan tombol Enter untuk memulai ulang",
|
||||||
"VTLANG_ENTER_CONTINUE": "tekan tombol Enter untuk melanjutkan",
|
"VTLANG_ENTER_CONTINUE": "tekan tombol Enter untuk melanjutkan",
|
||||||
|
|
||||||
"VTLANG_CTRL_TEMP_SET": "Temporary Control Settings",
|
"VTLANG_CTRL_TEMP_SET": "Pengaturan Kontrol Sementara",
|
||||||
"VTLANG_WIN11_BYPASS_CHECK": "Bypass CPU/TPM/SecureBoot check when install Windows 11",
|
"VTLANG_WIN11_BYPASS_CHECK": "Melewati pemeriksaaan CPU/TPM/SecureBoot ketika memasang Windows 11",
|
||||||
"VTLANG_WIN11_BYPASS_NRO": "Bypass online account requirement when install Windows 11",
|
"VTLANG_WIN11_BYPASS_NRO": "Melewati persyaratan akun online ketika memasang Windows 11",
|
||||||
"VTLANG_LINUX_REMOUNT": "Mount Ventoy partition after boot Linux",
|
"VTLANG_LINUX_REMOUNT": "Memuat partisi Ventoy setelah boot ke Linux",
|
||||||
"VTLANG_SECONDARY_BOOT_MENU": "Show secondary boot menu",
|
"VTLANG_SECONDARY_BOOT_MENU": "Tampilkan menu boot sekunder",
|
||||||
|
|
||||||
"MENU_STR_XXX": ""
|
"MENU_STR_XXX": ""
|
||||||
}
|
}
|
||||||
|
|||||||
93
INSTALL/grub/menu/lg_UG.json
Normal file
93
INSTALL/grub/menu/lg_UG.json
Normal file
@@ -0,0 +1,93 @@
|
|||||||
|
{
|
||||||
|
"VTLANG_LANGUAGE_NAME": "English (English)",
|
||||||
|
|
||||||
|
"VTLANG_STR_HOTKEY_LIST": "L:Language F1:Help F2:Browse F3:ListView F4:Localboot F5:Tools F6:ExMenu",
|
||||||
|
"VTLANG_STR_HOTKEY_TREE": "L:Language F1:Help F2:Browse F3:TreeView F4:Localboot F5:Tools F6:ExMenu",
|
||||||
|
"VTLANG_RETURN_PREVIOUS": "Return to previous menu [Esc]",
|
||||||
|
"VTLANG_RETURN_PRV_NOESC": "Return to previous menu",
|
||||||
|
|
||||||
|
"VTLANG_MENU_LANG": "Menu Language Select",
|
||||||
|
|
||||||
|
"VTLANG_LB_SBOOT_WINDOWS": "Search and boot Windows",
|
||||||
|
"VTLANG_LB_SBOOT_G4D": "Search and boot Grub4dos",
|
||||||
|
"VTLANG_LB_SBOOT_HDD1": "Boot the 1st local disk",
|
||||||
|
"VTLANG_LB_SBOOT_HDD2": "Boot the 2nd local disk",
|
||||||
|
"VTLANG_LB_SBOOT_HDD3": "Boot the 3rd local disk",
|
||||||
|
"VTLANG_LB_SBOOT_X64EFI": "Search and boot BOOTX64.EFI",
|
||||||
|
"VTLANG_LB_SBOOT_IA32EFI": "Search and boot BOOTIA32.EFI",
|
||||||
|
"VTLANG_LB_SBOOT_AA64EFI": "Search and boot BOOTAA64.EFI",
|
||||||
|
"VTLANG_LB_SBOOT_XORBOOT": "Search and boot xorboot",
|
||||||
|
|
||||||
|
"VTLANG_FILE_CHKSUM": "File checksum",
|
||||||
|
"VTLANG_CHKSUM_MD5_CALC": "Calculate md5sum",
|
||||||
|
"VTLANG_CHKSUM_SHA1_CALC": "Calculate sha1sum",
|
||||||
|
"VTLANG_CHKSUM_SHA256_CALC": "Calculate sha256sum",
|
||||||
|
"VTLANG_CHKSUM_SHA512_CALC": "Calculate sha512sum",
|
||||||
|
"VTLANG_CHKSUM_MD5_CALC_CHK": "Calculate and check md5sum",
|
||||||
|
"VTLANG_CHKSUM_SHA1_CALC_CHK": "Calculate and check sha1sum",
|
||||||
|
"VTLANG_CHKSUM_SHA256_CALC_CHK": "Calculate and check sha256sum",
|
||||||
|
"VTLANG_CHKSUM_SHA512_CALC_CHK": "Calculate and check sha512sum",
|
||||||
|
|
||||||
|
"VTLANG_POWER": "Power",
|
||||||
|
"VTLANG_POWER_REBOOT": "Reboot",
|
||||||
|
"VTLANG_POWER_HALT": "Halt",
|
||||||
|
"VTLANG_POWER_BOOT_EFIFW": "Reboot to EFI setup",
|
||||||
|
|
||||||
|
"VTLANG_KEYBRD_LAYOUT": "Keyboard Layouts",
|
||||||
|
"VTLANG_HWINFO": "Hardware Information",
|
||||||
|
|
||||||
|
"VTLANG_RESOLUTION_CFG": "Resolution Configuration",
|
||||||
|
"VTLANG_SCREEN_MODE": "Screen Display Mode",
|
||||||
|
"VTLANG_SCREEN_TEXT_MODE": "Force Text Mode",
|
||||||
|
"VTLANG_SCREEN_GUI_MODE": "Force Graphics Mode",
|
||||||
|
|
||||||
|
"VTLANG_THEME_SELECT": "Theme Select",
|
||||||
|
|
||||||
|
"VTLANG_UEFI_UTIL": "Ventoy UEFI Utilities",
|
||||||
|
"VTLANG_UTIL_SHOW_EFI_DRV": "Show EFI Drivers",
|
||||||
|
"VTLANG_UTIL_FIX_BLINIT_FAIL": "Fixup Windows BlinitializeLibrary Failure",
|
||||||
|
|
||||||
|
"VTLANG_JSON_CHK_JSON": "Check plugin json configuration (ventoy.json)",
|
||||||
|
"VTLANG_JSON_CHK_CONTROL": "Check global control plugin configuration",
|
||||||
|
"VTLANG_JSON_CHK_THEME": "Check theme plugin configuration",
|
||||||
|
"VTLANG_JSON_CHK_AUTOINS": "Check auto install plugin configuration",
|
||||||
|
"VTLANG_JSON_CHK_PERSIST": "Check persistence plugin configuration",
|
||||||
|
"VTLANG_JSON_CHK_MENU_ALIAS": "Check menu alias plugin configuration",
|
||||||
|
"VTLANG_JSON_CHK_MENU_TIP": "Check menu tip plugin configuration",
|
||||||
|
"VTLANG_JSON_CHK_MENU_CLASS": "Check menu class plugin configuration",
|
||||||
|
"VTLANG_JSON_CHK_INJECTION": "Check injection plugin configuration",
|
||||||
|
"VTLANG_JSON_CHK_AUTO_MEMDISK": "Check auto memdisk plugin configuration",
|
||||||
|
"VTLANG_JSON_CHK_IMG_LIST": "Check image list plugin configuration",
|
||||||
|
"VTLANG_JSON_CHK_IMG_BLIST": "Check image blacklist plugin configuration",
|
||||||
|
"VTLANG_JSON_CHK_CONF_REPLACE": "Check boot conf replace plugin configuration",
|
||||||
|
"VTLANG_JSON_CHK_DUD": "Check dud plugin configuration",
|
||||||
|
"VTLANG_JSON_CHK_PASSWORD": "Check password plugin configuration",
|
||||||
|
|
||||||
|
"VTLANG_NORMAL_MODE": "Boot in normal mode",
|
||||||
|
"VTLANG_WIMBOOT_MODE": "Boot in wimboot mode",
|
||||||
|
"VTLANG_GRUB2_MODE": "Boot in grub2 mode",
|
||||||
|
"VTLANG_MEMDISK_MODE": "Boot in memdisk mode",
|
||||||
|
|
||||||
|
"VTLANG_RET_TO_LISTVIEW": "Return to ListView",
|
||||||
|
"VTLANG_RET_TO_TREEVIEW": "Return to TreeView",
|
||||||
|
|
||||||
|
"VTLANG_NO_AUTOINS_SCRIPT": "Boot without auto installation template",
|
||||||
|
"VTLANG_AUTOINS_USE": "Boot with",
|
||||||
|
|
||||||
|
"VTLANG_NO_PERSIST": "Boot without persistence",
|
||||||
|
"VTLANG_PERSIST_USE": "Boot with",
|
||||||
|
|
||||||
|
"VTLANG_BROWER_RETURN": "Return",
|
||||||
|
|
||||||
|
"VTLANG_ENTER_EXIT": "press Enter key to exit",
|
||||||
|
"VTLANG_ENTER_REBOOT": "press Enter key to reboot",
|
||||||
|
"VTLANG_ENTER_CONTINUE": "press Enter key to continue",
|
||||||
|
|
||||||
|
"VTLANG_CTRL_TEMP_SET": "Temporary Control Settings",
|
||||||
|
"VTLANG_WIN11_BYPASS_CHECK": "Bypass CPU/TPM/SecureBoot check when install Windows 11",
|
||||||
|
"VTLANG_WIN11_BYPASS_NRO": "Bypass online account requirement when install Windows 11",
|
||||||
|
"VTLANG_LINUX_REMOUNT": "Mount Ventoy partition after boot Linux",
|
||||||
|
"VTLANG_SECONDARY_BOOT_MENU": "Show secondary boot menu",
|
||||||
|
|
||||||
|
"MENU_STR_XXX": ""
|
||||||
|
}
|
||||||
@@ -12,7 +12,7 @@ print_usage() {
|
|||||||
echo ' -l list Ventoy information in sdX'
|
echo ' -l list Ventoy information in sdX'
|
||||||
echo ''
|
echo ''
|
||||||
echo ' OPTION: (optional)'
|
echo ' OPTION: (optional)'
|
||||||
echo ' -r SIZE_MB preserve some space at the bottom of the disk (only for install)'
|
echo ' -r SIZE_MiB preserve some space (MiB) at the bottom of the disk (only for install)'
|
||||||
echo ' -s/-S enable/disable secure boot support (default is enabled)'
|
echo ' -s/-S enable/disable secure boot support (default is enabled)'
|
||||||
echo ' -g use GPT partition style, default is MBR (only for install)'
|
echo ' -g use GPT partition style, default is MBR (only for install)'
|
||||||
echo ' -L Label of the 1st exfat partition (default is Ventoy)'
|
echo ' -L Label of the 1st exfat partition (default is Ventoy)'
|
||||||
@@ -93,7 +93,7 @@ fi
|
|||||||
|
|
||||||
if [ -n "$RESERVE_SPACE" -a "$MODE" = "install" ]; then
|
if [ -n "$RESERVE_SPACE" -a "$MODE" = "install" ]; then
|
||||||
if echo $RESERVE_SIZE_MB | grep -q '^[0-9][0-9]*$'; then
|
if echo $RESERVE_SIZE_MB | grep -q '^[0-9][0-9]*$'; then
|
||||||
vtdebug "User will reserve $RESERVE_SIZE_MB MB disk space"
|
vtdebug "User will reserve $RESERVE_SIZE_MB MiB disk space"
|
||||||
else
|
else
|
||||||
vterr "$RESERVE_SIZE_MB is invalid for reserved space"
|
vterr "$RESERVE_SIZE_MB is invalid for reserved space"
|
||||||
exit 1
|
exit 1
|
||||||
@@ -231,7 +231,7 @@ if [ "$MODE" = "install" -a -z "$NONDESTRUCTIVE" ]; then
|
|||||||
reserve_sector_num=$(expr $sum_size_mb \* 2048)
|
reserve_sector_num=$(expr $sum_size_mb \* 2048)
|
||||||
|
|
||||||
if [ $disk_sector_num -le $reserve_sector_num ]; then
|
if [ $disk_sector_num -le $reserve_sector_num ]; then
|
||||||
vterr "Can't reserve $RESERVE_SIZE_MB MB space from $DISK"
|
vterr "Can't reserve $RESERVE_SIZE_MB MiB space from $DISK"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@@ -239,7 +239,7 @@ if [ "$MODE" = "install" -a -z "$NONDESTRUCTIVE" ]; then
|
|||||||
#Print disk info
|
#Print disk info
|
||||||
echo "Disk : $DISK"
|
echo "Disk : $DISK"
|
||||||
parted -s $DISK p 2>&1 | grep Model
|
parted -s $DISK p 2>&1 | grep Model
|
||||||
echo "Size : $disk_size_gb GB"
|
echo "Size : $disk_size_gb GiB"
|
||||||
if [ -n "$VTGPT" ]; then
|
if [ -n "$VTGPT" ]; then
|
||||||
echo "Style: GPT"
|
echo "Style: GPT"
|
||||||
else
|
else
|
||||||
@@ -248,7 +248,7 @@ if [ "$MODE" = "install" -a -z "$NONDESTRUCTIVE" ]; then
|
|||||||
echo ''
|
echo ''
|
||||||
|
|
||||||
if [ -n "$RESERVE_SPACE" ]; then
|
if [ -n "$RESERVE_SPACE" ]; then
|
||||||
echo "You will reserve $RESERVE_SIZE_MB MB disk space "
|
echo "You will reserve $RESERVE_SIZE_MB MiB disk space "
|
||||||
fi
|
fi
|
||||||
echo ''
|
echo ''
|
||||||
|
|
||||||
@@ -395,7 +395,7 @@ elif [ "$MODE" = "install" -a -n "$NONDESTRUCTIVE" ]; then
|
|||||||
#Print disk info
|
#Print disk info
|
||||||
echo "Disk : $DISK"
|
echo "Disk : $DISK"
|
||||||
parted -s $DISK p 2>&1 | grep Model
|
parted -s $DISK p 2>&1 | grep Model
|
||||||
echo "Size : $disk_size_gb GB"
|
echo "Size : $disk_size_gb GiB"
|
||||||
echo "Style: $OldStyle"
|
echo "Style: $OldStyle"
|
||||||
echo ''
|
echo ''
|
||||||
|
|
||||||
@@ -424,7 +424,7 @@ elif [ "$MODE" = "install" -a -n "$NONDESTRUCTIVE" ]; then
|
|||||||
PART1_MB=$(expr $PART1_4K / 256)
|
PART1_MB=$(expr $PART1_4K / 256)
|
||||||
PART1_NEW_MB=$(expr $PART1_MB - 32)
|
PART1_NEW_MB=$(expr $PART1_MB - 32)
|
||||||
|
|
||||||
echo "$PART1 is ${PART1_MB}MB"
|
echo "$PART1 is ${PART1_MB}MiB"
|
||||||
|
|
||||||
#check partition layout
|
#check partition layout
|
||||||
echo "check partition layout ..."
|
echo "check partition layout ..."
|
||||||
|
|||||||
38
INSTALL/tool/create_ventoy_iso_part_dm.sh
Normal file
38
INSTALL/tool/create_ventoy_iso_part_dm.sh
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
if [ "$(id -u)" -ne 0 ]; then
|
||||||
|
echo "Please run with sudo ..."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
oldpwd=$(pwd)
|
||||||
|
VPART=""
|
||||||
|
|
||||||
|
if dmsetup -h > /dev/null 2>&1; then
|
||||||
|
VPART_MAJOR_MINOR=$(dmsetup table ventoy | head -n 1 | awk '{print $4}')
|
||||||
|
cd /sys/class/block/
|
||||||
|
for t in *; do
|
||||||
|
if grep -q "^${VPART_MAJOR_MINOR}$" $t/dev; then
|
||||||
|
VPART=$t
|
||||||
|
echo 0 $(cat /sys/class/block/$VPART/size) linear /dev/$VPART 0 | dmsetup create $VPART
|
||||||
|
dmsetup mknodes "$VPART" > /dev/null 2>&1
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
cd $oldpwd
|
||||||
|
|
||||||
|
if [ -z "$VPART" ]; then
|
||||||
|
echo "$VPART_MAJOR_MINOR not found"
|
||||||
|
dmsetup ls; dmsetup info ventoy; dmsetup table ventoy
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
if [ ! -b "/dev/mapper/$VPART" ]; then
|
||||||
|
udevadm trigger --type=devices --action=add > /dev/null 2>&1
|
||||||
|
udevadm settle > /dev/null 2>&1
|
||||||
|
fi
|
||||||
|
echo "Create /dev/mapper/$VPART success"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "dmsetup program not avaliable"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
@@ -60,7 +60,7 @@ check_tool_work_ok() {
|
|||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if mkexfatfs -V > /dev/null; then
|
if mkexfatfs -V > /dev/null; then
|
||||||
vtdebug "mkexfatfs test ok ..."
|
vtdebug "mkexfatfs test ok ..."
|
||||||
else
|
else
|
||||||
vtdebug "mkexfatfs test fail ..."
|
vtdebug "mkexfatfs test fail ..."
|
||||||
@@ -341,6 +341,7 @@ EOF
|
|||||||
|
|
||||||
udevadm trigger --name-match=$DISK >/dev/null 2>&1
|
udevadm trigger --name-match=$DISK >/dev/null 2>&1
|
||||||
partprobe >/dev/null 2>&1
|
partprobe >/dev/null 2>&1
|
||||||
|
partx -u $DISK >/dev/null 2>&1
|
||||||
sleep 3
|
sleep 3
|
||||||
echo "Done"
|
echo "Done"
|
||||||
|
|
||||||
@@ -458,6 +459,7 @@ format_ventoy_disk_gpt() {
|
|||||||
|
|
||||||
udevadm trigger --name-match=$DISK >/dev/null 2>&1
|
udevadm trigger --name-match=$DISK >/dev/null 2>&1
|
||||||
partprobe >/dev/null 2>&1
|
partprobe >/dev/null 2>&1
|
||||||
|
partx -u $DISK >/dev/null 2>&1
|
||||||
sleep 3
|
sleep 3
|
||||||
echo "Done"
|
echo "Done"
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -126,6 +126,7 @@ mkdir -p $tmpmnt/tool
|
|||||||
dd status=none bs=1024 count=16 if=./tool/i386/vtoycli of=$tmpmnt/tool/mount.exfat-fuse_i386
|
dd status=none bs=1024 count=16 if=./tool/i386/vtoycli of=$tmpmnt/tool/mount.exfat-fuse_i386
|
||||||
dd status=none bs=1024 count=16 if=./tool/x86_64/vtoycli of=$tmpmnt/tool/mount.exfat-fuse_x86_64
|
dd status=none bs=1024 count=16 if=./tool/x86_64/vtoycli of=$tmpmnt/tool/mount.exfat-fuse_x86_64
|
||||||
dd status=none bs=1024 count=16 if=./tool/aarch64/vtoycli of=$tmpmnt/tool/mount.exfat-fuse_aarch64
|
dd status=none bs=1024 count=16 if=./tool/aarch64/vtoycli of=$tmpmnt/tool/mount.exfat-fuse_aarch64
|
||||||
|
cp -a ./tool/create_ventoy_iso_part_dm.sh $tmpmnt/tool/
|
||||||
|
|
||||||
|
|
||||||
rm -f $tmpmnt/grub/i386-pc/*.img
|
rm -f $tmpmnt/grub/i386-pc/*.img
|
||||||
|
|||||||
@@ -63,6 +63,71 @@
|
|||||||
"STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native devices.",
|
"STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native devices.",
|
||||||
|
|
||||||
"STRXXX":""
|
"STRXXX":""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Urdu (اردو)",
|
||||||
|
"FontFamily": "Noto Nastaliq Urdu",
|
||||||
|
"FontSize": 16,
|
||||||
|
"Author": "Muhammad Ramzan",
|
||||||
|
|
||||||
|
"STR_ERROR": "غلطی",
|
||||||
|
"STR_WARNING": "انتباہ",
|
||||||
|
"STR_INFO": "معلومات",
|
||||||
|
"STR_INCORRECT_DIR": "براہ کرم درست ڈائریکٹری میں چلائیں!",
|
||||||
|
"STR_INCORRECT_TREE_DIR": "یہاں نہ چلائیں، براہ کرم ریلیز پیکیج ڈاؤن لوڈ کریں اور وہاں چلائیں۔",
|
||||||
|
"STR_DEVICE": "ڈیوائس",
|
||||||
|
"STR_LOCAL_VER": "پیکج میں وینٹوی",
|
||||||
|
"STR_DISK_VER": "ڈیوائس میں وینٹوی",
|
||||||
|
"STR_STATUS": "اسٹیٹس - تیار",
|
||||||
|
"STR_INSTALL": "انسٹال کریں",
|
||||||
|
"STR_UPDATE": "اپڈیٹ کریں",
|
||||||
|
"STR_UPDATE_TIP": "اپگریڈ محفوظ ہے، ISO فائلز تبدیل نہیں ہوں گی۔#@کیا آپ جاری رکھنا چاہتے ہیں؟",
|
||||||
|
"STR_INSTALL_TIP": "ڈیوائس فارمیٹ ہو جائے گا اور تمام ڈیٹا ضائع ہو جائے گا۔#@کیا آپ جاری رکھنا چاہتے ہیں؟",
|
||||||
|
"STR_INSTALL_TIP2": "ڈیوائس فارمیٹ ہو جائے گا اور تمام ڈیٹا ضائع ہو جائے گا۔#@کیا آپ واقعی جاری رکھنا چاہتے ہیں؟ (دوبارہ تصدیق)",
|
||||||
|
"STR_INSTALL_SUCCESS": "مبارک ہو!#@وینٹوی کامیابی سے ڈیوائس پر انسٹال ہو گیا ہے۔",
|
||||||
|
"STR_INSTALL_FAILED": "انسٹالیشن کے دوران غلطی پیش آئی۔ دوبارہ USB لگائیں اور کوشش کریں۔ تفصیلات کے لیے log.txt چیک کریں۔ اگر مسئلہ برقرار رہے تو سرکاری ویب سائٹ کے FAQ دیکھیں۔",
|
||||||
|
"STR_UPDATE_SUCCESS": "مبارک ہو!#@وینٹوی کامیابی سے ڈیوائس پر اپڈیٹ ہو گیا ہے۔",
|
||||||
|
"STR_UPDATE_FAILED": "اپڈیٹ کے دوران غلطی پیش آئی۔ دوبارہ USB لگائیں اور کوشش کریں۔ تفصیلات کے لیے log.txt چیک کریں۔ اگر مسئلہ برقرار رہے تو سرکاری ویب سائٹ کے FAQ دیکھیں۔",
|
||||||
|
"STR_WAIT_PROCESS": "ایک عمل جاری ہے، براہ کرم انتظار کریں...",
|
||||||
|
"STR_MENU_OPTION": "اختیار",
|
||||||
|
"STR_MENU_SECURE_BOOT": "سکیور بوٹ سپورٹ",
|
||||||
|
"STR_MENU_PART_CFG": "پارٹیشن کنفیگریشن",
|
||||||
|
"STR_BTN_OK": "ٹھیک ہے",
|
||||||
|
"STR_BTN_CANCEL": "منسوخ کریں",
|
||||||
|
"STR_PRESERVE_SPACE": "ڈسک کے آخر میں کچھ جگہ محفوظ کریں",
|
||||||
|
"STR_SPACE_VAL_INVALID": "محفوظ جگہ کے لیے غلط ویلیو",
|
||||||
|
"STR_MENU_CLEAR": "وینٹوی ہٹائیں",
|
||||||
|
"STR_CLEAR_SUCCESS": "وینٹوی کامیابی سے ڈیوائس سے ہٹا دیا گیا ہے۔",
|
||||||
|
"STR_CLEAR_FAILED": "وینٹوی کو ہٹاتے وقت غلطی پیش آئی۔ دوبارہ USB لگائیں اور کوشش کریں۔ تفصیلات کے لیے log.txt چیک کریں۔",
|
||||||
|
"STR_MENU_PART_STYLE": "پارٹیشن اسٹائل",
|
||||||
|
"STR_DISK_2TB_MBR_ERROR": "2TB سے بڑی ڈیوائس کے لیے GPT منتخب کریں",
|
||||||
|
"STR_SHOW_ALL_DEV": "تمام ڈیوائسز دکھائیں",
|
||||||
|
"STR_PART_ALIGN_4KB": "پارٹیشنز کو 4KB کے ساتھ سیدھ میں رکھیں",
|
||||||
|
"STR_WEB_COMMUNICATION_ERR": "کمیونیکیشن ایرر:",
|
||||||
|
"STR_WEB_REMOTE_ABNORMAL": "کمیونیکیشن ایرر: ریموٹ ایرر",
|
||||||
|
"STR_WEB_REQUEST_TIMEOUT": "کمیونیکیشن ایرر: ریکویسٹ کا وقت ختم ہو گیا",
|
||||||
|
"STR_WEB_SERVICE_UNAVAILABLE": "کمیونیکیشن ایرر: سروس دستیاب نہیں",
|
||||||
|
"STR_WEB_TOKEN_MISMATCH": "ڈیمن اسٹیٹس اپڈیٹ ہو گیا، بعد میں دوبارہ کوشش کریں۔",
|
||||||
|
"STR_WEB_SERVICE_BUSY": "سروس مصروف ہے، بعد میں دوبارہ کوشش کریں۔",
|
||||||
|
"STR_MENU_VTSI_CREATE": "VTSI فائل بنائیں",
|
||||||
|
"STR_VTSI_CREATE_TIP": "یہ عمل ڈیوائس پر کچھ نہیں لکھے گا، صرف VTSI فائل بنائے گا۔#@کیا آپ جاری رکھنا چاہتے ہیں؟",
|
||||||
|
"STR_VTSI_CREATE_SUCCESS": "VTSI فائل کامیابی سے بن گئی!#@آپ Rufus(3.15+) کا استعمال کر کے اسے ڈیوائس پر لکھ سکتے ہیں تاکہ وینٹوی انسٹال مکمل ہو سکے۔",
|
||||||
|
"STR_VTSI_CREATE_FAILED": "VTSI فائل بنانے میں ناکام۔",
|
||||||
|
"STR_MENU_PART_RESIZE": "ڈیٹا محفوظ انسٹالیشن",
|
||||||
|
"STR_PART_RESIZE_TIP": "وینٹوی ممکن ہو تو ڈیٹا محفوظ انسٹالیشن کرے گا۔#@کیا آپ جاری رکھنا چاہتے ہیں؟",
|
||||||
|
"STR_PART_RESIZE_SUCCESS": "مبارک ہو!#@وینٹوی کی ڈیٹا محفوظ انسٹالیشن کامیابی سے مکمل ہو گئی۔",
|
||||||
|
"STR_PART_RESIZE_FAILED": "ڈیٹا محفوظ انسٹالیشن ناکام ہو گئی، تفصیلات کے لیے log.txt چیک کریں۔",
|
||||||
|
"STR_PART_RESIZE_UNSUPPORTED": "وینٹوی نے انسٹالیشن روک دی کیونکہ کچھ شرائط پوری نہیں ہو سکیں۔ تفصیلات کے لیے log.txt چیک کریں۔",
|
||||||
|
"STR_INSTALL_YES_TIP1": "انتباہ: ڈیٹا ضائع ہو جائے گا!",
|
||||||
|
"STR_INSTALL_YES_TIP2": "براہ کرم نیچے ٹیکسٹ باکس میں YES لکھیں تاکہ تصدیق ہو سکے کہ آپ اپگریڈ کی بجائے نیا انسٹال کرنا چاہتے ہیں۔",
|
||||||
|
"STR_PART_VENTOY_FS": "وینٹوی پارٹیشن کے لیے فائل سسٹم",
|
||||||
|
"STR_PART_FS": "فائل سسٹم",
|
||||||
|
"STR_PART_CLUSTER": "کلسٹر سائز",
|
||||||
|
"STR_PART_CLUSTER_DEFAULT": "سسٹم کا ڈیفالٹ ویلیو",
|
||||||
|
"STR_DONATE": "عطیہ کریں",
|
||||||
|
"STR_4KN_UNSUPPORTED": "فی الحال وینٹوی 4K نیٹو ڈیوائسز کو سپورٹ نہیں کرتا۔",
|
||||||
|
|
||||||
|
"STRXXX": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name":"Azerbaijani (Azərbaycanca)",
|
"name":"Azerbaijani (Azərbaycanca)",
|
||||||
@@ -649,6 +714,71 @@
|
|||||||
|
|
||||||
"STRXXX":""
|
"STRXXX":""
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name":"Slovenian (Slovenščina)",
|
||||||
|
"FontFamily":"Courier New",
|
||||||
|
"FontSize":16,
|
||||||
|
"Author":"Andrew Poženel, Urajmal",
|
||||||
|
|
||||||
|
"STR_ERROR":"Napaka",
|
||||||
|
"STR_WARNING":"Opozorilo",
|
||||||
|
"STR_INFO":"Informacija",
|
||||||
|
"STR_INCORRECT_DIR":"Prosim, zaženite program v pravilni mapi!",
|
||||||
|
"STR_INCORRECT_TREE_DIR":"Ne izvajajte programa tukaj, prosim prenesite izdani namestitveni paket in ga izvedite tam.",
|
||||||
|
"STR_DEVICE":"Naprava",
|
||||||
|
"STR_LOCAL_VER":"Ventoy različica",
|
||||||
|
"STR_DISK_VER":"Ventoy v napravi",
|
||||||
|
"STR_STATUS":"Stanje - PRIPRAVLJEN",
|
||||||
|
"STR_INSTALL":"Namesti",
|
||||||
|
"STR_UPDATE":"Posodobi",
|
||||||
|
"STR_UPDATE_TIP":"Nadgradnja je varna, datoteke ISO ostanejo nespremenjene.#@Nadaljuj?",
|
||||||
|
"STR_INSTALL_TIP":"Naprava bo formatirana in vsi podatki bodo izgubljeni.#@Nadaljuj?",
|
||||||
|
"STR_INSTALL_TIP2":"Naprava bo formatirana in vsi podatki bodo izgubljeni.#@Nadaljuj? (dvakrat preverite)",
|
||||||
|
"STR_INSTALL_SUCCESS":"Čestitamo!#@Ventoy je bil uspešno nameščen na napravo.",
|
||||||
|
"STR_INSTALL_FAILED":"Med namestitvijo je prišlo do napake. Ponovno vstavite USB-napravo in poskusite znova. Podrobnosti najdete v datoteki log.txt. Če napaka še vedno obstaja, si oglejte pogosta vprašanja na uradni spletni strani.",
|
||||||
|
"STR_UPDATE_SUCCESS":"Čestitamo!#@Ventoy je bil uspešno posodobljen na napravi.",
|
||||||
|
"STR_UPDATE_FAILED":"Med posodobitvijo je prišlo do napake. Ponovno vstavite USB-napravo in poskusite znova. Podrobnosti najdete v datoteki log.txt. Če se napaka ponavlja, si oglejte pogosta vprašanja na uradni spletni strani.",
|
||||||
|
"STR_WAIT_PROCESS":"Nit se izvaja, prosimo počakajte...",
|
||||||
|
"STR_MENU_OPTION":"Možnost",
|
||||||
|
"STR_MENU_SECURE_BOOT":"Podpora za varen zagon",
|
||||||
|
"STR_MENU_PART_CFG":"Konfiguracija particije",
|
||||||
|
"STR_BTN_OK":"V redu",
|
||||||
|
"STR_BTN_CANCEL":"Prekliči",
|
||||||
|
"STR_PRESERVE_SPACE":"Ohrani nekaj prostora na koncu diska",
|
||||||
|
"STR_SPACE_VAL_INVALID":"Neveljavna vrednost za rezervirani prostor",
|
||||||
|
"STR_MENU_CLEAR":"Počisti Ventoy",
|
||||||
|
"STR_CLEAR_SUCCESS":"Ventoy je bil uspešno odstranjen iz naprave.",
|
||||||
|
"STR_CLEAR_FAILED":"Pri odstranjevanju Ventoya z diska je prišlo do napake. Ponovno vstavite USB-napravo in poskusite znova. Podrobnosti najdete v datoteki log.txt.",
|
||||||
|
"STR_MENU_PART_STYLE":"Slog particije",
|
||||||
|
"STR_DISK_2TB_MBR_ERROR":"Za naprave z več kot 2 TB izberite GPT.",
|
||||||
|
"STR_SHOW_ALL_DEV":"Pokaži vse naprave",
|
||||||
|
"STR_PART_ALIGN_4KB":"Poravnaj particije s 4 KB",
|
||||||
|
"STR_WEB_COMMUNICATION_ERR":"Napaka pri komunikaciji:",
|
||||||
|
"STR_WEB_REMOTE_ABNORMAL":"Napaka pri komunikaciji: Oddaljena napaka",
|
||||||
|
"STR_WEB_REQUEST_TIMEOUT":"Napaka pri komunikaciji: Zahteva je potekla",
|
||||||
|
"STR_WEB_SERVICE_UNAVAILABLE":"Napaka pri komunikaciji: Storitev ni na voljo",
|
||||||
|
"STR_WEB_TOKEN_MISMATCH":"Stanje ozadnega procesa je bilo posodobljeno, poskusite pozneje.",
|
||||||
|
"STR_WEB_SERVICE_BUSY":"Storitev je zasedena, prosimo poskusite kasneje.",
|
||||||
|
"STR_MENU_VTSI_CREATE":"Ustvari datoteko VTSI",
|
||||||
|
"STR_VTSI_CREATE_TIP":"Tokrat ne bo zapisoval na napravo, ampak bo samo ustvaril datoteko VTSI#@Nadaljuj?",
|
||||||
|
"STR_VTSI_CREATE_SUCCESS":"Datoteka VTSI je bila uspešno ustvarjena!#@Za namestitev Ventoya jo lahko zapišete na napravo z uporabo programa Rufus (3.15+).",
|
||||||
|
"STR_VTSI_CREATE_FAILED":"Ustvarjanje datoteke VTSI ni uspelo.",
|
||||||
|
"STR_MENU_PART_RESIZE":"Neuničujoča namestitev",
|
||||||
|
"STR_PART_RESIZE_TIP":"Ventoy bo poskusil z neuničujočo namestitvijo, če je le mogoče. #@Nadaljuj?",
|
||||||
|
"STR_PART_RESIZE_SUCCESS":"Čestitamo!#@Ventoy neuničljiva namestitev je bila uspešno zaključena.",
|
||||||
|
"STR_PART_RESIZE_FAILED":"Neuničljiva namestitev ni uspela, podrobnosti preverite v datoteki log.txt.",
|
||||||
|
"STR_PART_RESIZE_UNSUPPORTED":"Neuničljiva namestitev Ventoy se je ustavila, ker nekateri pogoji niso izpolnjeni. Podrobnosti preverite v datoteki log.txt.",
|
||||||
|
"STR_INSTALL_YES_TIP1":"Opozorilo: Podatki bodo izgubljeni!",
|
||||||
|
"STR_INSTALL_YES_TIP2":"V spodnje besedilno polje vnesite DA, da potrdite, da res želite izvesti novo namestitev namesto nadgradnje.",
|
||||||
|
"STR_PART_VENTOY_FS":"Datotečni sistem za particijo Ventoy",
|
||||||
|
"STR_PART_FS":"Datotečni sistem",
|
||||||
|
"STR_PART_CLUSTER":"Velikost gruče",
|
||||||
|
"STR_PART_CLUSTER_DEFAULT":"Privzeta sistemska vrednost",
|
||||||
|
"STR_DONATE":"Donirajte",
|
||||||
|
"STR_4KN_UNSUPPORTED":"Trenutno Ventoy ne podpira naprav z ločljivostjo 4K.",
|
||||||
|
|
||||||
|
"STRXXX":""
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name":"Turkish (Türkçe)",
|
"name":"Turkish (Türkçe)",
|
||||||
"FontFamily":"Courier New",
|
"FontFamily":"Courier New",
|
||||||
@@ -2433,15 +2563,15 @@
|
|||||||
"STR_MENU_PART_CFG":"Konfigurasi Partisi",
|
"STR_MENU_PART_CFG":"Konfigurasi Partisi",
|
||||||
"STR_BTN_OK":"OK",
|
"STR_BTN_OK":"OK",
|
||||||
"STR_BTN_CANCEL":"Batal",
|
"STR_BTN_CANCEL":"Batal",
|
||||||
"STR_PRESERVE_SPACE":"Menyisakan sejumlah ruang penyimpanan pada disk di bawah ini",
|
"STR_PRESERVE_SPACE":"Pertahankan sisa ruang penyimpanan pada disk ini",
|
||||||
"STR_SPACE_VAL_INVALID":"Nilai sisa ruang tidak benar",
|
"STR_SPACE_VAL_INVALID":"Nilai sisa ruang tidak valid",
|
||||||
"STR_MENU_CLEAR":"Bersihkan Ventoy",
|
"STR_MENU_CLEAR":"Bersihkan Ventoy",
|
||||||
"STR_CLEAR_SUCCESS":"Ventoy telah berhasil dihapus pada perangkat ini.",
|
"STR_CLEAR_SUCCESS":"Ventoy telah berhasil dihapus pada perangkat ini.",
|
||||||
"STR_CLEAR_FAILED":"Terjadi kesalahan ketika penghapusan berlangsung. Anda perlu mencabut-pasang ulang USB dan coba lagi. Periksa berkas log.txt untuk detil.",
|
"STR_CLEAR_FAILED":"Terjadi kesalahan ketika penghapusan berlangsung. Anda perlu mencabut-pasang ulang USB dan coba lagi. Periksa berkas log.txt untuk detil.",
|
||||||
"STR_MENU_PART_STYLE":"Model Partisi",
|
"STR_MENU_PART_STYLE":"Model Partisi",
|
||||||
"STR_DISK_2TB_MBR_ERROR":"Silakan pilih GPT untuk disk yang lebih dari 2TB",
|
"STR_DISK_2TB_MBR_ERROR":"Silakan pilih GPT untuk disk yang lebih dari 2TB",
|
||||||
"STR_SHOW_ALL_DEV":"Tampilkan semua perangkat",
|
"STR_SHOW_ALL_DEV":"Tampilkan semua perangkat",
|
||||||
"STR_PART_ALIGN_4KB":"Meluruskan dengan partisi 4KB",
|
"STR_PART_ALIGN_4KB":"Mensejajarkan dengan partisi 4KB",
|
||||||
"STR_WEB_COMMUNICATION_ERR":"Kesalahan komunikasi:",
|
"STR_WEB_COMMUNICATION_ERR":"Kesalahan komunikasi:",
|
||||||
"STR_WEB_REMOTE_ABNORMAL":"Kesalahan komunikasi: pengendali bermasalah",
|
"STR_WEB_REMOTE_ABNORMAL":"Kesalahan komunikasi: pengendali bermasalah",
|
||||||
"STR_WEB_REQUEST_TIMEOUT":"Kesalahan komunikasi: Waktu permintaan habis",
|
"STR_WEB_REQUEST_TIMEOUT":"Kesalahan komunikasi: Waktu permintaan habis",
|
||||||
@@ -2459,9 +2589,9 @@
|
|||||||
"STR_PART_RESIZE_UNSUPPORTED":"Pemasangan tanpa merusakkan Ventoy terhenti karena beberapa kondisi yang tidak mendukung. Periksa berkas log.txt untuk detil.",
|
"STR_PART_RESIZE_UNSUPPORTED":"Pemasangan tanpa merusakkan Ventoy terhenti karena beberapa kondisi yang tidak mendukung. Periksa berkas log.txt untuk detil.",
|
||||||
"STR_INSTALL_YES_TIP1":"Peringatan: Data akan hilang!",
|
"STR_INSTALL_YES_TIP1":"Peringatan: Data akan hilang!",
|
||||||
"STR_INSTALL_YES_TIP2":"Silakan ketik YES pada kotak tulis di bawah untuk mengonfirmasikan bahwa anda memang yakin melakukan pemasangan baru ketimbang memperbaruinya",
|
"STR_INSTALL_YES_TIP2":"Silakan ketik YES pada kotak tulis di bawah untuk mengonfirmasikan bahwa anda memang yakin melakukan pemasangan baru ketimbang memperbaruinya",
|
||||||
"STR_PART_VENTOY_FS":"Berkas Sistem Untuk Partisi Ventoy",
|
"STR_PART_VENTOY_FS":"Sistem Berkas Untuk Partisi Ventoy",
|
||||||
"STR_PART_FS":"Berkas Sistem",
|
"STR_PART_FS":"Sistem Berkas",
|
||||||
"STR_PART_CLUSTER":"Ukuran Kelompok",
|
"STR_PART_CLUSTER":"Ukuran Kluster",
|
||||||
"STR_PART_CLUSTER_DEFAULT":"Nilai Standar Sistem",
|
"STR_PART_CLUSTER_DEFAULT":"Nilai Standar Sistem",
|
||||||
"STR_DONATE":"Donasi sukarela",
|
"STR_DONATE":"Donasi sukarela",
|
||||||
"STR_4KN_UNSUPPORTED":"Saat ini Ventoy tidak mendukung perangkat 4K yang asli.",
|
"STR_4KN_UNSUPPORTED":"Saat ini Ventoy tidak mendukung perangkat 4K yang asli.",
|
||||||
@@ -2728,72 +2858,7 @@
|
|||||||
"STR_4KN_UNSUPPORTED":"För närvarande stöder inte Ventoy 4K-enheter.",
|
"STR_4KN_UNSUPPORTED":"För närvarande stöder inte Ventoy 4K-enheter.",
|
||||||
|
|
||||||
"STRXXX":""
|
"STRXXX":""
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name":"Slovenian (Slovenski)",
|
|
||||||
"FontFamily":"Courier New",
|
|
||||||
"FontSize":16,
|
|
||||||
"Author":"Urajmal",
|
|
||||||
|
|
||||||
"STR_ERROR":"Napaka",
|
|
||||||
"STR_WARNING":"Opozorilo",
|
|
||||||
"STR_INFO":"Info",
|
|
||||||
"STR_INCORRECT_DIR":"Prosim izberite pravilno pot!",
|
|
||||||
"STR_INCORRECT_TREE_DIR":"Ne zaganjajte tukaj. Prosim prenesite posodobljeno verzijo in jo zaženite.",
|
|
||||||
"STR_DEVICE":"Naprava",
|
|
||||||
"STR_LOCAL_VER":"Ventoy verzija",
|
|
||||||
"STR_DISK_VER":"Ventoy na napravi",
|
|
||||||
"STR_STATUS":"Status - PRIPRAVLJEN",
|
|
||||||
"STR_INSTALL":"Namesti",
|
|
||||||
"STR_UPDATE":"Nadgradi",
|
|
||||||
"STR_UPDATE_TIP":"Varna nadgradnja. ISO datoteke ne bodo spremenjene.#@Nadaljujem?",
|
|
||||||
"STR_INSTALL_TIP":"Ta disk bo formatiran in vsi podatki bodo izbrisani.#@Nadaljujem?",
|
|
||||||
"STR_INSTALL_TIP2":"Ta disk bo formatiran in vsi podatki bodo izbrisani.#@Nadaljujem? (Druga potrditev)",
|
|
||||||
"STR_INSTALL_SUCCESS":"Čestitamo!#@Ventoy je bil uspešno nameščen na napravo.",
|
|
||||||
"STR_INSTALL_FAILED":"Med namestitvijo je prišlo do napake. Iztaknite in ponovno priklopite USB. Preverite log.txt za podrobnosti.",
|
|
||||||
"STR_UPDATE_SUCCESS":"Čestitamo!#@Ventoy na napravi je bil uspešno posodobljen.",
|
|
||||||
"STR_UPDATE_FAILED":"Prišlo je do napake med nadgradnjo. Iztaknite in ponovno priklopite USB. Preverite log.txt za podrobnosti.",
|
|
||||||
"STR_WAIT_PROCESS":"Proces teče, prosimo počakajte, ...",
|
|
||||||
"STR_MENU_OPTION":"Nastavitve",
|
|
||||||
"STR_MENU_SECURE_BOOT":"Podpora Secure Boot",
|
|
||||||
"STR_MENU_PART_CFG":"Konfiguracija particij",
|
|
||||||
"STR_BTN_OK":"Vredu",
|
|
||||||
"STR_BTN_CANCEL":"Prekliči",
|
|
||||||
"STR_PRESERVE_SPACE":"Ohrani nekaj prostora na koncu particije",
|
|
||||||
"STR_SPACE_VAL_INVALID":"Nepravilna vrednost za rezerviran prostor",
|
|
||||||
"STR_MENU_CLEAR":"Odstrani Ventoy",
|
|
||||||
"STR_CLEAR_SUCCESS":"Ventoy je bil uspešno odstranjen.",
|
|
||||||
"STR_CLEAR_FAILED":"Prišlo je do napake pri odstranjevanju Ventoy-a iz diska. Iztaknite in ponovno priklopite USB. Preverite log.txt za podrobnosti.",
|
|
||||||
"STR_MENU_PART_STYLE":"Vrsta particije",
|
|
||||||
"STR_DISK_2TB_MBR_ERROR":"Prosim izberite GPT za particije nad 2TB",
|
|
||||||
"STR_SHOW_ALL_DEV":"Pokaži vse naprave",
|
|
||||||
"STR_PART_ALIGN_4KB":"Poravnaj particije na 4KB",
|
|
||||||
"STR_WEB_COMMUNICATION_ERR":"Napaka v komunikaciji:",
|
|
||||||
"STR_WEB_REMOTE_ABNORMAL":"Napaka v komunikaciji: oddaljena težava",
|
|
||||||
"STR_WEB_REQUEST_TIMEOUT":"Napaka v komunikaciji: čas je potekel",
|
|
||||||
"STR_WEB_SERVICE_UNAVAILABLE":"Napaka v komunikaciji: storitev ni na voljo",
|
|
||||||
"STR_WEB_TOKEN_MISMATCH":"Zahteva storitve je potekla, prosim poskusite kasneje.",
|
|
||||||
"STR_WEB_SERVICE_BUSY":"Storitev je zasedena, prosim poskusite kasneje.",
|
|
||||||
"STR_MENU_VTSI_CREATE":"Ustvari VTSI datoteko",
|
|
||||||
"STR_VTSI_CREATE_TIP":"Spremembe na napravi ne bo, generirala se bo samo VTSI datoteka#@Nadaljujem?",
|
|
||||||
"STR_VTSI_CREATE_SUCCESS":"VTSI datoteka ustvarjena uspešno!#@Uporabi naj se Rufus(3.15+) za zapis na napravo in uspešno zaključeno inštalacijo Ventoy-a.",
|
|
||||||
"STR_VTSI_CREATE_FAILED":"Ustvarjanje VTSI datoteke ni uspelo.",
|
|
||||||
"STR_MENU_PART_RESIZE":"Inštalacija brez brisanja.",
|
|
||||||
"STR_PART_RESIZE_TIP":"Ventoy bo poskusil inštalacijo brez brisanja podatkov. #@Nadaljujem?",
|
|
||||||
"STR_PART_RESIZE_SUCCESS":"Čestitke!#@Ventoy je bil uspešno nameščen.",
|
|
||||||
"STR_PART_RESIZE_FAILED":"Inštalacija ni uspela, preveri log.txt za podrobnosti.",
|
|
||||||
"STR_PART_RESIZE_UNSUPPORTED":"Ventoy je ustavil inštalacijo ker nekateri pogoji niso zadostni. Preveri log.txt a podrobnosti.",
|
|
||||||
"STR_INSTALL_YES_TIP1":"Pozor: Podatki bodo izbrisani!",
|
|
||||||
"STR_INSTALL_YES_TIP2":"Prosim vtipkajte YES v spodnje okno da potrdite čisto inštalacijo in ne zgolj nadgradnje.",
|
|
||||||
"STR_PART_VENTOY_FS":"File System For Ventoy Partition",
|
|
||||||
"STR_PART_FS":"File System",
|
|
||||||
"STR_PART_CLUSTER":"Cluster Size",
|
|
||||||
"STR_PART_CLUSTER_DEFAULT":"System Default Value",
|
|
||||||
"STR_DONATE":"Donirajte",
|
|
||||||
"STR_4KN_UNSUPPORTED":"Currently Ventoy does not support 4K native devices.",
|
|
||||||
|
|
||||||
"STRXXX":""
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name":"Bulgarian (Български)",
|
"name":"Bulgarian (Български)",
|
||||||
"FontFamily":"Segoe",
|
"FontFamily":"Segoe",
|
||||||
@@ -3313,6 +3378,71 @@
|
|||||||
"STR_DONATE":"Ахвяраваць",
|
"STR_DONATE":"Ахвяраваць",
|
||||||
"STR_4KN_UNSUPPORTED":"Зараз Ventoy не падтрымлівае ўласныя прылады 4K.",
|
"STR_4KN_UNSUPPORTED":"Зараз Ventoy не падтрымлівае ўласныя прылады 4K.",
|
||||||
|
|
||||||
|
"STRXXX":""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name":"Malayalam (മലയാളം)",
|
||||||
|
"FontFamily":"Courier New",
|
||||||
|
"FontSize":16,
|
||||||
|
"Author":"SIDDHARTH K P",
|
||||||
|
|
||||||
|
"STR_ERROR":"പിശക്",
|
||||||
|
"STR_WARNING":"മുന്നറിയിപ്പ്",
|
||||||
|
"STR_INFO":"വിവരം",
|
||||||
|
"STR_INCORRECT_DIR":"ദയവായി ശരിയായ ഡയറക്ടറിയിൽ പ്രവർത്തിപ്പിക്കുക!",
|
||||||
|
"STR_INCORRECT_TREE_DIR":"എന്നെ ഇവിടെ പ്രവർത്തിപ്പിക്കരുത്, ദയവായി ഇൻസ്റ്റാളേഷൻ പാക്കേജ് ഡൗൺലോഡ് ചെയ്ത് അവിടെ പ്രവർത്തിപ്പിക്കുക.",
|
||||||
|
"STR_DEVICE":"ഉപകരണം",
|
||||||
|
"STR_LOCAL_VER":"പാക്കേജിലെ വെൻ്റോയ്",
|
||||||
|
"STR_DISK_VER":"ഉപകരണത്തിലെ വെൻ്റോയ്",
|
||||||
|
"STR_STATUS":"നില - തയ്യാറാണ്",
|
||||||
|
"STR_INSTALL":"ഇൻസ്റ്റാൾ ചെയ്യുക",
|
||||||
|
"STR_UPDATE":"അപ്ഡേറ്റ് ചെയ്യുക",
|
||||||
|
"STR_UPDATE_TIP":"അപ്ഡേറ്റ് പ്രവർത്തനം സുരക്ഷിതമാണ്, ISO ഫയലുകൾ മാറ്റമില്ലാതെ തുടരും.#@തുടരട്ടേ?",
|
||||||
|
"STR_INSTALL_TIP":"ഡിസ്ക് ഫോർമാറ്റ് ചെയ്യപ്പെടും, എല്ലാ ഡാറ്റയും നഷ്ടപ്പെടും.#@തുടരട്ടേ?",
|
||||||
|
"STR_INSTALL_TIP2":"ഡിസ്ക് ഫോർമാറ്റ് ചെയ്യപ്പെടും, എല്ലാ ഡാറ്റയും നഷ്ടപ്പെടും.#@തുടരട്ടേ? (ഒന്നുകൂടി ഉറപ്പിക്കുക)",
|
||||||
|
"STR_INSTALL_SUCCESS":"അഭിനന്ദനങ്ങൾ!#@വെൻ്റോയ് ഉപകരണത്തിൽ വിജയകരമായി ഇൻസ്റ്റാൾ ചെയ്തു.",
|
||||||
|
"STR_INSTALL_FAILED":"ഇൻസ്റ്റാളേഷൻ സമയത്ത് ഒരു പിശക് സംഭവിച്ചു. നിങ്ങൾക്ക് യുഎസ്ബി ഉപകരണം വീണ്ടും ഘടിപ്പിച്ച് വീണ്ടും ശ്രമിക്കാവുന്നതാണ്. വിവരങ്ങൾക്കായി log.txt പരിശോധിക്കുക.",
|
||||||
|
"STR_UPDATE_SUCCESS":"അഭിനന്ദനങ്ങൾ!#@വെൻ്റോയ് ഉപകരണത്തിൽ വിജയകരമായി അപ്ഡേറ്റ് ചെയ്തു.",
|
||||||
|
"STR_UPDATE_FAILED":"അപ്ഡേറ്റ് ചെയ്യുമ്പോൾ ഒരു പിശക് സംഭവിച്ചു. നിങ്ങൾക്ക് യുഎസ്ബി ഉപകരണം വീണ്ടും ഘടിപ്പിച്ച് വീണ്ടും ശ്രമിക്കാവുന്നതാണ്. വിവരങ്ങൾക്കായി log.txt പരിശോധിക്കുക.",
|
||||||
|
"STR_WAIT_PROCESS":"ഒരു പ്രവർത്തനം പുരോഗമിക്കുന്നു, ദയവായി കാത്തിരിക്കുക...",
|
||||||
|
"STR_MENU_OPTION":"ഓപ്ഷനുകൾ",
|
||||||
|
"STR_MENU_SECURE_BOOT":"സുരക്ഷിത ബൂട്ട് പിന്തുണ",
|
||||||
|
"STR_MENU_PART_CFG":"പാർട്ടീഷൻ കോൺഫിഗറേഷൻ",
|
||||||
|
"STR_BTN_OK":"ശരി",
|
||||||
|
"STR_BTN_CANCEL":"റദ്ദാക്കുക",
|
||||||
|
"STR_PRESERVE_SPACE":"ഡിസ്കിൻ്റെ അവസാനം കുറച്ച് സ്ഥലം ഒഴിച്ചിടുക",
|
||||||
|
"STR_SPACE_VAL_INVALID":"സംവരണം ചെയ്ത സ്ഥലത്തിന് അസാധുവായ മൂല്യം",
|
||||||
|
"STR_MENU_CLEAR":"വെൻ്റോയ് നീക്കംചെയ്യുക",
|
||||||
|
"STR_CLEAR_SUCCESS":"ഉപകരണത്തിൽ നിന്ന് വെൻ്റോയ് വിജയകരമായി നീക്കംചെയ്തു.",
|
||||||
|
"STR_CLEAR_FAILED":"ഡിസ്കിൽ നിന്ന് വെൻ്റോയ് നീക്കം ചെയ്യുമ്പോൾ ഒരു പിശക് സംഭവിച്ചു. നിങ്ങൾക്ക് യുഎസ്ബി ഉപകരണം വീണ്ടും ഘടിപ്പിച്ച് വീണ്ടും ശ്രമിക്കാവുന്നതാണ്. വിവരങ്ങൾക്കായി log.txt പരിശോധിക്കുക.",
|
||||||
|
"STR_MENU_PART_STYLE":"പാർട്ടീഷൻ രീതി",
|
||||||
|
"STR_DISK_2TB_MBR_ERROR":"2TB-യിൽ കൂടുതൽ വലുപ്പമുള്ള ഡിസ്കിനായി ദയവായി GPT തിരഞ്ഞെടുക്കുക",
|
||||||
|
"STR_SHOW_ALL_DEV":"എല്ലാ ഉപകരണങ്ങളും കാണിക്കുക",
|
||||||
|
"STR_PART_ALIGN_4KB":"പാർട്ടീഷനുകൾ 4KB ഉപയോഗിച്ച് വിന്യസിക്കുക",
|
||||||
|
"STR_WEB_COMMUNICATION_ERR":"ആശയവിനിമയ പിശക്:",
|
||||||
|
"STR_WEB_REMOTE_ABNORMAL":"ആശയവിനിമയ പിശക്: റിമോട്ട് തകരാറ്",
|
||||||
|
"STR_WEB_REQUEST_TIMEOUT":"ആശയവിനിമയ പിശക്: അഭ്യർത്ഥനയുടെ സമയം കഴിഞ്ഞു",
|
||||||
|
"STR_WEB_SERVICE_UNAVAILABLE":"ആശയവിനിമയ പിശക്: സേവനം ലഭ്യമല്ല",
|
||||||
|
"STR_WEB_TOKEN_MISMATCH":"ഡെമൺ നില അപ്ഡേറ്റ് ചെയ്തു, ദയവായി പിന്നീട് വീണ്ടും ശ്രമിക്കുക.",
|
||||||
|
"STR_WEB_SERVICE_BUSY":"സേവനം തിരക്കിലാണ്, ദയവായി പിന്നീട് വീണ്ടും ശ്രമിക്കുക.",
|
||||||
|
"STR_MENU_VTSI_CREATE":"VTSI ഫയൽ സൃഷ്ടിക്കുക",
|
||||||
|
"STR_VTSI_CREATE_TIP":"ഇത് ഇത്തവണ ഉപകരണത്തിലേക്ക് എഴുതുകയില്ല, ഒരു VTSI ഫയൽ മാത്രം സൃഷ്ടിക്കും#@തുടരട്ടേ?",
|
||||||
|
"STR_VTSI_CREATE_SUCCESS":"VTSI ഫയൽ വിജയകരമായി സൃഷ്ടിച്ചു!#@വെൻ്റോയ് ഇൻസ്റ്റാളേഷൻ പൂർത്തിയാക്കുന്നതിന് നിങ്ങൾക്ക് Rufus(3.15+) ഉപയോഗിച്ച് ഇത് ഉപകരണത്തിലേക്ക് എഴുതാം.",
|
||||||
|
"STR_VTSI_CREATE_FAILED":"VTSI ഫയൽ നിർമ്മാണം പരാജയപ്പെട്ടു.",
|
||||||
|
"STR_MENU_PART_RESIZE":"ഡാറ്റാ നഷ്ടപ്പെടാതെയുള്ള ഇൻസ്റ്റാളേഷൻ",
|
||||||
|
"STR_PART_RESIZE_TIP":"സാധ്യമെങ്കിൽ, ഡാറ്റാ നഷ്ടപ്പെടാതെയുള്ള ഇൻസ്റ്റാളേഷൻ വെൻ്റോയ് ശ്രമിക്കും. #@തുടരട്ടേ?",
|
||||||
|
"STR_PART_RESIZE_SUCCESS":"അഭിനന്ദനങ്ങൾ!#@വെൻ്റോയ് ഡാറ്റാ നഷ്ടപ്പെടാതെയുള്ള ഇൻസ്റ്റാളേഷൻ വിജയകരമായി പൂർത്തിയാക്കി.",
|
||||||
|
"STR_PART_RESIZE_FAILED":"ഡാറ്റാ നഷ്ടപ്പെടാതെയുള്ള ഇൻസ്റ്റാളേഷൻ പരാജയപ്പെട്ടു, വിശദാംശങ്ങൾക്കായി log.txt പരിശോധിക്കുക.",
|
||||||
|
"STR_PART_RESIZE_UNSUPPORTED":"ചില വ്യവസ്ഥകൾ പാലിക്കാൻ കഴിയാത്തതിനാൽ വെൻ്റോയ് ഡാറ്റാ നഷ്ടപ്പെടാതെയുള്ള ഇൻസ്റ്റാളേഷൻ നിർത്തി. വിശദാംശങ്ങൾക്കായി log.txt പരിശോധിക്കുക.",
|
||||||
|
"STR_INSTALL_YES_TIP1":"മുന്നറിയിപ്പ്: ഡാറ്റ നഷ്ടപ്പെടും!",
|
||||||
|
"STR_INSTALL_YES_TIP2":"അപ്ഗ്രേഡിന് പകരം ഒരു പുതിയ ഇൻസ്റ്റാളേഷൻ നടത്താൻ നിങ്ങൾ ആഗ്രഹിക്കുന്നുവെന്ന് സ്ഥിരീകരിക്കുന്നതിന് ദയവായി താഴെയുള്ള ടെക്സ്റ്റ് ബോക്സിൽ YES എന്ന് നൽകുക.",
|
||||||
|
"STR_PART_VENTOY_FS":"വെൻ്റോയ് പാർട്ടീഷനായുള്ള ഫയൽ സിസ്റ്റം",
|
||||||
|
"STR_PART_FS":"ഫയൽ സിസ്റ്റം",
|
||||||
|
"STR_PART_CLUSTER":"ക്ലസ്റ്റർ വലുപ്പം",
|
||||||
|
"STR_PART_CLUSTER_DEFAULT":"സിസ്റ്റം ഡിഫോൾട്ട് മൂല്യം",
|
||||||
|
"STR_DONATE":"സംഭാവന ചെയ്യുക",
|
||||||
|
"STR_4KN_UNSUPPORTED":"നിലവിൽ വെൻ്റോയ് 4K നേറ്റീവ് ഉപകരണങ്ങളെ പിന്തുണയ്ക്കുന്നില്ല.",
|
||||||
|
|
||||||
"STRXXX":""
|
"STRXXX":""
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
8
LZIP/buildlz4.txt
Normal file
8
LZIP/buildlz4.txt
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
|
||||||
|
/opt/diet64/bin/diet -Os gcc -D_FILE_OFFSET_BITS=64 smallz4cat.c -o lz4cat64
|
||||||
|
|
||||||
|
aarch64-buildroot-linux-uclibc-gcc -Os -static -D_FILE_OFFSET_BITS=64 smallz4cat.c -o lz4cataa64
|
||||||
|
|
||||||
|
mips64el-linux-musl-gcc -mips64r2 -mabi=64 -static -Os -D_FILE_OFFSET_BITS=64 smallz4cat.c -o lz4catm64e
|
||||||
|
|
||||||
|
|
||||||
@@ -1221,6 +1221,7 @@ int real_main(int argc, char **argv)
|
|||||||
int ret;
|
int ret;
|
||||||
int euid;
|
int euid;
|
||||||
char *exe = NULL;
|
char *exe = NULL;
|
||||||
|
const char *env = NULL;
|
||||||
char path[PATH_MAX];
|
char path[PATH_MAX];
|
||||||
char curpath[PATH_MAX];
|
char curpath[PATH_MAX];
|
||||||
|
|
||||||
@@ -1270,6 +1271,18 @@ int real_main(int argc, char **argv)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (strstr(path, "gtk"))
|
||||||
|
{
|
||||||
|
env = getenv("XDG_SESSION_TYPE");
|
||||||
|
vlog("=== XDG_SESSION_TYPE is <%s> ===\n", env ? env : "NULL");
|
||||||
|
|
||||||
|
if (env && strncasecmp(env, "wayland", 7) == 0)
|
||||||
|
{
|
||||||
|
vlog("Force GDK_BACKEND from %s to x11 for better compatibility\n", env);
|
||||||
|
setenv("GDK_BACKEND", "x11", 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (euid == 0)
|
if (euid == 0)
|
||||||
{
|
{
|
||||||
vlog("We have root privileges, just exec %s\n", path);
|
vlog("We have root privileges, just exec %s\n", path);
|
||||||
|
|||||||
@@ -777,10 +777,10 @@
|
|||||||
<script src="/static/js/jQuery-2.1.4.min.js"></script>
|
<script src="/static/js/jQuery-2.1.4.min.js"></script>
|
||||||
<!-- jquery validate -->
|
<!-- jquery validate -->
|
||||||
<script src="/static/js/jquery.validate.min.js"></script>
|
<script src="/static/js/jquery.validate.min.js"></script>
|
||||||
<script src="/static/js/jquery.validate.vtoymethods.js?v=192"></script>
|
<script src="/static/js/jquery.validate.vtoymethods.js?v=253"></script>
|
||||||
|
|
||||||
<script src="/static/js/jquery.vtoy.alert.js?v=192"></script>
|
<script src="/static/js/jquery.vtoy.alert.js?v=253"></script>
|
||||||
<script src="/static/js/vtoy.js?v=192"></script>
|
<script src="/static/js/vtoy.js?v=253"></script>
|
||||||
<script src="/static/js/md5.min.js"></script>
|
<script src="/static/js/md5.min.js"></script>
|
||||||
|
|
||||||
<!-- Bootstrap 3.3.5 -->
|
<!-- Bootstrap 3.3.5 -->
|
||||||
|
|||||||
@@ -101,6 +101,10 @@
|
|||||||
timeouten: timeouten,
|
timeouten: timeouten,
|
||||||
autoselen: autoselen
|
autoselen: autoselen
|
||||||
}, function(e) {
|
}, function(e) {
|
||||||
|
|
||||||
|
let data = m_data_autoins[current_tab_index][index];
|
||||||
|
data.timeout = timeoutval;
|
||||||
|
data.autosel = autoselval;
|
||||||
Message.success(g_vtoy_cur_language.STR_SAVE_SUCCESS);
|
Message.success(g_vtoy_cur_language.STR_SAVE_SUCCESS);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -224,6 +228,7 @@
|
|||||||
|
|
||||||
var tdtimeout, timeoutdisable, timeoutval;
|
var tdtimeout, timeoutdisable, timeoutval;
|
||||||
var tdautosel, autoseldisable, autoselval;
|
var tdautosel, autoseldisable, autoselval;
|
||||||
|
|
||||||
if (data[i].timeouten) {
|
if (data[i].timeouten) {
|
||||||
tdtimeout = '<th style="width:10%;"><input id="id_timeout_en_'+i+'" checked="checked" type="checkbox"/> timeout</th>';
|
tdtimeout = '<th style="width:10%;"><input id="id_timeout_en_'+i+'" checked="checked" type="checkbox"/> timeout</th>';
|
||||||
timeoutval = data[i].timeout;
|
timeoutval = data[i].timeout;
|
||||||
|
|||||||
@@ -101,6 +101,9 @@
|
|||||||
timeouten: timeouten,
|
timeouten: timeouten,
|
||||||
autoselen: autoselen
|
autoselen: autoselen
|
||||||
}, function(e) {
|
}, function(e) {
|
||||||
|
let data = m_data_persistence[current_tab_index][index];
|
||||||
|
data.timeout = timeoutval;
|
||||||
|
data.autosel = autoselval;
|
||||||
Message.success(g_vtoy_cur_language.STR_SAVE_SUCCESS);
|
Message.success(g_vtoy_cur_language.STR_SAVE_SUCCESS);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -316,6 +316,7 @@ var g_vtoy_cur_language_en =
|
|||||||
"STR_ENABLE": " Enable",
|
"STR_ENABLE": " Enable",
|
||||||
"STR_ADD": "Add",
|
"STR_ADD": "Add",
|
||||||
"STR_DEL": "Delete",
|
"STR_DEL": "Delete",
|
||||||
|
"STR_DEL_SHORT": "Del",
|
||||||
"STR_CLEAR": "Clear",
|
"STR_CLEAR": "Clear",
|
||||||
"STR_STATUS": "Status",
|
"STR_STATUS": "Status",
|
||||||
"STR_DEFAULT": "Default",
|
"STR_DEFAULT": "Default",
|
||||||
@@ -459,6 +460,7 @@ var g_vtoy_cur_language_cn =
|
|||||||
"STR_ENABLE": " 使能",
|
"STR_ENABLE": " 使能",
|
||||||
"STR_ADD": "新增",
|
"STR_ADD": "新增",
|
||||||
"STR_DEL": "删除",
|
"STR_DEL": "删除",
|
||||||
|
"STR_DEL_SHORT": "删除",
|
||||||
"STR_CLEAR": "清除",
|
"STR_CLEAR": "清除",
|
||||||
"STR_STATUS": "状态",
|
"STR_STATUS": "状态",
|
||||||
"STR_DEFAULT": "默认",
|
"STR_DEFAULT": "默认",
|
||||||
@@ -1007,7 +1009,7 @@ function VtoyCommonChangeLanguage(newlang) {
|
|||||||
$(this).text(g_vtoy_cur_language.STR_ADD);
|
$(this).text(g_vtoy_cur_language.STR_ADD);
|
||||||
});
|
});
|
||||||
$("span[id=id_span_btn_del]").each(function(){
|
$("span[id=id_span_btn_del]").each(function(){
|
||||||
$(this).text(g_vtoy_cur_language.STR_DEL);
|
$(this).text(g_vtoy_cur_language.STR_DEL_SHORT);
|
||||||
});
|
});
|
||||||
|
|
||||||
$("span[id=id_span_enable]").each(function(){
|
$("span[id=id_span_enable]").each(function(){
|
||||||
@@ -1436,7 +1438,7 @@ function ventoy_get_xslg_addbtn(mclass) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function ventoy_get_xslg_delbtn(mclass) {
|
function ventoy_get_xslg_delbtn(mclass) {
|
||||||
return '<button class="btn btn-xs btn-lg btn-danger btn-del '+mclass+'"><span class="fa fa-trash"> </span><span id="id_span_btn_del">'+g_vtoy_cur_language.STR_DEL+'</span></button>';
|
return '<button class="btn btn-xs btn-lg btn-danger btn-del '+mclass+'"><span class="fa fa-trash"> </span><span id="id_span_btn_del">'+g_vtoy_cur_language.STR_DEL_SHORT+'</span></button>';
|
||||||
}
|
}
|
||||||
|
|
||||||
function ventoy_get_addbtn(mclass) {
|
function ventoy_get_addbtn(mclass) {
|
||||||
@@ -1444,7 +1446,7 @@ function ventoy_get_addbtn(mclass) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function ventoy_get_delbtn(mclass) {
|
function ventoy_get_delbtn(mclass) {
|
||||||
return '<button class="btn btn-danger btn-del '+mclass+'"><span class="fa fa-trash"> </span><span id="id_span_btn_del">'+g_vtoy_cur_language.STR_DEL+'</span></button>';
|
return '<button class="btn btn-danger btn-del '+mclass+'"><span class="fa fa-trash"> </span><span id="id_span_btn_del">'+g_vtoy_cur_language.STR_DEL_SHORT+'</span></button>';
|
||||||
}
|
}
|
||||||
|
|
||||||
function ventoy_confirm(title, cb, data1, data2) {
|
function ventoy_confirm(title, cb, data1, data2) {
|
||||||
|
|||||||
18
README.md
18
README.md
@@ -12,28 +12,28 @@
|
|||||||
|
|
||||||
<h4 align="left">
|
<h4 align="left">
|
||||||
Ventoy is an open source tool to create bootable USB drive for ISO/WIM/IMG/VHD(x)/EFI files. <br/>
|
Ventoy is an open source tool to create bootable USB drive for ISO/WIM/IMG/VHD(x)/EFI files. <br/>
|
||||||
With ventoy, you don't need to format the disk over and over, you just need to copy the image files to the USB drive and boot it.
|
With Ventoy, you don't need to format the disk over and over, just copy the image files to the USB drive and boot them.
|
||||||
You can copy many image files at a time and ventoy will give you a boot menu to select them. <br/>
|
You can copy many image files at a time and Ventoy will give you a boot menu to select them. <br/>
|
||||||
You can also browse ISO/WIM/IMG/VHD(x)/EFI files in local disk and boot them.<br/>
|
You can also browse ISO/WIM/IMG/VHD(x)/EFI files in local disk and boot them.<br/>
|
||||||
x86 Legacy BIOS, IA32 UEFI, x86_64 UEFI, ARM64 UEFI and MIPS64EL UEFI are supported in the same way.<br/>
|
x86 Legacy BIOS, IA32 UEFI, x86_64 UEFI, ARM64 UEFI and MIPS64EL UEFI are supported in the same way.<br/>
|
||||||
Both MBR and GPT partition style are supported in the same way.<br/>
|
Both MBR and GPT partition style are supported in the same way.<br/>
|
||||||
Most type of OS supported(Windows/WinPE/Linux/Unix/ChromeOS/Vmware/Xen...) <br/>
|
Most type of OS supported(Windows/WinPE/Linux/Unix/ChromeOS/Vmware/Xen...) <br/>
|
||||||
1200+ ISO files are tested (<a href="https://www.ventoy.net/en/isolist.html">List</a>). 90%+ distros in <a href="https://distrowatch.com/">distrowatch.com</a> supported (<a href="https://www.ventoy.net/en/distrowatch.html">Details</a>). <br/>
|
1300+ ISO files are tested (<a href="https://www.ventoy.net/en/isolist.html">List</a>). 90%+ distros in <a href="https://distrowatch.com/">distrowatch.com</a> supported (<a href="https://www.ventoy.net/en/distrowatch.html">Details</a>). <br/>
|
||||||
<br/>Official Website: <a href=https://www.ventoy.net>https://www.ventoy.net</a>
|
<br/>Official Website: <a href=https://www.ventoy.net>https://www.ventoy.net</a>
|
||||||
</h4>
|
</h4>
|
||||||
|
|
||||||
# Tested OS
|
# Tested OS
|
||||||
**Windows**
|
**Windows**
|
||||||
Windows 7, Windows 8, Windows 8.1, Windows 10, Windows 11, Windows Server 2012, Windows Server 2012 R2, Windows Server 2016, Windows Server 2019, Windows Server 2022, WinPE
|
Windows 7, Windows 8, Windows 8.1, Windows 10, Windows 11, Windows Server 2012, Windows Server 2012 R2, Windows Server 2016, Windows Server 2019, Windows Server 2022, Windows Server 2025, WinPE
|
||||||
|
|
||||||
**Linux**
|
**Linux**
|
||||||
Debian, Ubuntu, CentOS(6/7/8/9), RHEL(6/7/8/9), Deepin, Fedora, Rocky Linux, AlmaLinux, EuroLinux(6/7/8/9), openEuler, OpenAnolis, SLES, openSUSE, MX Linux, Manjaro, Linux Mint, Endless OS, Elementary OS, Solus, Linx, Zorin, antiX, PClinuxOS, Arch, ArcoLinux, ArchLabs, BlackArch, Obarun, Artix Linux, Puppy Linux, Tails, Slax, Kali, Mageia, Slackware, Q4OS, Archman, Gentoo, Pentoo, NixOS, Kylin, openKylin, Ubuntu Kylin, KylinSec, Lubuntu, Xubuntu, Kubuntu, Ubuntu MATE, Ubuntu Budgie, Ubuntu Studio, Bluestar, OpenMandriva, ExTiX, Netrunner, ALT Linux, Nitrux, Peppermint, KDE neon, Linux Lite, Parrot OS, Qubes, Pop OS, ROSA, Void Linux, Star Linux, EndeavourOS, MakuluLinux, Voyager, Feren, ArchBang, LXLE, Knoppix, Calculate Linux, Clear Linux, Pure OS, Oracle Linux, Trident, Septor, Porteus, Devuan, GoboLinux, 4MLinux, Simplicity Linux, Zeroshell, Android-x86, netboot.xyz, Slitaz, SuperGrub2Disk, Proxmox VE, Kaspersky Rescue, SystemRescueCD, MemTest86, MemTest86+, MiniTool Partition Wizard, Parted Magic, veket, Sabayon, Scientific, alpine, ClearOS, CloneZilla, Berry Linux, Trisquel, Ataraxia Linux, Minimal Linux Live, BackBox Linux, Emmabuntüs, ESET SysRescue Live,Nova Linux, AV Linux, RoboLinux, NuTyX, IPFire, SELKS, ZStack, Enso Linux, Security Onion, Network Security Toolkit, Absolute Linux, TinyCore, Springdale Linux, Frost Linux, Shark Linux, LinuxFX, Snail Linux, Astra Linux, Namib Linux, Resilient Linux, Virage Linux, Blackweb Security OS, R-DriveImage, O-O.DiskImage, Macrium, ToOpPy LINUX, GNU Guix, YunoHost, foxclone, siduction, Adelie Linux, Elive, Pardus, CDlinux, AcademiX, Austrumi, Zenwalk, Anarchy, DuZeru, BigLinux, OpenMediaVault, Ubuntu DP, Exe GNU/Linux, 3CX Phone System, KANOTIX, Grml, Karoshi, PrimTux, ArchStrike, CAELinux, Cucumber, Fatdog, ForLEx, Hanthana, Kwort, MiniNo, Redcore, Runtu, Asianux, Clu Linux Live, Uruk, OB2D, BlueOnyx, Finnix, HamoniKR, Parabola, LinHES, LinuxConsole, BEE free, Untangle, Pearl, Thinstation, TurnKey, tuxtrans, Neptune, HefftorLinux, GeckoLinux, Mabox Linux, Zentyal, Maui, Reborn OS, SereneLinux , SkyWave Linux, Kaisen Linux, Regata OS, TROM-Jaro, DRBL Linux, Chalet OS, Chapeau, Desa OS, BlankOn, OpenMamba, Frugalware, Kibojoe Linux, Revenge OS, Tsurugi Linux, Drauger OS, Hash Linux, gNewSense, Ikki Boot, SteamOS, Hyperbola, VyOS, EasyNAS, SuperGamer, Live Raizo, Swift Linux, RebeccaBlackOS, Daphile, CRUX, Univention, Ufficio Zero, Rescuezilla, Phoenix OS, Garuda Linux, Mll, NethServer, OSGeoLive, Easy OS, Volumio, FreedomBox, paldo, UBOS, Recalbox, batocera, Lakka, LibreELEC, Pardus Topluluk, Pinguy, KolibriOS, Elastix, Arya, Omoikane, Omarine, Endian Firewall, Hamara, Rocks Cluster, MorpheusArch, Redo, Slackel, SME Server, APODIO, Smoothwall, Dragora, Linspire, Secure-K OS, Peach OSI, Photon, Plamo, SuperX, Bicom, Ploplinux, HP SPP, LliureX, Freespire, DietPi, BOSS, Webconverger, Lunar, TENS, Source Mage, RancherOS, T2, Vine, Pisi, blackPanther, mAid, Acronis, Active.Boot, AOMEI, Boot.Repair, CAINE, DaRT, EasyUEFI, R-Drive, PrimeOS, Avira Rescue System, bitdefender, Checkra1n Linux, Lenovo Diagnostics, Clover, Bliss-OS, Lenovo BIOS Update, Arcabit Rescue Disk, MiyoLinux, TeLOS, Kerio Control, RED OS, OpenWrt, MocaccinoOS, EasyStartup, Pyabr, Refracta, Eset SysRescue, Linpack Xtreme, Archcraft, NHVBOOT, pearOS, SeaTools, Easy Recovery Essentional, iKuai, StorageCraft SCRE, ZFSBootMenu, TROMjaro, BunsenLabs, Todo en Uno, ChallengerOS, Nobara, Holo, CachyOS, Peux OS, Vanilla OS, ShredOS, paladin, Palen1x, dban, ReviOS, HelenOS, XeroLinux, Tiny 11, chimera linux, CuteFish, DragonOs, Rhino Linux, vanilladpup, crystal, IGELOS, MiniOS, gnoppix, PikaOS, ......
|
Debian, Ubuntu, CentOS(6/7/8/9/10), RHEL(6/7/8/9/10), Deepin, Fedora, Rocky Linux, AlmaLinux, EuroLinux(6/7/8/9), openEuler, OpenAnolis, SLES, openSUSE, MX Linux, Manjaro, Linux Mint, Endless OS, Elementary OS, Solus, Linx, Zorin, antiX, PClinuxOS, Arch, ArcoLinux, ArchLabs, BlackArch, Obarun, Artix Linux, Puppy Linux, Tails, Slax, Kali, Mageia, Slackware, Q4OS, Archman, Gentoo, Pentoo, NixOS, Kylin, openKylin, Ubuntu Kylin, KylinSec, Lubuntu, Xubuntu, Kubuntu, Ubuntu MATE, Ubuntu Budgie, Ubuntu Studio, Bluestar, OpenMandriva, ExTiX, Netrunner, ALT Linux, Nitrux, Peppermint, KDE neon, Linux Lite, Parrot OS, Qubes, Pop OS, ROSA, Void Linux, Star Linux, EndeavourOS, MakuluLinux, Voyager, Feren, ArchBang, LXLE, Knoppix, Calculate Linux, Clear Linux, Pure OS, Oracle Linux, Trident, Septor, Porteus, Devuan, GoboLinux, 4MLinux, Simplicity Linux, Zeroshell, Android-x86, netboot.xyz, Slitaz, SuperGrub2Disk, Proxmox VE, Kaspersky Rescue, SystemRescueCD, MemTest86, MemTest86+, MiniTool Partition Wizard, Parted Magic, veket, Sabayon, Scientific, alpine, ClearOS, CloneZilla, Berry Linux, Trisquel, Ataraxia Linux, Minimal Linux Live, BackBox Linux, Emmabuntüs, ESET SysRescue Live,Nova Linux, AV Linux, RoboLinux, NuTyX, IPFire, SELKS, ZStack, Enso Linux, Security Onion, Network Security Toolkit, Absolute Linux, TinyCore, Springdale Linux, Frost Linux, Shark Linux, LinuxFX, Snail Linux, Astra Linux, Namib Linux, Resilient Linux, Virage Linux, Blackweb Security OS, R-DriveImage, O-O.DiskImage, Macrium, ToOpPy LINUX, GNU Guix, YunoHost, foxclone, siduction, Adelie Linux, Elive, Pardus, CDlinux, AcademiX, Austrumi, Zenwalk, Anarchy, DuZeru, BigLinux, OpenMediaVault, Ubuntu DP, Exe GNU/Linux, 3CX Phone System, KANOTIX, Grml, Karoshi, PrimTux, ArchStrike, CAELinux, Cucumber, Fatdog, ForLEx, Hanthana, Kwort, MiniNo, Redcore, Runtu, Asianux, Clu Linux Live, Uruk, OB2D, BlueOnyx, Finnix, HamoniKR, Parabola, LinHES, LinuxConsole, BEE free, Untangle, Pearl, Thinstation, TurnKey, tuxtrans, Neptune, HefftorLinux, GeckoLinux, Mabox Linux, Zentyal, Maui, Reborn OS, SereneLinux , SkyWave Linux, Kaisen Linux, Regata OS, TROM-Jaro, DRBL Linux, Chalet OS, Chapeau, Desa OS, BlankOn, OpenMamba, Frugalware, Kibojoe Linux, Revenge OS, Tsurugi Linux, Drauger OS, Hash Linux, gNewSense, Ikki Boot, SteamOS, Hyperbola, VyOS, EasyNAS, SuperGamer, Live Raizo, Swift Linux, RebeccaBlackOS, Daphile, CRUX, Univention, Ufficio Zero, Rescuezilla, Phoenix OS, Garuda Linux, Mll, NethServer, OSGeoLive, Easy OS, Volumio, FreedomBox, paldo, UBOS, Recalbox, batocera, Lakka, LibreELEC, Pardus Topluluk, Pinguy, KolibriOS, Elastix, Arya, Omoikane, Omarine, Endian Firewall, Hamara, Rocks Cluster, MorpheusArch, Redo, Slackel, SME Server, APODIO, Smoothwall, Dragora, Linspire, Secure-K OS, Peach OSI, Photon, Plamo, SuperX, Bicom, Ploplinux, HP SPP, LliureX, Freespire, DietPi, BOSS, Webconverger, Lunar, TENS, Source Mage, RancherOS, T2, Vine, Pisi, blackPanther, mAid, Acronis, Active.Boot, AOMEI, Boot.Repair, CAINE, DaRT, EasyUEFI, R-Drive, PrimeOS, Avira Rescue System, bitdefender, Checkra1n Linux, Lenovo Diagnostics, Clover, Bliss-OS, Lenovo BIOS Update, Arcabit Rescue Disk, MiyoLinux, TeLOS, Kerio Control, RED OS, OpenWrt, MocaccinoOS, EasyStartup, Pyabr, Refracta, Eset SysRescue, Linpack Xtreme, Archcraft, NHVBOOT, pearOS, SeaTools, Easy Recovery Essentional, iKuai, StorageCraft SCRE, ZFSBootMenu, TROMjaro, BunsenLabs, Todo en Uno, ChallengerOS, Nobara, Holo, CachyOS, Peux OS, Vanilla OS, ShredOS, paladin, Palen1x, dban, ReviOS, HelenOS, XeroLinux, Tiny 11, chimera linux, CuteFish, DragonOs, Rhino Linux, vanilladpup, crystal, IGELOS, MiniOS, gnoppix, PikaOS, UwUntu, Noble, PocketHandyBox, DiskGenius, Commodore, Talos, Shebang Linux, hrmpf, Bazzite, ManualLinux, nyarchlinux, ultramarine, TempleOS, bluefin, Damn Small Linux, Kicksecure, SerentiyOS, AerynOS, ......
|
||||||
|
|
||||||
**Unix**
|
**Unix**
|
||||||
DragonFly, FreeBSD, pfSense, GhostBSD, FreeNAS, TrueNAS, XigmaNAS, FuryBSD, OPNsense, HardenedBSD, MidnightBSD, ClonOS, EmergencyBootKit
|
DragonFly, FreeBSD, pfSense, OPNsense, GhostBSD, FreeNAS, TrueNAS, XigmaNAS, FuryBSD, HardenedBSD, MidnightBSD, ClonOS, EmergencyBootKit, helloSystem
|
||||||
|
|
||||||
**ChromeOS**
|
**ChromeOS**
|
||||||
FydeOS, CloudReady, ChromeOS Flex
|
FydeOS, CloudReady, ChromeOS Flex, ThoriumOS
|
||||||
|
|
||||||
**Other**
|
**Other**
|
||||||
VMware ESXi, Citrix XenServer, Xen XCP-ng
|
VMware ESXi, Citrix XenServer, Xen XCP-ng
|
||||||
@@ -63,12 +63,12 @@ A GUI Ventoy plugin configurator. [VentoyPlugson](https://www.ventoy.net/en/plug
|
|||||||
* Windows auto installation supported (1.0.09+)
|
* Windows auto installation supported (1.0.09+)
|
||||||
* Linux auto installation supported (1.0.09+)
|
* Linux auto installation supported (1.0.09+)
|
||||||
* Variables Expansion supported for Windows/Linux auto installation script
|
* Variables Expansion supported for Windows/Linux auto installation script
|
||||||
* FAT32/exFAT/NTFS/UDF/XFS/Ext2(3)(4) supported for main partition
|
* FAT32/exFAT/NTFS/UDF/XFS/Btrfs/Ext2(3)(4) supported for main partition
|
||||||
* ISO files larger than 4GB supported
|
* ISO files larger than 4GB supported
|
||||||
* Menu alias, Menu tip message supported
|
* Menu alias, Menu tip message supported
|
||||||
* Password protect supported
|
* Password protect supported
|
||||||
* Native boot menu style for Legacy & UEFI
|
* Native boot menu style for Legacy & UEFI
|
||||||
* Most types of OS supported, 1200+ iso files tested
|
* Most types of OS supported, 1300+ iso files tested
|
||||||
* Linux vDisk boot supported
|
* Linux vDisk boot supported
|
||||||
* Not only boot but also complete installation process
|
* Not only boot but also complete installation process
|
||||||
* Menu dynamically switchable between List/TreeView mode
|
* Menu dynamically switchable between List/TreeView mode
|
||||||
|
|||||||
10
Unix/BuildUnixKmod.txt
Normal file
10
Unix/BuildUnixKmod.txt
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
ventoy_geom kernel mod is used to boot FreeBSD and other Unix distros.
|
||||||
|
This kernel mod need to build inside a FreeBSD system.
|
||||||
|
|
||||||
|
use VM to install a FreeBSD (e.g. 9.X/10.X/11.X/....), need to install source code.
|
||||||
|
copy these files for example: Unix/ventoy_unix_src/FreeBSD/geom_ventoy_src/10.x/sys to /sys directory.
|
||||||
|
cd /sys/modules/geom/geom_ventoy/
|
||||||
|
make
|
||||||
|
make install
|
||||||
|
|
||||||
|
Other distros are similar.
|
||||||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,147 @@
|
|||||||
|
/*-
|
||||||
|
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD
|
||||||
|
*
|
||||||
|
* Copyright (c) 2020 longpanda <admin@ventoy.net>
|
||||||
|
* Copyright (c) 2004-2005 Pawel Jakub Dawidek <pjd@FreeBSD.org>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
|
||||||
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
|
||||||
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||||
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
|
* SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
* $FreeBSD$
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _G_VENTOY_H_
|
||||||
|
#define _G_VENTOY_H_
|
||||||
|
|
||||||
|
#include <sys/endian.h>
|
||||||
|
|
||||||
|
#define G_VENTOY_CLASS_NAME "VENTOY"
|
||||||
|
|
||||||
|
#define G_VENTOY_MAGIC "GEOM::VENTOY"
|
||||||
|
/*
|
||||||
|
* Version history:
|
||||||
|
* 1 - Initial version number.
|
||||||
|
* 2 - Added 'stop' command to gconcat(8).
|
||||||
|
* 3 - Added md_provider field to metadata and '-h' option to gconcat(8).
|
||||||
|
* 4 - Added md_provsize field to metadata.
|
||||||
|
*/
|
||||||
|
#define G_VENTOY_VERSION 4
|
||||||
|
|
||||||
|
#ifdef _KERNEL
|
||||||
|
#define G_VENTOY_TYPE_MANUAL 0
|
||||||
|
#define G_VENTOY_TYPE_AUTOMATIC 1
|
||||||
|
|
||||||
|
#define G_DEBUG(...) if (bootverbose) printf(__VA_ARGS__)
|
||||||
|
#define G_VENTOY_DEBUG(lvl, ...) if (g_ventoy_debug) printf(__VA_ARGS__)
|
||||||
|
#define G_VENTOY_LOGREQ(bp, ...) if (g_ventoy_debug) printf(__VA_ARGS__)
|
||||||
|
|
||||||
|
struct g_ventoy_disk {
|
||||||
|
TAILQ_ENTRY(g_ventoy_disk) d_next;
|
||||||
|
struct g_consumer *d_consumer;
|
||||||
|
struct g_ventoy_softc *d_softc;
|
||||||
|
off_t d_start;
|
||||||
|
off_t d_end;
|
||||||
|
off_t d_map_start;
|
||||||
|
off_t d_map_end;
|
||||||
|
int d_candelete;
|
||||||
|
int d_removed;
|
||||||
|
bool d_hardcoded;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct g_ventoy_softc {
|
||||||
|
u_int sc_type; /* provider type */
|
||||||
|
struct g_geom *sc_geom;
|
||||||
|
struct g_provider *sc_provider;
|
||||||
|
uint32_t sc_id; /* concat unique ID */
|
||||||
|
|
||||||
|
uint16_t sc_ndisks;
|
||||||
|
TAILQ_HEAD(g_ventoy_disks, g_ventoy_disk) sc_disks;
|
||||||
|
struct mtx sc_completion_lock; /* synchronizes cross-boundary IOs */
|
||||||
|
struct sx sc_disks_lock; /* synchronizes modification of sc_disks */
|
||||||
|
};
|
||||||
|
#define sc_name sc_geom->name
|
||||||
|
|
||||||
|
|
||||||
|
#pragma pack(1)
|
||||||
|
#define VENTOY_UNIX_SEG_MAGIC0 0x11223344
|
||||||
|
#define VENTOY_UNIX_SEG_MAGIC1 0x55667788
|
||||||
|
#define VENTOY_UNIX_SEG_MAGIC2 0x99aabbcc
|
||||||
|
#define VENTOY_UNIX_SEG_MAGIC3 0xddeeff00
|
||||||
|
#define VENTOY_UNIX_MAX_SEGNUM 40960
|
||||||
|
struct g_ventoy_seg {
|
||||||
|
uint64_t seg_start_bytes;
|
||||||
|
uint64_t seg_end_bytes;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct g_ventoy_map{
|
||||||
|
uint32_t magic1[4];
|
||||||
|
uint32_t magic2[4];
|
||||||
|
uint64_t segnum;
|
||||||
|
uint64_t disksize;
|
||||||
|
uint8_t diskuuid[16];
|
||||||
|
struct g_ventoy_seg seglist[VENTOY_UNIX_MAX_SEGNUM];
|
||||||
|
uint32_t magic3[4];
|
||||||
|
};
|
||||||
|
#pragma pack()
|
||||||
|
|
||||||
|
#define VENTOY_MAP_VALID(magic2) \
|
||||||
|
(magic2[0] == VENTOY_UNIX_SEG_MAGIC0 && magic2[1] == VENTOY_UNIX_SEG_MAGIC1 && magic2[2] == VENTOY_UNIX_SEG_MAGIC2 && magic2[3] == VENTOY_UNIX_SEG_MAGIC3)
|
||||||
|
|
||||||
|
#endif /* _KERNEL */
|
||||||
|
|
||||||
|
struct g_ventoy_metadata {
|
||||||
|
char md_magic[16]; /* Magic value. */
|
||||||
|
uint32_t md_version; /* Version number. */
|
||||||
|
char md_name[16]; /* Concat name. */
|
||||||
|
uint32_t md_id; /* Unique ID. */
|
||||||
|
uint16_t md_no; /* Disk number. */
|
||||||
|
uint16_t md_all; /* Number of all disks. */
|
||||||
|
char md_provider[16]; /* Hardcoded provider. */
|
||||||
|
uint64_t md_provsize; /* Provider's size. */
|
||||||
|
};
|
||||||
|
static __inline void
|
||||||
|
ventoy_metadata_encode(const struct g_ventoy_metadata *md, u_char *data)
|
||||||
|
{
|
||||||
|
|
||||||
|
bcopy(md->md_magic, data, sizeof(md->md_magic));
|
||||||
|
le32enc(data + 16, md->md_version);
|
||||||
|
bcopy(md->md_name, data + 20, sizeof(md->md_name));
|
||||||
|
le32enc(data + 36, md->md_id);
|
||||||
|
le16enc(data + 40, md->md_no);
|
||||||
|
le16enc(data + 42, md->md_all);
|
||||||
|
bcopy(md->md_provider, data + 44, sizeof(md->md_provider));
|
||||||
|
le64enc(data + 60, md->md_provsize);
|
||||||
|
}
|
||||||
|
static __inline void
|
||||||
|
ventoy_metadata_decode(const u_char *data, struct g_ventoy_metadata *md)
|
||||||
|
{
|
||||||
|
|
||||||
|
bcopy(data, md->md_magic, sizeof(md->md_magic));
|
||||||
|
md->md_version = le32dec(data + 16);
|
||||||
|
bcopy(data + 20, md->md_name, sizeof(md->md_name));
|
||||||
|
md->md_id = le32dec(data + 36);
|
||||||
|
md->md_no = le16dec(data + 40);
|
||||||
|
md->md_all = le16dec(data + 42);
|
||||||
|
bcopy(data + 44, md->md_provider, sizeof(md->md_provider));
|
||||||
|
md->md_provsize = le64dec(data + 60);
|
||||||
|
}
|
||||||
|
#endif /* _G_VENTOY_H_ */
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
# $FreeBSD$
|
||||||
|
|
||||||
|
.PATH: ${SRCTOP}/sys/geom/ventoy
|
||||||
|
|
||||||
|
KMOD= geom_ventoy
|
||||||
|
SRCS= g_ventoy.c
|
||||||
|
|
||||||
|
.include <bsd.kmod.mk>
|
||||||
@@ -2785,6 +2785,40 @@ static BOOL WriteBackupDataToDisk(HANDLE hDrive, UINT64 Offset, BYTE *Data, DWOR
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int DeleteVtoyEFIMountPoint(int PhyDrive)
|
||||||
|
{
|
||||||
|
int i = 0;
|
||||||
|
BOOL bRet;
|
||||||
|
CHAR DriveLetters[MAX_PATH] = { 0 };
|
||||||
|
CHAR DriveName[] = "?:\\";
|
||||||
|
|
||||||
|
Log("Try to delete VtoyEFI mount point for PhyDrive %d\n", PhyDrive);
|
||||||
|
|
||||||
|
GetLettersBelongPhyDrive(PhyDrive, DriveLetters, sizeof(DriveLetters));
|
||||||
|
|
||||||
|
if (DriveLetters[0] == 0)
|
||||||
|
{
|
||||||
|
Log("No drive letter was assigned...");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Unmount all mounted volumes that belong to this drive
|
||||||
|
// Do it in reverse so that we always end on the first volume letter
|
||||||
|
for (i = (int)strlen(DriveLetters); i > 0; i--)
|
||||||
|
{
|
||||||
|
DriveName[0] = DriveLetters[i - 1];
|
||||||
|
if (IsVentoyLogicalDrive(DriveName[0]))
|
||||||
|
{
|
||||||
|
Log("%s is ventoy logical drive", DriveName);
|
||||||
|
bRet = DeleteVolumeMountPointA(DriveName);
|
||||||
|
Log("Delete mountpoint %s ret:%u code:%u", DriveName, bRet, LASTERR);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int UpdateVentoy2PhyDrive(PHY_DRIVE_INFO *pPhyDrive, int TryId)
|
int UpdateVentoy2PhyDrive(PHY_DRIVE_INFO *pPhyDrive, int TryId)
|
||||||
{
|
{
|
||||||
@@ -2874,28 +2908,7 @@ int UpdateVentoy2PhyDrive(PHY_DRIVE_INFO *pPhyDrive, int TryId)
|
|||||||
SetFilePointer(hDrive, 512 * 2040, NULL, FILE_BEGIN);
|
SetFilePointer(hDrive, 512 * 2040, NULL, FILE_BEGIN);
|
||||||
ReadFile(hDrive, ReservedData, sizeof(ReservedData), &dwSize, NULL);
|
ReadFile(hDrive, ReservedData, sizeof(ReservedData), &dwSize, NULL);
|
||||||
|
|
||||||
GetLettersBelongPhyDrive(pPhyDrive->PhyDrive, DriveLetters, sizeof(DriveLetters));
|
DeleteVtoyEFIMountPoint(pPhyDrive->PhyDrive);
|
||||||
|
|
||||||
if (DriveLetters[0] == 0)
|
|
||||||
{
|
|
||||||
Log("No drive letter was assigned...");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Unmount all mounted volumes that belong to this drive
|
|
||||||
// Do it in reverse so that we always end on the first volume letter
|
|
||||||
for (i = (int)strlen(DriveLetters); i > 0; i--)
|
|
||||||
{
|
|
||||||
DriveName[0] = DriveLetters[i - 1];
|
|
||||||
if (IsVentoyLogicalDrive(DriveName[0]))
|
|
||||||
{
|
|
||||||
Log("%s is ventoy logical drive", DriveName);
|
|
||||||
bRet = DeleteVolumeMountPointA(DriveName);
|
|
||||||
Log("Delete mountpoint %s ret:%u code:%u", DriveName, bRet, LASTERR);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// It kind of blows, but we have to relinquish access to the physical drive
|
// It kind of blows, but we have to relinquish access to the physical drive
|
||||||
// for VDS to be able to delete the partitions that reside on it...
|
// for VDS to be able to delete the partitions that reside on it...
|
||||||
@@ -3270,6 +3283,9 @@ End:
|
|||||||
{
|
{
|
||||||
Log("Change EFI partition attr success");
|
Log("Change EFI partition attr success");
|
||||||
pPhyDrive->Part2GPTAttr = VENTOY_EFI_PART_ATTR;
|
pPhyDrive->Part2GPTAttr = VENTOY_EFI_PART_ATTR;
|
||||||
|
|
||||||
|
Sleep(1000);
|
||||||
|
DeleteVtoyEFIMountPoint(pPhyDrive->PhyDrive);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -7,12 +7,12 @@
|
|||||||
* modify it under the terms of the GNU General Public License as
|
* modify it under the terms of the GNU General Public License as
|
||||||
* published by the Free Software Foundation; either version 3 of the
|
* published by the Free Software Foundation; either version 3 of the
|
||||||
* License, or (at your option) any later version.
|
* License, or (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
* General Public License for more details.
|
* General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||||
*
|
*
|
||||||
@@ -70,7 +70,7 @@ static void vlog(const char *fmt, ...)
|
|||||||
n += vsnprintf(log, sizeof(log) - 1, fmt, arg);
|
n += vsnprintf(log, sizeof(log) - 1, fmt, arg);
|
||||||
va_end(arg);
|
va_end(arg);
|
||||||
|
|
||||||
fwrite(log, 1, n, fp);
|
fwrite(log, 1, n, fp);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -90,7 +90,7 @@ static int copy_file(const char *file1, const char *file2)
|
|||||||
vlog("Failed to read file <%s>\n", file1);
|
vlog("Failed to read file <%s>\n", file1);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
fp2 = fopen(file2, "wb+");
|
fp2 = fopen(file2, "wb+");
|
||||||
if (!fp2)
|
if (!fp2)
|
||||||
{
|
{
|
||||||
@@ -115,7 +115,7 @@ static int copy_file(const char *file1, const char *file2)
|
|||||||
vlog("Failed to read <%s> %d %d\n", file1, n, size);
|
vlog("Failed to read <%s> %d %d\n", file1, n, size);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
n = fwrite(buf, 1, size, fp2);
|
n = fwrite(buf, 1, size, fp2);
|
||||||
if (n != size)
|
if (n != size)
|
||||||
{
|
{
|
||||||
@@ -167,7 +167,7 @@ static int vtoy_is_possible_blkdev(const char *name)
|
|||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -184,7 +184,7 @@ static ulonglong vtoy_get_disk_size_in_byte(const char *disk)
|
|||||||
if (access(diskpath, F_OK) >= 0)
|
if (access(diskpath, F_OK) >= 0)
|
||||||
{
|
{
|
||||||
vlog("get disk size from sysfs for %s\n", disk);
|
vlog("get disk size from sysfs for %s\n", disk);
|
||||||
|
|
||||||
fd = open(diskpath, O_RDONLY | O_BINARY);
|
fd = open(diskpath, O_RDONLY | O_BINARY);
|
||||||
if (fd >= 0)
|
if (fd >= 0)
|
||||||
{
|
{
|
||||||
@@ -233,7 +233,7 @@ static int get_disk_num(void)
|
|||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
while ((p = readdir(dir)) != NULL)
|
while ((p = readdir(dir)) != NULL)
|
||||||
{
|
{
|
||||||
n++;
|
n++;
|
||||||
@@ -248,7 +248,7 @@ static int is_usb_disk(const char *diskname)
|
|||||||
int rc;
|
int rc;
|
||||||
char dstpath[1024] = { 0 };
|
char dstpath[1024] = { 0 };
|
||||||
char syspath[1024] = { 0 };
|
char syspath[1024] = { 0 };
|
||||||
|
|
||||||
snprintf(syspath, sizeof(syspath), "/sys/block/%s", diskname);
|
snprintf(syspath, sizeof(syspath), "/sys/block/%s", diskname);
|
||||||
rc = readlink(syspath, dstpath, sizeof(dstpath) - 1);
|
rc = readlink(syspath, dstpath, sizeof(dstpath) - 1);
|
||||||
if (rc > 0 && strstr(dstpath, "/usb"))
|
if (rc > 0 && strstr(dstpath, "/usb"))
|
||||||
@@ -296,13 +296,13 @@ static int get_all_disk(void)
|
|||||||
vlog("disk %s is filted by name\n", p->d_name);
|
vlog("disk %s is filted by name\n", p->d_name);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
cursize = vtoy_get_disk_size_in_byte(p->d_name);
|
cursize = vtoy_get_disk_size_in_byte(p->d_name);
|
||||||
|
|
||||||
node = g_disk_list + g_disk_num;
|
node = g_disk_list + g_disk_num;
|
||||||
g_disk_num++;
|
g_disk_num++;
|
||||||
|
|
||||||
|
|
||||||
snprintf(node->name, sizeof(node->name), p->d_name);
|
snprintf(node->name, sizeof(node->name), p->d_name);
|
||||||
node->size = cursize;
|
node->size = cursize;
|
||||||
node->isUSB = is_usb_disk(p->d_name);
|
node->isUSB = is_usb_disk(p->d_name);
|
||||||
@@ -338,7 +338,7 @@ static int get_all_disk(void)
|
|||||||
node->size / 1024 / 1024 / 1024, node->size, node->isUSB);
|
node->size / 1024 / 1024 / 1024, node->size, node->isUSB);
|
||||||
}
|
}
|
||||||
vlog("============ DISK DUMP END ===========\n");
|
vlog("============ DISK DUMP END ===========\n");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -410,7 +410,7 @@ static int expand_var(const char *var, char *value, int len)
|
|||||||
{
|
{
|
||||||
uiDst = strtoul(var + 22, NULL, 10);
|
uiDst = strtoul(var + 22, NULL, 10);
|
||||||
uiDst = uiDst * (1024ULL * 1024ULL * 1024ULL);
|
uiDst = uiDst * (1024ULL * 1024ULL * 1024ULL);
|
||||||
|
|
||||||
for (i = 0; i < g_disk_num; i++)
|
for (i = 0; i < g_disk_num; i++)
|
||||||
{
|
{
|
||||||
node = g_disk_list + i;
|
node = g_disk_list + i;
|
||||||
@@ -418,7 +418,7 @@ static int expand_var(const char *var, char *value, int len)
|
|||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (node->size > uiDst)
|
if (node->size > uiDst)
|
||||||
{
|
{
|
||||||
delta = node->size - uiDst;
|
delta = node->size - uiDst;
|
||||||
@@ -427,7 +427,52 @@ static int expand_var(const char *var, char *value, int len)
|
|||||||
{
|
{
|
||||||
delta = uiDst - node->size;
|
delta = uiDst - node->size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (delta < maxdelta)
|
||||||
|
{
|
||||||
|
index = i;
|
||||||
|
maxdelta = delta;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (index >= 0)
|
||||||
|
{
|
||||||
|
vlog("%s=<%s>\n", var, g_disk_list[index].name);
|
||||||
|
snprintf(value, len, "%s", g_disk_list[index].name);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
vlog("[Error] %s not found\n", var);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (strncmp(var, "VT_LINUX_DISK_NONVTOY_CLOSEST_", 30) == 0)
|
||||||
|
{
|
||||||
|
uiDst = strtoul(var + 30, NULL, 10);
|
||||||
|
uiDst = uiDst * (1024ULL * 1024ULL * 1024ULL);
|
||||||
|
|
||||||
|
for (i = 0; i < g_disk_num; i++)
|
||||||
|
{
|
||||||
|
node = g_disk_list + i;
|
||||||
|
if (node->size == 0)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (strcmp(node->name, g_vtoy_disk_name) == 0)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (node->size > uiDst)
|
||||||
|
{
|
||||||
|
delta = node->size - uiDst;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
delta = uiDst - node->size;
|
||||||
|
}
|
||||||
|
|
||||||
if (delta < maxdelta)
|
if (delta < maxdelta)
|
||||||
{
|
{
|
||||||
index = i;
|
index = i;
|
||||||
@@ -481,10 +526,10 @@ int vtoyexpand_main(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
g_vtoy_disk_name += 5;
|
g_vtoy_disk_name += 5;
|
||||||
}
|
}
|
||||||
vlog("<%s> <%s> <%s>\n", argv[1], argv[2], g_vtoy_disk_name);
|
vlog("<%s> <%s> <%s>\n", argv[1], argv[2], g_vtoy_disk_name);
|
||||||
|
|
||||||
get_all_disk();
|
get_all_disk();
|
||||||
|
|
||||||
fp = fopen(argv[1], "r");
|
fp = fopen(argv[1], "r");
|
||||||
if (!fp)
|
if (!fp)
|
||||||
{
|
{
|
||||||
@@ -502,7 +547,7 @@ int vtoyexpand_main(int argc, char **argv)
|
|||||||
|
|
||||||
memset(line, 0, sizeof(line));
|
memset(line, 0, sizeof(line));
|
||||||
memset(value, 0, sizeof(value));
|
memset(value, 0, sizeof(value));
|
||||||
|
|
||||||
while (fgets(line, sizeof(line), fp))
|
while (fgets(line, sizeof(line), fp))
|
||||||
{
|
{
|
||||||
start = strstr(line, "$$VT_");
|
start = strstr(line, "$$VT_");
|
||||||
@@ -519,7 +564,7 @@ int vtoyexpand_main(int argc, char **argv)
|
|||||||
*end = 0;
|
*end = 0;
|
||||||
expand_var(start + 2, value, sizeof(value));
|
expand_var(start + 2, value, sizeof(value));
|
||||||
fprintf(fout, "%s", value);
|
fprintf(fout, "%s", value);
|
||||||
|
|
||||||
fprintf(fout, "%s", end + 2);
|
fprintf(fout, "%s", end + 2);
|
||||||
|
|
||||||
memset(value, 0, sizeof(value));
|
memset(value, 0, sizeof(value));
|
||||||
@@ -531,7 +576,7 @@ int vtoyexpand_main(int argc, char **argv)
|
|||||||
|
|
||||||
line[0] = line[4095] = 0;
|
line[0] = line[4095] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
fclose(fout);
|
fclose(fout);
|
||||||
|
|
||||||
@@ -540,7 +585,7 @@ int vtoyexpand_main(int argc, char **argv)
|
|||||||
|
|
||||||
vlog("Copy file <%s> --> <%s>\n", TMP_FILE, argv[1]);
|
vlog("Copy file <%s> --> <%s>\n", TMP_FILE, argv[1]);
|
||||||
copy_file(TMP_FILE, argv[1]);
|
copy_file(TMP_FILE, argv[1]);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1642,6 +1642,37 @@ static int ExpandSingleVar(VarDiskInfo *pDiskInfo, int DiskNum, const char *var,
|
|||||||
Log("%s=<PhyDrive%d>", var, index);
|
Log("%s=<PhyDrive%d>", var, index);
|
||||||
sprintf_s(value, len, "%d", index);
|
sprintf_s(value, len, "%d", index);
|
||||||
}
|
}
|
||||||
|
else if (strncmp(var, "VT_WINDOWS_DISK_NONVTOY_CLOSEST_", 32) == 0)
|
||||||
|
{
|
||||||
|
uiDst = strtoul(var + 32, NULL, 10);
|
||||||
|
uiDst = uiDst * (1024ULL * 1024ULL * 1024ULL);
|
||||||
|
|
||||||
|
for (i = 0; i < DiskNum; i++)
|
||||||
|
{
|
||||||
|
if (pDiskInfo[i].Capacity == 0 || i == g_vtoy_disk_drive)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pDiskInfo[i].Capacity > uiDst)
|
||||||
|
{
|
||||||
|
uiDelta = pDiskInfo[i].Capacity - uiDst;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
uiDelta = uiDst - pDiskInfo[i].Capacity;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (uiDelta < uiMaxDelta)
|
||||||
|
{
|
||||||
|
uiMaxDelta = uiDelta;
|
||||||
|
index = i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Log("%s=<PhyDrive%d>", var, index);
|
||||||
|
sprintf_s(value, len, "%d", index);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Log("Invalid var name <%s>", var);
|
Log("Invalid var name <%s>", var);
|
||||||
@@ -2214,6 +2245,10 @@ static int Windows11Bypass(const char *isofile, const char MntLetter, UINT8 Chec
|
|||||||
goto End;
|
goto End;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//bugfix: change VTOYEFI partition attribute
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//Now we really need to bypass windows 11 check. create registry
|
//Now we really need to bypass windows 11 check. create registry
|
||||||
|
|
||||||
if (Check)
|
if (Check)
|
||||||
@@ -2390,6 +2425,45 @@ static int MountVTLRI(CHAR *ImgPath, DWORD PhyDrive)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static BOOL FindVentoyDiskBySig(UINT32 VtoySig, DWORD* pDiskNum)
|
||||||
|
{
|
||||||
|
HANDLE Handle;
|
||||||
|
DWORD dwSize = 0;
|
||||||
|
CHAR PhyPath[128];
|
||||||
|
UINT8 SectorBuf[512];
|
||||||
|
|
||||||
|
Log("Find Ventoy Disk by Sig %08x ...", VtoySig);
|
||||||
|
|
||||||
|
for (int DiskNum = 0; DiskNum < 32; DiskNum++)
|
||||||
|
{
|
||||||
|
sprintf_s(PhyPath, sizeof(PhyPath), "\\\\.\\PhysicalDrive%d", DiskNum);
|
||||||
|
Handle = CreateFileA(PhyPath, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, 0, OPEN_EXISTING, 0, 0);
|
||||||
|
if (Handle == INVALID_HANDLE_VALUE)
|
||||||
|
{
|
||||||
|
Log("Could not open the disk<%s>, error:%u", PhyPath, GetLastError());
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!ReadFile(Handle, SectorBuf, sizeof(SectorBuf), &dwSize, NULL))
|
||||||
|
{
|
||||||
|
Log("ReadFile failed, dwSize:%u error:%u", dwSize, GetLastError());
|
||||||
|
CloseHandle(Handle);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
CloseHandle(Handle);
|
||||||
|
|
||||||
|
if (*(UINT32*)(SectorBuf + 0x1B8) == VtoySig)
|
||||||
|
{
|
||||||
|
Log("%s sig match ...", PhyPath);
|
||||||
|
*pDiskNum = DiskNum;
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
static int VentoyHook(ventoy_os_param *param)
|
static int VentoyHook(ventoy_os_param *param)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
@@ -2476,11 +2550,11 @@ static int VentoyHook(ventoy_os_param *param)
|
|||||||
if (g_os_param_reserved[6] == 1)
|
if (g_os_param_reserved[6] == 1)
|
||||||
{
|
{
|
||||||
memcpy(&VtoySig, g_os_param_reserved + 7, 4);
|
memcpy(&VtoySig, g_os_param_reserved + 7, 4);
|
||||||
for (i = 0; i < 5; i++)
|
for (i = 0; i < 3; i++)
|
||||||
{
|
{
|
||||||
VtoyLetter = 'A';
|
VtoyLetter = 'A';
|
||||||
Drives = GetLogicalDrives();
|
Drives = GetLogicalDrives();
|
||||||
Log("Logic Drives: 0x%x VentoySig:%08X", Drives, VtoySig);
|
Log("[%d] Logic Drives: 0x%x VentoySig:%08X", i, Drives, VtoySig);
|
||||||
|
|
||||||
while (Drives)
|
while (Drives)
|
||||||
{
|
{
|
||||||
@@ -2489,12 +2563,13 @@ static int VentoyHook(ventoy_os_param *param)
|
|||||||
memset(UUID, 0, sizeof(UUID));
|
memset(UUID, 0, sizeof(UUID));
|
||||||
memset(&VtoyDiskExtent, 0, sizeof(VtoyDiskExtent));
|
memset(&VtoyDiskExtent, 0, sizeof(VtoyDiskExtent));
|
||||||
DiskSig = 0;
|
DiskSig = 0;
|
||||||
|
|
||||||
if (GetPhyDiskUUID(VtoyLetter, UUID, &DiskSig, &VtoyDiskExtent) == 0)
|
if (GetPhyDiskUUID(VtoyLetter, UUID, &DiskSig, &VtoyDiskExtent) == 0)
|
||||||
{
|
{
|
||||||
Log("DiskSig=%08X PartStart=%lld", DiskSig, VtoyDiskExtent.StartingOffset.QuadPart);
|
Log("[%d] DiskSig=%08X PartStart=%lld", i, DiskSig, VtoyDiskExtent.StartingOffset.QuadPart);
|
||||||
if (DiskSig == VtoySig && VtoyDiskExtent.StartingOffset.QuadPart == SIZE_1MB)
|
if (DiskSig == VtoySig && VtoyDiskExtent.StartingOffset.QuadPart == SIZE_1MB)
|
||||||
{
|
{
|
||||||
Log("Ventoy Disk Sig match");
|
Log("Ventoy Disk Sig and offset match");
|
||||||
vtoyfind = TRUE;
|
vtoyfind = TRUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -2517,6 +2592,13 @@ static int VentoyHook(ventoy_os_param *param)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (vtoyfind == FALSE) // vlnk mode Ventoy partition has no letter
|
||||||
|
{
|
||||||
|
Log("Warning: Ventoy partition has no drive letter, assume C: and find by sig");
|
||||||
|
VtoyLetter = 'C';
|
||||||
|
vtoyfind = FindVentoyDiskBySig(VtoySig, &VtoyDiskExtent.DiskNumber);
|
||||||
|
}
|
||||||
|
|
||||||
if (vtoyfind == FALSE)
|
if (vtoyfind == FALSE)
|
||||||
{
|
{
|
||||||
Log("Failed to find ventoy disk");
|
Log("Failed to find ventoy disk");
|
||||||
|
|||||||
Reference in New Issue
Block a user