Compare commits

..
81 Commits
Author SHA1 Message Date
longpanda 7cbdc5cf69 1.1.17 release
Ventoy CI / build (push) Has been cancelled
Mirror GitHub to Gitee / Sync-GitHub-to-Gitee (push) Has been cancelled
2026-07-24 20:56:41 +08:00
longpanda 5903c8bf52 Fix the issue that proxmox-ve can not boot after install in grub2 mode. 2026-07-24 20:53:12 +08:00
Tiago Augusto PimentaandGitHub 40895a09f6 Fix fdisk detection on BusyBox systems (#3614)
Ventoy CI / build (push) Has been cancelled
Mirror GitHub to Gitee / Sync-GitHub-to-Gitee (push) Has been cancelled
On BusyBox, fdisk -v exists but returns a non-zero exit code,
causing the script to incorrectly conclude fdisk is not available.
Use POSIX command -v instead to reliably check for fdisk.
2026-07-24 18:26:25 +08:00
HYB1022andGitHub ddc8e53156 [ko_KR] Improve Korean translation (natural phrasing & context fixes) (#3694)
* edit context, Language refinement (korean)

* Update languages.json
2026-07-24 17:31:58 +08:00
longpanda e352b76731 Fix the PATH broken in Ventoy2Disk.sh (#3615) 2026-07-24 17:21:49 +08:00
longpanda 5ebef5af77 Fix the boot issue for latest GhostBSD (#3664) 2026-07-24 16:56:59 +08:00
longpanda 9be9c7adb8 Add support for Athena OS (#3689) 2026-07-24 15:26:59 +08:00
longpanda 3751a47513 Add log for live injection process. 2026-07-24 14:14:12 +08:00
longpanda 6dd3ed3ce3 Fix the disk_write logic error (#3693)
This is indeed a logic error, but actually it does not take effect so it does not cause any install/update failure.
2026-07-24 12:25:35 +08:00
longpanda ac300d7464 Add support for some EulerOS release. 2026-07-24 11:52:45 +08:00
longpanda 0963c1d396 Fix the boot issue for some UOS release. 2026-07-24 11:49:59 +08:00
longpanda a3995a0267 Optimization for secure boot process.
Ventoy CI / build (push) Has been cancelled
Mirror GitHub to Gitee / Sync-GitHub-to-Gitee (push) Has been cancelled
2026-06-29 13:46:17 +08:00
longpanda ba87af540b Update hwinfo
Ventoy CI / build (push) Has been cancelled
Mirror GitHub to Gitee / Sync-GitHub-to-Gitee (push) Has been cancelled
2026-06-28 23:06:50 +08:00
longpanda 3d0d6c3147 Optimization for secure boot process.
Ventoy CI / build (push) Has been cancelled
Mirror GitHub to Gitee / Sync-GitHub-to-Gitee (push) Has been cancelled
2026-06-28 21:48:32 +08:00
longpanda 2915e197e9 Optimization for secure boot process.
Ventoy CI / build (push) Has been cancelled
Mirror GitHub to Gitee / Sync-GitHub-to-Gitee (push) Has been cancelled
2026-06-28 00:24:59 +08:00
longpanda 9bf8393cdf Optimization for secure boot process.
Ventoy CI / build (push) Has been cancelled
Mirror GitHub to Gitee / Sync-GitHub-to-Gitee (push) Has been cancelled
2026-06-26 18:08:39 +08:00
longpanda 05d10437b0 Remove grub.cfg max resolution script function.
Ventoy CI / build (push) Has been cancelled
Mirror GitHub to Gitee / Sync-GitHub-to-Gitee (push) Has been cancelled
2026-06-25 22:37:03 +08:00
longpanda 083e5f72ea Optimization for Secure Boot process. 2026-06-25 22:36:33 +08:00
longpanda 2f66a309e4 1.1.16 release.
Ventoy CI / build (push) Has been cancelled
Mirror GitHub to Gitee / Sync-GitHub-to-Gitee (push) Has been cancelled
2026-06-25 19:46:14 +08:00
longpanda aa75cdac7d VtoyShim build script update. 2026-06-25 19:39:15 +08:00
longpanda ccf4f7234a Fix the issue that VTOY_WIN_UEFI_RES_LOCK option reset when enter VentoyPlugson. 2026-06-25 19:38:47 +08:00
longpanda c1cad99584 Merge branch 'master' of https://github.com/Ventoy/Ventoy 2026-06-25 19:31:39 +08:00
VenusGirl❤andGitHub d9cab1cb33 Update Korean (#3649) 2026-06-25 19:31:22 +08:00
independent-argandGitHub 18f4c8afcc i18n: Update and optimize Spanish translation for grub and language JSON (#3648)
* i18n: Update Spanish translation

- Fixed grammatical inconsistencies (unified verbs to infinitive).
- Corrected missing accents and typos (árbol, gráfico, depuración).
- Standardized UI terminology to match original English text (GUI Mode).

* i18n: Update and fix typos in Spanish (Latinoamérica) translation

* docs(i18n): comprehensive Spanish localization updates

* update Spanish translations for Ventoy strings
2026-06-25 19:31:07 +08:00
Roope YrjöläandGitHub aeb46cd3c8 modified: LANGUAGES/languages.json (#3645)
Modified the finnis language translation.
2026-06-25 19:30:54 +08:00
longpanda 475de1dada Fix the boot issue with old UEFI version firmware when secure boot is disabled. 2026-06-25 19:23:48 +08:00
longpanda 31648a0d4b Fix the latest Kicksecure boot issue. (#3651) 2026-06-25 19:16:48 +08:00
longpanda d51e76daa9 1.1.15 release
Ventoy CI / build (push) Has been cancelled
Mirror GitHub to Gitee / Sync-GitHub-to-Gitee (push) Has been cancelled
2026-06-25 08:56:32 +08:00
longpanda f677d72e8d Fix the boot issue when Secure Boot is disabled in the UEFI firmware. (#3650) 2026-06-25 08:52:07 +08:00
longpanda 6418c2a09f 1.1.14
Ventoy CI / build (push) Has been cancelled
Mirror GitHub to Gitee / Sync-GitHub-to-Gitee (push) Has been cancelled
2026-06-24 20:55:20 +08:00
longpanda c2a3f181c0 Fix the secure boot issue. 2026-06-24 20:52:56 +08:00
longpanda 90e4f9db63 1.1.13 release
Ventoy CI / build (push) Has been cancelled
Mirror GitHub to Gitee / Sync-GitHub-to-Gitee (push) Has been cancelled
2026-06-24 18:41:35 +08:00
longpanda 255e84dbab Update BLOB_List.md 2026-06-24 18:41:24 +08:00
longpanda 213ce02985 add build.bat for VentoyPlugson 2026-06-24 18:41:03 +08:00
longpanda 8c2a3b44da Update BLOB_List.md 2026-06-24 17:39:31 +08:00
longpanda 536545cd39 VentoyPlugson Update
- Add missing option (VTOY_WIN_UEFI_RES_LOCK)
 - Add new option (VTOY_SECURE_BOOT_POLICY)
 - Remove deprecated option (VTOY_LINUX_REMOUNT)
2026-06-24 16:43:10 +08:00
longpanda 0f59e92a01 Fix grub i386 build issue.
Ventoy CI / build (push) Has been cancelled
Mirror GitHub to Gitee / Sync-GitHub-to-Gitee (push) Has been cancelled
2026-06-23 22:34:10 +08:00
longpanda 4b1e5ce89c Update SecureBoot.md 2026-06-23 22:11:24 +08:00
longpanda 1ed7bc9596 Ventoy Secure Boot Policy Update
- Update Ventoy grub code to match the new policy.
2026-06-23 21:19:46 +08:00
longpanda 71ac855b36 Ventoy Secure Boot Policy Update
- Update pack script (add efi file signature process)
2026-06-23 21:10:17 +08:00
longpanda 4302854b8d Ventoy Secure Boot Policy Update
- Update shim and MokManager for x86_64. I choose the shim file from Rocky Linux 9.2 because it was signed with both UEFI CA 2011 and UEFI CA 2023.
 - Update Ventoy Secure Boot CA.
2026-06-23 21:08:48 +08:00
longpanda 036f7234ad Ventoy Secure Boot Policy Update
- Add SecureBoot.md
2026-06-23 21:04:09 +08:00
longpanda 26a394ce84 Ventoy Secure Boot Policy Update
- Add Ventoy Preload module.
2026-06-23 21:02:56 +08:00
longpanda 25369d5884 Merge branch 'master' of https://github.com/Ventoy/Ventoy
Ventoy CI / build (push) Has been cancelled
Mirror GitHub to Gitee / Sync-GitHub-to-Gitee (push) Has been cancelled
2026-05-07 11:18:23 +08:00
longpanda 12387fff81 Fix the boot issue for some WinPE iso. 2026-05-07 11:17:57 +08:00
andrewczmandGitHub b54a7fe93b Polish translation - update (#3576)
Ventoy CI / build (push) Has been cancelled
Mirror GitHub to Gitee / Sync-GitHub-to-Gitee (push) Has been cancelled
* Update pl_PL.json

* Update pl_PL.json

* Update languages.json
2026-04-24 15:40:01 +08:00
longpanda dba7530b21 1.1.12
Ventoy CI / build (push) Has been cancelled
Mirror GitHub to Gitee / Sync-GitHub-to-Gitee (push) Has been cancelled
2026-04-23 18:04:05 +08:00
longpanda e9b4c86082 Fix Oracle Linux 6.9 install issue
Ventoy CI / build (push) Has been cancelled
Mirror GitHub to Gitee / Sync-GitHub-to-Gitee (push) Has been cancelled
2026-04-23 00:23:21 +08:00
longpanda dbcdf51950 Improve for UEFI boot Windows/WinPE resolution issue fix. 2026-04-23 00:00:05 +08:00
longpanda de3e6c6d1d rollback dmsetup operation.
Ventoy CI / build (push) Has been cancelled
Mirror GitHub to Gitee / Sync-GitHub-to-Gitee (push) Has been cancelled
2026-04-14 19:42:19 +08:00
longpanda 3c0df07b92 Improve for UEFI boot Windows/WinPE resolution issue fix.
Ventoy CI / build (push) Has been cancelled
Mirror GitHub to Gitee / Sync-GitHub-to-Gitee (push) Has been cancelled
2026-04-14 15:38:06 +08:00
longpanda c1c27cd30c Bugfix for ubuntu24.04.4 install failure. (#3567) 2026-04-14 11:03:02 +08:00
longpanda 167c87402c 1.1.11
Ventoy CI / build (push) Has been cancelled
Mirror GitHub to Gitee / Sync-GitHub-to-Gitee (push) Has been cancelled
. Fix the display issue when UEFI boot Windows/WinPE
. #3537
. #3532
. Add VT_WINDOWS_DISK_NONVTOY_CLOSEST_XXX  VT_LINUX_DISK_NONVTOY_CLOSEST_XXX
2026-04-05 23:11:45 +08:00
longpanda d35b8431fe Update distro check
Ventoy CI / build (push) Has been cancelled
Mirror GitHub to Gitee / Sync-GitHub-to-Gitee (push) Has been cancelled
2026-04-05 17:30:17 +08:00
Florian FuchsandGitHub a1771bd9b8 Improve booting of T2SDE live ISOs (#3526)
T2SDE changed the boot process vastly with 26.3 as it ships as a live
image now. So the injection hooks need to be customized.
2026-04-05 16:49:01 +08:00
panchenboandGitHub ed61a955bf add kylinsecos support (#3552)
Ventoy CI / build (push) Has been cancelled
Mirror GitHub to Gitee / Sync-GitHub-to-Gitee (push) Has been cancelled
2026-04-02 18:09:08 +08:00
longpanda e7cf29fd9d Add create_ventoy_iso_part_dm.sh (#3497)
Ventoy CI / build (push) Has been cancelled
Mirror GitHub to Gitee / Sync-GitHub-to-Gitee (push) Has been cancelled
2026-02-01 13:54:16 +08:00
longpandaandGitHub b5d87d394a Update imdisk download link in BuildVentoyFromSource.txt
Ventoy CI / build (push) Has been cancelled
Mirror GitHub to Gitee / Sync-GitHub-to-Gitee (push) Has been cancelled
2026-01-31 23:14:18 +08:00
longpanda 36da0e0f3d Add VT_WINDOWS_DISK_NONVTOY_CLOSEST_XXX
Ventoy CI / build (push) Has been cancelled
Mirror GitHub to Gitee / Sync-GitHub-to-Gitee (push) Has been cancelled
2026-01-23 10:47:49 +08:00
Florian FuchsandGitHub 903fd7aa01 Support booting T2SDE ISOs better (#3468)
Ventoy CI / build (push) Has been cancelled
Mirror GitHub to Gitee / Sync-GitHub-to-Gitee (push) Has been cancelled
T2 uses zstd compressed kernel modules, where dm-mod also depends on
dax module. So the default fallback to only decompress dm-mod isn't
sufficient. So we manually uncompress dax.ko and dm-mod.ko and insmod
this, as default busybox modprobe/insmod doesn't support zstd modules.
2026-01-08 16:26:35 +08:00
longpanda 81728a817c 1.1.10 release
Ventoy CI / build (push) Has been cancelled
Mirror GitHub to Gitee / Sync-GitHub-to-Gitee (push) Has been cancelled
2025-12-21 20:56:53 +08:00
longpanda f68d4a8076 Revert "added the Uzbek language я исправил потвердите (#3306)"
This reverts commit d3b911d249.
2025-12-21 20:33:25 +08:00
Ida BagusandGitHub f6c248e983 Update languages.json (#3198) 2025-12-21 20:26:14 +08:00
Ida BagusandGitHub 0906cd34fe Update id_ID.json (#3199) 2025-12-21 20:26:00 +08:00
+9
tojik_proof_93GitHubCopilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
d3b911d249 added the Uzbek language я исправил потвердите (#3306)
* added the Uzbek language

* Potential fix for code scanning alert no. 1: DOM text reinterpreted as HTML

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* Potential fix for code scanning alert no. 2: DOM text reinterpreted as HTML

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* Potential fix for code scanning alert no. 3: DOM text reinterpreted as HTML

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* Potential fix for code scanning alert no. 13: Time-of-check time-of-use filesystem race condition

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* Potential fix for code scanning alert no. 12: Time-of-check time-of-use filesystem race condition

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* Potential fix for code scanning alert no. 4: DOM text reinterpreted as HTML

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* Potential fix for code scanning alert no. 11: Time-of-check time-of-use filesystem race condition

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* Potential fix for code scanning alert no. 5: DOM text reinterpreted as HTML

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* Potential fix for code scanning alert no. 7: Unsafe jQuery plugin

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* Potential fix for code scanning alert no. 8: Unsafe jQuery plugin

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* Potential fix for code scanning alert no. 14: DOM text reinterpreted as HTML

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* Potential fix for code scanning alert no. 10: Time-of-check time-of-use filesystem race condition

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* Potential fix for code scanning alert no. 15: Time-of-check time-of-use filesystem race condition

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* Potential fix for code scanning alert no. 9: Call to `memset` may be deleted

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* Update bootstrap.js

* Update ci.yml

* Potential fix for code scanning alert no. 17: Workflow does not contain permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* Potential fix for code scanning alert no. 16: Workflow does not contain permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* Update ci.yml

* Update ci.yml

---------

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-12-21 20:23:34 +08:00
VenusGirl❤andGitHub 5c6e1c2446 Update ko_KR.txt (#3307) 2025-12-21 20:22:38 +08:00
SIDDHARTHandGitHub 3a97ab9165 Added Malayalam language support to languages.json (#3351) 2025-12-21 20:20:11 +08:00
Muhammad RamzanandGitHub 6fe6231790 Add Urdu language support for Ventoy UI (#3356)
* Add Urdu language support for Ventoy UI

* Add Urdu language support for Ventoy UI

* Add Urdu language support for Ventoy UI

* Update languages.json
2025-12-21 20:19:56 +08:00
9564f125a7 Added Persian Language (#3376)
Co-authored-by: Mojtaba Asgari <Mojtaba.asgari512@gmail.com>
2025-12-21 20:15:00 +08:00
David RefouaandGitHub e380575b91 fix grammar (#3413) 2025-12-21 20:13:04 +08:00
Moses CursorandGitHub 0fd49126bd Add Luganda help text (#3417)
Add Luganda Menu translation
2025-12-21 20:11:31 +08:00
Maison da SilvaandGitHub a466d787b8 Update ANSI for UTF-8 Lang pt-BR (#3432)
Update ANSI for UTF-8 Lang pt-BR
2025-12-21 20:11:02 +08:00
Andrew Poženel - SloDevTeamandGitHub ab5d00bafb Add and update Slovenian translations (#3445)
Added a new Slovenian help file for GRUB and replaced the existing Slovenian translation in languages.json with an updated and expanded version. The new translation provides improved accuracy and consistency for Slovenian users. I've included both authors, the previous one and myself.
2025-12-21 20:10:31 +08:00
longpanda 450caa6654 update README.md
Ventoy CI / build (push) Has been cancelled
Mirror GitHub to Gitee / Sync-GitHub-to-Gitee (push) Has been cancelled
2025-12-20 11:26:26 +08:00
longpanda ef93b55c91 Fix the LinuxGUI program crash issue in wayland environment. (#3406)
Ventoy CI / build (push) Has been cancelled
Mirror GitHub to Gitee / Sync-GitHub-to-Gitee (push) Has been cancelled
2025-12-20 09:07:08 +08:00
longpanda 4d7fcc26d4 Add support for AerynOS. (#3433)
Ventoy CI / build (push) Has been cancelled
Mirror GitHub to Gitee / Sync-GitHub-to-Gitee (push) Has been cancelled
2025-12-19 23:19:58 +08:00
longpanda 3597f15814 Fix the LinuxGUI program crash issue in wayland environment. (#3406)
Ventoy CI / build (push) Has been cancelled
Mirror GitHub to Gitee / Sync-GitHub-to-Gitee (push) Has been cancelled
2025-12-19 14:48:53 +08:00
longpanda f7e4a7a6ec Ventoy2Disk.sh supports musl libc envrionment. (#3332)
Ventoy CI / build (push) Has been cancelled
Mirror GitHub to Gitee / Sync-GitHub-to-Gitee (push) Has been cancelled
Only Ventoy2Disk.sh support, WebUI/LinuxGUI does not support.
2025-12-18 23:32:34 +08:00
longpanda 65b88aabc5 Fix the vhd.vtoy file boot issue in ext4 file system. (#3444)
Ventoy CI / build (push) Has been cancelled
Mirror GitHub to Gitee / Sync-GitHub-to-Gitee (push) Has been cancelled
2025-12-18 08:55:37 +08:00
longpanda c42abd33c2 Fix a Windows boot issue in F2 mode.
Ventoy CI / build (push) Has been cancelled
Mirror GitHub to Gitee / Sync-GitHub-to-Gitee (push) Has been cancelled
2025-12-17 22:51:58 +08:00
longpanda af34df278f Fix the boot issue with Kylin Server V11. (#3369)
Ventoy CI / build (push) Has been cancelled
Mirror GitHub to Gitee / Sync-GitHub-to-Gitee (push) Has been cancelled
2025-12-12 23:19:34 +08:00
118 changed files with 5483 additions and 2327 deletions
+96 -95
View File
@@ -46,131 +46,132 @@
<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/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>./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/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/BOOTMIPS.EFI</td> </tr>
<tr> <td>./INSTALL/EFI/BOOT/grubia32_real.efi</td> <tr> <td>./INSTALL/EFI/BOOT/grubia32_real.efi</td></tr>
<tr> <td>./INSTALL/EFI/BOOT/grubx64_real.efi</td> <tr> <td>./INSTALL/EFI/BOOT/grubx64_real.efi</td></tr>
<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> <td rowspan=3>upstream</td> <td rowspan=3>https://github.com/ValdikSS/Super-UEFIinSecureBoot-Disk </td> </tr>
<tr> <td>./INSTALL/EFI/BOOT/BOOTIA32.EFI</td> <tr> <td>./INSTALL/EFI/BOOT/grubia32.efi</td></tr>
<tr> <td>./INSTALL/EFI/BOOT/BOOTX64.EFI</td> <tr> <td>./INSTALL/EFI/BOOT/mmia32.efi</td></tr>
<tr> <td>./INSTALL/EFI/BOOT/grubia32.efi</td> <tr> <td>./INSTALL/EFI/BOOT/BOOTX64.EFI</td> <td rowspan=2>upstream</td> <td rowspan=2>From Rocky Linux 9.8 x86_64 ISO file<br/>Check the file hash to confirm </td> </tr>
<tr> <td>./INSTALL/EFI/BOOT/mmia32.efi</td> <tr> <td>./INSTALL/EFI/BOOT/mmx64.efi</td></tr>
<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/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/hexdump</td></tr>
<tr> <td>./INSTALL/tool/aarch64/xzcat</td> <tr> <td>./INSTALL/tool/aarch64/xzcat</td></tr>
<tr> <td>./INSTALL/tool/i386/ash</td> <tr> <td>./INSTALL/tool/i386/ash</td></tr>
<tr> <td>./INSTALL/tool/i386/hexdump</td> <tr> <td>./INSTALL/tool/i386/hexdump</td></tr>
<tr> <td>./INSTALL/tool/i386/xzcat</td> <tr> <td>./INSTALL/tool/i386/xzcat</td></tr>
<tr> <td>./INSTALL/tool/mips64el/ash</td> <tr> <td>./INSTALL/tool/mips64el/ash</td></tr>
<tr> <td>./INSTALL/tool/mips64el/hexdump</td> <tr> <td>./INSTALL/tool/mips64el/hexdump</td></tr>
<tr> <td>./INSTALL/tool/mips64el/xzcat</td> <tr> <td>./INSTALL/tool/mips64el/xzcat</td></tr>
<tr> <td>./INSTALL/tool/x86_64/ash</td> <tr> <td>./INSTALL/tool/x86_64/ash</td></tr>
<tr> <td>./INSTALL/tool/x86_64/hexdump</td> <tr> <td>./INSTALL/tool/x86_64/hexdump</td></tr>
<tr> <td>./INSTALL/tool/x86_64/xzcat</td> <tr> <td>./INSTALL/tool/x86_64/xzcat</td></tr>
<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/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.gtk3</td></tr>
<tr> <td>./INSTALL/tool/i386/Ventoy2Disk.gtk2</td> <tr> <td>./INSTALL/tool/i386/Ventoy2Disk.gtk2</td></tr>
<tr> <td>./INSTALL/tool/mips64el/Ventoy2Disk.gtk3</td> <tr> <td>./INSTALL/tool/mips64el/Ventoy2Disk.gtk3</td></tr>
<tr> <td>./INSTALL/tool/x86_64/Ventoy2Disk.gtk3</td> <tr> <td>./INSTALL/tool/x86_64/Ventoy2Disk.gtk3</td></tr>
<tr> <td>./INSTALL/tool/x86_64/Ventoy2Disk.gtk2</td> <tr> <td>./INSTALL/tool/x86_64/Ventoy2Disk.gtk2</td></tr>
<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/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/i386/Ventoy2Disk.qt5</td></tr>
<tr> <td>./INSTALL/tool/mips64el/Ventoy2Disk.qt5</td> <tr> <td>./INSTALL/tool/mips64el/Ventoy2Disk.qt5</td></tr>
<tr> <td>./INSTALL/tool/x86_64/Ventoy2Disk.qt5</td> <tr> <td>./INSTALL/tool/x86_64/Ventoy2Disk.qt5</td></tr>
<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/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/i386/Plugson</td></tr>
<tr> <td>./INSTALL/tool/mips64el/Plugson</td> <tr> <td>./INSTALL/tool/mips64el/Plugson</td></tr>
<tr> <td>./INSTALL/tool/x86_64/Plugson</td> <tr> <td>./INSTALL/tool/x86_64/Plugson</td></tr>
<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/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/i386/V2DServer</td></tr>
<tr> <td>./INSTALL/tool/mips64el/V2DServer</td> <tr> <td>./INSTALL/tool/mips64el/V2DServer</td></tr>
<tr> <td>./INSTALL/tool/x86_64/V2DServer</td> <tr> <td>./INSTALL/tool/x86_64/V2DServer</td></tr>
<tr> <td>./INSTALL/tool/aarch64/mkexfatfs</td> <td rowspan=8>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/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/aarch64/mount.exfat-fuse</td></tr>
<tr> <td>./INSTALL/tool/i386/mkexfatfs</td> <tr> <td>./INSTALL/tool/i386/mkexfatfs</td></tr>
<tr> <td>./INSTALL/tool/i386/mount.exfat-fuse</td> <tr> <td>./INSTALL/tool/i386/mount.exfat-fuse</td></tr>
<tr> <td>./INSTALL/tool/mips64el/mkexfatfs</td> <tr> <td>./INSTALL/tool/mips64el/mkexfatfs</td></tr>
<tr> <td>./INSTALL/tool/mips64el/mount.exfat-fuse</td> <tr> <td>./INSTALL/tool/mips64el/mount.exfat-fuse</td></tr>
<tr> <td>./INSTALL/tool/x86_64/mkexfatfs</td> <tr> <td>./INSTALL/tool/x86_64/mkexfatfs</td></tr>
<tr> <td>./INSTALL/tool/x86_64/mount.exfat-fuse</td> <tr> <td>./INSTALL/tool/x86_64/mkexfatfs_static</td></tr>
<tr> <td>./INSTALL/tool/x86_64/mount.exfat-fuse</td> </tr>
<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/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/i386/vlnk</td></tr>
<tr> <td>./INSTALL/tool/mips64el/vlnk</td> <tr> <td>./INSTALL/tool/mips64el/vlnk</td></tr>
<tr> <td>./INSTALL/tool/x86_64/vlnk</td> <tr> <td>./INSTALL/tool/x86_64/vlnk</td></tr>
<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/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/i386/vtoycli</td></tr>
<tr> <td>./INSTALL/tool/mips64el/vtoycli</td> <tr> <td>./INSTALL/tool/mips64el/vtoycli</td></tr>
<tr> <td>./INSTALL/tool/x86_64/vtoycli</td> <tr> <td>./INSTALL/tool/x86_64/vtoycli</td></tr>
<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.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.exe</td></tr>
<tr> <td>./INSTALL/ventoy/imdisk/32/imdisk.sys</td> <tr> <td>./INSTALL/ventoy/imdisk/32/imdisk.sys</td></tr>
<tr> <td>./INSTALL/ventoy/imdisk/64/imdisk.cpl</td> <tr> <td>./INSTALL/ventoy/imdisk/64/imdisk.cpl</td></tr>
<tr> <td>./INSTALL/ventoy/imdisk/64/imdisk.exe</td> <tr> <td>./INSTALL/ventoy/imdisk/64/imdisk.exe</td></tr>
<tr> <td>./INSTALL/ventoy/imdisk/64/imdisk.sys</td> <tr> <td>./INSTALL/ventoy/imdisk/64/imdisk.sys</td></tr>
<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/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/udf_aa64.efi</td></tr>
<tr> <td>./INSTALL/ventoy/iso9660_ia32.efi</td> <tr> <td>./INSTALL/ventoy/iso9660_ia32.efi</td></tr>
<tr> <td>./INSTALL/ventoy/udf_ia32.efi</td> <tr> <td>./INSTALL/ventoy/udf_ia32.efi</td></tr>
<tr> <td>./INSTALL/ventoy/iso9660_x64.efi</td> <tr> <td>./INSTALL/ventoy/iso9660_x64.efi</td></tr>
<tr> <td>./INSTALL/ventoy/udf_x64.efi</td> <tr> <td>./INSTALL/ventoy/udf_x64.efi</td></tr>
<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.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.i386</td></tr>
<tr> <td>./INSTALL/VentoyGUI.mips64el</td> <tr> <td>./INSTALL/VentoyGUI.mips64el</td></tr>
<tr> <td>./INSTALL/VentoyGUI.x86_64</td> <tr> <td>./INSTALL/VentoyGUI.x86_64</td></tr>
<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.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_ARM.exe</td></tr>
<tr> <td>./INSTALL/Ventoy2Disk_ARM64.exe</td> <tr> <td>./INSTALL/Ventoy2Disk_ARM64.exe</td></tr>
<tr> <td>./INSTALL/Ventoy2Disk_X64.exe</td> <tr> <td>./INSTALL/Ventoy2Disk_X64.exe</td></tr>
<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/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/vtoyjump64.exe</td></tr>
<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_aa64.efi</td> <td rowspan=7>build</td> <td rowspan=7>Build Instructions:<br/>./EDK2/buildedk.sh</td> </tr>
<tr> <td>./INSTALL/ventoy/ventoy_ia32.efi</td> <tr> <td>./INSTALL/ventoy/ventoy_ia32.efi</td></tr>
<tr> <td>./INSTALL/ventoy/ventoy_x64.efi</td> <tr> <td>./INSTALL/ventoy/ventoy_x64.efi</td></tr>
<tr> <td>./INSTALL/ventoy/vtoyutil_aa64.efi</td> <tr> <td>./INSTALL/ventoy/vtoyutil_aa64.efi</td></tr>
<tr> <td>./INSTALL/ventoy/vtoyutil_ia32.efi</td> <tr> <td>./INSTALL/ventoy/vtoyutil_ia32.efi</td></tr>
<tr> <td>./INSTALL/ventoy/vtoyutil_x64.efi</td> <tr> <td>./INSTALL/ventoy/vtoyutil_x64.efi</td></tr>
<tr> <td>./INSTALL/EFI/BOOT/fbx64.efi</td></tr>
<tr> <td>./INSTALL/ventoy/ipxe.krn</td> <td>build</td> <td>Build Instructions:<br/>./IPXE/buildipxe.sh</td> </tr> <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>./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>./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/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>./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>./LiveCD/GRUB/bootx64.efi</td></tr>
<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/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/lunzip64</td></tr>
<tr> <td>./LZIP/lunzipaa64</td> <tr> <td>./LZIP/lunzipaa64</td></tr>
<tr> <td>./LZIP/lz4cat64</td> <td rowspan=3>build</td> <td rowspan=3>Build Instructions:<br/>./LZIP/buildlz4.txt</td> </tr> <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/lz4cataa64</td></tr>
<tr> <td>./LZIP/lz4catm64e</td> <tr> <td>./LZIP/lz4catm64e</td></tr>
<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/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>./Plugson/vs/VentoyPlugson/x64/Release/VentoyPlugson_X64.exe</td></tr>
<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_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_64</td></tr>
<tr> <td>./SQUASHFS/unsquashfs_aa64</td> <tr> <td>./SQUASHFS/unsquashfs_aa64</td></tr>
<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/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>./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_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_64</td></tr>
<tr> <td>./VBLADE/vblade-master/vblade_aa64</td> <tr> <td>./VBLADE/vblade-master/vblade_aa64</td></tr>
<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>./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_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_64</td></tr>
<tr> <td>./VtoyTool/vtoytool/00/vtoytool_aa64</td> <tr> <td>./VtoyTool/vtoytool/00/vtoytool_aa64</td></tr>
<tr> <td>./VtoyTool/vtoytool/00/vtoytool_m64e</td> <tr> <td>./VtoyTool/vtoytool/00/vtoytool_m64e</td></tr>
<tr> <td>./VtoyTool/vtoytool/01/vtoytool_64</td> <tr> <td>./VtoyTool/vtoytool/01/vtoytool_64</td></tr>
<tr> <td>./VtoyTool/vtoytool/02/vtoytool_64</td> <tr> <td>./VtoyTool/vtoytool/02/vtoytool_64</td></tr>
<tr> <td>./ZSTD/zstdcat</td> <td rowspan=3>build</td> <td rowspan=3>Build Instructions:<br/>./ZSTD/build.txt</td> </tr> <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/zstdcat64</td></tr>
<tr> <td>./ZSTD/zstdcataa64</td> <tr> <td>./ZSTD/zstdcataa64</td></tr>
<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/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/busybox64</td></tr>
<tr> <td>./IMG/cpio_x86/ventoy/busybox/xzcat32_musl</td> <tr> <td>./IMG/cpio_x86/ventoy/busybox/xzcat32_musl</td></tr>
<tr> <td>./IMG/cpio_x86/ventoy/busybox/xzcat64_musl</td> <tr> <td>./IMG/cpio_x86/ventoy/busybox/xzcat64_musl</td></tr>
<tr> <td>./IMG/cpio_arm64/ventoy/busybox/busyboxaa64</td> <tr> <td>./IMG/cpio_arm64/ventoy/busybox/busyboxaa64</td></tr>
<tr> <td>./IMG/cpio_mips64/ventoy/busybox/busyboxm64e</td> <tr> <td>./IMG/cpio_mips64/ventoy/busybox/busyboxm64e</td> </tr>
<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/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>ISNTALL/ventoy/7z/32/7za.exe</td></tr>
<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.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>./INSTALL/ventoy/wimboot.x86_64</td></tr>
<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/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/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/10.x/64/geom_ventoy.ko</td></tr>
+2 -1
View File
@@ -232,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
@@ -274,3 +274,4 @@
5.14 ./LiveCD/ISO/EFI/boot/vmlinuz64 5.14 ./LiveCD/ISO/EFI/boot/vmlinuz64
download from http://www.tinycorelinux.net/11.x/x86_64/archive/11.0/distribution_files/vmlinuz64 download from http://www.tinycorelinux.net/11.x/x86_64/archive/11.0/distribution_files/vmlinuz64
vmlinuz64 SHA-256: 641077fc1f9914af244c248453005f56536ba9e7f54ba3e52402f26709ddb8a5 vmlinuz64 SHA-256: 641077fc1f9914af244c248453005f56536ba9e7f54ba3e52402f26709ddb8a5
+113
View File
@@ -0,0 +1,113 @@
#!/bin/sh
if [ -z "$1" ]; then
EDKARCH=X64
postfix=x64
elif [ "$1" = "ia32" ]; then
EDKARCH=IA32
postfix=ia32
shift
elif [ "$1" = "aa64" ]; then
EDKARCH=AARCH64
postfix=aa64
shift
fi
cd edk2-edk2-stable201911
rm -rf ./Conf/.cache
rm -f ./Conf/.AutoGenIdFile.txt
VTEFI_PATH=Build/MdeModule/RELEASE_GCC48/$EDKARCH/MdeModulePkg/Application/VtoyShim/VtoyShim/OUTPUT/VtoyShim.efi
DST_PATH=../../INSTALL/EFI/BOOT/fb${postfix}.efi
rm -f $VTEFI_PATH
rm -f $DST_PATH
unset WORKSPACE
source ./edksetup.sh
if [ "$EDKARCH" = "AARCH64" ]; then
PATH=$PATH:/opt/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu/bin \
GCC48_AARCH64_PREFIX=aarch64-linux-gnu- \
build -p MdeModulePkg/MdeModulePkg.dsc -a $EDKARCH -b RELEASE -t GCC48 -m MdeModulePkg/Application/VtoyShim/VtoyShim.inf
else
build -p MdeModulePkg/MdeModulePkg.dsc -a $EDKARCH -b RELEASE -t GCC48 -m MdeModulePkg/Application/VtoyShim/VtoyShim.inf
fi
if [ -e $VTEFI_PATH ]; then
objdump -h "$VTEFI_PATH"
echo ""
objcopy \
--add-section .sbat="MdeModulePkg/Application/VtoyShim/sbat.csv" \
--set-section-flags .sbat=alloc,load,readonly,data \
"$VTEFI_PATH" "$DST_PATH"
#find the right sbat section VMA
tmpfile=$(mktemp)
cnt1=$(objdump -h "$DST_PATH" | grep -P '^\s*[0-9][0-9]* \.' | wc -l)
cnt2=$(objdump -h "$DST_PATH" | grep -P 'ALLOC' | wc -l)
if [ $cnt1 -ne $cnt2 ]; then
echo "Section count mismatch $cnt1 $cnt2"
objdump -h "$DST_PATH"
exit 1
fi
objdump -h "$DST_PATH" | grep -P '^\s*[0-9][0-9]* \.' > $tmpfile
sbat_size=$(stat -c '%s' MdeModulePkg/Application/VtoyShim/sbat.csv)
sbat_size_hex=$(printf '0x%08x' $sbat_size)
lmax='0000000000000000'
lsize='0000000000000000'
while read line; do
echo $line
lbase=$(echo $line | awk '{print $4}')
if expr "$lmax" \< "$lbase" > /dev/null; then
lmax=$lbase
lsize=$(echo $line | awk '{print $3}')
fi
echo "max=$lmax size=$lsize"
done < $tmpfile
rm -f $tmpfile
lvma=$((0x${lsize}+0x${lmax}))
lvma_align=`printf '0x%08x' $(( (lvma + 4095) / 4096 * 4096 ))`
echo "sbat section lvma_align=$lvma_align"
objcopy --adjust-section-vma .sbat=$lvma_align "$DST_PATH"
img_base=$(objdump -p "$DST_PATH" | grep ImageBase | awk '{print $2}')
size_img=0x$(objdump -p "$DST_PATH" | grep SizeOfImage | awk '{print $2}')
sbat_end=`printf '0x%08x' $(($lvma_align+$sbat_size_hex))`
if [ "$img_base" != "0000000000000000" ]; then
echo "#### ImageBase is not 0 $img_base"
exit 1
fi
echo "size_img=$size_img sbat_size=$sbat_size_hex sbat_range $lvma_align - $sbat_end"
if expr "$size_img" \< "$sbat_end" > /dev/null; then
echo "SizeOfImage $size_img less than sbat section addr $sbat_end"
exit 1
else
echo "SizeOfImage $size_img >= $sbat_end is OK"
fi
objdump -h "$DST_PATH"
echo -e '\n\n====================== SUCCESS ========================\n\n'
cd ..
else
echo -e '\n\n====================== FAILED ========================\n\n'
cd ..
exit 1
fi
+4
View File
@@ -19,3 +19,7 @@ sh ./build.sh aa64 || exit 1
echo '======== build EDK2 for x86_64-efi ===============' echo '======== build EDK2 for x86_64-efi ==============='
sh ./build.sh || exit 1 sh ./build.sh || exit 1
echo '======== build EDK2 for x86_64-efi ==============='
sh ./build_shim.sh || exit 1
@@ -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])
{
ventoy_lock_res(g_os_param_reserved[11]);
}
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])
{
ventoy_unlock_res();
}
return EFI_SUCCESS; return EFI_SUCCESS;
} }
@@ -7,22 +7,24 @@
* 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__
#define COMPILE_ASSERT(expr) extern char __compile_assert[(expr) ? 1 : -1] #define COMPILE_ASSERT(expr) extern char __compile_assert[(expr) ? 1 : -1]
#define VTOY_SHIM_POLICY_GUID {0x90a29d14, 0x3968, 0x48fe, { 0x85, 0x81, 0x6b, 0x7f, 0x7d, 0xc4, 0x70, 0x55 }};
#define VENTOY_GUID { 0x77772020, 0x2e77, 0x6576, { 0x6e, 0x74, 0x6f, 0x79, 0x2e, 0x6e, 0x65, 0x74 }} #define VENTOY_GUID { 0x77772020, 0x2e77, 0x6576, { 0x6e, 0x74, 0x6f, 0x79, 0x2e, 0x6e, 0x65, 0x74 }}
typedef enum ventoy_chain_type typedef enum ventoy_chain_type
@@ -54,7 +56,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 +64,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 +88,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 +97,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 +126,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 +201,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 +274,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 +320,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 +333,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 +384,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 +430,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_res(UINT8 LockType);
EFI_STATUS ventoy_unlock_res(VOID);
#endif #endif
@@ -24,6 +24,10 @@
VERSION_STRING = 1.0 VERSION_STRING = 1.0
ENTRY_POINT = VentoyEfiMain ENTRY_POINT = VentoyEfiMain
[BuildOptions]
# Force standard GNU ld to pack and align ELF segments to 4KB page boundaries
GCC:*_*_*_DLINK_FLAGS = -Wl,-z,common-page-size=0x1000 -Wl,-z,max-page-size=0x1000
[Sources] [Sources]
Ventoy.h Ventoy.h
@@ -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,180 @@ 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 = 0;
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;
}
STATIC EFI_STATUS EFIAPI ventoy_set_mode2
(
IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,
IN UINT32 ModeNumber
)
{
UINTN Size;
EFI_STATUS rc;
EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *info = NULL;
/* Force >= 1024x768 */
rc = This->QueryMode(This, ModeNumber, &Size, &info);
if (rc == EFI_SUCCESS)
{
if (info->HorizontalResolution < 1024 || info->VerticalResolution < 768)
{
return EFI_SUCCESS;
}
}
return g_org_set_mode(This, ModeNumber);
}
EFI_STATUS ventoy_lock_res(UINT8 LockType)
{
UINT32 i = 0;
UINT32 x = 0;
UINT32 y = 0;
UINT32 SelMode = 0;
UINT32 CurMode = 0;
UINT32 Highest = 0;
UINT32 M1024_768 = MAX_UINT32;
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;
}
/* 1: Highest 2: 1024x768 3: >= 1024x768 */
if (LockType == 0 || LockType > 3)
{
return EFI_SUCCESS;
}
rc = gBS->LocateProtocol(&gEfiGraphicsOutputProtocolGuid, NULL, (void **)&gop);
if (rc != EFI_SUCCESS)
{
debug("Failed to locate GOP protocol");
return EFI_SUCCESS;
}
if (LockType == 3)
{
g_org_mode_num = MAX_UINT32;
g_org_set_mode = gop->SetMode;
gop->SetMode = ventoy_set_mode2;
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 (info->HorizontalResolution == 1024 && info->VerticalResolution == 768)
{
M1024_768 = i;
}
if (x < info->HorizontalResolution ||
(x == info->HorizontalResolution && y < info->VerticalResolution))
{
Highest = i;
x = info->HorizontalResolution;
y = info->VerticalResolution;
}
}
}
if (LockType == 1)
{
SelMode = Highest;
}
else
{
if (M1024_768 == MAX_UINT32)
{
SelMode = Highest;
}
else
{
SelMode = M1024_768;
x = 1024;
y = 768;
}
}
if (SelMode != CurMode)
{
gop->SetMode(gop, SelMode);
}
debug("Lock resolution to Mode:%d %d x %d", SelMode, 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_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;
}
if (g_org_mode_num != MAX_UINT32)
{
g_org_set_mode(gop, g_org_mode_num);
}
gop->SetMode = g_org_set_mode;
g_org_set_mode = NULL;
return EFI_SUCCESS;
}
@@ -0,0 +1,665 @@
/******************************************************************************
* VtoyShim.c
*
* Copyright (c) 2017 - 2018, Intel Corporation. All rights reserved.<BR>
* SPDX-License-Identifier: BSD-2-Clause-Patent
*
*/
#include <Uefi.h>
#include <Library/DebugLib.h>
#include <Library/PrintLib.h>
#include <Library/UefiLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/DevicePathLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
#include <Library/UefiApplicationEntryPoint.h>
#include <Library/PeCoffLib.h>
#include <Protocol/LoadedImage.h>
#include <Guid/FileInfo.h>
#include <Guid/FileSystemInfo.h>
#include <Protocol/BlockIo.h>
#include <Protocol/RamDisk.h>
#include <Protocol/SimpleFileSystem.h>
#include <Protocol/DevicePathToText.h>
#include <Protocol/DevicePathFromText.h>
#include <Protocol/LoadedImage.h>
#include <Protocol/Security.h>
#include <Protocol/Security2.h>
#include <IndustryStandard/PeImage.h>
#include <VtoyShim.h>
#define CUR_SBAT_VER 1
STATIC UINT8 gVtoyGrubSha256Hash[32] __attribute__((aligned(32))) = {
0x26, 0x26, 0x26, 0x26, 0x26, 0x26, 0x26, 0x26,
0x26, 0x26, 0x26, 0x26, 0x26, 0x26, 0x26, 0x26,
0x26, 0x26, 0x26, 0x26, 0x26, 0x26, 0x26, 0x26,
0x26, 0x26, 0x26, 0x26, 0x26, 0x26, 0x26, 0x26
};
STATIC BOOLEAN gGrubLaunched = FALSE;
STATIC EFI_GUID gShimLockGUID = SHIM_LOCK_GUID;
STATIC EFI_SECURITY_FILE_AUTHENTICATION_STATE gSysSecFileAuth = NULL;
STATIC EFI_SECURITY2_FILE_AUTHENTICATION gSysSec2FileAuth = NULL;
STATIC BOOLEAN gVtoyByPassSB = FALSE; /* must be FALSE by default for revoke */
STATIC VTOY_SHIM gVtoyShimProtocol;
STATIC EFI_HANDLE gVtoyShimProtHandle;
STATIC SHIM_LOCK gShimLock;
STATIC EFI_EXIT_BOOT_SERVICES gSysExitBootServices = NULL;
STATIC EFI_GET_VARIABLE gSysGetVariable = NULL;
STATIC VOID EFIAPI HookSystemService(VOID);
STATIC VOID EFIAPI UnHookSystemService(VOID);
STATIC VOID EFIAPI VtoyLog(CONST CHAR16 *Format, ...)
{
VA_LIST Marker;
CHAR16 Buffer[512];
UINTN BufLen = 0;
Buffer[0] = 0;
VA_START(Marker, Format);
BufLen = UnicodeVSPrint(Buffer, sizeof(Buffer), Format, Marker);
VA_END(Marker);
if (gST->ConOut && gST->ConOut->OutputString)
{
gST->ConOut->OutputString(gST->ConOut, Buffer);
}
}
STATIC VOID EFIAPI DumpDevicePath(const EFI_DEVICE_PATH_PROTOCOL *DevicePath)
{
CHAR16 *DPStr = NULL;
if (DevicePath)
{
DPStr = ConvertDevicePathToText(DevicePath, TRUE, TRUE);
}
if (DPStr)
{
vLog(L"%s", DPStr);
FreePool(DPStr);
}
else
{
vLog(L"NULL");
}
}
STATIC VOID EFIAPI ShowSBWarning(const EFI_DEVICE_PATH_PROTOCOL *DevicePath)
{
vLog(L"\r\n=======================================================");
vLog(L"=======================================================\r\n");
DumpDevicePath(DevicePath);
vLog(L"\r\n####### Ventoy Security Boot Violation ##########\r\n");
vLog(L"=======================================================");
vLog(L"=======================================================");
VtoySleep(5);
}
STATIC VOID * EFIAPI FindShimFuncAddr(UINT64 FuncOffset)
{
EFI_STATUS Status;
SHIM_IMAGE_LOADER *ImgLoader = NULL;
EFI_GUID ShimImgLoaderGuid = SHIM_IMAGE_LOADER_GUID;
Status = gBS->LocateProtocol(&ShimImgLoaderGuid, NULL, (VOID **)&ImgLoader);
if (EFI_ERROR(Status) || !ImgLoader || !ImgLoader->LoadImage)
{
vLog(L"Failed to locate shim image loader protocol %lx %p", Status, ImgLoader);
return NULL;
}
if (NM_SHIM_LOAD_IMAGE_OFFSET > FuncOffset)
{
return (UINT8 *)ImgLoader->LoadImage - (NM_SHIM_LOAD_IMAGE_OFFSET - FuncOffset);
}
else
{
return (UINT8 *)ImgLoader->LoadImage + (FuncOffset - NM_SHIM_LOAD_IMAGE_OFFSET);
}
}
EFI_STATUS EFIAPI LaunchRealGrub(EFI_HANDLE ImageHandle, CONST CHAR16 *FileName)
{
EFI_STATUS Status;
UINTN BufferSize = 0;
CHAR16 *DevDpStr = NULL;
CHAR16 *NewDpStr = NULL;
EFI_HANDLE ChildHandle = NULL;
EFI_LOADED_IMAGE_PROTOCOL *Li = NULL;
EFI_DEVICE_PATH_PROTOCOL *DeviceDP = NULL;
EFI_DEVICE_PATH_PROTOCOL *TargetDp = NULL;
Status = gBS->HandleProtocol(ImageHandle, &gEfiLoadedImageProtocolGuid, (VOID**)&Li);
if (EFI_ERROR(Status))
{
vLog(L"Failed to locate loaded image protocol %lx", Status);
return Status;
}
DeviceDP = DevicePathFromHandle(Li->DeviceHandle);
if (!DeviceDP || !IsDevicePathValid(DeviceDP, 0))
{
vLog(L"Failed to get device path of device handle %p", Li->DeviceHandle);
Status = EFI_NOT_FOUND;
goto END;
}
DevDpStr = ConvertDevicePathToText(DeviceDP, FALSE, TRUE);
if (!DevDpStr)
{
vLog(L"Failed to convert device path to text");
Status = EFI_OUT_OF_RESOURCES;
goto END;
}
BufferSize = (StrLen(DevDpStr) + 64) * sizeof(CHAR16);
NewDpStr = (CHAR16 *)AllocatePool(BufferSize);
if (!NewDpStr)
{
vLog(L"Failed to alloc new device path string buffer size:%lu", BufferSize);
Status = EFI_OUT_OF_RESOURCES;
goto END;
}
UnicodeSPrint(NewDpStr, BufferSize, L"%s/EFI/BOOT/%s", DevDpStr, FileName);
TargetDp = ConvertTextToDevicePath(NewDpStr);
if (!TargetDp)
{
vLog(L"Failed to convert new text <%s> to device path", NewDpStr);
Status = EFI_NOT_FOUND;
goto END;
}
Status = gBS->LoadImage(FALSE, ImageHandle, TargetDp, NULL, 0, &ChildHandle);
if (EFI_ERROR(Status))
{
vLog(L"Failed to LoadImage %lx", Status);
goto END;
}
Status = gBS->StartImage(ChildHandle, NULL, NULL);
if (EFI_ERROR(Status))
{
vLog(L"Failed to StartImage %lx", Status);
gBS->UnloadImage(ChildHandle);
goto END;
}
END:
CheckFreePool(DevDpStr);
CheckFreePool(NewDpStr);
CheckFreePool(TargetDp);
return Status;
}
STATIC EFI_STATUS EFIAPI CheckVtoyGrub
(
VOID *FileBuffer,
UINTN FileSize
)
{
UINT8 Sha256Hash[64];
if (!FileBuffer || FileSize < sizeof(EFI_IMAGE_DOS_HEADER))
{
vErr(L"Invalid FileBuffer:%p or size:%ld", FileBuffer, FileSize);
return EFI_SECURITY_VIOLATION;
}
ZeroMem(Sha256Hash, sizeof(Sha256Hash));
calc_sha256(FileBuffer, (UINT64)FileSize, Sha256Hash);
if (CompareMem(Sha256Hash, gVtoyGrubSha256Hash, 32) != 0)
{
vErr(L"Ventoy hash check failed.");
gRT->ResetSystem(EfiResetWarm, EFI_SECURITY_VIOLATION, 0, NULL);
return EFI_SECURITY_VIOLATION;
}
return EFI_SUCCESS;
}
STATIC EFI_STATUS EFIAPI SecurityPolicyAuth
(
const EFI_SECURITY_ARCH_PROTOCOL *This,
UINT32 AuthenticationStatus,
const EFI_DEVICE_PATH_PROTOCOL *DevicePathConst
)
{
/*
* Some old UEFI firmware (without Security2 protocol) will hang when run OpenVolume.
* So finally I decide not to support such UEFI firmware.
* It means that for UEFI firmware before 2.5 (about 2015) Ventoy only supports Bypass policy.
*
*/
(VOID)This;
(VOID)AuthenticationStatus;
(VOID)DevicePathConst;
return EFI_SUCCESS;
}
STATIC EFI_STATUS EFIAPI Security2PolicyAuth
(
const EFI_SECURITY2_ARCH_PROTOCOL *This,
const EFI_DEVICE_PATH_PROTOCOL *DevicePath,
VOID *FileBuffer,
UINTN FileSize,
BOOLEAN BootPolicy
)
{
EFI_STATUS Status;
/* Just return OK if the user choose to bypass SB */
if (gVtoyByPassSB)
{
return EFI_SUCCESS;
}
if (!gGrubLaunched)
{
return CheckVtoyGrub(FileBuffer, FileSize);
}
/*
* Step 1:
* Use original UEFI firmware auth API.
* If it's OK, it may be signed with Microsoft UEFI CA. (e.g. bootmgr/shim/...)
*/
if (gSysSec2FileAuth)
{
Status = gSysSec2FileAuth(This, DevicePath, FileBuffer, FileSize, BootPolicy);
if (!EFI_ERROR(Status))
{
return EFI_SUCCESS;
}
}
/*
* Step 2:
* Use shim verify API.
* If it's OK, it may be signed with a MOK key. (e.g. Ventoy EFI files)
*/
if (gShimLock.Verify)
{
if (FileBuffer && FileSize > 0 && FileSize < 0xFFFFFFFFUL)
{
Status = gShimLock.Verify(FileBuffer, (UINT32)FileSize);
if (!EFI_ERROR(Status))
{
return EFI_SUCCESS;
}
}
}
ShowSBWarning(DevicePath);
return EFI_SECURITY_VIOLATION;
}
STATIC EFI_STATUS EFIAPI HookSecurityPolicy(VOID)
{
EFI_STATUS Status;
EFI_STATUS Status2;
EFI_SECURITY_ARCH_PROTOCOL *Security = NULL;
EFI_SECURITY2_ARCH_PROTOCOL *Security2 = NULL;
Status = gBS->LocateProtocol(&gEfiSecurityArchProtocolGuid, NULL, (VOID **)&Security);
Status2 = gBS->LocateProtocol(&gEfiSecurity2ArchProtocolGuid, NULL, (VOID **)&Security2);
if (EFI_ERROR(Status) && EFI_ERROR(Status2))
{
vLog(L"Failed to locate security or security2 protocol. %lx %lx %p %p",
Status, Status2, Security, Security2);
return EFI_NOT_FOUND;
}
if (Security2)
{
gSysSec2FileAuth = Security2->FileAuthentication;
Security2->FileAuthentication = Security2PolicyAuth;
}
if (Security)
{
gSysSecFileAuth = Security->FileAuthenticationState;
Security->FileAuthenticationState = SecurityPolicyAuth;
}
return EFI_SUCCESS;
}
STATIC VOID EFIAPI UnHookSecurityPolicy(VOID)
{
EFI_STATUS Status;
EFI_STATUS Status2;
EFI_SECURITY_ARCH_PROTOCOL *Security = NULL;
EFI_SECURITY2_ARCH_PROTOCOL *Security2 = NULL;
if (!gSysSec2FileAuth && !gSysSecFileAuth)
{
return;
}
Status = gBS->LocateProtocol(&gEfiSecurityArchProtocolGuid, NULL, (VOID **)&Security);
Status2 = gBS->LocateProtocol(&gEfiSecurity2ArchProtocolGuid, NULL, (VOID **)&Security2);
if (EFI_ERROR(Status) && EFI_ERROR(Status2))
{
vLog(L"Failed to locate security or security2 protocol. %lx %lx %p %p",
Status, Status2, Security, Security2);
return;
}
if (Security2 && gSysSec2FileAuth && Security2->FileAuthentication == Security2PolicyAuth)
{
Security2->FileAuthentication = gSysSec2FileAuth;
gSysSec2FileAuth = NULL;
}
if (Security && gSysSecFileAuth && Security->FileAuthenticationState == SecurityPolicyAuth)
{
Security->FileAuthenticationState = gSysSecFileAuth;
gSysSecFileAuth = NULL;
}
}
STATIC VOID EFIAPI VtoyByPassSB(VOID)
{
gVtoyByPassSB = TRUE;
}
STATIC VOID EFIAPI VtoyCheckSB(VOID)
{
gVtoyByPassSB = FALSE;
}
STATIC VOID EFIAPI VtoyLaunched(VOID)
{
gGrubLaunched = TRUE;
}
STATIC VOID EFIAPI UnInstallVtoyShimProtocol(VOID)
{
EFI_GUID Guid = VTOY_SHIM_POLICY_GUID;
if (gVtoyShimProtHandle)
{
gBS->UninstallProtocolInterface(gVtoyShimProtHandle, &Guid, &gVtoyShimProtocol);
gVtoyShimProtHandle = NULL;
}
}
STATIC EFI_STATUS EFIAPI InstallVtoyShimProtocol(VOID)
{
EFI_STATUS Status;
EFI_GUID Guid = VTOY_SHIM_POLICY_GUID;
VTOY_SHIM *Prot = NULL;
gVtoyShimProtocol.ByPassSB = VtoyByPassSB;
gVtoyShimProtocol.CheckSB = VtoyCheckSB;
gVtoyShimProtocol.Launched = VtoyLaunched;
Status = gBS->LocateProtocol(&Guid, NULL, (VOID**)&Prot);
if (!EFI_ERROR(Status))
{
vLog(L"Ventoy shim already loaded, cannot be nested.");
return EFI_ALREADY_STARTED;
}
Status = gBS->InstallProtocolInterface(&gVtoyShimProtHandle, &Guid,
EFI_NATIVE_INTERFACE, &gVtoyShimProtocol);
if (EFI_ERROR(Status))
{
vLog(L"Failed to install protocol %lx", Status);
}
return Status;
}
STATIC BOOLEAN EFIAPI IsSecureBootEnabled(VOID)
{
UINT8 SecureBoot = 0;
UINTN DataSize;
EFI_STATUS Status;
DataSize = sizeof(SecureBoot);
Status = gST->RuntimeServices->GetVariable(L"SecureBoot", &gEfiGlobalVariableGuid, NULL,
&DataSize, &SecureBoot);
if (EFI_ERROR(Status))
{
return FALSE;
}
return SecureBoot ? TRUE : FALSE;
}
STATIC BOOLEAN EFIAPI IsSetupMode(VOID)
{
UINT8 SetupMode = 0;
UINTN DataSize;
EFI_STATUS Status;
DataSize = sizeof(SetupMode);
Status = gST->RuntimeServices->GetVariable(L"SetupMode", &gEfiGlobalVariableGuid, NULL,
&DataSize, &SetupMode);
if (EFI_ERROR(Status))
{
return FALSE;
}
return SetupMode ? TRUE : FALSE;
}
STATIC EFI_STATUS EFIAPI ShimEfiMain
(
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
)
{
EFI_STATUS Status;
SHIM_LOCK *ShimLock = NULL;
shim_void_func_pf Func1 = NULL;
shim_void_func_pf Func2 = NULL;
/* We must be launched by shim */
Status = gBS->LocateProtocol(&gShimLockGUID, NULL, (VOID**)&ShimLock);
if (EFI_ERROR(Status) || !ShimLock)
{
vErr(L"Failed to locate SHIM LOCK Protocol %lx", Status);
return Status;
}
/* Backup shim Lock because we will remove it later */
gShimLock.Verify = ShimLock->Verify;
gShimLock.Hash = ShimLock->Hash;
gShimLock.Context = ShimLock->Context;
Status = InstallVtoyShimProtocol();
if (EFI_ERROR(Status))
{
vErr(L"Failed to install ventoy shim protocol");
return Status;
}
/*
* IMPORTANT: All recent shim implementations hook the UEFI Boot Services
* (e.g. LoadImage, StartImage) to enforce signature verification.
*
* We must restore the original system service pointers here. If we fail to do this,
* we will be unable to launch Ventoy-signed EFI binaries or any other unsigned
* EFI applications later, even when the user has explicitly opted to disable
* all Secure Boot validation checks.
*
* To the best of my knowledge, there is no official way to remove these hooks.
* This is a tricky hack that relies on shim's internal implementation details.
* It may break in future versions of shim, and a better approach may exist.
*
*/
Func1 = FindShimFuncAddr(NM_UNHOOK_SYSTEM_SERVICES_OFFSET);
Func2 = FindShimFuncAddr(NM_UNINSTALL_SHIM_PROTOCOLS_OFFSET);
if (!Func1 || !Func2)
{
vErr(L"Can not find shim func %p %p", Func1, Func2);
Status = EFI_NOT_FOUND;
goto END;
}
Func1(); /* call shim unhook_system_services() */
Func2(); /* call shim uninstall_shim_protocols() */
HookSystemService();
/* Hook the system security policy */
Status = HookSecurityPolicy();
if (EFI_ERROR(Status))
{
vErr(L"Failed to hook system security policy");
goto END;
}
/* Finally launch Ventoy grub */
Status = LaunchRealGrub(ImageHandle, REAL_GRUB_FILE);
if (EFI_ERROR(Status))
{
vErr(L"Failed to finally launch real grub %s", REAL_GRUB_FILE);
goto END;
}
END:
/* UnHook system security policy */
UnHookSecurityPolicy();
UnInstallVtoyShimProtocol();
UnHookSystemService();
return Status;
}
EFI_STATUS EFIAPI VtoyGetVariable
(
IN CHAR16 *VariableName,
IN EFI_GUID *VendorGuid,
OUT UINT32 *Attributes, OPTIONAL
IN OUT UINTN *DataSize,
OUT VOID *Data OPTIONAL
)
{
BOOLEAN bChk = FALSE;
EFI_STATUS Status;
if (gVtoyByPassSB && VariableName && VendorGuid && DataSize && Data && (*DataSize) > 0)
{
bChk = TRUE;
}
Status = gSysGetVariable(VariableName, VendorGuid, Attributes, DataSize, Data);
if (bChk && (!EFI_ERROR(Status)))
{
if (CompareMem(&gShimLockGUID, VendorGuid, 16) == 0 &&
StrCmp(VariableName, L"MokSBState") == 0)
{
*(UINT8 *)Data = 1;
}
}
return Status;
}
STATIC VOID EFIAPI UnHookSystemService(VOID)
{
if (gSysExitBootServices)
{
gBS->ExitBootServices = gSysExitBootServices;
gSysExitBootServices = NULL;
}
if (gSysGetVariable)
{
gST->RuntimeServices->GetVariable = gSysGetVariable;
gSysGetVariable = NULL;
}
}
STATIC EFI_STATUS EFIAPI VtoyExitBootServices
(
IN EFI_HANDLE ImageHandle,
IN UINTN MapKey
)
{
EFI_EXIT_BOOT_SERVICES SysExitBS;
/* UnHookSystemService will set gSysExitBootServices NULL */
SysExitBS = gSysExitBootServices;
UnHookSecurityPolicy();
UnInstallVtoyShimProtocol();
UnHookSystemService();
return SysExitBS(ImageHandle, MapKey);
}
STATIC VOID EFIAPI HookSystemService(VOID)
{
gSysExitBootServices = gBS->ExitBootServices;
gBS->ExitBootServices = VtoyExitBootServices;
gSysGetVariable = gST->RuntimeServices->GetVariable;
gST->RuntimeServices->GetVariable = VtoyGetVariable;
}
EFI_STATUS EFIAPI VtoyShimEfiMain
(
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
)
{
BOOLEAN IsSetup = FALSE;
BOOLEAN IsSecureBoot = FALSE;
EFI_STATUS Status;
IsSetup = IsSetupMode();
IsSecureBoot = IsSecureBootEnabled();
if (!IsSecureBoot || IsSetup)
{
/* If secure boot is not enabled or in SetupMode, nothing needed, just launch Ventoy grub */
Status = LaunchRealGrub(ImageHandle, REAL_GRUB_FILE);
if (EFI_ERROR(Status))
{
vErr(L"Failed to launch %s", REAL_GRUB_FILE);
}
}
else
{
Status = ShimEfiMain(ImageHandle, SystemTable);
}
return Status;
}
@@ -0,0 +1,116 @@
/******************************************************************************
* VtoyShim.h
*
* Copyright (c) 2017 - 2018, Intel Corporation. All rights reserved.<BR>
* SPDX-License-Identifier: BSD-2-Clause-Patent
*
*/
#ifndef __VTOYSHIM_H__
#define __VTOYSHIM_H__
#if defined (MDE_CPU_IA32)
#define REAL_GRUB_FILE L"grubia32_real.efi"
#elif defined (MDE_CPU_X64)
#define REAL_GRUB_FILE L"grubx64_real.efi"
#elif defined (MDE_CPU_AARCH64)
#define REAL_GRUB_FILE L"grubaa64_real.efi"
#else
#error "Not supported now"
#endif
/* The following definations are copied from shim source code */
#define SHIM_LOCK_GUID {0x605dab50, 0xe046, 0x4300, {0xab, 0xb6, 0x3d, 0xd8, 0x10, 0xdd, 0x8b, 0x23 } };
typedef
EFI_STATUS
(*EFI_SHIM_LOCK_VERIFY) (
IN VOID *buffer,
IN UINT32 size
);
typedef
EFI_STATUS
(*EFI_SHIM_LOCK_HASH) (
IN char *data,
IN int datasize,
PE_COFF_LOADER_IMAGE_CONTEXT *context,
UINT8 *sha256hash,
UINT8 *sha1hash
);
typedef
EFI_STATUS
(*EFI_SHIM_LOCK_CONTEXT) (
IN VOID *data,
IN unsigned int datasize,
PE_COFF_LOADER_IMAGE_CONTEXT *context
);
typedef struct _SHIM_LOCK {
EFI_SHIM_LOCK_VERIFY Verify;
EFI_SHIM_LOCK_HASH Hash;
EFI_SHIM_LOCK_CONTEXT Context;
} SHIM_LOCK;
#define SHIM_IMAGE_LOADER_GUID {0x1f492041, 0xfadb, 0x4e59, {0x9e, 0x57, 0x7c, 0xaf, 0xe7, 0x3a, 0x55, 0xab } }
typedef struct _SHIM_IMAGE_LOADER {
EFI_IMAGE_LOAD LoadImage;
EFI_IMAGE_START StartImage;
EFI_EXIT Exit;
EFI_IMAGE_UNLOAD UnloadImage;
} SHIM_IMAGE_LOADER;
typedef VOID (*shim_void_func_pf)(VOID);
/*
* The two offset here are extract from the shim file which used in Ventoy.
* nm BOOTX64.EFI | grep shim_load_image
* nm BOOTX64.EFI | grep unhook_system_services
* nm BOOTX64.EFI | grep uninstall_shim_protocols
*
* It means that they must be updated every time Ventoy update the shim file.
*
*/
#define NM_SHIM_LOAD_IMAGE_OFFSET 0x2dc12
#define NM_UNHOOK_SYSTEM_SERVICES_OFFSET 0x2e278
#define NM_UNINSTALL_SHIM_PROTOCOLS_OFFSET 0x26264
#define VtoySleep(sec) gBS->Stall(1000000 * (sec))
#define vLog(fmt, ...) VtoyLog(fmt "\r\n", ##__VA_ARGS__)
#define vErr(fmt, ...) VtoyLog(fmt "\r\n", ##__VA_ARGS__); VtoySleep(5)
#define vDbg(fmt, ...) VtoyLog(fmt "\r\n", ##__VA_ARGS__); VtoySleep(2)
#define CheckFreePool(p) \
do { \
if (p) { \
FreePool(p); \
(p) = NULL; \
}\
} while (0)
#define VTOY_SHIM_POLICY_GUID {0x90a29d14, 0x3968, 0x48fe, { 0x85, 0x81, 0x6b, 0x7f, 0x7d, 0xc4, 0x70, 0x55 }};
typedef VOID (EFIAPI *VTOY_BYPASS_SB)(VOID);
typedef VOID (EFIAPI *VTOY_CHECK_SB)(VOID);
typedef VOID (EFIAPI *VTOY_LAUNCHED)(VOID);
typedef struct _VTOY_SHIM{
VTOY_BYPASS_SB ByPassSB;
VTOY_BYPASS_SB CheckSB;
VTOY_LAUNCHED Launched;
} VTOY_SHIM;
void calc_sha256(const void *data, UINT64 len, void *output);
#endif
@@ -0,0 +1,84 @@
#************************************************************************************
# Copyright (c) 2026, 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/>.
#
#************************************************************************************
[Defines]
INF_VERSION = 0x00010005
BASE_NAME = VtoyShim
FILE_GUID = 6d7c7406-b32c-461f-8454-ddaa5243d93d
MODULE_TYPE = UEFI_APPLICATION
VERSION_STRING = 1.0
ENTRY_POINT = VtoyShimEfiMain
[BuildOptions]
# Force standard GNU ld to pack and align ELF segments to 4KB page boundaries
GCC:*_*_*_DLINK_FLAGS = -Wl,-z,common-page-size=0x1000 -Wl,-z,max-page-size=0x1000
[Sources]
VtoyShim.h
VtoyShim.c
sha256.c
[Packages]
MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec
ShellPkg/ShellPkg.dec
[LibraryClasses]
UefiApplicationEntryPoint
UefiLib
DevicePathLib
DebugLib
[Guids]
gEfiGlobalVariableGuid
gShellVariableGuid
gEfiVirtualCdGuid
gEfiFileInfoGuid
[Protocols]
gEfiSecurityArchProtocolGuid
gEfiSecurity2ArchProtocolGuid
gEfiLoadedImageProtocolGuid
gEfiBlockIoProtocolGuid
gEfiDevicePathProtocolGuid
gEfiDevicePathToTextProtocolGuid
gEfiDevicePathFromTextProtocolGuid
gEfiSimpleFileSystemProtocolGuid
gEfiRamDiskProtocolGuid
gEfiAbsolutePointerProtocolGuid
gEfiAcpiTableProtocolGuid
gEfiBlockIo2ProtocolGuid
gEfiBusSpecificDriverOverrideProtocolGuid
gEfiComponentNameProtocolGuid
gEfiComponentName2ProtocolGuid
gEfiDriverBindingProtocolGuid
gEfiDiskIoProtocolGuid
gEfiDiskIo2ProtocolGuid
gEfiGraphicsOutputProtocolGuid
gEfiHiiConfigAccessProtocolGuid
gEfiHiiFontProtocolGuid
gEfiLoadFileProtocolGuid
gEfiLoadFile2ProtocolGuid
gEfiLoadedImageProtocolGuid
gEfiLoadedImageDevicePathProtocolGuid
gEfiPciIoProtocolGuid
gEfiSerialIoProtocolGuid
gEfiSimpleTextInProtocolGuid
gEfiSimpleTextInputExProtocolGuid
gEfiSimpleTextOutProtocolGuid
@@ -0,0 +1,2 @@
sbat,1,SBAT Version,sbat,1,https://github.com/rhboot/shim/blob/main/SBAT.md
ventoy-shim,1,Ventoy,ventoy-shim,1.0,https://www.ventoy.net/
1 sbat 1 SBAT Version sbat 1 https://github.com/rhboot/shim/blob/main/SBAT.md
2 ventoy-shim 1 Ventoy ventoy-shim 1.0 https://www.ventoy.net/
@@ -0,0 +1,170 @@
/******************************************************************************
* VtoyShim.c
*
* Copyright (c) 2017 - 2018, Intel Corporation. All rights reserved.<BR>
* SPDX-License-Identifier: BSD-2-Clause-Patent
*
*/
#include <Uefi.h>
#include <Library/DebugLib.h>
#include <Library/PrintLib.h>
#include <Library/UefiLib.h>
#include <Library/BaseMemoryLib.h>
static const UINT32 sha256_initial_h[8]
= { 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a,
0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19 };
static const UINT32 sha256_round_k[64]
= { 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1,
0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,
0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0xe49b69c1, 0xefbe4786,
0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147,
0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,
0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, 0xa2bfe8a1, 0xa81a664b,
0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a,
0x5b9cca4f, 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,
0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 };
static void sha256_endian_reverse64(UINT64 input, UINT8 *output) {
output[7] = (input >> 0) & 0xff;
output[6] = (input >> 8) & 0xff;
output[5] = (input >> 16) & 0xff;
output[4] = (input >> 24) & 0xff;
output[3] = (input >> 32) & 0xff;
output[2] = (input >> 40) & 0xff;
output[1] = (input >> 48) & 0xff;
output[0] = (input >> 56) & 0xff;
}
static UINT32 sha256_endian_read32(UINT8 *input) {
UINT32 output = 0;
output |= (input[0] << 24);
output |= (input[1] << 16);
output |= (input[2] << 8);
output |= (input[3] << 0);
return output;
}
static void sha256_endian_reverse32(UINT32 input, UINT8 *output) {
output[3] = (input >> 0) & 0xff;
output[2] = (input >> 8) & 0xff;
output[1] = (input >> 16) & 0xff;
output[0] = (input >> 24) & 0xff;
}
static UINT32 sha256_ror(UINT32 input, UINT32 by) {
return (input >> by) | (((input & ((1 << by) - 1))) << (32 - by));
}
void calc_sha256(const void *data, UINT64 len, void *output)
{
int i = 0;
int j = 0;
UINT8 padding[80];
UINT64 current = (len + 1) % 64;
// want to be == 56 % 64.
UINT64 needed = (64 + 56 - current) % 64;
UINT64 extra = needed + 9;
UINT64 total = len + extra;
UINT32 v[8];
UINT64 cursor = 0;
for(i = 1; i < 80; i++)
{
padding[i] = 0;
}
padding[0] = 0x80;
sha256_endian_reverse64(len * 8, padding + total - len - 8);
for(i = 0; i < 8; i++)
{
v[i] = sha256_initial_h[i];
}
for(cursor = 0; cursor * 64 < total; cursor++)
{
UINT32 t[8];
UINT32 w[64];
for(i = 0; i < 8; i++)
{
t[i] = v[i];
}
if(cursor * 64 + 64 <= len)
{
for(j = 0; j < 16; j++)
{
w[j] = sha256_endian_read32((UINT8 *)data + cursor * 64 + j * 4);
}
}
else
{
if(cursor * 64 < len)
{
UINT64 size = len - cursor * 64;
if(size > 0)
{
CopyMem(w, (UINT8 *)data + cursor * 64, size);
}
CopyMem((UINT8 *)w + size, padding, 64 - size);
}
else
{
UINT64 off = (cursor * 64 - len) % 64;
CopyMem((UINT8 *)w, padding + off, 64);
}
for(j = 0; j < 16; j++)
{
w[j] = sha256_endian_read32((UINT8 *)&w[j]);
}
}
for(j = 16; j < 64; j++)
{
UINT32 s1 = sha256_ror(w[j - 2], 17) ^ sha256_ror(w[j - 2], 19) ^ (w[j - 2] >> 10);
UINT32 s0 = sha256_ror(w[j - 15], 7) ^ sha256_ror(w[j - 15], 18) ^ (w[j - 15] >> 3);
w[j] = s1 + w[j - 7] + s0 + w[j - 16];
}
for(j = 0; j < 64; j++)
{
UINT32 ch = (t[4] & t[5]) ^ (~t[4] & t[6]);
UINT32 maj = (t[0] & t[1]) ^ (t[0] & t[2]) ^ (t[1] & t[2]);
UINT32 S0 = sha256_ror(t[0], 2) ^ sha256_ror(t[0], 13) ^ sha256_ror(t[0], 22);
UINT32 S1 = sha256_ror(t[4], 6) ^ sha256_ror(t[4], 11) ^ sha256_ror(t[4], 25);
UINT32 t1 = t[7] + S1 + ch + sha256_round_k[j] + w[j];
UINT32 t2 = S0 + maj;
t[7] = t[6];
t[6] = t[5];
t[5] = t[4];
t[4] = t[3] + t1;
t[3] = t[2];
t[2] = t[1];
t[1] = t[0];
t[0] = t1 + t2;
}
for(i = 0; i < 8; i++)
{
v[i] += t[i];
}
}
for(i = 0; i < 8; i++)
{
sha256_endian_reverse32(v[i], (UINT8 *)output + i * 4);
}
}
@@ -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/>.
* *
@@ -41,7 +41,7 @@ STATIC CONST CHAR16 *gCurFeature= NULL;
STATIC CHAR16 *gCmdLine = NULL; STATIC CHAR16 *gCmdLine = NULL;
STATIC grub_env_printf_pf g_env_printf = NULL; STATIC grub_env_printf_pf g_env_printf = NULL;
STATIC VtoyUtilFeature gFeatureList[] = STATIC VtoyUtilFeature gFeatureList[] =
{ {
{ L"fix_windows_mmap", FixWindowsMemhole }, { L"fix_windows_mmap", FixWindowsMemhole },
{ L"show_efi_drivers", ShowEfiDrivers }, { L"show_efi_drivers", ShowEfiDrivers },
@@ -93,7 +93,7 @@ VOID EFIAPI VtoyUtilDebug(IN CONST CHAR8 *Format, ...)
} }
STATIC EFI_STATUS ParseCmdline(IN EFI_HANDLE ImageHandle) STATIC EFI_STATUS ParseCmdline(IN EFI_HANDLE ImageHandle)
{ {
CHAR16 *pPos = NULL; CHAR16 *pPos = NULL;
CHAR16 *pCmdLine = NULL; CHAR16 *pCmdLine = NULL;
EFI_STATUS Status = EFI_SUCCESS; EFI_STATUS Status = EFI_SUCCESS;
@@ -117,7 +117,7 @@ STATIC EFI_STATUS ParseCmdline(IN EFI_HANDLE ImageHandle)
gST->ConOut->OutputString(gST->ConOut, L"\r\n##########################"); gST->ConOut->OutputString(gST->ConOut, L"\r\n##########################");
return EFI_SUCCESS; return EFI_SUCCESS;
} }
if (StrStr(pCmdLine, L"debug")) if (StrStr(pCmdLine, L"debug"))
{ {
gVtoyDebugPrint = TRUE; gVtoyDebugPrint = TRUE;
@@ -139,9 +139,9 @@ STATIC EFI_STATUS ParseCmdline(IN EFI_HANDLE ImageHandle)
} }
gCurFeature = pPos + StrLen(L"feature="); gCurFeature = pPos + StrLen(L"feature=");
gCmdLine = pCmdLine; gCmdLine = pCmdLine;
return EFI_SUCCESS; return EFI_SUCCESS;
} }
@@ -153,7 +153,7 @@ EFI_STATUS EFIAPI VtoyUtilEfiMain
{ {
UINTN i; UINTN i;
UINTN Len; UINTN Len;
ParseCmdline(ImageHandle); ParseCmdline(ImageHandle);
for (i = 0; gCurFeature && i < ARRAY_SIZE(gFeatureList); i++) for (i = 0; gCurFeature && i < ARRAY_SIZE(gFeatureList); i++)
@@ -170,7 +170,7 @@ EFI_STATUS EFIAPI VtoyUtilEfiMain
if (gCmdLine) if (gCmdLine)
{ {
FreePool(gCmdLine); FreePool(gCmdLine);
gCmdLine = NULL; gCmdLine = NULL;
} }
return EFI_SUCCESS; return EFI_SUCCESS;
@@ -7,20 +7,22 @@
* 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 __VTOYUTIL_H__ #ifndef __VTOYUTIL_H__
#define __VTOYUTIL_H__ #define __VTOYUTIL_H__
#define VTOY_SHIM_POLICY_GUID {0x90a29d14, 0x3968, 0x48fe, { 0x85, 0x81, 0x6b, 0x7f, 0x7d, 0xc4, 0x70, 0x55 }};
#pragma pack(1) #pragma pack(1)
typedef EFI_STATUS (*VTOY_UTIL_PROC_PF)(IN EFI_HANDLE ImageHandle, IN CONST CHAR16 *CmdLine); typedef EFI_STATUS (*VTOY_UTIL_PROC_PF)(IN EFI_HANDLE ImageHandle, IN CONST CHAR16 *CmdLine);
@@ -44,14 +46,14 @@ 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;
#pragma pack() #pragma pack()
typedef struct VtoyUtilFeature typedef struct VtoyUtilFeature
{ {
CONST CHAR16 *Cmd; CONST CHAR16 *Cmd;
VTOY_UTIL_PROC_PF MainProc; VTOY_UTIL_PROC_PF MainProc;
}VtoyUtilFeature; }VtoyUtilFeature;
@@ -23,7 +23,10 @@
MODULE_TYPE = UEFI_APPLICATION MODULE_TYPE = UEFI_APPLICATION
VERSION_STRING = 1.0 VERSION_STRING = 1.0
ENTRY_POINT = VtoyUtilEfiMain ENTRY_POINT = VtoyUtilEfiMain
[BuildOptions]
# Force standard GNU ld to pack and align ELF segments to 4KB page boundaries
GCC:*_*_*_DLINK_FLAGS = -Wl,-z,common-page-size=0x1000 -Wl,-z,max-page-size=0x1000
[Sources] [Sources]
VtoyUtil.h VtoyUtil.h
@@ -205,6 +205,7 @@
[Components] [Components]
MdeModulePkg/Application/Ventoy/Ventoy.inf MdeModulePkg/Application/Ventoy/Ventoy.inf
MdeModulePkg/Application/VtoyUtil/VtoyUtil.inf MdeModulePkg/Application/VtoyUtil/VtoyUtil.inf
MdeModulePkg/Application/VtoyShim/VtoyShim.inf
MdeModulePkg/Application/VDiskChain/VDiskChain.inf MdeModulePkg/Application/VDiskChain/VDiskChain.inf
MdeModulePkg/Application/HelloWorld/HelloWorld.inf MdeModulePkg/Application/HelloWorld/HelloWorld.inf
MdeModulePkg/Application/DumpDynPcd/DumpDynPcd.inf MdeModulePkg/Application/DumpDynPcd/DumpDynPcd.inf
@@ -0,0 +1,195 @@
/* corecmd.c - critical commands which are registered in kernel */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2009 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GRUB is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
*/
#include <grub/mm.h>
#include <grub/dl.h>
#include <grub/err.h>
#include <grub/env.h>
#include <grub/misc.h>
#include <grub/term.h>
#include <grub/file.h>
#include <grub/device.h>
#include <grub/command.h>
#include <grub/i18n.h>
/* set ENVVAR=VALUE */
static grub_err_t
grub_core_cmd_set (struct grub_command *cmd __attribute__ ((unused)),
int argc, char *argv[])
{
char *var;
char *val;
if (argc < 1)
{
struct grub_env_var *env;
FOR_SORTED_ENV (env)
grub_printf ("%s=%s\n", env->name, grub_env_get (env->name));
return 0;
}
var = argv[0];
val = grub_strchr (var, '=');
if (! val)
return grub_error (GRUB_ERR_BAD_ARGUMENT, "not an assignment");
val[0] = 0;
grub_env_set (var, val + 1);
val[0] = '=';
return 0;
}
static grub_err_t
grub_core_cmd_unset (struct grub_command *cmd __attribute__ ((unused)),
int argc, char *argv[])
{
if (argc < 1)
return grub_error (GRUB_ERR_BAD_ARGUMENT,
N_("one argument expected"));
grub_env_unset (argv[0]);
return 0;
}
/* insmod MODULE */
static grub_err_t
grub_core_cmd_insmod (struct grub_command *cmd __attribute__ ((unused)),
int argc, char *argv[])
{
grub_dl_t mod;
if (argc == 0)
return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("one argument expected"));
/* For simple, just disable insmod when SecureBoot is enabled. */
if (g_sys_sb && g_sb_policy == VTOY_SB_POLICY_CHECK)
{
return grub_error (GRUB_ERR_BAD_SIGNATURE, "Cannot insmod when SecureBoot is enabled and Policy is check.");
}
if (argv[0][0] == '/' || argv[0][0] == '(' || argv[0][0] == '+')
mod = grub_dl_load_file (argv[0]);
else
mod = grub_dl_load (argv[0]);
if (mod)
grub_dl_ref (mod);
return 0;
}
static int
grub_mini_print_devices (const char *name, void *data __attribute__ ((unused)))
{
grub_printf ("(%s) ", name);
return 0;
}
static int
grub_mini_print_files (const char *filename,
const struct grub_dirhook_info *info,
void *data __attribute__ ((unused)))
{
grub_printf ("%s%s ", filename, info->dir ? "/" : "");
return 0;
}
/* ls [ARG] */
static grub_err_t
grub_core_cmd_ls (struct grub_command *cmd __attribute__ ((unused)),
int argc, char *argv[])
{
if (argc < 1)
{
grub_device_iterate (grub_mini_print_devices, NULL);
grub_xputs ("\n");
grub_refresh ();
}
else
{
char *device_name;
grub_device_t dev = 0;
grub_fs_t fs;
char *path;
device_name = grub_file_get_device_name (argv[0]);
if (grub_errno)
goto fail;
dev = grub_device_open (device_name);
if (! dev)
goto fail;
fs = grub_fs_probe (dev);
path = grub_strchr (argv[0], ')');
if (! path)
path = argv[0];
else
path++;
if (! *path && ! device_name)
{
grub_error (GRUB_ERR_BAD_ARGUMENT, "invalid argument");
goto fail;
}
if (! *path)
{
if (grub_errno == GRUB_ERR_UNKNOWN_FS)
grub_errno = GRUB_ERR_NONE;
grub_printf ("(%s): Filesystem is %s.\n",
device_name, fs ? fs->name : "unknown");
}
else if (fs)
{
(fs->fs_dir) (dev, path, grub_mini_print_files, NULL);
grub_xputs ("\n");
grub_refresh ();
}
fail:
if (dev)
grub_device_close (dev);
grub_free (device_name);
}
return grub_errno;
}
void
grub_register_core_commands (void)
{
grub_command_t cmd;
cmd = grub_register_command ("set", grub_core_cmd_set,
N_("[ENVVAR=VALUE]"),
N_("Set an environment variable."));
if (cmd)
cmd->flags |= GRUB_COMMAND_FLAG_EXTRACTOR;
grub_register_command ("unset", grub_core_cmd_unset,
N_("ENVVAR"),
N_("Remove an environment variable."));
grub_register_command ("ls", grub_core_cmd_ls,
N_("[ARG]"), N_("List devices or files."));
grub_register_command ("insmod", grub_core_cmd_insmod,
N_("MODULE"), N_("Insert a module."));
}
+5 -2
View File
@@ -22,6 +22,9 @@
#include <grub/misc.h> #include <grub/misc.h>
#include <grub/mm.h> #include <grub/mm.h>
grub_uint8_t g_sys_sb = 0;
grub_uint8_t g_sb_policy = VTOY_SB_POLICY_BYPASS;
/* The initial context. */ /* The initial context. */
static struct grub_env_context initial_context; static struct grub_env_context initial_context;
@@ -238,12 +241,12 @@ grub_env_export (const char *name)
if (! var) if (! var)
{ {
grub_err_t err; grub_err_t err;
err = grub_env_set (name, ""); err = grub_env_set (name, "");
if (err) if (err)
return err; return err;
var = grub_env_find (name); var = grub_env_find (name);
} }
var->global = 1; var->global = 1;
return GRUB_ERR_NONE; return GRUB_ERR_NONE;
@@ -35,6 +35,8 @@
#include <grub/i18n.h> #include <grub/i18n.h>
#include <grub/lib/cmdline.h> #include <grub/lib/cmdline.h>
#include <grub/linux.h> #include <grub/linux.h>
#include <grub/time.h>
#include <grub/env.h>
#include <grub/machine/kernel.h> #include <grub/machine/kernel.h>
GRUB_MOD_LICENSE ("GPLv3+"); GRUB_MOD_LICENSE ("GPLv3+");
@@ -297,7 +299,7 @@ grub_linux_setup_video (struct linux_kernel_params *params)
params->lfb_size >>= 16; params->lfb_size >>= 16;
params->have_vga = GRUB_VIDEO_LINUX_TYPE_VESA; params->have_vga = GRUB_VIDEO_LINUX_TYPE_VESA;
break; break;
case GRUB_VIDEO_DRIVER_EFI_UGA: case GRUB_VIDEO_DRIVER_EFI_UGA:
case GRUB_VIDEO_DRIVER_EFI_GOP: case GRUB_VIDEO_DRIVER_EFI_GOP:
params->have_vga = GRUB_VIDEO_LINUX_TYPE_EFIFB; params->have_vga = GRUB_VIDEO_LINUX_TYPE_EFIFB;
@@ -413,11 +415,11 @@ static void ventoy_debug_pause(void)
{ {
char key; char key;
if (0 == ventoy_debug) if (0 == ventoy_debug)
{ {
return; return;
} }
grub_printf("press Enter to continue ......\n"); grub_printf("press Enter to continue ......\n");
while (1) while (1)
{ {
@@ -426,7 +428,7 @@ static void ventoy_debug_pause(void)
{ {
break; break;
} }
} }
} }
static int ventoy_preboot(void) static int ventoy_preboot(void)
@@ -435,7 +437,7 @@ static int ventoy_preboot(void)
const char *file; const char *file;
char buf[128]; char buf[128];
if (ventoy_debug) if (ventoy_debug)
{ {
grub_printf("ventoy_preboot %d %d\n", ventoy_linux_argc, ventoy_initrd_called); grub_printf("ventoy_preboot %d %d\n", ventoy_linux_argc, ventoy_initrd_called);
ventoy_debug_pause(); ventoy_debug_pause();
@@ -462,7 +464,7 @@ static int ventoy_preboot(void)
ventoy_extra_initrd_list[ventoy_extra_initrd_num++] = grub_strdup(file); ventoy_extra_initrd_list[ventoy_extra_initrd_num++] = grub_strdup(file);
} }
if (ventoy_debug) if (ventoy_debug)
{ {
grub_printf("========== initrd list ==========\n"); grub_printf("========== initrd list ==========\n");
for (i = 0; i < ventoy_extra_initrd_num; i++) for (i = 0; i < ventoy_extra_initrd_num; i++)
@@ -470,7 +472,7 @@ static int ventoy_preboot(void)
grub_printf("%s\n", ventoy_extra_initrd_list[i]); grub_printf("%s\n", ventoy_extra_initrd_list[i]);
} }
grub_printf("=================================\n"); grub_printf("=================================\n");
ventoy_debug_pause(); ventoy_debug_pause();
} }
@@ -500,7 +502,7 @@ static int ventoy_boot_opt_filter(char *opt)
} }
return 0; return 0;
} }
if (grub_strncmp(opt, "init=", 5) == 0) if (grub_strncmp(opt, "init=", 5) == 0)
{ {
opt[0] = 'v'; opt[0] = 'v';
@@ -521,12 +523,12 @@ static int ventoy_boot_opt_filter(char *opt)
{ {
return 1; return 1;
} }
if (grub_strncmp(opt, "loglevel=", 9) == 0) if (grub_strncmp(opt, "loglevel=", 9) == 0)
{ {
return 1; return 1;
} }
if (grub_strcmp(opt, "splash") == 0) if (grub_strcmp(opt, "splash") == 0)
{ {
return 1; return 1;
@@ -573,7 +575,7 @@ static int ventoy_bootopt_hook(int argc, char *argv[])
{ {
ventoy_linux_args[count] = ventoy_linux_args[i + (LINUX_MAX_ARGC / 2)]; ventoy_linux_args[count] = ventoy_linux_args[i + (LINUX_MAX_ARGC / 2)];
ventoy_linux_args[i + (LINUX_MAX_ARGC / 2)] = NULL; ventoy_linux_args[i + (LINUX_MAX_ARGC / 2)] = NULL;
if (ventoy_linux_args[count][0] == '@') if (ventoy_linux_args[count][0] == '@')
{ {
env = grub_env_get(ventoy_linux_args[count] + 1); env = grub_env_get(ventoy_linux_args[count] + 1);
@@ -619,7 +621,7 @@ static int ventoy_bootopt_hook(int argc, char *argv[])
{ {
if (0 == ventoy_boot_opt_filter(last)) if (0 == ventoy_boot_opt_filter(last))
{ {
ventoy_linux_args[count++] = grub_strdup(last); ventoy_linux_args[count++] = grub_strdup(last);
} }
break; break;
} }
@@ -634,7 +636,7 @@ static int ventoy_bootopt_hook(int argc, char *argv[])
} }
else else
{ {
count++; count++;
} }
} }
@@ -662,10 +664,10 @@ static int ventoy_bootopt_hook(int argc, char *argv[])
for (i = 0; i < count; i++) for (i = 0; i < count; i++)
{ {
grub_printf("%s ", ventoy_linux_args[i]); grub_printf("%s ", ventoy_linux_args[i]);
} }
grub_printf("\n================================\n"); grub_printf("\n================================\n");
} }
return 0; return 0;
} }
@@ -677,7 +679,7 @@ grub_cmd_extra_initrd_append (grub_command_t cmd __attribute__ ((unused)),
char *pos = NULL; char *pos = NULL;
char *end = NULL; char *end = NULL;
char buf[256] = {0}; char buf[256] = {0};
if (argc != 1) if (argc != 1)
{ {
return 1; return 1;
@@ -703,10 +705,10 @@ grub_cmd_extra_initrd_append (grub_command_t cmd __attribute__ ((unused)),
{ {
grub_snprintf(buf, sizeof(buf), "newc:%s:%s", end + 1, argv[0]); grub_snprintf(buf, sizeof(buf), "newc:%s:%s", end + 1, argv[0]);
} }
if (ventoy_extra_initrd_num < 256) if (ventoy_extra_initrd_num < 256)
{ {
ventoy_extra_initrd_list[ventoy_extra_initrd_num++] = grub_strdup(buf); ventoy_extra_initrd_list[ventoy_extra_initrd_num++] = grub_strdup(buf);
} }
} }
@@ -718,7 +720,7 @@ grub_cmd_extra_initrd_reset (grub_command_t cmd __attribute__ ((unused)),
int argc, char *argv[]) int argc, char *argv[])
{ {
int i; int i;
(void)argc; (void)argc;
(void)argv; (void)argv;
@@ -750,6 +752,16 @@ grub_linux_boot (void)
grub_size_t mmap_size; grub_size_t mmap_size;
grub_size_t cl_offset; grub_size_t cl_offset;
/* To be simple, just deny to boot linux kernel when SecureBoot is enabled and Policy is check */
if (g_sys_sb && g_sb_policy == VTOY_SB_POLICY_CHECK)
{
grub_printf("\n\n ######### Can not do linux boot in SecureBoot Policy Check #######\n\n");
grub_refresh();
grub_sleep(5);
grub_errno = GRUB_ERR_BAD_SIGNATURE;
return 0;
}
ventoy_preboot(); ventoy_preboot();
#ifdef GRUB_MACHINE_IEEE1275 #ifdef GRUB_MACHINE_IEEE1275
@@ -924,9 +936,9 @@ grub_linux_boot (void)
&efi_desc_size, &efi_desc_version); &efi_desc_size, &efi_desc_version);
if (err) if (err)
return err; return err;
/* Note that no boot services are available from here. */ /* Note that no boot services are available from here. */
efi_mmap_target = ctx.real_mode_target efi_mmap_target = ctx.real_mode_target
+ ((grub_uint8_t *) efi_mmap_buf - (grub_uint8_t *) real_mode_mem); + ((grub_uint8_t *) efi_mmap_buf - (grub_uint8_t *) real_mode_mem);
/* Pass EFI parameters. */ /* Pass EFI parameters. */
if (grub_le_to_cpu16 (ctx.params->version) >= 0x0208) if (grub_le_to_cpu16 (ctx.params->version) >= 0x0208)
@@ -1008,7 +1020,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
if (tip) if (tip)
{ {
grub_printf("%s\n", tip); grub_printf("%s\n", tip);
grub_refresh(); grub_refresh();
} }
} }
@@ -1086,7 +1098,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
align = 0; align = 0;
relocatable = 0; relocatable = 0;
} }
if (grub_le_to_cpu16 (lh.version) >= 0x020a) if (grub_le_to_cpu16 (lh.version) >= 0x020a)
{ {
min_align = lh.min_alignment; min_align = lh.min_alignment;
@@ -1361,7 +1373,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
- (sizeof (LINUX_IMAGE) - 1), - (sizeof (LINUX_IMAGE) - 1),
GRUB_VERIFY_KERNEL_CMDLINE); GRUB_VERIFY_KERNEL_CMDLINE);
} }
if (err) if (err)
goto fail; goto fail;
} }
@@ -1495,7 +1507,7 @@ ventoy_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
if (ventoy_linux_argc == 0) if (ventoy_linux_argc == 0)
{ {
return grub_cmd_initrd(cmd, argc, argv); return grub_cmd_initrd(cmd, argc, argv);
} }
grub_snprintf(buf, sizeof(buf), "mem:%s:size:%s", grub_env_get("ventoy_cpio_addr"), grub_env_get("ventoy_cpio_size")); grub_snprintf(buf, sizeof(buf), "mem:%s:size:%s", grub_env_get("ventoy_cpio_addr"), grub_env_get("ventoy_cpio_size"));
@@ -1526,7 +1538,7 @@ ventoy_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
} }
grub_printf("=================================\n"); grub_printf("=================================\n");
} }
return grub_cmd_initrd(cmd, ventoy_extra_initrd_num, ventoy_extra_initrd_list); return grub_cmd_initrd(cmd, ventoy_extra_initrd_num, ventoy_extra_initrd_list);
} }
@@ -1537,7 +1549,7 @@ grub_cmd_set_boot_opt (grub_command_t cmd __attribute__ ((unused)),
int i; int i;
const char *vtdebug; const char *vtdebug;
grub_command_t regcmd; grub_command_t regcmd;
for (i = 0; i < argc; i++) for (i = 0; i < argc; i++)
{ {
ventoy_linux_args[ventoy_linux_argc + (LINUX_MAX_ARGC / 2) ] = grub_strdup(argv[i]); ventoy_linux_args[ventoy_linux_argc + (LINUX_MAX_ARGC / 2) ] = grub_strdup(argv[i]);
@@ -1559,7 +1571,7 @@ grub_cmd_set_boot_opt (grub_command_t cmd __attribute__ ((unused)),
ventoy_linux16_func = regcmd->func; ventoy_linux16_func = regcmd->func;
regcmd->func = grub_cmd_linux; regcmd->func = grub_cmd_linux;
} }
regcmd = grub_command_find("initrd16"); regcmd = grub_command_find("initrd16");
if (regcmd) if (regcmd)
{ {
@@ -1576,7 +1588,7 @@ grub_cmd_unset_boot_opt (grub_command_t cmd __attribute__ ((unused)),
{ {
int i; int i;
grub_command_t regcmd; grub_command_t regcmd;
(void)argc; (void)argc;
(void)argv; (void)argv;
@@ -1612,7 +1624,7 @@ grub_cmd_unset_boot_opt (grub_command_t cmd __attribute__ ((unused)),
} }
ventoy_initrd16_func = NULL; ventoy_initrd16_func = NULL;
} }
return 0; return 0;
} }
@@ -1633,7 +1645,7 @@ GRUB_MOD_INIT(linux)
0, N_("Load initrd.")); 0, N_("Load initrd."));
cmd_set_bootopt = grub_register_command ("vt_set_boot_opt", grub_cmd_set_boot_opt, 0, N_("set ext boot opt")); cmd_set_bootopt = grub_register_command ("vt_set_boot_opt", grub_cmd_set_boot_opt, 0, N_("set ext boot opt"));
cmd_unset_bootopt = grub_register_command ("vt_unset_boot_opt", grub_cmd_unset_boot_opt, 0, N_("unset ext boot opt")); cmd_unset_bootopt = grub_register_command ("vt_unset_boot_opt", grub_cmd_unset_boot_opt, 0, N_("unset ext boot opt"));
cmd_extra_initrd_append = grub_register_command ("vt_img_extra_initrd_append", grub_cmd_extra_initrd_append, 0, N_("")); cmd_extra_initrd_append = grub_register_command ("vt_img_extra_initrd_append", grub_cmd_extra_initrd_append, 0, N_(""));
cmd_extra_initrd_reset = grub_register_command ("vt_img_extra_initrd_reset", grub_cmd_extra_initrd_reset, 0, N_("")); cmd_extra_initrd_reset = grub_register_command ("vt_img_extra_initrd_reset", grub_cmd_extra_initrd_reset, 0, N_(""));
+32 -18
View File
@@ -438,11 +438,11 @@ static void menu_set_chosen_tip(grub_menu_t menu, int entry)
if (g_ventoy_theme_path[0]) if (g_ventoy_theme_path[0])
{ {
grub_env_set("theme", g_ventoy_theme_path); grub_env_set("theme", g_ventoy_theme_path);
} }
g_ventoy_tip_msg1 = g_ventoy_tip_msg2 = NULL; g_ventoy_tip_msg1 = g_ventoy_tip_msg2 = NULL;
if (e && e->id && grub_strncmp(e->id, "VID_", 4) == 0) if (e && e->id && grub_strncmp(e->id, "VID_", 4) == 0)
{ {
g_ventoy_theme_path[0] = 0; g_ventoy_theme_path[0] = 0;
img = (img_info *)(void *)grub_strtoul(e->id + 4, NULL, 16); img = (img_info *)(void *)grub_strtoul(e->id + 4, NULL, 16);
@@ -480,7 +480,7 @@ static void
menu_set_chosen_entry (grub_menu_t menu, int entry) menu_set_chosen_entry (grub_menu_t menu, int entry)
{ {
struct grub_menu_viewer *cur; struct grub_menu_viewer *cur;
menu_set_chosen_tip(menu, entry); menu_set_chosen_tip(menu, entry);
for (cur = viewers; cur; cur = cur->next) for (cur = viewers; cur; cur = cur->next)
cur->set_chosen_entry (entry, cur->data); cur->set_chosen_entry (entry, cur->data);
@@ -972,7 +972,7 @@ run_menu (grub_menu_t menu, int nested, int *auto_boot)
; ;
menu_fini (); menu_fini ();
goto refresh; goto refresh;
} }
} }
break; break;
case (GRUB_TERM_CTRL | 'd'): case (GRUB_TERM_CTRL | 'd'):
@@ -981,7 +981,7 @@ run_menu (grub_menu_t menu, int nested, int *auto_boot)
{ {
menu_fini (); menu_fini ();
g_ventoy_memdisk_mode = 1 - g_ventoy_memdisk_mode; g_ventoy_memdisk_mode = 1 - g_ventoy_memdisk_mode;
g_ventoy_menu_refresh = 1; g_ventoy_menu_refresh = 1;
goto refresh; goto refresh;
} }
break; break;
@@ -992,7 +992,7 @@ run_menu (grub_menu_t menu, int nested, int *auto_boot)
menu_fini (); menu_fini ();
g_ventoy_iso_raw = 1 - g_ventoy_iso_raw; g_ventoy_iso_raw = 1 - g_ventoy_iso_raw;
g_ventoy_menu_refresh = 1; g_ventoy_menu_refresh = 1;
goto refresh; goto refresh;
} }
break; break;
case (GRUB_TERM_CTRL | 'r'): case (GRUB_TERM_CTRL | 'r'):
@@ -1001,10 +1001,10 @@ run_menu (grub_menu_t menu, int nested, int *auto_boot)
{ {
menu_fini (); menu_fini ();
g_ventoy_grub2_mode = 1 - g_ventoy_grub2_mode; g_ventoy_grub2_mode = 1 - g_ventoy_grub2_mode;
g_ventoy_menu_refresh = 1; g_ventoy_menu_refresh = 1;
goto refresh; goto refresh;
} }
break; break;
case (GRUB_TERM_CTRL | 'w'): case (GRUB_TERM_CTRL | 'w'):
case 'w': case 'w':
if (0 == g_ventoy_secondary_menu_on) if (0 == g_ventoy_secondary_menu_on)
@@ -1039,7 +1039,7 @@ run_menu (grub_menu_t menu, int nested, int *auto_boot)
case 'm': case 'm':
{ {
if (0 == g_ventoy_secondary_menu_on) if (0 == g_ventoy_secondary_menu_on)
{ {
if (g_ventoy_cur_img_path) if (g_ventoy_cur_img_path)
{ {
grub_env_set("VTOY_CHKSUM_FILE_PATH", g_ventoy_cur_img_path); grub_env_set("VTOY_CHKSUM_FILE_PATH", g_ventoy_cur_img_path);
@@ -1128,16 +1128,17 @@ static struct grub_menu_execute_callback execution_callback =
static grub_err_t static grub_err_t
show_menu (grub_menu_t menu, int nested, int autobooted) show_menu (grub_menu_t menu, int nested, int autobooted)
{ {
const char *def; const char *def;
def = grub_env_get("VTOY_DEFAULT_IMAGE"); def = grub_env_get("VTOY_DEFAULT_IMAGE");
while (1) while (1)
{ {
int ndown; int ndown;
char *pos = NULL;
int boot_entry; int boot_entry;
grub_menu_entry_t e; grub_menu_entry_t e;
int auto_boot; int auto_boot;
boot_entry = run_menu (menu, nested, &auto_boot); boot_entry = run_menu (menu, nested, &auto_boot);
if (boot_entry < 0) if (boot_entry < 0)
break; break;
@@ -1149,7 +1150,7 @@ show_menu (grub_menu_t menu, int nested, int autobooted)
if (autobooted == 0 && auto_boot == 0) { if (autobooted == 0 && auto_boot == 0) {
g_ventoy_last_entry = boot_entry; g_ventoy_last_entry = boot_entry;
if (g_ventoy_menu_esc) if (g_ventoy_menu_esc)
break; break;
} }
if (autobooted == 0 && g_ventoy_menu_esc && auto_boot) { if (autobooted == 0 && g_ventoy_menu_esc && auto_boot) {
@@ -1162,7 +1163,7 @@ show_menu (grub_menu_t menu, int nested, int autobooted)
continue; /* Menu is empty. */ continue; /* Menu is empty. */
if (2 == e->argc && e->args && e->args[1] && grub_strncmp(e->args[1], "VTOY_RET", 8) == 0) if (2 == e->argc && e->args && e->args[1] && grub_strncmp(e->args[1], "VTOY_RET", 8) == 0)
break; break;
grub_cls (); grub_cls ();
@@ -1175,16 +1176,29 @@ show_menu (grub_menu_t menu, int nested, int autobooted)
break; break;
if (2 == e->argc && e->args && e->args[1] && grub_strncmp(e->args[1], "VTOY_RUN_RET", 12) == 0) if (2 == e->argc && e->args && e->args[1] && grub_strncmp(e->args[1], "VTOY_RUN_RET", 12) == 0)
break; break;
else if (2 == e->argc && e->args && e->args[1] && grub_strncmp(e->args[1], "VTOY_RUN_SET", 12) == 0) { else if (2 == e->argc && e->args && e->args[1] && grub_strncmp(e->args[1], "VTOY_RUN_SET_", 13) == 0) {
ndown = (int)grub_strtol(e->args[1] + 12, NULL, 10); pos = NULL;
ndown = (int)grub_strtol(e->args[1] + 13, &pos, 10);
while (ndown > 0) while (ndown > 0)
{ {
ventoy_menu_push_key(GRUB_TERM_KEY_DOWN); ventoy_menu_push_key(GRUB_TERM_KEY_DOWN);
ndown--; ndown--;
} }
ventoy_menu_push_key('\n'); ventoy_menu_push_key('\n');
break;
if (pos && *pos == '_')
{
ndown = (int)grub_strtol(pos + 1, NULL, 10);
while (ndown > 0)
{
ventoy_menu_push_key(GRUB_TERM_KEY_DOWN);
ndown--;
}
}
break;
} }
} }
+187 -42
View File
@@ -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/>.
* *
@@ -49,6 +49,10 @@ int g_ventoy_debug = 0;
static int g_efi_os = 0xFF; static int g_efi_os = 0xFF;
grub_uint32_t g_ventoy_plat_data; grub_uint32_t g_ventoy_plat_data;
#ifdef GRUB_MACHINE_EFI
static VTOY_SHIM *g_vtoy_shim = NULL;
#endif
void ventoy_debug(const char *fmt, ...) void ventoy_debug(const char *fmt, ...)
{ {
va_list args; va_list args;
@@ -137,7 +141,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 +172,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 +189,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 +239,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 +252,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 +294,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);
@@ -298,9 +302,152 @@ void ventoy_memfile_env_set(const char *prefix, const void *buf, unsigned long l
return; return;
} }
#ifdef GRUB_MACHINE_EFI
static void ventoy_get_uefi_version(char *str, grub_size_t len)
{
grub_efi_uint8_t uefi_minor_1, uefi_minor_2;
uefi_minor_1 = (grub_efi_system_table->hdr.revision & 0xffff) / 10;
uefi_minor_2 = (grub_efi_system_table->hdr.revision & 0xffff) % 10;
grub_snprintf(str, len, "%d.%d", (grub_efi_system_table->hdr.revision >> 16), uefi_minor_1);
if (uefi_minor_2)
grub_snprintf(str, len, "%s.%d", str, uefi_minor_2);
}
static void ventoy_get_pi_version(char *str, grub_size_t len)
{
grub_uint32_t data = 0;
grub_efi_uintn_t i = 0;
grub_efi_guid_t dxest =
{ 0x05ad34ba, 0x6f02, 0x4214, {0x95, 0x2e, 0x4d, 0xa0, 0x39, 0x8e, 0x2b, 0xb9 } };
for (i = 0; i < grub_efi_system_table->num_table_entries; i++)
{
if (grub_memcmp(&dxest, &grub_efi_system_table->configuration_table[i].vendor_guid, 16) == 0)
{
grub_memcpy(&data, (char *)grub_efi_system_table->configuration_table[i].vendor_table + 8, 4);
break;
}
}
grub_snprintf(str, len, "%d.%d", (data >> 16) & 0xFFFF, (data & 0xFFFF) / 10);
}
int ventoy_set_sb_policy(void)
{
const char *env = NULL;
static int set_once = 0;
/* no need when SecureBoot is disabled */
if (g_sys_sb == 0)
{
return 0;
}
/* can only set once */
if (set_once > 0)
{
return 0;
}
set_once = 1;
/* VTOY_SECURE_BOOT_POLICY only take affect once during init */
env = grub_env_get("VTOY_SECURE_BOOT_POLICY");
if (env)
{
g_sb_policy = (grub_uint8_t)(env[0] - '0');
}
if (g_sb_policy == VTOY_SB_POLICY_BYPASS)
{
if (g_vtoy_shim && g_vtoy_shim->ByPassSB)
{
g_vtoy_shim->ByPassSB();
}
}
else if (g_sb_policy == VTOY_SB_POLICY_CHECK)
{
if (g_vtoy_shim && g_vtoy_shim->CheckSB)
{
g_vtoy_shim->CheckSB();
}
}
return 0;
}
static void ventoy_get_uefi_sb(void)
{
grub_uint8_t secure_boot = 0;
grub_uint8_t setup_mode = 0;
grub_uint8_t *var = NULL;
grub_size_t size = 0;
grub_efi_guid_t global = GRUB_EFI_GLOBAL_VARIABLE_GUID;
var = grub_efi_get_variable("SecureBoot", &global, &size);
if (var && size == 1 && *var == 1)
{
secure_boot = 1;
}
grub_check_free(var);
size = 0;
var = grub_efi_get_variable("SetupMode", &global, &size);
if (var && size == 1 && *var == 1)
{
setup_mode = 1;
}
if (secure_boot == 1 && setup_mode == 0)
{
g_sys_sb = 1;
}
grub_check_free(var);
}
static int ventoy_secure_boot_init(void)
{
grub_efi_guid_t ProtGuid = VTOY_SHIM_POLICY_GUID;
ventoy_get_uefi_sb();
if (g_sys_sb == 0)
{
return 0;
}
if (g_ventoy_plat_data == VTOY_PLAT_X86_64_UEFI)
{
g_vtoy_shim = grub_efi_locate_protocol(&ProtGuid, NULL);
if (g_vtoy_shim == NULL || g_vtoy_shim->ByPassSB == NULL ||
g_vtoy_shim->CheckSB == NULL || g_vtoy_shim->Launched == NULL)
{
/*
* Generally when SecureBoot enabled, Ventoy grub must be launched by Ventoy Shim.
* But there are some exceptions:
* 1. Ventoy key was enrolled directly to the UEFI DB
* 2. Some UEFI firmware (MSI) has Image Execution Policy as Always Execute which
* means Secure Boot is effectively disabled.
*/
}
else
{
g_vtoy_shim->Launched();
}
}
return 0;
}
#endif
static int ventoy_arch_mode_init(void) static int ventoy_arch_mode_init(void)
{ {
#ifdef GRUB_MACHINE_EFI #ifdef GRUB_MACHINE_EFI
if (grub_strcmp(GRUB_TARGET_CPU, "i386") == 0) if (grub_strcmp(GRUB_TARGET_CPU, "i386") == 0)
{ {
g_ventoy_plat_data = VTOY_PLAT_I386_UEFI; g_ventoy_plat_data = VTOY_PLAT_I386_UEFI;
@@ -329,19 +476,6 @@ static int ventoy_arch_mode_init(void)
return 0; return 0;
} }
#ifdef GRUB_MACHINE_EFI
static void ventoy_get_uefi_version(char *str, grub_size_t len)
{
grub_efi_uint8_t uefi_minor_1, uefi_minor_2;
uefi_minor_1 = (grub_efi_system_table->hdr.revision & 0xffff) / 10;
uefi_minor_2 = (grub_efi_system_table->hdr.revision & 0xffff) % 10;
grub_snprintf(str, len, "%d.%d", (grub_efi_system_table->hdr.revision >> 16), uefi_minor_1);
if (uefi_minor_2)
grub_snprintf(str, len, "%s.%d", str, uefi_minor_2);
}
#endif
static int ventoy_calc_totalmem(grub_uint64_t addr, grub_uint64_t size, grub_memory_type_t type, void *data) static int ventoy_calc_totalmem(grub_uint64_t addr, grub_uint64_t size, grub_memory_type_t type, void *data)
{ {
grub_uint64_t *total_mem = (grub_uint64_t *)data; grub_uint64_t *total_mem = (grub_uint64_t *)data;
@@ -367,14 +501,18 @@ static int ventoy_hwinfo_init(void)
#ifdef GRUB_MACHINE_EFI #ifdef GRUB_MACHINE_EFI
ventoy_get_uefi_version(str, sizeof(str)); ventoy_get_uefi_version(str, sizeof(str));
ventoy_env_export("grub_uefi_version", str); ventoy_env_export("grub_uefi_version", str);
ventoy_get_pi_version(str, sizeof(str));
ventoy_env_export("grub_pi_version", str);
#else #else
ventoy_env_export("grub_uefi_version", "NA"); ventoy_env_export("grub_uefi_version", "NA");
ventoy_env_export("grub_pi_version", "NA");
#endif #endif
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,20 +560,21 @@ 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" },
{ NULL, 0 } { "VTOY_WIN_UEFI_RES_LOCK", "3" },
{ NULL, "" }
}; };
static const char * ventoy_ctrl_var_read_hook(struct grub_env_var *var, const char *val) static const char * ventoy_ctrl_var_read_hook(struct grub_env_var *var, const char *val)
@@ -446,7 +585,7 @@ static const char * ventoy_ctrl_var_read_hook(struct grub_env_var *var, const ch
{ {
if (grub_strcmp(g_ctrl_vars[i].name, var->name) == 0) if (grub_strcmp(g_ctrl_vars[i].name, var->name) == 0)
{ {
return g_ctrl_vars[i].value ? "1" : "0"; return g_ctrl_vars[i].szval;
} }
} }
@@ -461,14 +600,14 @@ static char * ventoy_ctrl_var_write_hook(struct grub_env_var *var, const char *v
{ {
if (grub_strcmp(g_ctrl_vars[i].name, var->name) == 0) if (grub_strcmp(g_ctrl_vars[i].name, var->name) == 0)
{ {
if (val && val[0] == '1' && val[1] == 0) if (val && grub_isdigit(val[0]) && val[1] == 0)
{ {
g_ctrl_vars[i].value = 1; g_ctrl_vars[i].szval[0] = val[0];
return grub_strdup("1"); return grub_strdup(val);
} }
else else
{ {
g_ctrl_vars[i].value = 0; g_ctrl_vars[i].szval[0] = '0';
return grub_strdup("0"); return grub_strdup("0");
} }
} }
@@ -479,12 +618,13 @@ static char * ventoy_ctrl_var_write_hook(struct grub_env_var *var, const char *v
int ventoy_ctrl_var_init(void) int ventoy_ctrl_var_init(void)
{ {
int i; ctrl_var_cfg *cfg = g_ctrl_vars;
for (i = 0; g_ctrl_vars[i].name; i++) while (cfg->name)
{ {
ventoy_env_export(g_ctrl_vars[i].name, g_ctrl_vars[i].value ? "1" : "0"); ventoy_env_export(cfg->name, cfg->szval);
grub_register_variable_hook(g_ctrl_vars[i].name, ventoy_ctrl_var_read_hook, ventoy_ctrl_var_write_hook); grub_register_variable_hook(cfg->name, ventoy_ctrl_var_read_hook, ventoy_ctrl_var_write_hook);
cfg++;
} }
return 0; return 0;
@@ -495,6 +635,11 @@ GRUB_MOD_INIT(ventoy)
ventoy_hwinfo_init(); ventoy_hwinfo_init();
ventoy_env_init(); ventoy_env_init();
ventoy_arch_mode_init(); ventoy_arch_mode_init();
#ifdef GRUB_MACHINE_EFI
ventoy_secure_boot_init();
#endif
ventoy_register_all_cmd(); ventoy_register_all_cmd();
} }
File diff suppressed because it is too large Load Diff
@@ -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/>.
* *
@@ -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)
@@ -141,7 +142,7 @@ typedef enum VTOY_FILE_FLT
VTOY_FILE_FLT_IMG, /* .img */ VTOY_FILE_FLT_IMG, /* .img */
VTOY_FILE_FLT_VHD, /* .vhd(x) */ VTOY_FILE_FLT_VHD, /* .vhd(x) */
VTOY_FILE_FLT_VTOY, /* .vtoy */ VTOY_FILE_FLT_VTOY, /* .vtoy */
VTOY_FILE_FLT_BUTT VTOY_FILE_FLT_BUTT
}VTOY_FILE_FLT; }VTOY_FILE_FLT;
@@ -159,7 +160,7 @@ typedef struct cmd_para
grub_extcmd_func_t func; grub_extcmd_func_t func;
grub_command_flags_t flags; grub_command_flags_t flags;
const struct grub_arg_option *parser; const struct grub_arg_option *parser;
const char *summary; const char *summary;
const char *description; const char *description;
@@ -170,7 +171,7 @@ typedef struct cmd_para
#define ventoy_align(value, align) (((value) + ((align) - 1)) & (~((align) - 1))) #define ventoy_align(value, align) (((value) + ((align) - 1)) & (~((align) - 1)))
#pragma pack(1) #pragma pack(1)
typedef struct cpio_newc_header typedef struct cpio_newc_header
{ {
char c_magic[6]; char c_magic[6];
char c_ino[8]; char c_ino[8];
@@ -194,6 +195,18 @@ typedef struct cpio_newc_header
#define check_free(p, func) if (p) { func(p); p = NULL; } #define check_free(p, func) if (p) { func(p); p = NULL; }
#define grub_check_free(p) if (p) { grub_free(p); p = NULL; } #define grub_check_free(p) if (p) { grub_free(p); p = NULL; }
#define VTOY_SHIM_POLICY_GUID {0x90a29d14, 0x3968, 0x48fe, { 0x85, 0x81, 0x6b, 0x7f, 0x7d, 0xc4, 0x70, 0x55 }};
typedef void (*VTOY_BYPASS_SB)(void);
typedef void (*VTOY_CHECK_SB)(void);
typedef void (*VTOY_LAUNCHED)(void);
typedef struct _VTOY_SHIM{
VTOY_BYPASS_SB ByPassSB;
VTOY_CHECK_SB CheckSB;
VTOY_LAUNCHED Launched;
} VTOY_SHIM;
typedef int (*grub_char_check_func)(int c); typedef int (*grub_char_check_func)(int c);
#define ventoy_is_decimal(str) ventoy_string_check(str, grub_isdigit) #define ventoy_is_decimal(str) ventoy_string_check(str, grub_isdigit)
@@ -205,7 +218,7 @@ typedef struct ventoy_patch_vhd
grub_uint8_t part_offset_or_guid[16]; grub_uint8_t part_offset_or_guid[16];
grub_uint32_t reserved1; grub_uint32_t reserved1;
grub_uint32_t part_type; grub_uint32_t part_type;
grub_uint8_t disk_signature_or_guid[16]; grub_uint8_t disk_signature_or_guid[16];
grub_uint8_t reserved2[16]; grub_uint8_t reserved2[16];
grub_uint8_t vhd_file_path[1]; grub_uint8_t vhd_file_path[1];
}ventoy_patch_vhd; }ventoy_patch_vhd;
@@ -283,7 +296,7 @@ typedef struct img_info
const char *tip2; const char *tip2;
const char *class; const char *class;
const char *menu_prefix; const char *menu_prefix;
int id; int id;
int type; int type;
int plugin_list_index; int plugin_list_index;
@@ -312,8 +325,8 @@ typedef struct img_iterator_node
struct img_iterator_node *parent; struct img_iterator_node *parent;
struct img_iterator_node *firstchild; struct img_iterator_node *firstchild;
void *firstiso; void *firstiso;
}img_iterator_node; }img_iterator_node;
@@ -327,7 +340,7 @@ typedef struct initrd_info
grub_uint8_t iso_type; // 0: iso9660 1:udf grub_uint8_t iso_type; // 0: iso9660 1:udf
grub_uint32_t udf_start_block; grub_uint32_t udf_start_block;
grub_uint64_t override_offset; grub_uint64_t override_offset;
grub_uint32_t override_length; grub_uint32_t override_length;
char override_data[32]; char override_data[32];
@@ -396,7 +409,7 @@ void ventoy_debug(const char *fmt, ...);
#pragma pack(1) #pragma pack(1)
/* A WIM resource header */ /* A WIM resource header */
typedef struct wim_resource_header typedef struct wim_resource_header
{ {
grub_uint64_t size_in_wim:56; /* Compressed length */ grub_uint64_t size_in_wim:56; /* Compressed length */
grub_uint64_t flags:8; /* flags */ grub_uint64_t flags:8; /* flags */
@@ -408,7 +421,7 @@ typedef struct wim_resource_header
#define WIM_RESHDR_ZLEN_MASK 0x00ffffffffffffffULL #define WIM_RESHDR_ZLEN_MASK 0x00ffffffffffffffULL
/* WIM resource header flags */ /* WIM resource header flags */
typedef enum wim_resource_header_flags typedef enum wim_resource_header_flags
{ {
WIM_RESHDR_METADATA = ( 0x02ULL << 56 ), /* Resource contains metadata */ WIM_RESHDR_METADATA = ( 0x02ULL << 56 ), /* Resource contains metadata */
WIM_RESHDR_COMPRESSED = ( 0x04ULL << 56 ), /* Resource is compressed */ WIM_RESHDR_COMPRESSED = ( 0x04ULL << 56 ), /* Resource is compressed */
@@ -418,7 +431,7 @@ typedef enum wim_resource_header_flags
#define WIM_HEAD_SIGNATURE "MSWIM\0\0" #define WIM_HEAD_SIGNATURE "MSWIM\0\0"
/* WIM header */ /* WIM header */
typedef struct wim_header typedef struct wim_header
{ {
grub_uint8_t signature[8]; /* Signature */ grub_uint8_t signature[8]; /* Signature */
grub_uint32_t header_len; /* Header length */ grub_uint32_t header_len; /* Header length */
@@ -438,21 +451,21 @@ typedef struct wim_header
} wim_header; } wim_header;
/* WIM header flags */ /* WIM header flags */
typedef enum wim_header_flags typedef enum wim_header_flags
{ {
WIM_HDR_XPRESS = 0x00020000, /* WIM uses Xpress compresson */ WIM_HDR_XPRESS = 0x00020000, /* WIM uses Xpress compresson */
WIM_HDR_LZX = 0x00040000, /* WIM uses LZX compression */ WIM_HDR_LZX = 0x00040000, /* WIM uses LZX compression */
}wim_header_flags; }wim_header_flags;
/* A WIM file hash */ /* A WIM file hash */
typedef struct wim_hash typedef struct wim_hash
{ {
/* SHA-1 hash */ /* SHA-1 hash */
grub_uint8_t sha1[20]; grub_uint8_t sha1[20];
}wim_hash; }wim_hash;
/* A WIM lookup table entry */ /* A WIM lookup table entry */
typedef struct wim_lookup_entry typedef struct wim_lookup_entry
{ {
wim_resource_header resource; /* Resource header */ wim_resource_header resource; /* Resource header */
grub_uint16_t part; /* Part number */ grub_uint16_t part; /* Part number */
@@ -464,19 +477,19 @@ typedef struct wim_lookup_entry
#define WIM_CHUNK_LEN 32768 #define WIM_CHUNK_LEN 32768
/* A WIM chunk buffer */ /* A WIM chunk buffer */
typedef struct wim_chunk_buffer typedef struct wim_chunk_buffer
{ {
grub_uint8_t data[WIM_CHUNK_LEN]; /*Data */ grub_uint8_t data[WIM_CHUNK_LEN]; /*Data */
}wim_chunk_buffer; }wim_chunk_buffer;
/* Security data */ /* Security data */
typedef struct wim_security_header typedef struct wim_security_header
{ {
grub_uint32_t len; /* Length */ grub_uint32_t len; /* Length */
grub_uint32_t count; /* Number of entries */ grub_uint32_t count; /* Number of entries */
}wim_security_header; }wim_security_header;
typedef struct wim_stream_entry typedef struct wim_stream_entry
{ {
grub_uint64_t len; grub_uint64_t len;
grub_uint64_t unused1; grub_uint64_t unused1;
@@ -486,7 +499,7 @@ typedef struct wim_stream_entry
}wim_stream_entry; }wim_stream_entry;
/* Directory entry */ /* Directory entry */
typedef struct wim_directory_entry typedef struct wim_directory_entry
{ {
grub_uint64_t len; /* Length */ grub_uint64_t len; /* Length */
grub_uint32_t attributes; /* Attributes */ grub_uint32_t attributes; /* Attributes */
@@ -589,7 +602,7 @@ typedef struct _VTOY_JSON
struct _VTOY_JSON *pstChild; struct _VTOY_JSON *pstChild;
JSON_TYPE enDataType; JSON_TYPE enDataType;
union union
{ {
char *pcStrVal; char *pcStrVal;
int iNumVal; int iNumVal;
@@ -662,6 +675,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);
@@ -700,7 +714,7 @@ int vtoy_json_parse_value
( (
char *pcNewStart, char *pcNewStart,
char *pcRawStart, char *pcRawStart,
VTOY_JSON *pstJson, VTOY_JSON *pstJson,
const char *pcData, const char *pcData,
const char **ppcEnd const char **ppcEnd
); );
@@ -716,51 +730,51 @@ int vtoy_json_scan_parse
int vtoy_json_scan_array int vtoy_json_scan_array
( (
VTOY_JSON *pstJson, VTOY_JSON *pstJson,
const char *szKey, const char *szKey,
VTOY_JSON **ppstArrayItem VTOY_JSON **ppstArrayItem
); );
int vtoy_json_scan_array_ex int vtoy_json_scan_array_ex
( (
VTOY_JSON *pstJson, VTOY_JSON *pstJson,
const char *szKey, const char *szKey,
VTOY_JSON **ppstArrayItem VTOY_JSON **ppstArrayItem
); );
int vtoy_json_scan_object int vtoy_json_scan_object
( (
VTOY_JSON *pstJson, VTOY_JSON *pstJson,
const char *szKey, const char *szKey,
VTOY_JSON **ppstObjectItem VTOY_JSON **ppstObjectItem
); );
int vtoy_json_get_int int vtoy_json_get_int
( (
VTOY_JSON *pstJson, VTOY_JSON *pstJson,
const char *szKey, const char *szKey,
int *piValue int *piValue
); );
int vtoy_json_get_uint int vtoy_json_get_uint
( (
VTOY_JSON *pstJson, VTOY_JSON *pstJson,
const char *szKey, const char *szKey,
grub_uint32_t *puiValue grub_uint32_t *puiValue
); );
int vtoy_json_get_uint64 int vtoy_json_get_uint64
( (
VTOY_JSON *pstJson, VTOY_JSON *pstJson,
const char *szKey, const char *szKey,
grub_uint64_t *pui64Value grub_uint64_t *pui64Value
); );
int vtoy_json_get_bool int vtoy_json_get_bool
( (
VTOY_JSON *pstJson, VTOY_JSON *pstJson,
const char *szKey, const char *szKey,
grub_uint8_t *pbValue grub_uint8_t *pbValue
); );
int vtoy_json_get_string int vtoy_json_get_string
( (
VTOY_JSON *pstJson, VTOY_JSON *pstJson,
const char *szKey, const char *szKey,
grub_uint32_t uiBufLen, grub_uint32_t uiBufLen,
char *pcBuf char *pcBuf
); );
@@ -782,7 +796,7 @@ static inline int ventoy_isspace (int c)
static inline int ventoy_is_word_end(int c) static inline int ventoy_is_word_end(int c)
{ {
return (c == 0 || c == ',' || ventoy_isspace(c)); return (c == 0 || c == ',' || ventoy_isspace(c));
} }
#pragma pack(1) #pragma pack(1)
@@ -954,7 +968,7 @@ typedef struct persistence_config
int cursel; int cursel;
int backendnum; int backendnum;
file_fullpath *backendpath; file_fullpath *backendpath;
struct persistence_config *next; struct persistence_config *next;
}persistence_config; }persistence_config;
@@ -1279,6 +1293,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;
@@ -1293,7 +1308,7 @@ typedef struct global_var_cfg
typedef struct ctrl_var_cfg typedef struct ctrl_var_cfg
{ {
const char *name; const char *name;
int value; char szval[2];
}ctrl_var_cfg; }ctrl_var_cfg;
#define vtoy_check_goto_out(p) if (!p) goto out #define vtoy_check_goto_out(p) if (!p) goto out
@@ -1323,6 +1338,8 @@ int ventoy_ctrl_var_init(void);
int ventoy_global_var_init(void); int ventoy_global_var_init(void);
grub_err_t ventoy_cmd_push_menulang(grub_extcmd_context_t ctxt, int argc, char **args); grub_err_t ventoy_cmd_push_menulang(grub_extcmd_context_t ctxt, int argc, char **args);
grub_err_t ventoy_cmd_pop_menulang(grub_extcmd_context_t ctxt, int argc, char **args); grub_err_t ventoy_cmd_pop_menulang(grub_extcmd_context_t ctxt, int argc, char **args);
void ventoy_prompt_end(void);
int ventoy_set_sb_policy(void);
#endif /* __VENTOY_DEF_H__ */ #endif /* __VENTOY_DEF_H__ */
@@ -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);
File diff suppressed because it is too large Load Diff
@@ -1,5 +1,5 @@
/****************************************************************************** /******************************************************************************
* ventoy_unix.c * ventoy_unix.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/>.
* *
@@ -69,9 +69,9 @@ static int ventoy_get_file_override(const char *filename, grub_uint64_t *offset)
} }
*offset = grub_iso9660_get_last_file_dirent_pos(file) + 2; *offset = grub_iso9660_get_last_file_dirent_pos(file) + 2;
grub_file_close(file); grub_file_close(file);
return 0; return 0;
} }
@@ -83,12 +83,12 @@ static grub_uint32_t ventoy_unix_get_override_chunk_count(void)
{ {
count++; count++;
} }
if (g_mod_new_len > 0) if (g_mod_new_len > 0)
{ {
count++; count++;
} }
if (g_ko_fillmap_len > 0) if (g_ko_fillmap_len > 0)
{ {
count += (g_ko_fillmap_len / 512); count += (g_ko_fillmap_len / 512);
@@ -109,7 +109,7 @@ static grub_uint32_t ventoy_unix_get_virt_chunk_count(void)
{ {
count++; count++;
} }
if (g_mod_new_len > 0) if (g_mod_new_len > 0)
{ {
count++; count++;
@@ -127,7 +127,7 @@ static grub_uint32_t ventoy_unix_get_virt_chunk_size(void)
{ {
size += ventoy_align_2k(g_conf_new_len); size += ventoy_align_2k(g_conf_new_len);
} }
if (g_mod_new_len > 0) if (g_mod_new_len > 0)
{ {
size += ventoy_align_2k(g_mod_new_len); size += ventoy_align_2k(g_mod_new_len);
@@ -141,9 +141,9 @@ static void ventoy_unix_fill_map_data(ventoy_chain_head *chain, struct g_ventoy_
grub_uint32_t i; grub_uint32_t i;
ventoy_img_chunk *chunk = NULL; ventoy_img_chunk *chunk = NULL;
debug("Fill unix map data: <%llu> <%u> %p\n", debug("Fill unix map data: <%llu> <%u> %p\n",
(unsigned long long)chain->os_param.vtoy_disk_size, g_img_chunk_list.cur_chunk, map); (unsigned long long)chain->os_param.vtoy_disk_size, g_img_chunk_list.cur_chunk, map);
map->magic1[0] = map->magic2[0] = VENTOY_UNIX_SEG_MAGIC0; map->magic1[0] = map->magic2[0] = VENTOY_UNIX_SEG_MAGIC0;
map->magic1[1] = map->magic2[1] = VENTOY_UNIX_SEG_MAGIC1; map->magic1[1] = map->magic2[1] = VENTOY_UNIX_SEG_MAGIC1;
map->magic1[2] = map->magic2[2] = VENTOY_UNIX_SEG_MAGIC2; map->magic1[2] = map->magic2[2] = VENTOY_UNIX_SEG_MAGIC2;
@@ -158,12 +158,12 @@ static void ventoy_unix_fill_map_data(ventoy_chain_head *chain, struct g_ventoy_
debug("####[FAIL] Too many segments for the ISO file %u\n", g_img_chunk_list.cur_chunk); debug("####[FAIL] Too many segments for the ISO file %u\n", g_img_chunk_list.cur_chunk);
map->segnum = VENTOY_UNIX_MAX_SEGNUM; map->segnum = VENTOY_UNIX_MAX_SEGNUM;
} }
for (i = 0; i < (grub_uint32_t)(map->segnum); i++) for (i = 0; i < (grub_uint32_t)(map->segnum); i++)
{ {
chunk = g_img_chunk_list.chunk + i; chunk = g_img_chunk_list.chunk + i;
map->seglist[i].seg_start_bytes = chunk->disk_start_sector * 512ULL; map->seglist[i].seg_start_bytes = chunk->disk_start_sector * 512ULL;
map->seglist[i].seg_end_bytes = (chunk->disk_end_sector + 1) * 512ULL; map->seglist[i].seg_end_bytes = (chunk->disk_end_sector + 1) * 512ULL;
} }
} }
@@ -176,7 +176,7 @@ static void ventoy_unix_fill_override_data( grub_uint64_t isosize, ventoy_cha
grub_uint64_t sector; grub_uint64_t sector;
ventoy_override_chunk *cur; ventoy_override_chunk *cur;
ventoy_iso9660_override *dirent; ventoy_iso9660_override *dirent;
sector = (isosize + 2047) / 2048; sector = (isosize + 2047) / 2048;
cur = (ventoy_override_chunk *)((char *)chain + chain->override_chunk_offset); cur = (ventoy_override_chunk *)((char *)chain + chain->override_chunk_offset);
@@ -215,7 +215,7 @@ static void ventoy_unix_fill_override_data( grub_uint64_t isosize, ventoy_cha
offset = g_mod_override_offset; offset = g_mod_override_offset;
ventoy_unix_fill_map_data(chain, (struct g_ventoy_map *)data); ventoy_unix_fill_map_data(chain, (struct g_ventoy_map *)data);
for (i = 0; i < g_ko_fillmap_len / 512; i++) for (i = 0; i < g_ko_fillmap_len / 512; i++)
{ {
cur->img_offset = offset; cur->img_offset = offset;
@@ -252,7 +252,7 @@ static void ventoy_unix_fill_virt_data( grub_uint64_t isosize, ventoy_chain_h
override = (char *)chain + chain->virt_chunk_offset; override = (char *)chain + chain->virt_chunk_offset;
cur = (ventoy_virt_chunk *)override; cur = (ventoy_virt_chunk *)override;
sector = (isosize + 2047) / 2048; sector = (isosize + 2047) / 2048;
offset = 2 * sizeof(ventoy_virt_chunk); offset = 2 * sizeof(ventoy_virt_chunk);
@@ -267,10 +267,10 @@ static void ventoy_unix_fill_virt_data( grub_uint64_t isosize, ventoy_chain_h
{ {
ventoy_unix_fill_map_data(chain, (struct g_ventoy_map *)(g_mod_new_data + g_mod_search_magic)); ventoy_unix_fill_map_data(chain, (struct g_ventoy_map *)(g_mod_new_data + g_mod_search_magic));
} }
ventoy_unix_fill_virt(g_mod_new_data, g_mod_new_len); ventoy_unix_fill_virt(g_mod_new_data, g_mod_new_len);
} }
return; return;
} }
@@ -287,7 +287,7 @@ static int ventoy_freebsd_append_conf(char *buf, const char *isopath, const char
grub_uint8_t disk_guid[16]; grub_uint8_t disk_guid[16];
debug("ventoy_freebsd_append_conf %s\n", isopath); debug("ventoy_freebsd_append_conf %s\n", isopath);
isofile = ventoy_grub_file_open(VENTOY_FILE_TYPE, "%s", isopath); isofile = ventoy_grub_file_open(VENTOY_FILE_TYPE, "%s", isopath);
if (!isofile) if (!isofile)
{ {
@@ -296,7 +296,7 @@ static int ventoy_freebsd_append_conf(char *buf, const char *isopath, const char
vtoy_ssprintf(buf, pos, "ventoy_load=\"%s\"\n", "YES"); vtoy_ssprintf(buf, pos, "ventoy_load=\"%s\"\n", "YES");
vtoy_ssprintf(buf, pos, "ventoy_name=\"%s\"\n", g_ko_mod_path); vtoy_ssprintf(buf, pos, "ventoy_name=\"%s\"\n", g_ko_mod_path);
if (alias) if (alias)
{ {
vtoy_ssprintf(buf, pos, "hint.ventoy.0.alias=\"%s\"\n", alias); vtoy_ssprintf(buf, pos, "hint.ventoy.0.alias=\"%s\"\n", alias);
@@ -320,7 +320,7 @@ static int ventoy_freebsd_append_conf(char *buf, const char *isopath, const char
} }
debug("Fill hint.ventoy info\n"); debug("Fill hint.ventoy info\n");
disk = isofile->device->disk; disk = isofile->device->disk;
ventoy_get_disk_guid(isofile->name, disk_guid, disk_sig); ventoy_get_disk_guid(isofile->name, disk_guid, disk_sig);
@@ -338,7 +338,7 @@ static int ventoy_freebsd_append_conf(char *buf, const char *isopath, const char
for (i = 0; i < g_img_chunk_list.cur_chunk; i++) for (i = 0; i < g_img_chunk_list.cur_chunk; i++)
{ {
chunk = g_img_chunk_list.chunk + i; chunk = g_img_chunk_list.chunk + i;
vtoy_ssprintf(buf, pos, "hint.ventoy.%u.seg=\"0x%llx@0x%llx\"\n", vtoy_ssprintf(buf, pos, "hint.ventoy.%u.seg=\"0x%llx@0x%llx\"\n",
i, (ulonglong)(chunk->disk_start_sector * 512), i, (ulonglong)(chunk->disk_start_sector * 512),
(ulonglong)((chunk->disk_end_sector + 1) * 512)); (ulonglong)((chunk->disk_end_sector + 1) * 512));
} }
@@ -368,7 +368,7 @@ grub_err_t ventoy_cmd_unix_reset(grub_extcmd_context_t ctxt, int argc, char **ar
(void)ctxt; (void)ctxt;
(void)argc; (void)argc;
(void)args; (void)args;
g_unix_vlnk_boot = 0; g_unix_vlnk_boot = 0;
g_mod_search_magic = 0; g_mod_search_magic = 0;
g_conf_new_len = 0; g_conf_new_len = 0;
@@ -411,7 +411,7 @@ grub_err_t ventoy_cmd_parse_freenas_ver(grub_extcmd_context_t ctxt, int argc, ch
const char *ver = NULL; const char *ver = NULL;
char *buf = NULL; char *buf = NULL;
VTOY_JSON *json = NULL; VTOY_JSON *json = NULL;
(void)ctxt; (void)ctxt;
(void)argc; (void)argc;
@@ -472,7 +472,7 @@ grub_err_t ventoy_cmd_unix_freebsd_ver(grub_extcmd_context_t ctxt, int argc, cha
char *buf; char *buf;
char *start = NULL; char *start = NULL;
char *nextline = NULL; char *nextline = NULL;
(void)ctxt; (void)ctxt;
(void)argc; (void)argc;
(void)args; (void)args;
@@ -502,7 +502,7 @@ grub_err_t ventoy_cmd_unix_freebsd_ver(grub_extcmd_context_t ctxt, int argc, cha
nextline++; nextline++;
} }
*nextline = 0; *nextline = 0;
break; break;
} }
nextline = ventoy_get_line(start); nextline = ventoy_get_line(start);
@@ -521,25 +521,162 @@ grub_err_t ventoy_cmd_unix_freebsd_ver(grub_extcmd_context_t ctxt, int argc, cha
grub_free(buf); grub_free(buf);
grub_file_close(file); grub_file_close(file);
VENTOY_CMD_RETURN(GRUB_ERR_NONE); VENTOY_CMD_RETURN(GRUB_ERR_NONE);
} }
static int ventoy_freebsd_ver_elf(int bit64, grub_elf_t elf, const char *section, const char *env, char *data)
{
int j = 0;
int k = 0;
int ret = 1;
char *str = NULL;
void *hdr = NULL;
grub_off_t offset = 0;
grub_uint32_t len = 0;
char ver[64] = {0};
if (bit64)
{
Elf64_Ehdr *e = &(elf->ehdr.ehdr64);
Elf64_Shdr *h;
Elf64_Shdr *s;
Elf64_Shdr *t;
Elf64_Half i;
h = hdr = grub_zalloc(e->e_shnum * e->e_shentsize);
if (!h)
{
goto out;
}
debug("read section header %u %u %u\n", e->e_shnum, e->e_shentsize, e->e_shstrndx);
grub_file_seek(elf->file, e->e_shoff);
grub_file_read(elf->file, h, e->e_shnum * e->e_shentsize);
s = (Elf64_Shdr *)((char *)h + e->e_shstrndx * e->e_shentsize);
str = grub_malloc(s->sh_size + 1);
if (!str)
{
goto out;
}
str[s->sh_size] = 0;
debug("read string table %u %u\n", (grub_uint32_t)s->sh_offset, (grub_uint32_t)s->sh_size);
grub_file_seek(elf->file, s->sh_offset);
grub_file_read(elf->file, str, s->sh_size);
for (t = h, i = 0; i < e->e_shnum; i++)
{
if (grub_strcmp(str + t->sh_name, section) == 0)
{
offset = t->sh_offset;
len = t->sh_size;
debug("find %s section at %u %u\n", section, (grub_uint32_t)offset, len);
break;
}
t = (Elf64_Shdr *)((char *)t + e->e_shentsize);
}
}
else
{
Elf32_Ehdr *e = &(elf->ehdr.ehdr32);
Elf32_Shdr *h;
Elf32_Shdr *s;
Elf32_Shdr *t;
Elf32_Half i;
h = hdr = grub_zalloc(e->e_shnum * e->e_shentsize);
if (!h)
{
goto out;
}
debug("read section header %u %u %u\n", e->e_shnum, e->e_shentsize, e->e_shstrndx);
grub_file_seek(elf->file, e->e_shoff);
grub_file_read(elf->file, h, e->e_shnum * e->e_shentsize);
s = (Elf32_Shdr *)((char *)h + e->e_shstrndx * e->e_shentsize);
str = grub_malloc(s->sh_size + 1);
if (!str)
{
goto out;
}
str[s->sh_size] = 0;
debug("read string table %u %u\n", (grub_uint32_t)s->sh_offset, (grub_uint32_t)s->sh_size);
grub_file_seek(elf->file, s->sh_offset);
grub_file_read(elf->file, str, s->sh_size);
for (t = h, i = 0; i < e->e_shnum; i++)
{
if (grub_strcmp(str + t->sh_name, section) == 0)
{
offset = t->sh_offset;
len = t->sh_size;
debug("find %s section at %u %u\n", section, (grub_uint32_t)offset, len);
break;
}
t = (Elf32_Shdr *)((char *)t + e->e_shentsize);
}
}
if (offset == 0 || len == 0)
{
debug("%s section not found\n", section);
goto out;
}
grub_file_seek(elf->file, offset + len - 8192);
grub_file_read(elf->file, data, 8192);
for (j = 0; j < 8192 - 12; j++)
{
if (grub_strncmp(data + j, "@(#)FreeBSD ", 12) == 0)
{
for (k = j + 12; k < 8192; k++)
{
if (0 == grub_isdigit(data[k]) && data[k] != '.')
{
data[k] = 0;
break;
}
}
grub_snprintf(ver, sizeof(ver), "%s", data + j + 12);
break;
}
}
if (ver[0])
{
k = (int)grub_strtoul(ver, NULL, 10);
debug("%s freebsd version:<%s> <%d.x>\n", section, ver, k);
grub_snprintf(ver, sizeof(ver), "%d.x", k);
ventoy_set_env(env, ver);
ret = 0;
}
else
{
debug("%s freebsd version:<%s>\n", section, "NOT FOUND");
ret = 1;
}
out:
grub_check_free(str);
grub_check_free(hdr);
return ret;
}
grub_err_t ventoy_cmd_unix_freebsd_ver_elf(grub_extcmd_context_t ctxt, int argc, char **args) grub_err_t ventoy_cmd_unix_freebsd_ver_elf(grub_extcmd_context_t ctxt, int argc, char **args)
{ {
int j; int ret = 0;
int k; int bit64 = 0;
grub_elf_t elf = NULL;
grub_off_t offset = 0;
grub_uint32_t len = 0;
char *str = NULL;
char *data = NULL; char *data = NULL;
void *hdr = NULL; grub_elf_t elf = NULL;
char ver[64] = {0};
(void)ctxt; (void)ctxt;
(void)argc;
(void)args;
if (argc != 3) if (argc != 3)
{ {
@@ -560,136 +697,18 @@ grub_err_t ventoy_cmd_unix_freebsd_ver_elf(grub_extcmd_context_t ctxt, int argc,
goto out; goto out;
} }
if (args[1][0] == '6') bit64 = (args[1][0] == '6') ? 1 : 0;
ret = ventoy_freebsd_ver_elf(bit64, elf, ".data", args[2], data);
if (ret != 0)
{ {
Elf64_Ehdr *e = &(elf->ehdr.ehdr64); ret = ventoy_freebsd_ver_elf(bit64, elf, ".rodata", args[2], data);
Elf64_Shdr *h;
Elf64_Shdr *s;
Elf64_Shdr *t;
Elf64_Half i;
h = hdr = grub_zalloc(e->e_shnum * e->e_shentsize);
if (!h)
{
goto out;
}
debug("read section header %u %u %u\n", e->e_shnum, e->e_shentsize, e->e_shstrndx);
grub_file_seek(elf->file, e->e_shoff);
grub_file_read(elf->file, h, e->e_shnum * e->e_shentsize);
s = (Elf64_Shdr *)((char *)h + e->e_shstrndx * e->e_shentsize);
str = grub_malloc(s->sh_size + 1);
if (!str)
{
goto out;
}
str[s->sh_size] = 0;
debug("read string table %u %u\n", (grub_uint32_t)s->sh_offset, (grub_uint32_t)s->sh_size);
grub_file_seek(elf->file, s->sh_offset);
grub_file_read(elf->file, str, s->sh_size);
for (t = h, i = 0; i < e->e_shnum; i++)
{
if (grub_strcmp(str + t->sh_name, ".data") == 0)
{
offset = t->sh_offset;
len = t->sh_size;
debug("find .data section at %u %u\n", (grub_uint32_t)offset, len);
break;
}
t = (Elf64_Shdr *)((char *)t + e->e_shentsize);
}
}
else
{
Elf32_Ehdr *e = &(elf->ehdr.ehdr32);
Elf32_Shdr *h;
Elf32_Shdr *s;
Elf32_Shdr *t;
Elf32_Half i;
h = hdr = grub_zalloc(e->e_shnum * e->e_shentsize);
if (!h)
{
goto out;
}
debug("read section header %u %u %u\n", e->e_shnum, e->e_shentsize, e->e_shstrndx);
grub_file_seek(elf->file, e->e_shoff);
grub_file_read(elf->file, h, e->e_shnum * e->e_shentsize);
s = (Elf32_Shdr *)((char *)h + e->e_shstrndx * e->e_shentsize);
str = grub_malloc(s->sh_size + 1);
if (!str)
{
goto out;
}
str[s->sh_size] = 0;
debug("read string table %u %u\n", (grub_uint32_t)s->sh_offset, (grub_uint32_t)s->sh_size);
grub_file_seek(elf->file, s->sh_offset);
grub_file_read(elf->file, str, s->sh_size);
for (t = h, i = 0; i < e->e_shnum; i++)
{
if (grub_strcmp(str + t->sh_name, ".data") == 0)
{
offset = t->sh_offset;
len = t->sh_size;
debug("find .data section at %u %u\n", (grub_uint32_t)offset, len);
break;
}
t = (Elf32_Shdr *)((char *)t + e->e_shentsize);
}
}
if (offset == 0 || len == 0)
{
debug(".data section not found %s\n", args[0]);
goto out;
}
grub_file_seek(elf->file, offset + len - 8192);
grub_file_read(elf->file, data, 8192);
for (j = 0; j < 8192 - 12; j++)
{
if (grub_strncmp(data + j, "@(#)FreeBSD ", 12) == 0)
{
for (k = j + 12; k < 8192; k++)
{
if (0 == grub_isdigit(data[k]) && data[k] != '.')
{
data[k] = 0;
break;
}
}
grub_snprintf(ver, sizeof(ver), "%s", data + j + 12);
break;
}
}
if (ver[0])
{
k = (int)grub_strtoul(ver, NULL, 10);
debug("freebsd version:<%s> <%d.x>\n", ver, k);
grub_snprintf(ver, sizeof(ver), "%d.x", k);
ventoy_set_env(args[2], ver);
}
else
{
debug("freebsd version:<%s>\n", "NOT FOUND");
} }
out: out:
grub_check_free(str);
grub_check_free(hdr);
grub_check_free(data); grub_check_free(data);
check_free(elf, grub_elf_close); check_free(elf, grub_elf_close);
VENTOY_CMD_RETURN(GRUB_ERR_NONE); VENTOY_CMD_RETURN(GRUB_ERR_NONE);
} }
@@ -704,7 +723,7 @@ grub_err_t ventoy_cmd_unix_replace_grub_conf(grub_extcmd_context_t ctxt, int arg
grub_file_t file; grub_file_t file;
char extcfg[512]; char extcfg[512];
const char *confile = NULL; const char *confile = NULL;
const char * loader_conf[] = const char * loader_conf[] =
{ {
"/boot/grub/grub.cfg", "/boot/grub/grub.cfg",
}; };
@@ -716,7 +735,7 @@ grub_err_t ventoy_cmd_unix_replace_grub_conf(grub_extcmd_context_t ctxt, int arg
debug("Replace conf invalid argc %d\n", argc); debug("Replace conf invalid argc %d\n", argc);
return 1; return 1;
} }
for (i = 0; i < sizeof(loader_conf) / sizeof(loader_conf[0]); i++) for (i = 0; i < sizeof(loader_conf) / sizeof(loader_conf[0]); i++)
{ {
if (ventoy_get_file_override(loader_conf[i], &offset) == 0) if (ventoy_get_file_override(loader_conf[i], &offset) == 0)
@@ -728,7 +747,7 @@ grub_err_t ventoy_cmd_unix_replace_grub_conf(grub_extcmd_context_t ctxt, int arg
} }
if (confile == NULL) if (confile == NULL)
{ {
debug("Can't find grub.cfg file from %u locations\n", i); debug("Can't find grub.cfg file from %u locations\n", i);
return 1; return 1;
} }
@@ -745,13 +764,13 @@ grub_err_t ventoy_cmd_unix_replace_grub_conf(grub_extcmd_context_t ctxt, int arg
data = grub_malloc(VTOY_MAX_SCRIPT_BUF); data = grub_malloc(VTOY_MAX_SCRIPT_BUF);
if (!data) if (!data)
{ {
grub_file_close(file); grub_file_close(file);
return 1; return 1;
} }
grub_file_read(file, data, file->size); grub_file_read(file, data, file->size);
grub_file_close(file); grub_file_close(file);
g_conf_new_data = data; g_conf_new_data = data;
g_conf_new_len = (int)file->size; g_conf_new_len = (int)file->size;
@@ -783,7 +802,7 @@ grub_err_t ventoy_cmd_unix_replace_grub_conf(grub_extcmd_context_t ctxt, int arg
{ {
vtoy_ssprintf(extcfg, len, ";set kFreeBSD.hint.ventoy.0.remount=%d", 1); vtoy_ssprintf(extcfg, len, ";set kFreeBSD.hint.ventoy.0.remount=%d", 1);
} }
grub_memmove(pos + len, pos, (int)(file->size - (pos - data))); grub_memmove(pos + len, pos, (int)(file->size - (pos - data)));
grub_memcpy(pos, extcfg, len); grub_memcpy(pos, extcfg, len);
g_conf_new_len += len; g_conf_new_len += len;
@@ -792,7 +811,7 @@ grub_err_t ventoy_cmd_unix_replace_grub_conf(grub_extcmd_context_t ctxt, int arg
{ {
debug("no kfreebsd found\n"); debug("no kfreebsd found\n");
} }
VENTOY_CMD_RETURN(GRUB_ERR_NONE); VENTOY_CMD_RETURN(GRUB_ERR_NONE);
} }
@@ -803,7 +822,7 @@ grub_err_t ventoy_cmd_unix_replace_conf(grub_extcmd_context_t ctxt, int argc, ch
grub_uint64_t offset; grub_uint64_t offset;
grub_file_t file; grub_file_t file;
const char *confile = NULL; const char *confile = NULL;
const char * loader_conf[] = const char * loader_conf[] =
{ {
"/boot/loader.conf", "/boot/loader.conf",
"/boot/defaults/loader.conf", "/boot/defaults/loader.conf",
@@ -816,7 +835,7 @@ grub_err_t ventoy_cmd_unix_replace_conf(grub_extcmd_context_t ctxt, int argc, ch
debug("Replace conf invalid argc %d\n", argc); debug("Replace conf invalid argc %d\n", argc);
return 1; return 1;
} }
for (i = 0; i < sizeof(loader_conf) / sizeof(loader_conf[0]); i++) for (i = 0; i < sizeof(loader_conf) / sizeof(loader_conf[0]); i++)
{ {
if (ventoy_get_file_override(loader_conf[i], &offset) == 0) if (ventoy_get_file_override(loader_conf[i], &offset) == 0)
@@ -828,7 +847,7 @@ grub_err_t ventoy_cmd_unix_replace_conf(grub_extcmd_context_t ctxt, int argc, ch
} }
if (confile == NULL) if (confile == NULL)
{ {
debug("Can't find loader.conf file from %u locations\n", i); debug("Can't find loader.conf file from %u locations\n", i);
return 1; return 1;
} }
@@ -845,13 +864,13 @@ grub_err_t ventoy_cmd_unix_replace_conf(grub_extcmd_context_t ctxt, int argc, ch
data = grub_malloc(VTOY_MAX_SCRIPT_BUF); data = grub_malloc(VTOY_MAX_SCRIPT_BUF);
if (!data) if (!data)
{ {
grub_file_close(file); grub_file_close(file);
return 1; return 1;
} }
grub_file_read(file, data, file->size); grub_file_read(file, data, file->size);
grub_file_close(file); grub_file_close(file);
g_conf_new_data = data; g_conf_new_data = data;
g_conf_new_len = (int)file->size; g_conf_new_len = (int)file->size;
@@ -863,19 +882,19 @@ grub_err_t ventoy_cmd_unix_replace_conf(grub_extcmd_context_t ctxt, int argc, ch
{ {
g_conf_new_len += ventoy_dragonfly_append_conf(data + file->size, args[1]); g_conf_new_len += ventoy_dragonfly_append_conf(data + file->size, args[1]);
} }
VENTOY_CMD_RETURN(GRUB_ERR_NONE); VENTOY_CMD_RETURN(GRUB_ERR_NONE);
} }
static int ventoy_unix_search_magic(char *data, int len) static int ventoy_unix_search_magic(char *data, int len)
{ {
int i; int i;
grub_uint32_t *magic = NULL; grub_uint32_t *magic = NULL;
for (i = 0; i < len; i += 4096) for (i = 0; i < len; i += 4096)
{ {
magic = (grub_uint32_t *)(data + i); magic = (grub_uint32_t *)(data + i);
if (magic[0] == VENTOY_UNIX_SEG_MAGIC0 && magic[1] == VENTOY_UNIX_SEG_MAGIC1 && if (magic[0] == VENTOY_UNIX_SEG_MAGIC0 && magic[1] == VENTOY_UNIX_SEG_MAGIC1 &&
magic[2] == VENTOY_UNIX_SEG_MAGIC2 && magic[3] == VENTOY_UNIX_SEG_MAGIC3) magic[2] == VENTOY_UNIX_SEG_MAGIC2 && magic[3] == VENTOY_UNIX_SEG_MAGIC3)
{ {
debug("unix find search magic at 0x%x loop:%d\n", i, (i >> 12)); debug("unix find search magic at 0x%x loop:%d\n", i, (i >> 12));
@@ -910,7 +929,7 @@ grub_err_t ventoy_cmd_unix_replace_ko(grub_extcmd_context_t ctxt, int argc, char
g_mod_override_offset = offset; g_mod_override_offset = offset;
} }
else else
{ {
debug("Can't find replace ko file from %s\n", args[0]); debug("Can't find replace ko file from %s\n", args[0]);
return 1; return 1;
} }
@@ -928,18 +947,18 @@ grub_err_t ventoy_cmd_unix_replace_ko(grub_extcmd_context_t ctxt, int argc, char
if (!data) if (!data)
{ {
debug("Failed to alloc memory for new ko %d\n", (int)file->size); debug("Failed to alloc memory for new ko %d\n", (int)file->size);
grub_file_close(file); grub_file_close(file);
return 1; return 1;
} }
grub_file_read(file, data, file->size); grub_file_read(file, data, file->size);
grub_file_close(file); grub_file_close(file);
g_mod_new_data = data; g_mod_new_data = data;
g_mod_new_len = (int)file->size; g_mod_new_len = (int)file->size;
ventoy_unix_search_magic(g_mod_new_data, g_mod_new_len); ventoy_unix_search_magic(g_mod_new_data, g_mod_new_len);
VENTOY_CMD_RETURN(GRUB_ERR_NONE); VENTOY_CMD_RETURN(GRUB_ERR_NONE);
} }
@@ -967,7 +986,7 @@ grub_err_t ventoy_cmd_unix_ko_fillmap(grub_extcmd_context_t ctxt, int argc, char
g_mod_override_offset = grub_iso9660_get_last_read_pos(file); g_mod_override_offset = grub_iso9660_get_last_read_pos(file);
} }
else else
{ {
debug("Can't find replace ko file from %s\n", args[0]); debug("Can't find replace ko file from %s\n", args[0]);
return 1; return 1;
} }
@@ -977,8 +996,8 @@ grub_err_t ventoy_cmd_unix_ko_fillmap(grub_extcmd_context_t ctxt, int argc, char
magic[0] = 0; magic[0] = 0;
grub_file_seek(file, i); grub_file_seek(file, i);
grub_file_read(file, magic, sizeof(magic)); grub_file_read(file, magic, sizeof(magic));
if (magic[0] == VENTOY_UNIX_SEG_MAGIC0 && magic[1] == VENTOY_UNIX_SEG_MAGIC1 && if (magic[0] == VENTOY_UNIX_SEG_MAGIC0 && magic[1] == VENTOY_UNIX_SEG_MAGIC1 &&
magic[2] == VENTOY_UNIX_SEG_MAGIC2 && magic[3] == VENTOY_UNIX_SEG_MAGIC3) magic[2] == VENTOY_UNIX_SEG_MAGIC2 && magic[3] == VENTOY_UNIX_SEG_MAGIC3)
{ {
debug("unix find search magic at 0x%x loop:%d\n", i, (i >> 16)); debug("unix find search magic at 0x%x loop:%d\n", i, (i >> 16));
@@ -987,7 +1006,7 @@ grub_err_t ventoy_cmd_unix_ko_fillmap(grub_extcmd_context_t ctxt, int argc, char
} }
} }
len = (grub_uint32_t)OFFSET_OF(struct g_ventoy_map, seglist) + len = (grub_uint32_t)OFFSET_OF(struct g_ventoy_map, seglist) +
(sizeof(struct g_ventoy_seg) * g_img_chunk_list.cur_chunk); (sizeof(struct g_ventoy_seg) * g_img_chunk_list.cur_chunk);
g_ko_fillmap_len = (int)len; g_ko_fillmap_len = (int)len;
@@ -1034,7 +1053,7 @@ grub_err_t ventoy_cmd_unix_fill_image_desc(grub_extcmd_context_t ctxt, int argc,
if (grub_memcmp(flag, byte + i, 32) == 0) if (grub_memcmp(flag, byte + i, 32) == 0)
{ {
debug("Find position flag at %d(0x%x)\n", i, i); debug("Find position flag at %d(0x%x)\n", i, i);
break; break;
} }
} }
} }
@@ -1118,7 +1137,7 @@ grub_err_t ventoy_cmd_unix_chain_data(grub_extcmd_context_t ctxt, int argc, char
const char *pLastChain = NULL; const char *pLastChain = NULL;
const char *compatible; const char *compatible;
ventoy_chain_head *chain; ventoy_chain_head *chain;
(void)ctxt; (void)ctxt;
(void)argc; (void)argc;
@@ -1161,9 +1180,9 @@ grub_err_t ventoy_cmd_unix_chain_data(grub_extcmd_context_t ctxt, int argc, char
return grub_error(GRUB_ERR_BAD_ARGUMENT, "File %s is not bootable", args[0]); return grub_error(GRUB_ERR_BAD_ARGUMENT, "File %s is not bootable", args[0]);
} }
} }
img_chunk_size = g_img_chunk_list.cur_chunk * sizeof(ventoy_img_chunk); img_chunk_size = g_img_chunk_list.cur_chunk * sizeof(ventoy_img_chunk);
if (ventoy_compatible) if (ventoy_compatible)
{ {
size = sizeof(ventoy_chain_head) + img_chunk_size; size = sizeof(ventoy_chain_head) + img_chunk_size;
@@ -1172,11 +1191,11 @@ grub_err_t ventoy_cmd_unix_chain_data(grub_extcmd_context_t ctxt, int argc, char
{ {
override_count = ventoy_unix_get_override_chunk_count(); override_count = ventoy_unix_get_override_chunk_count();
override_size = override_count * sizeof(ventoy_override_chunk); override_size = override_count * sizeof(ventoy_override_chunk);
virt_chunk_size = ventoy_unix_get_virt_chunk_size(); virt_chunk_size = ventoy_unix_get_virt_chunk_size();
size = sizeof(ventoy_chain_head) + img_chunk_size + override_size + virt_chunk_size; size = sizeof(ventoy_chain_head) + img_chunk_size + override_size + virt_chunk_size;
} }
pLastChain = grub_env_get("vtoy_chain_mem_addr"); pLastChain = grub_env_get("vtoy_chain_mem_addr");
if (pLastChain) if (pLastChain)
{ {
@@ -1239,7 +1258,7 @@ grub_err_t ventoy_cmd_unix_chain_data(grub_extcmd_context_t ctxt, int argc, char
ventoy_unix_fill_virt_data(isosize, chain); ventoy_unix_fill_virt_data(isosize, chain);
grub_file_close(file); grub_file_close(file);
VENTOY_CMD_RETURN(GRUB_ERR_NONE); VENTOY_CMD_RETURN(GRUB_ERR_NONE);
} }
@@ -24,6 +24,11 @@
#include <grub/types.h> #include <grub/types.h>
#include <grub/menu.h> #include <grub/menu.h>
#define VTOY_SB_POLICY_BYPASS 0
#define VTOY_SB_POLICY_CHECK 1
extern grub_uint8_t EXPORT_VAR(g_sys_sb);
extern grub_uint8_t EXPORT_VAR(g_sb_policy);
struct grub_env_var; struct grub_env_var;
typedef const char *(*grub_env_read_hook_t) (struct grub_env_var *var, typedef const char *(*grub_env_read_hook_t) (struct grub_env_var *var,
+10 -9
View File
@@ -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/>.
* *
@@ -82,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.
* *
*/ */
@@ -104,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.
@@ -114,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
@@ -125,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
@@ -155,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 */
@@ -200,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;
@@ -319,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
); );
+4 -2
View File
@@ -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
+5
View File
@@ -17,5 +17,10 @@
# #
#************************************************************************************ #************************************************************************************
if $GREP -q 'rdinit=/vtoy/vtoy' /proc/cmdline; then
echo "fix rdinit" >> $VTLOG
$SED "/switch_root.*\/mnt\/.installer-mp/i\ sh $VTOY_PATH/hook/debian/pve-wa.sh /mnt/.installer-mp/sbin/unconfigured.sh" -i /init
fi
$SED "/\/sys\/block\/hd\*/i\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/debian/pve-disk.sh" -i /init $SED "/\/sys\/block\/hd\*/i\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/debian/pve-disk.sh" -i /init
$SED "s#/sys/block/hd\*#/sys/block/dm* /sys/block/hd*#" -i /init $SED "s#/sys/block/hd\*#/sys/block/dm* /sys/block/hd*#" -i /init
+20
View File
@@ -0,0 +1,20 @@
#!/bin/sh
script=$1
tmpscript=${script}.tmp
LINE=$(grep -n 'proc.*proc.*proc' $script | awk -F':' '{print $1}')
sed -n "1,${LINE}p" $script >> $tmpscript
echo "if grep -q 'rdinit=/vtoy/vtoy' /proc/cmdline; then" >> $tmpscript
echo " sed 's#rdinit=/vtoy/vtoy##g' /proc/cmdline > /etc/cmdline" >> $tmpscript
echo " mount --bind /etc/cmdline /proc/cmdline" >> $tmpscript
echo "fi" >> $tmpscript
let LINE++
sed -n "${LINE},\$p" $script >> $tmpscript
cat $tmpscript > $script
@@ -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
+7 -3
View File
@@ -17,19 +17,23 @@
# #
#************************************************************************************ #************************************************************************************
$CAT /proc/cmdline > /ventoy/cmdline
$SED 's#live-media=[^ ]*#live-media=/dev/mapper/ventoy#g' -i /ventoy/cmdline
if [ -e /init ] && $GREP -q '^mountroot$' /init; then if [ -e /init ] && $GREP -q '^mountroot$' /init; then
echo "Here before mountroot ..." >> $VTLOG echo "Here before mountroot ..." >> $VTLOG
$SED "/^mountroot$/i\\$BUSYBOX_PATH/sh $VTOY_PATH/hook/deepin/disk_mount_hook.sh" -i /init $SED "/^mountroot$/i\\$BUSYBOX_PATH/sh $VTOY_PATH/hook/deepin/disk_mount_hook.sh" -i /init
$SED "/^mountroot$/i\\export LIVEMEDIA=/dev/mapper/ventoy" -i /init $SED "/^mountroot$/i\\export LIVEMEDIA=/dev/mapper/ventoy" -i /init
$SED "/^mountroot$/i\\export LIVE_MEDIA=/dev/mapper/ventoy" -i /init $SED "/^mountroot$/i\\export LIVE_MEDIA=/dev/mapper/ventoy" -i /init
$SED "/mount *[-]t *proc/a\\mount --bind /ventoy/cmdline /proc/cmdline" -i /init
if $GREP -q 'live-media=' /proc/cmdline; then if $GREP -q 'live-media=' /proc/cmdline; then
if [ -f /scripts/casper ] && $GREP -q '^ *LIVEMEDIA=' /scripts/casper; then if [ -f /scripts/casper ] && $GREP -q '^ *LIVEMEDIA=' /scripts/casper; then
$SED "s#^ *LIVEMEDIA=.*#LIVEMEDIA=/dev/mapper/ventoy#" -i /scripts/casper $SED "s#^ *LIVEMEDIA=.*#LIVEMEDIA=/dev/mapper/ventoy#" -i /scripts/casper
fi fi
fi fi
else else
echo "Here use udev hook ..." >> $VTLOG echo "Here use udev hook ..." >> $VTLOG
ventoy_systemd_udevd_work_around ventoy_systemd_udevd_work_around
@@ -0,0 +1,24 @@
#!/ventoy/busybox/sh
. /ventoy/hook/ventoy-hook-lib.sh
vtlog "######### $0 $* ############"
if is_ventoy_hook_finished; then
exit 0
fi
wait_for_usb_disk_ready
vtdiskname=$(get_ventoy_disk_name)
if [ "$vtdiskname" = "unknown" ]; then
vtlog "ventoy disk not found"
exit 0
fi
vtlog "vtdiskname=$vtdiskname"
ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2" "noreplace"
# OK finish
set_ventoy_hook_finish
@@ -0,0 +1,7 @@
function ft_mountCdromDir()
{
/ventoy/busybox/sh /ventoy/hook/euleros/disk_mount_hook.sh
ft_mountCdromDirXX "$@"
}
@@ -0,0 +1,42 @@
#!/ventoy/busybox/sh
#************************************************************************************
# Copyright (c) 2020, longpanda <admin@ventoy.net>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
#
#************************************************************************************
. $VTOY_PATH/hook/ventoy-os-lib.sh
TRANSFILE=/usr/Euler/project/load/filetransfer.sh
LINE=$($GREP -n 'function ft_mountCdromDir' $TRANSFILE | $AWK -F':' '{print $1}')
echo "LINE=$LINE" >> $VTLOG
$SED 's#FT_SR_DEV=.*#FT_SR_DEV=/dev/mapper/ventoy#g' -i $TRANSFILE
$SED 's/function ft_mountCdromDir/function ft_mountCdromDirXX/' -i $TRANSFILE
let LINE--
$SED -n "1,${LINE}p" $TRANSFILE >> /ventoy/filetransfer.sh
$CAT $VTOY_PATH/hook/euleros/hook_func.sh >> /ventoy/filetransfer.sh
let LINE++
$SED -n "${LINE},\$p" $TRANSFILE >> /ventoy/filetransfer.sh
$BUSYBOX_PATH/mv /ventoy/filetransfer.sh $TRANSFILE
#fix the euler os shell script
$SED 's/-z ${harddisk_disk_list}/-z "${harddisk_disk_list}"/' -i /usr/Euler/project/disk/disk_tool.sh
@@ -72,6 +72,12 @@ ventoy_udev_disk_common_hook $* "noreplace"
$BUSYBOX_PATH/mount $VTOY_DM_PATH /mnt/ventoy $BUSYBOX_PATH/mount $VTOY_DM_PATH /mnt/ventoy
#fix Oracle Linux 6.9 install issue
if $GREP -q -i 'Oracle Linux' /mnt/ventoy/.discinfo; then
ln -s /mnt/ventoy /mnt/source
fi
# #
# We do a trick for rhel6 series here. # We do a trick for rhel6 series here.
# Use /dev/$vtCheatLoop and wapper it as a removable cdrom with bind mount. # Use /dev/$vtCheatLoop and wapper it as a removable cdrom with bind mount.
+13 -1
View File
@@ -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
+2
View File
@@ -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
+11 -6
View File
@@ -67,8 +67,11 @@ set_ventoy_hook_finish() {
if [ -f /ventoy/ventoy_iso_part_dm_cmd ]; then if [ -f /ventoy/ventoy_iso_part_dm_cmd ]; then
echo "### create iso part raw dm" >> $VTLOG echo "### create iso part raw dm" >> $VTLOG
$BUSYBOX_PATH/sh /ventoy/ventoy_iso_part_dm_cmd >>$VTLOG 2>&1 $CAT $VTOY_PATH/ventoy_raw_table >> $VTLOG
$BUSYBOX_PATH/rm -f /ventoy/ventoy_iso_part_dm_cmd 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 fi
} }
@@ -159,17 +162,17 @@ ventoy_get_vblade_bin() {
fi fi
} }
ventoy_find_bin_path() { ventoy_find_bin_path() {
#must use built-in dmsetup, so first try ventoy path. Otherwise ubuntu installer unhappy. #3567
if $BUSYBOX_PATH/which "$1" > /dev/null; then if $BUSYBOX_PATH/which "$1" > /dev/null; then
$BUSYBOX_PATH/which "$1"; return $BUSYBOX_PATH/which "$1"; return
fi 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
echo "" echo ""
} }
@@ -266,7 +269,9 @@ create_ventoy_device_mapper() {
fi fi
RAWDISKNAME=$($HEAD -n1 $VTOY_PATH/ventoy_raw_table | $AWK '{print $4}') RAWDISKNAME=$($HEAD -n1 $VTOY_PATH/ventoy_raw_table | $AWK '{print $4}')
echo "$VT_DM_BIN create ${RAWDISKNAME#/dev/} $VTOY_PATH/ventoy_raw_table" > /ventoy/ventoy_iso_part_dm_cmd 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() {
+24 -5
View File
@@ -100,7 +100,11 @@ ventoy_get_os_type() {
echo 'rhel7'; return echo 'rhel7'; return
elif $GREP -q 'euleros' /proc/version; then elif $GREP -q 'euleros' /proc/version; then
echo 'rhel7'; return if [ -d /usr/Euler/project/init ]; then
echo 'euleros'; return
else
echo 'rhel7'; return
fi
# SUSE # SUSE
elif $GREP -q 'SUSE' /proc/version; then elif $GREP -q 'SUSE' /proc/version; then
@@ -169,7 +173,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
@@ -177,6 +181,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
@@ -312,8 +320,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
@@ -373,6 +381,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
@@ -425,7 +440,11 @@ fi
# # # #
#################################################################### ####################################################################
if [ -f "/live_injection_7ed136ec_7a61_4b54_adc3_ae494d5106ea/hook.sh" ]; then if [ -f "/live_injection_7ed136ec_7a61_4b54_adc3_ae494d5106ea/hook.sh" ]; then
$BUSYBOX_PATH/sh "/live_injection_7ed136ec_7a61_4b54_adc3_ae494d5106ea/hook.sh" $VTOS echo "==== Begin Call live injection hook.sh $VTOS" >> $VTLOG
$BUSYBOX_PATH/sh "/live_injection_7ed136ec_7a61_4b54_adc3_ae494d5106ea/hook.sh" $VTOS >>$VTLOG 2>&1
echo "==== Finish Call live injection hook.sh $VTOS" >> $VTLOG
else
echo "No live injection" >> $VTLOG
fi fi
+3 -3
View File
@@ -205,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
@@ -344,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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+2 -1
View File
@@ -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.
+19 -10
View File
@@ -1,7 +1,5 @@
#!/bin/sh #!/bin/sh
OLDDIR=$(pwd)
if ! [ -f ./tool/ventoy_lib.sh ]; then if ! [ -f ./tool/ventoy_lib.sh ]; then
if [ -f ${0%Ventoy2Disk.sh}/tool/ventoy_lib.sh ]; then if [ -f ${0%Ventoy2Disk.sh}/tool/ventoy_lib.sh ]; then
cd ${0%Ventoy2Disk.sh} cd ${0%Ventoy2Disk.sh}
@@ -21,7 +19,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="$(pwd)/tool/$TOOLDIR:$PATH"
echo '' echo ''
@@ -61,6 +59,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
@@ -70,10 +86,3 @@ if [ -f /bin/bash ]; then
else else
ash ./tool/VentoyWorker.sh $* ash ./tool/VentoyWorker.sh $*
fi fi
if [ -n "$OLDDIR" ]; then
CURDIR=$(pwd)
if [ "$CURDIR" != "$OLDDIR" ]; then
cd "$OLDDIR"
fi
fi
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+40 -4
View File
@@ -4,7 +4,7 @@
# #
submenu "$VTLANG_CTRL_TEMP_SET" --class=debug_temp_set --class=F5tool { submenu "$VTLANG_CTRL_TEMP_SET" --class=debug_temp_set --class=F5tool {
menuentry "[ $VTOY_WIN11_BYPASS_CHECK ] $VTLANG_WIN11_BYPASS_CHECK" --class=debug_temp_win11_bypass --class=debug_temp_set --class=F5tool \ menuentry "[ $VTOY_WIN11_BYPASS_CHECK ] $VTLANG_WIN11_BYPASS_CHECK" --class=debug_temp_win11_bypass --class=debug_temp_set --class=F5tool \
VTOY_RUN_SET0 { VTOY_RUN_SET_0_0 {
if [ "$VTOY_WIN11_BYPASS_CHECK" = "0" ]; then if [ "$VTOY_WIN11_BYPASS_CHECK" = "0" ]; then
set VTOY_WIN11_BYPASS_CHECK=1 set VTOY_WIN11_BYPASS_CHECK=1
else else
@@ -13,7 +13,7 @@ submenu "$VTLANG_CTRL_TEMP_SET" --class=debug_temp_set --class=F5tool {
} }
menuentry "[ $VTOY_WIN11_BYPASS_NRO ] $VTLANG_WIN11_BYPASS_NRO" --class=debug_temp_win11_nro --class=debug_temp_set --class=F5tool \ menuentry "[ $VTOY_WIN11_BYPASS_NRO ] $VTLANG_WIN11_BYPASS_NRO" --class=debug_temp_win11_nro --class=debug_temp_set --class=F5tool \
VTOY_RUN_SET1 { VTOY_RUN_SET_1_0 {
if [ "$VTOY_WIN11_BYPASS_NRO" = "0" ]; then if [ "$VTOY_WIN11_BYPASS_NRO" = "0" ]; then
set VTOY_WIN11_BYPASS_NRO=1 set VTOY_WIN11_BYPASS_NRO=1
else else
@@ -22,13 +22,13 @@ 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_SET_2_0 {
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 "$VTLANG_RETURN_PREVIOUS" --class=vtoyret VTOY_RET { menuentry "$VTLANG_RETURN_PREVIOUS" --class=vtoyret VTOY_RET {
echo "Return ..." echo "Return ..."
@@ -36,6 +36,42 @@ submenu "$VTLANG_CTRL_TEMP_SET" --class=debug_temp_set --class=F5tool {
} }
if [ "$grub_platform" != "pc" ]; then
submenu "$VTLANG_WIN_UEFI_RES_LOCK" --class=debug_uefi_res_lock --class=F5tool {
set vtActive0="[ ]"
set vtActive1="[ ]"
set vtActive2="[ ]"
set vtActive3="[ ]"
if [ "$VTOY_WIN_UEFI_RES_LOCK" = "0" ]; then
set vtActive0="[*]"
elif [ "$VTOY_WIN_UEFI_RES_LOCK" = "1" ]; then
set vtActive1="[*]"
elif [ "$VTOY_WIN_UEFI_RES_LOCK" = "2" ]; then
set vtActive2="[*]"
elif [ "$VTOY_WIN_UEFI_RES_LOCK" = "3" ]; then
set vtActive3="[*]"
fi
menuentry "$vtActive0 $VTLANG_UEFI_RES_LOCK_NONE" --class=debug_uefi_res_lock0 --class=F5tool VTOY_RUN_SET_0_1 {
set VTOY_WIN_UEFI_RES_LOCK=0
}
menuentry "$vtActive1 $VTLANG_UEFI_RES_LOCK_MAX" --class=debug_uefi_res_lock1 --class=F5tool VTOY_RUN_SET_1_1 {
set VTOY_WIN_UEFI_RES_LOCK=1
}
menuentry "$vtActive2 $VTLANG_UEFI_RES_LOCK_1024_768" --class=debug_uefi_res_lock2 --class=F5tool VTOY_RUN_SET_2_1 {
set VTOY_WIN_UEFI_RES_LOCK=2
}
menuentry "$vtActive3 $VTLANG_UEFI_RES_LOCK_BE1024_768" --class=debug_uefi_res_lock3 --class=F5tool VTOY_RUN_SET_3_1 {
set VTOY_WIN_UEFI_RES_LOCK=3
}
menuentry "$VTLANG_RETURN_PREVIOUS" --class=vtoyret VTOY_RET {
echo "Return ..."
}
}
fi
submenu "$VTLANG_MENU_LANG" --class=debug_menu_lang --class=F5tool { submenu "$VTLANG_MENU_LANG" --class=debug_menu_lang --class=F5tool {
source $prefix/menulang.cfg source $prefix/menulang.cfg
} }
+33 -23
View File
@@ -34,20 +34,6 @@ function ventoy_debug_pause {
} }
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
@@ -70,6 +56,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}"
@@ -422,6 +414,16 @@ function distro_specify_initrd_file_phase2 {
vt_linux_specify_initrd_file /initramfs-linux.img vt_linux_specify_initrd_file /initramfs-linux.img
elif [ -f (loop)/boot/isolinux/initrd.gz ]; then elif [ -f (loop)/boot/isolinux/initrd.gz ]; then
vt_linux_specify_initrd_file /boot/isolinux/initrd.gz vt_linux_specify_initrd_file /boot/isolinux/initrd.gz
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
} }
@@ -487,20 +489,20 @@ 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 "^(15|14|13|12|11|10|9)_[0-9]" "$vt_volume_id"; then elif regexp --set 1:vtBsdVerNum "^(1[0-9]|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 "\"(15|14|13|12|11|10|9)\.[0-9]-" "$vt_userland_ver"; then if regexp --set 1:vtBsdVerNum "\"(1[0-9]|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 (15|14|13|12|11|10|9)\.[0-9]-" "$vt_freebsd_line1"; then if regexp --set 1:vtBsdVerNum "FreeBSD (1[0-9]|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
set vt_freebsd_ver=9.x set vt_freebsd_ver=9.x
@@ -529,7 +531,7 @@ function ventoy_freebsd_proc {
fi fi
if [ "$vt_freebsd_ver" = "xx" ]; then if [ "$vt_freebsd_ver" = "xx" ]; then
set vt_freebsd_ver=14.x set vt_freebsd_ver=15.x
fi fi
fi fi
@@ -646,7 +648,6 @@ 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_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
@@ -731,6 +732,8 @@ function uefi_linux_menu_func {
vt_add_replace_file $vtindex "arch\\boot\\x86_64\\initramfs-linux.img" vt_add_replace_file $vtindex "arch\\boot\\x86_64\\initramfs-linux.img"
elif [ -f (loop)/boot/initramfs_x86_64.img ]; then elif [ -f (loop)/boot/initramfs_x86_64.img ]; then
vt_add_replace_file $vtindex "boot\\initramfs_x86_64.img" vt_add_replace_file $vtindex "boot\\initramfs_x86_64.img"
elif [ -f (loop)/arch/boot/x86_64/initramfs-linux-aegis-offensive.img ]; then
vt_add_replace_file $vtindex "arch\\boot\\x86_64\\initramfs-linux-aegis-offensive.img"
fi fi
elif [ -d (loop)/blackarch ]; then elif [ -d (loop)/blackarch ]; then
if [ -f (loop)/blackarch/boot/x86_64/archiso.img ]; then if [ -f (loop)/blackarch/boot/x86_64/archiso.img ]; then
@@ -1441,7 +1444,10 @@ function ventoy_iso_busybox_ver {
set ventoy_busybox_ver=64 set ventoy_busybox_ver=64
elif vt_strstr "$vt_volume_id" "x86_64"; then elif vt_strstr "$vt_volume_id" "x86_64"; then
set ventoy_busybox_ver=64 set ventoy_busybox_ver=64
elif vt_istrstr "${vt_chosen_path}" "x86_64"; then
set ventoy_busybox_ver=64
elif vt_istrstr "${vt_chosen_path}" "amd64"; then
set ventoy_busybox_ver=64
fi fi
fi fi
} }
@@ -2433,7 +2439,7 @@ function mimg_common_menuentry {
############################################################# #############################################################
############################################################# #############################################################
set VENTOY_VERSION="1.1.09" set VENTOY_VERSION="1.1.17"
#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
@@ -2535,6 +2541,10 @@ else
vt_check_json_path_case $vtoy_iso_part vt_check_json_path_case $vtoy_iso_part
fi fi
#Update Secure Boot Policy
vt_update_sb_policy
if [ -n "$VTOY_MENU_LANGUAGE" ]; then if [ -n "$VTOY_MENU_LANGUAGE" ]; then
vt_init_menu_lang "$VTOY_MENU_LANGUAGE" vt_init_menu_lang "$VTOY_MENU_LANGUAGE"
else else
+10 -10
View File
@@ -1,18 +1,18 @@
L - Seleccionar lenguaje L - Seleccionar idioma
F1 - Mostrar información de ayuda F1 - Mostrar información de ayuda
F2 - Navegar y arranca archivos en el disco local F2 - Navegar y arrancar archivos en el disco local
F3 - Cambiar modo de menú entre vista de árbol <-> vista de lista F3 - Cambiar modo de menú entre Vista de árbol <-> Vista de lista
F4 - arrancar Windows/Linux en el disco local F4 - Arrancar Windows/Linux en el disco local
F5 - Utilidades F5 - Utilidades
F6 - Cargar menú de Grub2 personalizado F6 - Cargar menú de Grub2 personalizado
F7 - Cambiar entre modo grafico <-> modo texto F7 - Cambiar entre Modo GUI <-> Modo texto
m/Ctrl+m - Suma de comprobación de archivos de imagen (md5/sha1/sha256/sha512) m/Ctrl+m - Suma de comprobación de archivos de imagen (md5/sha1/sha256/sha512)
d/Ctrl+d - Modo Memdisk (solo para WinPE/LiveCD ISO/IMG pequeños) d/Ctrl+d - Modo Memdisk (lo para WinPE/LiveCD ISO/IMG pequeños)
w/Ctrl+w - Modo WIMBOOT (Solo para archivos Windows/WinPE ISO) w/Ctrl+w - Modo WIMBOOT (Sólo para archivos Windows/WinPE ISO)
r/Ctrl+r - Modo Grub2 (Solo para algunas distribuciones de Linux) r/Ctrl+r - Modo Grub2 (Sólo para algunas distros de Linux)
i/Ctrl+i - Modo compatible (Solo para depuración) i/Ctrl+i - Modo compatible (Sólo para depuración)
u/Ctrl+u - Cargar controlador ISO EFI (Solo para depuración, no se puede usar oficialmente) u/Ctrl+u - Cargar controlador ISO EFI (Sólo para depuración, uso no oficial)
+19
View 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 را کلیک کنید ......
+4 -4
View File
@@ -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
View 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 ......
+9 -9
View File
@@ -1,18 +1,18 @@
L - Seleção de Idiomas L - Seleção de Idiomas
F1 - Exibir informaçõ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ção em Árvore <-> Visualizaçã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á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ó pros pequenos WinPE/LiveCD ISO/IMG) d/Ctrl+d - Modo Memdisk (Só pros pequenos WinPE/LiveCD ISO/IMG)
w/Ctrl+w - Modo WIMBOOT (Só pra arquivos ISO do Windows/WinPE) w/Ctrl+w - Modo WIMBOOT (Só pra arquivos ISO do Windows/WinPE)
r/Ctrl+r - Modo Grub2 (Só pra algumas distros do Linux) r/Ctrl+r - Modo Grub2 (Só pra algumas distros do Linux)
i/Ctrl+i - Modo Compatível (Só pra debugging) i/Ctrl+i - Modo Compatível (Só pra debugging)
u/Ctrl+u - Carregar o driver EFI da ISO (Só pra debugging, não pode ser usado oficialmente) u/Ctrl+u - Carregar o driver EFI da ISO (Só pra debugging, não pode ser usado oficialmente)
+19
View 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 ......
+9 -6
View File
@@ -24,33 +24,36 @@ menuentry "$VTLANG_HWINFO" --class=debug_hwinfo --class=F5tool {
set bios_size="-"; set bios_size="-";
smbios -t 0 -b 0x09 --set=bios_size; smbios -t 0 -b 0x09 --set=bios_size;
echo "Platform $grub_cpu-$grub_platform" echo "Platform $grub_cpu-$grub_platform"
if [ "$grub_platform" != "pc" ]; then if [ "$grub_platform" != "pc" ]; then
echo "UEFI Version $grub_uefi_version" echo "UEFI Version $grub_uefi_version"
echo "PI Version $grub_pi_version"
if vt_check_secureboot_var; then if vt_check_secureboot_var; then
echo "Secure Boot Enabled" echo "Secure Boot Enabled"
else else
echo "Secure Boot Disabled" echo "Secure Boot Disabled"
fi fi
fi
vt_sbinfo
fi
echo "" echo ""
echo "CPU Model $cpu_brand" echo "CPU Model $cpu_brand"
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"
+6 -1
View File
@@ -88,6 +88,11 @@
"VTLANG_WIN11_BYPASS_NRO": "تجاوز متطلبات الحساب عبر الإنترنت عند تثبيت Windows 11", "VTLANG_WIN11_BYPASS_NRO": "تجاوز متطلبات الحساب عبر الإنترنت عند تثبيت Windows 11",
"VTLANG_LINUX_REMOUNT": "ضم قسم Ventoy بعد إقلاع Linux", "VTLANG_LINUX_REMOUNT": "ضم قسم Ventoy بعد إقلاع Linux",
"VTLANG_SECONDARY_BOOT_MENU": "اظهر قائمة الإقلاع الثانوية", "VTLANG_SECONDARY_BOOT_MENU": "اظهر قائمة الإقلاع الثانوية",
"VTLANG_WIN_UEFI_RES_LOCK": "Lock the resolution when UEFI boot Windows/WinPE",
"VTLANG_UEFI_RES_LOCK_NONE": "None",
"VTLANG_UEFI_RES_LOCK_MAX": "Highest",
"VTLANG_UEFI_RES_LOCK_1024_768": "Fixed 1024 x 768",
"VTLANG_UEFI_RES_LOCK_BE1024_768": "At least 1024 x 768",
"MENU_STR_XXX": "" "MENU_STR_XXX": ""
} }
+7 -1
View File
@@ -88,6 +88,12 @@
"VTLANG_WIN11_BYPASS_NRO": "Windows 11 ইনস্টল করার সময় অনলাইন অ্যাকাউন্টের প্রয়োজন বাইপাস করুন", "VTLANG_WIN11_BYPASS_NRO": "Windows 11 ইনস্টল করার সময় অনলাইন অ্যাকাউন্টের প্রয়োজন বাইপাস করুন",
"VTLANG_LINUX_REMOUNT": "লিনাক্স বুটের পরে ভেন্টয় পার্টিশনটি মাউন্ট করুন", "VTLANG_LINUX_REMOUNT": "লিনাক্স বুটের পরে ভেন্টয় পার্টিশনটি মাউন্ট করুন",
"VTLANG_SECONDARY_BOOT_MENU": "গৌণ বুট মেনু দেখান", "VTLANG_SECONDARY_BOOT_MENU": "গৌণ বুট মেনু দেখান",
"VTLANG_WIN_UEFI_RES_LOCK": "Lock the resolution when UEFI boot Windows/WinPE",
"VTLANG_UEFI_RES_LOCK_NONE": "None",
"VTLANG_UEFI_RES_LOCK_MAX": "Highest",
"VTLANG_UEFI_RES_LOCK_1024_768": "Fixed 1024 x 768",
"VTLANG_UEFI_RES_LOCK_BE1024_768": "At least 1024 x 768",
"MENU_STR_XXX": "" "MENU_STR_XXX": ""
} }
+6
View File
@@ -88,6 +88,12 @@
"VTLANG_WIN11_BYPASS_NRO": "Obejít požadování online účtu při instalaci Windows 11", "VTLANG_WIN11_BYPASS_NRO": "Obejít požadování online účtu při instalaci Windows 11",
"VTLANG_LINUX_REMOUNT": "Připojit Ventoy oddíl po spuštění Linuxu", "VTLANG_LINUX_REMOUNT": "Připojit Ventoy oddíl po spuštění Linuxu",
"VTLANG_SECONDARY_BOOT_MENU": "Zobrazit druhou spouštěcí nabídku", "VTLANG_SECONDARY_BOOT_MENU": "Zobrazit druhou spouštěcí nabídku",
"VTLANG_WIN_UEFI_RES_LOCK": "Lock the resolution when UEFI boot Windows/WinPE",
"VTLANG_UEFI_RES_LOCK_NONE": "None",
"VTLANG_UEFI_RES_LOCK_MAX": "Highest",
"VTLANG_UEFI_RES_LOCK_1024_768": "Fixed 1024 x 768",
"VTLANG_UEFI_RES_LOCK_BE1024_768": "At least 1024 x 768",
"MENU_STR_XXX": "" "MENU_STR_XXX": ""
} }
+7 -1
View File
@@ -88,6 +88,12 @@
"VTLANG_WIN11_BYPASS_NRO": "Umgehen Sie die Online-Kontoanforderung bei der Installation von Windows 11", "VTLANG_WIN11_BYPASS_NRO": "Umgehen Sie die Online-Kontoanforderung bei der Installation von Windows 11",
"VTLANG_LINUX_REMOUNT": "Mounten Sie die Ventoy-Partition nach dem Booten von Linux", "VTLANG_LINUX_REMOUNT": "Mounten Sie die Ventoy-Partition nach dem Booten von Linux",
"VTLANG_SECONDARY_BOOT_MENU": "Sekundäres Bootmenü anzeigen", "VTLANG_SECONDARY_BOOT_MENU": "Sekundäres Bootmenü anzeigen",
"VTLANG_WIN_UEFI_RES_LOCK": "Lock the resolution when UEFI boot Windows/WinPE",
"VTLANG_UEFI_RES_LOCK_NONE": "None",
"VTLANG_UEFI_RES_LOCK_MAX": "Highest",
"VTLANG_UEFI_RES_LOCK_1024_768": "Fixed 1024 x 768",
"VTLANG_UEFI_RES_LOCK_BE1024_768": "At least 1024 x 768",
"MENU_STR_XXX": "" "MENU_STR_XXX": ""
} }
+7 -1
View File
@@ -88,6 +88,12 @@
"VTLANG_WIN11_BYPASS_NRO": "Παράκαμψη της απαίτησης online λογαριασμού κατά την εγκατάσταση των Windows 11", "VTLANG_WIN11_BYPASS_NRO": "Παράκαμψη της απαίτησης online λογαριασμού κατά την εγκατάσταση των Windows 11",
"VTLANG_LINUX_REMOUNT": "Προσάρτηση διαμερίσματος Ventoy μετά την εκκίνηση του Linux", "VTLANG_LINUX_REMOUNT": "Προσάρτηση διαμερίσματος Ventoy μετά την εκκίνηση του Linux",
"VTLANG_SECONDARY_BOOT_MENU": "Εμφάνιση δευτερεύοντος μενού εκκίνησης", "VTLANG_SECONDARY_BOOT_MENU": "Εμφάνιση δευτερεύοντος μενού εκκίνησης",
"VTLANG_WIN_UEFI_RES_LOCK": "Lock the resolution when UEFI boot Windows/WinPE",
"VTLANG_UEFI_RES_LOCK_NONE": "None",
"VTLANG_UEFI_RES_LOCK_MAX": "Highest",
"VTLANG_UEFI_RES_LOCK_1024_768": "Fixed 1024 x 768",
"VTLANG_UEFI_RES_LOCK_BE1024_768": "At least 1024 x 768",
"MENU_STR_XXX": "" "MENU_STR_XXX": ""
} }
+6 -1
View File
@@ -87,7 +87,12 @@
"VTLANG_WIN11_BYPASS_CHECK": "Bypass CPU/TPM/SecureBoot check when install Windows 11", "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_WIN11_BYPASS_NRO": "Bypass online account requirement when install Windows 11",
"VTLANG_LINUX_REMOUNT": "Mount Ventoy partition after boot Linux", "VTLANG_LINUX_REMOUNT": "Mount Ventoy partition after boot Linux",
"VTLANG_SECONDARY_BOOT_MENU": "Show secondary boot menu", "VTLANG_SECONDARY_BOOT_MENU": "Show secondary boot menu",
"VTLANG_WIN_UEFI_RES_LOCK": "Lock the resolution when UEFI boot Windows/WinPE",
"VTLANG_UEFI_RES_LOCK_NONE": "None",
"VTLANG_UEFI_RES_LOCK_MAX": "Highest",
"VTLANG_UEFI_RES_LOCK_1024_768": "Fixed 1024 x 768",
"VTLANG_UEFI_RES_LOCK_BE1024_768": "At least 1024 x 768",
"MENU_STR_XXX": "" "MENU_STR_XXX": ""
} }
+37 -31
View File
@@ -1,10 +1,10 @@
{ {
"VTLANG_LANGUAGE_NAME": "Spanish (Español)", "VTLANG_LANGUAGE_NAME": "Spanish (Español)",
"VTLANG_STR_HOTKEY_LIST": "L:Lenguaje F1:Ayuda F2:Navegar F3:Vista de lista F4:Arranque local F5:Herramientas F6:Extensión de menú", "VTLANG_STR_HOTKEY_LIST": "L:Idioma F1:Ayuda F2:Navegar F3:Vista de lista F4:Arranque local F5:Herramientas F6:Menú ext.",
"VTLANG_STR_HOTKEY_TREE": "L:Lenguaje F1:Ayuda F2:Navegar F3:Vista de árbol F4:Arranque local F5:Herramientas F6:Extensión de menú", "VTLANG_STR_HOTKEY_TREE": "L:Idioma F1:Ayuda F2:Navegar F3:Vista de árbol F4:Arranque local F5:Herramientas F6:Menú ext.",
"VTLANG_RETURN_PREVIOUS": "Regresar al menú previo [Esc]", "VTLANG_RETURN_PREVIOUS": "Regresar al menú anterior [Esc]",
"VTLANG_RETURN_PRV_NOESC": "Regresar al menú previo", "VTLANG_RETURN_PRV_NOESC": "Regresar al menú anterior",
"VTLANG_MENU_LANG": "Selección de idioma del menú", "VTLANG_MENU_LANG": "Selección de idioma del menú",
@@ -28,13 +28,13 @@
"VTLANG_CHKSUM_SHA256_CALC_CHK": "Calcular y comprobar sha256sum", "VTLANG_CHKSUM_SHA256_CALC_CHK": "Calcular y comprobar sha256sum",
"VTLANG_CHKSUM_SHA512_CALC_CHK": "Calcular y comprobar sha512sum", "VTLANG_CHKSUM_SHA512_CALC_CHK": "Calcular y comprobar sha512sum",
"VTLANG_POWER": "Poder", "VTLANG_POWER": "Energía",
"VTLANG_POWER_REBOOT": "Reiniciar", "VTLANG_POWER_REBOOT": "Reiniciar",
"VTLANG_POWER_HALT": "Detener", "VTLANG_POWER_HALT": "Apagar",
"VTLANG_POWER_BOOT_EFIFW": "Reiniciar a configuración EFI", "VTLANG_POWER_BOOT_EFIFW": "Reiniciar a la configuración EFI",
"VTLANG_KEYBRD_LAYOUT": "Distribuciones de teclado", "VTLANG_KEYBRD_LAYOUT": "Distribuciones de teclado",
"VTLANG_HWINFO": "Información de Hardware", "VTLANG_HWINFO": "Información de hardware",
"VTLANG_RESOLUTION_CFG": "Configuración de resolución", "VTLANG_RESOLUTION_CFG": "Configuración de resolución",
"VTLANG_SCREEN_MODE": "Modo de visualización de pantalla", "VTLANG_SCREEN_MODE": "Modo de visualización de pantalla",
@@ -45,23 +45,23 @@
"VTLANG_UEFI_UTIL": "Utilidades UEFI de Ventoy", "VTLANG_UEFI_UTIL": "Utilidades UEFI de Ventoy",
"VTLANG_UTIL_SHOW_EFI_DRV": "Mostrar controladores EFI", "VTLANG_UTIL_SHOW_EFI_DRV": "Mostrar controladores EFI",
"VTLANG_UTIL_FIX_BLINIT_FAIL": "Reparar la falla de BinitializeLibrary de Windows", "VTLANG_UTIL_FIX_BLINIT_FAIL": "Reparar error BlinitializeLibrary de Windows",
"VTLANG_JSON_CHK_JSON": "Comprobar configuración de complemento de json (ventoy.json)", "VTLANG_JSON_CHK_JSON": "Comprobar configuración del complemento de json (ventoy.json)",
"VTLANG_JSON_CHK_CONTROL": "Comprobar configuración de complemento de control global", "VTLANG_JSON_CHK_CONTROL": "Comprobar configuración del complemento de control global",
"VTLANG_JSON_CHK_THEME": "Comprobar configuración de complemento de tema", "VTLANG_JSON_CHK_THEME": "Comprobar configuración del complemento de tema",
"VTLANG_JSON_CHK_AUTOINS": "Comprobar configuración de complemento de auto instalación", "VTLANG_JSON_CHK_AUTOINS": "Comprobar configuración del complemento de autoinstalación",
"VTLANG_JSON_CHK_PERSIST": "Comprobar configuración de complemento de persistencia", "VTLANG_JSON_CHK_PERSIST": "Comprobar configuración del complemento de persistencia",
"VTLANG_JSON_CHK_MENU_ALIAS": "Comprobar configuración de complemento de alias de menú", "VTLANG_JSON_CHK_MENU_ALIAS": "Comprobar configuración del complemento de alias de menú",
"VTLANG_JSON_CHK_MENU_TIP": "Comprobar configuración de complemento de consejo de menú", "VTLANG_JSON_CHK_MENU_TIP": "Comprobar configuración del complemento de consejo de menú",
"VTLANG_JSON_CHK_MENU_CLASS": "Comprobar configuración de complemento de clase de menú", "VTLANG_JSON_CHK_MENU_CLASS": "Comprobar configuración del complemento de clases de menú",
"VTLANG_JSON_CHK_INJECTION": "Comprobar configuración de complemento de inyección", "VTLANG_JSON_CHK_INJECTION": "Comprobar configuración del complemento de inyección",
"VTLANG_JSON_CHK_AUTO_MEMDISK": "Comprobar configuración de complemento de auto memdisk", "VTLANG_JSON_CHK_AUTO_MEMDISK": "Comprobar configuración del complemento auto memdisk",
"VTLANG_JSON_CHK_IMG_LIST": "Comprobar configuración de complemento de lista de imágenes", "VTLANG_JSON_CHK_IMG_LIST": "Comprobar configuración del complemento de lista de imágenes",
"VTLANG_JSON_CHK_IMG_BLIST": "Comprobar configuración de complemento de lista negra de imágenes", "VTLANG_JSON_CHK_IMG_BLIST": "Comprobar configuración del complemento de lista negra de imágenes",
"VTLANG_JSON_CHK_CONF_REPLACE": "Comprobar configuración de complemento de reemplazo de configuración de arranque", "VTLANG_JSON_CHK_CONF_REPLACE": "Comprobar configuración del complemento de reemplazo de configuración de arranque",
"VTLANG_JSON_CHK_DUD": "Comprobar configuración de complemento de dud", "VTLANG_JSON_CHK_DUD": "Comprobar configuración del complemento dud",
"VTLANG_JSON_CHK_PASSWORD": "Comprobar configuración de complemento de contraseñas", "VTLANG_JSON_CHK_PASSWORD": "Comprobar configuración del complemento de contraseñas",
"VTLANG_NORMAL_MODE": "Arrancar en modo normal", "VTLANG_NORMAL_MODE": "Arrancar en modo normal",
"VTLANG_WIMBOOT_MODE": "Arrancar en modo wimboot", "VTLANG_WIMBOOT_MODE": "Arrancar en modo wimboot",
@@ -71,7 +71,7 @@
"VTLANG_RET_TO_LISTVIEW": "Regresar a vista de lista", "VTLANG_RET_TO_LISTVIEW": "Regresar a vista de lista",
"VTLANG_RET_TO_TREEVIEW": "regresar a vista de árbol", "VTLANG_RET_TO_TREEVIEW": "regresar a vista de árbol",
"VTLANG_NO_AUTOINS_SCRIPT": "Arrancar sin plantilla de auto instalación", "VTLANG_NO_AUTOINS_SCRIPT": "Arrancar sin plantilla de autoinstalación",
"VTLANG_AUTOINS_USE": "Arrancar con", "VTLANG_AUTOINS_USE": "Arrancar con",
"VTLANG_NO_PERSIST": "Arrancar sin persistencia", "VTLANG_NO_PERSIST": "Arrancar sin persistencia",
@@ -79,15 +79,21 @@
"VTLANG_BROWER_RETURN": "Regresar", "VTLANG_BROWER_RETURN": "Regresar",
"VTLANG_ENTER_EXIT": "presiona tecla Entrar para salir", "VTLANG_ENTER_EXIT": "Presiona la tecla Entrar para salir",
"VTLANG_ENTER_REBOOT": "presiona tecla Entrar para reiniciar", "VTLANG_ENTER_REBOOT": "Presiona la tecla Entrar para reiniciar",
"VTLANG_ENTER_CONTINUE": "presiona tecla Entrar para continuar", "VTLANG_ENTER_CONTINUE": "Presiona la tecla Entrar para continuar",
"VTLANG_CTRL_TEMP_SET": "Ajustes de control temporales", "VTLANG_CTRL_TEMP_SET": "Ajustes de control temporales",
"VTLANG_WIN11_BYPASS_CHECK": "Saltar comprobación de CPU/TPM/Arranque Seguro al instalar Windows 11", "VTLANG_WIN11_BYPASS_CHECK": "Omitir comprobación de CPU/TPM/SecureBoot al instalar Windows 11",
"VTLANG_WIN11_BYPASS_NRO": "Saltar requerimiento de cuenta en linea al instalar Windows 11", "VTLANG_WIN11_BYPASS_NRO": "Omitir requisito de cuenta en línea al instalar Windows 11",
"VTLANG_LINUX_REMOUNT": "Montar partición de Ventoy después de arrancar Linux", "VTLANG_LINUX_REMOUNT": "Montar partición de Ventoy después de arrancar Linux",
"VTLANG_SECONDARY_BOOT_MENU": "Mostrar menú de arranque secundario", "VTLANG_SECONDARY_BOOT_MENU": "Mostrar menú de arranque secundario",
"VTLANG_WIN_UEFI_RES_LOCK": "Bloquear la resolución al arrancar Windows/WinPE en modo UEFI",
"VTLANG_UEFI_RES_LOCK_NONE": "Ninguno",
"VTLANG_UEFI_RES_LOCK_MAX": "La más alta",
"VTLANG_UEFI_RES_LOCK_1024_768": "Fija 1024 x 768",
"VTLANG_UEFI_RES_LOCK_BE1024_768": "Al menos 1024 x 768",
"MENU_STR_XXX": "" "MENU_STR_XXX": ""
} }
+99
View File
@@ -0,0 +1,99 @@
{
"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": "نمایش منوی بوت ثانویه",
"VTLANG_WIN_UEFI_RES_LOCK": "Lock the resolution when UEFI boot Windows/WinPE",
"VTLANG_UEFI_RES_LOCK_NONE": "None",
"VTLANG_UEFI_RES_LOCK_MAX": "Highest",
"VTLANG_UEFI_RES_LOCK_1024_768": "Fixed 1024 x 768",
"VTLANG_UEFI_RES_LOCK_BE1024_768": "At least 1024 x 768",
"MENU_STR_XXX": ""
}
+7 -1
View File
@@ -88,6 +88,12 @@
"VTLANG_WIN11_BYPASS_NRO": "Contourner l'exigence de compte en ligne lors de l'installation de Windows 11", "VTLANG_WIN11_BYPASS_NRO": "Contourner l'exigence de compte en ligne lors de l'installation de Windows 11",
"VTLANG_LINUX_REMOUNT": "Monter la partition Ventoy après le démarrage de Linux", "VTLANG_LINUX_REMOUNT": "Monter la partition Ventoy après le démarrage de Linux",
"VTLANG_SECONDARY_BOOT_MENU": "Afficher le menu de démarrage secondaire", "VTLANG_SECONDARY_BOOT_MENU": "Afficher le menu de démarrage secondaire",
"VTLANG_WIN_UEFI_RES_LOCK": "Lock the resolution when UEFI boot Windows/WinPE",
"VTLANG_UEFI_RES_LOCK_NONE": "None",
"VTLANG_UEFI_RES_LOCK_MAX": "Highest",
"VTLANG_UEFI_RES_LOCK_1024_768": "Fixed 1024 x 768",
"VTLANG_UEFI_RES_LOCK_BE1024_768": "At least 1024 x 768",
"MENU_STR_XXX": "" "MENU_STR_XXX": ""
} }
+7 -1
View File
@@ -88,6 +88,12 @@
"VTLANG_WIN11_BYPASS_NRO": "विंडोज 11 स्थापित करते समय ऑनलाइन खाते की आवश्यकता बाईपास", "VTLANG_WIN11_BYPASS_NRO": "विंडोज 11 स्थापित करते समय ऑनलाइन खाते की आवश्यकता बाईपास",
"VTLANG_LINUX_REMOUNT": "लिनक्स बूट के बाद वेंटॉय विभाजन को माउंट करें", "VTLANG_LINUX_REMOUNT": "लिनक्स बूट के बाद वेंटॉय विभाजन को माउंट करें",
"VTLANG_SECONDARY_BOOT_MENU": "द्वितीयक बूट मेनू दिखाएं", "VTLANG_SECONDARY_BOOT_MENU": "द्वितीयक बूट मेनू दिखाएं",
"VTLANG_WIN_UEFI_RES_LOCK": "Lock the resolution when UEFI boot Windows/WinPE",
"VTLANG_UEFI_RES_LOCK_NONE": "None",
"VTLANG_UEFI_RES_LOCK_MAX": "Highest",
"VTLANG_UEFI_RES_LOCK_1024_768": "Fixed 1024 x 768",
"VTLANG_UEFI_RES_LOCK_BE1024_768": "At least 1024 x 768",
"MENU_STR_XXX": "" "MENU_STR_XXX": ""
} }
+7 -1
View File
@@ -88,6 +88,12 @@
"VTLANG_WIN11_BYPASS_NRO": "Bypass online account requirement 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_LINUX_REMOUNT": "Mount Ventoy partition after boot Linux",
"VTLANG_SECONDARY_BOOT_MENU": "Show secondary boot menu", "VTLANG_SECONDARY_BOOT_MENU": "Show secondary boot menu",
"VTLANG_WIN_UEFI_RES_LOCK": "Lock the resolution when UEFI boot Windows/WinPE",
"VTLANG_UEFI_RES_LOCK_NONE": "None",
"VTLANG_UEFI_RES_LOCK_MAX": "Highest",
"VTLANG_UEFI_RES_LOCK_1024_768": "Fixed 1024 x 768",
"VTLANG_UEFI_RES_LOCK_BE1024_768": "At least 1024 x 768",
"MENU_STR_XXX": "" "MENU_STR_XXX": ""
} }
+7 -1
View File
@@ -88,6 +88,12 @@
"VTLANG_WIN11_BYPASS_NRO": "Internetes fiók követelményének megkerülése Windows 11 telepítésekor", "VTLANG_WIN11_BYPASS_NRO": "Internetes fiók követelményének megkerülése Windows 11 telepítésekor",
"VTLANG_LINUX_REMOUNT": "Ventoy partíció csatolása a Linux indítása után", "VTLANG_LINUX_REMOUNT": "Ventoy partíció csatolása a Linux indítása után",
"VTLANG_SECONDARY_BOOT_MENU": "Másodlagos indítási menü megjelenítése", "VTLANG_SECONDARY_BOOT_MENU": "Másodlagos indítási menü megjelenítése",
"VTLANG_WIN_UEFI_RES_LOCK": "Lock the resolution when UEFI boot Windows/WinPE",
"VTLANG_UEFI_RES_LOCK_NONE": "None",
"VTLANG_UEFI_RES_LOCK_MAX": "Highest",
"VTLANG_UEFI_RES_LOCK_1024_768": "Fixed 1024 x 768",
"VTLANG_UEFI_RES_LOCK_BE1024_768": "At least 1024 x 768",
"MENU_STR_XXX": "" "MENU_STR_XXX": ""
} }
+14 -8
View File
@@ -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,20 @@
"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",
"VTLANG_WIN_UEFI_RES_LOCK": "Lock the resolution when UEFI boot Windows/WinPE",
"VTLANG_UEFI_RES_LOCK_NONE": "None",
"VTLANG_UEFI_RES_LOCK_MAX": "Highest",
"VTLANG_UEFI_RES_LOCK_1024_768": "Fixed 1024 x 768",
"VTLANG_UEFI_RES_LOCK_BE1024_768": "At least 1024 x 768",
"MENU_STR_XXX": "" "MENU_STR_XXX": ""
} }
+7 -1
View File
@@ -88,6 +88,12 @@
"VTLANG_WIN11_BYPASS_NRO": "Durante l'installazione di Windows 11 bypassa il requisito di un account online ", "VTLANG_WIN11_BYPASS_NRO": "Durante l'installazione di Windows 11 bypassa il requisito di un account online ",
"VTLANG_LINUX_REMOUNT": "Dopo l'avvio di Linux monta la partizione Ventoy ", "VTLANG_LINUX_REMOUNT": "Dopo l'avvio di Linux monta la partizione Ventoy ",
"VTLANG_SECONDARY_BOOT_MENU": "Visualizza menu di avvio secondario", "VTLANG_SECONDARY_BOOT_MENU": "Visualizza menu di avvio secondario",
"VTLANG_WIN_UEFI_RES_LOCK": "Lock the resolution when UEFI boot Windows/WinPE",
"VTLANG_UEFI_RES_LOCK_NONE": "None",
"VTLANG_UEFI_RES_LOCK_MAX": "Highest",
"VTLANG_UEFI_RES_LOCK_1024_768": "Fixed 1024 x 768",
"VTLANG_UEFI_RES_LOCK_BE1024_768": "At least 1024 x 768",
"MENU_STR_XXX": "" "MENU_STR_XXX": ""
} }
+7 -1
View File
@@ -88,6 +88,12 @@
"VTLANG_WIN11_BYPASS_NRO": "Bypass online account requirement 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_LINUX_REMOUNT": "Mount Ventoy partition after boot Linux",
"VTLANG_SECONDARY_BOOT_MENU": "Show secondary boot menu", "VTLANG_SECONDARY_BOOT_MENU": "Show secondary boot menu",
"VTLANG_WIN_UEFI_RES_LOCK": "Lock the resolution when UEFI boot Windows/WinPE",
"VTLANG_UEFI_RES_LOCK_NONE": "None",
"VTLANG_UEFI_RES_LOCK_MAX": "Highest",
"VTLANG_UEFI_RES_LOCK_1024_768": "Fixed 1024 x 768",
"VTLANG_UEFI_RES_LOCK_BE1024_768": "At least 1024 x 768",
"MENU_STR_XXX": "" "MENU_STR_XXX": ""
} }
+6
View File
@@ -88,6 +88,12 @@
"VTLANG_WIN11_BYPASS_NRO": "Bypass online account requirement 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_LINUX_REMOUNT": "Mount Ventoy partition after boot Linux",
"VTLANG_SECONDARY_BOOT_MENU": "Show secondary boot menu", "VTLANG_SECONDARY_BOOT_MENU": "Show secondary boot menu",
"VTLANG_WIN_UEFI_RES_LOCK": "Lock the resolution when UEFI boot Windows/WinPE",
"VTLANG_UEFI_RES_LOCK_NONE": "None",
"VTLANG_UEFI_RES_LOCK_MAX": "Highest",
"VTLANG_UEFI_RES_LOCK_1024_768": "Fixed 1024 x 768",
"VTLANG_UEFI_RES_LOCK_BE1024_768": "At least 1024 x 768",
"MENU_STR_XXX": "" "MENU_STR_XXX": ""
} }
+7 -1
View File
@@ -88,6 +88,12 @@
"VTLANG_WIN11_BYPASS_NRO": "Windows 11 설치 시 온라인 계정 요구 사항 무시", "VTLANG_WIN11_BYPASS_NRO": "Windows 11 설치 시 온라인 계정 요구 사항 무시",
"VTLANG_LINUX_REMOUNT": "Linux 부팅 후 Ventoy 파티션 마운트", "VTLANG_LINUX_REMOUNT": "Linux 부팅 후 Ventoy 파티션 마운트",
"VTLANG_SECONDARY_BOOT_MENU": "보조 부팅 메뉴 표시", "VTLANG_SECONDARY_BOOT_MENU": "보조 부팅 메뉴 표시",
"VTLANG_WIN_UEFI_RES_LOCK": "UEFI 부팅 시 Windows/WinPE 해상도 고정",
"VTLANG_UEFI_RES_LOCK_NONE": "고정 안 함",
"VTLANG_UEFI_RES_LOCK_MAX": "최고 해상도로 고정",
"VTLANG_UEFI_RES_LOCK_1024_768": "1024 x 768로 고정",
"VTLANG_UEFI_RES_LOCK_BE1024_768": "1024 x 768 이상으로 고정",
"MENU_STR_XXX": "" "MENU_STR_XXX": ""
} }
+99
View File
@@ -0,0 +1,99 @@
{
"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",
"VTLANG_WIN_UEFI_RES_LOCK": "Lock the resolution when UEFI boot Windows/WinPE",
"VTLANG_UEFI_RES_LOCK_NONE": "None",
"VTLANG_UEFI_RES_LOCK_MAX": "Highest",
"VTLANG_UEFI_RES_LOCK_1024_768": "Fixed 1024 x 768",
"VTLANG_UEFI_RES_LOCK_BE1024_768": "At least 1024 x 768",
"MENU_STR_XXX": ""
}
+33 -27
View File
@@ -1,8 +1,8 @@
{ {
"VTLANG_LANGUAGE_NAME": "Polish (Poland)", "VTLANG_LANGUAGE_NAME": "Polish (Poland)",
"VTLANG_STR_HOTKEY_LIST": "L:Język F1:Pomoc F2:Przeglądaj F3:Widok listy F4:Localboot F5:Narzędzia F6:ExMenu", "VTLANG_STR_HOTKEY_LIST": "L:Język F1:Pomoc F2:Przeglądaj F3:Widok listy F4:Localboot F5:Narzędzia F6:ExMenu",
"VTLANG_STR_HOTKEY_TREE": "L:Język F1:Pomoc F2:Przeglądaj F3:Widok drzewa F4:Localboot F5:Narzędzia F6:ExMenu", "VTLANG_STR_HOTKEY_TREE": "L:Język F1:Pomoc F2:Przeglądaj F3:Widok drzewa F4:Localboot F5:Narzędzia F6:ExMenu",
"VTLANG_RETURN_PREVIOUS": "Powrót do poprzedniego menu [Esc]", "VTLANG_RETURN_PREVIOUS": "Powrót do poprzedniego menu [Esc]",
"VTLANG_RETURN_PRV_NOESC": "Powrót do poprzedniego menu", "VTLANG_RETURN_PRV_NOESC": "Powrót do poprzedniego menu",
@@ -28,40 +28,40 @@
"VTLANG_CHKSUM_SHA256_CALC_CHK": "Oblicz i sprawdź sumę sha256", "VTLANG_CHKSUM_SHA256_CALC_CHK": "Oblicz i sprawdź sumę sha256",
"VTLANG_CHKSUM_SHA512_CALC_CHK": "Oblicz i sprawdź sumę sha512", "VTLANG_CHKSUM_SHA512_CALC_CHK": "Oblicz i sprawdź sumę sha512",
"VTLANG_POWER": "Zasilanie", "VTLANG_POWER": "Opcje zasilania",
"VTLANG_POWER_REBOOT": "Uruchom ponownie", "VTLANG_POWER_REBOOT": "Uruchom ponownie",
"VTLANG_POWER_HALT": "Zakończ", "VTLANG_POWER_HALT": "Zakończ",
"VTLANG_POWER_BOOT_EFIFW": "Uruchom ponownie i przejdź do konfiguracji EFI", "VTLANG_POWER_BOOT_EFIFW": "Uruchom ponownie i przejdź do konfiguracji EFI",
"VTLANG_KEYBRD_LAYOUT": "Układy klawiatury", "VTLANG_KEYBRD_LAYOUT": "Układy klawiatury",
"VTLANG_HWINFO": "Informacje o sprzęcie", "VTLANG_HWINFO": "Informacje o konfiguracji sprzętowej",
"VTLANG_RESOLUTION_CFG": "Konfiguracja rozdzielczości", "VTLANG_RESOLUTION_CFG": "Konfiguracja rozdzielczości",
"VTLANG_SCREEN_MODE": "Tryb wyświetlania ekranu", "VTLANG_SCREEN_MODE": "Tryb wyświetlania ekranu",
"VTLANG_SCREEN_TEXT_MODE": "Wymuś tryb tekstowy", "VTLANG_SCREEN_TEXT_MODE": "Wymuś tryb tekstowy",
"VTLANG_SCREEN_GUI_MODE": "Wymuś tryb graficzny", "VTLANG_SCREEN_GUI_MODE": "Wymuś tryb graficzny",
"VTLANG_THEME_SELECT": "Wybór motywu", "VTLANG_THEME_SELECT": "Wybierz motyw",
"VTLANG_UEFI_UTIL": "Narzędzia UEFI Ventoy", "VTLANG_UEFI_UTIL": "Narzędzia Ventoy UEFI",
"VTLANG_UTIL_SHOW_EFI_DRV": "Pokaż sterowniki EFI", "VTLANG_UTIL_SHOW_EFI_DRV": "Pokaż sterowniki EFI",
"VTLANG_UTIL_FIX_BLINIT_FAIL": "Napraw błąd BlinitializeLibrary systemu Windows", "VTLANG_UTIL_FIX_BLINIT_FAIL": "Napraw błąd BlinitializeLibrary systemu Windows",
"VTLANG_JSON_CHK_JSON": "Sprawdź konfigurację wtyczki json (ventoy.json)", "VTLANG_JSON_CHK_JSON": "Sprawdź konfigurację pluginu json (ventoy.json)",
"VTLANG_JSON_CHK_CONTROL": "Sprawdź konfigurację wtyczki globalnej kontroli", "VTLANG_JSON_CHK_CONTROL": "Sprawdź konfigurację pluginu Global Control",
"VTLANG_JSON_CHK_THEME": "Sprawdź konfigurację wtyczki motywu", "VTLANG_JSON_CHK_THEME": "Sprawdź konfigurację pluginu Theme",
"VTLANG_JSON_CHK_AUTOINS": "Sprawdź konfigurację wtyczki automatycznej instalacji", "VTLANG_JSON_CHK_AUTOINS": "Sprawdź konfigurację pluginu Auto Installation",
"VTLANG_JSON_CHK_PERSIST": "Sprawdź konfigurację wtyczki trwałości", "VTLANG_JSON_CHK_PERSIST": "Sprawdź konfigurację pluginu Persistence",
"VTLANG_JSON_CHK_MENU_ALIAS": "Sprawdź konfigurację wtyczek aliasów menu", "VTLANG_JSON_CHK_MENU_ALIAS": "Sprawdź konfigurację pluginu Menu Alias",
"VTLANG_JSON_CHK_MENU_TIP": "Sprawdź konfigurację wtyczki podpowiedzi menu", "VTLANG_JSON_CHK_MENU_TIP": "Sprawdź konfigurację pluginu Menu Tip",
"VTLANG_JSON_CHK_MENU_CLASS": "Sprawdź konfigurację wtyczki klasy menu", "VTLANG_JSON_CHK_MENU_CLASS": "Sprawdź konfigurację pluginu Menu Class",
"VTLANG_JSON_CHK_INJECTION": "Sprawdź konfigurację wtyczki wstrzykiwania", "VTLANG_JSON_CHK_INJECTION": "Sprawdź konfigurację pluginu Injection",
"VTLANG_JSON_CHK_AUTO_MEMDISK": "Sprawdź automatyczną konfigurację wtyczki memdisk", "VTLANG_JSON_CHK_AUTO_MEMDISK": "Sprawdź konfigurację pluginu Auto Memdisk",
"VTLANG_JSON_CHK_IMG_LIST": "Sprawdź konfigurację wtyczki listy obrazów", "VTLANG_JSON_CHK_IMG_LIST": "Sprawdź konfigurację pluginu Image List",
"VTLANG_JSON_CHK_IMG_BLIST": "Sprawdź konfigurację wtyczki czarnej listy obrazów", "VTLANG_JSON_CHK_IMG_BLIST": "Sprawdź konfigurację pluginu Blacklist dla obrazów",
"VTLANG_JSON_CHK_CONF_REPLACE": "Sprawdź konfigurację wtyczki zastępującej konfigurację bootowania", "VTLANG_JSON_CHK_CONF_REPLACE": "Sprawdź konfigurację pluginu Boot Conf Replace",
"VTLANG_JSON_CHK_DUD": "Sprawdź konfigurację wtyczki dud", "VTLANG_JSON_CHK_DUD": "Sprawdź konfigurację pluginu DUD (Driver Update Disk)",
"VTLANG_JSON_CHK_PASSWORD": "Sprawdź konfigurację wtyczki hasła", "VTLANG_JSON_CHK_PASSWORD": "Sprawdź konfigurację pluginu Password",
"VTLANG_NORMAL_MODE": "Uruchom w trybie normalnym", "VTLANG_NORMAL_MODE": "Uruchom w trybie normalnym",
"VTLANG_WIMBOOT_MODE": "Uruchom w trybie Wimboot", "VTLANG_WIMBOOT_MODE": "Uruchom w trybie Wimboot",
@@ -74,7 +74,7 @@
"VTLANG_NO_AUTOINS_SCRIPT": "Uruchom bez szablonu automatycznej instalacji", "VTLANG_NO_AUTOINS_SCRIPT": "Uruchom bez szablonu automatycznej instalacji",
"VTLANG_AUTOINS_USE": "Uruchom z", "VTLANG_AUTOINS_USE": "Uruchom z",
"VTLANG_NO_PERSIST": "Uruchom bez zachowania", "VTLANG_NO_PERSIST": "Uruchom bez persistence (zapisywania ustawień)",
"VTLANG_PERSIST_USE": "Uruchom z", "VTLANG_PERSIST_USE": "Uruchom z",
"VTLANG_BROWER_RETURN": "Powrót", "VTLANG_BROWER_RETURN": "Powrót",
@@ -84,10 +84,16 @@
"VTLANG_ENTER_CONTINUE": "naciśnij klawisz Enter, aby kontynuować", "VTLANG_ENTER_CONTINUE": "naciśnij klawisz Enter, aby kontynuować",
"VTLANG_CTRL_TEMP_SET": "Tymczasowe ustawienia kontroli", "VTLANG_CTRL_TEMP_SET": "Tymczasowe ustawienia kontroli",
"VTLANG_WIN11_BYPASS_CHECK": "Pominięcie kontroli CPU/TPM/SecureBoot podczas instalacji Windows 11", "VTLANG_WIN11_BYPASS_CHECK": "Pominięcie sprawdzania CPU/TPM/SecureBoot podczas instalacji Windows 11",
"VTLANG_WIN11_BYPASS_NRO": "Pominięcie wymogu posiadania konta online podczas instalacji systemu Windows 11", "VTLANG_WIN11_BYPASS_NRO": "Pominięcie wymogu posiadania konta Microsoft podczas instalacji Windows 11",
"VTLANG_LINUX_REMOUNT": "Zamontuj partycję Ventoy po starcie Linuksa", "VTLANG_LINUX_REMOUNT": "Zamontuj partycję Ventoy po uruchomieniu Linuksa",
"VTLANG_SECONDARY_BOOT_MENU": "Pokaż dodatkowe menu startowe", "VTLANG_SECONDARY_BOOT_MENU": "Pokaż dodatkowe menu rozruchowe (boot menu)",
"VTLANG_WIN_UEFI_RES_LOCK": "Zablokuj rozdzielczość podczas bootowania UEFI Windows/WinPE",
"VTLANG_UEFI_RES_LOCK_NONE": "Brak",
"VTLANG_UEFI_RES_LOCK_MAX": "Najwyższa",
"VTLANG_UEFI_RES_LOCK_1024_768": "Stała 1024 x 768",
"VTLANG_UEFI_RES_LOCK_BE1024_768": "Co najmniej 1024 x 768",
"MENU_STR_XXX": "" "MENU_STR_XXX": ""
} }
+7 -1
View File
@@ -88,6 +88,12 @@
"VTLANG_WIN11_BYPASS_NRO": "Ignorar o requerimento de conta online quanto instalar o Windows 11", "VTLANG_WIN11_BYPASS_NRO": "Ignorar o requerimento de conta online quanto instalar o Windows 11",
"VTLANG_LINUX_REMOUNT": "Montar a partição do Ventoy após iniciar o Linux", "VTLANG_LINUX_REMOUNT": "Montar a partição do Ventoy após iniciar o Linux",
"VTLANG_SECONDARY_BOOT_MENU": "Mostrar o menu secundário da inicialização", "VTLANG_SECONDARY_BOOT_MENU": "Mostrar o menu secundário da inicialização",
"VTLANG_WIN_UEFI_RES_LOCK": "Lock the resolution when UEFI boot Windows/WinPE",
"VTLANG_UEFI_RES_LOCK_NONE": "None",
"VTLANG_UEFI_RES_LOCK_MAX": "Highest",
"VTLANG_UEFI_RES_LOCK_1024_768": "Fixed 1024 x 768",
"VTLANG_UEFI_RES_LOCK_BE1024_768": "At least 1024 x 768",
"MENU_STR_XXX": "" "MENU_STR_XXX": ""
} }
+7 -1
View File
@@ -88,6 +88,12 @@
"VTLANG_WIN11_BYPASS_NRO": "Ignorar requerimento de conta online quanto instalando Windows 11", "VTLANG_WIN11_BYPASS_NRO": "Ignorar requerimento de conta online quanto instalando Windows 11",
"VTLANG_LINUX_REMOUNT": "Montar partição Ventoy após boot do Linux", "VTLANG_LINUX_REMOUNT": "Montar partição Ventoy após boot do Linux",
"VTLANG_SECONDARY_BOOT_MENU": "Mostar menu seundário de boot", "VTLANG_SECONDARY_BOOT_MENU": "Mostar menu seundário de boot",
"VTLANG_WIN_UEFI_RES_LOCK": "Lock the resolution when UEFI boot Windows/WinPE",
"VTLANG_UEFI_RES_LOCK_NONE": "None",
"VTLANG_UEFI_RES_LOCK_MAX": "Highest",
"VTLANG_UEFI_RES_LOCK_1024_768": "Fixed 1024 x 768",
"VTLANG_UEFI_RES_LOCK_BE1024_768": "At least 1024 x 768",
"MENU_STR_XXX": "" "MENU_STR_XXX": ""
} }
+7 -1
View File
@@ -88,6 +88,12 @@
"VTLANG_WIN11_BYPASS_NRO": "Обойти требование сетевой учётной записи при установке Windows 11", "VTLANG_WIN11_BYPASS_NRO": "Обойти требование сетевой учётной записи при установке Windows 11",
"VTLANG_LINUX_REMOUNT": "Смонтировать раздел Ventoy после загрузки Linux", "VTLANG_LINUX_REMOUNT": "Смонтировать раздел Ventoy после загрузки Linux",
"VTLANG_SECONDARY_BOOT_MENU": "Показать вторичное загрузочное меню", "VTLANG_SECONDARY_BOOT_MENU": "Показать вторичное загрузочное меню",
"VTLANG_WIN_UEFI_RES_LOCK": "Lock the resolution when UEFI boot Windows/WinPE",
"VTLANG_UEFI_RES_LOCK_NONE": "None",
"VTLANG_UEFI_RES_LOCK_MAX": "Highest",
"VTLANG_UEFI_RES_LOCK_1024_768": "Fixed 1024 x 768",
"VTLANG_UEFI_RES_LOCK_BE1024_768": "At least 1024 x 768",
"MENU_STR_XXX": "" "MENU_STR_XXX": ""
} }
+6
View File
@@ -88,6 +88,12 @@
"VTLANG_WIN11_BYPASS_NRO": "Obid zahteve po spletnem računu pri namestitvi sistema Windows 11", "VTLANG_WIN11_BYPASS_NRO": "Obid zahteve po spletnem računu pri namestitvi sistema Windows 11",
"VTLANG_LINUX_REMOUNT": "Priklopi Ventoy particijo po zagonu Linuxa", "VTLANG_LINUX_REMOUNT": "Priklopi Ventoy particijo po zagonu Linuxa",
"VTLANG_SECONDARY_BOOT_MENU": "Prikaz sekundarnega zagonskega menija", "VTLANG_SECONDARY_BOOT_MENU": "Prikaz sekundarnega zagonskega menija",
"VTLANG_WIN_UEFI_RES_LOCK": "Lock the resolution when UEFI boot Windows/WinPE",
"VTLANG_UEFI_RES_LOCK_NONE": "None",
"VTLANG_UEFI_RES_LOCK_MAX": "Highest",
"VTLANG_UEFI_RES_LOCK_1024_768": "Fixed 1024 x 768",
"VTLANG_UEFI_RES_LOCK_BE1024_768": "At least 1024 x 768",
"MENU_STR_XXX": "" "MENU_STR_XXX": ""
} }
+7 -1
View File
@@ -88,6 +88,12 @@
"VTLANG_WIN11_BYPASS_NRO": "Bypass online account requirement 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_LINUX_REMOUNT": "Mount Ventoy partition after boot Linux",
"VTLANG_SECONDARY_BOOT_MENU": "Show secondary boot menu", "VTLANG_SECONDARY_BOOT_MENU": "Show secondary boot menu",
"VTLANG_WIN_UEFI_RES_LOCK": "Lock the resolution when UEFI boot Windows/WinPE",
"VTLANG_UEFI_RES_LOCK_NONE": "None",
"VTLANG_UEFI_RES_LOCK_MAX": "Highest",
"VTLANG_UEFI_RES_LOCK_1024_768": "Fixed 1024 x 768",
"VTLANG_UEFI_RES_LOCK_BE1024_768": "At least 1024 x 768",
"MENU_STR_XXX": "" "MENU_STR_XXX": ""
} }
+7 -1
View File
@@ -88,6 +88,12 @@
"VTLANG_WIN11_BYPASS_NRO": "விண்டோஸ் 11 ஐ நிறுவும் போது ஆன்லைன் கணக்கின் தேவையை புறக்கணிக்கவும்", "VTLANG_WIN11_BYPASS_NRO": "விண்டோஸ் 11 ஐ நிறுவும் போது ஆன்லைன் கணக்கின் தேவையை புறக்கணிக்கவும்",
"VTLANG_LINUX_REMOUNT": "லினக்ஸை துவக்கிய பிறகு Ventoy பகிர்வை ஏற்றவும்", "VTLANG_LINUX_REMOUNT": "லினக்ஸை துவக்கிய பிறகு Ventoy பகிர்வை ஏற்றவும்",
"VTLANG_SECONDARY_BOOT_MENU": "இரண்டாம் நிலை துவக்க பட்டியலைக் காட்டு", "VTLANG_SECONDARY_BOOT_MENU": "இரண்டாம் நிலை துவக்க பட்டியலைக் காட்டு",
"VTLANG_WIN_UEFI_RES_LOCK": "Lock the resolution when UEFI boot Windows/WinPE",
"VTLANG_UEFI_RES_LOCK_NONE": "None",
"VTLANG_UEFI_RES_LOCK_MAX": "Highest",
"VTLANG_UEFI_RES_LOCK_1024_768": "Fixed 1024 x 768",
"VTLANG_UEFI_RES_LOCK_BE1024_768": "At least 1024 x 768",
"MENU_STR_XXX": "" "MENU_STR_XXX": ""
} }
+6
View File
@@ -88,6 +88,12 @@
"VTLANG_WIN11_BYPASS_NRO": "Windows11'i yüklerken, çevrimiçi hesap gereksinimini(OOBE) atla", "VTLANG_WIN11_BYPASS_NRO": "Windows11'i yüklerken, çevrimiçi hesap gereksinimini(OOBE) atla",
"VTLANG_LINUX_REMOUNT": "Linux sistemi önyükledikten sonra, Ventoy bölümünü bağla", "VTLANG_LINUX_REMOUNT": "Linux sistemi önyükledikten sonra, Ventoy bölümünü bağla",
"VTLANG_SECONDARY_BOOT_MENU": "İkincil önyükleme menüsünü göster", "VTLANG_SECONDARY_BOOT_MENU": "İkincil önyükleme menüsünü göster",
"VTLANG_WIN_UEFI_RES_LOCK": "Lock the resolution when UEFI boot Windows/WinPE",
"VTLANG_UEFI_RES_LOCK_NONE": "None",
"VTLANG_UEFI_RES_LOCK_MAX": "Highest",
"VTLANG_UEFI_RES_LOCK_1024_768": "Fixed 1024 x 768",
"VTLANG_UEFI_RES_LOCK_BE1024_768": "At least 1024 x 768",
"MENU_STR_XXX": "" "MENU_STR_XXX": ""
} }
+7 -1
View File
@@ -88,6 +88,12 @@
"VTLANG_WIN11_BYPASS_NRO": "Обійти вимогу онлайн-аккаунту під час інсталяції Windows 11", "VTLANG_WIN11_BYPASS_NRO": "Обійти вимогу онлайн-аккаунту під час інсталяції Windows 11",
"VTLANG_LINUX_REMOUNT": "Монтувати розділ Ventoy після завантаження Linux", "VTLANG_LINUX_REMOUNT": "Монтувати розділ Ventoy після завантаження Linux",
"VTLANG_SECONDARY_BOOT_MENU": "Показувати вторинне меню завантаження", "VTLANG_SECONDARY_BOOT_MENU": "Показувати вторинне меню завантаження",
"VTLANG_WIN_UEFI_RES_LOCK": "Lock the resolution when UEFI boot Windows/WinPE",
"VTLANG_UEFI_RES_LOCK_NONE": "None",
"VTLANG_UEFI_RES_LOCK_MAX": "Highest",
"VTLANG_UEFI_RES_LOCK_1024_768": "Fixed 1024 x 768",
"VTLANG_UEFI_RES_LOCK_BE1024_768": "At least 1024 x 768",
"MENU_STR_XXX": "" "MENU_STR_XXX": ""
} }
+7 -1
View File
@@ -88,6 +88,12 @@
"VTLANG_WIN11_BYPASS_NRO": "Bỏ qua yêu cầu tài khoản trực tuyến khi cài đặt Windows 11", "VTLANG_WIN11_BYPASS_NRO": "Bỏ qua yêu cầu tài khoản trực tuyến khi cài đặt Windows 11",
"VTLANG_LINUX_REMOUNT": "Gắn phân vùng Ventoy sau khi khởi động GNU/Linux", "VTLANG_LINUX_REMOUNT": "Gắn phân vùng Ventoy sau khi khởi động GNU/Linux",
"VTLANG_SECONDARY_BOOT_MENU": "Hiện menu khởi động thứ cấp`", "VTLANG_SECONDARY_BOOT_MENU": "Hiện menu khởi động thứ cấp`",
"VTLANG_WIN_UEFI_RES_LOCK": "Lock the resolution when UEFI boot Windows/WinPE",
"VTLANG_UEFI_RES_LOCK_NONE": "None",
"VTLANG_UEFI_RES_LOCK_MAX": "Highest",
"VTLANG_UEFI_RES_LOCK_1024_768": "Fixed 1024 x 768",
"VTLANG_UEFI_RES_LOCK_BE1024_768": "At least 1024 x 768",
"MENU_STR_XXX": "" "MENU_STR_XXX": ""
} }
+5
View File
@@ -88,6 +88,11 @@
"VTLANG_WIN11_BYPASS_NRO": "安装 Windows 11 时绕过在线账户的要求", "VTLANG_WIN11_BYPASS_NRO": "安装 Windows 11 时绕过在线账户的要求",
"VTLANG_LINUX_REMOUNT": "启动 Linux 系统后挂载 Ventoy 分区", "VTLANG_LINUX_REMOUNT": "启动 Linux 系统后挂载 Ventoy 分区",
"VTLANG_SECONDARY_BOOT_MENU": "显示二级启动菜单", "VTLANG_SECONDARY_BOOT_MENU": "显示二级启动菜单",
"VTLANG_WIN_UEFI_RES_LOCK": "UEFI启动 Windows/WinPE 时锁定分辨率",
"VTLANG_UEFI_RES_LOCK_NONE": "不锁定",
"VTLANG_UEFI_RES_LOCK_MAX": "锁定最高分辨率",
"VTLANG_UEFI_RES_LOCK_1024_768": "锁定 1024 x 768",
"VTLANG_UEFI_RES_LOCK_BE1024_768": "锁定 1024 x 768 及以上",
"MENU_STR_XXX": "" "MENU_STR_XXX": ""
} }
+6 -1
View File
@@ -88,6 +88,11 @@
"VTLANG_WIN11_BYPASS_NRO": "安裝 Windows 11 時繞過登入帳戶的需求", "VTLANG_WIN11_BYPASS_NRO": "安裝 Windows 11 時繞過登入帳戶的需求",
"VTLANG_LINUX_REMOUNT": "啟動 Linux 系統後掛載 Ventoy 分區", "VTLANG_LINUX_REMOUNT": "啟動 Linux 系統後掛載 Ventoy 分區",
"VTLANG_SECONDARY_BOOT_MENU": "顯示次要啟動選單", "VTLANG_SECONDARY_BOOT_MENU": "顯示次要啟動選單",
"VTLANG_WIN_UEFI_RES_LOCK": "Lock the resolution when UEFI boot Windows/WinPE",
"VTLANG_UEFI_RES_LOCK_NONE": "None",
"VTLANG_UEFI_RES_LOCK_MAX": "Highest",
"VTLANG_UEFI_RES_LOCK_1024_768": "Fixed 1024 x 768",
"VTLANG_UEFI_RES_LOCK_BE1024_768": "At least 1024 x 768",
"MENU_STR_XXX": "" "MENU_STR_XXX": ""
} }
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/expect -f
set password [lindex $argv 0]
set key_file [lindex $argv 1]
set cert_file [lindex $argv 2]
set input_file [lindex $argv 3]
set output_file [lindex $argv 4]
spawn bash -c "sbsign --key '$key_file' --cert '$cert_file' --output '$output_file' '$input_file' 2>&1"
expect -nocase -re "Enter PEM pass phrase:"
send "$password\r"
expect eof
set ret [wait]
exit [lindex $ret 3]
Binary file not shown.
+1 -1
View File
@@ -186,7 +186,7 @@ if [ "$MODE" = "install" -a -z "$NONDESTRUCTIVE" ]; then
else else
if parted -v > /dev/null 2>&1; then if parted -v > /dev/null 2>&1; then
PARTTOOL='parted' PARTTOOL='parted'
elif fdisk -v >/dev/null 2>&1; then elif command -v fdisk > /dev/null 2>&1; then
PARTTOOL='fdisk' PARTTOOL='fdisk'
else else
vterr "Both parted and fdisk are not found in the system, Ventoy can't create new partitions." vterr "Both parted and fdisk are not found in the system, Ventoy can't create new partitions."
+38
View 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
+3 -1
View File
@@ -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.
+99
View File
@@ -1,5 +1,59 @@
#!/bin/sh #!/bin/sh
if [ "$VENTOY_CERT_PASS" = "YES" ]; then
read -s -p "Enter cert key passphrase: " KEY_PASS
echo
if openssl pkey -in "$VENTOY_CERT_KEY" -passin pass:"$KEY_PASS" -out /dev/null > /dev/null 2>&1; then
echo "Password check OK"
else
echo "Incorrect password"
exit 1
fi
fi
sign_efi() {
efi=$1
if [ ! -f "$efi" ]; then
printf "### %-64s non-exist\n" "$efi"
return
fi
#Don't sign if VENTOY_CERT_KEY is not defined.
if [ -z "$VENTOY_CERT_KEY" -o -z "$VENTOY_CERT_PEM" ]; then
printf "### %-64s NO-CA\n" "$efi"
return
fi
if echo $efi | grep -q '\.xz$'; then
xzcat $efi > ${efi}.unxz
mv ${efi}.unxz ${efi}
fi
rm -f "${efi}.signed"
if [ "$VENTOY_CERT_PASS" = "YES" ]; then
expect -f ./sign_with_pass.exp "$KEY_PASS" "$VENTOY_CERT_KEY" "$VENTOY_CERT_PEM" "${efi}" "${efi}.signed" >/dev/null 2>&1
else
sbsign --key "$VENTOY_CERT_KEY" --cert "$VENTOY_CERT_PEM" --output "${efi}.signed" "${efi}" >/dev/null 2>&1
fi
if [ -f "${efi}.signed" ]; then
if echo $efi | grep -q '\.xz$'; then
xz --check=crc32 "${efi}.signed"
mv "${efi}.signed.xz" "$efi"
rm -f "${efi}.signed"
else
mv "${efi}.signed" "$efi"
fi
else
printf "### %-64s failed\n" "$efi"
exit 1
fi
printf "### %-64s success\n" "$efi"
}
if [ "$1" = "CI" ]; then if [ "$1" = "CI" ]; then
OPT='-dR' OPT='-dR'
else else
@@ -126,11 +180,49 @@ 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
sign_efi $tmpmnt/EFI/BOOT/fbia32.efi
sign_efi $tmpmnt/EFI/BOOT/fbaa64.efi
sign_efi $tmpmnt/EFI/BOOT/grubx64_real.efi
sign_efi $tmpmnt/EFI/BOOT/grubia32_real.efi
sign_efi $tmpmnt/ventoy/iso9660_x64.efi
sign_efi $tmpmnt/ventoy/iso9660_ia32.efi
sign_efi $tmpmnt/ventoy/iso9660_aa64.efi
sign_efi $tmpmnt/ventoy/udf_x64.efi
sign_efi $tmpmnt/ventoy/udf_ia32.efi
sign_efi $tmpmnt/ventoy/udf_aa64.efi
sign_efi $tmpmnt/ventoy/ventoy_x64.efi
sign_efi $tmpmnt/ventoy/ventoy_ia32.efi
sign_efi $tmpmnt/ventoy/ventoy_aa64.efi
sign_efi $tmpmnt/ventoy/vtoyutil_x64.efi
sign_efi $tmpmnt/ventoy/vtoyutil_ia32.efi
sign_efi $tmpmnt/ventoy/vtoyutil_aa64.efi
sign_efi $tmpmnt/ventoy/wimboot.i386.efi.xz
sign_efi $tmpmnt/ventoy/wimboot.x86_64.xz
#inject Ventoy Grub sign sha256 value into VtoyShim
grub_sha256=$(sha256sum $tmpmnt/EFI/BOOT/grubx64_real.efi | awk '{print $1}')
magic_cnt=$(hexdump -C $tmpmnt/EFI/BOOT/fbx64.efi | grep '26 26 26 26 26 26 26 26' | wc -l)
if [ $magic_cnt -ne 1 ]; then
echo "hash magic duplicate"
exit 1
fi
magic_off_hex=$(hexdump -C $tmpmnt/EFI/BOOT/fbx64.efi | grep '26 26 26 26 26 26 26 26' | awk '{print $1}')
magic_off=$(printf '%u' "0x${magic_off_hex}")
echo_cmd=$(echo $grub_sha256 | sed 's/\(..\)/\\x\1/g')
echo Ventoy Grub hash $grub_sha256
echo -en "$echo_cmd" | dd bs=1 count=32 of=$tmpmnt/EFI/BOOT/fbx64.efi seek=$magic_off conv=notrunc status=none
sign_efi $tmpmnt/EFI/BOOT/fbx64.efi
umount $tmpmnt && rm -rf $tmpmnt umount $tmpmnt && rm -rf $tmpmnt
@@ -270,6 +362,13 @@ cd $CurDir
mv ../LiveCDGUI/ventoy*.iso ./ mv ../LiveCDGUI/ventoy*.iso ./
if [ -e ventoy-${curver}-windows.zip ] && [ -e ventoy-${curver}-linux.tar.gz ]; then if [ -e ventoy-${curver}-windows.zip ] && [ -e ventoy-${curver}-linux.tar.gz ]; then
if [ -z "$VENTOY_CERT_KEY" -o -z "$VENTOY_CERT_PEM" ]; then
echo "[warning]: EFI files are not signed and can only boot when Secure Boot is disabled."
echo "[warning]: EFI files are not signed and can only boot when Secure Boot is disabled."
echo "[warning]: EFI files are not signed and can only boot when Secure Boot is disabled."
fi
echo -e "\n ============= SUCCESS =================\n" echo -e "\n ============= SUCCESS =================\n"
else else
echo -e "\n ============= FAILED =================\n" echo -e "\n ============= FAILED =================\n"

Some files were not shown because too many files have changed in this diff Show More