Compare commits

...

262 Commits

Author SHA1 Message Date
longpanda
0961ce5624 1.0.91 release 2023-04-05 20:41:34 +08:00
longpanda
07574f0379 Improve grub2 mode process for legacy BIOS mode. 2023-04-05 20:16:36 +08:00
Steve
142aa47944 fixed german translation (#2318)
* Updated german translation

#2277 has an small issue (misstyping; "nocht" should read "noch")
Changed the translation. It is minimally shorter.

* fixed german translation
2023-04-04 13:54:49 +08:00
longpanda
11739fa9d0 Fix a bug that Fedora boot error if Ventoy partition is NTFS. (#2333) 2023-04-03 21:49:21 +08:00
longpanda
9fc85051a7 Fix the issue for booting Bliss OS 15.x 2023-04-03 09:18:13 +08:00
longpanda
b9e82bcf16 Support FreeBSD 14-CURRENT 2023-04-02 13:17:20 +08:00
longpanda
cff3a01289 Support NTFS with large cluster size (greater than 64KB). 2023-03-28 11:38:46 +08:00
longpanda
0f90149c4e 1.0.90 release 2023-03-26 19:01:13 +08:00
longpanda
8ef9732931 Update vtoytool 2023-03-26 16:03:32 +08:00
longpanda
b32eda4262 Fix the VTOY_LINUX_REMOUNT option for new linux kernel in intel 11th(and later) gen CPU. 2023-03-26 10:45:19 +08:00
longpanda
e743f7c15f Add support for chimera linux. (#2309) 2023-03-24 20:43:47 +08:00
longpanda
652475f1ef Optimization for Fedora boot process 2023-03-24 10:37:24 +08:00
longpanda
abfc2a6343 Add checksum jif 2023-03-21 15:44:54 +08:00
longpanda
e73ac04cb6 update README.md 2023-03-20 17:15:36 +08:00
StoyanDimitrov
8727e63880 Update languages.json (#2299) 2023-03-17 17:39:57 +08:00
VenusGirl❤
2d281d7dee Update ko_KR.json (#2286)
Korean Update
2023-03-17 17:39:21 +08:00
Steve
385c806adf Updated german translation (#2279)
#2277 has an small issue (misstyping; "nocht" should read "noch")
Changed the translation. It is minimally shorter.
2023-03-17 17:39:02 +08:00
longpanda
e869bc2386 Fix the issue that Fedora Rawhide install media not detected. (#2283) 2023-03-10 22:33:53 +08:00
longpanda
b47aa1abc7 Support LibreELEC 11.0+ (#2281) 2023-03-09 23:59:12 +08:00
longpanda
d8698b2194 1.0.89 release 2023-03-07 19:21:15 +08:00
longpanda
7fa4724743 Fix the menu missing issue when there exist an invalid vlnk file. (#2228) 2023-03-07 18:05:33 +08:00
WebSnke
2717405a7a Add German translation for STR_4KN_UNSUPPORTED (#2277) 2023-03-05 20:59:09 +08:00
wiz64
d494007df9 update japanese (#2264) 2023-03-05 20:58:55 +08:00
Tayfun Akkoyun
bc9e3f641b Update tr_TR.txt (#2262)
Long translations edited to be shorter
2023-03-05 20:58:32 +08:00
dmitrygribenchuk
9f02d37001 Update translation (#2261)
* update translation

* update translation
2023-03-05 20:58:16 +08:00
Thunderstrike116
fa1461bac7 Add Greek Language (#2258)
* Added Greek Translation

* Added Greek Translation
2023-03-05 20:57:55 +08:00
marcellogianola
3d56c3fa17 Update languages.json (#2257) 2023-03-05 20:57:29 +08:00
ИEØ_ΙΙØZ
a7e3d78d14 Update zh_TW.json (#2256) 2023-03-05 20:57:05 +08:00
longpanda
879a7592bd Fix dm_patch for new linux kernel. 2023-02-20 11:59:03 +08:00
longpanda
5a433f49f7 Optimization for booting Fedora series. 2023-02-18 21:33:05 +08:00
Ikko Eltociear Ashimine
0cce956c54 Fix typo in EXT/README.txt (#2247)
bellow -> below
2023-02-18 21:31:37 +08:00
Ing. Jan Kaláb
0b6372857c Fix typo in Czech translation (#2252)
Thanks to Jiří Červinka
2023-02-18 21:31:19 +08:00
M
028663de9a Update Polish translation (#2232) 2023-02-18 21:31:09 +08:00
Tyemak
5feb3f7b4b Update languages.json (#2230) 2023-02-18 21:30:48 +08:00
longpanda
7035787f38 update languages.json 2023-02-08 10:42:35 +08:00
ИEØ_ΙΙØZ
7dd0f509f5 Update languages.json (#2207)
Fixed one string for Traditional Chinese,
Sorry, I missed it in my last submission.
2023-02-08 10:37:35 +08:00
andrewczm
15947caea2 Updated Polish translation (#2212)
* Update pl_PL.json

A few corrections to the Polish translation

* Update pl_PL.json

small correction

* Update pl_PL.json

the latest update

* Updated Polish translation

Some cosmetic corrections in the Polish translation
2023-02-08 10:36:39 +08:00
YALdysse
6aeba8f8b4 fix ukrainian language (#2222) 2023-02-08 10:36:16 +08:00
ИEØ_ΙΙØZ
fd46b2c3c3 Update languages.json (#2204)
add & correct some strings
2023-02-02 15:51:28 +08:00
YALdysse
e502f4291e Ukrainian language (#2199) 2023-02-02 15:50:22 +08:00
andrewczm
9c59c27eff Update pl_PL.json (#2191)
* Update pl_PL.json

A few corrections to the Polish translation

* Update pl_PL.json

small correction

* Update pl_PL.json

the latest update
2023-02-02 15:50:02 +08:00
YALdysse
daeb96ce80 fixed russian translation (#2190) 2023-02-02 15:49:42 +08:00
YALdysse
b7e878c466 fixed russian translation (#2189) 2023-02-02 15:49:28 +08:00
VenusGirl❤
b76ebf5b07 Update languages.json (#2186) 2023-02-02 15:49:10 +08:00
VenusGirl❤
9532776f39 Update ko_KR.txt (#2188)
* Update ko_KR.txt

* Update ko_KR.txt
2023-02-02 15:48:43 +08:00
Ing. Jan Kaláb
d8e81d41e4 Czech translation (#2185)
* Czech translation

* Fix missing translations

---------

Co-authored-by: Ing. Jan Kaláb <jan@kalabovi.org>
2023-02-02 15:48:16 +08:00
VenusGirl❤
fa3aa3b36f Update ko_KR.json (#2177)
* Update ko_KR.json

* Update ko_KR.json

* Update ko_KR.json
2023-02-02 15:47:48 +08:00
MELERIX
e717d00d53 Update Spanish Latinoamérica translation (#2179) 2023-02-02 15:47:30 +08:00
wiz64
6bcaf19a1a Update languages.json (#2172) 2023-01-16 15:35:25 +08:00
wiz64
bcbe8835d4 update Russian and Bengali languages.json (#2167) 2023-01-15 21:10:25 +08:00
gidano
ed746ce13e Fixed hungarian text (#2163) 2023-01-15 21:10:11 +08:00
VenusGirl❤
07a790fc6a Update languages.json (#2160)
Korean Update
2023-01-15 21:09:54 +08:00
Tayfun Akkoyun
fd393a02fd Update languages.json (#2159)
"STR_4KN_UNSUPPORTED" line is translated to turkish language
2023-01-15 21:09:37 +08:00
longpanda
0501d03dbb Fix the syntax error in hu_HU.json 2023-01-15 13:15:51 +08:00
longpanda
c9939a8cfc Ignore reserved space when do non-destructive installation via GUI. (#2168) 2023-01-15 09:41:46 +08:00
longpanda
5067020a61 Add tip message when theme file contains non-enclosed literal values. (#2166) 2023-01-14 23:07:08 +08:00
longpanda
4f5334026e 1. Fix the issue that Ventoy2Disk_X64.exe can not run under altexe directory.
2. Fix the issue that VentoyPlugson_X64.exe exit silently.
3. Add missing /FS option for Ventoy2Disk.exe in Windows command line mode.
4. Ventoy2Disk.exe automatically change current directory when started from other directory.
2023-01-14 21:56:19 +08:00
longpanda
3e34dd8514 1.0.88 release 2023-01-13 21:57:44 +08:00
longpanda
4df793e021 1. Add new options for Windows CLI mode.
2. Add tip message for 4k native disk.
2023-01-13 20:55:40 +08:00
longpanda
e0132ac4b5 switch to en_US when use text mode. 2023-01-10 16:17:08 +08:00
VenusGirl❤
2b3192b098 Update ko_KR.json (#2152) 2023-01-10 15:48:22 +08:00
민웅기
7ee3a6d9f8 Update ko_KR (부트 -> 부팅) (#2147)
Changed the word "boot" to be spelled "부팅" rather than "부트" in the general context.

일반적인 맥락에서 단어 "boot"는 부트보다 부팅로 표기되므로 변경하였습니다.
2023-01-10 15:09:29 +08:00
Pierfrancesco Passerini
e1d3ca9fc4 Update italian language (#2141)
Small fix to Italian
2023-01-10 15:09:17 +08:00
Stefan Šućur
8653832551 Fixed and updated Serbian translations (both writing systems) (#2144)
* Update Serbian (both writing systems)

Fixed a stray Cyrillic word in the Latin text.
Translated the untranslated strings in both texts.
Changed a word in both texts.
Added part of a string that was missing in the Cyrillic version.
Fixed spelling mistakes in the Cyrillic text.

* Update languages.json

Added myself to the credits of the Cyrillic text too, as I forgot to do so earlier.
2023-01-10 15:08:54 +08:00
longpanda
c308892db0 Show file checksum menu title according to the existence of checksum value. 2023-01-10 12:23:35 +08:00
longpanda
1300f7f4f1 Fix the VHD(x) boot issue introduced in 1.0.87. 2023-01-10 09:37:05 +08:00
longpanda
d9182dbfa4 Fix the syntax error in F4 localboot 2023-01-10 09:17:18 +08:00
longpanda
e988c0dfe2 Fix that workaround #2 not working for Legacy BIOS access limit. 2023-01-08 21:35:50 +08:00
longpanda
0714971f8c Fix VTOY_WIN11_BYPASS_CHECK/VTOY_WIN11_BYPASS_NRO option web page display issue. 2023-01-07 20:14:38 +08:00
longpanda
3c03df31ce 1.0.87 release 2023-01-07 15:57:53 +08:00
longpanda
e24dacadcd Add /F option for VentoyPlugson.exe to use the system default browser.
By default it will firstly try to use Google Chrome if possible.
2023-01-07 15:35:47 +08:00
longpanda
315cabb945 Fix the file path when file checksum in F2 browse mode. 2023-01-07 11:33:04 +08:00
longpanda
72f25f14fc Merge branch 'master' of https://github.com/ventoy/Ventoy 2023-01-06 21:26:39 +08:00
longpanda
47e1553d23 Optimization for VTOY_WIN11_BYPASS_NRO option process. 2023-01-06 21:26:31 +08:00
MELERIX
9a2a7e83eb Add Spanish Translation (json/txt) grub menu (#2135)
* Add Spanish Tranlsation (json/txt) grub menu

* renamed
2023-01-06 12:23:05 +08:00
K.B.Dharun Krishna
5f747148c6 grub/menu: Update Tamil translation (#2133) 2023-01-06 11:55:40 +08:00
longpanda
686ed11037 Optimization for Lenovo Recovery Image (USB unplug process) 2023-01-05 22:18:39 +08:00
longpanda
7fe4762faa 1. grub2 mode supports Porteus ISO file.
2. Optimization for Lenovo Recovery Image.
2023-01-04 21:46:40 +08:00
longpanda
eac1c35f76 Fix the bug when F2 browse and boot VHD/VHDX files in an extend logic partition. 2023-01-04 19:22:02 +08:00
longpanda
c7dcaa5734 1. Fix the blank item in the last of Language select menu
2. Fix the menu display VTLANG_NO_PERSISTENCE issue when use persistence
2023-01-04 19:19:32 +08:00
longpanda
4b17ee30c4 Add "return to previous menu" in secondary boot menu for convenience. 2023-01-04 15:55:32 +08:00
longpanda
a18aa36c01 Code optimization 2023-01-04 15:39:03 +08:00
Tyemak
1de7489c6d Update ru_RU.txt (#2130) 2023-01-03 20:58:13 +08:00
longpanda
afb3340ce7 Disable Fn/L/Ctrl hotkeys when selecting auto install script or perssitence file. 2023-01-03 19:11:36 +08:00
longpanda
fdce4a756a Add support for Dell PER ISO. (#2113) 2023-01-03 16:43:17 +08:00
longpanda
5a7fa0c565 Support lenovo product recovery iso file. 2023-01-03 11:35:27 +08:00
longpanda
287d77224c Disable Fn/L/Ctrl hotkeys on select WIM menu. 2023-01-03 11:29:50 +08:00
longpanda
c6bd857cbe Support BSD style for .md5/.sha1/.sh256/.sha512 checksum file.
Support VENTOY_CHECKSUM file for checksum file.
(#2112)
2023-01-01 00:31:08 +08:00
wiz64
b4bb6efd3c Update ru_RU.txt (#2120) 2022-12-31 20:59:08 +08:00
Hildo Guillardi Júnior
7386f64ed8 Update pt_PT.json (#2118) 2022-12-31 20:58:50 +08:00
Hildo Guillardi Júnior
044ca8811d PT translate and SI grammar (#2117) 2022-12-31 20:58:38 +08:00
Tyemak
8c6fd872af Update ru_RU.json (#2114) 2022-12-31 20:58:06 +08:00
longpanda
683101ae1a vtoyjump optimization.
Signed-off-by: longpanda <admin@ventoy.net>
2022-12-31 19:41:15 +08:00
longpanda
0e968e266e Update the F1 help text. WIMBOOT mode supports both Windows and WinPE ISO files. 2022-12-29 18:48:06 +08:00
longpanda
d94d59583a Search VTEFI directory for UEFI boot files.
When user install for example Windows in the reserved space of Ventoy USB stick in UEFI mode.
Windows will create part 3 as the EFI partition and when you boot the USB stick, the BIOS may skip Ventoy and directly boot the Windows.
To avoid this, we suggest to rename the directory name from EFI to VTEFI.
2022-12-26 22:08:23 +08:00
gidano
05bbef63c1 Edited! (#2105)
* Hungarian translation

* Hungarian translation

* HU update languages.json

Jól értettem, hogy a *#-t módosítani kell \r\n-re?!

* Edited!
2022-12-26 17:01:43 +08:00
longpanda
8923d4b8f1 Fix the menu title of F5 Tools ---> Power ---> $VTLANG_POWER_REBOOT_EFIFW 2022-12-26 16:56:53 +08:00
longpanda
377cd9e468 Update readme 2022-12-25 17:23:50 +08:00
longpanda
be78728342 1.0.86 release 2022-12-24 21:19:31 +08:00
Tayfun Akkoyun
3938fbb351 Update tr_TR.json (#2101) 2022-12-24 15:59:32 +08:00
longpanda
a2e7afd893 Update menu language translation 2022-12-24 10:16:13 +08:00
wiz64
27bb4a1168 Update bn_BN.json (#2100) 2022-12-24 10:06:41 +08:00
wiz64
b8b8c7bd66 Update hi_HI.json (#2099) 2022-12-24 10:06:29 +08:00
longpanda
12b51bcf09 Change the prompt format when check device failed. (#2094) 2022-12-24 09:39:27 +08:00
longpanda
911d5dcab9 Remove useless BypassStorageCheck registry when VTOY_WIN11_BYPASS_CHECK is set to 1. (#1873) 2022-12-23 23:41:57 +08:00
longpanda
f597497da6 1. Add VTOY_WIN11_BYPASS_NRO option in Global Control Plugin.
2. Change the default value of VTOY_WIN11_BYPASS_CHECK and VTOY_WIN11_BYPASS_NRO options to 1.
2022-12-23 23:17:39 +08:00
Frede H
54bca8c942 Added Danish (Dansk) to languages.json (#2096) 2022-12-23 16:01:45 +08:00
VenusGirl❤
6b422ad9c1 Update ko_KR.json (#2092) 2022-12-23 15:54:27 +08:00
wiz64
925d057883 Update ru_RU.json (#2091) 2022-12-23 15:54:08 +08:00
longpanda
a377dd6172 Support config ventoy_left/ventoy_top/ventoy_color in theme.txt.
The configuration must be the first line in theme.txt and must be in the following format.
ventoy_left_top_color: "@5%@95%@#0000ff@"

The format is very strict:
1. ventoy_left_top_color must start with no space in front of.
2. left/top/color options must be around with 4 @
2022-12-23 15:52:43 +08:00
longpanda
4707022ef9 Add prompt and wait for key when Ventoy check device failed. (#2094) 2022-12-23 11:42:22 +08:00
Tayfun Akkoyun
e03c73978a Update tr_TR.json (#2090)
New Turkish menu interface lines is translated (VTLANG_CTRL_TEMP_SET,VTLANG_WIN11_BYPASS_CHECK,VTLANG_LINUX_REMOUNT,VTLANG_SECONDARY_BOOT_MENU)
2022-12-22 23:13:49 +08:00
longpanda
f434d1f5d0 Add Temporary Control Settings menu.
Refer https://www.ventoy.net/en/doc_ctrl_settings.html for details.
2022-12-22 22:14:51 +08:00
longpanda
23f8bc8aeb Add resolution_fit option in theme plugin. 2022-12-22 18:26:01 +08:00
wiz64
f2016ab899 Update Actions Image route (#2088) 2022-12-22 14:28:52 +08:00
wiz64
7acbf7e819 Update bn_BN.json (#2085) 2022-12-22 14:28:38 +08:00
Ida Bagus
0135bf1934 Update languages.json (#2087) 2022-12-22 10:04:22 +08:00
wiz64
f2c94bd963 Improve grammar (Readme.md) (#2086) 2022-12-22 10:04:01 +08:00
longpanda
676ae725ae Fix the egrep warning. (#2083) 2022-12-21 19:59:16 +08:00
longpanda
54dd35d277 Merge branch 'master' of https://github.com/ventoy/Ventoy 2022-12-21 13:22:11 +08:00
longpanda
3e75b2df3b VentoyPlugson: Add Windows duplicate file path check for different upper/lower case. 2022-12-21 13:21:54 +08:00
wiz64
2d1230cba4 Update hi_HI.json (#2081) 2022-12-20 21:17:49 +08:00
wiz64
309f85fd35 update ru_RU.json (#2080)
* Update ru_RU.json

* Update ru_RU.json
2022-12-20 21:17:41 +08:00
VenusGirl❤
a13d6d9c0e Update ko_KR.json (#2079) 2022-12-20 21:17:24 +08:00
longpanda
9b7d6cbc3d Add theme plugin duplicate file check. (#2078) 2022-12-20 20:02:06 +08:00
longpanda
bf797ceadb Fix the drive letter case check issue for VentoyPlugson in Windows. (#2078) 2022-12-20 18:46:04 +08:00
longpanda
cd0c7ca884 Extend the donate link width. 2022-12-20 14:05:01 +08:00
longpanda
201f7cc13c Change the MBR partition type to 0x0C when select FAT32 for installation. 2022-12-20 00:16:01 +08:00
longpanda
44a3e23740 Optimization for the implement of menu languages. 2022-12-19 23:49:25 +08:00
9c3e1a6880 update Japanese translation (#2077)
* Remove unnecessary space.

* Unify the translation terms into which used in other files
  (language.json, help/ja_JP.txt...)
2022-12-19 22:21:27 +08:00
wiz64
8a664faa04 Update languages.json (#2076) 2022-12-19 22:20:51 +08:00
Hoàng Điềm Tĩnh
398ba9fb56 Update languages.json (#2075)
I update for Vietnamese lang. Please add to your the next release.
2022-12-19 22:20:34 +08:00
Tayfun Akkoyun
e7a0c2d359 Update languages.json (#2074)
hi master
STR_DONATE parameter is translated for turkish users again
2022-12-19 22:20:07 +08:00
longpanda
22ad828df2 1.0.85 release 2022-12-18 22:11:28 +08:00
longpanda
83f22173a5 menu language update 2022-12-18 17:30:29 +08:00
longpanda
2de7d9ffe0 Suppress some prompt window when install Ventoy. 2022-12-17 23:36:59 +08:00
Tyemak
5c174c4521 Update languages.json (russian translation) (#2070)
* Update languages.json

* Update languages.json
2022-12-17 23:34:03 +08:00
longpanda
c76ece4b74 Fix the format failure when install Ventoy. 2022-12-16 17:03:05 +08:00
longpanda
27eda4d1e7 Fix the issue when booting Peux distro iso file. 2022-12-13 12:17:46 +08:00
longpanda
acf5a84467 Add Arabic menu language. 2022-12-12 11:00:57 +08:00
longpanda
c93e406aa5 Add missing file. 2022-12-11 21:59:09 +08:00
longpanda
1b164e74e4 update pl_PL.json 2022-12-11 10:49:02 +08:00
longpanda
308cb86f83 Fix json syntax error. 2022-12-11 10:30:31 +08:00
longpanda
2ec593d355 Add pl_PL language for menu. 2022-12-11 10:22:39 +08:00
longpanda
594e735b91 Merge branch 'master' of https://github.com/ventoy/Ventoy 2022-12-10 19:27:49 +08:00
longpanda
6203366040 grub2 mode support KNOPPIX 2022-12-10 19:27:38 +08:00
Thomas De Rocker
64f4400305 Update languages.json (#2046) 2022-12-10 17:32:03 +08:00
Alexander Dolidze
d00e08e2e1 added Georgian (ka_GE) translation (json/txt) for grub menu (#2044)
Co-authored-by: Alexander Dolidze <alexander.dolidze@azry.com>
2022-12-10 17:31:48 +08:00
Hugo Carvalho
c6008be394 Update Portuguese(Portugal) Translation (#2039)
* Update languages.json

Update Portuguese (Portugal) language

* Update Portuguese(Portugal) Translation

* Update Portuguese(Portugal) Translation
2022-12-10 17:31:31 +08:00
longpanda
a5c6859f5f Add zh_TW menu language. 2022-12-09 21:36:32 +08:00
longpanda
497d4cc991 update grub2 mod file 2022-12-09 21:33:59 +08:00
VenusGirl❤
7e7687afe3 Update ko_KR.txt (#2038) 2022-12-08 21:11:04 +08:00
Ida Bagus
dd3276badf Update id_ID.json (#2034)
first translation, if they find unrelevant translation, i will update it later
2022-12-08 21:10:49 +08:00
Ida Bagus
4a06f4a694 Update id_ID.txt (#2033)
fix little translation
2022-12-08 21:10:34 +08:00
Silejonu
c73bf256be French translation additions & corrections (#2032)
* Update fr_FR.txt

* Update fr_FR.json
2022-12-08 21:10:17 +08:00
longpanda
21851f7e96 Optimization for booting memtest86-usb.img. 2022-12-05 11:19:46 +08:00
longpanda
f222f8cac9 Auto memdisk plugin support some IMA/IMG files. 2022-12-05 10:51:15 +08:00
gidano
40c4825aac Hungarian translation (#2028)
* Hungarian translation

* Hungarian translation
2022-12-04 18:42:53 +08:00
VenusGirl❤
dd906e0b16 Update ko_KR.txt (#2025) 2022-12-04 17:38:48 +08:00
K.B.Dharun Krishna
324f2b927c grub/*: add Tamil translation (#2023)
* grub/menu: Add Tamil translation

Signed-off-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>

* grub/help: Add Tamil translation

Signed-off-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>

Signed-off-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>
2022-12-04 17:38:32 +08:00
K.B.Dharun Krishna
5797ca3396 grub/help/en_US: Fix typos (#2024)
* grub/help/en_US: Fix typos

* Apply suggestions from code review

* Fix typo in line 15
2022-12-04 17:37:25 +08:00
longpanda
b36b322c03 Update languages.json 2022-12-04 17:33:46 +08:00
longpanda
fd7e34b632 1.0.84 release 2022-12-04 15:33:16 +08:00
longpanda
e85c02756b 1.0.83 release 2022-12-04 13:15:18 +08:00
wiz64
c1d68bd787 Add Russian Tranlsation (json/txt) grub menu (#2022) 2022-12-04 11:18:33 +08:00
wiz64
a35a822723 add Bengali (bn_BN.json/txt) (#2019) 2022-12-04 09:22:26 +08:00
Tayfun Akkoyun
05137c83e2 Update tr_TR.txt (#2020)
tr_TR.txt Help file is updated.
2022-12-04 09:21:58 +08:00
VenusGirl❤
8058856182 Update ko_KR.json (#2021) 2022-12-04 09:21:36 +08:00
longpanda
33b958e112 Update language json files 2022-12-03 21:37:09 +08:00
Tayfun Akkoyun
9eb50a85e4 Update tr_TR.json (#2018)
Master hi!
I translated lines again. Can you UPDATE this file again?
2022-12-03 20:17:13 +08:00
Steve
3cc7e3772e german translation (grub and related help) (#2016)
* updated german translation

translated the new strings

* german translation updated

* fixed STR_INSTALL_YES_TIP2

* german translation

* fix for F6

* german translation
2022-12-03 20:16:31 +08:00
longpanda
9c8292867f Update menu langauge json file 2022-12-03 17:53:42 +08:00
wiz64
a4053d2d05 add grub/menu hi.json (hindi) (#2014)
* add grub/menu hi.json (hindi)

* Update hi.json

* Update hotkey and rename

* Update and rename hi_HI.json to hi.json

* Rename hi.json to hi_HI.json

* Update hi_HI.json

* add grub/help/hi_HI.txt (hindi)
2022-12-03 17:45:47 +08:00
longpanda
5c14ea0a4a Add some menu language xx.json template. (copy from English) 2022-12-03 16:51:03 +08:00
longpanda
194e948cb6 Remove VTOY_HELP_TXT_LANGUAGE option from Global Control Plugin. 2022-12-03 14:33:52 +08:00
K.B.Dharun Krishna
c896c03efe language.json: Update Tamil translation (#2009) 2022-12-03 13:52:47 +08:00
wiz64
574b4d850c Update French [languages.json] (#2015) 2022-12-03 13:52:23 +08:00
wiz64
68a98325e6 Update German [languages.json] (#2006) 2022-12-03 13:52:08 +08:00
longpanda
25b055bb0f Hotkey change:
1. Change F1 from Memdisk to help
2. Add d/Ctrl+d for Memdisk
3. Add L for Language selection

So update the help txt files and menu json files at the same time.
2022-12-03 13:44:46 +08:00
longpanda
bda74cd89b VentoyPlugson supports multi-language menu option. 2022-12-02 20:46:57 +08:00
longpanda
511b8091eb Add muli-languages support for Ventoy menu.
F5 ---> Menu Language Select
Language files are in INSTALL/grub/menu/ directory.
2022-12-02 20:35:59 +08:00
VenusGirl❤
3be4aacd78 Update languages.json (#2003) 2022-12-02 20:26:34 +08:00
wiz64
2d8b27b172 Update Hindi & Bengali languages (#2002) 2022-12-02 20:26:21 +08:00
wiz64
c174410d35 Update Romanian Translation (#2001)
Co-authored-by: cezarlacatus 42448787+cezarlacatus@users.noreply.github.com
2022-12-02 20:26:06 +08:00
wiz64
f83e84f868 Fixed syntax errors for recent PRs (#1999) 2022-12-02 20:25:50 +08:00
dmitrygribenchuk
a39078b87a add belarussian and update ukranian and russian (#1998) 2022-12-02 11:42:59 +08:00
Tayfun Akkoyun
2576235f97 Turkish update_language.json (#1996)
New Turkish translate rows are completed
2022-12-02 11:42:31 +08:00
longpanda
ee04af5243 Ventoy2Disk update:
1. Add UDF filesytem option.
2. Add Cluster Size option.
3. Support FAT32 for disk bigger than 32GB.
4. Fix the format fail issue.
5. Add a tip bubble with cluster size when mouse hover on the file system type string.
6. The secure boot lock character can not show in early Windows, change it to a yellow icon.
2022-11-30 21:12:43 +08:00
Ida Bagus
118bedd546 Indonesian translation update (#1978)
translating STR_PART_VENTOY_FS row & little change
2022-11-30 20:54:37 +08:00
longpanda
44ff3dd8d4 VentoyPlugson: Fix the garbled preview json for unicode characters. 2022-11-23 14:27:58 +08:00
wiz64
9da5a6ce65 Update Romanian Translation (languages.json) (#1968)
* Updated Romanian (languages.json)

Co-authored-by: cezarlacatus <42448787+cezarlacatus@users.noreply.github.com>

* Updated Romanian (languages.json)

Co-authored-by: cezarlacatus <42448787+cezarlacatus@users.noreply.github.com>

Co-authored-by: cezarlacatus <42448787+cezarlacatus@users.noreply.github.com>
2022-11-19 19:17:38 +08:00
marcellogianola
604b25ec82 Update languages.json (#1965) 2022-11-19 19:17:14 +08:00
Vasilis
0918355035 Update languages.json (#1963)
Updated Greek translation
2022-11-18 15:28:32 +08:00
wiz64
ce76fd5649 Update German, French (#1962)
Co-authored-by: galaxy2211 <56916688+galaxy2211@users.noreply.github.com>

Co-authored-by: galaxy2211 <56916688+galaxy2211@users.noreply.github.com>
2022-11-18 15:28:17 +08:00
MELERIX
42535f35bc Update Spanish (Latinoamérica) translation (#1961)
* Update Spanish (Latinoamérica) translation

* Delete languages.json.bak
2022-11-18 15:25:38 +08:00
longpanda
68a9cebe19 1.0.82 release 2022-11-17 17:56:11 +08:00
wiz64
cc77c74bf4 Update Russian, Hindi, Bengali (languages.json) (#1959) 2022-11-17 17:15:29 +08:00
Tayfun Akkoyun
ee952e3f69 Turkish update.json (#1960) 2022-11-17 17:15:01 +08:00
longpanda
b11a499939 Update BOOT/BOOTX64.EFI and mm efi files from Fedora 37. 2022-11-16 22:34:37 +08:00
longpanda
fdf4693433 Ventoy2Disk.exe update.
1. Add exFAT/NTFS/FAT32 option when install Ventoy
2. Display Ventoy partition file system in physical disk
3. String "Status x%" is missing for translations (#1667)
2022-11-16 20:33:14 +08:00
VenusGirl❤
ac65c0fb24 Update languages.json (#1957) 2022-11-16 19:45:15 +08:00
wiz64
ea0afe7c8b Update Bengali Translation (#1956) 2022-11-16 19:44:58 +08:00
wiz64
f8ca8b13d3 Update Hindi Translation (#1941) 2022-11-16 17:56:04 +08:00
longpanda
678a2abdf1 Fix the disk display error when pCloud virtual disk is installed in Windows OS. 2022-11-13 19:29:49 +08:00
longpanda
e645301713 Optimization for Windows unattended install process. 2022-11-10 10:10:10 +08:00
longpanda
43b415c032 Fix an issue that CGI backup tool can not open in WePE. 2022-11-08 15:27:08 +08:00
longpanda
311d2961ca Fix the issue that help line disappears when auto-going to a submenu. (#1939) 2022-11-02 20:13:12 +08:00
longpanda
1d66584190 Change Ventoy LiveCD GUI default language to English (#1938) 2022-10-31 09:40:10 +08:00
longpanda
553c853865 Fix the issue that Linux WEB/GUI does not restore MBR when updating. (#1935) 2022-10-30 13:39:19 +08:00
longpanda
7d90912a09 Add VTOY_SHOW_PASSWORD_ASTERISK option in global control plugon. (#1931) 2022-10-26 15:27:51 +08:00
longpanda
c2336f555a 1.0.81 release 2022-10-25 19:58:10 +08:00
longpanda
87391e8b32 Update BOOTX64.EFI MMX64.EFI 2022-10-23 21:41:05 +08:00
longpanda
f9c56c6686 update vtoyjump 2022-10-22 19:54:54 +08:00
longpanda
1ab1799b72 Code Optimization 2022-10-22 16:13:03 +08:00
longpanda
4a42bdfce7 Add support for easyOS easy-4.4.2-amd64.img. (#1926) 2022-10-22 15:28:16 +08:00
longpanda
3f09fb9a23 VentoyPlugson Update:
1. Add preview json feature
2. Add reset button
3. Add configuration active identifier for each tab
4. Bug fix
2022-10-21 16:06:13 +08:00
longpanda
c87ad1d734 Fix VentoyPlugson issue when ISO partition has a drive label with a space. (#1901) 2022-10-09 09:24:16 +08:00
longpanda
5590208885 Fix the issue that rockcluster, part of config missing during install. (#1900) 2022-10-08 10:07:39 +08:00
longpanda
09a6d33d62 Add _VTNORMAL identifier. 2022-10-07 17:28:31 +08:00
longpanda
9852252aba Merge branch 'master' of https://github.com/ventoy/Ventoy 2022-10-07 11:18:04 +08:00
longpanda
0585d83a8f Fix the issue that VTOY_LINUX_REMOUNT=1 does not work with Batocera 35 (#1878) 2022-10-07 11:16:45 +08:00
A1ive
ebe0b7d282 show asterisks ('*') when typing password (#1868)
* show asterisks ('*') when typing password

* add function ventoy_password_get
2022-09-25 12:31:32 +08:00
MELERIX
261ddcef45 added Spanish (Latinoamérica) translation (#1865)
* added Spanish (Latinoamérica) translation

* Update languages.json
2022-09-25 10:14:02 +08:00
longpanda
ebc5e2e993 1. Disable Fn hotkey during secondary boot menu.
2. Recover boot mode after boot fail from secondary boot menu.
2022-09-24 21:06:29 +08:00
longpanda
d58bd8c3f7 update README.md 2022-09-23 11:32:39 +08:00
longpanda
17f9e2fd09 1.0.80 release 2022-09-21 19:41:51 +08:00
longpanda
6b22a6200e upate issue template 2022-09-21 11:27:51 +08:00
longpanda
860dce6683 Fix languages.json syntax error 2022-09-19 23:00:57 +08:00
longpanda
7fc72d5ce6 Fix a bug when ISO contains a ks=file:/xxx boot parameter. 2022-09-19 22:35:02 +08:00
K.B.Dharun Krishna
b7c3cbd23b languages.json: Add Tamil Language (#1848)
Adding Tamil Language translation to languages.json.

Signed-off-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>

Signed-off-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>
2022-09-19 21:40:31 +08:00
K.B.Dharun Krishna
3de97bdf44 Fix typo in GitHub Issue Templates (#1852) 2022-09-19 21:39:32 +08:00
longpanda
e79dc57ebe wimboot mode support Bob.Ombs.Modified.Win10PEx64 (#1842) 2022-09-16 01:05:58 +08:00
longpanda
7bf85a1ef8 Add 'i' 'u' hotkey. 2022-09-14 09:27:17 +08:00
crim50n
a5e0641226 Update to support a future version of MiniOS. (#1841)
* Update minios-hook.sh

* Update minios-disk.sh
2022-09-14 09:25:24 +08:00
longpanda
2c65eec9ec [update] Make injection plugin available in WIMBOOT mode. (#1834) 2022-09-13 22:04:19 +08:00
longpanda
0c310c5bd8 Make injection plugin available in WIMBOOT mode. (#1834) 2022-09-13 21:32:35 +08:00
Kamil Aronowski
c81b49807b Mention EuroLinux support (#1832) 2022-09-12 23:18:55 +08:00
shulkalala
085e20f64d Update languages.json - Spanish (#1827) 2022-09-12 23:18:30 +08:00
Henrique
ff3ce4da66 Fix Issue #1825 (#1826)
the modifications verify user privilege and prevent improper script execution.
2022-09-12 23:18:12 +08:00
longpanda
81d3492a61 Make injection plugin available in WIMBOOT mode. (#1834) 2022-09-12 22:40:00 +08:00
longpanda
635b1a1c6c Fix the 'overflow is detected' error in WIMBOOT mode for large ISO file. 2022-09-12 21:33:47 +08:00
longpanda
10b80f2690 Add w and r hotkey for WIMBOOT and GRUB2 mode. (#1837) 2022-09-12 11:24:57 +08:00
longpanda
36c21a21e4 Always use /bin/bash to launch VentoyPlugson.sh (#1809) 2022-08-23 20:50:18 +08:00
longpanda
13eb9829fa ALT Linux multiple initrd (#1784) 2022-08-14 23:10:46 +08:00
longpanda
88f77c01e4 bug fix 2022-08-13 22:12:00 +08:00
longpanda
11b30dab5f Fix typo in VentoyPlugson web page. (#1782) 2022-08-13 15:03:09 +08:00
longpanda
fb729146de Fix the issue when booting latest Gentoo live. (#1770) 2022-08-11 17:43:15 +08:00
longpanda
92bd6733dd Update MIPS GCC 7.3 download link. (#1757) 2022-07-29 13:50:11 +08:00
longpanda
9e28dd1394 1.0.79 release 2022-07-28 19:53:28 +08:00
longpanda
4100e7a886 Fix the repo missing for Kylin V10 SP2 Server 2022-07-26 23:08:40 +08:00
longpanda
a4f5ce2c9e update languages.json 2022-07-26 11:17:09 +08:00
aligoogo
c7967ea476 add georgian language (#1755) 2022-07-26 11:14:23 +08:00
sehnemvinicius
3e7f1ca764 Update portuguese translation (#1745) 2022-07-26 11:11:48 +08:00
longpanda
1bc18295ae Fix the bug that report 'invalid value for reserved space' in GTK. (#1752) 2022-07-25 10:49:57 +08:00
ShatteredMINT
b4f1f11742 remove '=' from reserved space check (#1753)
removes the (misplaced) '=' in the check of the configured reserved space in the 'on_part_cfg_ok' function.
This caused #1752
2022-07-25 10:46:07 +08:00
Jose Riha
20010c5e88 Fix and update Slovak translation (#1708) 2022-07-16 09:02:09 +08:00
Sopor
1de18e43c5 Update Swedish language (#1706)
* Update Swedish language

* Update Swedish language

Fixed the `YES`
2022-07-16 09:01:52 +08:00
lev741
15299d4d87 Updated Czech translation (#1705)
* Update languages.json

Updated Czech translation

* Update languages.json

Corrected typo
2022-07-16 09:01:30 +08:00
longpanda
5d6d6df39b autosel doesn't work since 1.0.77 (#1716) 2022-07-13 23:40:45 +08:00
longpanda
096cc99c3c Fix a bug that VTOY_LINUX_REMOUNT option doesn't take effect in openSUSE. 2022-07-13 22:40:32 +08:00
longpanda
602e8c7fdf Fix a bug when rhel based distribution has an external kickstart file. (#1717) 2022-07-12 17:13:49 +08:00
longpanda
da35a99f7c Support Fedora CoreOS (#1727) 2022-07-12 12:13:24 +08:00
275 changed files with 14118 additions and 2378 deletions

View File

@@ -21,7 +21,7 @@ body:
attributes: attributes:
label: Ventoy Version label: Ventoy Version
description: What version of ventoy are you running? description: What version of ventoy are you running?
placeholder: 1.0.78 placeholder: 1.0.91
validations: validations:
required: true required: true
- type: dropdown - type: dropdown
@@ -34,6 +34,16 @@ body:
- No. I didn't try the latest release. - No. I didn't try the latest release.
validations: validations:
required: true required: true
- type: dropdown
id: alternativemode
attributes:
label: Try alternative boot mode
description: Have you tried alternative boot mode? (wimboot mode for Windows/WinPE, grub2 mode for linux)
options:
- Yes. I have tried them, but the bug still exist.
- No. I didn't try these alternative boot modes.
validations:
required: true
- type: dropdown - type: dropdown
id: bios id: bios
attributes: attributes:

View File

@@ -85,7 +85,7 @@ body:
- type: input - type: input
id: testenv id: testenv
attributes: attributes:
label: Test envrionment label: Test environment
description: The manufacturer/model and other details about your computer (or VM). description: The manufacturer/model and other details about your computer (or VM).
placeholder: Lenovo Thinkpad T420 laptop placeholder: Lenovo Thinkpad T420 laptop
validations: validations:

7
DMPATCH/Makefile_IBT Normal file
View File

@@ -0,0 +1,7 @@
obj-m += dm_patch_ibt.o
EXTRA_CFLAGS := -Wall -DVTOY_IBT -fcf-protection=branch -mindirect-branch-register
dm_patch_ibt-objs := dmpatch.o

View File

@@ -51,7 +51,9 @@ typedef struct ko_param
unsigned long sym_get_size; unsigned long sym_get_size;
unsigned long sym_put_addr; unsigned long sym_put_addr;
unsigned long sym_put_size; unsigned long sym_put_size;
unsigned long padding[3]; unsigned long kv_major;
unsigned long ibt;
unsigned long padding[1];
}ko_param; }ko_param;
#pragma pack() #pragma pack()
@@ -69,35 +71,125 @@ static volatile ko_param g_ko_param =
}; };
#if defined(CONFIG_X86_64) #if defined(CONFIG_X86_64)
#define PATCH_OP_POS 3 #define PATCH_OP_POS1 3
#define CODE_MATCH(code, i) \ #define CODE_MATCH1(code, i) \
(code[i] == 0x40 && code[i + 1] == 0x80 && code[i + 2] == 0xce && code[i + 3] == 0x80) (code[i] == 0x40 && code[i + 1] == 0x80 && code[i + 2] == 0xce && code[i + 3] == 0x80)
#define PATCH_OP_POS2 1
#define CODE_MATCH2(code, i) \
(code[i] == 0x0C && code[i + 1] == 0x80 && code[i + 2] == 0x89 && code[i + 3] == 0xC6)
#elif defined(CONFIG_X86_32) #elif defined(CONFIG_X86_32)
#define PATCH_OP_POS 2 #define PATCH_OP_POS1 2
#define CODE_MATCH(code, i) \ #define CODE_MATCH1(code, i) \
(code[i] == 0x80 && code[i + 1] == 0xca && code[i + 2] == 0x80 && code[i + 3] == 0xe8) (code[i] == 0x80 && code[i + 1] == 0xca && code[i + 2] == 0x80 && code[i + 3] == 0xe8)
#define PATCH_OP_POS2 2
#define CODE_MATCH2(code, i) \
(code[i] == 0x80 && code[i + 1] == 0xca && code[i + 2] == 0x80 && code[i + 3] == 0xe8)
#else #else
#error "unsupported arch" #error "unsupported arch"
#endif #endif
#ifdef VTOY_IBT
#ifdef CONFIG_X86_64
/* Using 64-bit values saves one instruction clearing the high half of low */
#define DECLARE_ARGS(val, low, high) unsigned long low, high
#define EAX_EDX_VAL(val, low, high) ((low) | (high) << 32)
#define EAX_EDX_RET(val, low, high) "=a" (low), "=d" (high)
#else
#define DECLARE_ARGS(val, low, high) unsigned long long val
#define EAX_EDX_VAL(val, low, high) (val)
#define EAX_EDX_RET(val, low, high) "=A" (val)
#endif
#define EX_TYPE_WRMSR 8
#define EX_TYPE_RDMSR 9
#define MSR_IA32_S_CET 0x000006a2 /* kernel mode cet */
#define CET_ENDBR_EN (1ULL << 2)
/* Exception table entry */
#ifdef __ASSEMBLY__
#define _ASM_EXTABLE_TYPE(from, to, type) \
.pushsection "__ex_table","a" ; \
.balign 4 ; \
.long (from) - . ; \
.long (to) - . ; \
.long type ; \
.popsection
#else /* ! __ASSEMBLY__ */
#define _ASM_EXTABLE_TYPE(from, to, type) \
" .pushsection \"__ex_table\",\"a\"\n" \
" .balign 4\n" \
" .long (" #from ") - .\n" \
" .long (" #to ") - .\n" \
" .long " __stringify(type) " \n" \
" .popsection\n"
#endif /* __ASSEMBLY__ */
#endif /* VTOY_IBT */
#define vdebug(fmt, args...) if(kprintf) kprintf(KERN_ERR fmt, ##args) #define vdebug(fmt, args...) if(kprintf) kprintf(KERN_ERR fmt, ##args)
static int notrace dmpatch_replace_code(unsigned long addr, unsigned long size, int expect, const char *desc) static unsigned char *g_get_patch[MAX_PATCH] = { NULL };
static unsigned char *g_put_patch[MAX_PATCH] = { NULL };
static void notrace dmpatch_restore_code(unsigned char *opCode)
{
unsigned long align;
if (opCode)
{
align = (unsigned long)opCode / g_ko_param.pgsize * g_ko_param.pgsize;
set_mem_rw(align, 1);
*opCode = 0x80;
set_mem_ro(align, 1);
}
}
static int notrace dmpatch_replace_code
(
int style,
unsigned long addr,
unsigned long size,
int expect,
const char *desc,
unsigned char **patch
)
{ {
int i = 0; int i = 0;
int cnt = 0; int cnt = 0;
unsigned long align; unsigned long align;
unsigned char *patch[MAX_PATCH];
unsigned char *opCode = (unsigned char *)addr; unsigned char *opCode = (unsigned char *)addr;
vdebug("patch for %s 0x%lx %d\n", desc, addr, (int)size); vdebug("patch for %s style[%d] 0x%lx %d\n", desc, style, addr, (int)size);
for (i = 0; i < (int)size - 4; i++) for (i = 0; i < (int)size - 4; i++)
{ {
if (CODE_MATCH(opCode, i) && cnt < MAX_PATCH) if (style == 1)
{ {
patch[cnt] = opCode + i + PATCH_OP_POS; if (CODE_MATCH1(opCode, i) && cnt < MAX_PATCH)
cnt++; {
patch[cnt] = opCode + i + PATCH_OP_POS1;
cnt++;
}
}
else
{
if (CODE_MATCH2(opCode, i) && cnt < MAX_PATCH)
{
patch[cnt] = opCode + i + PATCH_OP_POS2;
cnt++;
}
} }
} }
@@ -121,11 +213,66 @@ static int notrace dmpatch_replace_code(unsigned long addr, unsigned long size,
return 0; return 0;
} }
#ifdef VTOY_IBT
static __always_inline unsigned long long dmpatch_rdmsr(unsigned int msr)
{
DECLARE_ARGS(val, low, high);
asm volatile("1: rdmsr\n"
"2:\n"
_ASM_EXTABLE_TYPE(1b, 2b, EX_TYPE_RDMSR)
: EAX_EDX_RET(val, low, high) : "c" (msr));
return EAX_EDX_VAL(val, low, high);
}
static __always_inline void dmpatch_wrmsr(unsigned int msr, u32 low, u32 high)
{
asm volatile("1: wrmsr\n"
"2:\n"
_ASM_EXTABLE_TYPE(1b, 2b, EX_TYPE_WRMSR)
: : "c" (msr), "a"(low), "d" (high) : "memory");
}
static u64 dmpatch_ibt_save(void)
{
u64 msr = 0;
u64 val = 0;
msr = dmpatch_rdmsr(MSR_IA32_S_CET);
val = msr & ~CET_ENDBR_EN;
dmpatch_wrmsr(MSR_IA32_S_CET, (u32)(val & 0xffffffffULL), (u32)(val >> 32));
return msr;
}
static void dmpatch_ibt_restore(u64 save)
{
u64 msr;
msr = dmpatch_rdmsr(MSR_IA32_S_CET);
msr &= ~CET_ENDBR_EN;
msr |= (save & CET_ENDBR_EN);
dmpatch_wrmsr(MSR_IA32_S_CET, (u32)(msr & 0xffffffffULL), (u32)(msr >> 32));
}
#else
static u64 dmpatch_ibt_save(void) { return 0; }
static void dmpatch_ibt_restore(u64 save) { (void)save; }
#endif
static int notrace dmpatch_init(void) static int notrace dmpatch_init(void)
{ {
int r = 0; int r = 0;
int rc = 0; int rc = 0;
u64 msr = 0;
if (g_ko_param.ibt == 0x8888)
{
msr = dmpatch_ibt_save();
}
kprintf = (printk_pf)(g_ko_param.printk_addr); kprintf = (printk_pf)(g_ko_param.printk_addr);
vdebug("dmpatch_init start pagesize=%lu ...\n", g_ko_param.pgsize); vdebug("dmpatch_init start pagesize=%lu ...\n", g_ko_param.pgsize);
@@ -147,7 +294,13 @@ static int notrace dmpatch_init(void)
reg_kprobe = (kprobe_reg_pf)g_ko_param.reg_kprobe_addr; reg_kprobe = (kprobe_reg_pf)g_ko_param.reg_kprobe_addr;
unreg_kprobe = (kprobe_unreg_pf)g_ko_param.unreg_kprobe_addr; unreg_kprobe = (kprobe_unreg_pf)g_ko_param.unreg_kprobe_addr;
r = dmpatch_replace_code(g_ko_param.sym_get_addr, g_ko_param.sym_get_size, 2, "dm_get_table_device"); r = dmpatch_replace_code(1, g_ko_param.sym_get_addr, g_ko_param.sym_get_size, 2, "dm_get_table_device", g_get_patch);
if (r && g_ko_param.kv_major >= 5)
{
vdebug("new patch dm_get_table_device...\n");
r = dmpatch_replace_code(2, g_ko_param.sym_get_addr, g_ko_param.sym_get_size, 1, "dm_get_table_device", g_get_patch);
}
if (r) if (r)
{ {
rc = -EINVAL; rc = -EINVAL;
@@ -155,7 +308,7 @@ static int notrace dmpatch_init(void)
} }
vdebug("patch dm_get_table_device success\n"); vdebug("patch dm_get_table_device success\n");
r = dmpatch_replace_code(g_ko_param.sym_put_addr, g_ko_param.sym_put_size, 1, "dm_put_table_device"); r = dmpatch_replace_code(1, g_ko_param.sym_put_addr, g_ko_param.sym_put_size, 1, "dm_put_table_device", g_put_patch);
if (r) if (r)
{ {
rc = -EINVAL; rc = -EINVAL;
@@ -167,6 +320,11 @@ static int notrace dmpatch_init(void)
vdebug("######## dm patch success ###########\n"); vdebug("######## dm patch success ###########\n");
vdebug("#####################################\n"); vdebug("#####################################\n");
if (g_ko_param.ibt == 0x8888)
{
dmpatch_ibt_restore(msr);
}
out: out:
return rc; return rc;
@@ -174,7 +332,26 @@ out:
static void notrace dmpatch_exit(void) static void notrace dmpatch_exit(void)
{ {
int i = 0;
u64 msr;
if (g_ko_param.ibt == 0x8888)
{
msr = dmpatch_ibt_save();
}
for (i = 0; i < MAX_PATCH; i++)
{
dmpatch_restore_code(g_get_patch[i]);
dmpatch_restore_code(g_put_patch[i]);
}
vdebug("dmpatch_exit success\n");
if (g_ko_param.ibt == 0x8888)
{
dmpatch_ibt_restore(msr);
}
} }
module_init(dmpatch_init); module_init(dmpatch_init);

65
DMPATCH/ubuntu_build.sh Normal file
View File

@@ -0,0 +1,65 @@
#!/bin/bash
FTPIP=168.0.0.209
FTPUSR='a:a'
rm -f dmpatch.c Makefile Makefile_IBT
for f in dmpatch.c Makefile Makefile_IBT; do
curl -s -u $FTPUSR ftp://$FTPIP/$f -o $f
if [ -f $f ]; then
echo "download $f OK ..."
else
echo "download $f FAILED ..."
exit 1
fi
done
rm -f *.ko
echo "build dm_patch.ko ..."
rm -rf ./aa
mkdir ./aa
cp -a *.c aa/
cp -a Makefile aa/
cd /home/panda/linux-source-5.13.0
make modules M=/home/panda/build/aa/
strip --strip-debug /home/panda/build/aa/dm_patch.ko
cd -
cp -a aa/dm_patch.ko ./
echo "build dm_patch_ibt.ko ..."
rm -rf ./aa
mkdir ./aa
cp -a *.c aa/
cp -a Makefile_IBT aa/Makefile
cd /home/panda/linux-source-5.13.0
make modules M=/home/panda/build/aa/
strip --strip-debug /home/panda/build/aa/dm_patch_ibt.ko
cd -
cp -a aa/dm_patch_ibt.ko ./
rm -rf ./aa
curl -s -T dm_patch.ko -u $FTPUSR ftp://$FTPIP/dm_patch_64.ko || exit 1
curl -s -T dm_patch_ibt.ko -u $FTPUSR ftp://$FTPIP/dm_patch_ibt_64.ko || exit 1
if [ -f ./dm_patch.ko -a -f ./dm_patch_ibt.ko ]; then
echo -e "\n\n=============== SUCCESS =============\n\n"
else
echo -e "\n\n=============== FAILED ==============\n\n"
fi

View File

@@ -34,7 +34,7 @@
https://codeload.github.com/libfuse/libfuse/zip/fuse-2.9.9 ===> /home/Ventoy-master/ExFAT/libfuse-fuse-2.9.9.zip https://codeload.github.com/libfuse/libfuse/zip/fuse-2.9.9 ===> /home/Ventoy-master/ExFAT/libfuse-fuse-2.9.9.zip
https://releases.linaro.org/components/toolchain/binaries/7.4-2019.02/aarch64-linux-gnu/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu.tar.xz ===> /opt/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu.tar.xz https://releases.linaro.org/components/toolchain/binaries/7.4-2019.02/aarch64-linux-gnu/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu.tar.xz ===> /opt/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu.tar.xz
https://toolchains.bootlin.com/downloads/releases/toolchains/aarch64/tarballs/aarch64--uclibc--stable-2020.08-1.tar.bz2 ===> /opt/aarch64--uclibc--stable-2020.08-1.tar.bz2 https://toolchains.bootlin.com/downloads/releases/toolchains/aarch64/tarballs/aarch64--uclibc--stable-2020.08-1.tar.bz2 ===> /opt/aarch64--uclibc--stable-2020.08-1.tar.bz2
http://ftp.loongnix.org/toolchain/gcc/release/mips-loongson-gcc7.3-2019.06-29-linux-gnu.tar.gz ===> /opt/mips-loongson-gcc7.3-2019.06-29-linux-gnu.tar.gz http://ftp.loongnix.cn/toolchain/gcc/release/mips/gcc7/mips-loongson-gcc7.3-2019.06-29-linux-gnu.tar.gz ===> /opt/mips-loongson-gcc7.3-2019.06-29-linux-gnu.tar.gz
https://github.com/ventoy/musl-cross-make/releases/download/latest/output.tar.bz2 ===> /opt/output.tar.bz2 https://github.com/ventoy/musl-cross-make/releases/download/latest/output.tar.bz2 ===> /opt/output.tar.bz2

View File

@@ -1491,6 +1491,34 @@ STATIC EFI_STATUS EFIAPI ventoy_wrapper_file_procotol(EFI_FILE_PROTOCOL *File, B
return EFI_SUCCESS; return EFI_SUCCESS;
} }
STATIC BOOLEAN EFIAPI ventoy_replace_name_match(CHAR8 *pReplace, CHAR8 *pName)
{
UINTN Len1, Len2;
Len1 = AsciiStrLen(pReplace);
Len2 = AsciiStrLen(pName);
if (Len1 == 0 || Len2 == 0)
{
return FALSE;
}
if (0 == AsciiStriCmp(pReplace, pName))
{
return TRUE;
}
if (Len1 > 2 && Len2 > 2)
{
if ((pReplace[0] != '\\') && (pName[0] == '\\') && (0 == AsciiStriCmp(pReplace, pName + 1)))
{
return TRUE;
}
}
return FALSE;
}
STATIC EFI_STATUS EFIAPI ventoy_wrapper_file_open STATIC EFI_STATUS EFIAPI ventoy_wrapper_file_open
( (
EFI_FILE_HANDLE This, EFI_FILE_HANDLE This,
@@ -1534,7 +1562,7 @@ STATIC EFI_STATUS EFIAPI ventoy_wrapper_file_open
AsciiSPrint(TmpName, sizeof(TmpName), "%s", Name); AsciiSPrint(TmpName, sizeof(TmpName), "%s", Name);
for (j = 0; j < 4; j++) for (j = 0; j < 4; j++)
{ {
if (0 == AsciiStriCmp(g_file_replace_list[i].old_file_name[j], TmpName)) if (ventoy_replace_name_match(g_file_replace_list[i].old_file_name[j], TmpName))
{ {
g_original_fclose(*New); g_original_fclose(*New);
*New = &g_efi_file_replace.WrapperHandle; *New = &g_efi_file_replace.WrapperHandle;

View File

@@ -1533,7 +1533,7 @@ module = {
name = squash4; name = squash4;
common = fs/squash4.c; common = fs/squash4.c;
cflags = '$(CFLAGS_POSIX) -Wno-undef'; cflags = '$(CFLAGS_POSIX) -Wno-undef';
cppflags = '-I$(srcdir)/lib/posix_wrap -I$(srcdir)/lib/xzembed -I$(srcdir)/lib/minilzo -DMINILZO_HAVE_CONFIG_H'; cppflags = '-I$(srcdir)/lib/posix_wrap -I$(srcdir)/lib/xzembed -I$(srcdir)/lib/minilzo -I$(srcdir)/lib/zstd -DMINILZO_HAVE_CONFIG_H';
}; };
module = { module = {

View File

@@ -260,6 +260,7 @@ grub_cmd_hashsum (struct grub_extcmd_context *ctxt,
grub_file_t file; grub_file_t file;
grub_err_t err; grub_err_t err;
unsigned j; unsigned j;
int vlnk = 0;
file = grub_file_open (args[i], GRUB_FILE_TYPE_TO_HASH file = grub_file_open (args[i], GRUB_FILE_TYPE_TO_HASH
| (!uncompress ? GRUB_FILE_TYPE_NO_DECOMPRESS | (!uncompress ? GRUB_FILE_TYPE_NO_DECOMPRESS
: GRUB_FILE_TYPE_NONE)); : GRUB_FILE_TYPE_NONE));
@@ -272,6 +273,7 @@ grub_cmd_hashsum (struct grub_extcmd_context *ctxt,
unread++; unread++;
continue; continue;
} }
vlnk = file->vlnk;
err = hash_file (file, hash, result); err = hash_file (file, hash, result);
grub_file_close (file); grub_file_close (file);
if (err) if (err)
@@ -288,7 +290,7 @@ grub_cmd_hashsum (struct grub_extcmd_context *ctxt,
grub_printf ("%02x", ((grub_uint8_t *) result)[j]); grub_printf ("%02x", ((grub_uint8_t *) result)[j]);
len += grub_snprintf(hashsum + len, sizeof(hashsum) - len, "%02x", ((grub_uint8_t *) result)[j]); len += grub_snprintf(hashsum + len, sizeof(hashsum) - len, "%02x", ((grub_uint8_t *) result)[j]);
} }
grub_printf (" %s\n", args[i]); grub_printf (" %s\n", vlnk ? grub_file_get_vlnk(args[i], NULL) : args[i]);
grub_env_set("VT_LAST_CHECK_SUM", hashsum); grub_env_set("VT_LAST_CHECK_SUM", hashsum);
} }

View File

@@ -229,6 +229,13 @@ test_parse (char **args, int *argn, int argc)
(*argn) += 3; (*argn) += 3;
continue; continue;
} }
if (grub_strcmp (args[*argn + 1], "-EQ") == 0)
{
update_val (grub_strtoull (args[*argn], 0, 0)
== grub_strtoull (args[*argn + 2], 0, 0), &ctx);
(*argn) += 3;
continue;
}
if (grub_strcmp (args[*argn + 1], "-ge") == 0) if (grub_strcmp (args[*argn + 1], "-ge") == 0)
{ {
@@ -237,6 +244,13 @@ test_parse (char **args, int *argn, int argc)
(*argn) += 3; (*argn) += 3;
continue; continue;
} }
if (grub_strcmp (args[*argn + 1], "-GE") == 0)
{
update_val (grub_strtoull (args[*argn], 0, 0)
>= grub_strtoull (args[*argn + 2], 0, 0), &ctx);
(*argn) += 3;
continue;
}
if (grub_strcmp (args[*argn + 1], "-gt") == 0) if (grub_strcmp (args[*argn + 1], "-gt") == 0)
{ {
@@ -245,6 +259,13 @@ test_parse (char **args, int *argn, int argc)
(*argn) += 3; (*argn) += 3;
continue; continue;
} }
if (grub_strcmp (args[*argn + 1], "-GT") == 0)
{
update_val (grub_strtoull (args[*argn], 0, 0)
> grub_strtoull (args[*argn + 2], 0, 0), &ctx);
(*argn) += 3;
continue;
}
if (grub_strcmp (args[*argn + 1], "-le") == 0) if (grub_strcmp (args[*argn + 1], "-le") == 0)
{ {
@@ -253,6 +274,13 @@ test_parse (char **args, int *argn, int argc)
(*argn) += 3; (*argn) += 3;
continue; continue;
} }
if (grub_strcmp (args[*argn + 1], "-LE") == 0)
{
update_val (grub_strtoull (args[*argn], 0, 0)
<= grub_strtoull (args[*argn + 2], 0, 0), &ctx);
(*argn) += 3;
continue;
}
if (grub_strcmp (args[*argn + 1], "-lt") == 0) if (grub_strcmp (args[*argn + 1], "-lt") == 0)
{ {
@@ -261,6 +289,13 @@ test_parse (char **args, int *argn, int argc)
(*argn) += 3; (*argn) += 3;
continue; continue;
} }
if (grub_strcmp (args[*argn + 1], "-LT") == 0)
{
update_val (grub_strtoull (args[*argn], 0, 0)
< grub_strtoull (args[*argn + 2], 0, 0), &ctx);
(*argn) += 3;
continue;
}
if (grub_strcmp (args[*argn + 1], "-ne") == 0) if (grub_strcmp (args[*argn + 1], "-ne") == 0)
{ {
@@ -269,6 +304,13 @@ test_parse (char **args, int *argn, int argc)
(*argn) += 3; (*argn) += 3;
continue; continue;
} }
if (grub_strcmp (args[*argn + 1], "-NE") == 0)
{
update_val (grub_strtoull (args[*argn], 0, 0)
!= grub_strtoull (args[*argn + 2], 0, 0), &ctx);
(*argn) += 3;
continue;
}
/* GRUB extension: compare numbers skipping prefixes. /* GRUB extension: compare numbers skipping prefixes.
Useful for comparing versions. E.g. vmlinuz-2 -plt vmlinuz-11. */ Useful for comparing versions. E.g. vmlinuz-2 -plt vmlinuz-11. */

View File

@@ -889,6 +889,7 @@ grub_ntfs_mount (grub_disk_t disk)
struct grub_ntfs_bpb bpb; struct grub_ntfs_bpb bpb;
struct grub_ntfs_data *data = 0; struct grub_ntfs_data *data = 0;
grub_uint32_t spc; grub_uint32_t spc;
grub_uint32_t sectors_per_cluster;
if (!disk) if (!disk)
goto fail; goto fail;
@@ -903,14 +904,18 @@ grub_ntfs_mount (grub_disk_t disk)
if (grub_disk_read (disk, 0, 0, sizeof (bpb), &bpb)) if (grub_disk_read (disk, 0, 0, sizeof (bpb), &bpb))
goto fail; goto fail;
sectors_per_cluster = bpb.sectors_per_cluster;
if (sectors_per_cluster > 0x80)
sectors_per_cluster = 1U << (256U - bpb.sectors_per_cluster);
if (grub_memcmp ((char *) &bpb.oem_name, "NTFS", 4) != 0 if (grub_memcmp ((char *) &bpb.oem_name, "NTFS", 4) != 0
|| bpb.sectors_per_cluster == 0 || sectors_per_cluster == 0
|| (bpb.sectors_per_cluster & (bpb.sectors_per_cluster - 1)) != 0 || (sectors_per_cluster & (sectors_per_cluster - 1)) != 0
|| bpb.bytes_per_sector == 0 || bpb.bytes_per_sector == 0
|| (bpb.bytes_per_sector & (bpb.bytes_per_sector - 1)) != 0) || (bpb.bytes_per_sector & (bpb.bytes_per_sector - 1)) != 0)
goto fail; goto fail;
spc = (((grub_uint32_t) bpb.sectors_per_cluster spc = (((grub_uint32_t) sectors_per_cluster
* (grub_uint32_t) grub_le_to_cpu16 (bpb.bytes_per_sector)) * (grub_uint32_t) grub_le_to_cpu16 (bpb.bytes_per_sector))
>> GRUB_NTFS_BLK_SHR); >> GRUB_NTFS_BLK_SHR);
if (spc == 0) if (spc == 0)

View File

@@ -27,6 +27,7 @@
#include <grub/fshelp.h> #include <grub/fshelp.h>
#include <grub/deflate.h> #include <grub/deflate.h>
#include <minilzo.h> #include <minilzo.h>
#include <zstd.h>
#include "xz.h" #include "xz.h"
#include "xz_stream.h" #include "xz_stream.h"
@@ -184,6 +185,7 @@ enum
COMPRESSION_LZO = 3, COMPRESSION_LZO = 3,
COMPRESSION_XZ = 4, COMPRESSION_XZ = 4,
COMPRESSION_LZ4 = 5, COMPRESSION_LZ4 = 5,
COMPRESSION_ZSTD = 6,
}; };
@@ -398,6 +400,33 @@ static grub_ssize_t lz4_decompress_wrap(char *inbuf, grub_size_t insize, grub_of
return len; return len;
} }
static grub_ssize_t zstd_decompress_wrap(char *inbuf, grub_size_t insize, grub_off_t off,
char *outbuf, grub_size_t len, struct grub_squash_data *data)
{
char *udata = NULL;
int usize = data->blksz;
if (off == 0)
{
ZSTD_decompress(outbuf, len, inbuf, insize);
}
else
{
if (usize < 8192)
usize = 8192;
udata = grub_malloc (usize);
if (!udata)
return -1;
ZSTD_decompress(udata, usize, inbuf, insize);
grub_memcpy(outbuf, udata + off, len);
grub_free(udata);
}
return len;
}
static struct grub_squash_data * static struct grub_squash_data *
squash_mount (grub_disk_t disk) squash_mount (grub_disk_t disk)
{ {
@@ -447,6 +476,9 @@ squash_mount (grub_disk_t disk)
case grub_cpu_to_le16_compile_time (COMPRESSION_LZ4): case grub_cpu_to_le16_compile_time (COMPRESSION_LZ4):
data->decompress = lz4_decompress_wrap; data->decompress = lz4_decompress_wrap;
break; break;
case grub_cpu_to_le16_compile_time (COMPRESSION_ZSTD):
data->decompress = zstd_decompress_wrap;
break;
case grub_cpu_to_le16_compile_time (COMPRESSION_XZ): case grub_cpu_to_le16_compile_time (COMPRESSION_XZ):
data->decompress = xz_decompress; data->decompress = xz_decompress;
data->xzbuf = grub_malloc (XZBUFSIZ); data->xzbuf = grub_malloc (XZBUFSIZ);

View File

@@ -31,6 +31,7 @@ extern int g_ventoy_iso_raw;
extern int g_ventoy_grub2_mode; extern int g_ventoy_grub2_mode;
extern int g_ventoy_wimboot_mode; extern int g_ventoy_wimboot_mode;
extern int g_ventoy_iso_uefi_drv; extern int g_ventoy_iso_uefi_drv;
extern char g_ventoy_hotkey_tip[256];
static const char *align_options[] = static const char *align_options[] =
{ {
@@ -230,10 +231,11 @@ label_set_property (void *vself, const char *name, const char *value)
value = g_ventoy_iso_uefi_drv ? grub_env_get("VTOY_ISO_UEFI_DRV_STR") : " "; value = g_ventoy_iso_uefi_drv ? grub_env_get("VTOY_ISO_UEFI_DRV_STR") : " ";
} }
else if (grub_strcmp (value, "@VTOY_HOTKEY_TIP@") == 0) { else if (grub_strcmp (value, "@VTOY_HOTKEY_TIP@") == 0) {
value = grub_env_get("VTOY_HOTKEY_TIP"); value = g_ventoy_hotkey_tip;
if (value == NULL) { } else if (value[0] == '@' && value[1] == '@' && value[2]) {
value = _(" "); value = grub_env_get(value + 2);
} if (!value)
value = " ";
} }
self->template = grub_strdup (value); self->template = grub_strdup (value);

View File

@@ -295,6 +295,8 @@ theme_set_string (grub_gfxmenu_view_t view,
if (! view->title_text) if (! view->title_text)
return grub_errno; return grub_errno;
} }
else if (! grub_strcmp ("ventoy_left_top_color", name))
return grub_errno;
else else
{ {
return grub_error (GRUB_ERR_BAD_ARGUMENT, return grub_error (GRUB_ERR_BAD_ARGUMENT,
@@ -732,6 +734,11 @@ read_property (struct parsebuf *p)
"%s:%d:%d property value invalid; " "%s:%d:%d property value invalid; "
"enclose literal values in quotes (\")", "enclose literal values in quotes (\")",
p->filename, p->line_num, p->col_num); p->filename, p->line_num, p->col_num);
grub_printf("File: %s\nLine:%d Column:%d\n"
"property value invalid; enclose literal values in quotes (\")\n\n",
p->filename, p->line_num, p->col_num);
goto done; goto done;
} }

View File

@@ -0,0 +1,250 @@
/* env.c - Environment variables */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2003,2005,2006,2007,2008,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/env.h>
#include <grub/env_private.h>
#include <grub/misc.h>
#include <grub/mm.h>
/* The initial context. */
static struct grub_env_context initial_context;
/* The current context. */
struct grub_env_context *grub_current_context = &initial_context;
static grub_env_read_hook_t vtoy_menu_lang_read_hook;
/* Return the hash representation of the string S. */
static unsigned int
grub_env_hashval (const char *s)
{
unsigned int i = 0;
/* XXX: This can be done much more efficiently. */
while (*s)
i += 5 * *(s++);
return i % HASHSZ;
}
static struct grub_env_var *
grub_env_find (const char *name)
{
struct grub_env_var *var;
int idx = grub_env_hashval (name);
/* Look for the variable in the current context. */
for (var = grub_current_context->vars[idx]; var; var = var->next)
if (grub_strcmp (var->name, name) == 0)
return var;
return 0;
}
static void
grub_env_insert (struct grub_env_context *context,
struct grub_env_var *var)
{
int idx = grub_env_hashval (var->name);
/* Insert the variable into the hashtable. */
var->prevp = &context->vars[idx];
var->next = context->vars[idx];
if (var->next)
var->next->prevp = &(var->next);
context->vars[idx] = var;
}
static void
grub_env_remove (struct grub_env_var *var)
{
/* Remove the entry from the variable table. */
*var->prevp = var->next;
if (var->next)
var->next->prevp = var->prevp;
}
grub_err_t
grub_env_set (const char *name, const char *val)
{
struct grub_env_var *var;
/* If the variable does already exist, just update the variable. */
var = grub_env_find (name);
if (var)
{
char *old = var->value;
if (var->write_hook)
var->value = var->write_hook (var, val);
else
var->value = grub_strdup (val);
if (! var->value)
{
var->value = old;
return grub_errno;
}
grub_free (old);
return GRUB_ERR_NONE;
}
/* The variable does not exist, so create a new one. */
var = grub_zalloc (sizeof (*var));
if (! var)
return grub_errno;
var->name = grub_strdup (name);
if (! var->name)
goto fail;
var->value = grub_strdup (val);
if (! var->value)
goto fail;
grub_env_insert (grub_current_context, var);
return GRUB_ERR_NONE;
fail:
grub_free (var->name);
grub_free (var->value);
grub_free (var);
return grub_errno;
}
const char *
grub_env_get (const char *name)
{
struct grub_env_var *var;
if (name && vtoy_menu_lang_read_hook && grub_strncmp(name, "VTLANG_", 7) == 0)
return vtoy_menu_lang_read_hook(NULL, name);
var = grub_env_find (name);
if (! var)
return 0;
if (var->read_hook)
return var->read_hook (var, var->value);
return var->value;
}
void
grub_env_unset (const char *name)
{
struct grub_env_var *var;
var = grub_env_find (name);
if (! var)
return;
if (var->read_hook || var->write_hook)
{
grub_env_set (name, "");
return;
}
grub_env_remove (var);
grub_free (var->name);
grub_free (var->value);
grub_free (var);
}
struct grub_env_var *
grub_env_update_get_sorted (void)
{
struct grub_env_var *sorted_list = 0;
int i;
/* Add variables associated with this context into a sorted list. */
for (i = 0; i < HASHSZ; i++)
{
struct grub_env_var *var;
for (var = grub_current_context->vars[i]; var; var = var->next)
{
struct grub_env_var *p, **q;
for (q = &sorted_list, p = *q; p; q = &((*q)->sorted_next), p = *q)
{
if (grub_strcmp (p->name, var->name) > 0)
break;
}
var->sorted_next = *q;
*q = var;
}
}
return sorted_list;
}
grub_err_t
grub_register_variable_hook (const char *name,
grub_env_read_hook_t read_hook,
grub_env_write_hook_t write_hook)
{
struct grub_env_var *var = grub_env_find (name);
if (! var)
{
if (grub_env_set (name, "") != GRUB_ERR_NONE)
return grub_errno;
var = grub_env_find (name);
/* XXX Insert an assertion? */
}
var->read_hook = read_hook;
var->write_hook = write_hook;
return GRUB_ERR_NONE;
}
grub_err_t
grub_register_vtoy_menu_lang_hook(grub_env_read_hook_t read_hook)
{
vtoy_menu_lang_read_hook = read_hook;
return GRUB_ERR_NONE;
}
grub_err_t
grub_env_export (const char *name)
{
struct grub_env_var *var;
var = grub_env_find (name);
if (! var)
{
grub_err_t err;
err = grub_env_set (name, "");
if (err)
return err;
var = grub_env_find (name);
}
var->global = 1;
return GRUB_ERR_NONE;
}

View File

@@ -200,7 +200,8 @@ const char *grub_file_get_vlnk(const char *name, int *vlnk)
if (len == g_vtoy_vlnk.srclen && grub_strcmp(name, g_vtoy_vlnk.src) == 0) if (len == g_vtoy_vlnk.srclen && grub_strcmp(name, g_vtoy_vlnk.src) == 0)
{ {
*vlnk = 1; if (vlnk)
*vlnk = 1;
return g_vtoy_vlnk.dst; return g_vtoy_vlnk.dst;
} }
@@ -208,7 +209,8 @@ const char *grub_file_get_vlnk(const char *name, int *vlnk)
{ {
if (node->srclen == len && grub_strcmp(name, node->src) == 0) if (node->srclen == len && grub_strcmp(name, node->src) == 0)
{ {
*vlnk = 1; if (vlnk)
*vlnk = 1;
return node->dst; return node->dst;
} }
node = node->next; node = node->next;

View File

@@ -362,7 +362,8 @@ static grub_err_t
cmd_append (const char *line, struct syslinux_menu *menu) cmd_append (const char *line, struct syslinux_menu *menu)
{ {
if (!menu->entries) if (!menu->entries)
return grub_error (GRUB_ERR_BAD_ARGUMENT, "kernel without label"); return GRUB_ERR_NONE;
//return grub_error (GRUB_ERR_BAD_ARGUMENT, "kernel without label");
menu->entries->append = grub_strdup (line); menu->entries->append = grub_strdup (line);
if (!menu->entries->append) if (!menu->entries->append)

View File

@@ -88,6 +88,8 @@ static int ventoy_linux_argc = 0;
static char **ventoy_linux_args = NULL; static char **ventoy_linux_args = NULL;
static int ventoy_extra_initrd_num = 0; static int ventoy_extra_initrd_num = 0;
static char *ventoy_extra_initrd_list[256]; static char *ventoy_extra_initrd_list[256];
static grub_command_func_t ventoy_linux16_func = NULL;
static grub_command_func_t ventoy_initrd16_func = NULL;
static grub_err_t static grub_err_t
grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), int argc, char *argv[]); grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), int argc, char *argv[]);
@@ -667,54 +669,6 @@ static int ventoy_bootopt_hook(int argc, char *argv[])
return 0; return 0;
} }
static grub_err_t
grub_cmd_set_boot_opt (grub_command_t cmd __attribute__ ((unused)),
int argc, char *argv[])
{
int i;
const char *vtdebug;
for (i = 0; i < argc; i++)
{
ventoy_linux_args[ventoy_linux_argc + (LINUX_MAX_ARGC / 2) ] = grub_strdup(argv[i]);
ventoy_linux_argc++;
}
vtdebug = grub_env_get("vtdebug_flag");
if (vtdebug && vtdebug[0])
{
ventoy_debug = 1;
}
if (ventoy_debug) grub_printf("ventoy set boot opt %d\n", ventoy_linux_argc);
return 0;
}
static grub_err_t
grub_cmd_unset_boot_opt (grub_command_t cmd __attribute__ ((unused)),
int argc, char *argv[])
{
int i;
(void)argc;
(void)argv;
for (i = 0; i < LINUX_MAX_ARGC; i++)
{
if (ventoy_linux_args[i])
{
grub_free(ventoy_linux_args[i]);
}
}
ventoy_debug = 0;
ventoy_linux_argc = 0;
ventoy_initrd_called = 0;
grub_memset(ventoy_linux_args, 0, sizeof(char *) * LINUX_MAX_ARGC);
return 0;
}
static grub_err_t static grub_err_t
grub_cmd_extra_initrd_append (grub_command_t cmd __attribute__ ((unused)), grub_cmd_extra_initrd_append (grub_command_t cmd __attribute__ ((unused)),
int argc, char *argv[]) int argc, char *argv[])
@@ -1576,6 +1530,92 @@ ventoy_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
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);
} }
static grub_err_t
grub_cmd_set_boot_opt (grub_command_t cmd __attribute__ ((unused)),
int argc, char *argv[])
{
int i;
const char *vtdebug;
grub_command_t regcmd;
for (i = 0; i < argc; i++)
{
ventoy_linux_args[ventoy_linux_argc + (LINUX_MAX_ARGC / 2) ] = grub_strdup(argv[i]);
ventoy_linux_argc++;
}
vtdebug = grub_env_get("vtdebug_flag");
if (vtdebug && vtdebug[0])
{
ventoy_debug = 1;
}
if (ventoy_debug) grub_printf("ventoy set boot opt %d\n", ventoy_linux_argc);
ventoy_linux16_func = ventoy_initrd16_func = NULL;
regcmd = grub_command_find("linux16");
if (regcmd)
{
ventoy_linux16_func = regcmd->func;
regcmd->func = grub_cmd_linux;
}
regcmd = grub_command_find("initrd16");
if (regcmd)
{
ventoy_initrd16_func = regcmd->func;
regcmd->func = ventoy_cmd_initrd;
}
return 0;
}
static grub_err_t
grub_cmd_unset_boot_opt (grub_command_t cmd __attribute__ ((unused)),
int argc, char *argv[])
{
int i;
grub_command_t regcmd;
(void)argc;
(void)argv;
for (i = 0; i < LINUX_MAX_ARGC; i++)
{
if (ventoy_linux_args[i])
{
grub_free(ventoy_linux_args[i]);
}
}
ventoy_debug = 0;
ventoy_linux_argc = 0;
ventoy_initrd_called = 0;
grub_memset(ventoy_linux_args, 0, sizeof(char *) * LINUX_MAX_ARGC);
if (ventoy_linux16_func)
{
regcmd = grub_command_find("linux16");
if (regcmd)
{
regcmd->func = ventoy_linux16_func;
}
ventoy_linux16_func = NULL;
}
if (ventoy_initrd16_func)
{
regcmd = grub_command_find("initrd16");
if (regcmd)
{
regcmd->func = ventoy_initrd16_func;
}
ventoy_initrd16_func = NULL;
}
return 0;
}
static grub_command_t cmd_linux, cmd_initrd, cmd_linuxefi, cmd_initrdefi; static grub_command_t cmd_linux, cmd_initrd, cmd_linuxefi, cmd_initrdefi;
static grub_command_t cmd_set_bootopt, cmd_unset_bootopt, cmd_extra_initrd_append, cmd_extra_initrd_reset; static grub_command_t cmd_set_bootopt, cmd_unset_bootopt, cmd_extra_initrd_append, cmd_extra_initrd_reset;

View File

@@ -48,10 +48,35 @@ int g_ventoy_suppress_esc = 0;
int g_ventoy_suppress_esc_default = 1; int g_ventoy_suppress_esc_default = 1;
int g_ventoy_menu_esc = 0; int g_ventoy_menu_esc = 0;
int g_ventoy_fn_mutex = 0; int g_ventoy_fn_mutex = 0;
int g_ventoy_secondary_menu_on = 0;
int g_ventoy_terminal_output = 0; int g_ventoy_terminal_output = 0;
char g_ventoy_hotkey_tip[256];
static int g_vt_key_num = 0;
static int g_vt_key_code[128];
static int ventoy_menu_pop_key(void)
{
if (g_vt_key_num > 0 && g_vt_key_num < (int)(sizeof(g_vt_key_code) / sizeof(g_vt_key_code[0])))
{
g_vt_key_num--;
return g_vt_key_code[g_vt_key_num];
}
return -1;
}
int ventoy_menu_push_key(int code)
{
if (g_vt_key_num >= 0 && g_vt_key_num < (int)(sizeof(g_vt_key_code) / sizeof(g_vt_key_code[0])))
{
g_vt_key_code[g_vt_key_num++] = code;
return 0;
}
return -1;
}
#define VTOY_COMM_HOTKEY(cmdkey) \ #define VTOY_COMM_HOTKEY(cmdkey) \
if (0 == g_ventoy_fn_mutex) { \ if (0 == g_ventoy_fn_mutex && 0 == g_ventoy_secondary_menu_on) { \
cmdstr = grub_env_get(cmdkey); \ cmdstr = grub_env_get(cmdkey); \
if (cmdstr) \ if (cmdstr) \
{ \ { \
@@ -795,7 +820,11 @@ run_menu (grub_menu_t menu, int nested, int *auto_boot)
return default_entry; return default_entry;
} }
c = grub_getkey_noblock (); if (g_vt_key_num > 0) {
c = ventoy_menu_pop_key();
} else {
c = grub_getkey_noblock ();
}
/* Negative values are returned on error. */ /* Negative values are returned on error. */
if ((c != GRUB_TERM_NO_KEY) && (c > 0)) if ((c != GRUB_TERM_NO_KEY) && (c > 0))
@@ -922,77 +951,110 @@ run_menu (grub_menu_t menu, int nested, int *auto_boot)
menu_fini (); menu_fini ();
if (g_ventoy_terminal_output == 0) if (g_ventoy_terminal_output == 0)
{ {
grub_script_execute_sourcecode("terminal_output console"); grub_script_execute_sourcecode("vt_push_menu_lang en_US\nterminal_output console");
g_ventoy_terminal_output = 1; g_ventoy_terminal_output = 1;
} }
else else
{ {
grub_script_execute_sourcecode("terminal_output gfxterm"); grub_script_execute_sourcecode("terminal_output gfxterm\nvt_pop_menu_lang");
g_ventoy_terminal_output = 0; g_ventoy_terminal_output = 0;
} }
goto refresh; goto refresh;
case GRUB_TERM_KEY_F1: case GRUB_TERM_KEY_F1:
case '1': case '1':
menu_fini (); if (0 == g_ventoy_secondary_menu_on)
g_ventoy_memdisk_mode = 1 - g_ventoy_memdisk_mode; {
g_ventoy_menu_refresh = 1; cmdstr = grub_env_get("VTOY_HELP_CMD");
goto refresh; if (cmdstr)
{
case (GRUB_TERM_CTRL | 'i'): grub_script_execute_sourcecode(cmdstr);
menu_fini (); while (grub_getkey() != GRUB_TERM_ESC)
g_ventoy_iso_raw = 1 - g_ventoy_iso_raw; ;
g_ventoy_menu_refresh = 1; menu_fini ();
goto refresh; goto refresh;
}
case (GRUB_TERM_CTRL | 'r'): }
menu_fini (); break;
g_ventoy_grub2_mode = 1 - g_ventoy_grub2_mode; case (GRUB_TERM_CTRL | 'd'):
g_ventoy_menu_refresh = 1; case 'd':
goto refresh; if (0 == g_ventoy_secondary_menu_on)
case (GRUB_TERM_CTRL | 'w'):
menu_fini ();
g_ventoy_wimboot_mode = 1 - g_ventoy_wimboot_mode;
g_ventoy_menu_refresh = 1;
goto refresh;
case (GRUB_TERM_CTRL | 'u'):
menu_fini ();
g_ventoy_iso_uefi_drv = 1 - g_ventoy_iso_uefi_drv;
g_ventoy_menu_refresh = 1;
goto refresh;
case (GRUB_TERM_CTRL | 'h'):
case 'h':
{
cmdstr = grub_env_get("VTOY_HELP_CMD");
if (cmdstr)
{ {
grub_script_execute_sourcecode(cmdstr);
while (grub_getkey() != GRUB_TERM_ESC)
;
menu_fini (); menu_fini ();
g_ventoy_memdisk_mode = 1 - g_ventoy_memdisk_mode;
g_ventoy_menu_refresh = 1;
goto refresh; goto refresh;
} }
break; break;
case (GRUB_TERM_CTRL | 'i'):
case 'i':
if (0 == g_ventoy_secondary_menu_on)
{
menu_fini ();
g_ventoy_iso_raw = 1 - g_ventoy_iso_raw;
g_ventoy_menu_refresh = 1;
goto refresh;
}
break;
case (GRUB_TERM_CTRL | 'r'):
case 'r':
if (0 == g_ventoy_secondary_menu_on)
{
menu_fini ();
g_ventoy_grub2_mode = 1 - g_ventoy_grub2_mode;
g_ventoy_menu_refresh = 1;
goto refresh;
}
break;
case (GRUB_TERM_CTRL | 'w'):
case 'w':
if (0 == g_ventoy_secondary_menu_on)
{
menu_fini ();
g_ventoy_wimboot_mode = 1 - g_ventoy_wimboot_mode;
g_ventoy_menu_refresh = 1;
goto refresh;
}
break;
case (GRUB_TERM_CTRL | 'u'):
case 'u':
if (0 == g_ventoy_secondary_menu_on)
{
menu_fini ();
g_ventoy_iso_uefi_drv = 1 - g_ventoy_iso_uefi_drv;
g_ventoy_menu_refresh = 1;
goto refresh;
}
break;
case (GRUB_TERM_CTRL | 'l'):
case (GRUB_TERM_CTRL | 'L'):
case (GRUB_TERM_SHIFT | 'l'):
case (GRUB_TERM_SHIFT | 'L'):
case 'l':
case 'L':
{
VTOY_COMM_HOTKEY("VTOY_LANG_CMD");
break;
} }
case (GRUB_TERM_CTRL | 'm'): case (GRUB_TERM_CTRL | 'm'):
case 'm': case 'm':
{ {
if (g_ventoy_cur_img_path) if (0 == g_ventoy_secondary_menu_on)
{ {
grub_env_set("VTOY_CHKSUM_FILE_PATH", g_ventoy_cur_img_path); if (g_ventoy_cur_img_path)
cmdstr = grub_env_get("VTOY_CHKSUM_CMD");
if (cmdstr)
{ {
menu_fini(); grub_env_set("VTOY_CHKSUM_FILE_PATH", g_ventoy_cur_img_path);
grub_script_execute_sourcecode(cmdstr); cmdstr = grub_env_get("VTOY_CHKSUM_CMD");
goto refresh; if (cmdstr)
{
menu_fini();
grub_script_execute_sourcecode(cmdstr);
goto refresh;
}
}
else
{
grub_env_set("VTOY_CHKSUM_FILE_PATH", "X");
} }
}
else
{
grub_env_set("VTOY_CHKSUM_FILE_PATH", "X");
} }
break; break;
} }
@@ -1071,6 +1133,7 @@ show_menu (grub_menu_t menu, int nested, int autobooted)
while (1) while (1)
{ {
int ndown;
int boot_entry; int boot_entry;
grub_menu_entry_t e; grub_menu_entry_t e;
int auto_boot; int auto_boot;
@@ -1113,6 +1176,16 @@ show_menu (grub_menu_t menu, int nested, int autobooted)
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) {
ndown = (int)grub_strtol(e->args[1] + 12, NULL, 10);
while (ndown > 0)
{
ventoy_menu_push_key(GRUB_TERM_KEY_DOWN);
ndown--;
}
ventoy_menu_push_key('\n');
break;
}
} }
return GRUB_ERR_NONE; return GRUB_ERR_NONE;

View File

@@ -31,6 +31,8 @@
static grub_uint8_t grub_color_menu_normal; static grub_uint8_t grub_color_menu_normal;
static grub_uint8_t grub_color_menu_highlight; static grub_uint8_t grub_color_menu_highlight;
extern char g_ventoy_hotkey_tip[256];
struct menu_viewer_data struct menu_viewer_data
{ {
int first, offset; int first, offset;
@@ -204,7 +206,7 @@ command-line or ESC to discard edits and return to the GRUB menu."),
ret += grub_print_message_indented_real(szLine, STANDARD_MARGIN, STANDARD_MARGIN, term, dry_run); ret += grub_print_message_indented_real(szLine, STANDARD_MARGIN, STANDARD_MARGIN, term, dry_run);
ret += grub_print_message_indented_real("\n", STANDARD_MARGIN, STANDARD_MARGIN, term, dry_run); ret += grub_print_message_indented_real("\n", STANDARD_MARGIN, STANDARD_MARGIN, term, dry_run);
ret += grub_print_message_indented_real(grub_env_get("VTOY_HOTKEY_TIP"), ret += grub_print_message_indented_real(g_ventoy_hotkey_tip,
3, 6, term, dry_run); 3, 6, term, dry_run);
} }
} }

View File

@@ -115,6 +115,92 @@ int ventoy_str_all_digit(const char *str)
return 1; return 1;
} }
int ventoy_str_all_alnum(const char *str)
{
if (NULL == str || 0 == *str)
{
return 0;
}
while (*str)
{
if (!grub_isalnum(*str))
{
return 0;
}
}
return 1;
}
int ventoy_str_len_alnum(const char *str, int len)
{
int i;
int slen;
if (NULL == str || 0 == *str)
{
return 0;
}
slen = grub_strlen(str);
if (slen <= len)
{
return 0;
}
for (i = 0; i < len; i++)
{
if (!grub_isalnum(str[i]))
{
return 0;
}
}
if (str[len] == 0 || grub_isspace(str[len]))
{
return 1;
}
return 0;
}
char * ventoy_str_basename(char *path)
{
char *pos = NULL;
pos = grub_strrchr(path, '/');
if (pos)
{
pos++;
}
else
{
pos = path;
}
return pos;
}
int ventoy_str_chrcnt(const char *str, char c)
{
int n = 0;
if (str)
{
while (*str)
{
if (*str == c)
{
n++;
}
str++;
}
}
return n;
}
int ventoy_strcmp(const char *pattern, const char *str) int ventoy_strcmp(const char *pattern, const char *str)
{ {
while (*pattern && *str) while (*pattern && *str)
@@ -146,6 +232,14 @@ int ventoy_strncmp (const char *pattern, const char *str, grub_size_t n)
return (int)(grub_uint8_t)*pattern - (int)(grub_uint8_t)*str; return (int)(grub_uint8_t)*pattern - (int)(grub_uint8_t)*str;
} }
grub_err_t ventoy_env_int_set(const char *name, int value)
{
char buf[16];
grub_snprintf(buf, sizeof(buf), "%d", value);
return grub_env_set(name, buf);
}
void ventoy_debug_dump_guid(const char *prefix, grub_uint8_t *guid) void ventoy_debug_dump_guid(const char *prefix, grub_uint8_t *guid)
{ {
int i; int i;
@@ -188,6 +282,21 @@ void * ventoy_alloc_chain(grub_size_t size)
return p; return p;
} }
void ventoy_memfile_env_set(const char *prefix, const void *buf, unsigned long long len)
{
char name[128];
char val[64];
grub_snprintf(name, sizeof(name), "%s_addr", prefix);
grub_snprintf(val, sizeof(val), "0x%llx", (ulonglong)(ulong)buf);
grub_env_set(name, val);
grub_snprintf(name, sizeof(name), "%s_size", prefix);
grub_snprintf(val, sizeof(val), "%llu", len);
grub_env_set(name, val);
return;
}
static int ventoy_arch_mode_init(void) static int ventoy_arch_mode_init(void)
{ {
@@ -254,12 +363,130 @@ static int ventoy_hwinfo_init(void)
grub_snprintf(str, sizeof(str), "%ld", (long)(total_mem / VTOY_SIZE_1MB)); grub_snprintf(str, sizeof(str), "%ld", (long)(total_mem / VTOY_SIZE_1MB));
ventoy_env_export("grub_total_ram", str); ventoy_env_export("grub_total_ram", str);
#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);
#else
ventoy_env_export("grub_uefi_version", "NA");
#endif #endif
return 0;
}
static global_var_cfg g_global_vars[] =
{
{ "gfxmode", "1024x768", NULL },
{ ventoy_left_key, "5%", NULL },
{ ventoy_top_key, "95%", NULL },
{ ventoy_color_key, "#0000ff", NULL },
{ NULL, NULL, NULL }
};
static const char * ventoy_global_var_read_hook(struct grub_env_var *var, const char *val)
{
int i;
for (i = 0; g_global_vars[i].name; i++)
{
if (grub_strcmp(g_global_vars[i].name, var->name) == 0)
{
return g_global_vars[i].value;
}
}
return val;
}
static char * ventoy_global_var_write_hook(struct grub_env_var *var, const char *val)
{
int i;
for (i = 0; g_global_vars[i].name; i++)
{
if (grub_strcmp(g_global_vars[i].name, var->name) == 0)
{
grub_check_free(g_global_vars[i].value);
g_global_vars[i].value = grub_strdup(val);
break;
}
}
return grub_strdup(val);
}
int ventoy_global_var_init(void)
{
int i;
for (i = 0; g_global_vars[i].name; i++)
{
g_global_vars[i].value = grub_strdup(g_global_vars[i].defval);
ventoy_env_export(g_global_vars[i].name, g_global_vars[i].defval);
grub_register_variable_hook(g_global_vars[i].name, ventoy_global_var_read_hook, ventoy_global_var_write_hook);
}
return 0;
}
static ctrl_var_cfg g_ctrl_vars[] =
{
{ "VTOY_WIN11_BYPASS_CHECK", 1 },
{ "VTOY_WIN11_BYPASS_NRO", 1 },
{ "VTOY_LINUX_REMOUNT", 0 },
{ "VTOY_SECONDARY_BOOT_MENU", 1 },
{ NULL, 0 }
};
static const char * ventoy_ctrl_var_read_hook(struct grub_env_var *var, const char *val)
{
int i;
for (i = 0; g_ctrl_vars[i].name; i++)
{
if (grub_strcmp(g_ctrl_vars[i].name, var->name) == 0)
{
return g_ctrl_vars[i].value ? "1" : "0";
}
}
return val;
}
static char * ventoy_ctrl_var_write_hook(struct grub_env_var *var, const char *val)
{
int i;
for (i = 0; g_ctrl_vars[i].name; i++)
{
if (grub_strcmp(g_ctrl_vars[i].name, var->name) == 0)
{
if (val && val[0] == '1' && val[1] == 0)
{
g_ctrl_vars[i].value = 1;
return grub_strdup("1");
}
else
{
g_ctrl_vars[i].value = 0;
return grub_strdup("0");
}
}
}
return grub_strdup(val);
}
int ventoy_ctrl_var_init(void)
{
int i;
for (i = 0; g_ctrl_vars[i].name; i++)
{
ventoy_env_export(g_ctrl_vars[i].name, g_ctrl_vars[i].value ? "1" : "0");
grub_register_variable_hook(g_ctrl_vars[i].name, ventoy_ctrl_var_read_hook, ventoy_ctrl_var_write_hook);
}
return 0; return 0;
} }

View File

@@ -392,6 +392,11 @@ static int ventoy_browser_iterate_dir(const char *filename, const struct grub_di
return 0; return 0;
} }
if (grub_file_is_vlnk_suffix(filename, len))
{
return 0;
}
node = grub_zalloc(sizeof(browser_node)); node = grub_zalloc(sizeof(browser_node));
if (!node) if (!node)
{ {
@@ -616,13 +621,15 @@ grub_err_t ventoy_cmd_browser_disk(grub_extcmd_context_t ctxt, int argc, char **
if (g_tree_view_menu_style == 0) if (g_tree_view_menu_style == 0)
{ {
browser_ssprintf(&mbuf, "menuentry \"%-10s [Return]\" --class=\"vtoyret\" VTOY_RET {\n " browser_ssprintf(&mbuf, "menuentry \"%-10s [%s]\" --class=\"vtoyret\" VTOY_RET {\n "
" echo 'return ...' \n}\n", "<--"); " echo 'return ...' \n}\n", "<--",
ventoy_get_vmenu_title("VTLANG_BROWER_RETURN"));
} }
else else
{ {
browser_ssprintf(&mbuf, "menuentry \"[Return]\" --class=\"vtoyret\" VTOY_RET {\n " browser_ssprintf(&mbuf, "menuentry \"[%s]\" --class=\"vtoyret\" VTOY_RET {\n "
" echo 'return ...' \n}\n"); " echo 'return ...' \n}\n",
ventoy_get_vmenu_title("VTLANG_BROWER_RETURN"));
} }
grub_disk_dev_iterate(ventoy_browser_iterate_disk, &mbuf); grub_disk_dev_iterate(ventoy_browser_iterate_disk, &mbuf);

File diff suppressed because it is too large Load Diff

View File

@@ -29,6 +29,8 @@
#define VTOY_FILT_MIN_FILE_SIZE 32768 #define VTOY_FILT_MIN_FILE_SIZE 32768
#define VTOY_LINUX_SYSTEMD_MENU_MAX_BUF 16384
#define VTOY_SIZE_1GB 1073741824 #define VTOY_SIZE_1GB 1073741824
#define VTOY_SIZE_1MB (1024 * 1024) #define VTOY_SIZE_1MB (1024 * 1024)
#define VTOY_SIZE_2MB (2 * 1024 * 1024) #define VTOY_SIZE_2MB (2 * 1024 * 1024)
@@ -60,6 +62,8 @@
#define VTOY_WARNING "!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!" #define VTOY_WARNING "!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!"
#define VTOY_CHKSUM_NUM 4
#define VTOY_PLAT_I386_UEFI 0x49413332 #define VTOY_PLAT_I386_UEFI 0x49413332
#define VTOY_PLAT_ARM64_UEFI 0x41413634 #define VTOY_PLAT_ARM64_UEFI 0x41413634
#define VTOY_PLAT_X86_64_UEFI 0x55454649 #define VTOY_PLAT_X86_64_UEFI 0x55454649
@@ -75,6 +79,10 @@
#define VTOY_ARCH_CPIO "ventoy_x86.cpio" #define VTOY_ARCH_CPIO "ventoy_x86.cpio"
#endif #endif
#define ventoy_left_key "VTLE_LFT"
#define ventoy_top_key "VTLE_TOP"
#define ventoy_color_key "VTLE_CLR"
#define ventoy_varg_4(arg) arg[0], arg[1], arg[2], arg[3] #define ventoy_varg_4(arg) arg[0], arg[1], arg[2], arg[3]
#define ventoy_varg_8(arg) arg[0], arg[1], arg[2], arg[3], arg[4], arg[5], arg[6], arg[7] #define ventoy_varg_8(arg) arg[0], arg[1], arg[2], arg[3], arg[4], arg[5], arg[6], arg[7]
@@ -97,6 +105,28 @@
}\ }\
} }
#define VTOY_SKIP_SPACE(s) \
while (ventoy_isspace(*s)) \
{\
s++;\
}
#define VTOY_SKIP_SPACE_NEXT(s, initial) \
s += initial;\
while (ventoy_isspace(*s)) \
{\
s++;\
}
#define VTOY_SKIP_SPACE_NEXT_EX(s, base, initial) \
s = base + initial;\
while (ventoy_isspace(*s)) \
{\
s++;\
}
#define VTOY_GOTO_END(v) ret = v; goto end
typedef enum VTOY_FILE_FLT typedef enum VTOY_FILE_FLT
{ {
VTOY_FILE_FLT_ISO = 0, /* .iso */ VTOY_FILE_FLT_ISO = 0, /* .iso */
@@ -329,9 +359,16 @@ void ventoy_debug(const char *fmt, ...);
#define vtoy_ssprintf(buf, pos, fmt, args...) \ #define vtoy_ssprintf(buf, pos, fmt, args...) \
pos += grub_snprintf(buf + pos, VTOY_MAX_SCRIPT_BUF - pos, fmt, ##args) pos += grub_snprintf(buf + pos, VTOY_MAX_SCRIPT_BUF - pos, fmt, ##args)
#define vtoy_len_ssprintf(buf, pos, len, fmt, args...) \
pos += grub_snprintf(buf + pos, len - pos, fmt, ##args)
#define browser_ssprintf(mbuf, fmt, args...) \ #define browser_ssprintf(mbuf, fmt, args...) \
(mbuf)->pos += grub_snprintf((mbuf)->buf + (mbuf)->pos, (mbuf)->max - (mbuf)->pos, fmt, ##args) (mbuf)->pos += grub_snprintf((mbuf)->buf + (mbuf)->pos, (mbuf)->max - (mbuf)->pos, fmt, ##args)
#define vtoy_dummy_menuentry(buf, pos, len, title, class) \
vtoy_len_ssprintf(buf, pos, len, "menuentry \"%s\" --class=\"%s\" {\n echo \"\"\n}\n", title, class)
#define FLAG_HEADER_RESERVED 0x00000001 #define FLAG_HEADER_RESERVED 0x00000001
#define FLAG_HEADER_COMPRESSION 0x00000002 #define FLAG_HEADER_COMPRESSION 0x00000002
#define FLAG_HEADER_READONLY 0x00000004 #define FLAG_HEADER_READONLY 0x00000004
@@ -602,6 +639,11 @@ typedef struct chk_case_fs_dir
}chk_case_fs_dir; }chk_case_fs_dir;
int ventoy_str_all_digit(const char *str); int ventoy_str_all_digit(const char *str);
int ventoy_str_all_alnum(const char *str);
int ventoy_str_len_alnum(const char *str, int len);
char * ventoy_str_basename(char *path);
grub_err_t ventoy_env_int_set(const char *name, int value);
int ventoy_str_chrcnt(const char *str, char c);
int ventoy_strcmp(const char *pattern, const char *str); int ventoy_strcmp(const char *pattern, const char *str);
int ventoy_strncmp (const char *pattern, const char *str, grub_size_t n); int ventoy_strncmp (const char *pattern, const char *str, grub_size_t n);
void ventoy_fill_os_param(grub_file_t file, ventoy_os_param *param); void ventoy_fill_os_param(grub_file_t file, ventoy_os_param *param);
@@ -613,6 +655,8 @@ grub_err_t ventoy_cmd_clear_initrd_list(grub_extcmd_context_t ctxt, int argc, ch
grub_uint32_t ventoy_get_iso_boot_catlog(grub_file_t file); 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_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);
grub_err_t ventoy_cmd_valid_initrd_count(grub_extcmd_context_t ctxt, int argc, char **args); grub_err_t ventoy_cmd_valid_initrd_count(grub_extcmd_context_t ctxt, int argc, char **args);
@@ -633,6 +677,7 @@ grub_err_t ventoy_cmd_windows_chain_data(grub_extcmd_context_t ctxt, int argc, c
grub_err_t ventoy_cmd_windows_wimboot_data(grub_extcmd_context_t ctxt, int argc, char **args); grub_err_t ventoy_cmd_windows_wimboot_data(grub_extcmd_context_t ctxt, int argc, char **args);
grub_err_t ventoy_cmd_wim_chain_data(grub_extcmd_context_t ctxt, int argc, char **args); grub_err_t ventoy_cmd_wim_chain_data(grub_extcmd_context_t ctxt, int argc, char **args);
grub_err_t ventoy_cmd_wim_check_bootable(grub_extcmd_context_t ctxt, int argc, char **args); grub_err_t ventoy_cmd_wim_check_bootable(grub_extcmd_context_t ctxt, int argc, char **args);
grub_err_t ventoy_cmd_is_standard_winiso(grub_extcmd_context_t ctxt, int argc, char **args);
grub_err_t ventoy_cmd_dump_wim_patch(grub_extcmd_context_t ctxt, int argc, char **args); grub_err_t ventoy_cmd_dump_wim_patch(grub_extcmd_context_t ctxt, int argc, char **args);
grub_err_t ventoy_cmd_sel_wimboot(grub_extcmd_context_t ctxt, int argc, char **args); grub_err_t ventoy_cmd_sel_wimboot(grub_extcmd_context_t ctxt, int argc, char **args);
grub_err_t ventoy_cmd_set_wim_prompt(grub_extcmd_context_t ctxt, int argc, char **args); grub_err_t ventoy_cmd_set_wim_prompt(grub_extcmd_context_t ctxt, int argc, char **args);
@@ -1028,6 +1073,7 @@ typedef struct menu_password
}menu_password; }menu_password;
extern int g_ventoy_menu_esc; extern int g_ventoy_menu_esc;
extern int g_ventoy_secondary_menu_on;
extern int g_ventoy_suppress_esc; extern int g_ventoy_suppress_esc;
extern int g_ventoy_suppress_esc_default; extern int g_ventoy_suppress_esc_default;
extern int g_ventoy_last_entry; extern int g_ventoy_last_entry;
@@ -1040,6 +1086,9 @@ extern int g_ventoy_case_insensitive;
extern int g_ventoy_fn_mutex; extern int g_ventoy_fn_mutex;
extern grub_uint8_t g_ventoy_chain_type; extern grub_uint8_t g_ventoy_chain_type;
extern int g_vhdboot_enable; extern int g_vhdboot_enable;
extern int g_default_menu_mode;
extern char g_ventoy_hotkey_tip[256];
extern int g_ventoy_menu_refresh;
#define VENTOY_IMG_WHITE_LIST 1 #define VENTOY_IMG_WHITE_LIST 1
#define VENTOY_IMG_BLACK_LIST 2 #define VENTOY_IMG_BLACK_LIST 2
@@ -1111,6 +1160,7 @@ grub_err_t ventoy_cmd_linux_get_main_initrd_index(grub_extcmd_context_t ctxt, in
grub_err_t ventoy_cmd_collect_wim_patch(grub_extcmd_context_t ctxt, int argc, char **args); grub_err_t ventoy_cmd_collect_wim_patch(grub_extcmd_context_t ctxt, int argc, char **args);
grub_err_t ventoy_cmd_wim_patch_count(grub_extcmd_context_t ctxt, int argc, char **args); grub_err_t ventoy_cmd_wim_patch_count(grub_extcmd_context_t ctxt, int argc, char **args);
grub_err_t ventoy_cmd_locate_wim_patch(grub_extcmd_context_t ctxt, int argc, char **args); grub_err_t ventoy_cmd_locate_wim_patch(grub_extcmd_context_t ctxt, int argc, char **args);
grub_err_t ventoy_cmd_sel_winpe_wim(grub_extcmd_context_t ctxt, int argc, char **args);
grub_err_t ventoy_cmd_unix_chain_data(grub_extcmd_context_t ctxt, int argc, char **args); grub_err_t ventoy_cmd_unix_chain_data(grub_extcmd_context_t ctxt, int argc, char **args);
int ventoy_get_disk_guid(const char *filename, grub_uint8_t *guid, grub_uint8_t *signature); int ventoy_get_disk_guid(const char *filename, grub_uint8_t *guid, grub_uint8_t *signature);
grub_err_t ventoy_cmd_unix_reset(grub_extcmd_context_t ctxt, int argc, char **args); grub_err_t ventoy_cmd_unix_reset(grub_extcmd_context_t ctxt, int argc, char **args);
@@ -1218,6 +1268,29 @@ typedef struct var_node
struct var_node *next; struct var_node *next;
}var_node; }var_node;
typedef struct systemd_menu_ctx
{
char *dev;
char *buf;
int pos;
int len;
}systemd_menu_ctx;
typedef struct global_var_cfg
{
const char *name;
const char *defval;
char *value;
}global_var_cfg;
typedef struct ctrl_var_cfg
{
const char *name;
int value;
}ctrl_var_cfg;
#define vtoy_check_goto_out(p) if (!p) goto out
extern char *g_tree_script_buf; extern char *g_tree_script_buf;
extern int g_tree_script_pos; extern int g_tree_script_pos;
extern int g_tree_script_pre; extern int g_tree_script_pre;
@@ -1234,6 +1307,14 @@ grub_err_t ventoy_cmd_browser_disk(grub_extcmd_context_t ctxt, int argc, char **
int ventoy_get_fs_type(const char *fs); int ventoy_get_fs_type(const char *fs);
int ventoy_img_name_valid(const char *filename, grub_size_t namelen); int ventoy_img_name_valid(const char *filename, grub_size_t namelen);
void * ventoy_alloc_chain(grub_size_t size); void * ventoy_alloc_chain(grub_size_t size);
int ventoy_plugin_load_menu_lang(int init, const char *lang);
const char *ventoy_get_vmenu_title(const char *vMenu);
grub_err_t ventoy_cmd_cur_menu_lang(grub_extcmd_context_t ctxt, int argc, char **args);
extern int ventoy_menu_push_key(int code);
int ventoy_ctrl_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_pop_menulang(grub_extcmd_context_t ctxt, int argc, char **args);
#endif /* __VENTOY_DEF_H__ */ #endif /* __VENTOY_DEF_H__ */

View File

@@ -177,10 +177,7 @@ static grub_err_t ventoy_isolinux_initrd_collect(grub_file_t file, const char *p
{ {
nextline = ventoy_get_line(start); nextline = ventoy_get_line(start);
while (ventoy_isspace(*start)) VTOY_SKIP_SPACE(start);
{
start++;
}
offset = 7; // strlen("initrd=") or "INITRD " or "initrd " offset = 7; // strlen("initrd=") or "INITRD " or "initrd "
pos = grub_strstr(start, "initrd="); pos = grub_strstr(start, "initrd=");
@@ -333,12 +330,84 @@ end:
VENTOY_CMD_RETURN(GRUB_ERR_NONE); VENTOY_CMD_RETURN(GRUB_ERR_NONE);
} }
static int ventoy_linux_initrd_collect_hook(const char *filename, const struct grub_dirhook_info *info, void *data)
{
int len;
initrd_info *img = NULL;
(void)data;
if (0 == info->dir)
{
if (grub_strncmp(filename, "initrd", 6) == 0)
{
len = (int)grub_strlen(filename);
if (grub_strcmp(filename + len - 4, ".img") == 0)
{
img = grub_zalloc(sizeof(initrd_info));
if (img)
{
grub_snprintf(img->name, sizeof(img->name), "/boot/%s", filename);
if (ventoy_find_initrd_by_name(g_initrd_img_list, img->name))
{
grub_free(img);
}
else
{
if (g_initrd_img_list)
{
img->prev = g_initrd_img_tail;
g_initrd_img_tail->next = img;
}
else
{
g_initrd_img_list = img;
}
g_initrd_img_tail = img;
g_initrd_img_count++;
}
}
}
}
}
return 0;
}
static int ventoy_linux_collect_boot_initrds(void)
{
grub_fs_t fs;
grub_device_t dev = NULL;
dev = grub_device_open("loop");
if (!dev)
{
debug("failed to open device loop\n");
goto end;
}
fs = grub_fs_probe(dev);
if (!fs)
{
debug("failed to probe fs %d\n", grub_errno);
goto end;
}
fs->fs_dir(dev, "/boot", ventoy_linux_initrd_collect_hook, NULL);
end:
return 0;
}
static grub_err_t ventoy_grub_cfg_initrd_collect(const char *fileName) static grub_err_t ventoy_grub_cfg_initrd_collect(const char *fileName)
{ {
int i = 0; int i = 0;
int len = 0; int len = 0;
int dollar = 0; int dollar = 0;
int quotation = 0; int quotation = 0;
int initrd_dollar = 0;
grub_file_t file = NULL; grub_file_t file = NULL;
char *buf = NULL; char *buf = NULL;
char *start = NULL; char *start = NULL;
@@ -366,10 +435,7 @@ static grub_err_t ventoy_grub_cfg_initrd_collect(const char *fileName)
{ {
nextline = ventoy_get_line(start); nextline = ventoy_get_line(start);
while (ventoy_isspace(*start)) VTOY_SKIP_SPACE(start);
{
start++;
}
if (grub_strncmp(start, "initrd", 6) != 0) if (grub_strncmp(start, "initrd", 6) != 0)
{ {
@@ -382,10 +448,7 @@ static grub_err_t ventoy_grub_cfg_initrd_collect(const char *fileName)
start++; start++;
} }
while (ventoy_isspace(*start)) VTOY_SKIP_SPACE(start);
{
start++;
}
if (*start == '"') if (*start == '"')
{ {
@@ -421,6 +484,19 @@ static grub_err_t ventoy_grub_cfg_initrd_collect(const char *fileName)
debug("Remove quotation <%s>\n", img->name); debug("Remove quotation <%s>\n", img->name);
} }
/* special process for /boot/initrd$XXX.img */
if (dollar == 1)
{
if (grub_strncmp(img->name, "/boot/initrd$", 13) == 0)
{
len = (int)grub_strlen(img->name);
if (grub_strcmp(img->name + len - 4, ".img") == 0)
{
initrd_dollar++;
}
}
}
if (dollar == 1 || ventoy_find_initrd_by_name(g_initrd_img_list, img->name)) if (dollar == 1 || ventoy_find_initrd_by_name(g_initrd_img_list, img->name))
{ {
grub_free(img); grub_free(img);
@@ -443,10 +519,7 @@ static grub_err_t ventoy_grub_cfg_initrd_collect(const char *fileName)
if (*start == ' ' || *start == '\t') if (*start == ' ' || *start == '\t')
{ {
while (ventoy_isspace(*start)) VTOY_SKIP_SPACE(start);
{
start++;
}
} }
else else
{ {
@@ -458,6 +531,12 @@ static grub_err_t ventoy_grub_cfg_initrd_collect(const char *fileName)
grub_free(buf); grub_free(buf);
grub_file_close(file); grub_file_close(file);
if (initrd_dollar > 0 && grub_strncmp(fileName, "(loop)/", 7) == 0)
{
debug("collect initrd variable %d\n", initrd_dollar);
ventoy_linux_collect_boot_initrds();
}
VENTOY_CMD_RETURN(GRUB_ERR_NONE); VENTOY_CMD_RETURN(GRUB_ERR_NONE);
} }
@@ -1481,7 +1560,6 @@ grub_err_t ventoy_cmd_trailer_cpio(grub_extcmd_context_t ctxt, int argc, char **
grub_uint8_t *bufend; grub_uint8_t *bufend;
cpio_newc_header *head; cpio_newc_header *head;
grub_file_t file; grub_file_t file;
char value[64];
const grub_uint8_t trailler[124] = { const grub_uint8_t trailler[124] = {
0x30, 0x37, 0x30, 0x37, 0x30, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x37, 0x30, 0x37, 0x30, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
@@ -1552,11 +1630,8 @@ grub_err_t ventoy_cmd_trailer_cpio(grub_extcmd_context_t ctxt, int argc, char **
name = (char *)(head + 1); name = (char *)(head + 1);
} }
} }
grub_snprintf(value, sizeof(value), "0x%llx", (ulonglong)(ulong)g_ventoy_cpio_buf); ventoy_memfile_env_set("ventoy_cpio", g_ventoy_cpio_buf, (ulonglong)bufsize);
ventoy_set_env("ventoy_cpio_addr", value);
grub_snprintf(value, sizeof(value), "%d", bufsize);
ventoy_set_env("ventoy_cpio_size", value);
VENTOY_CMD_RETURN(GRUB_ERR_NONE); VENTOY_CMD_RETURN(GRUB_ERR_NONE);
} }
@@ -1578,7 +1653,6 @@ grub_err_t ventoy_cmd_linux_chain_data(grub_extcmd_context_t ctxt, int argc, cha
const char *pLastChain = NULL; const char *pLastChain = NULL;
const char *compatible; const char *compatible;
ventoy_chain_head *chain; ventoy_chain_head *chain;
char envbuf[64];
(void)ctxt; (void)ctxt;
(void)argc; (void)argc;
@@ -1666,10 +1740,7 @@ grub_err_t ventoy_cmd_linux_chain_data(grub_extcmd_context_t ctxt, int argc, cha
return 1; return 1;
} }
grub_snprintf(envbuf, sizeof(envbuf), "0x%lx", (unsigned long)chain); ventoy_memfile_env_set("vtoy_chain_mem", chain, (ulonglong)size);
grub_env_set("vtoy_chain_mem_addr", envbuf);
grub_snprintf(envbuf, sizeof(envbuf), "%u", size);
grub_env_set("vtoy_chain_mem_size", envbuf);
grub_memset(chain, 0, sizeof(ventoy_chain_head)); grub_memset(chain, 0, sizeof(ventoy_chain_head));
@@ -1720,3 +1791,300 @@ grub_err_t ventoy_cmd_linux_chain_data(grub_extcmd_context_t ctxt, int argc, cha
VENTOY_CMD_RETURN(GRUB_ERR_NONE); VENTOY_CMD_RETURN(GRUB_ERR_NONE);
} }
static char *ventoy_systemd_conf_tag(char *buf, const char *tag, int optional)
{
int taglen = 0;
char *start = NULL;
char *nextline = NULL;
taglen = grub_strlen(tag);
for (start = buf; start; start = nextline)
{
nextline = ventoy_get_line(start);
VTOY_SKIP_SPACE(start);
if (grub_strncmp(start, tag, taglen) == 0 && (start[taglen] == ' ' || start[taglen] == '\t'))
{
start += taglen;
VTOY_SKIP_SPACE(start);
return start;
}
}
if (optional == 0)
{
debug("tag<%s> NOT found\n", tag);
}
return NULL;
}
static int ventoy_systemd_conf_hook(const char *filename, const struct grub_dirhook_info *info, void *data)
{
int oldpos = 0;
char *tag = NULL;
char *bkbuf = NULL;
char *filebuf = NULL;
grub_file_t file = NULL;
systemd_menu_ctx *ctx = (systemd_menu_ctx *)data;
debug("ventoy_systemd_conf_hook %s\n", filename);
if (info->dir || NULL == grub_strstr(filename, ".conf"))
{
return 0;
}
file = ventoy_grub_file_open(VENTOY_FILE_TYPE, "%s/loader/entries/%s", ctx->dev, filename);
if (!file)
{
return 0;
}
filebuf = grub_zalloc(2 * file->size + 8);
if (!filebuf)
{
goto out;
}
bkbuf = filebuf + file->size + 4;
grub_file_read(file, bkbuf, file->size);
oldpos = ctx->pos;
/* title --> menuentry */
grub_memcpy(filebuf, bkbuf, file->size);
tag = ventoy_systemd_conf_tag(filebuf, "title", 0);
vtoy_check_goto_out(tag);
vtoy_len_ssprintf(ctx->buf, ctx->pos, ctx->len, "menuentry \"%s\" {\n", tag);
/* linux xxx */
grub_memcpy(filebuf, bkbuf, file->size);
tag = ventoy_systemd_conf_tag(filebuf, "linux", 0);
if (!tag)
{
ctx->pos = oldpos;
goto out;
}
vtoy_len_ssprintf(ctx->buf, ctx->pos, ctx->len, " echo \"Downloading kernel ...\"\n linux %s ", tag);
/* kernel options */
grub_memcpy(filebuf, bkbuf, file->size);
tag = ventoy_systemd_conf_tag(filebuf, "options", 0);
vtoy_len_ssprintf(ctx->buf, ctx->pos, ctx->len, "%s \n", tag ? tag : "");
/* initrd xxx xxx xxx */
vtoy_len_ssprintf(ctx->buf, ctx->pos, ctx->len, " echo \"Downloading initrd ...\"\n initrd ");
grub_memcpy(filebuf, bkbuf, file->size);
tag = ventoy_systemd_conf_tag(filebuf, "initrd", 1);
while (tag)
{
vtoy_len_ssprintf(ctx->buf, ctx->pos, ctx->len, "%s ", tag);
tag = ventoy_systemd_conf_tag(tag + grub_strlen(tag) + 1, "initrd", 1);
}
vtoy_len_ssprintf(ctx->buf, ctx->pos, ctx->len, "\n boot\n}\n");
out:
grub_check_free(filebuf);
grub_file_close(file);
return 0;
}
grub_err_t ventoy_cmd_linux_systemd_menu(grub_extcmd_context_t ctxt, int argc, char **args)
{
static char *buf = NULL;
grub_fs_t fs;
char *device_name = NULL;
grub_device_t dev = NULL;
systemd_menu_ctx ctx;
(void)ctxt;
(void)argc;
if (!buf)
{
buf = grub_malloc(VTOY_LINUX_SYSTEMD_MENU_MAX_BUF);
if (!buf)
{
goto end;
}
}
device_name = grub_file_get_device_name(args[0]);
if (!device_name)
{
debug("failed to get device name %s\n", args[0]);
goto end;
}
dev = grub_device_open(device_name);
if (!dev)
{
debug("failed to open device %s\n", device_name);
goto end;
}
fs = grub_fs_probe(dev);
if (!fs)
{
debug("failed to probe fs %d\n", grub_errno);
goto end;
}
ctx.dev = args[0];
ctx.buf = buf;
ctx.pos = 0;
ctx.len = VTOY_LINUX_SYSTEMD_MENU_MAX_BUF;
fs->fs_dir(dev, "/loader/entries", ventoy_systemd_conf_hook, &ctx);
ventoy_memfile_env_set(args[1], buf, (ulonglong)(ctx.pos));
end:
grub_check_free(device_name);
check_free(dev, grub_device_close);
VENTOY_CMD_RETURN(GRUB_ERR_NONE);
}
static int ventoy_limine_path_convert(char *path)
{
char newpath[256] = {0};
if (grub_strncmp(path, "boot://2/", 9) == 0)
{
grub_snprintf(newpath, sizeof(newpath), "(vtimghd,2)/%s", path + 9);
}
else if (grub_strncmp(path, "boot://1/", 9) == 0)
{
grub_snprintf(newpath, sizeof(newpath), "(vtimghd,1)/%s", path + 9);
}
if (newpath[0])
{
grub_snprintf(path, 1024, "%s", newpath);
}
return 0;
}
grub_err_t ventoy_cmd_linux_limine_menu(grub_extcmd_context_t ctxt, int argc, char **args)
{
int pos = 0;
int sub = 0;
int len = VTOY_LINUX_SYSTEMD_MENU_MAX_BUF;
char *filebuf = NULL;
char *start = NULL;
char *nextline = NULL;
grub_file_t file = NULL;
char *title = NULL;
char *kernel = NULL;
char *initrd = NULL;
char *param = NULL;
static char *buf = NULL;
(void)ctxt;
(void)argc;
if (!buf)
{
buf = grub_malloc(len + 4 * 1024);
if (!buf)
{
goto end;
}
}
title = buf + len;
kernel = title + 1024;
initrd = kernel + 1024;
param = initrd + 1024;
file = ventoy_grub_file_open(VENTOY_FILE_TYPE, args[0]);
if (!file)
{
return 0;
}
filebuf = grub_zalloc(file->size + 8);
if (!filebuf)
{
goto end;
}
grub_file_read(file, filebuf, file->size);
grub_file_close(file);
title[0] = kernel[0] = initrd[0] = param[0] = 0;
for (start = filebuf; start; start = nextline)
{
nextline = ventoy_get_line(start);
VTOY_SKIP_SPACE(start);
if (start[0] == ':')
{
if (start[1] == ':')
{
grub_snprintf(title, 1024, "%s", start + 2);
}
else
{
if (sub)
{
vtoy_len_ssprintf(buf, pos, len, "}\n");
sub = 0;
}
if (nextline && nextline[0] == ':' && nextline[1] == ':')
{
vtoy_len_ssprintf(buf, pos, len, "submenu \"[+] %s\" {\n", start + 2);
sub = 1;
title[0] = 0;
}
else
{
grub_snprintf(title, 1024, "%s", start + 1);
}
}
}
else if (grub_strncmp(start, "KERNEL_PATH=", 12) == 0)
{
grub_snprintf(kernel, 1024, "%s", start + 12);
}
else if (grub_strncmp(start, "MODULE_PATH=", 12) == 0)
{
grub_snprintf(initrd, 1024, "%s", start + 12);
}
else if (grub_strncmp(start, "KERNEL_CMDLINE=", 15) == 0)
{
grub_snprintf(param, 1024, "%s", start + 15);
}
if (title[0] && kernel[0] && initrd[0] && param[0])
{
ventoy_limine_path_convert(kernel);
ventoy_limine_path_convert(initrd);
vtoy_len_ssprintf(buf, pos, len, "menuentry \"%s\" {\n", title);
vtoy_len_ssprintf(buf, pos, len, " echo \"Downloading kernel ...\"\n linux %s %s\n", kernel, param);
vtoy_len_ssprintf(buf, pos, len, " echo \"Downloading initrd ...\"\n initrd %s\n", initrd);
vtoy_len_ssprintf(buf, pos, len, "}\n");
title[0] = kernel[0] = initrd[0] = param[0] = 0;
}
}
if (sub)
{
vtoy_len_ssprintf(buf, pos, len, "}\n");
sub = 0;
}
ventoy_memfile_env_set(args[1], buf, (ulonglong)pos);
end:
grub_check_free(filebuf);
VENTOY_CMD_RETURN(GRUB_ERR_NONE);
}

View File

@@ -35,6 +35,7 @@
#include <grub/crypto.h> #include <grub/crypto.h>
#include <grub/time.h> #include <grub/time.h>
#include <grub/font.h> #include <grub/font.h>
#include <grub/video.h>
#include <grub/ventoy.h> #include <grub/ventoy.h>
#include "ventoy_def.h" #include "ventoy_def.h"
@@ -56,12 +57,16 @@ static injection_config *g_injection_head = NULL;
static auto_memdisk *g_auto_memdisk_head = NULL; static auto_memdisk *g_auto_memdisk_head = NULL;
static image_list *g_image_list_head = NULL; static image_list *g_image_list_head = NULL;
static conf_replace *g_conf_replace_head = NULL; static conf_replace *g_conf_replace_head = NULL;
static VTOY_JSON *g_menu_lang_json = NULL;
static int g_theme_id = 0; static int g_theme_id = 0;
static int g_theme_res_fit = 0;
static int g_theme_num = 0; static int g_theme_num = 0;
static theme_list *g_theme_head = NULL; static theme_list *g_theme_head = NULL;
static int g_theme_random = vtoy_theme_random_boot_second; static int g_theme_random = vtoy_theme_random_boot_second;
static char g_theme_single_file[256]; static char g_theme_single_file[256];
static char g_cur_menu_language[32] = {0};
static char g_push_menu_language[32] = {0};
static int ventoy_plugin_is_parent(const char *pat, int patlen, const char *isopath) static int ventoy_plugin_is_parent(const char *pat, int patlen, const char *isopath)
{ {
@@ -375,6 +380,18 @@ static int ventoy_plugin_theme_entry(VTOY_JSON *json, const char *isodisk)
if (g_theme_num > 0) if (g_theme_num > 0)
{ {
vtoy_json_get_int(json->pstChild, "default_file", &g_theme_id); vtoy_json_get_int(json->pstChild, "default_file", &g_theme_id);
if (g_theme_id == 0)
{
vtoy_json_get_int(json->pstChild, "resolution_fit", &g_theme_res_fit);
if (g_theme_res_fit != 1)
{
g_theme_res_fit = 0;
}
grub_snprintf(val, sizeof(val), "%d", g_theme_res_fit);
ventoy_env_export("vtoy_res_fit", val);
}
if (g_theme_id > g_theme_num || g_theme_id < 0) if (g_theme_id > g_theme_num || g_theme_id < 0)
{ {
g_theme_id = 0; g_theme_id = 0;
@@ -405,19 +422,19 @@ static int ventoy_plugin_theme_entry(VTOY_JSON *json, const char *isodisk)
value = vtoy_json_get_string_ex(json->pstChild, "ventoy_left"); value = vtoy_json_get_string_ex(json->pstChild, "ventoy_left");
if (value) if (value)
{ {
ventoy_env_export("VTLE_LFT", value); ventoy_env_export(ventoy_left_key, value);
} }
value = vtoy_json_get_string_ex(json->pstChild, "ventoy_top"); value = vtoy_json_get_string_ex(json->pstChild, "ventoy_top");
if (value) if (value)
{ {
ventoy_env_export("VTLE_TOP", value); ventoy_env_export(ventoy_top_key, value);
} }
value = vtoy_json_get_string_ex(json->pstChild, "ventoy_color"); value = vtoy_json_get_string_ex(json->pstChild, "ventoy_color");
if (value) if (value)
{ {
ventoy_env_export("VTLE_CLR", value); ventoy_env_export(ventoy_color_key, value);
} }
node = vtoy_json_find_item(json->pstChild, JSON_TYPE_ARRAY, "fonts"); node = vtoy_json_find_item(json->pstChild, JSON_TYPE_ARRAY, "fonts");
@@ -3369,7 +3386,7 @@ grub_err_t ventoy_cmd_select_theme_cfg(grub_extcmd_context_t ctxt, int argc, cha
} }
pos += grub_snprintf(buf + pos, bufsize - pos, pos += grub_snprintf(buf + pos, bufsize - pos,
"menuentry 'Return to previous menu [Esc]' --class=vtoyret VTOY_RET {\n" "menuentry \"$VTLANG_RETURN_PREVIOUS\" --class=vtoyret VTOY_RET {\n"
"echo 'Return ...'\n" "echo 'Return ...'\n"
"}\n"); "}\n");
@@ -3379,13 +3396,19 @@ grub_err_t ventoy_cmd_select_theme_cfg(grub_extcmd_context_t ctxt, int argc, cha
return 0; return 0;
} }
extern char g_ventoy_theme_path[256];
grub_err_t ventoy_cmd_set_theme(grub_extcmd_context_t ctxt, int argc, char **args) grub_err_t ventoy_cmd_set_theme(grub_extcmd_context_t ctxt, int argc, char **args)
{ {
grub_uint32_t i = 0; grub_uint32_t i = 0;
grub_uint32_t mod = 0; grub_uint32_t mod = 0;
grub_uint32_t theme_num = 0;
theme_list *node = g_theme_head; theme_list *node = g_theme_head;
struct grub_datetime datetime; struct grub_datetime datetime;
struct grub_video_mode_info info;
char buf[64];
char **pThemePath = NULL;
(void)argc; (void)argc;
(void)args; (void)args;
(void)ctxt; (void)ctxt;
@@ -3415,41 +3438,82 @@ grub_err_t ventoy_cmd_set_theme(grub_extcmd_context_t ctxt, int argc, char **arg
goto end; goto end;
} }
grub_memset(&datetime, 0, sizeof(datetime)); pThemePath = (char **)grub_zalloc(sizeof(char *) * g_theme_num);
grub_get_datetime(&datetime); if (!pThemePath)
if (g_theme_random == vtoy_theme_random_boot_second)
{ {
grub_divmod32((grub_uint32_t)datetime.second, (grub_uint32_t)g_theme_num, &mod); goto end;
}
else if (g_theme_random == vtoy_theme_random_boot_day)
{
grub_divmod32((grub_uint32_t)datetime.day, (grub_uint32_t)g_theme_num, &mod);
}
else if (g_theme_random == vtoy_theme_random_boot_month)
{
grub_divmod32((grub_uint32_t)datetime.month, (grub_uint32_t)g_theme_num, &mod);
} }
debug("%04d/%02d/%02d %02d:%02d:%02d radom:%d mod:%d\n", if (g_theme_res_fit)
datetime.year, datetime.month, datetime.day,
datetime.hour, datetime.minute, datetime.second,
g_theme_random, mod);
for (i = 0; i < mod && node; i++)
{ {
node = node->next; if (grub_video_get_info(&info) == GRUB_ERR_NONE)
{
debug("get video info success %ux%u\n", info.width, info.height);
grub_snprintf(buf, sizeof(buf), "%ux%u", info.width, info.height);
for (node = g_theme_head; node; node = node->next)
{
if (grub_strstr(node->theme.path, buf))
{
pThemePath[theme_num++] = node->theme.path;
}
}
}
} }
debug("random theme %s\n", node->theme.path); if (theme_num == 0)
grub_env_set("theme", node->theme.path); {
for (node = g_theme_head; node; node = node->next)
{
pThemePath[theme_num++] = node->theme.path;
}
}
if (theme_num == 1)
{
mod = 0;
debug("Only 1 theme match, no need to random.\n");
}
else
{
grub_memset(&datetime, 0, sizeof(datetime));
grub_get_datetime(&datetime);
if (g_theme_random == vtoy_theme_random_boot_second)
{
grub_divmod32((grub_uint32_t)datetime.second, theme_num, &mod);
}
else if (g_theme_random == vtoy_theme_random_boot_day)
{
grub_divmod32((grub_uint32_t)datetime.day, theme_num, &mod);
}
else if (g_theme_random == vtoy_theme_random_boot_month)
{
grub_divmod32((grub_uint32_t)datetime.month, theme_num, &mod);
}
debug("%04d/%02d/%02d %02d:%02d:%02d theme_num:%d mod:%d\n",
datetime.year, datetime.month, datetime.day,
datetime.hour, datetime.minute, datetime.second,
theme_num, mod);
}
if (argc > 0 && grub_strcmp(args[0], "switch") == 0)
{
grub_snprintf(g_ventoy_theme_path, sizeof(g_ventoy_theme_path), "%s", pThemePath[mod]);
}
else
{
debug("random theme %s\n", pThemePath[mod]);
grub_env_set("theme", pThemePath[mod]);
}
g_ventoy_menu_refresh = 1;
end: end:
grub_check_free(pThemePath);
VENTOY_CMD_RETURN(GRUB_ERR_NONE); VENTOY_CMD_RETURN(GRUB_ERR_NONE);
} }
extern char g_ventoy_theme_path[256];
grub_err_t ventoy_cmd_set_theme_path(grub_extcmd_context_t ctxt, int argc, char **args) grub_err_t ventoy_cmd_set_theme_path(grub_extcmd_context_t ctxt, int argc, char **args)
{ {
(void)argc; (void)argc;
@@ -3467,3 +3531,127 @@ grub_err_t ventoy_cmd_set_theme_path(grub_extcmd_context_t ctxt, int argc, char
VENTOY_CMD_RETURN(GRUB_ERR_NONE); VENTOY_CMD_RETURN(GRUB_ERR_NONE);
} }
const char *ventoy_get_vmenu_title(const char *vMenu)
{
return vtoy_json_get_string_ex(g_menu_lang_json->pstChild, vMenu);
}
int ventoy_plugin_load_menu_lang(int init, const char *lang)
{
int ret = 1;
grub_file_t file = NULL;
char *buf = NULL;
if (grub_strcmp(lang, g_cur_menu_language) == 0)
{
debug("Same menu lang %s\n", lang);
return 0;
}
grub_snprintf(g_cur_menu_language, sizeof(g_cur_menu_language), "%s", lang);
debug("Load menu lang %s\n", g_cur_menu_language);
if (g_menu_lang_json)
{
vtoy_json_destroy(g_menu_lang_json);
g_menu_lang_json = NULL;
}
g_menu_lang_json = vtoy_json_create();
if (!g_menu_lang_json)
{
goto end;
}
file = ventoy_grub_file_open(GRUB_FILE_TYPE_LINUX_INITRD, "(vt_menu_tarfs)/menu/%s.json", lang);
if (!file)
{
goto end;
}
buf = grub_malloc(file->size + 1);
if (!buf)
{
grub_printf("Failed to malloc memory %lu.\n", (ulong)(file->size + 1));
goto end;
}
buf[file->size] = 0;
grub_file_read(file, buf, file->size);
vtoy_json_parse(g_menu_lang_json, buf);
if (g_default_menu_mode == 0)
{
grub_snprintf(g_ventoy_hotkey_tip, sizeof(g_ventoy_hotkey_tip), "%s", ventoy_get_vmenu_title("VTLANG_STR_HOTKEY_TREE"));
}
else
{
grub_snprintf(g_ventoy_hotkey_tip, sizeof(g_ventoy_hotkey_tip), "%s", ventoy_get_vmenu_title("VTLANG_STR_HOTKEY_LIST"));
}
if (init == 0)
{
ventoy_menu_push_key(GRUB_TERM_ESC);
ventoy_menu_push_key(GRUB_TERM_ESC);
g_ventoy_menu_refresh = 1;
}
ret = 0;
end:
check_free(file, grub_file_close);
grub_check_free(buf);
return ret;
}
grub_err_t ventoy_cmd_cur_menu_lang(grub_extcmd_context_t ctxt, int argc, char **args)
{
(void)ctxt;
(void)argc;
if (argc > 0)
{
grub_env_set(args[0], g_cur_menu_language);
}
else
{
grub_printf("%s\n", g_cur_menu_language);
grub_printf("%s\n", g_ventoy_hotkey_tip);
grub_refresh();
}
VENTOY_CMD_RETURN(0);
}
grub_err_t ventoy_cmd_push_menulang(grub_extcmd_context_t ctxt, int argc, char **args)
{
(void)argc;
(void)ctxt;
if (g_push_menu_language[0] == 0)
{
grub_memcpy(g_push_menu_language, g_cur_menu_language, sizeof(g_push_menu_language));
ventoy_plugin_load_menu_lang(0, args[0]);
}
VENTOY_CMD_RETURN(0);
}
grub_err_t ventoy_cmd_pop_menulang(grub_extcmd_context_t ctxt, int argc, char **args)
{
(void)argc;
(void)ctxt;
(void)args;
if (g_push_menu_language[0])
{
ventoy_plugin_load_menu_lang(0, g_push_menu_language);
g_push_menu_language[0] = 0;
}
VENTOY_CMD_RETURN(0);
}

View File

@@ -1118,7 +1118,6 @@ 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;
char envbuf[64];
(void)ctxt; (void)ctxt;
(void)argc; (void)argc;
@@ -1197,10 +1196,7 @@ grub_err_t ventoy_cmd_unix_chain_data(grub_extcmd_context_t ctxt, int argc, char
return 1; return 1;
} }
grub_snprintf(envbuf, sizeof(envbuf), "0x%lx", (unsigned long)chain); ventoy_memfile_env_set("vtoy_chain_mem", chain, (ulonglong)size);
grub_env_set("vtoy_chain_mem_addr", envbuf);
grub_snprintf(envbuf, sizeof(envbuf), "%u", size);
grub_env_set("vtoy_chain_mem_size", envbuf);
grub_memset(chain, 0, sizeof(ventoy_chain_head)); grub_memset(chain, 0, sizeof(ventoy_chain_head));

View File

@@ -148,9 +148,10 @@ static int ventoy_vhd_patch_path(char *vhdpath, ventoy_patch_vhd *patch1, ventoy
return 0; return 0;
} }
static int ventoy_vhd_read_parttbl(const char *filename, ventoy_gpt_info *gpt, int *index) static int ventoy_vhd_read_parttbl(const char *filename, ventoy_gpt_info *gpt, int *index, grub_uint64_t *poffset)
{ {
int i; int i;
int find = 0;
int ret = 1; int ret = 1;
grub_uint64_t start; grub_uint64_t start;
grub_file_t file = NULL; grub_file_t file = NULL;
@@ -183,6 +184,7 @@ static int ventoy_vhd_read_parttbl(const char *filename, ventoy_gpt_info *gpt, i
if (start == gpt->PartTbl[i].StartLBA) if (start == gpt->PartTbl[i].StartLBA)
{ {
*index = i; *index = i;
find = 1;
break; break;
} }
} }
@@ -196,11 +198,22 @@ static int ventoy_vhd_read_parttbl(const char *filename, ventoy_gpt_info *gpt, i
if ((grub_uint32_t)start == gpt->MBR.PartTbl[i].StartSectorId) if ((grub_uint32_t)start == gpt->MBR.PartTbl[i].StartSectorId)
{ {
*index = i; *index = i;
find = 1;
break; break;
} }
} }
} }
if (find == 0) // MBR Logical partition
{
if (file->device->disk->partition->number > 0)
{
*index = file->device->disk->partition->number;
debug("Fall back part number: %d\n", *index);
}
}
*poffset = start;
ret = 0; ret = 0;
end: end:
@@ -226,7 +239,7 @@ static int ventoy_vhd_patch_disk(const char *vhdpath, ventoy_patch_vhd *patch1,
else else
{ {
gpt = grub_zalloc(sizeof(ventoy_gpt_info)); gpt = grub_zalloc(sizeof(ventoy_gpt_info));
ventoy_vhd_read_parttbl(vhdpath, gpt, &partIndex); ventoy_vhd_read_parttbl(vhdpath, gpt, &partIndex, &offset);
debug("This is HDD partIndex %d %s\n", partIndex, vhdpath); debug("This is HDD partIndex %d %s\n", partIndex, vhdpath);
} }
@@ -249,9 +262,11 @@ static int ventoy_vhd_patch_disk(const char *vhdpath, ventoy_patch_vhd *patch1,
} }
else else
{ {
offset = gpt->MBR.PartTbl[partIndex].StartSectorId; if (offset == 0)
{
offset = gpt->MBR.PartTbl[partIndex].StartSectorId;
}
offset *= 512; offset *= 512;
debug("MBR disk signature: %02x%02x%02x%02x Part(%d) offset:%llu\n", debug("MBR disk signature: %02x%02x%02x%02x Part(%d) offset:%llu\n",
gpt->MBR.BootCode[0x1b8 + 0], gpt->MBR.BootCode[0x1b8 + 1], gpt->MBR.BootCode[0x1b8 + 0], gpt->MBR.BootCode[0x1b8 + 1],
gpt->MBR.BootCode[0x1b8 + 2], gpt->MBR.BootCode[0x1b8 + 3], gpt->MBR.BootCode[0x1b8 + 2], gpt->MBR.BootCode[0x1b8 + 3],
@@ -305,7 +320,6 @@ grub_err_t ventoy_cmd_patch_vhdboot(grub_extcmd_context_t ctxt, int argc, char *
int patchoffset[2]; int patchoffset[2];
ventoy_patch_vhd *patch1; ventoy_patch_vhd *patch1;
ventoy_patch_vhd *patch2; ventoy_patch_vhd *patch2;
char envbuf[64];
(void)ctxt; (void)ctxt;
(void)argc; (void)argc;
@@ -356,15 +370,9 @@ grub_err_t ventoy_cmd_patch_vhdboot(grub_extcmd_context_t ctxt, int argc, char *
/* set buffer and size */ /* set buffer and size */
#ifdef GRUB_MACHINE_EFI #ifdef GRUB_MACHINE_EFI
grub_snprintf(envbuf, sizeof(envbuf), "0x%lx", (ulong)g_vhdboot_totbuf); ventoy_memfile_env_set("vtoy_vhd_buf", g_vhdboot_totbuf, (ulonglong)(g_vhdboot_isolen + sizeof(ventoy_chain_head)));
grub_env_set("vtoy_vhd_buf_addr", envbuf);
grub_snprintf(envbuf, sizeof(envbuf), "%d", (int)(g_vhdboot_isolen + sizeof(ventoy_chain_head)));
grub_env_set("vtoy_vhd_buf_size", envbuf);
#else #else
grub_snprintf(envbuf, sizeof(envbuf), "0x%lx", (ulong)g_vhdboot_isobuf); ventoy_memfile_env_set("vtoy_vhd_buf", g_vhdboot_isobuf, (ulonglong)g_vhdboot_isolen);
grub_env_set("vtoy_vhd_buf_addr", envbuf);
grub_snprintf(envbuf, sizeof(envbuf), "%d", g_vhdboot_isolen);
grub_env_set("vtoy_vhd_buf_size", envbuf);
#endif #endif
VENTOY_CMD_RETURN(GRUB_ERR_NONE); VENTOY_CMD_RETURN(GRUB_ERR_NONE);
@@ -645,7 +653,6 @@ grub_err_t ventoy_cmd_raw_chain_data(grub_extcmd_context_t ctxt, int argc, char
grub_disk_t disk; grub_disk_t disk;
const char *pLastChain = NULL; const char *pLastChain = NULL;
ventoy_chain_head *chain; ventoy_chain_head *chain;
char envbuf[64];
(void)ctxt; (void)ctxt;
(void)argc; (void)argc;
@@ -695,10 +702,7 @@ grub_err_t ventoy_cmd_raw_chain_data(grub_extcmd_context_t ctxt, int argc, char
return 1; return 1;
} }
grub_snprintf(envbuf, sizeof(envbuf), "0x%lx", (unsigned long)chain); ventoy_memfile_env_set("vtoy_chain_mem", chain, (ulonglong)size);
grub_env_set("vtoy_chain_mem_addr", envbuf);
grub_snprintf(envbuf, sizeof(envbuf), "%u", size);
grub_env_set("vtoy_chain_mem_size", envbuf);
grub_env_export("vtoy_chain_mem_addr"); grub_env_export("vtoy_chain_mem_addr");
grub_env_export("vtoy_chain_mem_size"); grub_env_export("vtoy_chain_mem_size");

View File

@@ -1090,6 +1090,12 @@ static int ventoy_fill_windows_rtdata(void *buf, char *isopath, int dataflag)
{ {
data->windows11_bypass_check = 1; data->windows11_bypass_check = 1;
} }
env = grub_env_get("VTOY_WIN11_BYPASS_NRO");
if (env && env[0] == '1' && env[1] == 0)
{
data->windows11_bypass_nro = 1;
}
pos = grub_strstr(isopath, "/"); pos = grub_strstr(isopath, "/");
if (!pos) if (!pos)
@@ -1364,6 +1370,112 @@ static int ventoy_wimdows_locate_wim(const char *disk, wim_patch *patch, int win
return 0; return 0;
} }
grub_err_t ventoy_cmd_sel_winpe_wim(grub_extcmd_context_t ctxt, int argc, char **args)
{
int i = 0;
int pos = 0;
int len = 0;
int find = 0;
char *cmd = NULL;
wim_patch *node = NULL;
wim_patch *tmp = NULL;
grub_file_t file = NULL;
wim_header *head = NULL;
char cfgfile[128];
(void)ctxt;
(void)argc;
len = 8 * VTOY_SIZE_1KB;
cmd = (char *)grub_malloc(len + sizeof(wim_header));
if (!cmd)
{
return 1;
}
head = (wim_header *)(cmd + len);
grub_env_unset("vtoy_pe_wim_path");
for (node = g_wim_patch_head; node; node = node->next)
{
find = 0;
for (tmp = g_wim_patch_head; tmp != node; tmp = tmp->next)
{
if (tmp->valid && grub_strcasecmp(tmp->path, node->path) == 0)
{
find = 1;
break;
}
}
if (find)
{
continue;
}
g_ventoy_case_insensitive = 1;
file = ventoy_grub_file_open(VENTOY_FILE_TYPE, "%s%s", args[0], node->path);
g_ventoy_case_insensitive = 0;
if (!file)
{
debug("File %s%s NOT exist\n", args[0], node->path);
continue;
}
grub_file_read(file, head, sizeof(wim_header));
if (grub_memcmp(head->signature, WIM_HEAD_SIGNATURE, sizeof(head->signature)))
{
debug("Not a valid wim file %s\n", (char *)head->signature);
grub_file_close(file);
continue;
}
if (head->flags & FLAG_HEADER_COMPRESS_LZMS)
{
debug("LZMS compress is not supported 0x%x\n", head->flags);
grub_file_close(file);
continue;
}
grub_file_close(file);
node->valid = 1;
vtoy_len_ssprintf(cmd, pos, len, "menuentry \"%s\" --class=\"sel_wim\" {\n echo \"\"\n}\n", node->path);
}
if (pos > 0)
{
g_ventoy_menu_esc = 1;
g_ventoy_suppress_esc = 1;
g_ventoy_suppress_esc_default = 0;
g_ventoy_secondary_menu_on = 1;
grub_snprintf(cfgfile, sizeof(cfgfile), "configfile mem:0x%llx:size:%d", (ulonglong)(ulong)cmd, pos);
grub_script_execute_sourcecode(cfgfile);
g_ventoy_menu_esc = 0;
g_ventoy_suppress_esc = 0;
g_ventoy_suppress_esc_default = 1;
g_ventoy_secondary_menu_on = 0;
for (node = g_wim_patch_head; node; node = node->next)
{
if (node->valid)
{
if (i == g_ventoy_last_entry)
{
grub_env_set("vtoy_pe_wim_path", node->path);
break;
}
i++;
}
}
}
grub_free(cmd);
return 0;
}
grub_err_t ventoy_cmd_locate_wim_patch(grub_extcmd_context_t ctxt, int argc, char **args) grub_err_t ventoy_cmd_locate_wim_patch(grub_extcmd_context_t ctxt, int argc, char **args)
{ {
int datalen = 0; int datalen = 0;
@@ -1790,19 +1902,150 @@ end:
return rc; return rc;
} }
static int ventoy_extract_init_exe(char *wimfile, grub_uint8_t **pexe_data, grub_uint32_t *pexe_len, char *exe_name)
{
int rc;
int ret = 1;
grub_uint16_t i;
grub_file_t file = NULL;
grub_uint32_t exe_len = 0;
wim_header *head = NULL;
grub_uint16_t *uname = NULL;
grub_uint8_t *exe_data = NULL;
grub_uint8_t *decompress_data = NULL;
wim_lookup_entry *lookup = NULL;
wim_security_header *security = NULL;
wim_directory_entry *rootdir = NULL;
wim_directory_entry *search = NULL;
wim_stream_entry *stream = NULL;
wim_lookup_entry *replace_look = NULL;
wim_header wimhdr;
wim_hash hashdata;
head = &wimhdr;
file = grub_file_open(wimfile, VENTOY_FILE_TYPE);
if (!file)
{
goto out;
}
grub_file_read(file, head, sizeof(wim_header));
rc = ventoy_read_resource(file, head, &head->metadata, (void **)&decompress_data);
if (rc)
{
grub_printf("failed to read meta data %d\n", rc);
goto out;
}
security = (wim_security_header *)decompress_data;
if (security->len > 0)
{
rootdir = (wim_directory_entry *)(decompress_data + ((security->len + 7) & 0xFFFFFFF8U));
}
else
{
rootdir = (wim_directory_entry *)(decompress_data + 8);
}
debug("read lookup offset:%llu size:%llu\n", (ulonglong)head->lookup.offset, (ulonglong)head->lookup.raw_size);
lookup = grub_malloc(head->lookup.raw_size);
grub_file_seek(file, head->lookup.offset);
grub_file_read(file, lookup, head->lookup.raw_size);
/* search winpeshl.exe dirent entry */
search = search_replace_wim_dirent(file, head, lookup, decompress_data, rootdir);
if (!search)
{
debug("Failed to find replace file %p\n", search);
goto out;
}
uname = (grub_uint16_t *)(search + 1);
for (i = 0; i < search->name_len / 2 && i < 200; i++)
{
exe_name[i] = (char)uname[i];
}
exe_name[i] = 0;
debug("find replace file at %p <%s>\n", search, exe_name);
grub_memset(&hashdata, 0, sizeof(wim_hash));
if (grub_memcmp(&hashdata, search->hash.sha1, sizeof(wim_hash)) == 0)
{
debug("search hash all 0, now do deep search\n");
stream = (wim_stream_entry *)((char *)search + search->len);
for (i = 0; i < search->streams; i++)
{
if (stream->name_len == 0)
{
grub_memcpy(&hashdata, stream->hash.sha1, sizeof(wim_hash));
debug("new search hash: %02x %02x %02x %02x %02x %02x %02x %02x\n",
ventoy_varg_8(hashdata.sha1));
break;
}
stream = (wim_stream_entry *)((char *)stream + stream->len);
}
}
else
{
grub_memcpy(&hashdata, search->hash.sha1, sizeof(wim_hash));
}
/* find and extact winpeshl.exe */
replace_look = ventoy_find_look_entry(head, lookup, &hashdata);
if (replace_look)
{
exe_len = (grub_uint32_t)replace_look->resource.raw_size;
debug("find replace lookup entry_id:%ld raw_size:%u\n",
((long)replace_look - (long)lookup) / sizeof(wim_lookup_entry), exe_len);
if (0 != ventoy_read_resource(file, head, &(replace_look->resource), (void **)&(exe_data)))
{
exe_len = 0;
exe_data = NULL;
debug("failed to read replace file meta data %u\n", exe_len);
}
}
else
{
debug("failed to find lookup entry for replace file %02x %02x %02x %02x\n",
ventoy_varg_4(hashdata.sha1));
}
if (exe_data)
{
ret = 0;
*pexe_data = exe_data;
*pexe_len = exe_len;
}
out:
grub_check_free(lookup);
grub_check_free(decompress_data);
check_free(file, grub_file_close);
return ret;
}
grub_err_t ventoy_cmd_windows_wimboot_data(grub_extcmd_context_t ctxt, int argc, char **args) grub_err_t ventoy_cmd_windows_wimboot_data(grub_extcmd_context_t ctxt, int argc, char **args)
{ {
int rc = 0;
int wim64 = 0;
int datalen = 0; int datalen = 0;
int dataflag = 0; int dataflag = 0;
grub_uint32_t size = 0; grub_uint32_t exe_len = 0;
grub_uint32_t jump_align = 0;
const char *addr = NULL; const char *addr = NULL;
ventoy_chain_head *chain = NULL; ventoy_chain_head *chain = NULL;
ventoy_os_param *param = NULL; grub_uint8_t *param = NULL;
char envbuf[64]; grub_uint8_t *exe_data = NULL;
ventoy_windows_data *rtdata = NULL;
char exename[128] = {0};
wim_tail wim_data;
(void)ctxt; (void)ctxt;
(void)argc; (void)argc;
(void)args;
addr = grub_env_get("vtoy_chain_mem_addr"); addr = grub_env_get("vtoy_chain_mem_addr");
if (!addr) if (!addr)
@@ -1821,24 +2064,30 @@ grub_err_t ventoy_cmd_windows_wimboot_data(grub_extcmd_context_t ctxt, int argc,
datalen = ventoy_get_windows_rtdata_len(chain->os_param.vtoy_img_path, &dataflag); datalen = ventoy_get_windows_rtdata_len(chain->os_param.vtoy_img_path, &dataflag);
size = sizeof(ventoy_os_param) + datalen; rc = ventoy_extract_init_exe(args[0], &exe_data, &exe_len, exename);
param = (ventoy_os_param *)grub_zalloc(size); if (rc)
if (!param)
{ {
return 1; return 1;
} }
wim64 = ventoy_is_pe64(exe_data);
grub_memcpy(param, &chain->os_param, sizeof(ventoy_os_param)); grub_memset(&wim_data, 0, sizeof(wim_data));
ventoy_fill_windows_rtdata(param + 1, param->vtoy_img_path, dataflag); ventoy_cat_exe_file_data(&wim_data, exe_len, exe_data, datalen);
grub_check_free(exe_data);
jump_align = ventoy_align(wim_data.jump_exe_len, 16);
param = wim_data.jump_bin_data;
grub_memcpy(param + jump_align, &chain->os_param, sizeof(ventoy_os_param));
rtdata = (ventoy_windows_data *)(param + jump_align + sizeof(ventoy_os_param));
ventoy_fill_windows_rtdata(rtdata, chain->os_param.vtoy_img_path, dataflag);
ventoy_memfile_env_set("vtoy_wimboot_mem", param, (ulonglong)(wim_data.bin_align_len));
grub_env_set(args[1], exename);
grub_env_set(args[2], wim64 ? "64" : "32");
grub_snprintf(envbuf, sizeof(envbuf), "0x%lx", (unsigned long)param);
grub_env_set("vtoy_wimboot_mem_addr", envbuf);
debug("vtoy_wimboot_mem_addr: %s\n", envbuf);
grub_snprintf(envbuf, sizeof(envbuf), "%u", size);
grub_env_set("vtoy_wimboot_mem_size", envbuf);
debug("vtoy_wimboot_mem_size: %s\n", envbuf);
VENTOY_CMD_RETURN(GRUB_ERR_NONE); VENTOY_CMD_RETURN(GRUB_ERR_NONE);
} }
@@ -1857,7 +2106,6 @@ grub_err_t ventoy_cmd_windows_chain_data(grub_extcmd_context_t ctxt, int argc, c
const char *pLastChain = NULL; const char *pLastChain = NULL;
const char *compatible; const char *compatible;
ventoy_chain_head *chain; ventoy_chain_head *chain;
char envbuf[64];
(void)ctxt; (void)ctxt;
(void)argc; (void)argc;
@@ -1879,7 +2127,10 @@ grub_err_t ventoy_cmd_windows_chain_data(grub_extcmd_context_t ctxt, int argc, c
if (0 == ventoy_compatible && g_wim_valid_patch_count == 0) if (0 == ventoy_compatible && g_wim_valid_patch_count == 0)
{ {
unknown_image = 1; unknown_image = 1;
debug("Warning: %s was not recognized by Ventoy\n", args[0]); if (!g_ventoy_wimboot_mode)
{
debug("Warning: %s was not recognized by Ventoy\n", args[0]);
}
} }
file = ventoy_grub_file_open(VENTOY_FILE_TYPE, "%s", args[0]); file = ventoy_grub_file_open(VENTOY_FILE_TYPE, "%s", args[0]);
@@ -1949,10 +2200,7 @@ grub_err_t ventoy_cmd_windows_chain_data(grub_extcmd_context_t ctxt, int argc, c
return 1; return 1;
} }
grub_snprintf(envbuf, sizeof(envbuf), "0x%lx", (unsigned long)chain); ventoy_memfile_env_set("vtoy_chain_mem", chain, (ulonglong)size);
grub_env_set("vtoy_chain_mem_addr", envbuf);
grub_snprintf(envbuf, sizeof(envbuf), "%u", size);
grub_env_set("vtoy_chain_mem_size", envbuf);
grub_memset(chain, 0, sizeof(ventoy_chain_head)); grub_memset(chain, 0, sizeof(ventoy_chain_head));
@@ -2071,6 +2319,67 @@ static int ventoy_get_wim_chunklist(grub_file_t wimfile, ventoy_img_chunk_list *
return 0; return 0;
} }
grub_err_t ventoy_cmd_is_standard_winiso(grub_extcmd_context_t ctxt, int argc, char **args)
{
int i;
int ret = 1;
char prefix[32] = {0};
const char *chkfile[] =
{
"boot/bcd", "boot/boot.sdi", NULL
};
(void)ctxt;
(void)argc;
if (ventoy_check_file_exist("%s/sources/boot.wim", args[0]))
{
prefix[0] = 0;
}
else if (ventoy_check_file_exist("%s/x86/sources/boot.wim", args[0]))
{
grub_snprintf(prefix, sizeof(prefix), "/x86");
}
else if (ventoy_check_file_exist("%s/x64/sources/boot.wim", args[0]))
{
grub_snprintf(prefix, sizeof(prefix), "/x64");
}
else
{
debug("No boot.wim found.\n");
goto out;
}
for (i = 0; chkfile[i]; i++)
{
if (!ventoy_check_file_exist("%s%s/%s", args[0], prefix, chkfile[i]))
{
debug("%s not found.\n", chkfile[i]);
goto out;
}
}
if ((!ventoy_check_file_exist("%s%s/sources/install.wim", args[0], prefix)) &&
(!ventoy_check_file_exist("%s%s/sources/install.esd", args[0], prefix)))
{
debug("No install.wim(esd) found.\n");
goto out;
}
if (!ventoy_check_file_exist("%s/setup.exe", args[0]))
{
debug("No setup.exe found.\n");
goto out;
}
ret = 0;
debug("This is standard Windows ISO.\n");
out:
return ret;
}
grub_err_t ventoy_cmd_wim_check_bootable(grub_extcmd_context_t ctxt, int argc, char **args) grub_err_t ventoy_cmd_wim_check_bootable(grub_extcmd_context_t ctxt, int argc, char **args)
{ {
grub_uint32_t boot_index; grub_uint32_t boot_index;
@@ -2125,7 +2434,6 @@ static grub_err_t ventoy_vlnk_wim_chain_data(grub_file_t wimfile)
ventoy_img_chunk *chunknode; ventoy_img_chunk *chunknode;
ventoy_override_chunk *override; ventoy_override_chunk *override;
ventoy_img_chunk_list wimchunk; ventoy_img_chunk_list wimchunk;
char envbuf[128];
debug("vlnk wim chain data begin <%s> ...\n", wimfile->name); debug("vlnk wim chain data begin <%s> ...\n", wimfile->name);
@@ -2182,10 +2490,7 @@ static grub_err_t ventoy_vlnk_wim_chain_data(grub_file_t wimfile)
return 1; return 1;
} }
grub_snprintf(envbuf, sizeof(envbuf), "0x%lx", (unsigned long)chain); ventoy_memfile_env_set("vtoy_chain_mem", chain, (ulonglong)size);
grub_env_set("vtoy_chain_mem_addr", envbuf);
grub_snprintf(envbuf, sizeof(envbuf), "%u", size);
grub_env_set("vtoy_chain_mem_size", envbuf);
grub_memset(chain, 0, sizeof(ventoy_chain_head)); grub_memset(chain, 0, sizeof(ventoy_chain_head));
@@ -2290,7 +2595,6 @@ static grub_err_t ventoy_normal_wim_chain_data(grub_file_t wimfile)
ventoy_img_chunk *chunknode; ventoy_img_chunk *chunknode;
ventoy_override_chunk *override; ventoy_override_chunk *override;
ventoy_img_chunk_list wimchunk; ventoy_img_chunk_list wimchunk;
char envbuf[128];
debug("normal wim chain data begin <%s> ...\n", wimfile->name); debug("normal wim chain data begin <%s> ...\n", wimfile->name);
@@ -2347,10 +2651,7 @@ static grub_err_t ventoy_normal_wim_chain_data(grub_file_t wimfile)
return 1; return 1;
} }
grub_snprintf(envbuf, sizeof(envbuf), "0x%lx", (unsigned long)chain); ventoy_memfile_env_set("vtoy_chain_mem", chain, (ulonglong)size);
grub_env_set("vtoy_chain_mem_addr", envbuf);
grub_snprintf(envbuf, sizeof(envbuf), "%u", size);
grub_env_set("vtoy_chain_mem_size", envbuf);
grub_memset(chain, 0, sizeof(ventoy_chain_head)); grub_memset(chain, 0, sizeof(ventoy_chain_head));

View File

@@ -0,0 +1,73 @@
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2003,2005,2006,2007,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/>.
*/
#ifndef GRUB_ENV_HEADER
#define GRUB_ENV_HEADER 1
#include <grub/symbol.h>
#include <grub/err.h>
#include <grub/types.h>
#include <grub/menu.h>
struct grub_env_var;
typedef const char *(*grub_env_read_hook_t) (struct grub_env_var *var,
const char *val);
typedef char *(*grub_env_write_hook_t) (struct grub_env_var *var,
const char *val);
struct grub_env_var
{
char *name;
char *value;
grub_env_read_hook_t read_hook;
grub_env_write_hook_t write_hook;
struct grub_env_var *next;
struct grub_env_var **prevp;
struct grub_env_var *sorted_next;
int global;
};
grub_err_t EXPORT_FUNC(grub_env_set) (const char *name, const char *val);
const char *EXPORT_FUNC(grub_env_get) (const char *name);
void EXPORT_FUNC(grub_env_unset) (const char *name);
struct grub_env_var *EXPORT_FUNC(grub_env_update_get_sorted) (void);
#define FOR_SORTED_ENV(var) for (var = grub_env_update_get_sorted (); var; var = var->sorted_next)
grub_err_t EXPORT_FUNC(grub_register_variable_hook) (const char *name,
grub_env_read_hook_t read_hook,
grub_env_write_hook_t write_hook);
grub_err_t EXPORT_FUNC(grub_register_vtoy_menu_lang_hook) (grub_env_read_hook_t read_hook);
grub_err_t grub_env_context_open (void);
grub_err_t grub_env_context_close (void);
grub_err_t EXPORT_FUNC(grub_env_export) (const char *name);
void grub_env_unset_menu (void);
grub_menu_t grub_env_get_menu (void);
void grub_env_set_menu (grub_menu_t nmenu);
grub_err_t
grub_env_extractor_open (int source);
grub_err_t
grub_env_extractor_close (int source);
#endif /* ! GRUB_ENV_HEADER */

View File

@@ -141,8 +141,10 @@ typedef struct ventoy_windows_data
grub_uint8_t windows11_bypass_check; grub_uint8_t windows11_bypass_check;
grub_uint32_t auto_install_len; grub_uint32_t auto_install_len;
grub_uint8_t reserved[255 - 4]; grub_uint8_t windows11_bypass_nro;
grub_uint8_t reserved[255 - 5];
/* auto_intall file buf */ /* auto_intall file buf */
/* ...... + auto_install_len */ /* ...... + auto_install_len */
@@ -304,6 +306,7 @@ grub_uint64_t grub_udf_get_last_file_attr_offset
grub_uint64_t *fe_entry_size_offset grub_uint64_t *fe_entry_size_offset
); );
int ventoy_is_efi_os(void); int ventoy_is_efi_os(void);
void ventoy_memfile_env_set(const char *prefix, const void *buf, unsigned long long len);
#endif /* __VENTOY_H__ */ #endif /* __VENTOY_H__ */

View File

@@ -12,7 +12,7 @@ make install
PATH=$VT_DIR/GRUB2/INSTALL/bin/:$VT_DIR/GRUB2/INSTALL/sbin/:$PATH PATH=$VT_DIR/GRUB2/INSTALL/bin/:$VT_DIR/GRUB2/INSTALL/sbin/:$PATH
net_modules_legacy="net tftp http" net_modules_legacy="net tftp http"
all_modules_legacy="file setkey date drivemap blocklist regexp newc vga_text ntldr search at_keyboard usb_keyboard gcry_md5 hashsum gzio xzio lzopio lspci pci ext2 xfs ventoy chain read halt iso9660 linux16 test true sleep reboot echo videotest videoinfo videotest_checksum video_colors video_cirrus video_bochs vga vbe video_fb font video gettext extcmd terminal linux minicmd help configfile tr trig boot biosdisk disk ls tar squash4 password_pbkdf2 all_video png jpeg part_gpt part_msdos fat exfat ntfs loopback gzio normal udf gfxmenu gfxterm gfxterm_background gfxterm_menu smbios zfs" all_modules_legacy="file date drivemap blocklist newc vga_text ntldr search at_keyboard usb_keyboard gcry_md5 hashsum gzio xzio lzopio lspci pci ext2 xfs ventoy chain read halt iso9660 linux16 test true sleep reboot echo videotest videoinfo videotest_checksum video_colors video_cirrus video_bochs vga vbe font video gettext extcmd terminal linux minicmd help configfile tr trig boot biosdisk disk ls tar squash4 password_pbkdf2 all_video png jpeg part_gpt part_msdos fat exfat ntfs loopback gzio normal video_fb udf gfxmenu gfxterm gfxterm_background gfxterm_menu smbios"
net_modules_uefi="efinet net tftp http" net_modules_uefi="efinet net tftp http"
all_modules_uefi="file setkey blocklist ventoy test true regexp newc search at_keyboard usb_keyboard gcry_md5 hashsum gzio xzio lzopio ext2 xfs read halt sleep serial terminfo png password_pbkdf2 gcry_sha512 pbkdf2 part_gpt part_msdos ls tar squash4 loopback part_apple minicmd diskfilter linux relocator jpeg iso9660 udf hfsplus halt acpi mmap gfxmenu video_colors trig bitmap_scale gfxterm bitmap font fat exfat ntfs fshelp efifwsetup reboot echo configfile normal terminal gettext chain priority_queue bufio datetime cat extcmd crypto gzio boot all_video efi_gop efi_uga video_bochs video_cirrus video video_fb gfxterm_background gfxterm_menu mouse fwload smbios zfs" all_modules_uefi="file setkey blocklist ventoy test true regexp newc search at_keyboard usb_keyboard gcry_md5 hashsum gzio xzio lzopio ext2 xfs read halt sleep serial terminfo png password_pbkdf2 gcry_sha512 pbkdf2 part_gpt part_msdos ls tar squash4 loopback part_apple minicmd diskfilter linux relocator jpeg iso9660 udf hfsplus halt acpi mmap gfxmenu video_colors trig bitmap_scale gfxterm bitmap font fat exfat ntfs fshelp efifwsetup reboot echo configfile normal terminal gettext chain priority_queue bufio datetime cat extcmd crypto gzio boot all_video efi_gop efi_uga video_bochs video_cirrus video video_fb gfxterm_background gfxterm_menu mouse fwload smbios zfs"

BIN
ICON/filechecksum.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 437 KiB

View File

@@ -0,0 +1,32 @@
#!/ventoy/busybox/sh
#************************************************************************************
# Copyright (c) 2020, longpanda <admin@ventoy.net>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
#
#************************************************************************************
. /ventoy/hook/ventoy-hook-lib.sh
for i in 0 1 2 3 4 5 6 7 8 9; do
vtdiskname=$(get_ventoy_disk_name)
if [ "$vtdiskname" = "unknown" ]; then
vtlog "wait for disk ..."
$SLEEP 3
else
break
fi
done
ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2"

View File

@@ -0,0 +1,22 @@
#!/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
$SED "/maybe_break *premount/a\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/chimera/disk_hook.sh" -i /init

View File

@@ -33,7 +33,7 @@ ventoy_os_install_dmsetup_by_fuse() {
vtoy_fuse_iso -f $VTOY_PATH/ventoy_dm_table -m $VTOY_PATH/mnt/fuse vtoy_fuse_iso -f $VTOY_PATH/ventoy_dm_table -m $VTOY_PATH/mnt/fuse
mount -t iso9660 $VTOY_PATH/mnt/fuse/ventoy.iso $VTOY_PATH/mnt/iso mount -t iso9660 $VTOY_PATH/mnt/fuse/ventoy.iso $VTOY_PATH/mnt/iso
mount -t squashfs $VTOY_PATH/mnt/iso/minios/01-core*.sb $VTOY_PATH/mnt/squashfs mount -t squashfs $VTOY_PATH/mnt/iso/minios/0*-core*.sb $VTOY_PATH/mnt/squashfs
KoName=$(ls $VTOY_PATH/mnt/squashfs/lib/modules/$2/kernel/drivers/md/dm-mod.ko*) KoName=$(ls $VTOY_PATH/mnt/squashfs/lib/modules/$2/kernel/drivers/md/dm-mod.ko*)
vtlog "insmod $KoName" vtlog "insmod $KoName"

View File

@@ -20,5 +20,5 @@
if [ -f /lib/livekitlib ] && $GREP -q 'debug_log.*find_data_try' /lib/livekitlib; then if [ -f /lib/livekitlib ] && $GREP -q 'debug_log.*find_data_try' /lib/livekitlib; then
$SED "/debug_log.*find_data_try/a\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/debian/minios-disk.sh" -i /lib/livekitlib $SED "/debug_log.*find_data_try/a\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/debian/minios-disk.sh" -i /lib/livekitlib
else else
$SED "/find_data/i\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/debian/minios-disk.sh" -i /init $SED "/find_data/i\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/debian/minios-disk.sh" -i /init
fi fi

View File

@@ -24,6 +24,9 @@ if $GREP -q kaspersky /proc/version; then
if [ -f /ventoy/ventoy_persistent_map ]; then if [ -f /ventoy/ventoy_persistent_map ]; then
$SED "/sysresccd_parsecmdline[^(]*$/a\ BACKSTORE_CMD='LABEL=casper-rw,noloop'" -i /init $SED "/sysresccd_parsecmdline[^(]*$/a\ BACKSTORE_CMD='LABEL=casper-rw,noloop'" -i /init
fi fi
elif $GREP -q 'setting up the root filesystem' /init; then
$SED "/setting up the root filesystem/a\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/gentoo/disk_hook.sh" -i /init
$SED "/setting up the root filesystem/a\ export CDROOT_DEV=/dev/mapper/ventoy" -i /init
elif [ -d /etc/udev/rules.d ] || [ -d /lib/udev/rules.d ]; then elif [ -d /etc/udev/rules.d ] || [ -d /lib/udev/rules.d ]; then
ventoy_systemd_udevd_work_around ventoy_systemd_udevd_work_around
ventoy_add_udev_rule "$VTOY_PATH/hook/default/udev_disk_hook.sh %k noreplace" ventoy_add_udev_rule "$VTOY_PATH/hook/default/udev_disk_hook.sh %k noreplace"

View File

@@ -0,0 +1,24 @@
#!/bin/sh
#************************************************************************************
# Copyright (c) 2022, longpanda <admin@ventoy.net>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
#
#************************************************************************************
if [ -f /run/install/ks.cfg ]; then
sh /ventoy/hook/default/auto_install_varexp.sh /run/install/ks.cfg
fi
exit 0

View File

@@ -24,18 +24,21 @@ if [ -f $VTOY_PATH/autoinstall ]; then
else else
for vtParam in $($CAT /proc/cmdline); do for vtParam in $($CAT /proc/cmdline); do
if echo $vtParam | $GREP -q 'inst.ks=hd:LABEL='; then if echo $vtParam | $GREP -q 'inst.ks=hd:LABEL='; then
vtRawKsFull="$vtParam"
vtRawKs=$(echo $vtParam | $AWK -F: '{print $NF}') vtRawKs=$(echo $vtParam | $AWK -F: '{print $NF}')
VTKS="inst.ks=hd:/dev/ventoy:$vtRawKs" VTKS="inst.ks=hd:/dev/ventoy:$vtRawKs"
break break
fi fi
if echo $vtParam | $GREP -q '^ks=.*:/'; then if echo $vtParam | $GREP -q '^ks=.*:/'; then
vtRawKsFull="$vtParam"
vtRawKs=$(echo $vtParam | $AWK -F: '{print $NF}') vtRawKs=$(echo $vtParam | $AWK -F: '{print $NF}')
VTKS="ks=hd:/dev/ventoy:$vtRawKs" VTKS="ks=hd:/dev/ventoy:$vtRawKs"
break break
fi fi
if echo $vtParam | $GREP -q '^inst.ks=.*:/'; then if echo $vtParam | $GREP -q '^inst.ks=.*:/'; then
vtRawKsFull="$vtParam"
vtRawKs=$(echo $vtParam | $AWK -F: '{print $NF}') vtRawKs=$(echo $vtParam | $AWK -F: '{print $NF}')
VTKS="inst.ks=hd:/dev/ventoy:$vtRawKs" VTKS="inst.ks=hd:/dev/ventoy:$vtRawKs"
break break
@@ -63,7 +66,13 @@ fi
echo "VTKS=$VTKS VTOVERLAY=$VTOVERLAY" >> $VTLOG echo "VTKS=$VTKS VTOVERLAY=$VTOVERLAY" >> $VTLOG
if [ -n "$vtRawKs" ]; then if [ -n "$vtRawKs" ]; then
echo "$vtRawKs" > $VTOY_PATH/ventoy_ks_rootpath if echo $vtRawKsFull | $EGREP -q "=http|=https|=ftp|=nfs|=hmc"; then
echo "vtRawKsFull=$vtRawKsFull no patch needed." >> $VTLOG
vtRawKs=""
VTKS=""
else
echo "$vtRawKs" > $VTOY_PATH/ventoy_ks_rootpath
fi
fi fi
if ls $VTOY_PATH | $GREP -q 'ventoy_dud[0-9]'; then if ls $VTOY_PATH | $GREP -q 'ventoy_dud[0-9]'; then
@@ -98,3 +107,7 @@ if [ -f /usr/sbin/anaconda-diskroot ]; then
$SED 's/^mount $dev $repodir/mount -oro $dev $repodir/' -i /usr/sbin/anaconda-diskroot $SED 's/^mount $dev $repodir/mount -oro $dev $repodir/' -i /usr/sbin/anaconda-diskroot
fi fi
if [ -f $VTOY_PATH/autoinstall ]; then
cp -a $VTOY_PATH/hook/openEuler/ventoy-autoexp.sh /lib/dracut/hooks/pre-mount/99-ventoy-autoexp.sh
fi

View File

@@ -51,6 +51,9 @@ if is_inotify_ventoy_part $3; then
if [ -e /sbin/anaconda-diskroot ]; then if [ -e /sbin/anaconda-diskroot ]; then
vtlog "set anaconda-diskroot ..." vtlog "set anaconda-diskroot ..."
#busybox cp doesn't support -t option (issue 1900)
/bin/cp -a /bin/cp $BUSYBOX_PATH/cp
/sbin/anaconda-diskroot /dev/ventoy /sbin/anaconda-diskroot /dev/ventoy
fi fi

View File

@@ -39,6 +39,9 @@ fi
if [ -e /sbin/anaconda-diskroot ]; then if [ -e /sbin/anaconda-diskroot ]; then
vtlog "set anaconda-diskroot /dev/ventoy ..." vtlog "set anaconda-diskroot /dev/ventoy ..."
#busybox cp doesn't support -t option (issue 1900)
/bin/cp -a /bin/cp $BUSYBOX_PATH/cp
/sbin/anaconda-diskroot /dev/ventoy /sbin/anaconda-diskroot /dev/ventoy
fi fi

View File

@@ -24,21 +24,29 @@
if [ -f $VTOY_PATH/autoinstall ]; then if [ -f $VTOY_PATH/autoinstall ]; then
VTKS="inst.ks=file:$VTOY_PATH/autoinstall" VTKS="inst.ks=file:$VTOY_PATH/autoinstall"
cp -a $VTOY_PATH/hook/rhel7/ventoy-autoexp.sh /lib/dracut/hooks/pre-mount/99-ventoy-autoexp.sh
else else
for vtParam in $($CAT /proc/cmdline); do for vtParam in $($CAT /proc/cmdline); do
if echo $vtParam | $GREP -q 'ks=file:/'; then
continue
fi
if echo $vtParam | $GREP -q 'inst.ks=hd:LABEL='; then if echo $vtParam | $GREP -q 'inst.ks=hd:LABEL='; then
vtRawKsFull="$vtParam"
vtRawKs=$(echo $vtParam | $AWK -F: '{print $NF}') vtRawKs=$(echo $vtParam | $AWK -F: '{print $NF}')
VTKS="inst.ks=hd:/dev/ventoy:$vtRawKs" VTKS="inst.ks=hd:/dev/ventoy:$vtRawKs"
break break
fi fi
if echo $vtParam | $GREP -q '^ks=.*:/'; then if echo $vtParam | $GREP -q '^ks=.*:/'; then
vtRawKsFull="$vtParam"
vtRawKs=$(echo $vtParam | $AWK -F: '{print $NF}') vtRawKs=$(echo $vtParam | $AWK -F: '{print $NF}')
VTKS="ks=hd:/dev/ventoy:$vtRawKs" VTKS="ks=hd:/dev/ventoy:$vtRawKs"
break break
fi fi
if echo $vtParam | $GREP -q '^inst.ks=.*:/'; then if echo $vtParam | $GREP -q '^inst.ks=.*:/'; then
vtRawKsFull="$vtParam"
vtRawKs=$(echo $vtParam | $AWK -F: '{print $NF}') vtRawKs=$(echo $vtParam | $AWK -F: '{print $NF}')
VTKS="inst.ks=hd:/dev/ventoy:$vtRawKs" VTKS="inst.ks=hd:/dev/ventoy:$vtRawKs"
break break
@@ -67,7 +75,13 @@ fi
echo "VTKS=$VTKS VTOVERLAY=$VTOVERLAY" >> $VTLOG echo "VTKS=$VTKS VTOVERLAY=$VTOVERLAY" >> $VTLOG
if [ -n "$vtRawKs" ]; then if [ -n "$vtRawKs" ]; then
echo "$vtRawKs" > $VTOY_PATH/ventoy_ks_rootpath if echo $vtRawKsFull | $EGREP -q "=http|=https|=ftp|=nfs|=hmc"; then
echo "vtRawKsFull=$vtRawKsFull no patch needed." >> $VTLOG
vtRawKs=""
VTKS=""
else
echo "$vtRawKs" > $VTOY_PATH/ventoy_ks_rootpath
fi
fi fi
if ls $VTOY_PATH | $GREP -q 'ventoy_dud[0-9]'; then if ls $VTOY_PATH | $GREP -q 'ventoy_dud[0-9]'; then
@@ -77,23 +91,7 @@ if ls $VTOY_PATH | $GREP -q 'ventoy_dud[0-9]'; then
fi fi
echo "vtInstDD=$vtInstDD" >> $VTLOG echo "vtInstDD=$vtInstDD" >> $VTLOG
if $GREP -q 'root=live' /proc/cmdline; then
$SED "s#printf\(.*\)\$CMDLINE#printf\1\$CMDLINE root=live:/dev/ventoy $VTKS $VTOVERLAY $vtInstDD#" -i /lib/dracut-lib.sh
else
$SED "s#printf\(.*\)\$CMDLINE#printf\1\$CMDLINE inst.stage2=hd:/dev/ventoy $VTKS $VTOVERLAY $vtInstDD#" -i /lib/dracut-lib.sh
fi
ventoy_set_inotify_script rhel7/ventoy-inotifyd-hook.sh
#Fedora
if $BUSYBOX_PATH/which dmsquash-live-root > /dev/null; then
vtPriority=99
else
vtPriority=01
fi
$BUSYBOX_PATH/cp -a $VTOY_PATH/hook/rhel7/ventoy-inotifyd-start.sh /lib/dracut/hooks/pre-udev/${vtPriority}-ventoy-inotifyd-start.sh
$BUSYBOX_PATH/cp -a $VTOY_PATH/hook/rhel7/ventoy-timeout.sh /lib/dracut/hooks/initqueue/timeout/${vtPriority}-ventoy-timeout.sh
vtNeedRepo= vtNeedRepo=
if [ -f /etc/system-release ]; then if [ -f /etc/system-release ]; then
@@ -112,12 +110,59 @@ if $GREP -i -q Fedora /proc/version; then
fi fi
fi fi
if $GREP -i -q Fedora /etc/os-release; then
if $GREP -q 'Server Edition' /etc/os-release; then
vtNeedRepo="yes"
fi
fi
echo "vtNeedRepo=$vtNeedRepo" >> $VTLOG echo "vtNeedRepo=$vtNeedRepo" >> $VTLOG
if [ "$vtNeedRepo" = "yes" ]; then if [ "$vtNeedRepo" = "yes" ]; then
$BUSYBOX_PATH/cp -a $VTOY_PATH/hook/rhel7/ventoy-repo.sh /lib/dracut/hooks/pre-pivot/99-ventoy-repo.sh $BUSYBOX_PATH/cp -a $VTOY_PATH/hook/rhel7/ventoy-repo.sh /lib/dracut/hooks/pre-pivot/99-ventoy-repo.sh
fi fi
#iso-scan (currently only for Fedora)
if $GREP -q Fedora /etc/os-release; then
if ventoy_iso_scan_check; then
echo "iso_scan process ..." >> $VTLOG
vtIsoPath=$(/ventoy/tool/vtoydump -p /ventoy/ventoy_os_param)
VTISO_SCAN="iso-scan/filename=$vtIsoPath"
echo -n $vtIsoPath > /ventoy/vtoy_iso_scan
$SED "s#printf\(.*\)\$CMDLINE#printf\1\$CMDLINE $VTISO_SCAN $VTKS $VTOVERLAY $vtInstDD#" -i /lib/dracut-lib.sh
if [ "$VTOY_LINUX_REMOUNT" = "01" -a "$vtNeedRepo" != "yes" ]; then
ventoy_rw_iso_scan
fi
exit 0
fi
fi
echo "common process ..." >> $VTLOG
if $GREP -q 'root=live' /proc/cmdline; then
$SED "s#printf\(.*\)\$CMDLINE#printf\1\$CMDLINE root=live:/dev/ventoy $VTKS $VTOVERLAY $VTISO_SCAN $vtInstDD#" -i /lib/dracut-lib.sh
else
$SED "s#printf\(.*\)\$CMDLINE#printf\1\$CMDLINE inst.stage2=hd:/dev/ventoy $VTKS $VTOVERLAY $VTISO_SCAN $vtInstDD#" -i /lib/dracut-lib.sh
fi
ventoy_set_inotify_script rhel7/ventoy-inotifyd-hook.sh
#Fedora
if $BUSYBOX_PATH/which dmsquash-live-root > /dev/null; then
vtPriority=99
else
vtPriority=01
fi
$BUSYBOX_PATH/cp -a $VTOY_PATH/hook/rhel7/ventoy-inotifyd-start.sh /lib/dracut/hooks/pre-udev/${vtPriority}-ventoy-inotifyd-start.sh
$BUSYBOX_PATH/cp -a $VTOY_PATH/hook/rhel7/ventoy-timeout.sh /lib/dracut/hooks/initqueue/timeout/${vtPriority}-ventoy-timeout.sh
if [ -e /sbin/dmsquash-live-root ]; then if [ -e /sbin/dmsquash-live-root ]; then
echo "patch /sbin/dmsquash-live-root ..." >> $VTLOG echo "patch /sbin/dmsquash-live-root ..." >> $VTLOG
$SED "1 a $BUSYBOX_PATH/sh $VTOY_PATH/hook/rhel7/ventoy-make-link.sh" -i /sbin/dmsquash-live-root $SED "1 a $BUSYBOX_PATH/sh $VTOY_PATH/hook/rhel7/ventoy-make-link.sh" -i /sbin/dmsquash-live-root
@@ -128,6 +173,24 @@ if [ -e /usr/sbin/anaconda-diskroot ]; then
$SED 's/^mount $dev $repodir/mount -oro $dev $repodir/' -i /usr/sbin/anaconda-diskroot $SED 's/^mount $dev $repodir/mount -oro $dev $repodir/' -i /usr/sbin/anaconda-diskroot
fi fi
if [ -f $VTOY_PATH/autoinstall ]; then #For Fedora CoreOS
cp -a $VTOY_PATH/hook/rhel7/ventoy-autoexp.sh /lib/dracut/hooks/pre-mount/99-ventoy-autoexp.sh if $GREP -i -q 'fedora.*coreos' /etc/os-release; then
$SED "s#isosrc=.*#isosrc=/dev/mapper/ventoy#" -i /lib/systemd/system-generators/live-generator
cp -a $VTOY_PATH/hook/rhel7/ventoy-make-link.sh /lib/dracut/hooks/pre-mount/99-ventoy-premount-mklink.sh
fi fi
#special distro magic
$BUSYBOX_PATH/mkdir -p $VTOY_PATH/distmagic
if $GREP -q SCRE /proc/cmdline; then
echo 1 > $VTOY_PATH/distmagic/SCRE
fi
if $GREP -qw 'SA[.]1' /proc/cmdline; then
if $GREP -qw 'writable.fsimg' /proc/cmdline; then
if $GREP -qw 'rw' /proc/cmdline; then
echo 1 > $VTOY_PATH/distmagic/DELL_PER
fi
fi
fi

View File

@@ -0,0 +1,26 @@
#!/ventoy/busybox/sh
#************************************************************************************
# Copyright (c) 2023, longpanda <admin@ventoy.net>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
#
#************************************************************************************
. /ventoy/hook/ventoy-hook-lib.sh
vtHook=$($CAT $VTOY_PATH/inotifyd-hook-script.txt)
vtdisk=$(get_ventoy_disk_name)
vtlog "... $vtdisk already exist ..."
$BUSYBOX_PATH/sh $vtHook n /dev "${vtdisk#/dev/}2"

View File

@@ -50,7 +50,11 @@ if is_inotify_ventoy_part $3; then
vtScript=$($GREP -m1 'RUN.=' $vtGenRulFile | $AWK -F'RUN.=' '{print $2}' | $SED 's/"\(.*\)".*/\1/') vtScript=$($GREP -m1 'RUN.=' $vtGenRulFile | $AWK -F'RUN.=' '{print $2}' | $SED 's/"\(.*\)".*/\1/')
vtlog "vtScript=$vtScript" vtlog "vtScript=$vtScript"
if $GREP -q SCRE /proc/cmdline; then if [ -f $VTOY_PATH/distmagic/SCRE ]; then
/sbin/dmsquash-live-root /dev/ventoy
elif [ -f $VTOY_PATH/distmagic/DELL_PER ]; then
sed 's/liverw=[^ ]*/liverw=ro/g' -i /sbin/dmsquash-live-root
sed 's/writable_fsimg=[^ ]*/writable_fsimg=""/g' -i /sbin/dmsquash-live-root
/sbin/dmsquash-live-root /dev/ventoy /sbin/dmsquash-live-root /dev/ventoy
else else
$vtScript $vtScript
@@ -70,6 +74,9 @@ if is_inotify_ventoy_part $3; then
if [ -e /sbin/anaconda-diskroot ]; then if [ -e /sbin/anaconda-diskroot ]; then
vtlog "set anaconda-diskroot ..." vtlog "set anaconda-diskroot ..."
#busybox cp doesn't support -t option (issue 1900)
/bin/cp -a /bin/cp $BUSYBOX_PATH/cp
/sbin/anaconda-diskroot /dev/ventoy /sbin/anaconda-diskroot /dev/ventoy
fi fi

View File

@@ -27,5 +27,8 @@ if [ "$vtdisk" = "unknown" ]; then
$BUSYBOX_PATH/nohup $VTOY_PATH/tool/inotifyd $vtHook /dev:n 2>&- & $BUSYBOX_PATH/nohup $VTOY_PATH/tool/inotifyd $vtHook /dev:n 2>&- &
else else
vtlog "... $vtdisk already exist ..." vtlog "... $vtdisk already exist ..."
$BUSYBOX_PATH/sh $vtHook n /dev "${vtdisk#/dev/}2"
#don't call it too early issue 2225
#$BUSYBOX_PATH/sh $vtHook n /dev "${vtdisk#/dev/}2"
cp -a $VTOY_PATH/hook/rhel7/ventoy-inotifyd-call.sh /lib/dracut/hooks/initqueue/settled/90-ventoy-inotifyd-call.sh
fi fi

View File

@@ -26,7 +26,9 @@ fi
blkdev_num=$($VTOY_PATH/tool/dmsetup ls | grep ventoy | sed 's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1:\2/') blkdev_num=$($VTOY_PATH/tool/dmsetup ls | grep ventoy | sed 's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1:\2/')
vtDM=$(ventoy_find_dm_id ${blkdev_num}) vtDM=$(ventoy_find_dm_id ${blkdev_num})
if ! [ -e /dev/mapper/ventoy ]; then if [ -e /dev/mapper/ventoy ]; then
vtlog "/dev/mapper/ventoy already exist"
else
vtlog "link /dev/$vtDM to /dev/mapper/ventoy" vtlog "link /dev/$vtDM to /dev/mapper/ventoy"
ln -s /dev/$vtDM /dev/mapper/ventoy ln -s /dev/$vtDM /dev/mapper/ventoy
fi fi
@@ -35,7 +37,13 @@ VTLABEL=$($BUSYBOX_PATH/blkid /dev/$vtDM | $SED 's/.*LABEL="\([^"]*\)".*/\1/')
vtlog "VTLABEL=$VTLABEL" vtlog "VTLABEL=$VTLABEL"
if [ -n "$VTLABEL" ]; then if [ -n "$VTLABEL" ]; then
if ! [ -e "/dev/disk/by-label/$VTLABEL" ]; then if ! [ -d /dev/disk/by-label ]; then
mkdir -p /dev/disk/by-label
fi
if [ -e "/dev/disk/by-label/$VTLABEL" ]; then
vtlog "/dev/disk/by-label/$VTLABEL already exist"
else
vtlog "link /dev/$vtDM to /dev/disk/by-label/$VTLABEL" vtlog "link /dev/$vtDM to /dev/disk/by-label/$VTLABEL"
ln -s /dev/$vtDM "/dev/disk/by-label/$VTLABEL" ln -s /dev/$vtDM "/dev/disk/by-label/$VTLABEL"
fi fi

View File

@@ -23,7 +23,18 @@ vtlog "##### $0 $* ..."
VTPATH_OLD=$PATH; PATH=$BUSYBOX_PATH:$VTOY_PATH/tool:$PATH VTPATH_OLD=$PATH; PATH=$BUSYBOX_PATH:$VTOY_PATH/tool:$PATH
repodev=$(ls $VTOY_PATH/dev_backup*) if [ -f /ventoy/vtoy_iso_scan ]; then
echo "inst.repo=hd:/dev/${repodev#*dev_backup_}" >> /sysroot/etc/cmdline repopath=$(cat /ventoy/vtoy_iso_scan)
repodev=$(vtoydump -f /ventoy/ventoy_os_param | awk -F'#' '{print $1}')
if echo $repodev | egrep -q "nvme|mmc|nbd"; then
vtpart1=${repodev}p1
else
vtpart1=${repodev}1
fi
echo "inst.repo=hd:${vtpart1}:${repopath}" >> /sysroot/etc/cmdline
else
repodev=$(ls $VTOY_PATH/dev_backup*)
echo "inst.repo=hd:/dev/${repodev#*dev_backup_}" >> /sysroot/etc/cmdline
fi
PATH=$VTPATH_OLD PATH=$VTPATH_OLD

View File

@@ -39,6 +39,9 @@ fi
if [ -e /sbin/anaconda-diskroot ]; then if [ -e /sbin/anaconda-diskroot ]; then
vtlog "set anaconda-diskroot /dev/ventoy ..." vtlog "set anaconda-diskroot /dev/ventoy ..."
#busybox cp doesn't support -t option (issue 1900)
/bin/cp -a /bin/cp $BUSYBOX_PATH/cp
/sbin/anaconda-diskroot /dev/ventoy /sbin/anaconda-diskroot /dev/ventoy
fi fi

View File

@@ -223,6 +223,42 @@ ventoy_check_dm_module() {
fi fi
} }
ventoy_need_proc_ibt() {
vtKv=$($BUSYBOX_PATH/uname -r)
vtMajor=$(echo $vtKv | $AWK -F. '{print $1}')
vtMinor=$(echo $vtKv | $AWK -F. '{print $2}')
#ibt was supported since linux kernel 5.18
if [ $vtMajor -lt 5 ]; then
$BUSYBOX_PATH/false; return
elif [ $vtMajor -eq 5 ]; then
if [ $vtMajor -lt 18 ]; then
$BUSYBOX_PATH/false; return
fi
fi
if $GREP -q ' ibt=off' /proc/cmdline; then
$BUSYBOX_PATH/false; return
fi
#hardware CPU doesn't support IBT
if $VTOY_PATH/tool/vtoykmod -I; then
:
else
$BUSYBOX_PATH/false; return
fi
#dot.CONFIG not enabled
if $GREP -q ' ibt_restore$' /proc/kallsyms; then
:
else
$BUSYBOX_PATH/false; return
fi
$BUSYBOX_PATH/true
}
ventoy_need_dm_patch() { ventoy_need_dm_patch() {
if [ "$VTOY_LINUX_REMOUNT" != "01" ]; then if [ "$VTOY_LINUX_REMOUNT" != "01" ]; then
if $GREP -q 'VTOY_LINUX_REMOUNT=1' /proc/cmdline; then if $GREP -q 'VTOY_LINUX_REMOUNT=1' /proc/cmdline; then
@@ -269,6 +305,16 @@ ventoy_dm_patch() {
return return
fi fi
if ventoy_need_proc_ibt; then
vtlog "need to proc IBT"
vtKoName=dm_patch_ibt_64.ko
vtIBT='0x8888'
else
vtlog "NO need to proc IBT"
vtIBT='0'
fi
if [ -f $VTOY_PATH/tool/$vtKoName ]; then if [ -f $VTOY_PATH/tool/$vtKoName ]; then
vtlog "/ventoy/tool/$vtKoName exist OK" vtlog "/ventoy/tool/$vtKoName exist OK"
else else
@@ -278,11 +324,23 @@ ventoy_dm_patch() {
$CAT /proc/kallsyms | $BUSYBOX_PATH/sort > $VTOY_PATH/kallsyms $CAT /proc/kallsyms | $BUSYBOX_PATH/sort > $VTOY_PATH/kallsyms
vtLine=$($VTOY_PATH/tool/vtoyksym dm_get_table_device $VTOY_PATH/kallsyms) if $GREP -m1 -q 'open_table_device.isra' $VTOY_PATH/kallsyms; then
vtLine=$($VTOY_PATH/tool/vtoyksym open_table_device.isra $VTOY_PATH/kallsyms)
vtlog "get open_table_device.isra address $vtLine"
else
vtLine=$($VTOY_PATH/tool/vtoyksym dm_get_table_device $VTOY_PATH/kallsyms)
vtlog "get dm_get_table_device address $vtLine"
fi
get_addr=$(echo $vtLine | $AWK '{print $1}') get_addr=$(echo $vtLine | $AWK '{print $1}')
get_size=$(echo $vtLine | $AWK '{print $2}') get_size=$(echo $vtLine | $AWK '{print $2}')
vtLine=$($VTOY_PATH/tool/vtoyksym dm_put_table_device $VTOY_PATH/kallsyms) if $GREP -m1 -q 'close_table_device.isra' $VTOY_PATH/kallsyms; then
vtLine=$($VTOY_PATH/tool/vtoyksym close_table_device.isra $VTOY_PATH/kallsyms)
vtlog "get close_table_device.isra address $vtLine"
else
vtLine=$($VTOY_PATH/tool/vtoyksym dm_put_table_device $VTOY_PATH/kallsyms)
vtlog "get dm_put_table_device address $vtLine"
fi
put_addr=$(echo $vtLine | $AWK '{print $1}') put_addr=$(echo $vtLine | $AWK '{print $1}')
put_size=$(echo $vtLine | $AWK '{print $2}') put_size=$(echo $vtLine | $AWK '{print $2}')
@@ -293,6 +351,9 @@ ventoy_dm_patch() {
if [ "$VTOY_DEBUG_LEVEL" = "01" ]; then if [ "$VTOY_DEBUG_LEVEL" = "01" ]; then
printk_addr=$($GREP ' printk$' /proc/kallsyms | $AWK '{print $1}') printk_addr=$($GREP ' printk$' /proc/kallsyms | $AWK '{print $1}')
if [ -z "$printk_addr" ]; then
printk_addr=$($GREP ' _printk$' /proc/kallsyms | $AWK '{print $1}')
fi
vtDebug="-v" vtDebug="-v"
else else
printk_addr=0 printk_addr=0
@@ -349,14 +410,16 @@ ventoy_dm_patch() {
return return
fi fi
#step1: modify vermagic/mod crc/relocation #step1: modify vermagic/mod crc/relocation
vtlog "$VTOY_PATH/tool/vtoykmod -u $VTOY_PATH/tool/$vtKoName $VTOY_PATH/$vtModName $vtDebug" vtlog "$VTOY_PATH/tool/vtoykmod -u $VTOY_PATH/tool/$vtKoName $VTOY_PATH/$vtModName $vtDebug"
$VTOY_PATH/tool/vtoykmod -u $VTOY_PATH/tool/$vtKoName $VTOY_PATH/$vtModName $vtDebug $VTOY_PATH/tool/vtoykmod -u $VTOY_PATH/tool/$vtKoName $VTOY_PATH/$vtModName $vtDebug
#step2: fill parameters #step2: fill parameters
vtPgsize=$($VTOY_PATH/tool/vtoyksym -p) vtPgsize=$($VTOY_PATH/tool/vtoyksym -p)
vtlog "$VTOY_PATH/tool/vtoykmod -f $VTOY_PATH/tool/$vtKoName $vtPgsize 0x$printk_addr 0x$ro_addr 0x$rw_addr $get_addr $get_size $put_addr $put_size 0x$kprobe_reg_addr 0x$kprobe_unreg_addr $vtDebug" vtlog "$VTOY_PATH/tool/vtoykmod -f $VTOY_PATH/tool/$vtKoName $vtPgsize 0x$printk_addr 0x$ro_addr 0x$rw_addr $get_addr $get_size $put_addr $put_size 0x$kprobe_reg_addr 0x$kprobe_unreg_addr $vtKv $vtIBT $vtDebug"
$VTOY_PATH/tool/vtoykmod -f $VTOY_PATH/tool/$vtKoName $vtPgsize 0x$printk_addr 0x$ro_addr 0x$rw_addr $get_addr $get_size $put_addr $put_size 0x$kprobe_reg_addr 0x$kprobe_unreg_addr $vtDebug $VTOY_PATH/tool/vtoykmod -f $VTOY_PATH/tool/$vtKoName $vtPgsize 0x$printk_addr 0x$ro_addr 0x$rw_addr $get_addr $get_size $put_addr $put_size 0x$kprobe_reg_addr 0x$kprobe_unreg_addr $vtKv $vtIBT $vtDebug
$BUSYBOX_PATH/insmod $VTOY_PATH/tool/$vtKoName $BUSYBOX_PATH/insmod $VTOY_PATH/tool/$vtKoName
@@ -738,6 +801,7 @@ ventoy_udev_disk_common_hook() {
fi fi
if $GREP -q 'dm_patch' /proc/modules; then if $GREP -q 'dm_patch' /proc/modules; then
vtlog "remove dm_patch module."
$BUSYBOX_PATH/rmmod dm_patch $BUSYBOX_PATH/rmmod dm_patch
fi fi
} }
@@ -879,3 +943,17 @@ ventoy_check_umount() {
fi fi
done done
} }
ventoy_wait_dir() {
vtdir=$1
vtsec=0
while [ $vtsec -lt $2 ]; do
if [ -d "$vtdir" ]; then
break
else
$SLEEP 1
vtsec=$(expr $vtsec + 1)
fi
done
}

View File

@@ -121,3 +121,53 @@ ventoy_check_mount() {
$BUSYBOX_PATH/mount $1 $2 $BUSYBOX_PATH/mount $1 $2
fi fi
} }
ventoy_has_exfat_ko() {
vtExfat=''
vtKerVer=$($BUSYBOX_PATH/uname -r)
if [ -d /lib/modules/$vtKerVer/kernel/fs/exfat ]; then
vtExfat=$(ls /lib/modules/$vtKerVer/kernel/fs/exfat/)
fi
[ -n "$vtExfat" ]
}
ventoy_is_exfat_part() {
$VTOY_PATH/tool/vtoydump -s /ventoy/ventoy_os_param | $GREP -q exfat
}
ventoy_iso_scan_path() {
if [ -f /sbin/iso-scan ]; then
echo -n '/sbin/iso-scan'
elif [ -f /bin/iso-scan ]; then
echo -n '/bin/iso-scan'
else
echo -n ''
fi
}
ventoy_has_iso_scan() {
vtScanPath=$(ventoy_iso_scan_path)
[ -n "$vtScanPath" ]
}
ventoy_rw_iso_scan() {
vtScanPath=$(ventoy_iso_scan_path)
if [ -n "$vtScanPath" ]; then
if $GREP -q 'mount.* ro .*isoscan' $vtScanPath; then
$SED -i 's/\(mount.*-o.*\) ro /\1 rw /' $vtScanPath
fi
fi
}
ventoy_iso_scan_check() {
vtCheckOk=0
if ventoy_is_exfat_part; then
if ventoy_has_exfat_ko; then
if ventoy_has_iso_scan; then
vtCheckOk=1
fi
fi
fi
[ $vtCheckOk -eq 1 ]
}

View File

@@ -34,9 +34,12 @@ else
vtBit=32 vtBit=32
fi fi
xz -d $VTOY_PATH/vtloopex/dm-mod/$vtKerVer/$vtBit/dm-mod.ko.xz if [ -f $VTOY_PATH/vtloopex/dm-mod/$vtKerVer/$vtBit/dm-mod.ko.xz ]; then
insmod $VTOY_PATH/vtloopex/dm-mod/$vtKerVer/$vtBit/dm-mod.ko xz -d $VTOY_PATH/vtloopex/dm-mod/$vtKerVer/$vtBit/dm-mod.ko.xz
insmod $VTOY_PATH/vtloopex/dm-mod/$vtKerVer/$vtBit/dm-mod.ko
elif [ -f $VTOY_PATH/modules/dm-mod.ko ]; then
insmod $VTOY_PATH/modules/dm-mod.ko
fi
wait_for_usb_disk_ready wait_for_usb_disk_ready

View File

@@ -37,9 +37,38 @@ if [ "$vtdiskname" = "unknown" ]; then
fi fi
ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2" "noreplace" ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2" "noreplace"
ventoy_create_dev_ventoy_part ventoy_create_dev_ventoy_part
if ventoy_need_dm_patch; then
vtlog "extract a ko file"
mkdir -p /ventoy/tmpmnt1 /ventoy/tmpmnt2
mount /dev/ventoy1 /ventoy/tmpmnt1
mount /ventoy/tmpmnt1/boot/batocera /ventoy/tmpmnt2
vtKV=$(uname -r)
mkdir -p /lib/modules/$vtKV/kernel/
vtKO=$(find "/ventoy/tmpmnt2/lib/modules/$vtKV/kernel/fs/" -name "*.ko*" | head -n1)
cp -a $vtKO /lib/modules/$vtKV/kernel/
vtlog "vtKV=$vtKV vtKO=$vtKO"
umount /ventoy/tmpmnt2
umount /ventoy/tmpmnt1
vtPartid=1
cat /vtoy_dm_table | while read vtline; do
dmsetup remove ventoy$vtPartid
vtPartid=$(expr $vtPartid + 1)
done
dmsetup remove ventoy
vtlog "Recreate device-mapper"
ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2" "noreplace"
ventoy_create_dev_ventoy_part
fi
PATH=$VTPATH_OLD PATH=$VTPATH_OLD
set_ventoy_hook_finish set_ventoy_hook_finish

View File

@@ -23,6 +23,9 @@ $SED "/find drives/i $BUSYBOX_PATH/sh $VTOY_PATH/loop/easyos/ventoy-disk.sh; vtD
$SED "1a boot_dev=ventoy1;wkg_dev=ventoy2" -i /init $SED "1a boot_dev=ventoy1;wkg_dev=ventoy2" -i /init
$SED 's#\(dd *if=/dev/.*WKG_DRV.* *of=/dev/null.*skip\)=[0-9]*#\1=1048576#' -i /init
$SED "s#WKG_DEV=\"\"#WKG_DEV=ventoy2#g" -i /init
#check for ssd will read /sys/block/ventoy, will no exist, need a workaround #check for ssd will read /sys/block/ventoy, will no exist, need a workaround
$SED "s#/sys/block/\${WKG_DRV}/#/sys/block/\$vtDM/#g" -i /init $SED "s#/sys/block/\${WKG_DRV}/#/sys/block/\$vtDM/#g" -i /init

View File

@@ -0,0 +1,46 @@
#!/ventoy/busybox/sh
#************************************************************************************
# Copyright (c) 2020, longpanda <admin@ventoy.net>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
#
#************************************************************************************
. /ventoy/hook/ventoy-hook-lib.sh
if is_ventoy_hook_finished; then
exit 0
fi
vtlog "####### $0 $* ########"
VTPATH_OLD=$PATH; PATH=$BUSYBOX_PATH:$VTOY_PATH/tool:$PATH
wait_for_usb_disk_ready
vtdiskname=$(get_ventoy_disk_name)
if [ "$vtdiskname" = "unknown" ]; then
vtlog "ventoy disk not found"
PATH=$VTPATH_OLD
exit 0
fi
ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2" "noreplace"
ventoy_create_dev_ventoy_part
mdev -s
PATH=$VTPATH_OLD
set_ventoy_hook_finish

View File

@@ -0,0 +1,23 @@
#!/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
$SED "/^mountroot$/i\\$BUSYBOX_PATH/sh $VTOY_PATH/loop/fwts/ventoy-disk.sh" -i /init
#$SED "/^mountroot$/i\\export ROOT=/dev/mapper/ventoy" -i /init

View File

@@ -229,6 +229,10 @@ ventoy_get_os_type() {
echo 'android'; return echo 'android'; return
fi fi
if $GREP -q 'android.google' /proc/version; then
echo 'android'; return
fi
if $GREP -q 'adelielinux' /proc/version; then if $GREP -q 'adelielinux' /proc/version; then
echo 'adelie'; return echo 'adelie'; return
fi fi
@@ -362,6 +366,16 @@ ventoy_get_os_type() {
fi fi
#Kylin V10 Server
if [ -f /usr/sbin/dhclient ]; then
if $BUSYBOX_PATH/strings /usr/sbin/dhclient | $GREP -i -q -m1 openeuler; then
echo 'openEuler'; return
fi
fi
if $GREP -q 'chimera' /proc/version; then
echo 'chimera'; return
fi
echo "default" echo "default"
} }

View File

@@ -75,6 +75,10 @@ ventoy_get_os_type() {
echo 'openwrt'; return echo 'openwrt'; return
fi fi
if $GREP -q 'easyos' /proc/cmdline; then
echo 'easyos'; return
fi
if [ -e /BOOT_SPECS ]; then if [ -e /BOOT_SPECS ]; then
if $GREP -q 'easyos' /BOOT_SPECS; then if $GREP -q 'easyos' /BOOT_SPECS; then
echo 'easyos'; return echo 'easyos'; return

Binary file not shown.

View File

@@ -18,6 +18,18 @@ print_usage() {
echo '' echo ''
} }
print_err() {
echo ""
echo "$*"
echo ""
}
uid=$(id -u)
if [ $uid -ne 0 ]; then
print_err "Please use sudo or run the script as root."
exit 1
fi
while [ -n "$1" ]; do while [ -n "$1" ]; do
if [ "$1" = "-s" ]; then if [ "$1" = "-s" ]; then
shift shift

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,4 +1,4 @@
#!/bin/sh #!/bin/bash
print_usage() { print_usage() {
echo 'Usage: ExtendPersistentImg.sh file size' echo 'Usage: ExtendPersistentImg.sh file size'
@@ -19,6 +19,18 @@ if [ -z "$2" ]; then
exit 1 exit 1
fi fi
if [ "$1" = "__vbash__" ]; then
shift
else
if readlink /bin/sh | grep -q bash; then
:
else
exec /bin/bash $0 "__vbash__" "$@"
fi
fi
file=$1 file=$1
size=$2 size=$2

View File

@@ -1,7 +1,7 @@
========== Ventoy2Disk.sh =============== ========== Ventoy2Disk.sh ===============
sudo sh Ventoy2Disk.sh { -i | -I | -u } /dev/sdX sdX is the USB device, for example /dev/sdb. sudo bash Ventoy2Disk.sh { -i | -I | -u } /dev/sdX sdX is the USB device, for example /dev/sdb.
Ventoy2Disk.sh CMD [ OPTION ] /dev/sdX Ventoy2Disk.sh CMD [ OPTION ] /dev/sdX
CMD: CMD:
@@ -18,16 +18,16 @@ Please refer https://www.ventoy.net/en/doc_start.html for details.
========== VentoyWeb.sh =============== ========== VentoyWeb.sh ===============
1. sudo sh VentoyWeb.sh 1. sudo bash VentoyWeb.sh
2. open your browser and visit http://127.0.0.1:24680 2. open your browser and visit http://127.0.0.1:24680
========== VentoyPlugson.sh =============== ========== VentoyPlugson.sh ===============
1. sudo sh VentoyPlugson.sh 1. sudo bash VentoyPlugson.sh /dev/sdX
2. open your browser and visit http://127.0.0.1:24681 2. open your browser and visit http://127.0.0.1:24681
========== VentoyVlnk.sh =============== ========== VentoyVlnk.sh ===============
Usage: sudo sh VentoyVlnk.sh CMD FILE Usage: sudo bash VentoyVlnk.sh CMD FILE
CMD: CMD:
-c FILE create vlnk for FILE -c FILE create vlnk for FILE
-l VLNK parse vlnk file -l VLNK parse vlnk file
@@ -43,21 +43,21 @@ VentoyGUI is native GUI program for Linux (GTK/QT)
========== CreatePersistentImg.sh =============== ========== CreatePersistentImg.sh ===============
sudo sh CreatePersistentImg.sh [ -s SIZE_IN_MB ] [ -t FSTYPE ] [ -l LABEL ] for example: sudo bash CreatePersistentImg.sh [ -s SIZE_IN_MB ] [ -t FSTYPE ] [ -l LABEL ] for example:
sh CreatePersistentImg.sh ----> persistence.dat in 1GB size and ext4 filesystem and casper-rw label bash CreatePersistentImg.sh ----> persistence.dat in 1GB size and ext4 filesystem and casper-rw label
sh CreatePersistentImg.sh -l MX-Persist ----> persistence.dat in 1GB size and ext4 filesystem and MX-Persist label bash CreatePersistentImg.sh -l MX-Persist ----> persistence.dat in 1GB size and ext4 filesystem and MX-Persist label
sh CreatePersistentImg.sh -s 2048 ----> persistence.dat in 2GB size and ext4 filesystem and casper-rw label bash CreatePersistentImg.sh -s 2048 ----> persistence.dat in 2GB size and ext4 filesystem and casper-rw label
sh CreatePersistentImg.sh -s 4096 -t xfs ----> persistence.dat in 4GB size and xfs filesystem (ext2/3/4 xfs are supported) and casper-rw label bash CreatePersistentImg.sh -s 4096 -t xfs ----> persistence.dat in 4GB size and xfs filesystem (ext2/3/4 xfs are supported) and casper-rw label
Please refer https://www.ventoy.net/en/plugin_persistence.html for details. Please refer https://www.ventoy.net/en/plugin_persistence.html for details.
========== ExtendPersistentImg.sh =============== ========== ExtendPersistentImg.sh ===============
sudo sh ExtendPersistentImg.sh file size sudo bash ExtendPersistentImg.sh file size
For example: For example:
sh ExtendPersistentImg.sh persistence.dat 2048 ----> Extend persistence.dat by 2048MB bash ExtendPersistentImg.sh persistence.dat 2048 ----> Extend persistence.dat by 2048MB
That is to say, persistence.dat file will grow to 3GB size (assume that it is 1GB size before extend) That is to say, persistence.dat file will grow to 3GB size (assume that it is 1GB size before extend)
Please refer https://www.ventoy.net/en/plugin_persistence.html for details. Please refer https://www.ventoy.net/en/plugin_persistence.html for details.

Binary file not shown.

View File

@@ -12,11 +12,11 @@ if [ -f ./ventoy/version ]; then
curver=$(cat ./ventoy/version) curver=$(cat ./ventoy/version)
fi fi
if uname -m | egrep -q 'aarch64|arm64'; then if uname -m | grep -E -q 'aarch64|arm64'; then
export TOOLDIR=aarch64 export TOOLDIR=aarch64
elif uname -m | egrep -q 'x86_64|amd64'; then elif uname -m | grep -E -q 'x86_64|amd64'; then
export TOOLDIR=x86_64 export TOOLDIR=x86_64
elif uname -m | egrep -q 'mips64'; then elif uname -m | grep -E -q 'mips64'; then
export TOOLDIR=mips64el export TOOLDIR=mips64el
else else
export TOOLDIR=i386 export TOOLDIR=i386

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,9 +1,9 @@
#!/bin/sh #!/bin/bash
. ./tool/ventoy_lib.sh . ./tool/ventoy_lib.sh
print_usage() { print_usage() {
echo 'Usage: sudo sh VentoyPlugson.sh [OPTION] /dev/sdX' echo 'Usage: sudo bash VentoyPlugson.sh [OPTION] /dev/sdX'
echo ' OPTION: (optional)' echo ' OPTION: (optional)'
echo ' -H x.x.x.x http server IP address (default is 127.0.0.1)' echo ' -H x.x.x.x http server IP address (default is 127.0.0.1)'
echo ' -P PORT http server PORT (default is 24681)' echo ' -P PORT http server PORT (default is 24681)'
@@ -17,17 +17,26 @@ if [ $uid -ne 0 ]; then
exit 1 exit 1
fi fi
if [ "$1" = "__vbash__" ]; then
shift
else
if readlink /bin/sh | grep -q bash; then
:
else
exec /bin/bash $0 "__vbash__" "$@"
fi
fi
OLDDIR=$(pwd) OLDDIR=$(pwd)
machine=$(uname -m) machine=$(uname -m)
if echo $machine | egrep -q 'aarch64|arm64'; then if echo $machine | grep -E -q 'aarch64|arm64'; then
TOOLDIR=aarch64 TOOLDIR=aarch64
elif echo $machine | egrep -q 'x86_64|amd64'; then elif echo $machine | grep -E -q 'x86_64|amd64'; then
TOOLDIR=x86_64 TOOLDIR=x86_64
elif echo $machine | egrep -q 'mips64'; then elif echo $machine | grep -E -q 'mips64'; then
TOOLDIR=mips64el TOOLDIR=mips64el
elif echo $machine | egrep -q 'i[3-6]86'; then elif echo $machine | grep -E -q 'i[3-6]86'; then
TOOLDIR=i386 TOOLDIR=i386
else else
echo "Unsupported machine type $machine" echo "Unsupported machine type $machine"
@@ -113,7 +122,7 @@ if echo $DISK | grep -q "[a-z]d[a-z][1-9]"; then
DISK=${DISK:0:-1} DISK=${DISK:0:-1}
fi fi
if echo $DISK | egrep -q "/dev/nvme|/dev/mmcblk/dev/nbd"; then if echo $DISK | grep -E -q "/dev/nvme|/dev/mmcblk/dev/nbd"; then
if echo $DISK | grep -q "p[1-9]$"; then if echo $DISK | grep -q "p[1-9]$"; then
DISK=${DISK:0:-2} DISK=${DISK:0:-2}
fi fi
@@ -154,7 +163,7 @@ fi
PART1=$(get_disk_part_name $DISK 1) PART1=$(get_disk_part_name $DISK 1)
if grep -q "^$PART1 " /proc/mounts; then if grep -q "^$PART1 " /proc/mounts; then
mtpnt=$(grep "^$PART1 " /proc/mounts | awk '{print $2}') mtpnt=$(grep "^$PART1 " /proc/mounts | awk '{print $2}' | sed 's/\\040/ /g')
fstype=$(grep "^$PART1 " /proc/mounts | awk '{print $3}') fstype=$(grep "^$PART1 " /proc/mounts | awk '{print $3}')
if echo $fstype | grep -q -i 'fuse'; then if echo $fstype | grep -q -i 'fuse'; then

View File

@@ -1,4 +1,4 @@
#!/bin/sh #!/bin/bash
print_usage() { print_usage() {
echo 'Usage: VentoyWeb.sh [ OPTION ]' echo 'Usage: VentoyWeb.sh [ OPTION ]'
@@ -23,11 +23,11 @@ fi
OLDDIR=$(pwd) OLDDIR=$(pwd)
if uname -m | egrep -q 'aarch64|arm64'; then if uname -m | grep -E -q 'aarch64|arm64'; then
TOOLDIR=aarch64 TOOLDIR=aarch64
elif uname -m | egrep -q 'x86_64|amd64'; then elif uname -m | grep -E -q 'x86_64|amd64'; then
TOOLDIR=x86_64 TOOLDIR=x86_64
elif uname -m | egrep -q 'mips64'; then elif uname -m | grep -E -q 'mips64'; then
TOOLDIR=mips64el TOOLDIR=mips64el
else else
TOOLDIR=i386 TOOLDIR=i386

Binary file not shown.

Binary file not shown.

View File

@@ -1,117 +1,96 @@
if [ -e "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}.md5" ]; then unset vtchkdef
set default=0 vt_vtoychksum_exist "${VTOY_CHKSUM_FILE_PATH}"
menuentry "Calculate and check md5sum" --class=checksum_md5 {
if [ "$VT_EXIST_MD5" = "1" ]; then
if [ -z "$vtchkdef" ]; then
set default=0
set vtchkdef=1
fi
menuentry "$VTLANG_CHKSUM_MD5_CALC_CHK" --class=checksum_md5 {
md5sum "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}"
vt_cmp_checksum 0 "${VTOY_CHKSUM_FILE_PATH}"
echo -en "\n\n$VTLANG_ENTER_EXIT ..."
read vtInputKey
}
else
menuentry "$VTLANG_CHKSUM_MD5_CALC" --class=checksum_md5 {
md5sum "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}" md5sum "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}"
vt_1st_line "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}.md5" vtReadChecksum echo -en "\n\n$VTLANG_ENTER_EXIT ..."
if vt_str_casebegin "$vtReadChecksum" "$VT_LAST_CHECK_SUM"; then
echo -e "\n\nCheck MD5 value with .md5 file. [ OK ]"
else
echo -e "\n\nCheck MD5 value with .md5 file. [ FAIL ]"
echo "The MD5 value in .md5 file is:"
echo "$vtReadChecksum"
fi
echo -e "\n\npress ENTER to exit ..."
read vtInputKey
}
else
menuentry "Calculate md5sum" --class=checksum_md5 {
md5sum "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}"
echo -e "\n\npress ENTER to exit ..."
read vtInputKey read vtInputKey
} }
fi fi
if [ -e "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}.sha1" ]; then if [ "$VT_EXIST_SHA1" = "1" ]; then
set default=1 if [ -z "$vtchkdef" ]; then
menuentry "Calculate and check sha1sum" --class=checksum_sha1 { set default=1
set vtchkdef=1
fi
menuentry "$VTLANG_CHKSUM_SHA1_CALC_CHK" --class=checksum_sha1 {
sha1sum "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}"
vt_cmp_checksum 1 "${VTOY_CHKSUM_FILE_PATH}"
echo -en "\n\n$VTLANG_ENTER_EXIT ..."
read vtInputKey
}
else
menuentry "$VTLANG_CHKSUM_SHA1_CALC" --class=checksum_sha1 {
sha1sum "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}" sha1sum "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}"
vt_1st_line "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}.sha1" vtReadChecksum echo -en "\n\n$VTLANG_ENTER_EXIT ..."
if vt_str_casebegin "$vtReadChecksum" "$VT_LAST_CHECK_SUM"; then
echo -e "\n\nCheck SHA1 value with .sha1 file. [ OK ]"
else
echo -e "\n\nCheck SHA1 value with .sha1 file. [ FAIL ]"
echo "The SHA1 value in .sha1 file is:"
echo "$vtReadChecksum"
fi
echo -e "\n\npress ENTER to exit ..."
read vtInputKey
}
else
menuentry "Calculate sha1sum" --class=checksum_sha1 {
sha1sum "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}"
echo -e "\n\npress ENTER to exit ..."
read vtInputKey read vtInputKey
} }
fi fi
if [ -e "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}.sha256" ]; then if [ "$VT_EXIST_SHA256" = "1" ]; then
set default=2 if [ -z "$vtchkdef" ]; then
menuentry "Calculate and check sha256sum" --class=checksum_sha256 { set default=2
set vtchkdef=1
fi
menuentry "$VTLANG_CHKSUM_SHA256_CALC_CHK" --class=checksum_sha256 {
sha256sum "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}"
vt_cmp_checksum 2 "${VTOY_CHKSUM_FILE_PATH}"
echo -en "\n\n$VTLANG_ENTER_EXIT ..."
read vtInputKey
}
else
menuentry "$VTLANG_CHKSUM_SHA256_CALC" --class=checksum_sha256 {
sha256sum "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}" sha256sum "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}"
vt_1st_line "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}.sha256" vtReadChecksum echo -en "\n\n$VTLANG_ENTER_EXIT ..."
if vt_str_casebegin "$vtReadChecksum" "$VT_LAST_CHECK_SUM"; then
echo -e "\n\nCheck SHA256 value with .sha256 file. [ OK ]"
else
echo -e "\n\nCheck SHA256 value with .sha256 file. [ FAIL ]"
echo "The SHA256 value in .sha256 file is:"
echo "$vtReadChecksum"
fi
echo -e "\n\npress ENTER to exit ..."
read vtInputKey
}
else
menuentry "Calculate sha256sum" --class=checksum_sha256 {
sha256sum "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}"
echo -e "\n\npress ENTER to exit ..."
read vtInputKey read vtInputKey
} }
fi fi
if [ -e "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}.sha512" ]; then if [ "$VT_EXIST_SHA512" = "1" ]; then
set default=3 if [ -z "$vtchkdef" ]; then
menuentry "Calculate and check sha512sum" --class=checksum_sha512{ set default=3
set vtchkdef=1
fi
menuentry "$VTLANG_CHKSUM_SHA512_CALC_CHK" --class=checksum_sha512{
sha512sum "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}" sha512sum "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}"
vt_cmp_checksum 3 "${VTOY_CHKSUM_FILE_PATH}"
vt_1st_line "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}.sha512" vtReadChecksum echo -en "\n\n$VTLANG_ENTER_EXIT ..."
if vt_str_casebegin "$vtReadChecksum" "$VT_LAST_CHECK_SUM"; then
echo -e "\n\nCheck SHA512 value with .sha512 file. [ OK ]"
else
echo -e "\n\nCheck SHA512 value with .sha512 file. [ FAIL ]"
echo "The SHA512 value in .sha512 file is:"
echo "$vtReadChecksum"
fi
echo -e "\n\npress ENTER to exit ..."
read vtInputKey read vtInputKey
} }
else else
menuentry "Calculate sha512sum" --class=checksum_sha512{ menuentry "$VTLANG_CHKSUM_SHA512_CALC" --class=checksum_sha512{
sha512sum "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}" sha512sum "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}"
echo -e "\n\npress ENTER to exit ..." echo -en "\n\n$VTLANG_ENTER_EXIT ..."
read vtInputKey read vtInputKey
} }
fi fi
menuentry 'Return to previous menu [Esc]' --class=vtoyret VTOY_RET { menuentry "$VTLANG_RETURN_PREVIOUS" --class=vtoyret VTOY_RET {
echo 'Return ...' echo 'Return ...'
} }

View File

@@ -1,11 +1,61 @@
#
# VTLANG_CTRL_TEMP_SET must be the first
# And the inside item order can not be changed
#
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 \
VTOY_RUN_SET0 {
if [ "$VTOY_WIN11_BYPASS_CHECK" = "0" ]; then
set VTOY_WIN11_BYPASS_CHECK=1
else
set VTOY_WIN11_BYPASS_CHECK=0
fi
}
menuentry "[ $VTOY_WIN11_BYPASS_NRO ] $VTLANG_WIN11_BYPASS_NRO" --class=debug_temp_win11_nro --class=debug_temp_set --class=F5tool \
VTOY_RUN_SET1 {
if [ "$VTOY_WIN11_BYPASS_NRO" = "0" ]; then
set VTOY_WIN11_BYPASS_NRO=1
else
set VTOY_WIN11_BYPASS_NRO=0
fi
}
menuentry "[ $VTOY_LINUX_REMOUNT ] $VTLANG_LINUX_REMOUNT" --class=debug_temp_linux_remount --class=debug_temp_set --class=F5tool \
VTOY_RUN_SET2 {
if [ "$VTOY_LINUX_REMOUNT" = "0" ]; then
set VTOY_LINUX_REMOUNT=1
else
set VTOY_LINUX_REMOUNT=0
fi
}
menuentry "[ $VTOY_SECONDARY_BOOT_MENU ] $VTLANG_SECONDARY_BOOT_MENU" --class=debug_temp_second_menu --class=debug_temp_set --class=F5tool \
VTOY_RUN_SET3 {
if [ "$VTOY_SECONDARY_BOOT_MENU" = "0" ]; then
set VTOY_SECONDARY_BOOT_MENU=1
else
set VTOY_SECONDARY_BOOT_MENU=0
fi
}
menuentry "$VTLANG_RETURN_PREVIOUS" --class=vtoyret VTOY_RET {
echo "Return ..."
}
}
submenu "$VTLANG_MENU_LANG" --class=debug_menu_lang --class=F5tool {
source $prefix/menulang.cfg
}
source $prefix/power.cfg source $prefix/power.cfg
source $prefix/hwinfo.cfg source $prefix/hwinfo.cfg
source $prefix/keyboard.cfg source $prefix/keyboard.cfg
submenu "Resolution Configuration" --class=debug_resolution --class=F5tool { submenu "$VTLANG_RESOLUTION_CFG" --class=debug_resolution --class=F5tool {
menuentry 'Return to previous menu [Esc]' --class=vtoyret VTOY_RET { menuentry "$VTLANG_RETURN_PREVIOUS" --class=vtoyret VTOY_RET {
echo 'Return ...' echo "Return ..."
} }
vt_update_cur_video_mode VT_CUR_MODE vt_update_cur_video_mode VT_CUR_MODE
@@ -21,201 +71,197 @@ submenu "Resolution Configuration" --class=debug_resolution --class=F5tool {
menuentry "$vtCurMode $vtActive" --class=debug_videomode --class=debug_resolution --class=F5tool VTOY_RUN_RET { menuentry "$vtCurMode $vtActive" --class=debug_videomode --class=debug_resolution --class=F5tool VTOY_RUN_RET {
terminal_output console terminal_output console
set gfxmode=$1 set gfxmode=$1
terminal_output gfxterm terminal_output gfxterm
if [ "$vtoy_res_fit" = "1" ]; then
vt_set_theme switch
fi
} }
vt_incr vdid 1 vt_incr vdid 1
done done
} }
submenu "Screen Display Mode" --class=debug_screen_mode --class=F5tool { submenu "$VTLANG_SCREEN_MODE" --class=debug_screen_mode --class=F5tool {
menuentry 'Force Text Mode' --class=debug_text_mode --class=debug_screen_mode --class=F5tool { menuentry "$VTLANG_SCREEN_TEXT_MODE" --class=debug_text_mode --class=debug_screen_mode --class=F5tool {
vt_push_menu_lang en_US
terminal_output console terminal_output console
} }
menuentry 'Force Graphics Mode' --class=debug_gui_mode --class=debug_screen_mode --class=F5tool { menuentry "$VTLANG_SCREEN_GUI_MODE" --class=debug_gui_mode --class=debug_screen_mode --class=F5tool {
terminal_output gfxterm terminal_output gfxterm
vt_pop_menu_lang
} }
menuentry 'Return to previous menu [Esc]' --class=vtoyret VTOY_RET { menuentry "$VTLANG_RETURN_PREVIOUS" --class=vtoyret VTOY_RET {
echo 'Return ...' echo "Return ..."
} }
} }
if [ $VTOY_THEME_COUNT -gt 1 ]; then if [ -n "$VTOY_THEME_COUNT" -a $VTOY_THEME_COUNT -gt 1 ]; then
submenu "Theme Select" --class=debug_theme_select --class=F5tool { submenu "$VTLANG_THEME_SELECT" --class=debug_theme_select --class=F5tool {
vt_select_theme_cfg vt_select_theme_cfg
} }
fi fi
if [ "$grub_platform" != "pc" ]; then if [ "$grub_platform" != "pc" ]; then
submenu 'Ventoy UEFI Utilities' --class=debug_util --class=F5tool { submenu "$VTLANG_UEFI_UTIL" --class=debug_util --class=F5tool {
menuentry 'Show EFI Drivers' --class=debug_util_efidrv --class=debug_util --class=F5tool { menuentry "$VTLANG_UTIL_SHOW_EFI_DRV" --class=debug_util_efidrv --class=debug_util --class=F5tool {
vt_push_pager vt_push_pager
chainloader ${vtoy_path}/vtoyutil_${VTOY_EFI_ARCH}.efi env_param=${env_param} ${vtdebug_flag} feature=show_efi_drivers chainloader ${vtoy_path}/vtoyutil_${VTOY_EFI_ARCH}.efi env_param=${env_param} ${vtdebug_flag} feature=show_efi_drivers
boot boot
vt_pop_pager vt_pop_pager
echo -e "\npress ENTER to exit ..." echo -en "\n$VTLANG_ENTER_EXIT ..."
read vtInputKey read vtInputKey
} }
menuentry 'Fixup Windows BlinitializeLibrary Failure' --class=debug_util_blinit --class=debug_util --class=F5tool { menuentry "$VTLANG_UTIL_FIX_BLINIT_FAIL" --class=debug_util_blinit --class=debug_util --class=F5tool {
chainloader ${vtoy_path}/vtoyutil_${VTOY_EFI_ARCH}.efi env_param=${env_param} ${vtdebug_flag} feature=fix_windows_mmap chainloader ${vtoy_path}/vtoyutil_${VTOY_EFI_ARCH}.efi env_param=${env_param} ${vtdebug_flag} feature=fix_windows_mmap
boot boot
echo -e "\npress ENTER to exit ..." echo -en "\n$VTLANG_ENTER_EXIT ..."
read vtInputKey read vtInputKey
} }
menuentry 'Return to previous menu [Esc]' --class=vtoyret VTOY_RET { menuentry "$VTLANG_RETURN_PREVIOUS" --class=vtoyret VTOY_RET {
echo 'Return ...' echo "Return ..."
} }
} }
fi fi
submenu 'Check plugin json configuration (ventoy.json)' --class=debug_json --class=F5tool { submenu "$VTLANG_JSON_CHK_JSON" --class=debug_json --class=F5tool {
menuentry 'Check global control plugin configuration' --class=debug_control --class=debug_json --class=F5tool { menuentry "$VTLANG_JSON_CHK_CONTROL" --class=debug_control --class=debug_json --class=F5tool {
set pager=1 set pager=1
vt_check_plugin_json $vt_plugin_path control $vtoy_iso_part vt_check_plugin_json $vt_plugin_path control $vtoy_iso_part
echo -e "\npress ENTER to exit ..." echo -en "\n$VTLANG_ENTER_EXIT ..."
read vtInputKey read vtInputKey
unset pager unset pager
} }
menuentry 'Check theme plugin configuration' --class=debug_theme --class=debug_json --class=F5tool { menuentry "$VTLANG_JSON_CHK_THEME" --class=debug_theme --class=debug_json --class=F5tool {
set pager=1 set pager=1
vt_check_plugin_json $vt_plugin_path theme $vtoy_iso_part vt_check_plugin_json $vt_plugin_path theme $vtoy_iso_part
echo -e "\npress ENTER to exit ..." echo -en "\n$VTLANG_ENTER_EXIT ..."
read vtInputKey read vtInputKey
unset pager unset pager
} }
menuentry 'Check auto install plugin configuration' --class=debug_autoinstall --class=debug_json --class=F5tool { menuentry "$VTLANG_JSON_CHK_AUTOINS" --class=debug_autoinstall --class=debug_json --class=F5tool {
set pager=1 set pager=1
vt_check_plugin_json $vt_plugin_path auto_install $vtoy_iso_part vt_check_plugin_json $vt_plugin_path auto_install $vtoy_iso_part
echo -e "\npress ENTER to exit ..." echo -en "\n$VTLANG_ENTER_EXIT ..."
read vtInputKey read vtInputKey
unset pager unset pager
} }
menuentry 'Check persistence plugin configuration' --class=debug_persistence --class=debug_json --class=F5tool { menuentry "$VTLANG_JSON_CHK_PERSIST" --class=debug_persistence --class=debug_json --class=F5tool {
set pager=1 set pager=1
vt_check_plugin_json $vt_plugin_path persistence $vtoy_iso_part vt_check_plugin_json $vt_plugin_path persistence $vtoy_iso_part
echo -e "\n############### dump persistence ###############" echo -e "\n############### dump persistence ###############"
vt_dump_persistence vt_dump_persistence
echo -e "\npress ENTER to exit ..." echo -en "\n$VTLANG_ENTER_EXIT ..."
read vtInputKey read vtInputKey
unset pager unset pager
} }
menuentry 'Check menu alias plugin configuration' --class=debug_menualias --class=debug_json --class=F5tool { menuentry "$VTLANG_JSON_CHK_MENU_ALIAS" --class=debug_menualias --class=debug_json --class=F5tool {
set pager=1 set pager=1
vt_check_plugin_json $vt_plugin_path menu_alias $vtoy_iso_part vt_check_plugin_json $vt_plugin_path menu_alias $vtoy_iso_part
echo -e "\npress ENTER to exit ..." echo -en "\n$VTLANG_ENTER_EXIT ..."
read vtInputKey read vtInputKey
unset pager unset pager
} }
menuentry 'Check menu tip plugin configuration' --class=debug_menutip --class=debug_json --class=F5tool { menuentry "$VTLANG_JSON_CHK_MENU_TIP" --class=debug_menutip --class=debug_json --class=F5tool {
set pager=1 set pager=1
vt_check_plugin_json $vt_plugin_path menu_tip $vtoy_iso_part vt_check_plugin_json $vt_plugin_path menu_tip $vtoy_iso_part
echo -e "\npress ENTER to exit ..." echo -en "\n$VTLANG_ENTER_EXIT ..."
read vtInputKey read vtInputKey
unset pager unset pager
} }
menuentry 'Check menu class plugin configuration' --class=debug_menuclass --class=debug_json --class=F5tool { menuentry "$VTLANG_JSON_CHK_MENU_CLASS" --class=debug_menuclass --class=debug_json --class=F5tool {
set pager=1 set pager=1
vt_check_plugin_json $vt_plugin_path menu_class $vtoy_iso_part vt_check_plugin_json $vt_plugin_path menu_class $vtoy_iso_part
echo -e "\npress ENTER to exit ..." echo -en "\n$VTLANG_ENTER_EXIT ..."
read vtInputKey read vtInputKey
unset pager unset pager
} }
menuentry 'Check injection plugin configuration' --class=debug_injection --class=debug_json --class=F5tool { menuentry "$VTLANG_JSON_CHK_INJECTION" --class=debug_injection --class=debug_json --class=F5tool {
set pager=1 set pager=1
vt_check_plugin_json $vt_plugin_path injection $vtoy_iso_part vt_check_plugin_json $vt_plugin_path injection $vtoy_iso_part
echo -e "\npress ENTER to exit ..." echo -en "\n$VTLANG_ENTER_EXIT ..."
read vtInputKey read vtInputKey
unset pager unset pager
} }
menuentry 'Check auto memdisk plugin configuration' --class=debug_automemdisk --class=debug_json --class=F5tool { menuentry "$VTLANG_JSON_CHK_AUTO_MEMDISK" --class=debug_automemdisk --class=debug_json --class=F5tool {
set pager=1 set pager=1
vt_check_plugin_json $vt_plugin_path auto_memdisk $vtoy_iso_part vt_check_plugin_json $vt_plugin_path auto_memdisk $vtoy_iso_part
echo -e "\npress ENTER to exit ..." echo -en "\n$VTLANG_ENTER_EXIT ..."
read vtInputKey read vtInputKey
unset pager unset pager
} }
menuentry 'Check image list plugin configuration' --class=debug_imagelist --class=debug_json --class=F5tool { menuentry "$VTLANG_JSON_CHK_IMG_LIST" --class=debug_imagelist --class=debug_json --class=F5tool {
set pager=1 set pager=1
vt_check_plugin_json $vt_plugin_path image_list $vtoy_iso_part vt_check_plugin_json $vt_plugin_path image_list $vtoy_iso_part
echo -e "\npress ENTER to exit ..." echo -en "\n$VTLANG_ENTER_EXIT ..."
read vtInputKey read vtInputKey
unset pager unset pager
} }
menuentry 'Check image blacklist plugin configuration' --class=debug_imageblacklist --class=debug_json --class=F5tool { menuentry "$VTLANG_JSON_CHK_IMG_BLIST" --class=debug_imageblacklist --class=debug_json --class=F5tool {
set pager=1 set pager=1
vt_check_plugin_json $vt_plugin_path image_blacklist $vtoy_iso_part vt_check_plugin_json $vt_plugin_path image_blacklist $vtoy_iso_part
echo -e "\npress ENTER to exit ..." echo -en "\n$VTLANG_ENTER_EXIT ..."
read vtInputKey read vtInputKey
unset pager unset pager
} }
menuentry 'Check boot conf replace plugin configuration' --class=debug_bootconf_replace --class=debug_json --class=F5tool { menuentry "$VTLANG_JSON_CHK_CONF_REPLACE" --class=debug_bootconf_replace --class=debug_json --class=F5tool {
set pager=1 set pager=1
vt_check_plugin_json $vt_plugin_path conf_replace $vtoy_iso_part vt_check_plugin_json $vt_plugin_path conf_replace $vtoy_iso_part
echo -e "\npress ENTER to exit ..." echo -en "\n$VTLANG_ENTER_EXIT ..."
read vtInputKey read vtInputKey
unset pager unset pager
} }
menuentry 'Check dud plugin configuration' --class=debug_dud --class=debug_json --class=F5tool { menuentry "$VTLANG_JSON_CHK_DUD" --class=debug_dud --class=debug_json --class=F5tool {
set pager=1 set pager=1
vt_check_plugin_json $vt_plugin_path dud $vtoy_iso_part vt_check_plugin_json $vt_plugin_path dud $vtoy_iso_part
echo -e "\npress ENTER to exit ..." echo -en "\n$VTLANG_ENTER_EXIT ..."
read vtInputKey read vtInputKey
unset pager unset pager
} }
menuentry 'Check password plugin configuration' --class=debug_pwd --class=debug_json --class=F5tool { menuentry "$VTLANG_JSON_CHK_PASSWORD" --class=debug_pwd --class=debug_json --class=F5tool {
set pager=1 set pager=1
vt_check_plugin_json $vt_plugin_path password $vtoy_iso_part vt_check_plugin_json $vt_plugin_path password $vtoy_iso_part
echo -e "\npress ENTER to exit ..." echo -en "\n$VTLANG_ENTER_EXIT ..."
read vtInputKey read vtInputKey
unset pager unset pager
} }
menuentry 'Check custom boot plugin configuration' --class=debug_custom_boot --class=debug_json --class=F5tool { menuentry "$VTLANG_RETURN_PREVIOUS" --class=vtoyret VTOY_RET {
set pager=1 echo "Return ..."
vt_check_plugin_json $vt_plugin_path custom_boot $vtoy_iso_part
echo -e "\npress ENTER to exit ..."
read vtInputKey
unset pager
}
menuentry 'Return to previous menu [Esc]' --class=vtoyret VTOY_RET {
echo 'Return ...'
} }
} }
menuentry 'Return to previous menu [Esc]' --class=vtoyret VTOY_RET { menuentry "$VTLANG_RETURN_PREVIOUS" --class=vtoyret VTOY_RET {
echo 'Return ...' echo "Return ..."
} }

View File

@@ -0,0 +1,15 @@
set label="writable"
menuentry 'Firmware Test Suite' --class ubuntu --class gnu-linux --class gnu --class os {
set root='vtimghd,4'
linux /boot/vmlinuz root=LABEL=$label ro console=tty1 console=ttyS0 quiet
initrd /boot/initrd.img
}
menuentry 'Firmware Test Suite (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
set root='vtimghd,4'
echo 'Loading Linux ...'
linux /boot/vmlinuz root=LABEL=$label ro recovery nomodeset
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img
}

View File

@@ -16,6 +16,11 @@
# #
#************************************************************************************ #************************************************************************************
if [ "$grub_platform" = "pc" ]; then
insmod setkey
insmod regexp
fi
function ventoy_pause { function ventoy_pause {
echo "press Enter to continue ......" echo "press Enter to continue ......"
read vtTmpPause read vtTmpPause
@@ -65,6 +70,10 @@ function ventoy_vcfg_proc {
fi fi
} }
function ventoy_language {
configfile $prefix/menulang.cfg
}
function ventoy_diagnosis { function ventoy_diagnosis {
vt_enum_video_mode vt_enum_video_mode
configfile $prefix/debug.cfg configfile $prefix/debug.cfg
@@ -81,7 +90,7 @@ function ventoy_ext_menu {
unset ventoy_new_context unset ventoy_new_context
else else
echo "ventoy_grub.cfg NOT exist." echo "ventoy_grub.cfg NOT exist."
echo -e "\npress ENTER to exit ..." echo -en "\n$VTLANG_ENTER_EXIT ..."
read vtInputKey read vtInputKey
fi fi
} }
@@ -99,8 +108,9 @@ function ventoy_show_help {
fi fi
loopback vt_help_tarfs mem:${vtoy_help_txt_mem_addr}:size:${vtoy_help_txt_mem_size} loopback vt_help_tarfs mem:${vtoy_help_txt_mem_addr}:size:${vtoy_help_txt_mem_size}
if [ -f "(vt_help_tarfs)/help/${VTOY_HELP_TXT_LANGUAGE}.txt" ]; then vt_cur_menu_lang vtCurLang
cat "(vt_help_tarfs)/help/${VTOY_HELP_TXT_LANGUAGE}.txt" if [ -f "(vt_help_tarfs)/help/${vtCurLang}.txt" ]; then
cat "(vt_help_tarfs)/help/${vtCurLang}.txt"
else else
cat "(vt_help_tarfs)/help/en_US.txt" cat "(vt_help_tarfs)/help/en_US.txt"
fi fi
@@ -108,9 +118,15 @@ function ventoy_show_help {
fi fi
} }
function ventoy_load_menu_lang_file {
vt_load_file_to_mem "auto" $prefix/menu.tar.gz vtoy_menu_lang_mem
loopback vt_menu_tarfs mem:${vtoy_menu_lang_mem_addr}:size:${vtoy_menu_lang_mem_size}
}
function get_os_type { function get_os_type {
set vtoy_os=Linux set vtoy_os=Linux
export vtoy_os
if vt_str_begin "$vt_volume_id" "DLC Boot"; then if vt_str_begin "$vt_volume_id" "DLC Boot"; then
if [ -f (loop)/DLCBoot.exe ]; then if [ -f (loop)/DLCBoot.exe ]; then
set vtoy_os=Windows set vtoy_os=Windows
@@ -158,7 +174,7 @@ function get_os_type {
function vt_check_compatible_pe { function vt_check_compatible_pe {
#Check for PE without external tools #Check for PE without external tools
#set compatible if ISO file is less than 80MB #set compatible if ISO file is less than 80MB
if [ $vt_chosen_size -gt 33554432 -a $vt_chosen_size -le 83886080 ]; then if [ $vt_chosen_size -GT 33554432 -a $vt_chosen_size -LE 83886080 ]; then
set ventoy_compatible=YES set ventoy_compatible=YES
fi fi
@@ -211,6 +227,8 @@ function distro_specify_wim_patch {
function distro_specify_wim_patch_phase2 { function distro_specify_wim_patch_phase2 {
if [ -f (loop)/boot/boot.wim ]; then if [ -f (loop)/boot/boot.wim ]; then
vt_windows_collect_wim_patch wim /boot/boot.wim vt_windows_collect_wim_patch wim /boot/boot.wim
elif [ -f (loop)/sources/boot.wim ]; then
vt_windows_collect_wim_patch wim /sources/boot.wim
fi fi
if vt_str_begin "$vt_volume_id" "DLC Boot"; then if vt_str_begin "$vt_volume_id" "DLC Boot"; then
@@ -381,7 +399,11 @@ function distro_specify_initrd_file_phase2 {
vt_linux_specify_initrd_file /sysresccd/boot/i686/sysresccd.img vt_linux_specify_initrd_file /sysresccd/boot/i686/sysresccd.img
elif [ -f (loop)/boot/full.cz ]; then elif [ -f (loop)/boot/full.cz ]; then
vt_linux_specify_initrd_file /boot/full.cz vt_linux_specify_initrd_file /boot/full.cz
elif [ -f (loop)/images/pxeboot/initrd.img ]; then
vt_linux_specify_initrd_file /images/pxeboot/initrd.img
elif [ -f (loop)/live/initrd ]; then
vt_linux_specify_initrd_file /live/initrd
fi fi
} }
@@ -391,10 +413,9 @@ function ventoy_get_ghostbsd_ver {
} }
function ventoy_get_furybsd_ver { function ventoy_get_furybsd_ver {
if regexp "13\.[0-9]" "$2"; then set vt_freebsd_ver=12.x
set vt_freebsd_ver=13.x if regexp --set 1:vtFuryVer "(14|13)\.[0-9]" "$2"; then
else set vt_freebsd_ver=${vtFuryVer}.x
set vt_freebsd_ver=12.x
fi fi
} }
@@ -403,12 +424,8 @@ function ventoy_get_freenas_ver {
if [ -e (loop)/FreeNAS-MANIFEST ]; then if [ -e (loop)/FreeNAS-MANIFEST ]; then
vt_parse_freenas_ver (loop)/FreeNAS-MANIFEST vt_freenas_ver vt_parse_freenas_ver (loop)/FreeNAS-MANIFEST vt_freenas_ver
if regexp "^13\.[0-9]" "$vt_freenas_ver"; then if regexp --set 1:vtNasVer "^(14|13|12|11)\.[0-9]" "$vt_freenas_ver"; then
set vt_freebsd_ver=13.x set vt_freebsd_ver=${vtNasVer}.x
elif regexp "^12\.[0-9]" "$vt_freenas_ver"; then
set vt_freebsd_ver=12.x
elif regexp "^11\.[0-9]" "$vt_freenas_ver"; then
set vt_freebsd_ver=11.x
fi fi
fi fi
} }
@@ -418,12 +435,8 @@ function ventoy_get_truenas_ver {
if [ -e (loop)/TrueNAS-MANIFEST ]; then if [ -e (loop)/TrueNAS-MANIFEST ]; then
vt_parse_freenas_ver (loop)/TrueNAS-MANIFEST vt_truenas_ver vt_parse_freenas_ver (loop)/TrueNAS-MANIFEST vt_truenas_ver
if regexp "^13\.[0-9]" "$vt_truenas_ver"; then if regexp --set 1:vtTNasVer "^(14|13|12|11)\.[0-9]" "$vt_truenas_ver"; then
set vt_freebsd_ver=13.x set vt_freebsd_ver=${vtTNasVer}.x
elif regexp "^12\.[0-9]" "$vt_truenas_ver"; then
set vt_freebsd_ver=12.x
elif regexp "^11\.[0-9]" "$vt_truenas_ver"; then
set vt_freebsd_ver=11.x
fi fi
fi fi
} }
@@ -455,49 +468,25 @@ 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 "^13_[0-9]" "$vt_volume_id"; then elif regexp --set 1:vtBsdVerNum "^(14|13|12|11|10|9)_[0-9]" "$vt_volume_id"; then
set vt_freebsd_ver=13.x set vt_freebsd_ver=${vtBsdVerNum}.x
elif regexp "^12_[0-9]" "$vt_volume_id"; then
set vt_freebsd_ver=12.x
elif regexp "^11_[0-9]" "$vt_volume_id"; then
set vt_freebsd_ver=11.x
elif regexp "^10_[0-9]" "$vt_volume_id"; then
set vt_freebsd_ver=10.x
elif regexp "^9_[0-9]" "$vt_volume_id"; then
set vt_freebsd_ver=9.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 "\"13\.[0-9]-" "$vt_userland_ver"; then if regexp --set 1:vtBsdVerNum "\"(14|13|12|11|10|9)\.[0-9]-" "$vt_userland_ver"; then
set vt_freebsd_ver=13.x set vt_freebsd_ver=${vtBsdVerNum}.x
elif regexp "\"12\.[0-9]-" "$vt_userland_ver"; then fi
set vt_freebsd_ver=12.x
elif regexp "\"11\.[0-9]-" "$vt_userland_ver"; then
set vt_freebsd_ver=11.x
elif regexp "\"10\.[0-9]-" "$vt_userland_ver"; then
set vt_freebsd_ver=10.x
elif regexp "\"9\.[0-9]-" "$vt_userland_ver"; then
set vt_freebsd_ver=9.x
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 "FreeBSD 13\.[0-9]-" "$vt_freebsd_line1"; then if regexp --set 1:vtBsdVerNum "FreeBSD (14|13|12|11|10|9)\.[0-9]-" "$vt_freebsd_line1"; then
set vt_freebsd_ver=13.x set vt_freebsd_ver=${vtBsdVerNum}.x
elif regexp "FreeBSD 12\.[0-9]-" "$vt_freebsd_line1"; then
set vt_freebsd_ver=12.x
elif regexp "FreeBSD 11\.[0-9]-" "$vt_freebsd_line1"; then
set vt_freebsd_ver=11.x
elif regexp "FreeBSD 10\.[0-9]-" "$vt_freebsd_line1"; then
set vt_freebsd_ver=10.x
elif regexp "FreeBSD 9\.[0-9]-" "$vt_freebsd_line1"; then
set vt_freebsd_ver=9.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
fi fi
if [ -e (loop)/usr/freebsd-dist/cloninst.sh ]; then if [ -e (loop)/usr/freebsd-dist/cloninst.sh ]; then
set vtFreeBsdDistro=ClonOS set vtFreeBsdDistro=ClonOS
@@ -521,7 +510,7 @@ function ventoy_freebsd_proc {
fi fi
if [ "$vt_freebsd_ver" = "xx" ]; then if [ "$vt_freebsd_ver" = "xx" ]; then
set vt_freebsd_ver=13.x set vt_freebsd_ver=14.x
fi fi
fi fi
@@ -597,8 +586,12 @@ function ventoy_unix_comm_proc {
function uefi_windows_menu_func { function uefi_windows_menu_func {
vt_windows_reset vt_windows_reset
if [ "$ventoy_compatible" = "NO" ]; then unset vt_cur_wimboot_mode
if vt_check_mode 4 "$vt_chosen_name"; then
set vt_cur_wimboot_mode=1
fi
if [ "$ventoy_compatible" = "NO" -o "$vt_cur_wimboot_mode" = "1" ]; then
if [ "$ventoy_fs_probe" = "iso9660" ]; then if [ "$ventoy_fs_probe" = "iso9660" ]; then
loopback -d loop loopback -d loop
vt_iso9660_nojoliet 1 vt_iso9660_nojoliet 1
@@ -617,14 +610,14 @@ function uefi_windows_menu_func {
ventoy_debug_pause ventoy_debug_pause
locate_wim "${chosen_path}" locate_wim "${chosen_path}"
fi fi
vt_windows_chain_data "${1}${chosen_path}" vt_windows_chain_data "${1}${chosen_path}"
ventoy_debug_pause ventoy_debug_pause
if vt_check_mode 4 "$vt_chosen_name"; then if [ "$vt_cur_wimboot_mode" = "1" ]; then
vtoy_windows_wimboot_func vtoy_wimboot_func
fi fi
if [ -n "$vtoy_chain_mem_addr" ]; then if [ -n "$vtoy_chain_mem_addr" ]; then
ventoy_acpi_param ${vtoy_chain_mem_addr} 2048 ventoy_acpi_param ${vtoy_chain_mem_addr} 2048
ventoy_cli_console ventoy_cli_console
@@ -768,7 +761,7 @@ function uefi_linux_menu_func {
vt_linux_chain_data "${1}${chosen_path}" vt_linux_chain_data "${1}${chosen_path}"
if [ -n "$LoadIsoEfiDriver" -a $vt_chosen_size -lt 104857600 ]; then if [ -n "$LoadIsoEfiDriver" -a $vt_chosen_size -LT 104857600 ]; then
if [ -f (loop)/efi/clover/cloverx64.efi ]; then if [ -f (loop)/efi/clover/cloverx64.efi ]; then
unset LoadIsoEfiDriver unset LoadIsoEfiDriver
fi fi
@@ -781,6 +774,10 @@ function uefi_linux_menu_func {
unset vtGrub2Mode unset vtGrub2Mode
if vt_check_mode 3 "$vt_chosen_name"; then if vt_check_mode 3 "$vt_chosen_name"; then
set vtGrub2Mode=1 set vtGrub2Mode=1
elif vt_str_begin "$vt_volume_id" "HOLO_"; then
if [ -d (loop)/loader/entries ]; then
set vtGrub2Mode=1
fi
elif vt_str_begin "$vt_volume_id" "KRD"; then elif vt_str_begin "$vt_volume_id" "KRD"; then
if [ -f (loop)/boot/grub/grub.cfg.sig ]; then if [ -f (loop)/boot/grub/grub.cfg.sig ]; then
set vtGrub2Mode=1 set vtGrub2Mode=1
@@ -814,6 +811,28 @@ function uefi_linux_menu_func {
break break
fi fi
done done
if [ $vtback_cfg_find -eq 0 ]; then
if [ -f (loop)/loader/loader.conf -a -d (loop)/loader/entries ]; then
if vt_str_begin "$vt_volume_id" "HOLO_"; then
set root=(loop,2)
vt_systemd_menu (loop,2) vt_sys_menu_mem
else
vt_systemd_menu (loop) vt_sys_menu_mem
fi
set vtback_cfg_find=1
configfile "mem:${vt_sys_menu_mem_addr}:size:${vt_sys_menu_mem_size}"
fi
fi
if [ $vtback_cfg_find -eq 0 ]; then
if [ -f (loop)/boot/isolinux/syslnx64.cfg ]; then
syslinux_configfile (loop)/boot/isolinux/syslnx64.cfg
set vtback_cfg_find=1
elif [ -f (loop)/boot/syslinux/porteus.cfg ]; then
syslinux_configfile (loop)/boot/syslinux/porteus.cfg
set vtback_cfg_find=1
fi
fi
if [ "$vtback_cfg_find" = "0" ]; then if [ "$vtback_cfg_find" = "0" ]; then
echo " " echo " "
@@ -859,11 +878,6 @@ function ventoy_reset_nojoliet {
} }
function uefi_iso_menu_func { function uefi_iso_menu_func {
if [ -d (loop)/ ]; then
loopback -d loop
fi
if [ -n "$vtisouefi" ]; then if [ -n "$vtisouefi" ]; then
set LoadIsoEfiDriver=on set LoadIsoEfiDriver=on
unset vtisouefi unset vtisouefi
@@ -877,21 +891,13 @@ function uefi_iso_menu_func {
vt_select_auto_install "${chosen_path}" vt_select_auto_install "${chosen_path}"
vt_select_persistence "${chosen_path}" vt_select_persistence "${chosen_path}"
if vt_is_udf "${1}${chosen_path}"; then if ! vt_is_udf "${1}${chosen_path}"; then
set ventoy_fs_probe=udf
else
set ventoy_fs_probe=iso9660
ventoy_reset_nojoliet
# Lenovo EasyStartup need an addional sector for boundary check # Lenovo EasyStartup need an addional sector for boundary check
if vt_str_begin "$vt_volume_id" "EasyStartup"; then if vt_str_begin "$vt_volume_id" "EasyStartup"; then
vt_skip_svd "${vtoy_iso_part}${vt_chosen_path}" vt_skip_svd "${vtoy_iso_part}${vt_chosen_path}"
vt_append_extra_sector 1 vt_append_extra_sector 1
fi fi
fi fi
loopback loop "${1}${chosen_path}"
get_os_type (loop)
if [ -d (loop)/EFI ]; then if [ -d (loop)/EFI ]; then
set vt_efi_dir=YES set vt_efi_dir=YES
@@ -926,7 +932,7 @@ function uefi_iso_menu_func {
uefi_linux_menu_func "$1" "${chosen_path}" uefi_linux_menu_func "$1" "${chosen_path}"
fi fi
ventoy_gui_console ventoy_gui_console
} }
function uefi_iso_memdisk { function uefi_iso_memdisk {
@@ -940,8 +946,7 @@ function uefi_iso_memdisk {
ventoy_gui_console ventoy_gui_console
} }
function vtoy_windows_wimboot {
function vtoy_windows_wimboot_func {
if [ -f (loop)/x86/sources/boot.wim -a -f (loop)/x64/sources/boot.wim ]; then if [ -f (loop)/x86/sources/boot.wim -a -f (loop)/x64/sources/boot.wim ]; then
vt_sel_wimboot vtoy_wimboot_bit vt_sel_wimboot vtoy_wimboot_bit
if [ "$vtoy_wimboot_bit" = "32" ]; then if [ "$vtoy_wimboot_bit" = "32" ]; then
@@ -959,43 +964,24 @@ function vtoy_windows_wimboot_func {
fi fi
if [ -n "${vtdebug_flag}" ]; then if [ -n "${vtdebug_flag}" ]; then
echo vtoy_wimboot_prefix=$vtoy_wimboot_prefix vtoy_wimboot_bit=$vtoy_wimboot_bit echo vtoy_wimboot_prefix=$vtoy_wimboot_prefix vtoy_wimboot_bit=$vtoy_wimboot_bit vt_wimkernel=$vt_wimkernel
fi fi
for wmfile in sources/boot.wim boot/bcd boot/boot.sdi; do vt_windows_wimboot_data "$vtoy_wimboot_prefix/sources/boot.wim" vtoy_init_exe vtoy_wim_bit
if [ ! -f $vtoy_wimboot_prefix/$wmfile ]; then
return
fi
done
if [ -f $vtoy_wimboot_prefix/sources/install.wim -o -f $vtoy_wimboot_prefix/sources/install.esd ]; then
vt_windows_wimboot_data
else
return
fi
if [ "$grub_platform" = "pc" ]; then if [ "$grub_platform" = "pc" ]; then
set vt_wimkernel=wimboot.x86_64.xz
linux16 "$vtoy_path/$vt_wimkernel" quiet linux16 "$vtoy_path/$vt_wimkernel" quiet
ventoy_debug_pause ventoy_debug_pause
vt_set_wim_load_prompt 1 "Loading files......" vt_set_wim_load_prompt 1 "Loading files......"
initrd16 newc:vtoyjump.exe:$vtoy_path/vtoyjump${vtoy_wimboot_bit}.exe \ initrd16 newc:winpeshl.exe:mem:${vtoy_wimboot_mem_addr}:size:${vtoy_wimboot_mem_size} \
newc:wimboot.data:mem:${vtoy_wimboot_mem_addr}:size:${vtoy_wimboot_mem_size} \ newc:vtoy_wimboot:$vtoy_wimboot_prefix/boot/bcd \
newc:winpeshl.ini:mem:${vtoy_winpeshl_ini_addr}:size:${vtoy_winpeshl_ini_size} \
newc:bcd:$vtoy_wimboot_prefix/boot/bcd \ newc:bcd:$vtoy_wimboot_prefix/boot/bcd \
newc:boot.sdi:$vtoy_wimboot_prefix/boot/boot.sdi \ newc:boot.sdi:$vtoy_wimboot_prefix/boot/boot.sdi \
newc:boot.wim:$vtoy_wimboot_prefix/sources/boot.wim newc:boot.wim:$vtoy_wimboot_prefix/sources/boot.wim
vt_set_wim_load_prompt 0 vt_set_wim_load_prompt 0
boot boot
else else
if [ "$grub_cpu" = "i386" ]; then
set vt_wimkernel=wimboot.i386.efi.xz
else
set vt_wimkernel=wimboot.x86_64.xz
fi
vt_set_wim_load_prompt 1 "Loading files......" vt_set_wim_load_prompt 1 "Loading files......"
vt_load_file_to_mem "nodecompress" $vtoy_wimboot_prefix/sources/boot.wim vtoy_wimfile_mem vt_load_file_to_mem "nodecompress" $vtoy_wimboot_prefix/sources/boot.wim vtoy_wimfile_mem
vt_set_wim_load_prompt 0 vt_set_wim_load_prompt 0
@@ -1008,9 +994,8 @@ function vtoy_windows_wimboot_func {
ventoy_cli_console ventoy_cli_console
chainloader "$vtoy_path/$vt_wimkernel" quiet \ chainloader "$vtoy_path/$vt_wimkernel" quiet \
"vf=wimboot.data:mem:${vtoy_wimboot_mem_addr}:size:${vtoy_wimboot_mem_size}" \ "vf=winpeshl.exe:mem:${vtoy_wimboot_mem_addr}:size:${vtoy_wimboot_mem_size}" \
"vf=winpeshl.ini:mem:${vtoy_winpeshl_ini_addr}:size:${vtoy_winpeshl_ini_size}" \ "vf=vtoy_wimboot:$vtoy_wimboot_prefix/boot/bcd" \
"vf=vtoyjump.exe:$vtoy_path/vtoyjump${vtoy_wimboot_bit}.exe" \
"vf=bcd:$vtoy_wimboot_prefix/boot/bcd" \ "vf=bcd:$vtoy_wimboot_prefix/boot/bcd" \
"vf=boot.sdi:$vtoy_wimboot_prefix/boot/boot.sdi" \ "vf=boot.sdi:$vtoy_wimboot_prefix/boot/boot.sdi" \
"vf=boot.wim:$vtoy_wimfile_path" \ "vf=boot.wim:$vtoy_wimfile_path" \
@@ -1021,11 +1006,125 @@ function vtoy_windows_wimboot_func {
fi fi
} }
function vtoy_winpe_wimboot {
unset vtoy_boot_sdi_legacy
unset vtoy_boot_sdi_efi
set vtoy_wimboot_prefix=(loop)
set vtoy_wim_path="$1"
if [ -n "${vtdebug_flag}" ]; then
echo "winpe_wimboot $1 $2 $3"
fi
if [ "$2" != "0" ]; then
set vtoy_boot_sdi_legacy="newc:boot.sdi:$vtoy_wimboot_prefix/$2"
set vtoy_boot_sdi_efi="vf=boot.sdi:$vtoy_wimboot_prefix/$2"
fi
vt_windows_wimboot_data $vtoy_wimboot_prefix/$vtoy_wim_path vtoy_init_exe vtoy_wim_bit
if [ "$grub_platform" = "pc" ]; then
linux16 "$vtoy_path/$vt_wimkernel" quiet
ventoy_debug_pause
vt_set_wim_load_prompt 1 "Loading files......"
initrd16 newc:$vtoy_init_exe:mem:${vtoy_wimboot_mem_addr}:size:${vtoy_wimboot_mem_size} \
newc:vtoy_wimboot:$vtoy_path/$vt_wimkernel \
newc:bootmgr.exe:mem:${vtoy_pe_bootmgr_mem_addr}:size:${vtoy_pe_bootmgr_mem_size} \
newc:bcd:mem:${vtoy_pe_bcd_mem_addr}:size:${vtoy_pe_bcd_mem_size} \
$vtoy_boot_sdi_legacy \
newc:boot.wim:$vtoy_wimboot_prefix/$vtoy_wim_path
vt_set_wim_load_prompt 0
boot
else
if [ "$VTOY_EFI_ARCH" = "x64" -a "$vtoy_wim_bit" = "32" ]; then
echo -e "\nThis is 32bit Windows and does NOT support x86_64 UEFI firmware.\n"
echo -e "这是32位的 Windows 系统不支持当前的64位 UEFI 环境。\n"
fi
vt_set_wim_load_prompt 1 "Loading files......"
vt_load_file_to_mem "nodecompress" $vtoy_wimboot_prefix/$vtoy_wim_path vtoy_wimfile_mem
vt_set_wim_load_prompt 0
if [ $? -eq 0 ]; then
set vtoy_wimfile_path=mem:${vtoy_wimfile_mem_addr}:size:${vtoy_wimfile_mem_size}
else
set vtoy_wimfile_path=$vtoy_wimboot_prefix/$vtoy_wim_path
fi
unset vtoy_boot_efi_path
if [ -F (loop)/efi/boot/boot${VTOY_EFI_ARCH}.efi ]; then
set vtoy_boot_efi_path="vf=bootx64.efi:(loop)/efi/boot/boot${VTOY_EFI_ARCH}.efi"
fi
ventoy_cli_console
chainloader "$vtoy_path/$vt_wimkernel" quiet \
"vf=$vtoy_init_exe:mem:${vtoy_wimboot_mem_addr}:size:${vtoy_wimboot_mem_size}" \
"vf=vtoy_wimboot:$vtoy_path/$vt_wimkernel" \
"vf=bcd:mem:${vtoy_pe_bcd_mem_addr}:size:${vtoy_pe_bcd_mem_size}" \
"$vtoy_boot_sdi_efi" \
"$vtoy_boot_efi_path" \
"vf=boot.wim:$vtoy_wimfile_path" \
pfsize=$vtoy_chain_file_size \
pfread=$vtoy_chain_file_read
boot
ventoy_gui_console
fi
}
function vtoy_wimboot_func {
if [ "$grub_platform" = "pc" ]; then
set vt_wimkernel=wimboot.x86_64.xz
else
if [ "$grub_cpu" = "i386" ]; then
set vt_wimkernel=wimboot.i386.efi.xz
else
set vt_wimkernel=wimboot.x86_64.xz
fi
fi
if vt_is_standard_winiso (loop); then
echo -e "\n==================== VENTOY WIMBOOT ==================\n"
vtoy_windows_wimboot
else
vt_sel_winpe_wim (loop)
if [ -n "$vtoy_pe_wim_path" ]; then
echo -e "\n==================== VENTOY WIMBOOT ==================\n"
vt_fs_ignore_case 1
vt_load_file_to_mem "auto" $vtoy_path/common_bcd.xz vtoy_pe_bcd_mem
set vt_sdi_path=0
for vsdi in "boot/boot.sdi" "2K10/FONTS/boot.sdi" "SSTR/boot.sdi" "ISPE/BOOT.SDI" \
"boot/uqi.sdi" "ISYL/boot.sdi" "WEPE/WEPE.SDI" ; do
if [ -F "(loop)/$vsdi" ]; then
set vt_sdi_path=$vsdi
break
fi
done
if [ "$grub_platform" = "pc" ]; then
vt_load_file_to_mem "auto" $vtoy_path/common_bootmgr.xz vtoy_pe_bootmgr_mem
vtoy_winpe_wimboot "$vtoy_pe_wim_path" "$vt_sdi_path" 1
else
vtoy_winpe_wimboot "$vtoy_pe_wim_path" "$vt_sdi_path" 0
fi
vt_fs_ignore_case 0
fi
fi
}
function legacy_windows_menu_func { function legacy_windows_menu_func {
vt_windows_reset vt_windows_reset
if [ "$ventoy_compatible" = "NO" ]; then unset vt_cur_wimboot_mode
if vt_check_mode 4 "$vt_chosen_name"; then
set vt_cur_wimboot_mode=1
fi
if [ "$ventoy_compatible" = "NO" -o "$vt_cur_wimboot_mode" = "1" ]; then
if [ "$ventoy_fs_probe" = "iso9660" ]; then if [ "$ventoy_fs_probe" = "iso9660" ]; then
loopback -d loop loopback -d loop
vt_iso9660_nojoliet 1 vt_iso9660_nojoliet 1
@@ -1043,15 +1142,17 @@ function legacy_windows_menu_func {
distro_specify_wim_patch_phase2 distro_specify_wim_patch_phase2
fi fi
ventoy_debug_pause ventoy_debug_pause
locate_wim "${chosen_path}" if [ -z "$vt_cur_wimboot_mode" ]; then
locate_wim "${chosen_path}"
fi
fi fi
vt_windows_chain_data "${1}${chosen_path}" vt_windows_chain_data "${1}${chosen_path}"
ventoy_debug_pause ventoy_debug_pause
if vt_check_mode 4 "$vt_chosen_name"; then if [ "$vt_cur_wimboot_mode" = "1" ]; then
vtoy_windows_wimboot_func vtoy_wimboot_func
fi fi
if [ -n "$vtoy_chain_mem_addr" ]; then if [ -n "$vtoy_chain_mem_addr" ]; then
@@ -1133,10 +1234,19 @@ function legacy_linux_menu_func {
ventoy_debug_pause ventoy_debug_pause
if [ -n "$vtoy_chain_mem_addr" ]; then if [ -n "$vtoy_chain_mem_addr" ]; then
unset vtGrub2Mode
if vt_check_mode 3 "$vt_chosen_name"; then if vt_check_mode 3 "$vt_chosen_name"; then
set vtGrub2Mode=1
elif vt_str_begin "$vt_volume_id" "HOLO_"; then
if [ -d (loop)/loader/entries ]; then
set vtGrub2Mode=1
fi
fi
if [ -n "$vtGrub2Mode" ]; then
ventoy_acpi_param ${vtoy_chain_mem_addr} 2048 ventoy_acpi_param ${vtoy_chain_mem_addr} 2048
ventoy_cli_console ventoy_cli_console
# fallback # fallback
set vtback_root=$root set vtback_root=$root
vt_push_last_entry vt_push_last_entry
@@ -1155,6 +1265,28 @@ function legacy_linux_menu_func {
break break
fi fi
done done
if [ $vtback_cfg_find -eq 0 ]; then
if [ -f (loop)/loader/loader.conf -a -d (loop)/loader/entries ]; then
if vt_str_begin "$vt_volume_id" "HOLO_"; then
set root=(loop,2)
vt_systemd_menu (loop,2) vt_sys_menu_mem
else
vt_systemd_menu (loop) vt_sys_menu_mem
fi
set vtback_cfg_find=1
configfile "mem:${vt_sys_menu_mem_addr}:size:${vt_sys_menu_mem_size}"
fi
fi
if [ $vtback_cfg_find -eq 0 ]; then
if [ -f (loop)/boot/isolinux/syslnx64.cfg ]; then
syslinux_configfile (loop)/boot/isolinux/syslnx64.cfg
set vtback_cfg_find=1
elif [ -f (loop)/boot/syslinux/porteus.cfg ]; then
syslinux_configfile (loop)/boot/syslinux/porteus.cfg
set vtback_cfg_find=1
fi
fi
vt_unset_boot_opt vt_unset_boot_opt
set root=$vtback_root set root=$vtback_root
@@ -1188,26 +1320,10 @@ function legacy_unix_menu_func {
function legacy_iso_menu_func { function legacy_iso_menu_func {
if [ -d (loop)/ ]; then
loopback -d loop
fi
set chosen_path="$2" set chosen_path="$2"
vt_select_auto_install "${chosen_path}" vt_select_auto_install "${chosen_path}"
vt_select_persistence "${chosen_path}" vt_select_persistence "${chosen_path}"
if vt_is_udf "${1}${chosen_path}"; then
set ventoy_fs_probe=udf
else
set ventoy_fs_probe=iso9660
ventoy_reset_nojoliet
fi
loopback loop "${1}${chosen_path}"
get_os_type (loop)
if [ -n "$vtcompat" ]; then if [ -n "$vtcompat" ]; then
set ventoy_compatible=YES set ventoy_compatible=YES
@@ -1233,6 +1349,7 @@ function legacy_iso_menu_func {
vt_check_compatible_linux (loop) vt_check_compatible_linux (loop)
legacy_linux_menu_func "$1" "${chosen_path}" legacy_linux_menu_func "$1" "${chosen_path}"
fi fi
vt_secondary_recover_mode
} }
function legacy_iso_memdisk { function legacy_iso_memdisk {
@@ -1307,13 +1424,13 @@ function iso_common_menuentry {
vt_chosen_img_path vt_chosen_path vt_chosen_size vt_chosen_name vt_chosen_img_path vt_chosen_path vt_chosen_size vt_chosen_name
vt_parse_iso_volume "${vtoy_iso_part}${vt_chosen_path}" vt_system_id vt_volume_id vt_volume_space vt_parse_iso_volume "${vtoy_iso_part}${vt_chosen_path}" vt_system_id vt_volume_id vt_volume_space
if [ $vt_volume_space -ne $vt_chosen_size ]; then if [ $vt_volume_space -NE $vt_chosen_size ]; then
vt_mod $vt_chosen_size 2048 vt_chosen_size_mod vt_mod $vt_chosen_size 2048 vt_chosen_size_mod
if [ $vt_chosen_size_mod -ne 0 ]; then if [ $vt_chosen_size_mod -ne 0 ]; then
echo -e "\n $vt_volume_space $vt_chosen_size $vt_chosen_size_mod\n" echo -e "\n $vt_volume_space $vt_chosen_size $vt_chosen_size_mod\n"
echo -e "\n The size of the iso file \"$vt_chosen_size\" is invalid. File corrupted ?\n" echo -e "\n The size of the iso file \"$vt_chosen_size\" is invalid. File corrupted ?\n"
echo -e " 此ISO文件的大小 \"$vt_chosen_size\" 有问题,请确认文件是否损坏。\n" echo -e " 此ISO文件的大小 \"$vt_chosen_size\" 有问题,请确认文件是否损坏。\n"
echo -e "\n press ENTER to continue (请按 回车 键继续) ..." echo -en "\n$VTLANG_ENTER_CONTINUE ..."
read vtInputKey read vtInputKey
fi fi
fi fi
@@ -1325,6 +1442,33 @@ function iso_common_menuentry {
if ventoy_vcfg_proc "${vt_chosen_path}"; then if ventoy_vcfg_proc "${vt_chosen_path}"; then
return return
fi fi
#secondary boot menu
if vt_is_udf "${vtoy_iso_part}${vt_chosen_path}"; then
set ventoy_fs_probe=udf
else
set ventoy_fs_probe=iso9660
ventoy_reset_nojoliet
fi
if [ -d (loop)/ ]; then
loopback -d loop
fi
loopback loop "${vtoy_iso_part}${vt_chosen_path}"
get_os_type (loop)
ventoy_debug_pause
if vt_need_secondary_menu "$vt_chosen_name"; then
vt_show_secondary_menu "$vt_chosen_path" "$vtoy_os" $vt_chosen_size
if [ "$VTOY_SECOND_EXIT" = "1" ]; then
return
fi
fi
if vt_str_begin "$vt_volume_id" "Avira"; then if vt_str_begin "$vt_volume_id" "Avira"; then
vt_skip_svd "${vtoy_iso_part}${vt_chosen_path}" vt_skip_svd "${vtoy_iso_part}${vt_chosen_path}"
@@ -1355,7 +1499,7 @@ function iso_common_menuentry {
fi fi
#For iKuai8 (<64MB) #For iKuai8 (<64MB)
if [ $vt_chosen_size -le 67108864 ]; then if [ $vt_chosen_size -LE 67108864 ]; then
if vt_str_begin "$vt_chosen_name" "iKuai"; then if vt_str_begin "$vt_chosen_name" "iKuai"; then
set vtMemDiskBoot=1 set vtMemDiskBoot=1
fi fi
@@ -1376,7 +1520,9 @@ function iso_common_menuentry {
else else
uefi_iso_menu_func $vtoy_iso_part "$vt_chosen_path" uefi_iso_menu_func $vtoy_iso_part "$vt_chosen_path"
fi fi
fi fi
vt_secondary_recover_mode
} }
function miso_common_menuentry { function miso_common_menuentry {
@@ -1401,7 +1547,7 @@ function miso_common_menuentry {
function common_unsupport_menuentry { function common_unsupport_menuentry {
echo -e "\n The name of the iso file could NOT contain space or non-ascii characters. \n" echo -e "\n The name of the iso file could NOT contain space or non-ascii characters. \n"
echo -e " 文件名中不能有中文或空格 \n" echo -e " 文件名中不能有中文或空格 \n"
echo -e "\npress ENTER to exit (请按 回车 键返回) ..." echo -en "\n$VTLANG_ENTER_EXIT ..."
read vtInputKey read vtInputKey
} }
@@ -1548,7 +1694,7 @@ function vhd_common_menuentry {
echo -e "!!! WARNING !!!\n" echo -e "!!! WARNING !!!\n"
echo -e "\nPartition1 ($vtoy_iso_fs) is NOT ntfs, the VHD(x) file may not boot normally \n" echo -e "\nPartition1 ($vtoy_iso_fs) is NOT ntfs, the VHD(x) file may not boot normally \n"
echo -e "\nVHD(x) 文件所在分区不是 ntfs 格式, 可能无法正常启动 \n\n" echo -e "\nVHD(x) 文件所在分区不是 ntfs 格式, 可能无法正常启动 \n\n"
echo -n "press ENTER to continue boot (请按 回车 键继续) ..." echo -en "\n$VTLANG_ENTER_CONTINUE ..."
read vtInputKey read vtInputKey
fi fi
fi fi
@@ -1657,7 +1803,7 @@ function vtoy_unsupport_menuentry {
function only_uefi_tip { function only_uefi_tip {
echo -e "\n This IMG file is only supported in UEFI mode. \n" echo -e "\n This IMG file is only supported in UEFI mode. \n"
echo -e "\n press ENTER to exit ..." echo -en "\n$VTLANG_ENTER_EXIT ..."
read vtInputKey read vtInputKey
} }
@@ -1689,6 +1835,41 @@ function ventoy_img_easyos {
loopback -d easysfs loopback -d easysfs
} }
function ventoy_img_easyos2 {
vt_load_cpio $vtoy_path "${vt_chosen_path}" ${vtoy_iso_part} "busybox=$ventoy_busybox_ver"
vt_trailer_cpio ${vtoy_iso_part} "${vt_chosen_path}" noinit
if [ -e (vtimghd,2)/easyos/easy.sfs ]; then
loopback easysfs (vtimghd,2)/easyos/easy.sfs
elif [ -d (vtimghd,2)/easyos/releases ]; then
vt_fs_enum_1st_dir (vtimghd,2) /easyos/releases/ vt_dir_name
loopback easysfs (vtimghd,2)/easyos/releases/$vt_dir_name/easy.sfs
fi
vt_get_lib_module_ver (easysfs) /lib/modules/ vt_module_ver
if [ -n "$vt_module_ver" ]; then
for mod in "kernel/drivers/md/dm-mod.ko" "kernel/drivers/dax/dax.ko"; do
if [ -e (easysfs)/lib/modules/$vt_module_ver/$mod ]; then
vt_img_extra_initrd_append (easysfs)/lib/modules/$vt_module_ver/$mod
fi
done
fi
ventoy_debug_pause
#boot image file
vt_set_boot_opt rdinit=/vtoy/vtoy
vt_img_hook_root
vt_limine_menu (vtimghd,1)/limine.cfg vt_sys_menu_mem
configfile "mem:${vt_sys_menu_mem_addr}:size:${vt_sys_menu_mem_size}"
vt_img_unhook_root
vt_unset_boot_opt
loopback -d easysfs
}
function ventoy_img_volumio { function ventoy_img_volumio {
vt_load_cpio $vtoy_path "${vt_chosen_path}" ${vtoy_iso_part} "busybox=$ventoy_busybox_ver" vt_load_cpio $vtoy_path "${vt_chosen_path}" ${vtoy_iso_part} "busybox=$ventoy_busybox_ver"
vt_trailer_cpio ${vtoy_iso_part} "${vt_chosen_path}" noinit vt_trailer_cpio ${vtoy_iso_part} "${vt_chosen_path}" noinit
@@ -1714,6 +1895,20 @@ function ventoy_img_openelec {
loopback vtloopex $vtoy_efi_part/ventoy/vtloopex.cpio loopback vtloopex $vtoy_efi_part/ventoy/vtloopex.cpio
vt_img_extra_initrd_append (vtloopex)/$elec_ver/vtloopex.tar.xz vt_img_extra_initrd_append (vtloopex)/$elec_ver/vtloopex.tar.xz
if [ "$elec_ver" = "LibreELEC" ]; then
if [ -f (vtimghd,1)/system ]; then
loopback elecsfs (vtimghd,1)/system
vt_get_lib_module_ver (elecsfs) /usr/lib/kernel-overlays/base/lib/modules/ vt_module_ver
if [ -n "$vt_module_ver" ]; then
for mod in "kernel/drivers/md/dm-mod.ko"; do
if [ -e (elecsfs)/usr/lib/kernel-overlays/base/lib/modules/$vt_module_ver/$mod ]; then
vt_img_extra_initrd_append (elecsfs)/usr/lib/kernel-overlays/base/lib/modules/$vt_module_ver/$mod
fi
done
fi
fi
fi
ventoy_debug_pause ventoy_debug_pause
#boot image file #boot image file
@@ -1726,6 +1921,7 @@ function ventoy_img_openelec {
vt_img_unhook_root vt_img_unhook_root
vt_unset_boot_opt vt_unset_boot_opt
loopback -d vtloopex loopback -d vtloopex
loopback -d elecsfs
} }
@@ -1797,7 +1993,7 @@ function ventoy_img_ubos {
} }
function ventoy_img_recalbox { function ventoy_img_recalbox {
if [ $vtoy_img_max_part_end -gt $vt_chosen_size ]; then if [ $vtoy_img_max_part_end -GT $vt_chosen_size ]; then
echo -e "\nPlease extend the img file size before boot it. \n" echo -e "\nPlease extend the img file size before boot it. \n"
ventoy_pause ventoy_pause
return return
@@ -1880,7 +2076,7 @@ function ventoy_img_openwrt {
ventoy_gui_console ventoy_gui_console
echo -e "\n ventoy_openwrt.xz not found. Please refer https://www.ventoy.net/en/doc_openwrt.html.\n" echo -e "\n ventoy_openwrt.xz not found. Please refer https://www.ventoy.net/en/doc_openwrt.html.\n"
echo -e " 未找到 ventoy_openwrt.xz 文件。请参考 https://www.ventoy.net/cn/doc_openwrt.html\n" echo -e " 未找到 ventoy_openwrt.xz 文件。请参考 https://www.ventoy.net/cn/doc_openwrt.html\n"
echo -e "\n press ENTER to exit (请按 回车 键返回) ..." echo -en "\n$VTLANG_ENTER_EXIT ..."
read vtInputKey read vtInputKey
ventoy_cli_console ventoy_cli_console
return return
@@ -2004,6 +2200,23 @@ function ventoy_img_cloudready {
unset linuxpartB unset linuxpartB
} }
function ventoy_img_fwts {
vt_load_cpio $vtoy_path "${vt_chosen_path}" ${vtoy_iso_part} "busybox=$ventoy_busybox_ver"
vt_trailer_cpio ${vtoy_iso_part} "${vt_chosen_path}" noinit
ventoy_debug_pause
#boot image file
vt_set_boot_opt rdinit=/vtoy/vtoy ventoyos=fwts
vt_img_hook_root
configfile $prefix/distro/fwts.cfg
vt_img_unhook_root
vt_unset_boot_opt
}
function ventoy_img_memtest86 { function ventoy_img_memtest86 {
chainloader (vtimghd,1)/efi/boot/BOOTX64.efi chainloader (vtimghd,1)/efi/boot/BOOTX64.efi
boot boot
@@ -2012,7 +2225,7 @@ function ventoy_img_memtest86 {
function img_unsupport_tip { function img_unsupport_tip {
echo -e "\n This IMG file is NOT supported now. \n" echo -e "\n This IMG file is NOT supported now. \n"
echo -e " 当前不支持启动此 IMG 文件 \n" echo -e " 当前不支持启动此 IMG 文件 \n"
echo -e "\npress ENTER to exit (请按 回车 键返回) ..." echo -en "\n$VTLANG_ENTER_EXIT ..."
read vtInputKey read vtInputKey
} }
@@ -2069,6 +2282,12 @@ function img_common_menuentry {
vt_get_fs_label (vtimghd,2) vtImgHd2Label vt_get_fs_label (vtimghd,2) vtImgHd2Label
fi fi
if [ -z "$vtImgHd1Label" ]; then
if [ -d (vtimghd,2)/efi ]; then
vt_get_fs_label (vtimghd,3) vtImgHd3Label
fi
fi
if [ -e (vtimghd,1)/etc/hostname ]; then if [ -e (vtimghd,1)/etc/hostname ]; then
vt_1st_line (vtimghd,1)/etc/hostname vtImgHostname vt_1st_line (vtimghd,1)/etc/hostname vtImgHostname
fi fi
@@ -2076,12 +2295,18 @@ function img_common_menuentry {
if vt_str_begin "$vtImgHd3Label" "ROOT-"; then if vt_str_begin "$vtImgHd3Label" "ROOT-"; then
if [ -f (vtimghd,3)/etc/os-release.d/ID ]; then if [ -f (vtimghd,3)/etc/os-release.d/ID ]; then
vt_1st_line (vtimghd,3)/etc/os-release.d/ID vt_release_line1 vt_1st_line (vtimghd,3)/etc/os-release.d/ID vt_release_line1
if [ vt_str_begin "$vt_release_line1" "FydeOS" ]; then if vt_str_begin "$vt_release_line1" "FydeOS"; then
ventoy_img_fydeos ventoy_img_fydeos
else
ventoy_img_cloudready
fi fi
elif [ -f (vtimghd,3)/etc/cloudready-release ]; then elif [ -f (vtimghd,3)/etc/cloudready-release ]; then
ventoy_img_cloudready ventoy_img_cloudready
elif [ -f (vtimghd,3)/etc/chrome_dev.conf ]; then
ventoy_img_cloudready
fi fi
elif vt_str_begin "$vtImgHd3Label" "fwts-result"; then
ventoy_img_fwts
elif vt_str_begin "$vtImgHd1Label" "LAKKA"; then elif vt_str_begin "$vtImgHd1Label" "LAKKA"; then
ventoy_img_openelec lakka ventoy_img_openelec lakka
elif vt_str_begin "$vtImgHd1Label" "LIBREELEC"; then elif vt_str_begin "$vtImgHd1Label" "LIBREELEC"; then
@@ -2100,19 +2325,22 @@ function img_common_menuentry {
ventoy_img_esysrescue ventoy_img_esysrescue
elif [ -e (vtimghd,1)/easy.sfs ]; then elif [ -e (vtimghd,1)/easy.sfs ]; then
ventoy_img_easyos ventoy_img_easyos
elif [ -d (vtimghd,2)/easyos ]; then
ventoy_img_easyos2
elif [ -e (vtimghd,1)/volumio.initrd ]; then elif [ -e (vtimghd,1)/volumio.initrd ]; then
ventoy_img_volumio ventoy_img_volumio
elif [ -f (vtimghd,2)/loader/entries/ubos.conf ]; then elif [ -f (vtimghd,2)/loader/entries/ubos.conf ]; then
ventoy_img_ubos ventoy_img_ubos
elif [ -f (vtimghd,2)/etc/openwrt_version ]; then elif [ -f (vtimghd,2)/etc/openwrt_version ]; then
ventoy_img_openwrt ventoy_img_openwrt
elif [ -f (vtimghd,1)/efi/boot/mt86.png ]; then
if [ "$grub_platform" = "pc" ]; then
img_unsupport_tip
else
ventoy_img_memtest86
fi
else else
if [ -f (vtimghd,1)/efi/boot/mt86.png ]; then
if [ "$grub_platform" = "pc" ]; then
img_unsupport_tip
fi
fi
#common chain
vt_linux_chain_data "${vtoy_iso_part}${vt_chosen_path}" vt_linux_chain_data "${vtoy_iso_part}${vt_chosen_path}"
ventoy_acpi_param ${vtoy_chain_mem_addr} 512 ventoy_acpi_param ${vtoy_chain_mem_addr} 512
if [ "$grub_platform" = "pc" ]; then if [ "$grub_platform" = "pc" ]; then
@@ -2137,6 +2365,28 @@ function img_unsupport_menuentry {
common_unsupport_menuentry common_unsupport_menuentry
} }
function mimg_common_menuentry {
vt_chosen_img_path vt_chosen_path vt_chosen_size vt_chosen_name
if vt_check_password "${vt_chosen_path}"; then
return
fi
echo "memdisk mode boot for $vt_chosen_path"
echo ""
ventoy_debug_pause
if [ "$grub_platform" = "pc" ]; then
legacy_img_memdisk $vtoy_iso_part "$vt_chosen_path"
else
vt_load_img_memdisk "$vtoy_iso_part$vt_chosen_path" vtoy_img_buf
ventoy_cli_console
chainloader ${vtoy_path}/ventoy_${VTOY_EFI_ARCH}.efi memdisk env_param=${env_param} isoefi=${LoadIsoEfiDriver} ${vtdebug_flag} mem:${vtoy_img_buf_addr}:size:${vtoy_img_buf_size}
boot
ventoy_gui_console
fi
}
############################################################# #############################################################
############################################################# #############################################################
############################################################# #############################################################
@@ -2145,7 +2395,7 @@ function img_unsupport_menuentry {
############################################################# #############################################################
############################################################# #############################################################
set VENTOY_VERSION="1.0.78" set VENTOY_VERSION="1.0.91"
#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
@@ -2169,6 +2419,7 @@ set VTOY_HELP_CMD="ventoy_show_help"
set VTOY_CHKSUM_CMD="ventoy_checksum" set VTOY_CHKSUM_CMD="ventoy_checksum"
set VTOY_HELP_TXT_LANGUAGE="en_US" set VTOY_HELP_TXT_LANGUAGE="en_US"
set VTOY_CHKSUM_FILE_PATH="X" set VTOY_CHKSUM_FILE_PATH="X"
set VTOY_LANG_CMD="ventoy_language"
if [ "$grub_platform" = "pc" ]; then if [ "$grub_platform" = "pc" ]; then
@@ -2203,6 +2454,11 @@ if [ "$vtoy_dev" = "tftp" ]; then
done done
loadfont ascii loadfont ascii
if [ -n "$vtoy_efi_part" ]; then
vt_load_file_to_mem "auto" $vtoy_efi_part/grub/fonts/unicode.pf2 vtoy_font_mem
loadfont mem:${vtoy_font_mem_addr}:size:${vtoy_font_mem_size}
fi
if [ -f $vtoy_iso_part/ventoy/ventoy.json ]; then if [ -f $vtoy_iso_part/ventoy/ventoy.json ]; then
set vt_plugin_path=$vtoy_iso_part set vt_plugin_path=$vtoy_iso_part
else else
@@ -2229,6 +2485,9 @@ fi
#Load Partition Table #Load Partition Table
vt_load_part_table $vtoydev vt_load_part_table $vtoydev
#Load menu lang file
ventoy_load_menu_lang_file
#Load Plugin #Load Plugin
if [ -f $vtoy_iso_part/ventoy/ventoy.json ]; then if [ -f $vtoy_iso_part/ventoy/ventoy.json ]; then
clear clear
@@ -2238,6 +2497,12 @@ else
vt_check_json_path_case $vtoy_iso_part vt_check_json_path_case $vtoy_iso_part
fi fi
if [ -n "$VTOY_MENU_LANGUAGE" ]; then
vt_init_menu_lang "$VTOY_MENU_LANGUAGE"
else
vt_init_menu_lang en_US
fi
if [ -n "$VTOY_MENU_TIMEOUT" ]; then if [ -n "$VTOY_MENU_TIMEOUT" ]; then
set timeout=$VTOY_MENU_TIMEOUT set timeout=$VTOY_MENU_TIMEOUT
else else
@@ -2259,10 +2524,8 @@ fi
if [ $VTOY_DEFAULT_MENU_MODE -eq 0 ]; then if [ $VTOY_DEFAULT_MENU_MODE -eq 0 ]; then
set VTOY_F3_CMD="vt_dynamic_menu 1 1" set VTOY_F3_CMD="vt_dynamic_menu 1 1"
set VTOY_HOTKEY_TIP="h:Help F1:Memdisk F2:Browser F3:TreeView F4:Localboot F5:Tools F6:ExMenu"
else else
set VTOY_F3_CMD="vt_dynamic_menu 1 0" set VTOY_F3_CMD="vt_dynamic_menu 1 0"
set VTOY_HOTKEY_TIP="h:Help F1:Memdisk F2:Browser F3:ListView F4:Localboot F5:Tools F6:ExMenu"
fi fi
terminal_output console terminal_output console
@@ -2290,7 +2553,20 @@ elif [ "$vtoy_display_mode" = "serial_console" ]; then
fi fi
terminal_input serial console terminal_input serial console
terminal_output serial console terminal_output serial console
else else
if [ "$vtoy_gfxmode" = "max" ]; then
set gfxmode=1024x768
terminal_output gfxterm
vt_enum_video_mode
vt_get_video_mode 0 vtCurMode
terminal_output console
set gfxmode=$vtCurMode
terminal_output gfxterm
elif [ "$vtoy_res_fit" = "1" ]; then
terminal_output gfxterm
fi
if [ -n "$vtoy_theme" ]; then if [ -n "$vtoy_theme" ]; then
vt_set_theme vt_set_theme
else else
@@ -2371,6 +2647,7 @@ export VTOY_HELP_CMD
export VTOY_CHKSUM_CMD export VTOY_CHKSUM_CMD
export VTOY_HELP_TXT_LANGUAGE export VTOY_HELP_TXT_LANGUAGE
export VTOY_CHKSUM_FILE_PATH export VTOY_CHKSUM_FILE_PATH
export VTOY_LANG_CMD
#colect all image files (iso files) #colect all image files (iso files)

View File

@@ -0,0 +1,18 @@
L - اختيار اللغة
F1 - عرض معلومات المساعدة
F2 - استعراض وتشغيل الملفات في القرص المحلي
F3 - تبديل وضع القائمة بين Treeview <-> ListView
F4 - تشغيل ويندوز / لينكس على القرص المحلي
F5 - الأدوات المساعده
F6 - تحميل قائمة Grub2 المخصصة
F7 - التبديل بين وضع الواجهة الرسومية <-> وضع النص
m / Ctrl + m - تحقق من صحة الملفات الصور (md5 / sha1 / sha256 / sha512)
d / Ctrl + d - وضع Memdisk (فقط للصغير WinPE / LiveCD ISO / IMG)
w / Ctrl + w - وضع WIMBOOT (فقط للويندوز القياسي ISO)
r / Ctrl + r - وضع Grub2 (يدعم بعض توزيعات لينكس)
i / Ctrl + i - وضع متوافق (فقط للتدقيق)
u / Ctrl + u - تحميل برنامج التشغيل EFI ISO (فقط للتدقيق، غير مستخدم رسمي)
اضغط على ESC للعودة ......

View File

@@ -0,0 +1,19 @@
L - ভাষা নির্বাচন করুন
F1 - এই সাহায্য তথ্য প্রদর্শন করুন
F2 - স্থানীয় ডিস্কে ফাইলটি browse করুন এবং boot করুন
F3 - Treeview <-> ListView এর মধ্যে মেনু মোড পরিবর্তন করুন
F4 - স্থানীয় ডিস্কে Windows/Linux boot করুন
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 ISO জন্য)
r/Ctrl+r - Grub2 মোড (শুধুমাত্র কিছু Linux distro জন্য)
i/Ctrl+i - Compatible মোড (শুধুমাত্র debug জন্য)
u/Ctrl+u - ISO efi ড্রাইভার লোড করুন (শুধুমাত্র debug জন্য, সরকারীভাবে ব্যবহার করা যাবে না)
ফিরে আসতে ESC টিপুন ......

View File

@@ -0,0 +1,19 @@
L - Výběr jazyka
F1 - Zobrazení nápovědy
F2 - Procházet spouštět soubory na disku
F3 - Přepínat mezi zobrazením stromu a seznamu
F4 - Spustit Windows/Linux na disku
F5 - Nástroje
F6 - Nahrát vlastní Grub2 nabídku
F7 - Přepínat mezi grafickým a textovým režimem
m/Ctrl+m - Kontrolní součky obrazů (md5/sha1/sha256/sha512)
d/Ctrl+d - Memdisk režim (pouze pro malé WinPE/LiveCD ISO/IMG)
w/Ctrl+w - WIMBOOT režim (pouze pro Windows/WinPE ISO soubory)
r/Ctrl+r - Grub2 režim (pouze pro některé linuxové distribuce)
i/Ctrl+i - Režim kompatibility (pouze pro ladění)
u/Ctrl+u - Nahrát ISO EFI ovladač (pouze pro ladění, oficiálně nejde použít)
Stiskněte ESC pro návrat ......

View File

@@ -1,18 +1,19 @@
h - Zeigt dieses Hilfe Menu L - Sprache auswählen
F1 - Memdisk Modus (Nur für kleine WinPE/LiveCD ISO/IMG) F1 - Zeigt dieses Hilfemenü
F2 - Browse and boot files in local disk F2 - Durchsuchen und starten von Dateien auf lokalem Datenträger
F3 - Menu wechsel zwischen Baum <-> Listen Ansicht F3 - Wechsel zwischen Baum-/Listenansicht
F4 - Windows/Linux vom lokalem Datenträger starten F4 - Windows/Linux von lokalem Datenträger starten
F5 - Dienstprogramme F5 - Werkzeuge
F6 - Benutzerdefiniertes Grub2-Menü laden F6 - Benutzerdefiniertes Grub2-Menü laden
F7 - Wechseln zwischen GUI-Modus <-> TEXT-Modus F7 - Wechseln zwischen Grafik-/Text-Modus
m - Prüfsummencheck Image Dateien (md5/sha1/sha256/sha512) m/Strg+m - Prüfsumme von Abbilddatei prüfen (md5/sha1/sha256/sha512)
Ctrl+w - WIMBOOT Modus (Nur für Standard Windows ISO) d/Strg+d - Memdisk-Modus (Nur für kleine WinPE/LiveCD ISO/IMG)
Ctrl+r - Grub2 Modus (Nur für einige Linux distros) w/Strg+w - WIMBOOT-Modus (Nur für Windows/WinPE ISO)
Ctrl+i - Kompatibilitäts Modus (Nur für Fehleranalyse) r/Strg+r - Grub2-Modus (Nur für einige Linux-Distributionen)
Ctrl+u - Lade ISO efi Treiber (Nur für Fehleranalyse, darf nicht offiziel benutzt werden) i/Strg+i - Kompatibilitäts-Modus (Nur für Fehleranalyse)
u/Strg+u - ISO EFI-Treiber laden (Nur für Fehleranalyse, darf offiziell nicht benutzt werden)
Drücke ESC für Zurück ...... ESC für Zurück drücken......

View File

@@ -0,0 +1,19 @@
L - Επιλογή Γλώσσας
F1 - Εμφάνιση πληροφοριών βοήθειας
F2 - Περιήγηση και εκκίνηση αρχείων στον τοπικό δίσκο
F3 - Εναλλαγή λειτουργίας μενού μεταξύ Προβολής Δένδρου <-> Προβολή Λίστας
F4 - Εκκίνηση Windows/Linux στον τοπικό δίσκο
F5 - Εργαλεία
F6 - Φόρτωση προσαρμοσμένου μενού Grub2
F7 - Εναλλαγή μεταξύ Λειτουργίας GUI <-> Λειτουργίας ΚΕΙΜΕΝΟΥ
m/Ctrl+m - Αρχεία εικόνας Checksum (md5/sha1/sha256/sha512)
d/Ctrl+d - Λειτουργία Memdisk (Μόνο για μικρά WinPE/LiveCD ISO/IMG)
w/Ctrl+w - Λειτουργία WIMBOOT (Μόνο για αρχεία ISO Windows/WinPE)
r/Ctrl+r - Λειτουργία Grub2 (Μόνο για ορισμένες διανομές Linux)
i/Ctrl+i - Λειτουργία Συμβατότητας (Μόνο για εντοπισμό σφαλμάτων - debugging)
u/Ctrl+u - Φόρτωση προγράμματος οδήγησης ISO EFI (Μόνο για εντοπισμό σφαλμάτων - debugging, δεν μπορεί να χρησιμοποιηθεί επίσημα)
Πατήστε ESC για επιστροφή ......

View File

@@ -1,17 +1,18 @@
h - Display this help information L - Language Select
F1 - Memdisk Mode (Only for small WinPE/LiveCD ISO/IMG) F1 - Display help information
F2 - Browse and boot files in local disk F2 - Browse and boot files in the local disk
F3 - Switch menu mode between Treeview <-> ListView F3 - Switch menu mode between Treeview <-> ListView
F4 - Boot Windows/Linux in local disk F4 - Boot Windows/Linux on the local disk
F5 - Utilities F5 - Utilities
F6 - Load Custom Grub2 Menu F6 - Load Custom Grub2 Menu
F7 - Switch between GUI Mode <-> TEXT Mode F7 - Switch between GUI Mode <-> TEXT Mode
m - Checksum image files (md5/sha1/sha256/sha512) m/Ctrl+m - Checksum image files (md5/sha1/sha256/sha512)
Ctrl+w - WIMBOOT Mode (Only for standard Windows ISO) d/Ctrl+d - Memdisk Mode (Only for small WinPE/LiveCD ISO/IMG)
Ctrl+r - Grub2 Mode (Only for some Linux distros) w/Ctrl+w - WIMBOOT Mode (Only for Windows/WinPE ISO files)
Ctrl+i - Compatible Mode (Just only for debug) r/Ctrl+r - Grub2 Mode (Only for some Linux distros)
Ctrl+u - Load ISO efi driver (Just only for debug, can not be used officially) i/Ctrl+i - Compatible Mode (Only for debugging)
u/Ctrl+u - Load ISO EFI driver (Only for debugging, cannot be used officially)

View File

@@ -0,0 +1,19 @@
L - Seleccionar lenguaje
F1 - Mostrar información de ayuda
F2 - Navegar y arranca archivos en el disco local
F3 - Cambiar modo de menú entre vista de árbol <-> vista de lista
F4 - arrancar Windows/Linux en el disco local
F5 - Utilidades
F6 - Cargar menú de Grub2 personalizado
F7 - Cambiar entre modo grafico <-> modo texto
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)
w/Ctrl+w - Modo WIMBOOT (Solo para archivos Windows/WinPE ISO)
r/Ctrl+r - Modo Grub2 (Solo para algunas distribuciones de Linux)
i/Ctrl+i - Modo compatible (Solo para depuración)
u/Ctrl+u - Cargar controlador ISO EFI (Solo para depuración, no se puede usar oficialmente)
Presiona ESC para regresar ......

View File

@@ -1,16 +1,19 @@
h - Afficher cette aide L - Sélection de la langue
F1 - Mode Memdisk (Seulement pour WinPE/LiveCD ISO/IMG) F1 - Afficher laide
F2 - Browse and boot files in local disk F2 - Démarrer à partir dun disque local
F3 - Basculer l'affichage 'Vue en arbre' <-> 'Vue en liste' F3 - Basculer laffichage Vue en arbre <-> Vue en liste
F4 - Démarrer le système Windows/Linux local F4 - Démarrer un système Windows ou Linux local
F5 - Utilitaires F5 - Utilitaires
F6 - Charger le menu Grub2 personnalisé F6 - Charger le menu GRUB 2 personnalisé
F7 - Basculer entre le mode graphique <-> mode texte F7 - Basculer entre le mode graphique <-> mode texte
m - Somme de contrôle des images (md5/sha1/sha256/sha512) m/Ctrl+m - Somme de contrôle des images (md5/sha1/sha256/sha512)
Ctrl+w - Mode WIMBOOT (seulement pour les images standards Windows) d/Ctrl+d - Mode Memdisk (pour WinPE/LiveCD ISO/IMG uniquement)
Ctrl+r - Mode Grub2 (seulement pour quelques Linux) w/Ctrl+w - Mode WIMBOOT (pour images Windows/WinPE uniquement)
Ctrl+i - Mode Compatible (seulement à fins de tests) r/Ctrl+r - Mode GRUB 2 (pour quelques distributions Linux uniquement)
Ctrl+u - Load ISO efi driver (Just only for debug, can not be used officially) i/Ctrl+i - Mode Compatible (pour débug uniquement)
u/Ctrl+u - Charger lISO dun pilote EFI (pour débug uniquement)
Appuyer sur Echap pour sortir ......
Appuyer sur Echap pour sortir…

View File

@@ -0,0 +1,19 @@
L - भाषा का चयन
F1 - इस सहायता जानकारी को प्रदर्शित करें
F2 - स्थानीय डिस्क में फ़ाइलें ब्राउज़ करें और बूट करें
F3 - TreeView <-> ListView के बीच मेन्यू मोड स्विच करें
F4 - स्थानीय डिस्क में Windows/Linux बूट करें
F5 - यूटिलिटीज
F6 - कस्टम Grub2 मेनू लोड करें
F7 - GUI मोड <-> Text मोड के बीच स्विच करें
m/Ctrl+m - चेकसम इमेज फाइल्स (md5/sha1/sha256/sha512)
d/Ctrl+d - Memdisk मोड (केवल small WinPE/LiveCD ISO/IMG के लिए)
w/Ctrl+w - WIMBOOT मोड (केवल Windows/WinPE ISO के लिए)
r/Ctrl+r - Grub2 मोड (केवल कुछ Linux distros के लिए)
i/Ctrl+i - Compatible मोड (केवल डिबग के लिए)
u/Ctrl+u - ISO efi ड्राइवर लोड करें (केवल debug के लिए, आधिकारिक तौर पर इस्तेमाल नहीं किया जा सकता)
वापस जाने के लिए ESC दबाएं ......

View File

@@ -1,5 +1,5 @@
h - Prikazuje ove informacije L - Izaberite jezik
F1 - Memdisk način rada (samo za male WinPE/LiveCD imidž fajlove) F1 - Prikazuje ove informacije
F2 - Pokreće imidž fajlove na lokalnom disku F2 - Pokreće imidž fajlove na lokalnom disku
F3 - Mijenja meni između TreeView <-> ListView F3 - Mijenja meni između TreeView <-> ListView
F4 - Pokreće Windows/Linux na lokalnom disku F4 - Pokreće Windows/Linux na lokalnom disku
@@ -7,11 +7,12 @@ F5 - Alati
F6 - Učitava prilagođen GRUB2 meni F6 - Učitava prilagođen GRUB2 meni
F7 - Mijenja između GUI <-> TEXT načina rada F7 - Mijenja između GUI <-> TEXT načina rada
m - Generira heš odabranog imidž fajla (md5/sha1/sha256/sha512) m/Ctrl+m - Generira heš odabranog imidž fajla (md5/sha1/sha256/sha512)
Ctrl+w - WIMBOOT način rada (samo za standardne Windows imidž fajlove) d/Ctrl+d - Memdisk način rada (samo za male WinPE/LiveCD imidž fajlove)
Ctrl+r - GRUB2 način rada (samo za neke Linux distribucije) w/Ctrl+w - WIMBOOT način rada (samo za Windows/WinPE imidž fajlove)
Ctrl+i - Kompatibilni način rada (samo za testiranje) r/Ctrl+r - GRUB2 način rada (samo za neke Linux distribucije)
Ctrl+u - Učitava EFI drajver za imidž fajlove (samo za testiranje) i/Ctrl+i - Kompatibilni način rada (samo za testiranje)
u/Ctrl+u - Učitava EFI drajver za imidž fajlove (samo za testiranje)

View File

@@ -0,0 +1,19 @@
L - Nyelv kiválasztása
F1 - Jelenítse meg ezt a súgóinformációt
F2 - A helyi lemezen lévő fájlok böngészése és indítása
F3 - Menü mód váltása Fanézet <-> Listanézet között
F4 - Windows/Linux indítása helyi lemezről
F5 - Segédprogramok
F6 - Egyéni Grub2 menü betöltése
F7 - Váltás Grafikus mód <-> Szövege mód között
m/Ctrl+m - Image fájlok ell.összege (md5/sha1/sha256/sha512)
d/Ctrl+d - Memdisk mód (Csak kis WinPE/LiveCD ISO/IMG esetén)
w/Ctrl+w - WIMBOOT mód (Csak Windows/WinPE ISO esetében)
r/Ctrl+r - Grub2 mód (Csak néhány Linux disztró esetében)
i/Ctrl+i - Kompatibilis mód (Csak hibakeresésre)
u/Ctrl+u - ISO efi driver betöltés (Csak hibakeresésre, hivatalosan nem használható.)
Nyomjon ESC-et a visszatéréshez ......

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