mirror of
https://github.com/ventoy/Ventoy.git
synced 2025-09-16 09:01:15 +00:00
Compare commits
224 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
430f81ac49 | ||
|
038c0533d9 | ||
|
102b179cd9 | ||
|
6785f5d049 | ||
|
0c812ed5e9 | ||
|
9f2b9b0867 | ||
|
c79b072680 | ||
|
6b4509a550 | ||
|
feea11e2bb | ||
|
35c952d891 | ||
|
82053680bf | ||
|
6d5de12f52 | ||
|
84b2ee7ee3 | ||
|
da1b306e81 | ||
|
0961ce5624 | ||
|
07574f0379 | ||
|
142aa47944 | ||
|
11739fa9d0 | ||
|
9fc85051a7 | ||
|
b9e82bcf16 | ||
|
cff3a01289 | ||
|
0f90149c4e | ||
|
8ef9732931 | ||
|
b32eda4262 | ||
|
e743f7c15f | ||
|
652475f1ef | ||
|
abfc2a6343 | ||
|
e73ac04cb6 | ||
|
8727e63880 | ||
|
2d281d7dee | ||
|
385c806adf | ||
|
e869bc2386 | ||
|
b47aa1abc7 | ||
|
d8698b2194 | ||
|
7fa4724743 | ||
|
2717405a7a | ||
|
d494007df9 | ||
|
bc9e3f641b | ||
|
9f02d37001 | ||
|
fa1461bac7 | ||
|
3d56c3fa17 | ||
|
a7e3d78d14 | ||
|
879a7592bd | ||
|
5a433f49f7 | ||
|
0cce956c54 | ||
|
0b6372857c | ||
|
028663de9a | ||
|
5feb3f7b4b | ||
|
7035787f38 | ||
|
7dd0f509f5 | ||
|
15947caea2 | ||
|
6aeba8f8b4 | ||
|
fd46b2c3c3 | ||
|
e502f4291e | ||
|
9c59c27eff | ||
|
daeb96ce80 | ||
|
b7e878c466 | ||
|
b76ebf5b07 | ||
|
9532776f39 | ||
|
d8e81d41e4 | ||
|
fa3aa3b36f | ||
|
e717d00d53 | ||
|
6bcaf19a1a | ||
|
bcbe8835d4 | ||
|
ed746ce13e | ||
|
07a790fc6a | ||
|
fd393a02fd | ||
|
0501d03dbb | ||
|
c9939a8cfc | ||
|
5067020a61 | ||
|
4f5334026e | ||
|
3e34dd8514 | ||
|
4df793e021 | ||
|
e0132ac4b5 | ||
|
2b3192b098 | ||
|
7ee3a6d9f8 | ||
|
e1d3ca9fc4 | ||
|
8653832551 | ||
|
c308892db0 | ||
|
1300f7f4f1 | ||
|
d9182dbfa4 | ||
|
e988c0dfe2 | ||
|
0714971f8c | ||
|
3c03df31ce | ||
|
e24dacadcd | ||
|
315cabb945 | ||
|
72f25f14fc | ||
|
47e1553d23 | ||
|
9a2a7e83eb | ||
|
5f747148c6 | ||
|
686ed11037 | ||
|
7fe4762faa | ||
|
eac1c35f76 | ||
|
c7dcaa5734 | ||
|
4b17ee30c4 | ||
|
a18aa36c01 | ||
|
1de7489c6d | ||
|
afb3340ce7 | ||
|
fdce4a756a | ||
|
5a7fa0c565 | ||
|
287d77224c | ||
|
c6bd857cbe | ||
|
b4bb6efd3c | ||
|
7386f64ed8 | ||
|
044ca8811d | ||
|
8c6fd872af | ||
|
683101ae1a | ||
|
0e968e266e | ||
|
d94d59583a | ||
|
05bbef63c1 | ||
|
8923d4b8f1 | ||
|
377cd9e468 | ||
|
be78728342 | ||
|
3938fbb351 | ||
|
a2e7afd893 | ||
|
27bb4a1168 | ||
|
b8b8c7bd66 | ||
|
12b51bcf09 | ||
|
911d5dcab9 | ||
|
f597497da6 | ||
|
54bca8c942 | ||
|
6b422ad9c1 | ||
|
925d057883 | ||
|
a377dd6172 | ||
|
4707022ef9 | ||
|
e03c73978a | ||
|
f434d1f5d0 | ||
|
23f8bc8aeb | ||
|
f2016ab899 | ||
|
7acbf7e819 | ||
|
0135bf1934 | ||
|
f2c94bd963 | ||
|
676ae725ae | ||
|
54dd35d277 | ||
|
3e75b2df3b | ||
|
2d1230cba4 | ||
|
309f85fd35 | ||
|
a13d6d9c0e | ||
|
9b7d6cbc3d | ||
|
bf797ceadb | ||
|
cd0c7ca884 | ||
|
201f7cc13c | ||
|
44a3e23740 | ||
|
9c3e1a6880 | ||
|
8a664faa04 | ||
|
398ba9fb56 | ||
|
e7a0c2d359 | ||
|
22ad828df2 | ||
|
83f22173a5 | ||
|
2de7d9ffe0 | ||
|
5c174c4521 | ||
|
c76ece4b74 | ||
|
27eda4d1e7 | ||
|
acf5a84467 | ||
|
c93e406aa5 | ||
|
1b164e74e4 | ||
|
308cb86f83 | ||
|
2ec593d355 | ||
|
594e735b91 | ||
|
6203366040 | ||
|
64f4400305 | ||
|
d00e08e2e1 | ||
|
c6008be394 | ||
|
a5c6859f5f | ||
|
497d4cc991 | ||
|
7e7687afe3 | ||
|
dd3276badf | ||
|
4a06f4a694 | ||
|
c73bf256be | ||
|
21851f7e96 | ||
|
f222f8cac9 | ||
|
40c4825aac | ||
|
dd906e0b16 | ||
|
324f2b927c | ||
|
5797ca3396 | ||
|
b36b322c03 | ||
|
fd7e34b632 | ||
|
e85c02756b | ||
|
c1d68bd787 | ||
|
a35a822723 | ||
|
05137c83e2 | ||
|
8058856182 | ||
|
33b958e112 | ||
|
9eb50a85e4 | ||
|
3cc7e3772e | ||
|
9c8292867f | ||
|
a4053d2d05 | ||
|
5c14ea0a4a | ||
|
194e948cb6 | ||
|
c896c03efe | ||
|
574b4d850c | ||
|
68a98325e6 | ||
|
25b055bb0f | ||
|
bda74cd89b | ||
|
511b8091eb | ||
|
3be4aacd78 | ||
|
2d8b27b172 | ||
|
c174410d35 | ||
|
f83e84f868 | ||
|
a39078b87a | ||
|
2576235f97 | ||
|
ee04af5243 | ||
|
118bedd546 | ||
|
44ff3dd8d4 | ||
|
9da5a6ce65 | ||
|
604b25ec82 | ||
|
0918355035 | ||
|
ce76fd5649 | ||
|
42535f35bc | ||
|
68a9cebe19 | ||
|
cc77c74bf4 | ||
|
ee952e3f69 | ||
|
b11a499939 | ||
|
fdf4693433 | ||
|
ac65c0fb24 | ||
|
ea0afe7c8b | ||
|
f8ca8b13d3 | ||
|
678a2abdf1 | ||
|
e645301713 | ||
|
43b415c032 | ||
|
311d2961ca | ||
|
1d66584190 | ||
|
553c853865 | ||
|
7d90912a09 |
2
.github/ISSUE_TEMPLATE/issue_template.yml
vendored
2
.github/ISSUE_TEMPLATE/issue_template.yml
vendored
@@ -21,7 +21,7 @@ body:
|
||||
attributes:
|
||||
label: Ventoy Version
|
||||
description: What version of ventoy are you running?
|
||||
placeholder: 1.0.80
|
||||
placeholder: 1.0.91
|
||||
validations:
|
||||
required: true
|
||||
- type: dropdown
|
||||
|
12
.github/workflows/ci.yml
vendored
12
.github/workflows/ci.yml
vendored
@@ -12,26 +12,26 @@ jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
- name: Run docker-compose up
|
||||
run: docker-compose up
|
||||
- uses: actions/upload-artifact@v2
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ventoy-windows
|
||||
path: INSTALL/ventoy-*windows*
|
||||
- uses: actions/upload-artifact@v2
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ventoy-linux
|
||||
path: INSTALL/ventoy-*linux*
|
||||
- uses: actions/upload-artifact@v2
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ventoy-livecd
|
||||
path: INSTALL/ventoy-*livecd*
|
||||
- uses: actions/upload-artifact@v2
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: SHA256SUM
|
||||
path: INSTALL/sha256.txt
|
||||
- uses: actions/upload-artifact@v2
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: xxx-build-log
|
||||
path: DOC/build.log
|
||||
|
7
DMPATCH/Makefile_IBT
Normal file
7
DMPATCH/Makefile_IBT
Normal 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
|
||||
|
@@ -51,7 +51,9 @@ typedef struct ko_param
|
||||
unsigned long sym_get_size;
|
||||
unsigned long sym_put_addr;
|
||||
unsigned long sym_put_size;
|
||||
unsigned long padding[3];
|
||||
unsigned long kv_major;
|
||||
unsigned long ibt;
|
||||
unsigned long padding[1];
|
||||
}ko_param;
|
||||
|
||||
#pragma pack()
|
||||
@@ -69,17 +71,73 @@ static volatile ko_param g_ko_param =
|
||||
};
|
||||
|
||||
#if defined(CONFIG_X86_64)
|
||||
#define PATCH_OP_POS 3
|
||||
#define CODE_MATCH(code, i) \
|
||||
#define PATCH_OP_POS1 3
|
||||
#define CODE_MATCH1(code, i) \
|
||||
(code[i] == 0x40 && code[i + 1] == 0x80 && code[i + 2] == 0xce && code[i + 3] == 0x80)
|
||||
|
||||
#define PATCH_OP_POS2 1
|
||||
#define CODE_MATCH2(code, i) \
|
||||
(code[i] == 0x0C && code[i + 1] == 0x80 && code[i + 2] == 0x89 && code[i + 3] == 0xC6)
|
||||
|
||||
#elif defined(CONFIG_X86_32)
|
||||
#define PATCH_OP_POS 2
|
||||
#define CODE_MATCH(code, i) \
|
||||
#define PATCH_OP_POS1 2
|
||||
#define CODE_MATCH1(code, i) \
|
||||
(code[i] == 0x80 && code[i + 1] == 0xca && code[i + 2] == 0x80 && code[i + 3] == 0xe8)
|
||||
|
||||
#define PATCH_OP_POS2 2
|
||||
#define CODE_MATCH2(code, i) \
|
||||
(code[i] == 0x80 && code[i + 1] == 0xca && code[i + 2] == 0x80 && code[i + 3] == 0xe8)
|
||||
|
||||
#else
|
||||
#error "unsupported arch"
|
||||
#endif
|
||||
|
||||
#ifdef VTOY_IBT
|
||||
#ifdef CONFIG_X86_64
|
||||
/* Using 64-bit values saves one instruction clearing the high half of low */
|
||||
#define DECLARE_ARGS(val, low, high) unsigned long low, high
|
||||
#define EAX_EDX_VAL(val, low, high) ((low) | (high) << 32)
|
||||
#define EAX_EDX_RET(val, low, high) "=a" (low), "=d" (high)
|
||||
#else
|
||||
#define DECLARE_ARGS(val, low, high) unsigned long long val
|
||||
#define EAX_EDX_VAL(val, low, high) (val)
|
||||
#define EAX_EDX_RET(val, low, high) "=A" (val)
|
||||
#endif
|
||||
|
||||
#define EX_TYPE_WRMSR 8
|
||||
#define EX_TYPE_RDMSR 9
|
||||
#define MSR_IA32_S_CET 0x000006a2 /* kernel mode cet */
|
||||
#define CET_ENDBR_EN (1ULL << 2)
|
||||
|
||||
/* Exception table entry */
|
||||
#ifdef __ASSEMBLY__
|
||||
|
||||
#define _ASM_EXTABLE_TYPE(from, to, type) \
|
||||
.pushsection "__ex_table","a" ; \
|
||||
.balign 4 ; \
|
||||
.long (from) - . ; \
|
||||
.long (to) - . ; \
|
||||
.long type ; \
|
||||
.popsection
|
||||
|
||||
#else /* ! __ASSEMBLY__ */
|
||||
|
||||
#define _ASM_EXTABLE_TYPE(from, to, type) \
|
||||
" .pushsection \"__ex_table\",\"a\"\n" \
|
||||
" .balign 4\n" \
|
||||
" .long (" #from ") - .\n" \
|
||||
" .long (" #to ") - .\n" \
|
||||
" .long " __stringify(type) " \n" \
|
||||
" .popsection\n"
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* VTOY_IBT */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#define vdebug(fmt, args...) if(kprintf) kprintf(KERN_ERR fmt, ##args)
|
||||
|
||||
static unsigned char *g_get_patch[MAX_PATCH] = { NULL };
|
||||
@@ -100,6 +158,7 @@ static void notrace dmpatch_restore_code(unsigned char *opCode)
|
||||
|
||||
static int notrace dmpatch_replace_code
|
||||
(
|
||||
int style,
|
||||
unsigned long addr,
|
||||
unsigned long size,
|
||||
int expect,
|
||||
@@ -112,14 +171,25 @@ static int notrace dmpatch_replace_code
|
||||
unsigned long align;
|
||||
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++)
|
||||
{
|
||||
if (CODE_MATCH(opCode, i) && cnt < MAX_PATCH)
|
||||
if (style == 1)
|
||||
{
|
||||
patch[cnt] = opCode + i + PATCH_OP_POS;
|
||||
cnt++;
|
||||
if (CODE_MATCH1(opCode, i) && cnt < MAX_PATCH)
|
||||
{
|
||||
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++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -143,11 +213,66 @@ static int notrace dmpatch_replace_code
|
||||
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)
|
||||
{
|
||||
int r = 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);
|
||||
|
||||
vdebug("dmpatch_init start pagesize=%lu ...\n", g_ko_param.pgsize);
|
||||
@@ -169,7 +294,13 @@ static int notrace dmpatch_init(void)
|
||||
reg_kprobe = (kprobe_reg_pf)g_ko_param.reg_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", g_get_patch);
|
||||
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)
|
||||
{
|
||||
rc = -EINVAL;
|
||||
@@ -177,7 +308,7 @@ static int notrace dmpatch_init(void)
|
||||
}
|
||||
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", g_put_patch);
|
||||
r = dmpatch_replace_code(1, g_ko_param.sym_put_addr, g_ko_param.sym_put_size, 1, "dm_put_table_device", g_put_patch);
|
||||
if (r)
|
||||
{
|
||||
rc = -EINVAL;
|
||||
@@ -189,6 +320,11 @@ static int notrace dmpatch_init(void)
|
||||
vdebug("######## dm patch success ###########\n");
|
||||
vdebug("#####################################\n");
|
||||
|
||||
if (g_ko_param.ibt == 0x8888)
|
||||
{
|
||||
dmpatch_ibt_restore(msr);
|
||||
}
|
||||
|
||||
out:
|
||||
|
||||
return rc;
|
||||
@@ -197,6 +333,12 @@ out:
|
||||
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++)
|
||||
{
|
||||
@@ -205,6 +347,11 @@ static void notrace dmpatch_exit(void)
|
||||
}
|
||||
|
||||
vdebug("dmpatch_exit success\n");
|
||||
|
||||
if (g_ko_param.ibt == 0x8888)
|
||||
{
|
||||
dmpatch_ibt_restore(msr);
|
||||
}
|
||||
}
|
||||
|
||||
module_init(dmpatch_init);
|
||||
|
65
DMPATCH/ubuntu_build.sh
Normal file
65
DMPATCH/ubuntu_build.sh
Normal 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
|
||||
|
@@ -5,7 +5,7 @@ use an old version of dmsetup
|
||||
http://vault.centos.org/5.3/os/SRPMS/device-mapper-1.02.28-2.el5.src.rpm
|
||||
https://www.fefe.de/dietlibc/dietlibc-0.34.tar.xz
|
||||
|
||||
======== Build Envrioment ========
|
||||
======== Build Environment ========
|
||||
build for 32bit, static linked with dietlibc
|
||||
1. install centos 6.10 i386 with CentOS-6.10-i386-bin-DVD1.iso
|
||||
2. yum install gcc kernel-devel package
|
||||
|
@@ -1,8 +1,8 @@
|
||||
|
||||
==========================================
|
||||
1. Compile Enviroment
|
||||
1. Compile Environment
|
||||
==========================================
|
||||
My build envrioment is CentOS 7.8 x86_64. So here I first explain how to create the build environment from scratch.
|
||||
My build environment is CentOS 7.8 x86_64. So here I first explain how to create the build environment from scratch.
|
||||
Because Ventoy is based on many open source projects, so the environment is important. I suggest you test it on a virtual machine firstly.
|
||||
|
||||
1.1 Install CentOS 7.8
|
||||
@@ -54,7 +54,7 @@
|
||||
mv /opt/output /opt/mips64el-linux-musl-gcc730
|
||||
|
||||
|
||||
2.4 Set PATH envrioment
|
||||
2.4 Set PATH environment
|
||||
export PATH=$PATH:/opt/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu/bin:/opt/aarch64--uclibc--stable-2020.08-1/bin:/opt/mips64el-linux-musl-gcc730/bin
|
||||
better to add this line to /root/.bashrc and relogin as root
|
||||
|
||||
|
@@ -1491,6 +1491,34 @@ STATIC EFI_STATUS EFIAPI ventoy_wrapper_file_procotol(EFI_FILE_PROTOCOL *File, B
|
||||
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
|
||||
(
|
||||
EFI_FILE_HANDLE This,
|
||||
@@ -1534,7 +1562,7 @@ STATIC EFI_STATUS EFIAPI ventoy_wrapper_file_open
|
||||
AsciiSPrint(TmpName, sizeof(TmpName), "%s", Name);
|
||||
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);
|
||||
*New = &g_efi_file_replace.WrapperHandle;
|
||||
|
@@ -1533,7 +1533,7 @@ module = {
|
||||
name = squash4;
|
||||
common = fs/squash4.c;
|
||||
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 = {
|
||||
|
@@ -260,6 +260,7 @@ grub_cmd_hashsum (struct grub_extcmd_context *ctxt,
|
||||
grub_file_t file;
|
||||
grub_err_t err;
|
||||
unsigned j;
|
||||
int vlnk = 0;
|
||||
file = grub_file_open (args[i], GRUB_FILE_TYPE_TO_HASH
|
||||
| (!uncompress ? GRUB_FILE_TYPE_NO_DECOMPRESS
|
||||
: GRUB_FILE_TYPE_NONE));
|
||||
@@ -272,6 +273,7 @@ grub_cmd_hashsum (struct grub_extcmd_context *ctxt,
|
||||
unread++;
|
||||
continue;
|
||||
}
|
||||
vlnk = file->vlnk;
|
||||
err = hash_file (file, hash, result);
|
||||
grub_file_close (file);
|
||||
if (err)
|
||||
@@ -288,7 +290,7 @@ grub_cmd_hashsum (struct grub_extcmd_context *ctxt,
|
||||
grub_printf ("%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);
|
||||
}
|
||||
|
||||
|
@@ -889,6 +889,7 @@ grub_ntfs_mount (grub_disk_t disk)
|
||||
struct grub_ntfs_bpb bpb;
|
||||
struct grub_ntfs_data *data = 0;
|
||||
grub_uint32_t spc;
|
||||
grub_uint32_t sectors_per_cluster;
|
||||
|
||||
if (!disk)
|
||||
goto fail;
|
||||
@@ -903,14 +904,18 @@ grub_ntfs_mount (grub_disk_t disk)
|
||||
if (grub_disk_read (disk, 0, 0, sizeof (bpb), &bpb))
|
||||
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
|
||||
|| bpb.sectors_per_cluster == 0
|
||||
|| (bpb.sectors_per_cluster & (bpb.sectors_per_cluster - 1)) != 0
|
||||
|| sectors_per_cluster == 0
|
||||
|| (sectors_per_cluster & (sectors_per_cluster - 1)) != 0
|
||||
|| bpb.bytes_per_sector == 0
|
||||
|| (bpb.bytes_per_sector & (bpb.bytes_per_sector - 1)) != 0)
|
||||
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_NTFS_BLK_SHR);
|
||||
if (spc == 0)
|
||||
|
@@ -27,6 +27,7 @@
|
||||
#include <grub/fshelp.h>
|
||||
#include <grub/deflate.h>
|
||||
#include <minilzo.h>
|
||||
#include <zstd.h>
|
||||
|
||||
#include "xz.h"
|
||||
#include "xz_stream.h"
|
||||
@@ -184,6 +185,7 @@ enum
|
||||
COMPRESSION_LZO = 3,
|
||||
COMPRESSION_XZ = 4,
|
||||
COMPRESSION_LZ4 = 5,
|
||||
COMPRESSION_ZSTD = 6,
|
||||
};
|
||||
|
||||
|
||||
@@ -398,6 +400,25 @@ static grub_ssize_t lz4_decompress_wrap(char *inbuf, grub_size_t insize, grub_of
|
||||
return len;
|
||||
}
|
||||
|
||||
static grub_ssize_t zstd_decompress_wrap(char *inbuf, grub_size_t insize, grub_off_t off,
|
||||
char *outbuf, grub_size_t len, struct grub_squash_data *data)
|
||||
{
|
||||
char *udata = NULL;
|
||||
int usize = data->blksz;
|
||||
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 *
|
||||
squash_mount (grub_disk_t disk)
|
||||
{
|
||||
@@ -447,6 +468,9 @@ squash_mount (grub_disk_t disk)
|
||||
case grub_cpu_to_le16_compile_time (COMPRESSION_LZ4):
|
||||
data->decompress = lz4_decompress_wrap;
|
||||
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):
|
||||
data->decompress = xz_decompress;
|
||||
data->xzbuf = grub_malloc (XZBUFSIZ);
|
||||
@@ -519,7 +543,7 @@ grub_squash_iterate_dir (grub_fshelp_node_t dir,
|
||||
break;
|
||||
case grub_cpu_to_le16_compile_time (SQUASH_TYPE_LONG_DIR):
|
||||
off = grub_le_to_cpu16 (dir->ino.long_dir.offset);
|
||||
endoff = grub_le_to_cpu16 (dir->ino.long_dir.size) + off - 3;
|
||||
endoff = grub_le_to_cpu32 (dir->ino.long_dir.size) + off - 3;
|
||||
chunk = grub_le_to_cpu32 (dir->ino.long_dir.chunk);
|
||||
break;
|
||||
default:
|
||||
|
@@ -31,6 +31,7 @@ extern int g_ventoy_iso_raw;
|
||||
extern int g_ventoy_grub2_mode;
|
||||
extern int g_ventoy_wimboot_mode;
|
||||
extern int g_ventoy_iso_uefi_drv;
|
||||
extern char g_ventoy_hotkey_tip[256];
|
||||
|
||||
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") : " ";
|
||||
}
|
||||
else if (grub_strcmp (value, "@VTOY_HOTKEY_TIP@") == 0) {
|
||||
value = grub_env_get("VTOY_HOTKEY_TIP");
|
||||
if (value == NULL) {
|
||||
value = _(" ");
|
||||
}
|
||||
value = g_ventoy_hotkey_tip;
|
||||
} else if (value[0] == '@' && value[1] == '@' && value[2]) {
|
||||
value = grub_env_get(value + 2);
|
||||
if (!value)
|
||||
value = " ";
|
||||
}
|
||||
|
||||
self->template = grub_strdup (value);
|
||||
|
@@ -295,6 +295,8 @@ theme_set_string (grub_gfxmenu_view_t view,
|
||||
if (! view->title_text)
|
||||
return grub_errno;
|
||||
}
|
||||
else if (! grub_strcmp ("ventoy_left_top_color", name))
|
||||
return grub_errno;
|
||||
else
|
||||
{
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT,
|
||||
@@ -732,6 +734,11 @@ read_property (struct parsebuf *p)
|
||||
"%s:%d:%d property value invalid; "
|
||||
"enclose literal values in quotes (\")",
|
||||
p->filename, p->line_num, p->col_num);
|
||||
|
||||
grub_printf("File: %s\nLine:%d Column:%d\n"
|
||||
"property value invalid; enclose literal values in quotes (\")\n\n",
|
||||
p->filename, p->line_num, p->col_num);
|
||||
|
||||
goto done;
|
||||
}
|
||||
|
||||
|
250
GRUB2/MOD_SRC/grub-2.04/grub-core/kern/env.c
Normal file
250
GRUB2/MOD_SRC/grub-2.04/grub-core/kern/env.c
Normal 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;
|
||||
}
|
@@ -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)
|
||||
{
|
||||
*vlnk = 1;
|
||||
if (vlnk)
|
||||
*vlnk = 1;
|
||||
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)
|
||||
{
|
||||
*vlnk = 1;
|
||||
if (vlnk)
|
||||
*vlnk = 1;
|
||||
return node->dst;
|
||||
}
|
||||
node = node->next;
|
||||
|
@@ -362,7 +362,8 @@ static grub_err_t
|
||||
cmd_append (const char *line, struct syslinux_menu *menu)
|
||||
{
|
||||
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);
|
||||
if (!menu->entries->append)
|
||||
|
@@ -229,10 +229,7 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)),
|
||||
if (! file)
|
||||
goto fail;
|
||||
|
||||
/* Get the root device's device path. */
|
||||
dev = grub_device_open (0);
|
||||
if (! dev)
|
||||
goto fail;
|
||||
dev = file->device;
|
||||
|
||||
if (dev->disk)
|
||||
dev_handle = grub_efidisk_get_device_handle (dev->disk);
|
||||
@@ -257,16 +254,13 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)),
|
||||
if (dev_handle)
|
||||
dp = grub_efi_get_device_path (dev_handle);
|
||||
|
||||
if (! dp)
|
||||
if (dp != NULL)
|
||||
{
|
||||
grub_error (GRUB_ERR_BAD_DEVICE, "not a valid root device");
|
||||
goto fail;
|
||||
file_path = make_file_path (dp, filename);
|
||||
if (! file_path)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
file_path = make_file_path (dp, filename);
|
||||
if (! file_path)
|
||||
goto fail;
|
||||
|
||||
//grub_printf ("file path: ");
|
||||
//grub_efi_print_device_path (file_path);
|
||||
|
||||
@@ -390,16 +384,12 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)),
|
||||
}
|
||||
|
||||
grub_file_close (file);
|
||||
grub_device_close (dev);
|
||||
|
||||
grub_loader_set (grub_chainloader_boot, grub_chainloader_unload, 0);
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
|
||||
if (dev)
|
||||
grub_device_close (dev);
|
||||
|
||||
if (file)
|
||||
grub_file_close (file);
|
||||
|
||||
|
@@ -88,6 +88,8 @@ static int ventoy_linux_argc = 0;
|
||||
static char **ventoy_linux_args = NULL;
|
||||
static int ventoy_extra_initrd_num = 0;
|
||||
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
|
||||
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;
|
||||
}
|
||||
|
||||
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
|
||||
grub_cmd_extra_initrd_append (grub_command_t cmd __attribute__ ((unused)),
|
||||
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);
|
||||
}
|
||||
|
||||
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_set_bootopt, cmd_unset_bootopt, cmd_extra_initrd_append, cmd_extra_initrd_reset;
|
||||
|
@@ -50,6 +50,30 @@ int g_ventoy_menu_esc = 0;
|
||||
int g_ventoy_fn_mutex = 0;
|
||||
int g_ventoy_secondary_menu_on = 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) \
|
||||
if (0 == g_ventoy_fn_mutex && 0 == g_ventoy_secondary_menu_on) { \
|
||||
@@ -796,7 +820,11 @@ run_menu (grub_menu_t menu, int nested, int *auto_boot)
|
||||
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. */
|
||||
if ((c != GRUB_TERM_NO_KEY) && (c > 0))
|
||||
@@ -923,17 +951,32 @@ run_menu (grub_menu_t menu, int nested, int *auto_boot)
|
||||
menu_fini ();
|
||||
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;
|
||||
}
|
||||
else
|
||||
{
|
||||
grub_script_execute_sourcecode("terminal_output gfxterm");
|
||||
grub_script_execute_sourcecode("terminal_output gfxterm\nvt_pop_menu_lang");
|
||||
g_ventoy_terminal_output = 0;
|
||||
}
|
||||
goto refresh;
|
||||
case GRUB_TERM_KEY_F1:
|
||||
case '1':
|
||||
if (0 == g_ventoy_secondary_menu_on)
|
||||
{
|
||||
cmdstr = grub_env_get("VTOY_HELP_CMD");
|
||||
if (cmdstr)
|
||||
{
|
||||
grub_script_execute_sourcecode(cmdstr);
|
||||
while (grub_getkey() != GRUB_TERM_ESC)
|
||||
;
|
||||
menu_fini ();
|
||||
goto refresh;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case (GRUB_TERM_CTRL | 'd'):
|
||||
case 'd':
|
||||
if (0 == g_ventoy_secondary_menu_on)
|
||||
{
|
||||
menu_fini ();
|
||||
@@ -982,21 +1025,14 @@ run_menu (grub_menu_t menu, int nested, int *auto_boot)
|
||||
goto refresh;
|
||||
}
|
||||
break;
|
||||
case (GRUB_TERM_CTRL | 'h'):
|
||||
case 'h':
|
||||
case (GRUB_TERM_CTRL | 'l'):
|
||||
case (GRUB_TERM_CTRL | 'L'):
|
||||
case (GRUB_TERM_SHIFT | 'l'):
|
||||
case (GRUB_TERM_SHIFT | 'L'):
|
||||
case 'l':
|
||||
case 'L':
|
||||
{
|
||||
if (0 == g_ventoy_secondary_menu_on)
|
||||
{
|
||||
cmdstr = grub_env_get("VTOY_HELP_CMD");
|
||||
if (cmdstr)
|
||||
{
|
||||
grub_script_execute_sourcecode(cmdstr);
|
||||
while (grub_getkey() != GRUB_TERM_ESC)
|
||||
;
|
||||
menu_fini ();
|
||||
goto refresh;
|
||||
}
|
||||
}
|
||||
VTOY_COMM_HOTKEY("VTOY_LANG_CMD");
|
||||
break;
|
||||
}
|
||||
case (GRUB_TERM_CTRL | 'm'):
|
||||
@@ -1097,6 +1133,7 @@ show_menu (grub_menu_t menu, int nested, int autobooted)
|
||||
|
||||
while (1)
|
||||
{
|
||||
int ndown;
|
||||
int boot_entry;
|
||||
grub_menu_entry_t e;
|
||||
int auto_boot;
|
||||
@@ -1139,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)
|
||||
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;
|
||||
|
@@ -31,6 +31,8 @@
|
||||
static grub_uint8_t grub_color_menu_normal;
|
||||
static grub_uint8_t grub_color_menu_highlight;
|
||||
|
||||
extern char g_ventoy_hotkey_tip[256];
|
||||
|
||||
struct menu_viewer_data
|
||||
{
|
||||
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("\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);
|
||||
}
|
||||
}
|
||||
|
@@ -115,6 +115,92 @@ int ventoy_str_all_digit(const char *str)
|
||||
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)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
int i;
|
||||
@@ -269,12 +363,130 @@ static int ventoy_hwinfo_init(void)
|
||||
|
||||
grub_snprintf(str, sizeof(str), "%ld", (long)(total_mem / VTOY_SIZE_1MB));
|
||||
ventoy_env_export("grub_total_ram", str);
|
||||
|
||||
|
||||
#ifdef GRUB_MACHINE_EFI
|
||||
ventoy_get_uefi_version(str, sizeof(str));
|
||||
ventoy_env_export("grub_uefi_version", str);
|
||||
#else
|
||||
ventoy_env_export("grub_uefi_version", "NA");
|
||||
#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;
|
||||
}
|
||||
|
||||
|
@@ -392,6 +392,11 @@ static int ventoy_browser_iterate_dir(const char *filename, const struct grub_di
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (grub_file_is_vlnk_suffix(filename, len))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
node = grub_zalloc(sizeof(browser_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)
|
||||
{
|
||||
browser_ssprintf(&mbuf, "menuentry \"%-10s [Return]\" --class=\"vtoyret\" VTOY_RET {\n "
|
||||
" echo 'return ...' \n}\n", "<--");
|
||||
browser_ssprintf(&mbuf, "menuentry \"%-10s [%s]\" --class=\"vtoyret\" VTOY_RET {\n "
|
||||
" echo 'return ...' \n}\n", "<--",
|
||||
ventoy_get_vmenu_title("VTLANG_BROWER_RETURN"));
|
||||
}
|
||||
else
|
||||
{
|
||||
browser_ssprintf(&mbuf, "menuentry \"[Return]\" --class=\"vtoyret\" VTOY_RET {\n "
|
||||
" echo 'return ...' \n}\n");
|
||||
browser_ssprintf(&mbuf, "menuentry \"[%s]\" --class=\"vtoyret\" VTOY_RET {\n "
|
||||
" echo 'return ...' \n}\n",
|
||||
ventoy_get_vmenu_title("VTLANG_BROWER_RETURN"));
|
||||
}
|
||||
|
||||
grub_disk_dev_iterate(ventoy_browser_iterate_disk, &mbuf);
|
||||
|
@@ -158,6 +158,10 @@ const char *g_menu_prefix[img_type_max] =
|
||||
"iso", "wim", "efi", "img", "vhd", "vtoy"
|
||||
};
|
||||
|
||||
static const char *g_lower_chksum_name[VTOY_CHKSUM_NUM] = { "md5", "sha1", "sha256", "sha512" };
|
||||
static int g_lower_chksum_namelen[VTOY_CHKSUM_NUM] = { 3, 4, 6, 6 };
|
||||
static int g_chksum_retlen[VTOY_CHKSUM_NUM] = { 32, 40, 64, 128 };
|
||||
|
||||
static int g_vtoy_secondary_need_recover = 0;
|
||||
|
||||
static int g_vtoy_load_prompt = 0;
|
||||
@@ -362,6 +366,42 @@ static int ventoy_enum_video_mode(void)
|
||||
VENTOY_CMD_RETURN(GRUB_ERR_NONE);
|
||||
}
|
||||
|
||||
static int ventoy_pre_parse_data(char *src, int size)
|
||||
{
|
||||
char c;
|
||||
char *pos = NULL;
|
||||
char buf[256];
|
||||
|
||||
if (size < 20 || grub_strncmp(src, "ventoy_left_top_color", 21))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
pos = src + 21;
|
||||
while (*pos && *pos != '\r' && *pos != '\n')
|
||||
{
|
||||
pos++;
|
||||
}
|
||||
|
||||
c = *pos;
|
||||
*pos = 0;
|
||||
|
||||
if (grub_strlen(src) > 200)
|
||||
{
|
||||
goto end;
|
||||
}
|
||||
|
||||
grub_snprintf(buf, sizeof(buf),
|
||||
"regexp -s 1:%s -s 2:%s -s 3:%s \"@([^@]*)@([^@]*)@([^@]*)@\" \"%s\"",
|
||||
ventoy_left_key, ventoy_top_key, ventoy_color_key, src);
|
||||
|
||||
grub_script_execute_sourcecode(buf);
|
||||
|
||||
end:
|
||||
*pos = c;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static grub_file_t ventoy_wrapper_open(grub_file_t rawFile, enum grub_file_type type)
|
||||
{
|
||||
int len;
|
||||
@@ -395,6 +435,7 @@ static grub_file_t ventoy_wrapper_open(grub_file_t rawFile, enum grub_file_type
|
||||
}
|
||||
|
||||
grub_file_read(rawFile, file->data, rawFile->size);
|
||||
ventoy_pre_parse_data((char *)file->data, (int)rawFile->size);
|
||||
len = ventoy_fill_data(4096, (char *)file->data + rawFile->size);
|
||||
|
||||
g_old_file = rawFile;
|
||||
@@ -495,6 +536,7 @@ static int ventoy_set_check_result(int ret, const char *msg)
|
||||
|
||||
if (ret)
|
||||
{
|
||||
grub_cls();
|
||||
grub_printf(VTOY_WARNING"\n");
|
||||
grub_printf(VTOY_WARNING"\n");
|
||||
grub_printf(VTOY_WARNING"\n\n\n");
|
||||
@@ -502,10 +544,7 @@ static int ventoy_set_check_result(int ret, const char *msg)
|
||||
grub_printf("This is NOT a standard Ventoy device and is NOT supported (%d).\n", ret);
|
||||
grub_printf("Error message: <%s>\n\n", msg);
|
||||
grub_printf("You should follow the instructions in https://www.ventoy.net to use Ventoy.\n");
|
||||
|
||||
grub_printf("\n\nWill exit after 10 seconds ...... ");
|
||||
grub_refresh();
|
||||
grub_sleep(10);
|
||||
}
|
||||
|
||||
return ret;
|
||||
@@ -1728,6 +1767,10 @@ static int ventoy_check_vlnk_data(ventoy_vlnk *vlnk, int print, char *dst, int s
|
||||
cur->fs->fs_close(&file);
|
||||
grub_snprintf(dst, size - 1, "(%s)%s", cur->device, vlnk->filepath);
|
||||
}
|
||||
else
|
||||
{
|
||||
grub_errno = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2079,6 +2122,13 @@ static int ventoy_collect_img_files(const char *filename, const struct grub_dirh
|
||||
img->menu_prefix = "miso";
|
||||
}
|
||||
}
|
||||
else if (img_type_img == type)
|
||||
{
|
||||
if (ventoy_plugin_check_memdisk(img->path))
|
||||
{
|
||||
img->menu_prefix = "mimg";
|
||||
}
|
||||
}
|
||||
|
||||
debug("Add %s%s to list %d\n", node->dir, filename, g_ventoy_img_count);
|
||||
}
|
||||
@@ -2212,6 +2262,21 @@ ventoy_password_get (char buf[], unsigned buf_size)
|
||||
return (key != GRUB_TERM_ESC);
|
||||
}
|
||||
|
||||
static int ventoy_get_password(char buf[], unsigned buf_size)
|
||||
{
|
||||
const char *env = NULL;
|
||||
|
||||
env = grub_env_get("VTOY_SHOW_PASSWORD_ASTERISK");
|
||||
if (env && env[0] == '0' && env[1] == 0)
|
||||
{
|
||||
return grub_password_get(buf, buf_size);
|
||||
}
|
||||
else
|
||||
{
|
||||
return ventoy_password_get(buf, buf_size);
|
||||
}
|
||||
}
|
||||
|
||||
int ventoy_check_password(const vtoy_password *pwd, int retry)
|
||||
{
|
||||
int offset;
|
||||
@@ -2227,7 +2292,7 @@ int ventoy_check_password(const vtoy_password *pwd, int retry)
|
||||
|
||||
if (pwd->type == VTOY_PASSWORD_TXT)
|
||||
{
|
||||
ventoy_password_get(input, 128);
|
||||
ventoy_get_password(input, 128);
|
||||
if (grub_strcmp(pwd->text, input) == 0)
|
||||
{
|
||||
return 0;
|
||||
@@ -2235,7 +2300,7 @@ int ventoy_check_password(const vtoy_password *pwd, int retry)
|
||||
}
|
||||
else if (pwd->type == VTOY_PASSWORD_MD5)
|
||||
{
|
||||
ventoy_password_get(input, 128);
|
||||
ventoy_get_password(input, 128);
|
||||
grub_crypto_hash(GRUB_MD_MD5, md5, input, grub_strlen(input));
|
||||
if (grub_memcmp(pwd->md5, md5, 16) == 0)
|
||||
{
|
||||
@@ -2245,7 +2310,7 @@ int ventoy_check_password(const vtoy_password *pwd, int retry)
|
||||
else if (pwd->type == VTOY_PASSWORD_SALT_MD5)
|
||||
{
|
||||
offset = (int)grub_snprintf(input, 128, "%s", pwd->salt);
|
||||
ventoy_password_get(input + offset, 128);
|
||||
ventoy_get_password(input + offset, 128);
|
||||
|
||||
grub_crypto_hash(GRUB_MD_MD5, md5, input, grub_strlen(input));
|
||||
if (grub_memcmp(pwd->md5, md5, 16) == 0)
|
||||
@@ -2331,16 +2396,16 @@ static int ventoy_dynamic_tree_menu(img_iterator_node *node)
|
||||
if (g_tree_view_menu_style == 0)
|
||||
{
|
||||
vtoy_ssprintf(g_tree_script_buf, g_tree_script_pos,
|
||||
"menuentry \"%-10s [Return to ListView]\" --class=\"vtoyret\" VTOY_RET {\n "
|
||||
"menuentry \"%-10s [%s]\" --class=\"vtoyret\" VTOY_RET {\n "
|
||||
" echo 'return ...' \n"
|
||||
"}\n", "<--");
|
||||
"}\n", "<--", ventoy_get_vmenu_title("VTLANG_RET_TO_LISTVIEW"));
|
||||
}
|
||||
else
|
||||
{
|
||||
vtoy_ssprintf(g_tree_script_buf, g_tree_script_pos,
|
||||
"menuentry \"[Return to ListView]\" --class=\"vtoyret\" VTOY_RET {\n "
|
||||
"menuentry \"[%s]\" --class=\"vtoyret\" VTOY_RET {\n "
|
||||
" echo 'return ...' \n"
|
||||
"}\n");
|
||||
"}\n", ventoy_get_vmenu_title("VTLANG_RET_TO_LISTVIEW"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2919,9 +2984,9 @@ static grub_err_t ventoy_cmd_list_img(grub_extcmd_context_t ctxt, int argc, char
|
||||
if (g_default_menu_mode == 1)
|
||||
{
|
||||
vtoy_ssprintf(g_list_script_buf, g_list_script_pos,
|
||||
"menuentry \"%s [Return to TreeView]\" --class=\"vtoyret\" VTOY_RET {\n "
|
||||
"menuentry \"%s [%s]\" --class=\"vtoyret\" VTOY_RET {\n "
|
||||
" echo 'return ...' \n"
|
||||
"}\n", "<--");
|
||||
"}\n", "<--", ventoy_get_vmenu_title("VTLANG_RET_TO_TREEVIEW"));
|
||||
}
|
||||
|
||||
for (cur = g_ventoy_img_list; cur; cur = cur->next)
|
||||
@@ -3690,26 +3755,29 @@ static grub_err_t ventoy_cmd_sel_auto_install(grub_extcmd_context_t ctxt, int ar
|
||||
vtoy_ssprintf(buf, pos, "set timeout=%d\n", node->timeout);
|
||||
}
|
||||
|
||||
vtoy_ssprintf(buf, pos, "menuentry \"Boot without auto installation template\" --class=\"sel_auto_install\" {\n"
|
||||
vtoy_ssprintf(buf, pos, "menuentry \"$VTLANG_NO_AUTOINS_SCRIPT\" --class=\"sel_auto_install\" {\n"
|
||||
" echo %s\n}\n", "");
|
||||
|
||||
for (i = 0; i < node->templatenum; i++)
|
||||
{
|
||||
vtoy_ssprintf(buf, pos, "menuentry \"Boot with %s\" --class=\"sel_auto_install\" {\n"
|
||||
vtoy_ssprintf(buf, pos, "menuentry \"%s %s\" --class=\"sel_auto_install\" {\n"
|
||||
" echo \"\"\n}\n",
|
||||
ventoy_get_vmenu_title("VTLANG_AUTOINS_USE"),
|
||||
node->templatepath[i].path);
|
||||
}
|
||||
|
||||
g_ventoy_menu_esc = 1;
|
||||
g_ventoy_suppress_esc = 1;
|
||||
g_ventoy_suppress_esc_default = defidx;
|
||||
|
||||
g_ventoy_secondary_menu_on = 1;
|
||||
|
||||
grub_snprintf(configfile, sizeof(configfile), "configfile mem:0x%llx:size:%d", (ulonglong)(ulong)buf, pos);
|
||||
grub_script_execute_sourcecode(configfile);
|
||||
|
||||
g_ventoy_menu_esc = 0;
|
||||
g_ventoy_suppress_esc = 0;
|
||||
g_ventoy_suppress_esc_default = 1;
|
||||
g_ventoy_secondary_menu_on = 0;
|
||||
|
||||
grub_free(buf);
|
||||
|
||||
@@ -3796,13 +3864,14 @@ static grub_err_t ventoy_cmd_sel_persistence(grub_extcmd_context_t ctxt, int arg
|
||||
vtoy_ssprintf(buf, pos, "set timeout=%d\n", node->timeout);
|
||||
}
|
||||
|
||||
vtoy_ssprintf(buf, pos, "menuentry \"Boot without persistence\" --class=\"sel_persistence\" {\n"
|
||||
vtoy_ssprintf(buf, pos, "menuentry \"$VTLANG_NO_PERSIST\" --class=\"sel_persistence\" {\n"
|
||||
" echo %s\n}\n", "");
|
||||
|
||||
for (i = 0; i < node->backendnum; i++)
|
||||
{
|
||||
vtoy_ssprintf(buf, pos, "menuentry \"Boot with %s\" --class=\"sel_persistence\" {\n"
|
||||
vtoy_ssprintf(buf, pos, "menuentry \"%s %s\" --class=\"sel_persistence\" {\n"
|
||||
" echo \"\"\n}\n",
|
||||
ventoy_get_vmenu_title("VTLANG_PERSIST_USE"),
|
||||
node->backendpath[i].path);
|
||||
|
||||
}
|
||||
@@ -3810,13 +3879,15 @@ static grub_err_t ventoy_cmd_sel_persistence(grub_extcmd_context_t ctxt, int arg
|
||||
g_ventoy_menu_esc = 1;
|
||||
g_ventoy_suppress_esc = 1;
|
||||
g_ventoy_suppress_esc_default = defidx;
|
||||
|
||||
g_ventoy_secondary_menu_on = 1;
|
||||
|
||||
grub_snprintf(configfile, sizeof(configfile), "configfile mem:0x%llx:size:%d", (ulonglong)(ulong)buf, pos);
|
||||
grub_script_execute_sourcecode(configfile);
|
||||
|
||||
g_ventoy_menu_esc = 0;
|
||||
g_ventoy_suppress_esc = 0;
|
||||
g_ventoy_suppress_esc_default = 1;
|
||||
g_ventoy_secondary_menu_on = 0;
|
||||
|
||||
grub_free(buf);
|
||||
|
||||
@@ -4946,6 +5017,61 @@ int ventoy_load_part_table(const char *diskname)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void ventoy_prompt_end(void)
|
||||
{
|
||||
int op = 0;
|
||||
char c;
|
||||
|
||||
grub_printf("\n\n\n");
|
||||
grub_printf(" 1 --- Exit grub\n");
|
||||
grub_printf(" 2 --- Reboot\n");
|
||||
grub_printf(" 3 --- Shut down\n");
|
||||
grub_printf("Please enter your choice: ");
|
||||
grub_refresh();
|
||||
|
||||
while (1)
|
||||
{
|
||||
c = grub_getkey();
|
||||
if (c >= '1' && c <= '3')
|
||||
{
|
||||
if (op == 0)
|
||||
{
|
||||
op = c - '0';
|
||||
grub_printf("%c", c);
|
||||
grub_refresh();
|
||||
}
|
||||
}
|
||||
else if (c == '\r' || c == '\n')
|
||||
{
|
||||
if (op)
|
||||
{
|
||||
if (op == 1)
|
||||
{
|
||||
grub_exit();
|
||||
}
|
||||
else if (op == 2)
|
||||
{
|
||||
grub_reboot();
|
||||
}
|
||||
else if (op == 3)
|
||||
{
|
||||
grub_script_execute_sourcecode("halt");
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (c == '\b')
|
||||
{
|
||||
if (op)
|
||||
{
|
||||
op = 0;
|
||||
grub_printf("\rPlease enter your choice: ");
|
||||
grub_printf("\rPlease enter your choice: ");
|
||||
grub_refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static grub_err_t ventoy_cmd_load_part_table(grub_extcmd_context_t ctxt, int argc, char **args)
|
||||
{
|
||||
int ret;
|
||||
@@ -4956,7 +5082,7 @@ static grub_err_t ventoy_cmd_load_part_table(grub_extcmd_context_t ctxt, int arg
|
||||
ret = ventoy_load_part_table(args[0]);
|
||||
if (ret)
|
||||
{
|
||||
grub_exit();
|
||||
ventoy_prompt_end();
|
||||
}
|
||||
|
||||
g_ventoy_disk_part_size[0] = ventoy_get_vtoy_partsize(0);
|
||||
@@ -6043,6 +6169,7 @@ static grub_err_t ventoy_cmd_show_secondary_menu(grub_extcmd_context_t ctxt, int
|
||||
}
|
||||
|
||||
g_vtoy_secondary_need_recover = 0;
|
||||
grub_env_unset("VTOY_SECOND_EXIT");
|
||||
grub_env_unset("VTOY_CHKSUM_FILE_PATH");
|
||||
|
||||
env = grub_env_get("VTOY_SECONDARY_TIMEOUT");
|
||||
@@ -6058,28 +6185,30 @@ static grub_err_t ventoy_cmd_show_secondary_menu(grub_extcmd_context_t ctxt, int
|
||||
|
||||
fsize = grub_strtoull(args[2], NULL, 10);
|
||||
|
||||
vtoy_dummy_menuentry(cmd, pos, len, "Boot in normal mode", "second_normal"); seldata[n++] = 1;
|
||||
vtoy_dummy_menuentry(cmd, pos, len, "$VTLANG_NORMAL_MODE", "second_normal"); seldata[n++] = 1;
|
||||
|
||||
if (grub_strcmp(args[1], "Unix") != 0)
|
||||
{
|
||||
if (grub_strcmp(args[1], "Windows") == 0)
|
||||
{
|
||||
vtoy_dummy_menuentry(cmd, pos, len, "Boot in wimboot mode", "second_wimboot"); seldata[n++] = 2;
|
||||
vtoy_dummy_menuentry(cmd, pos, len, "$VTLANG_WIMBOOT_MODE", "second_wimboot"); seldata[n++] = 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
vtoy_dummy_menuentry(cmd, pos, len, "Boot in grub2 mode", "second_grub2"); seldata[n++] = 3;
|
||||
vtoy_dummy_menuentry(cmd, pos, len, "$VTLANG_GRUB2_MODE", "second_grub2"); seldata[n++] = 3;
|
||||
}
|
||||
|
||||
if (fsize <= VTOY_SIZE_1GB)
|
||||
{
|
||||
vtoy_dummy_menuentry(cmd, pos, len, "Boot in memdisk mode", "second_memdisk"); seldata[n++] = 4;
|
||||
vtoy_dummy_menuentry(cmd, pos, len, "$VTLANG_MEMDISK_MODE", "second_memdisk"); seldata[n++] = 4;
|
||||
}
|
||||
}
|
||||
|
||||
vtoy_dummy_menuentry(cmd, pos, len, "File checksum", "second_checksum"); seldata[n++] = 5;
|
||||
vtoy_dummy_menuentry(cmd, pos, len, "$VTLANG_FILE_CHKSUM", "second_checksum"); seldata[n++] = 5;
|
||||
vtoy_dummy_menuentry(cmd, pos, len, "$VTLANG_RETURN_PRV_NOESC", "second_return"); seldata[n++] = 6;
|
||||
|
||||
do {
|
||||
grub_errno = GRUB_ERR_NONE;
|
||||
g_ventoy_menu_esc = 1;
|
||||
g_ventoy_suppress_esc = 1;
|
||||
g_ventoy_suppress_esc_default = 0;
|
||||
@@ -6113,10 +6242,14 @@ static grub_err_t ventoy_cmd_show_secondary_menu(grub_extcmd_context_t ctxt, int
|
||||
grub_env_set("VTOY_CHKSUM_FILE_PATH", args[0]);
|
||||
grub_script_execute_sourcecode("configfile $vtoy_efi_part/grub/checksum.cfg");
|
||||
}
|
||||
else if (select == 6)
|
||||
{
|
||||
grub_env_set("VTOY_SECOND_EXIT", "1");
|
||||
}
|
||||
}while (select == 5);
|
||||
|
||||
grub_free(cmd);
|
||||
return 0;
|
||||
VENTOY_CMD_RETURN(GRUB_ERR_NONE);
|
||||
}
|
||||
|
||||
static grub_err_t ventoy_cmd_secondary_recover_mode(grub_extcmd_context_t ctxt, int argc, char **args)
|
||||
@@ -6160,6 +6293,443 @@ static grub_err_t ventoy_cmd_fs_ignore_case(grub_extcmd_context_t ctxt, int argc
|
||||
return 0;
|
||||
}
|
||||
|
||||
static grub_err_t ventoy_cmd_init_menu_lang(grub_extcmd_context_t ctxt, int argc, char **args)
|
||||
{
|
||||
(void)ctxt;
|
||||
(void)argc;
|
||||
|
||||
ventoy_plugin_load_menu_lang(1, args[0]);
|
||||
VENTOY_CMD_RETURN(0);
|
||||
}
|
||||
|
||||
static grub_err_t ventoy_cmd_load_menu_lang(grub_extcmd_context_t ctxt, int argc, char **args)
|
||||
{
|
||||
(void)ctxt;
|
||||
(void)argc;
|
||||
|
||||
ventoy_plugin_load_menu_lang(0, args[0]);
|
||||
VENTOY_CMD_RETURN(0);
|
||||
}
|
||||
|
||||
static int ventoy_chksum_pathcmp(int chktype, char *rlpath, char *rdpath)
|
||||
{
|
||||
char *pos1 = NULL;
|
||||
char *pos2 = NULL;
|
||||
|
||||
if (chktype == 2)
|
||||
{
|
||||
pos1 = ventoy_str_basename(rlpath);
|
||||
pos2 = ventoy_str_basename(rdpath);
|
||||
return grub_strcmp(pos1, pos2);
|
||||
}
|
||||
else if (chktype == 3 || chktype == 4)
|
||||
{
|
||||
if (grub_strcmp(rlpath, rdpath) == 0 || grub_strcmp(rlpath + 1, rdpath) == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int ventoy_find_checksum
|
||||
(
|
||||
grub_file_t file,
|
||||
const char *uname,
|
||||
int retlen,
|
||||
char *path,
|
||||
int chktype,
|
||||
char *chksum
|
||||
)
|
||||
{
|
||||
int ulen;
|
||||
char *pos = NULL;
|
||||
char *pos1 = NULL;
|
||||
char *pos2 = NULL;
|
||||
char *buf = NULL;
|
||||
char *currline = NULL;
|
||||
char *nextline = NULL;
|
||||
|
||||
ulen = (int)grub_strlen(uname);
|
||||
|
||||
/* read file to buffer */
|
||||
buf = grub_malloc(file->size + 4);
|
||||
if (!buf)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
grub_file_read(file, buf, file->size);
|
||||
buf[file->size] = 0;
|
||||
|
||||
/* parse each line */
|
||||
for (currline = buf; currline; currline = nextline)
|
||||
{
|
||||
nextline = ventoy_get_line(currline);
|
||||
VTOY_SKIP_SPACE(currline);
|
||||
|
||||
if (grub_strncasecmp(currline, uname, ulen) == 0)
|
||||
{
|
||||
pos = grub_strchr(currline, '=');
|
||||
pos1 = grub_strchr(currline, '(');
|
||||
pos2 = grub_strchr(currline, ')');
|
||||
|
||||
if (pos && pos1 && pos2)
|
||||
{
|
||||
*pos2 = 0;
|
||||
if (ventoy_chksum_pathcmp(chktype, path, pos1 + 1) == 0)
|
||||
{
|
||||
VTOY_SKIP_SPACE_NEXT(pos, 1);
|
||||
grub_memcpy(chksum, pos, retlen);
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (ventoy_str_len_alnum(currline, retlen))
|
||||
{
|
||||
VTOY_SKIP_SPACE_NEXT_EX(pos, currline, retlen);
|
||||
if (ventoy_chksum_pathcmp(chktype, path, pos) == 0)
|
||||
{
|
||||
grub_memcpy(chksum, currline, retlen);
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
grub_free(buf);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ventoy_check_chkfile(const char *isopart, char *path, const char *lchkname, grub_file_t *pfile)
|
||||
{
|
||||
int ret = 0;
|
||||
int cnt = 0;
|
||||
char c = 0;
|
||||
char *pos = NULL;
|
||||
grub_file_t file = NULL;
|
||||
|
||||
file = ventoy_grub_file_open(VENTOY_FILE_TYPE, "%s%s.%s", isopart, path, lchkname);
|
||||
if (file)
|
||||
{
|
||||
VTOY_GOTO_END(1);
|
||||
}
|
||||
|
||||
cnt = ventoy_str_chrcnt(path, '/');
|
||||
if (cnt > 1)
|
||||
{
|
||||
pos = grub_strrchr(path, '/');
|
||||
c = *pos;
|
||||
*pos = 0;
|
||||
|
||||
file = ventoy_grub_file_open(VENTOY_FILE_TYPE, "%s%s/VENTOY_CHECKSUM", isopart, path);
|
||||
if (file)
|
||||
{
|
||||
*pos = c;
|
||||
VTOY_GOTO_END(2);
|
||||
}
|
||||
*pos = c;
|
||||
}
|
||||
|
||||
file = ventoy_grub_file_open(VENTOY_FILE_TYPE, "%s/VENTOY_CHECKSUM", isopart);
|
||||
if (file)
|
||||
{
|
||||
ret = (cnt > 1) ? 3 : 4;
|
||||
}
|
||||
|
||||
end:
|
||||
|
||||
if (pfile)
|
||||
{
|
||||
*pfile = file;
|
||||
}
|
||||
else
|
||||
{
|
||||
check_free(file, grub_file_close);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
static grub_err_t ventoy_cmd_cmp_checksum(grub_extcmd_context_t ctxt, int argc, char **args)
|
||||
{
|
||||
int index = 0;
|
||||
int chktype = 0;
|
||||
char *pos = NULL;
|
||||
grub_file_t file = NULL;
|
||||
const char *calc_value = NULL;
|
||||
const char *isopart = NULL;
|
||||
char fchksum[64];
|
||||
char readchk[256] = {0};
|
||||
char filebuf[512] = {0};
|
||||
char uchkname[16];
|
||||
|
||||
(void)ctxt;
|
||||
|
||||
index = (int)grub_strtol(args[0], NULL, 10);
|
||||
if (argc != 2 || index < 0 || index >= VTOY_CHKSUM_NUM)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
grub_strncpy(uchkname, g_lower_chksum_name[index], sizeof(uchkname));
|
||||
ventoy_str_toupper(uchkname);
|
||||
|
||||
isopart = grub_env_get("vtoy_iso_part");
|
||||
calc_value = grub_env_get("VT_LAST_CHECK_SUM");
|
||||
|
||||
chktype = ventoy_check_chkfile(isopart, args[1], g_lower_chksum_name[index], &file);
|
||||
if (chktype <= 0)
|
||||
{
|
||||
grub_printf("\n\nNo checksum file found.\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (chktype == 1)
|
||||
{
|
||||
grub_snprintf(fchksum, sizeof(fchksum), ".%s", g_lower_chksum_name[index]);
|
||||
grub_memset(filebuf, 0, sizeof(filebuf));
|
||||
grub_file_read(file, filebuf, 511);
|
||||
|
||||
pos = grub_strchr(filebuf, '=');
|
||||
if (pos)
|
||||
{
|
||||
VTOY_SKIP_SPACE_NEXT(pos, 1);
|
||||
grub_memcpy(readchk, pos, g_chksum_retlen[index]);
|
||||
}
|
||||
else
|
||||
{
|
||||
grub_memcpy(readchk, filebuf, g_chksum_retlen[index]);
|
||||
}
|
||||
}
|
||||
else if (chktype == 3 || chktype == 4)
|
||||
{
|
||||
grub_snprintf(fchksum, sizeof(fchksum), "global VENTOY_CHECKSUM");
|
||||
ventoy_find_checksum(file, uchkname, g_chksum_retlen[index], args[1], chktype, readchk);
|
||||
if (readchk[0] == 0)
|
||||
{
|
||||
grub_printf("\n\n%s value not found in %s.\n", uchkname, fchksum);
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
grub_snprintf(fchksum, sizeof(fchksum), "local VENTOY_CHECKSUM");
|
||||
ventoy_find_checksum(file, uchkname, g_chksum_retlen[index], args[1], chktype, readchk);
|
||||
if (readchk[0] == 0)
|
||||
{
|
||||
grub_file_close(file);
|
||||
file = ventoy_grub_file_open(VENTOY_FILE_TYPE, "%s/VENTOY_CHECKSUM", isopart);
|
||||
if (file)
|
||||
{
|
||||
grub_snprintf(fchksum, sizeof(fchksum), "global VENTOY_CHECKSUM");
|
||||
ventoy_find_checksum(file, uchkname, g_chksum_retlen[index], args[1], 3, readchk);
|
||||
if (readchk[0] == 0)
|
||||
{
|
||||
grub_printf("\n\n%s value not found in both local and global VENTOY_CHECKSUM.\n", uchkname);
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (grub_strcasecmp(calc_value, readchk) == 0)
|
||||
{
|
||||
grub_printf("\n\nCheck %s value with %s file. [ SUCCESS ]\n", uchkname, fchksum);
|
||||
}
|
||||
else
|
||||
{
|
||||
grub_printf("\n\nCheck %s value with %s file. [ ERROR ]\n", uchkname, fchksum);
|
||||
grub_printf("The %s value in %s file is:\n%s\n", uchkname, fchksum, readchk);
|
||||
}
|
||||
|
||||
end:
|
||||
grub_refresh();
|
||||
check_free(file, grub_file_close);
|
||||
VENTOY_CMD_RETURN(0);
|
||||
}
|
||||
|
||||
static int ventoy_find_all_checksum
|
||||
(
|
||||
grub_file_t file,
|
||||
char *path,
|
||||
int chktype,
|
||||
int exists[VTOY_CHKSUM_NUM],
|
||||
int *ptotexist
|
||||
)
|
||||
{
|
||||
int i;
|
||||
int ulen;
|
||||
int tot = 0;
|
||||
char c = 0;
|
||||
char *pos = NULL;
|
||||
char *pos1 = NULL;
|
||||
char *pos2 = NULL;
|
||||
char *buf = NULL;
|
||||
char *currline = NULL;
|
||||
char *nextline = NULL;
|
||||
const char *uname = NULL;
|
||||
|
||||
tot = *ptotexist;
|
||||
|
||||
/* read file to buffer */
|
||||
buf = grub_malloc(file->size + 4);
|
||||
if (!buf)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
grub_file_read(file, buf, file->size);
|
||||
buf[file->size] = 0;
|
||||
|
||||
/* parse each line */
|
||||
for (currline = buf; currline; currline = nextline)
|
||||
{
|
||||
nextline = ventoy_get_line(currline);
|
||||
VTOY_SKIP_SPACE(currline);
|
||||
|
||||
for (i = 0; i < VTOY_CHKSUM_NUM; i++)
|
||||
{
|
||||
if (exists[i])
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
uname = g_lower_chksum_name[i];
|
||||
ulen = g_lower_chksum_namelen[i];
|
||||
|
||||
if (grub_strncasecmp(currline, uname, ulen) == 0)
|
||||
{
|
||||
pos = grub_strchr(currline, '=');
|
||||
pos1 = grub_strchr(currline, '(');
|
||||
pos2 = grub_strchr(currline, ')');
|
||||
|
||||
if (pos && pos1 && pos2)
|
||||
{
|
||||
c = *pos2;
|
||||
*pos2 = 0;
|
||||
if (ventoy_chksum_pathcmp(chktype, path, pos1 + 1) == 0)
|
||||
{
|
||||
exists[i] = 1;
|
||||
tot++;
|
||||
}
|
||||
*pos2 = c;
|
||||
}
|
||||
}
|
||||
else if (ventoy_str_len_alnum(currline, g_chksum_retlen[i]))
|
||||
{
|
||||
VTOY_SKIP_SPACE_NEXT_EX(pos, currline, g_chksum_retlen[i]);
|
||||
if (ventoy_chksum_pathcmp(chktype, path, pos) == 0)
|
||||
{
|
||||
exists[i] = 1;
|
||||
tot++;
|
||||
}
|
||||
}
|
||||
|
||||
if (tot >= VTOY_CHKSUM_NUM)
|
||||
{
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
|
||||
*ptotexist = tot;
|
||||
grub_free(buf);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static grub_err_t ventoy_cmd_vtoychksum_exist(grub_extcmd_context_t ctxt, int argc, char **args)
|
||||
{
|
||||
int i = 0;
|
||||
int cnt = 0;
|
||||
char c = 0;
|
||||
int tip = 0;
|
||||
char *pos = NULL;
|
||||
grub_file_t file = NULL;
|
||||
const char *isopart = NULL;
|
||||
int exists[VTOY_CHKSUM_NUM] = { 0, 0, 0, 0 };
|
||||
int totexist = 0;
|
||||
|
||||
(void)argc;
|
||||
(void)ctxt;
|
||||
|
||||
isopart = grub_env_get("vtoy_iso_part");
|
||||
|
||||
for (i = 0; i < VTOY_CHKSUM_NUM; i++)
|
||||
{
|
||||
if (ventoy_check_file_exist("%s%s.%s", isopart, args[0], g_lower_chksum_name[i]))
|
||||
{
|
||||
exists[i] = 1;
|
||||
totexist++;
|
||||
}
|
||||
}
|
||||
|
||||
if (totexist == VTOY_CHKSUM_NUM)
|
||||
{
|
||||
goto end;
|
||||
}
|
||||
|
||||
cnt = ventoy_str_chrcnt(args[0], '/');
|
||||
if (cnt > 1)
|
||||
{
|
||||
pos = grub_strrchr(args[0], '/');
|
||||
c = *pos;
|
||||
*pos = 0;
|
||||
file = ventoy_grub_file_open(VENTOY_FILE_TYPE, "%s%s/VENTOY_CHECKSUM", isopart, args[0]);
|
||||
*pos = c;
|
||||
|
||||
if (file)
|
||||
{
|
||||
if (tip == 0 && file->size > (32 * VTOY_SIZE_1KB))
|
||||
{
|
||||
tip = 1;
|
||||
grub_printf("Reading checksum file...\n");
|
||||
grub_refresh();
|
||||
}
|
||||
|
||||
debug("parse local VENTOY_CHECKSUM\n");
|
||||
ventoy_find_all_checksum(file, args[0], 2, exists, &totexist);
|
||||
grub_file_close(file);
|
||||
}
|
||||
}
|
||||
|
||||
if (totexist == VTOY_CHKSUM_NUM)
|
||||
{
|
||||
goto end;
|
||||
}
|
||||
|
||||
file = ventoy_grub_file_open(VENTOY_FILE_TYPE, "%s/VENTOY_CHECKSUM", isopart);
|
||||
if (file)
|
||||
{
|
||||
if (tip == 0 && file->size > (32 * VTOY_SIZE_1KB))
|
||||
{
|
||||
tip = 1;
|
||||
grub_printf("Reading checksum file...\n");
|
||||
grub_refresh();
|
||||
}
|
||||
|
||||
debug("parse global VENTOY_CHECKSUM\n");
|
||||
ventoy_find_all_checksum(file, args[0], (cnt > 1) ? 3 : 4, exists, &totexist);
|
||||
grub_file_close(file);
|
||||
}
|
||||
|
||||
end:
|
||||
|
||||
ventoy_env_int_set("VT_EXIST_MD5", exists[0]);
|
||||
ventoy_env_int_set("VT_EXIST_SHA1", exists[1]);
|
||||
ventoy_env_int_set("VT_EXIST_SHA256", exists[2]);
|
||||
ventoy_env_int_set("VT_EXIST_SHA512", exists[3]);
|
||||
|
||||
VENTOY_CMD_RETURN(0);
|
||||
}
|
||||
|
||||
|
||||
static const char * ventoy_menu_lang_read_hook(struct grub_env_var *var, const char *val)
|
||||
{
|
||||
(void)var;
|
||||
return ventoy_get_vmenu_title(val);
|
||||
}
|
||||
|
||||
int ventoy_env_init(void)
|
||||
{
|
||||
int i;
|
||||
@@ -6167,6 +6737,10 @@ int ventoy_env_init(void)
|
||||
|
||||
grub_env_set("vtdebug_flag", "");
|
||||
|
||||
grub_register_vtoy_menu_lang_hook(ventoy_menu_lang_read_hook);
|
||||
ventoy_ctrl_var_init();
|
||||
ventoy_global_var_init();
|
||||
|
||||
g_part_list_buf = grub_malloc(VTOY_PART_BUF_LEN);
|
||||
g_tree_script_buf = grub_malloc(VTOY_MAX_SCRIPT_BUF);
|
||||
g_list_script_buf = grub_malloc(VTOY_MAX_SCRIPT_BUF);
|
||||
@@ -6201,6 +6775,14 @@ int ventoy_env_init(void)
|
||||
grub_snprintf(buf, sizeof(buf), "0x%lx", (ulong)ventoy_chain_file_read);
|
||||
grub_env_set("vtoy_chain_file_read", buf);
|
||||
grub_env_export("vtoy_chain_file_read");
|
||||
|
||||
grub_snprintf(buf, sizeof(buf), "0x%lx", (ulong)ventoy_get_vmenu_title);
|
||||
grub_env_set("VTOY_VMENU_FUNC_ADDR", buf);
|
||||
grub_env_export("VTOY_VMENU_FUNC_ADDR");
|
||||
|
||||
grub_snprintf(buf, sizeof(buf), "%s-%s", GRUB_TARGET_CPU, GRUB_PLATFORM);
|
||||
grub_env_set("grub_cpu_platform", buf);
|
||||
grub_env_export("grub_cpu_platform");
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -6368,6 +6950,14 @@ static cmd_para ventoy_cmds[] =
|
||||
{ "vt_systemd_menu", ventoy_cmd_linux_systemd_menu, 0, NULL, "", "", NULL },
|
||||
{ "vt_limine_menu", ventoy_cmd_linux_limine_menu, 0, NULL, "", "", NULL },
|
||||
{ "vt_secondary_recover_mode", ventoy_cmd_secondary_recover_mode, 0, NULL, "", "", NULL },
|
||||
{ "vt_load_menu_lang", ventoy_cmd_load_menu_lang, 0, NULL, "", "", NULL },
|
||||
{ "vt_init_menu_lang", ventoy_cmd_init_menu_lang, 0, NULL, "", "", NULL },
|
||||
{ "vt_cur_menu_lang", ventoy_cmd_cur_menu_lang, 0, NULL, "", "", NULL },
|
||||
{ "vt_vtoychksum_exist", ventoy_cmd_vtoychksum_exist, 0, NULL, "", "", NULL },
|
||||
{ "vt_cmp_checksum", ventoy_cmd_cmp_checksum, 0, NULL, "", "", NULL },
|
||||
{ "vt_push_menu_lang", ventoy_cmd_push_menulang, 0, NULL, "", "", NULL },
|
||||
{ "vt_pop_menu_lang", ventoy_cmd_pop_menulang, 0, NULL, "", "", NULL },
|
||||
|
||||
};
|
||||
|
||||
int ventoy_register_all_cmd(void)
|
||||
|
@@ -62,6 +62,8 @@
|
||||
|
||||
#define VTOY_WARNING "!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!"
|
||||
|
||||
#define VTOY_CHKSUM_NUM 4
|
||||
|
||||
#define VTOY_PLAT_I386_UEFI 0x49413332
|
||||
#define VTOY_PLAT_ARM64_UEFI 0x41413634
|
||||
#define VTOY_PLAT_X86_64_UEFI 0x55454649
|
||||
@@ -77,6 +79,10 @@
|
||||
#define VTOY_ARCH_CPIO "ventoy_x86.cpio"
|
||||
#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_8(arg) arg[0], arg[1], arg[2], arg[3], arg[4], arg[5], arg[6], arg[7]
|
||||
|
||||
@@ -99,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
|
||||
{
|
||||
VTOY_FILE_FLT_ISO = 0, /* .iso */
|
||||
@@ -611,6 +639,11 @@ typedef struct chk_case_fs_dir
|
||||
}chk_case_fs_dir;
|
||||
|
||||
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_strncmp (const char *pattern, const char *str, grub_size_t n);
|
||||
void ventoy_fill_os_param(grub_file_t file, ventoy_os_param *param);
|
||||
@@ -1053,6 +1086,9 @@ extern int g_ventoy_case_insensitive;
|
||||
extern int g_ventoy_fn_mutex;
|
||||
extern grub_uint8_t g_ventoy_chain_type;
|
||||
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_BLACK_LIST 2
|
||||
@@ -1240,6 +1276,19 @@ typedef struct systemd_menu_ctx
|
||||
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;
|
||||
@@ -1258,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_img_name_valid(const char *filename, grub_size_t namelen);
|
||||
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__ */
|
||||
|
||||
|
@@ -177,10 +177,7 @@ static grub_err_t ventoy_isolinux_initrd_collect(grub_file_t file, const char *p
|
||||
{
|
||||
nextline = ventoy_get_line(start);
|
||||
|
||||
while (ventoy_isspace(*start))
|
||||
{
|
||||
start++;
|
||||
}
|
||||
VTOY_SKIP_SPACE(start);
|
||||
|
||||
offset = 7; // strlen("initrd=") or "INITRD " or "initrd "
|
||||
pos = grub_strstr(start, "initrd=");
|
||||
@@ -438,10 +435,7 @@ static grub_err_t ventoy_grub_cfg_initrd_collect(const char *fileName)
|
||||
{
|
||||
nextline = ventoy_get_line(start);
|
||||
|
||||
while (ventoy_isspace(*start))
|
||||
{
|
||||
start++;
|
||||
}
|
||||
VTOY_SKIP_SPACE(start);
|
||||
|
||||
if (grub_strncmp(start, "initrd", 6) != 0)
|
||||
{
|
||||
@@ -454,10 +448,7 @@ static grub_err_t ventoy_grub_cfg_initrd_collect(const char *fileName)
|
||||
start++;
|
||||
}
|
||||
|
||||
while (ventoy_isspace(*start))
|
||||
{
|
||||
start++;
|
||||
}
|
||||
VTOY_SKIP_SPACE(start);
|
||||
|
||||
if (*start == '"')
|
||||
{
|
||||
@@ -528,10 +519,7 @@ static grub_err_t ventoy_grub_cfg_initrd_collect(const char *fileName)
|
||||
|
||||
if (*start == ' ' || *start == '\t')
|
||||
{
|
||||
while (ventoy_isspace(*start))
|
||||
{
|
||||
start++;
|
||||
}
|
||||
VTOY_SKIP_SPACE(start);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1813,18 +1801,12 @@ static char *ventoy_systemd_conf_tag(char *buf, const char *tag, int optional)
|
||||
for (start = buf; start; start = nextline)
|
||||
{
|
||||
nextline = ventoy_get_line(start);
|
||||
while (ventoy_isspace(*start))
|
||||
{
|
||||
start++;
|
||||
}
|
||||
VTOY_SKIP_SPACE(start);
|
||||
|
||||
if (grub_strncmp(start, tag, taglen) == 0 && (start[taglen] == ' ' || start[taglen] == '\t'))
|
||||
{
|
||||
start += taglen;
|
||||
while (ventoy_isspace(*start))
|
||||
{
|
||||
start++;
|
||||
}
|
||||
VTOY_SKIP_SPACE(start);
|
||||
return start;
|
||||
}
|
||||
}
|
||||
@@ -2038,10 +2020,7 @@ grub_err_t ventoy_cmd_linux_limine_menu(grub_extcmd_context_t ctxt, int argc, ch
|
||||
for (start = filebuf; start; start = nextline)
|
||||
{
|
||||
nextline = ventoy_get_line(start);
|
||||
while (ventoy_isspace(*start))
|
||||
{
|
||||
start++;
|
||||
}
|
||||
VTOY_SKIP_SPACE(start);
|
||||
|
||||
if (start[0] == ':')
|
||||
{
|
||||
|
@@ -35,6 +35,7 @@
|
||||
#include <grub/crypto.h>
|
||||
#include <grub/time.h>
|
||||
#include <grub/font.h>
|
||||
#include <grub/video.h>
|
||||
#include <grub/ventoy.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 image_list *g_image_list_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_res_fit = 0;
|
||||
static int g_theme_num = 0;
|
||||
static theme_list *g_theme_head = NULL;
|
||||
static int g_theme_random = vtoy_theme_random_boot_second;
|
||||
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)
|
||||
{
|
||||
@@ -375,6 +380,18 @@ static int ventoy_plugin_theme_entry(VTOY_JSON *json, const char *isodisk)
|
||||
if (g_theme_num > 0)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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");
|
||||
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");
|
||||
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");
|
||||
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");
|
||||
@@ -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,
|
||||
"menuentry 'Return to previous menu [Esc]' --class=vtoyret VTOY_RET {\n"
|
||||
"menuentry \"$VTLANG_RETURN_PREVIOUS\" --class=vtoyret VTOY_RET {\n"
|
||||
"echo 'Return ...'\n"
|
||||
"}\n");
|
||||
|
||||
@@ -3379,13 +3396,19 @@ grub_err_t ventoy_cmd_select_theme_cfg(grub_extcmd_context_t ctxt, int argc, cha
|
||||
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_uint32_t i = 0;
|
||||
grub_uint32_t mod = 0;
|
||||
grub_uint32_t theme_num = 0;
|
||||
theme_list *node = g_theme_head;
|
||||
struct grub_datetime datetime;
|
||||
|
||||
struct grub_video_mode_info info;
|
||||
char buf[64];
|
||||
char **pThemePath = NULL;
|
||||
|
||||
(void)argc;
|
||||
(void)args;
|
||||
(void)ctxt;
|
||||
@@ -3415,41 +3438,82 @@ grub_err_t ventoy_cmd_set_theme(grub_extcmd_context_t ctxt, int argc, char **arg
|
||||
goto end;
|
||||
}
|
||||
|
||||
grub_memset(&datetime, 0, sizeof(datetime));
|
||||
grub_get_datetime(&datetime);
|
||||
|
||||
if (g_theme_random == vtoy_theme_random_boot_second)
|
||||
pThemePath = (char **)grub_zalloc(sizeof(char *) * g_theme_num);
|
||||
if (!pThemePath)
|
||||
{
|
||||
grub_divmod32((grub_uint32_t)datetime.second, (grub_uint32_t)g_theme_num, &mod);
|
||||
}
|
||||
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);
|
||||
goto end;
|
||||
}
|
||||
|
||||
debug("%04d/%02d/%02d %02d:%02d:%02d radom:%d mod:%d\n",
|
||||
datetime.year, datetime.month, datetime.day,
|
||||
datetime.hour, datetime.minute, datetime.second,
|
||||
g_theme_random, mod);
|
||||
|
||||
for (i = 0; i < mod && node; i++)
|
||||
if (g_theme_res_fit)
|
||||
{
|
||||
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);
|
||||
grub_env_set("theme", node->theme.path);
|
||||
if (theme_num == 0)
|
||||
{
|
||||
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:
|
||||
|
||||
grub_check_free(pThemePath);
|
||||
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)
|
||||
{
|
||||
(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);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -148,9 +148,10 @@ static int ventoy_vhd_patch_path(char *vhdpath, ventoy_patch_vhd *patch1, ventoy
|
||||
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 find = 0;
|
||||
int ret = 1;
|
||||
grub_uint64_t start;
|
||||
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)
|
||||
{
|
||||
*index = i;
|
||||
find = 1;
|
||||
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)
|
||||
{
|
||||
*index = i;
|
||||
find = 1;
|
||||
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;
|
||||
|
||||
end:
|
||||
@@ -226,7 +239,7 @@ static int ventoy_vhd_patch_disk(const char *vhdpath, ventoy_patch_vhd *patch1,
|
||||
else
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -249,9 +262,11 @@ static int ventoy_vhd_patch_disk(const char *vhdpath, ventoy_patch_vhd *patch1,
|
||||
}
|
||||
else
|
||||
{
|
||||
offset = gpt->MBR.PartTbl[partIndex].StartSectorId;
|
||||
if (offset == 0)
|
||||
{
|
||||
offset = gpt->MBR.PartTbl[partIndex].StartSectorId;
|
||||
}
|
||||
offset *= 512;
|
||||
|
||||
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 + 2], gpt->MBR.BootCode[0x1b8 + 3],
|
||||
|
@@ -1090,6 +1090,12 @@ static int ventoy_fill_windows_rtdata(void *buf, char *isopath, int dataflag)
|
||||
{
|
||||
data->windows11_bypass_check = 1;
|
||||
}
|
||||
|
||||
env = grub_env_get("VTOY_WIN11_BYPASS_NRO");
|
||||
if (env && env[0] == '1' && env[1] == 0)
|
||||
{
|
||||
data->windows11_bypass_nro = 1;
|
||||
}
|
||||
|
||||
pos = grub_strstr(isopath, "/");
|
||||
if (!pos)
|
||||
@@ -1442,6 +1448,7 @@ grub_err_t ventoy_cmd_sel_winpe_wim(grub_extcmd_context_t ctxt, int argc, char *
|
||||
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);
|
||||
@@ -1449,6 +1456,7 @@ grub_err_t ventoy_cmd_sel_winpe_wim(grub_extcmd_context_t ctxt, int argc, char *
|
||||
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)
|
||||
{
|
||||
|
73
GRUB2/MOD_SRC/grub-2.04/include/grub/env.h
Normal file
73
GRUB2/MOD_SRC/grub-2.04/include/grub/env.h
Normal 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 */
|
@@ -142,7 +142,9 @@ typedef struct ventoy_windows_data
|
||||
|
||||
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_install_len */
|
||||
|
@@ -12,7 +12,7 @@ make install
|
||||
PATH=$VT_DIR/GRUB2/INSTALL/bin/:$VT_DIR/GRUB2/INSTALL/sbin/:$PATH
|
||||
|
||||
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"
|
||||
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
BIN
ICON/filechecksum.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 437 KiB |
32
IMG/cpio/ventoy/hook/chimera/disk_hook.sh
Normal file
32
IMG/cpio/ventoy/hook/chimera/disk_hook.sh
Normal 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"
|
22
IMG/cpio/ventoy/hook/chimera/ventoy-hook.sh
Normal file
22
IMG/cpio/ventoy/hook/chimera/ventoy-hook.sh
Normal 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
|
@@ -26,6 +26,10 @@ ventoy_get_debian_distro() {
|
||||
if $EGREP -q "ID=.*antix|ID=.*mx" /etc/initrd-release; then
|
||||
echo 'antix'; return
|
||||
fi
|
||||
elif [ -e /etc/initrd_release ]; then
|
||||
if $EGREP -q "ID=.*antix|ID=.*mx" /etc/initrd_release; then
|
||||
echo 'antix'; return
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -e /DISTRO_SPECS ]; then
|
||||
|
40
IMG/cpio/ventoy/hook/deepin/disk_mount_hook.sh
Normal file
40
IMG/cpio/ventoy/hook/deepin/disk_mount_hook.sh
Normal file
@@ -0,0 +1,40 @@
|
||||
#!/ventoy/busybox/sh
|
||||
#************************************************************************************
|
||||
# Copyright (c) 2020, longpanda <admin@ventoy.net>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation; either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
#************************************************************************************
|
||||
|
||||
. /ventoy/hook/ventoy-hook-lib.sh
|
||||
|
||||
vtlog "####### $0 $* ########"
|
||||
|
||||
VTPATH_OLD=$PATH; PATH=$BUSYBOX_PATH:$VTOY_PATH/tool:$PATH
|
||||
|
||||
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
|
||||
|
||||
vtlog "${vtdiskname#/dev/}2 found..."
|
||||
$BUSYBOX_PATH/sh $VTOY_PATH/hook/debian/udev_disk_hook.sh "${vtdiskname#/dev/}2"
|
||||
|
||||
if [ -f /ventoy/autoinstall ]; then
|
||||
sh /ventoy/hook/default/auto_install_varexp.sh /ventoy/autoinstall
|
||||
fi
|
151
IMG/cpio/ventoy/hook/deepin/udev_disk_hook.sh
Normal file
151
IMG/cpio/ventoy/hook/deepin/udev_disk_hook.sh
Normal file
@@ -0,0 +1,151 @@
|
||||
#!/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
|
||||
|
||||
ventoy_os_install_dmsetup() {
|
||||
|
||||
vtlog "ventoy_os_install_dmsetup $1 ..."
|
||||
|
||||
vt_usb_disk=$1
|
||||
|
||||
# dump iso file location
|
||||
$VTOY_PATH/tool/vtoydm -i -f $VTOY_PATH/ventoy_image_map -d ${vt_usb_disk} > $VTOY_PATH/iso_file_list
|
||||
|
||||
# install dmsetup
|
||||
LINE=$($GREP ' dmsetup.*\.udeb' $VTOY_PATH/iso_file_list)
|
||||
if [ $? -eq 0 ]; then
|
||||
install_udeb_from_line "$LINE" ${vt_usb_disk}
|
||||
fi
|
||||
|
||||
# install libdevmapper
|
||||
LINE=$($GREP ' libdevmapper.*\.udeb' $VTOY_PATH/iso_file_list)
|
||||
if [ $? -eq 0 ]; then
|
||||
install_udeb_from_line "$LINE" ${vt_usb_disk}
|
||||
fi
|
||||
|
||||
# install md-modules
|
||||
LINE=$($GREP -i ' md-modules.*\.udeb' $VTOY_PATH/iso_file_list)
|
||||
if [ $? -eq 0 ]; then
|
||||
LINTCNT=$($GREP -i -c ' md-modules.*\.udeb' $VTOY_PATH/iso_file_list)
|
||||
if [ $LINTCNT -gt 1 ]; then
|
||||
vtlog "more than one pkgs, need to filter..."
|
||||
VER=$($BUSYBOX_PATH/uname -r)
|
||||
|
||||
LINE=$($GREP -i ' md-modules.*\.udeb' $VTOY_PATH/iso_file_list | $GREP -i $VER)
|
||||
LINTCNT=$($GREP -i ' md-modules.*\.udeb' $VTOY_PATH/iso_file_list | $GREP -i -c $VER)
|
||||
if [ $LINTCNT -gt 1 ]; then
|
||||
vtlog "Still more than one pkgs, use the first one..."
|
||||
LINE=$($GREP -i ' md-modules.*\.udeb' $VTOY_PATH/iso_file_list | $GREP -i -m1 $VER)
|
||||
fi
|
||||
fi
|
||||
install_udeb_from_line "$LINE" ${vt_usb_disk}
|
||||
fi
|
||||
|
||||
# insmod md-mod if needed
|
||||
if $GREP -q 'device-mapper' /proc/devices; then
|
||||
vtlog "device mapper module is loaded"
|
||||
else
|
||||
vtlog "device mapper module is NOT loaded, now load it..."
|
||||
|
||||
VER=$($BUSYBOX_PATH/uname -r)
|
||||
KO=$($FIND /lib/modules/$VER/kernel/drivers/md -name "dm-mod*")
|
||||
vtlog "KO=$KO"
|
||||
|
||||
insmod $KO
|
||||
fi
|
||||
|
||||
vtlog "dmsetup install finish, now check it..."
|
||||
if dmsetup info >> $VTLOG 2>&1; then
|
||||
vtlog "dmsetup work ok"
|
||||
else
|
||||
vtlog "dmsetup not work, now try to load eglibc ..."
|
||||
|
||||
# install eglibc (some ubuntu 32 bit version need it)
|
||||
LINE=$($GREP 'libc6-.*\.udeb' $VTOY_PATH/iso_file_list)
|
||||
if [ $? -eq 0 ]; then
|
||||
install_udeb_from_line "$LINE" ${vt_usb_disk}
|
||||
fi
|
||||
|
||||
if dmsetup info >> $VTLOG 2>&1; then
|
||||
vtlog "dmsetup work ok after retry"
|
||||
else
|
||||
vtlog "dmsetup still not work after retry"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
if is_ventoy_hook_finished || not_ventoy_disk "${1:0:-1}"; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
vtlog "==== $0 $* ===="
|
||||
|
||||
dmsetup_path=$(ventoy_find_bin_path dmsetup)
|
||||
if [ -z "$dmsetup_path" ]; then
|
||||
ventoy_os_install_dmsetup "/dev/${1:0:-1}"
|
||||
fi
|
||||
|
||||
if ! $GREP -q 'device-mapper' /proc/devices; then
|
||||
ventoy_os_install_dmsetup "/dev/${1:0:-1}"
|
||||
fi
|
||||
|
||||
ventoy_udev_disk_common_hook $*
|
||||
|
||||
#
|
||||
# Some distro default only accept usb partitions as install medium.
|
||||
# So if ventoy is installed on a non-USB device, we just mount /cdrom here except
|
||||
# for these has boot=live or boot=casper parameter in cmdline
|
||||
#
|
||||
VT_BUS_USB=""
|
||||
if [ -n "$ID_BUS" ]; then
|
||||
if echo $ID_BUS | $GREP -q -i usb; then
|
||||
VT_BUS_USB="YES"
|
||||
fi
|
||||
else
|
||||
if $BUSYBOX_PATH/ls -l /sys/class/block/${1:0:-1} | $GREP -q -i usb; then
|
||||
VT_BUS_USB="YES"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -n "$VT_BUS_USB" ]; then
|
||||
vtlog "$1 is USB device"
|
||||
echo /dev/$1 > /ventoy/list-devices-usb-part
|
||||
else
|
||||
vtlog "$1 is NOT USB device (bus $ID_BUS)"
|
||||
|
||||
if $EGREP -q 'boot=|casper' /proc/cmdline; then
|
||||
vtlog "boot=, or casper, don't mount"
|
||||
else
|
||||
vtlog "No boot param, need to mount"
|
||||
echo /dev/$1 > /ventoy/list-devices-usb-part
|
||||
fi
|
||||
fi
|
||||
|
||||
#special process for Linx
|
||||
if $BUSYBOX_PATH/uname -r | $GREP -q "^2\.6"; then
|
||||
if $GREP -q "linx" /proc/version; then
|
||||
blkdev_num=$($VTOY_PATH/tool/dmsetup ls | $GREP ventoy | $SED 's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1:\2/')
|
||||
vtDM=$(ventoy_find_dm_id ${blkdev_num})
|
||||
echo "/dev/$vtDM" > /ventoy/list-devices-usb-part
|
||||
fi
|
||||
fi
|
||||
|
||||
# OK finish
|
||||
set_ventoy_hook_finish
|
42
IMG/cpio/ventoy/hook/deepin/ventoy-hook.sh
Normal file
42
IMG/cpio/ventoy/hook/deepin/ventoy-hook.sh
Normal file
@@ -0,0 +1,42 @@
|
||||
#!/ventoy/busybox/sh
|
||||
#************************************************************************************
|
||||
# Copyright (c) 2020, longpanda <admin@ventoy.net>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation; either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
#************************************************************************************
|
||||
|
||||
|
||||
if [ -e /init ] && $GREP -q '^mountroot$' /init; then
|
||||
echo "Here before mountroot ..." >> $VTLOG
|
||||
|
||||
$SED "/^mountroot$/i\\$BUSYBOX_PATH/sh $VTOY_PATH/hook/deepin/disk_mount_hook.sh" -i /init
|
||||
$SED "/^mountroot$/i\\export LIVEMEDIA=/dev/mapper/ventoy" -i /init
|
||||
$SED "/^mountroot$/i\\export LIVE_MEDIA=/dev/mapper/ventoy" -i /init
|
||||
|
||||
if $GREP -q 'live-media=' /proc/cmdline; then
|
||||
if [ -f /scripts/casper ] && $GREP -q '^ *LIVEMEDIA=' /scripts/casper; then
|
||||
$SED "s#^ *LIVEMEDIA=.*#LIVEMEDIA=/dev/mapper/ventoy#" -i /scripts/casper
|
||||
fi
|
||||
fi
|
||||
else
|
||||
echo "Here use udev hook ..." >> $VTLOG
|
||||
ventoy_systemd_udevd_work_around
|
||||
ventoy_add_udev_rule "$VTOY_PATH/hook/deepin/udev_disk_hook.sh %k"
|
||||
fi
|
||||
|
||||
if [ -f $VTOY_PATH/autoinstall ]; then
|
||||
echo "Do auto install ..." >> $VTLOG
|
||||
$SED '/maybe_break[[:space:]]*init/i\/ventoy/busybox/sh /ventoy/hook/deepin/ventoy_autoinstall.sh >>/ventoy/autoinstall.log 2>&1' -i /init
|
||||
fi
|
122
IMG/cpio/ventoy/hook/deepin/ventoy_autoinstall.sh
Normal file
122
IMG/cpio/ventoy/hook/deepin/ventoy_autoinstall.sh
Normal file
@@ -0,0 +1,122 @@
|
||||
#!/ventoy/busybox/sh
|
||||
|
||||
. /ventoy/hook/ventoy_hook_lib.sh
|
||||
|
||||
change_var_value() {
|
||||
local vfile=$1
|
||||
local vkey=$2
|
||||
local vVal=$3
|
||||
local quote=$4
|
||||
local vline
|
||||
|
||||
if [ $quote -eq 0 ]; then
|
||||
vline="$vkey = $vVal"
|
||||
else
|
||||
vline="$vkey = \"$vVal\""
|
||||
fi
|
||||
|
||||
if grep -q -m1 "^$vkey[[:space:]]*=" $vfile; then
|
||||
sed "s#^$vkey[[:space:]]*=.*#$vline#g" -i $vfile
|
||||
else
|
||||
echo "$vline" >> $vfile
|
||||
fi
|
||||
}
|
||||
|
||||
setting_script_process() {
|
||||
local sfile=$1
|
||||
local vItem
|
||||
local vB64Item
|
||||
|
||||
vItem=$(grep '^language[[:space:]]*=' /ventoy/autoinstall | awk '{print $3}')
|
||||
if [ -n "$vItem" ]; then
|
||||
change_var_value $sfile 'select_language_default_locale' "$vItem" 0
|
||||
fi
|
||||
|
||||
vItem=$(grep '^timezone[[:space:]]*=' /ventoy/autoinstall | awk '{print $3}')
|
||||
if [ -n "$vItem" ]; then
|
||||
change_var_value $sfile 'timezone_default' "$vItem" 0
|
||||
fi
|
||||
|
||||
vItem=$(grep '^hostname[[:space:]]*=' /ventoy/autoinstall | awk '{print $3}')
|
||||
if [ -n "$vItem" ]; then
|
||||
change_var_value $sfile 'system_info_default_hostname' "$vItem" 1
|
||||
change_var_value $sfile 'DI_HOSTNAME' "$vItem" 1
|
||||
fi
|
||||
|
||||
vItem=$(grep '^root_password[[:space:]]*=' /ventoy/autoinstall | awk '{print $3}')
|
||||
if [ -n "$vItem" ]; then
|
||||
vB64Item=$(echo -n "$vItem" | base64)
|
||||
change_var_value $sfile 'system_info_default_root_password' "$vB64Item" 1
|
||||
change_var_value $sfile 'DI_ROOTPASSWORD' "$vB64Item" 1
|
||||
fi
|
||||
|
||||
vItem=$(grep '^default_username[[:space:]]*=' /ventoy/autoinstall | awk '{print $3}')
|
||||
if [ -n "$vItem" ]; then
|
||||
change_var_value $sfile 'system_info_default_username' "$vItem" 1
|
||||
change_var_value $sfile 'DI_USERNAME' "$vItem" 1
|
||||
fi
|
||||
|
||||
vItem=$(grep '^default_password[[:space:]]*=' /ventoy/autoinstall | awk '{print $3}')
|
||||
if [ -n "$vItem" ]; then
|
||||
change_var_value $sfile 'system_info_default_password' "$vItem" 1
|
||||
change_var_value $sfile 'DI_PASSWORD' "$vItem" 1
|
||||
fi
|
||||
|
||||
vItem=$(grep '^install_disk[[:space:]]*=' /ventoy/autoinstall | awk '{print $3}')
|
||||
if [ -n "$vItem" ]; then
|
||||
echo "DI_FULLDISK_MULTIDISK_DEVICE = $vItem" >> $sfile
|
||||
echo "DI_ROOTDISK = $vItem" >> $sfile
|
||||
echo "DI_BOOTLOADER = $vItem" >> $sfile
|
||||
fi
|
||||
|
||||
change_var_value $sfile 'skip_virtual_machine_page' 'true' 0
|
||||
change_var_value $sfile 'skip_select_language_page' 'true' 0
|
||||
change_var_value $sfile 'skip_select_language_page_on_first_boot' 'true' 0
|
||||
change_var_value $sfile 'skip_system_keyboard_page' 'true' 0
|
||||
change_var_value $sfile 'skip_system_info_page' 'true' 0
|
||||
change_var_value $sfile 'skip_qr_code_system_info_page' 'true' 0
|
||||
change_var_value $sfile 'skip_timezone_page' 'true' 0
|
||||
change_var_value $sfile 'skip_partition_page' 'true' 0
|
||||
change_var_value $sfile 'system_info_password_validate_required' '0' 0
|
||||
change_var_value $sfile 'system_info_password_strong_check' 'false' 0
|
||||
change_var_value $sfile 'partition_do_auto_part' 'true' 0
|
||||
change_var_value $sfile 'system_info_disable_license' 'true' 0
|
||||
change_var_value $sfile 'system_info_disable_experience' 'true' 0
|
||||
change_var_value $sfile 'system_info_disable_privacy_license' 'true' 0
|
||||
|
||||
#filesystem.squashfs search ini
|
||||
#first_page_state=0,表示不跳过首页,展示首页让用户自己选择
|
||||
#first_page_state=1,表示跳过首页,并且自动点击一键安装
|
||||
#first_page_state=2,表示跳过首页,并且自动点击自定义安装
|
||||
#first_page_state=3,表示跳过首页,并且直接以全盘安装方式自动安装
|
||||
change_var_value $sfile 'first_page_state' '3' 0
|
||||
}
|
||||
|
||||
update_settings() {
|
||||
local script=$1
|
||||
local newscript
|
||||
|
||||
echo "update_settings for $script ..."
|
||||
|
||||
newscript=$(basename $script)
|
||||
cp -a $script /ventoy/vini_${newscript}
|
||||
setting_script_process /ventoy/vini_${newscript}
|
||||
|
||||
rm -f $script
|
||||
cp -a /ventoy/vini_${newscript} $script
|
||||
}
|
||||
|
||||
sh /ventoy/hook/common/auto_install_varexp.sh /ventoy/autoinstall
|
||||
|
||||
update_settings /root/usr/share/deepin-installer/resources/default_settings.ini
|
||||
|
||||
ls -1 /root/usr/share/deepin-installer/resources/override/ | while read line; do
|
||||
update_settings /root/usr/share/deepin-installer/resources/override/$line
|
||||
done
|
||||
|
||||
ls -1 /root/usr/share/deepin-installer/resources/oem/ | while read line; do
|
||||
update_settings /root/usr/share/deepin-installer/resources/oem/$line
|
||||
done
|
||||
|
||||
|
||||
|
@@ -24,6 +24,7 @@
|
||||
|
||||
if [ -f $VTOY_PATH/autoinstall ]; then
|
||||
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
|
||||
for vtParam in $($CAT /proc/cmdline); do
|
||||
if echo $vtParam | $GREP -q 'ks=file:/'; then
|
||||
@@ -90,23 +91,7 @@ if ls $VTOY_PATH | $GREP -q 'ventoy_dud[0-9]'; then
|
||||
fi
|
||||
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=
|
||||
if [ -f /etc/system-release ]; then
|
||||
@@ -125,12 +110,61 @@ if $GREP -i -q Fedora /proc/version; then
|
||||
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
|
||||
|
||||
if [ "$vtNeedRepo" = "yes" ]; then
|
||||
$BUSYBOX_PATH/cp -a $VTOY_PATH/hook/rhel7/ventoy-repo.sh /lib/dracut/hooks/pre-pivot/99-ventoy-repo.sh
|
||||
fi
|
||||
|
||||
|
||||
#iso-scan (currently only for Fedora)
|
||||
if $GREP -q Fedora /etc/os-release; then
|
||||
if /ventoy/tool/vtoydump -a /ventoy/ventoy_os_param; then
|
||||
if ventoy_iso_scan_check; then
|
||||
echo "iso_scan process ..." >> $VTLOG
|
||||
|
||||
vtIsoPath=$(/ventoy/tool/vtoydump -p /ventoy/ventoy_os_param)
|
||||
VTISO_SCAN="iso-scan/filename=$vtIsoPath"
|
||||
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
|
||||
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
|
||||
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
|
||||
@@ -147,6 +181,18 @@ if $GREP -i -q 'fedora.*coreos' /etc/os-release; then
|
||||
cp -a $VTOY_PATH/hook/rhel7/ventoy-make-link.sh /lib/dracut/hooks/pre-mount/99-ventoy-premount-mklink.sh
|
||||
fi
|
||||
|
||||
if [ -f $VTOY_PATH/autoinstall ]; then
|
||||
cp -a $VTOY_PATH/hook/rhel7/ventoy-autoexp.sh /lib/dracut/hooks/pre-mount/99-ventoy-autoexp.sh
|
||||
|
||||
#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
|
||||
|
||||
|
26
IMG/cpio/ventoy/hook/rhel7/ventoy-inotifyd-call.sh
Normal file
26
IMG/cpio/ventoy/hook/rhel7/ventoy-inotifyd-call.sh
Normal 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"
|
@@ -50,7 +50,11 @@ if is_inotify_ventoy_part $3; then
|
||||
vtScript=$($GREP -m1 'RUN.=' $vtGenRulFile | $AWK -F'RUN.=' '{print $2}' | $SED 's/"\(.*\)".*/\1/')
|
||||
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
|
||||
else
|
||||
$vtScript
|
||||
|
@@ -27,5 +27,8 @@ if [ "$vtdisk" = "unknown" ]; then
|
||||
$BUSYBOX_PATH/nohup $VTOY_PATH/tool/inotifyd $vtHook /dev:n 2>&- &
|
||||
else
|
||||
vtlog "... $vtdisk already exist ..."
|
||||
$BUSYBOX_PATH/sh $vtHook n /dev "${vtdisk#/dev/}2"
|
||||
|
||||
#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
|
||||
|
@@ -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/')
|
||||
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"
|
||||
ln -s /dev/$vtDM /dev/mapper/ventoy
|
||||
fi
|
||||
@@ -35,7 +37,13 @@ VTLABEL=$($BUSYBOX_PATH/blkid /dev/$vtDM | $SED 's/.*LABEL="\([^"]*\)".*/\1/')
|
||||
vtlog "VTLABEL=$VTLABEL"
|
||||
|
||||
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"
|
||||
ln -s /dev/$vtDM "/dev/disk/by-label/$VTLABEL"
|
||||
fi
|
||||
|
@@ -23,7 +23,18 @@ vtlog "##### $0 $* ..."
|
||||
|
||||
VTPATH_OLD=$PATH; PATH=$BUSYBOX_PATH:$VTOY_PATH/tool:$PATH
|
||||
|
||||
repodev=$(ls $VTOY_PATH/dev_backup*)
|
||||
echo "inst.repo=hd:/dev/${repodev#*dev_backup_}" >> /sysroot/etc/cmdline
|
||||
if [ -f /ventoy/vtoy_iso_scan ]; then
|
||||
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
|
||||
|
@@ -223,6 +223,42 @@ ventoy_check_dm_module() {
|
||||
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() {
|
||||
if [ "$VTOY_LINUX_REMOUNT" != "01" ]; then
|
||||
if $GREP -q 'VTOY_LINUX_REMOUNT=1' /proc/cmdline; then
|
||||
@@ -269,6 +305,16 @@ ventoy_dm_patch() {
|
||||
return
|
||||
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
|
||||
vtlog "/ventoy/tool/$vtKoName exist OK"
|
||||
else
|
||||
@@ -305,6 +351,9 @@ ventoy_dm_patch() {
|
||||
|
||||
if [ "$VTOY_DEBUG_LEVEL" = "01" ]; then
|
||||
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"
|
||||
else
|
||||
printk_addr=0
|
||||
@@ -361,14 +410,16 @@ ventoy_dm_patch() {
|
||||
return
|
||||
fi
|
||||
|
||||
|
||||
|
||||
#step1: modify vermagic/mod crc/relocation
|
||||
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
|
||||
|
||||
#step2: fill parameters
|
||||
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"
|
||||
$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 $vtKv $vtIBT $vtDebug
|
||||
|
||||
$BUSYBOX_PATH/insmod $VTOY_PATH/tool/$vtKoName
|
||||
|
||||
@@ -892,3 +943,17 @@ ventoy_check_umount() {
|
||||
fi
|
||||
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
|
||||
}
|
||||
|
@@ -121,3 +121,53 @@ ventoy_check_mount() {
|
||||
$BUSYBOX_PATH/mount $1 $2
|
||||
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 ]
|
||||
}
|
||||
|
@@ -34,9 +34,12 @@ else
|
||||
vtBit=32
|
||||
fi
|
||||
|
||||
xz -d $VTOY_PATH/vtloopex/dm-mod/$vtKerVer/$vtBit/dm-mod.ko.xz
|
||||
insmod $VTOY_PATH/vtloopex/dm-mod/$vtKerVer/$vtBit/dm-mod.ko
|
||||
|
||||
if [ -f $VTOY_PATH/vtloopex/dm-mod/$vtKerVer/$vtBit/dm-mod.ko.xz ]; then
|
||||
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
|
||||
|
||||
|
46
IMG/cpio/ventoy/loop/fwts/ventoy-disk.sh
Normal file
46
IMG/cpio/ventoy/loop/fwts/ventoy-disk.sh
Normal 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
|
23
IMG/cpio/ventoy/loop/fwts/ventoy-hook.sh
Normal file
23
IMG/cpio/ventoy/loop/fwts/ventoy-hook.sh
Normal 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
|
@@ -64,9 +64,9 @@ ventoy_get_os_type() {
|
||||
elif $GREP -q '[Uu]buntu' /proc/version; then
|
||||
echo 'debian'; return
|
||||
|
||||
# Deepin : do the same process with debian
|
||||
# Deepin :
|
||||
elif $GREP -q '[Dd]eepin' /proc/version; then
|
||||
echo 'debian'; return
|
||||
echo 'deepin'; return
|
||||
|
||||
# rhel5/CentOS5 and all other distributions based on them
|
||||
elif $GREP -q 'el5' /proc/version; then
|
||||
@@ -169,9 +169,9 @@ ventoy_get_os_type() {
|
||||
elif $GREP -q 'fuyu' /etc/os-release; then
|
||||
echo 'openEuler'; return
|
||||
elif $GREP -q 'deepin' /etc/os-release; then
|
||||
echo 'debian'; return
|
||||
echo 'deepin'; return
|
||||
elif $GREP -q 'chinauos' /etc/os-release; then
|
||||
echo 'debian'; return
|
||||
echo 'deepin'; return
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -229,6 +229,10 @@ ventoy_get_os_type() {
|
||||
echo 'android'; return
|
||||
fi
|
||||
|
||||
if $GREP -q 'android.google' /proc/version; then
|
||||
echo 'android'; return
|
||||
fi
|
||||
|
||||
if $GREP -q 'adelielinux' /proc/version; then
|
||||
echo 'adelie'; return
|
||||
fi
|
||||
@@ -369,6 +373,9 @@ ventoy_get_os_type() {
|
||||
fi
|
||||
fi
|
||||
|
||||
if $GREP -q 'chimera' /proc/version; then
|
||||
echo 'chimera'; return
|
||||
fi
|
||||
|
||||
echo "default"
|
||||
}
|
||||
|
Binary file not shown.
BIN
IMG/cpio_x86/ventoy/tool/dm_patch_ibt_64.ko
Normal file
BIN
IMG/cpio_x86/ventoy/tool/dm_patch_ibt_64.ko
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
INSTALL/EFI/BOOT/MokManager.efi
Normal file
BIN
INSTALL/EFI/BOOT/MokManager.efi
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,7 +1,7 @@
|
||||
|
||||
========== 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
|
||||
CMD:
|
||||
@@ -18,16 +18,16 @@ Please refer https://www.ventoy.net/en/doc_start.html for details.
|
||||
|
||||
|
||||
========== VentoyWeb.sh ===============
|
||||
1. sudo sh VentoyWeb.sh
|
||||
1. sudo bash VentoyWeb.sh
|
||||
2. open your browser and visit http://127.0.0.1:24680
|
||||
|
||||
|
||||
========== 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
|
||||
|
||||
========== VentoyVlnk.sh ===============
|
||||
Usage: sudo sh VentoyVlnk.sh CMD FILE
|
||||
Usage: sudo bash VentoyVlnk.sh CMD FILE
|
||||
CMD:
|
||||
-c FILE create vlnk for FILE
|
||||
-l VLNK parse vlnk file
|
||||
@@ -43,21 +43,21 @@ VentoyGUI is native GUI program for Linux (GTK/QT)
|
||||
|
||||
========== 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
|
||||
sh 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
|
||||
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 ----> persistence.dat in 1GB size and ext4 filesystem and casper-rw label
|
||||
bash CreatePersistentImg.sh -l MX-Persist ----> persistence.dat in 1GB size and ext4 filesystem and MX-Persist label
|
||||
bash CreatePersistentImg.sh -s 2048 ----> persistence.dat in 2GB size and ext4 filesystem 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.
|
||||
|
||||
|
||||
|
||||
========== ExtendPersistentImg.sh ===============
|
||||
sudo sh ExtendPersistentImg.sh file size
|
||||
sudo bash ExtendPersistentImg.sh file size
|
||||
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)
|
||||
|
||||
Please refer https://www.ventoy.net/en/plugin_persistence.html for details.
|
||||
|
Binary file not shown.
@@ -12,11 +12,11 @@ if [ -f ./ventoy/version ]; then
|
||||
curver=$(cat ./ventoy/version)
|
||||
fi
|
||||
|
||||
if uname -m | egrep -q 'aarch64|arm64'; then
|
||||
if uname -m | grep -E -q 'aarch64|arm64'; then
|
||||
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
|
||||
elif uname -m | egrep -q 'mips64'; then
|
||||
elif uname -m | grep -E -q 'mips64'; then
|
||||
export TOOLDIR=mips64el
|
||||
else
|
||||
export TOOLDIR=i386
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -30,13 +30,13 @@ fi
|
||||
OLDDIR=$(pwd)
|
||||
|
||||
machine=$(uname -m)
|
||||
if echo $machine | egrep -q 'aarch64|arm64'; then
|
||||
if echo $machine | grep -E -q 'aarch64|arm64'; then
|
||||
TOOLDIR=aarch64
|
||||
elif echo $machine | egrep -q 'x86_64|amd64'; then
|
||||
elif echo $machine | grep -E -q 'x86_64|amd64'; then
|
||||
TOOLDIR=x86_64
|
||||
elif echo $machine | egrep -q 'mips64'; then
|
||||
elif echo $machine | grep -E -q 'mips64'; then
|
||||
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
|
||||
else
|
||||
echo "Unsupported machine type $machine"
|
||||
@@ -122,7 +122,7 @@ if echo $DISK | grep -q "[a-z]d[a-z][1-9]"; then
|
||||
DISK=${DISK:0:-1}
|
||||
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
|
||||
DISK=${DISK:0:-2}
|
||||
fi
|
||||
|
@@ -23,11 +23,11 @@ fi
|
||||
|
||||
OLDDIR=$(pwd)
|
||||
|
||||
if uname -m | egrep -q 'aarch64|arm64'; then
|
||||
if uname -m | grep -E -q 'aarch64|arm64'; then
|
||||
TOOLDIR=aarch64
|
||||
elif uname -m | egrep -q 'x86_64|amd64'; then
|
||||
elif uname -m | grep -E -q 'x86_64|amd64'; then
|
||||
TOOLDIR=x86_64
|
||||
elif uname -m | egrep -q 'mips64'; then
|
||||
elif uname -m | grep -E -q 'mips64'; then
|
||||
TOOLDIR=mips64el
|
||||
else
|
||||
TOOLDIR=i386
|
||||
|
@@ -3,7 +3,7 @@
|
||||
VTOY_PATH=$PWD/..
|
||||
|
||||
date +"%Y/%m/%d %H:%M:%S"
|
||||
echo downloading envrionment ...
|
||||
echo downloading environment ...
|
||||
|
||||
wget -q -P $VTOY_PATH/DOC/ https://github.com/ventoy/vtoytoolchain/releases/download/1.0/dietlibc-0.34.tar.xz
|
||||
wget -q -P $VTOY_PATH/DOC/ https://github.com/ventoy/vtoytoolchain/releases/download/1.0/musl-1.2.1.tar.gz
|
||||
@@ -14,6 +14,6 @@ wget -q -P /opt/ https://github.com/ventoy/vtoytoolchain/releases/download/1.0/a
|
||||
wget -q -P /opt/ https://github.com/ventoy/vtoytoolchain/releases/download/1.0/mips-loongson-gcc7.3-2019.06-29-linux-gnu.tar.gz
|
||||
|
||||
date +"%Y/%m/%d %H:%M:%S"
|
||||
echo downloading envrionment finish...
|
||||
echo downloading environment finish...
|
||||
|
||||
sh all_in_one.sh CI
|
||||
|
Binary file not shown.
@@ -1,117 +1,96 @@
|
||||
|
||||
if [ -e "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}.md5" ]; then
|
||||
set default=0
|
||||
menuentry "Calculate and check md5sum" --class=checksum_md5 {
|
||||
unset vtchkdef
|
||||
vt_vtoychksum_exist "${VTOY_CHKSUM_FILE_PATH}"
|
||||
|
||||
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}"
|
||||
|
||||
vt_1st_line "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}.md5" vtReadChecksum
|
||||
|
||||
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 ..."
|
||||
echo -en "\n\n$VTLANG_ENTER_EXIT ..."
|
||||
read vtInputKey
|
||||
}
|
||||
fi
|
||||
|
||||
if [ -e "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}.sha1" ]; then
|
||||
set default=1
|
||||
menuentry "Calculate and check sha1sum" --class=checksum_sha1 {
|
||||
if [ "$VT_EXIST_SHA1" = "1" ]; then
|
||||
if [ -z "$vtchkdef" ]; then
|
||||
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}"
|
||||
|
||||
vt_1st_line "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}.sha1" vtReadChecksum
|
||||
|
||||
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 ..."
|
||||
echo -en "\n\n$VTLANG_ENTER_EXIT ..."
|
||||
read vtInputKey
|
||||
}
|
||||
fi
|
||||
|
||||
|
||||
|
||||
if [ -e "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}.sha256" ]; then
|
||||
set default=2
|
||||
menuentry "Calculate and check sha256sum" --class=checksum_sha256 {
|
||||
if [ "$VT_EXIST_SHA256" = "1" ]; then
|
||||
if [ -z "$vtchkdef" ]; then
|
||||
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}"
|
||||
|
||||
vt_1st_line "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}.sha256" vtReadChecksum
|
||||
|
||||
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 ..."
|
||||
echo -en "\n\n$VTLANG_ENTER_EXIT ..."
|
||||
read vtInputKey
|
||||
}
|
||||
fi
|
||||
|
||||
|
||||
|
||||
if [ -e "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}.sha512" ]; then
|
||||
set default=3
|
||||
menuentry "Calculate and check sha512sum" --class=checksum_sha512{
|
||||
if [ "$VT_EXIST_SHA512" = "1" ]; then
|
||||
if [ -z "$vtchkdef" ]; then
|
||||
set default=3
|
||||
set vtchkdef=1
|
||||
fi
|
||||
menuentry "$VTLANG_CHKSUM_SHA512_CALC_CHK" --class=checksum_sha512{
|
||||
sha512sum "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}"
|
||||
vt_cmp_checksum 3 "${VTOY_CHKSUM_FILE_PATH}"
|
||||
|
||||
vt_1st_line "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}.sha512" vtReadChecksum
|
||||
|
||||
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 ..."
|
||||
echo -en "\n\n$VTLANG_ENTER_EXIT ..."
|
||||
read vtInputKey
|
||||
}
|
||||
else
|
||||
menuentry "Calculate sha512sum" --class=checksum_sha512{
|
||||
menuentry "$VTLANG_CHKSUM_SHA512_CALC" --class=checksum_sha512{
|
||||
sha512sum "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}"
|
||||
|
||||
echo -e "\n\npress ENTER to exit ..."
|
||||
echo -en "\n\n$VTLANG_ENTER_EXIT ..."
|
||||
read vtInputKey
|
||||
}
|
||||
fi
|
||||
|
||||
|
||||
menuentry 'Return to previous menu [Esc]' --class=vtoyret VTOY_RET {
|
||||
menuentry "$VTLANG_RETURN_PREVIOUS" --class=vtoyret VTOY_RET {
|
||||
echo 'Return ...'
|
||||
}
|
||||
|
@@ -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/hwinfo.cfg
|
||||
source $prefix/keyboard.cfg
|
||||
|
||||
submenu "Resolution Configuration" --class=debug_resolution --class=F5tool {
|
||||
menuentry 'Return to previous menu [Esc]' --class=vtoyret VTOY_RET {
|
||||
echo 'Return ...'
|
||||
submenu "$VTLANG_RESOLUTION_CFG" --class=debug_resolution --class=F5tool {
|
||||
menuentry "$VTLANG_RETURN_PREVIOUS" --class=vtoyret VTOY_RET {
|
||||
echo "Return ..."
|
||||
}
|
||||
|
||||
vt_update_cur_video_mode VT_CUR_MODE
|
||||
@@ -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 {
|
||||
terminal_output console
|
||||
set gfxmode=$1
|
||||
terminal_output gfxterm
|
||||
terminal_output gfxterm
|
||||
if [ "$vtoy_res_fit" = "1" ]; then
|
||||
vt_set_theme switch
|
||||
fi
|
||||
}
|
||||
|
||||
vt_incr vdid 1
|
||||
done
|
||||
}
|
||||
|
||||
submenu "Screen Display Mode" --class=debug_screen_mode --class=F5tool {
|
||||
menuentry 'Force Text Mode' --class=debug_text_mode --class=debug_screen_mode --class=F5tool {
|
||||
submenu "$VTLANG_SCREEN_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
|
||||
}
|
||||
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
|
||||
vt_pop_menu_lang
|
||||
}
|
||||
menuentry 'Return to previous menu [Esc]' --class=vtoyret VTOY_RET {
|
||||
echo 'Return ...'
|
||||
menuentry "$VTLANG_RETURN_PREVIOUS" --class=vtoyret VTOY_RET {
|
||||
echo "Return ..."
|
||||
}
|
||||
}
|
||||
|
||||
if [ $VTOY_THEME_COUNT -gt 1 ]; then
|
||||
submenu "Theme Select" --class=debug_theme_select --class=F5tool {
|
||||
if [ -n "$VTOY_THEME_COUNT" -a $VTOY_THEME_COUNT -gt 1 ]; then
|
||||
submenu "$VTLANG_THEME_SELECT" --class=debug_theme_select --class=F5tool {
|
||||
vt_select_theme_cfg
|
||||
}
|
||||
fi
|
||||
|
||||
if [ "$grub_platform" != "pc" ]; then
|
||||
submenu 'Ventoy UEFI Utilities' --class=debug_util --class=F5tool {
|
||||
menuentry 'Show EFI Drivers' --class=debug_util_efidrv --class=debug_util --class=F5tool {
|
||||
submenu "$VTLANG_UEFI_UTIL" --class=debug_util --class=F5tool {
|
||||
menuentry "$VTLANG_UTIL_SHOW_EFI_DRV" --class=debug_util_efidrv --class=debug_util --class=F5tool {
|
||||
vt_push_pager
|
||||
chainloader ${vtoy_path}/vtoyutil_${VTOY_EFI_ARCH}.efi env_param=${env_param} ${vtdebug_flag} feature=show_efi_drivers
|
||||
boot
|
||||
vt_pop_pager
|
||||
echo -e "\npress ENTER to exit ..."
|
||||
echo -en "\n$VTLANG_ENTER_EXIT ..."
|
||||
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
|
||||
boot
|
||||
echo -e "\npress ENTER to exit ..."
|
||||
echo -en "\n$VTLANG_ENTER_EXIT ..."
|
||||
read vtInputKey
|
||||
}
|
||||
|
||||
menuentry 'Return to previous menu [Esc]' --class=vtoyret VTOY_RET {
|
||||
echo 'Return ...'
|
||||
menuentry "$VTLANG_RETURN_PREVIOUS" --class=vtoyret VTOY_RET {
|
||||
echo "Return ..."
|
||||
}
|
||||
}
|
||||
fi
|
||||
|
||||
|
||||
submenu 'Check plugin json configuration (ventoy.json)' --class=debug_json --class=F5tool {
|
||||
menuentry 'Check global control plugin configuration' --class=debug_control --class=debug_json --class=F5tool {
|
||||
submenu "$VTLANG_JSON_CHK_JSON" --class=debug_json --class=F5tool {
|
||||
menuentry "$VTLANG_JSON_CHK_CONTROL" --class=debug_control --class=debug_json --class=F5tool {
|
||||
set pager=1
|
||||
vt_check_plugin_json $vt_plugin_path control $vtoy_iso_part
|
||||
|
||||
echo -e "\npress ENTER to exit ..."
|
||||
echo -en "\n$VTLANG_ENTER_EXIT ..."
|
||||
read vtInputKey
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
vt_check_plugin_json $vt_plugin_path persistence $vtoy_iso_part
|
||||
|
||||
echo -e "\n############### dump persistence ###############"
|
||||
vt_dump_persistence
|
||||
|
||||
echo -e "\npress ENTER to exit ..."
|
||||
echo -en "\n$VTLANG_ENTER_EXIT ..."
|
||||
read vtInputKey
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
unset pager
|
||||
}
|
||||
|
||||
menuentry 'Check custom boot plugin configuration' --class=debug_custom_boot --class=debug_json --class=F5tool {
|
||||
set pager=1
|
||||
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 "$VTLANG_RETURN_PREVIOUS" --class=vtoyret VTOY_RET {
|
||||
echo "Return ..."
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
menuentry 'Return to previous menu [Esc]' --class=vtoyret VTOY_RET {
|
||||
echo 'Return ...'
|
||||
menuentry "$VTLANG_RETURN_PREVIOUS" --class=vtoyret VTOY_RET {
|
||||
echo "Return ..."
|
||||
}
|
||||
|
15
INSTALL/grub/distro/fwts.cfg
Normal file
15
INSTALL/grub/distro/fwts.cfg
Normal 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
|
||||
}
|
@@ -16,6 +16,11 @@
|
||||
#
|
||||
#************************************************************************************
|
||||
|
||||
if [ "$grub_platform" = "pc" ]; then
|
||||
insmod setkey
|
||||
insmod regexp
|
||||
fi
|
||||
|
||||
function ventoy_pause {
|
||||
echo "press Enter to continue ......"
|
||||
read vtTmpPause
|
||||
@@ -65,6 +70,10 @@ function ventoy_vcfg_proc {
|
||||
fi
|
||||
}
|
||||
|
||||
function ventoy_language {
|
||||
configfile $prefix/menulang.cfg
|
||||
}
|
||||
|
||||
function ventoy_diagnosis {
|
||||
vt_enum_video_mode
|
||||
configfile $prefix/debug.cfg
|
||||
@@ -81,7 +90,7 @@ function ventoy_ext_menu {
|
||||
unset ventoy_new_context
|
||||
else
|
||||
echo "ventoy_grub.cfg NOT exist."
|
||||
echo -e "\npress ENTER to exit ..."
|
||||
echo -en "\n$VTLANG_ENTER_EXIT ..."
|
||||
read vtInputKey
|
||||
fi
|
||||
}
|
||||
@@ -99,8 +108,9 @@ function ventoy_show_help {
|
||||
fi
|
||||
|
||||
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
|
||||
cat "(vt_help_tarfs)/help/${VTOY_HELP_TXT_LANGUAGE}.txt"
|
||||
vt_cur_menu_lang vtCurLang
|
||||
if [ -f "(vt_help_tarfs)/help/${vtCurLang}.txt" ]; then
|
||||
cat "(vt_help_tarfs)/help/${vtCurLang}.txt"
|
||||
else
|
||||
cat "(vt_help_tarfs)/help/en_US.txt"
|
||||
fi
|
||||
@@ -108,9 +118,15 @@ function ventoy_show_help {
|
||||
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 {
|
||||
set vtoy_os=Linux
|
||||
|
||||
export vtoy_os
|
||||
|
||||
if vt_str_begin "$vt_volume_id" "DLC Boot"; then
|
||||
if [ -f (loop)/DLCBoot.exe ]; then
|
||||
set vtoy_os=Windows
|
||||
@@ -211,6 +227,8 @@ function distro_specify_wim_patch {
|
||||
function distro_specify_wim_patch_phase2 {
|
||||
if [ -f (loop)/boot/boot.wim ]; then
|
||||
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
|
||||
|
||||
if vt_str_begin "$vt_volume_id" "DLC Boot"; then
|
||||
@@ -383,6 +401,8 @@ function distro_specify_initrd_file_phase2 {
|
||||
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
|
||||
}
|
||||
@@ -393,10 +413,9 @@ function ventoy_get_ghostbsd_ver {
|
||||
}
|
||||
|
||||
function ventoy_get_furybsd_ver {
|
||||
if regexp "13\.[0-9]" "$2"; then
|
||||
set vt_freebsd_ver=13.x
|
||||
else
|
||||
set vt_freebsd_ver=12.x
|
||||
set vt_freebsd_ver=12.x
|
||||
if regexp --set 1:vtFuryVer "(14|13)\.[0-9]" "$2"; then
|
||||
set vt_freebsd_ver=${vtFuryVer}.x
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -405,12 +424,8 @@ function ventoy_get_freenas_ver {
|
||||
|
||||
if [ -e (loop)/FreeNAS-MANIFEST ]; then
|
||||
vt_parse_freenas_ver (loop)/FreeNAS-MANIFEST vt_freenas_ver
|
||||
if regexp "^13\.[0-9]" "$vt_freenas_ver"; then
|
||||
set vt_freebsd_ver=13.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
|
||||
if regexp --set 1:vtNasVer "^(14|13|12|11)\.[0-9]" "$vt_freenas_ver"; then
|
||||
set vt_freebsd_ver=${vtNasVer}.x
|
||||
fi
|
||||
fi
|
||||
}
|
||||
@@ -420,12 +435,8 @@ function ventoy_get_truenas_ver {
|
||||
|
||||
if [ -e (loop)/TrueNAS-MANIFEST ]; then
|
||||
vt_parse_freenas_ver (loop)/TrueNAS-MANIFEST vt_truenas_ver
|
||||
if regexp "^13\.[0-9]" "$vt_truenas_ver"; then
|
||||
set vt_freebsd_ver=13.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
|
||||
if regexp --set 1:vtTNasVer "^(14|13|12|11)\.[0-9]" "$vt_truenas_ver"; then
|
||||
set vt_freebsd_ver=${vtTNasVer}.x
|
||||
fi
|
||||
fi
|
||||
}
|
||||
@@ -457,49 +468,25 @@ function ventoy_freebsd_proc {
|
||||
ventoy_get_truenas_ver "$1" "${chosen_path}"
|
||||
elif vt_strstr "$vt_volume_id" "FURYBSD"; then
|
||||
ventoy_get_furybsd_ver "$1" "${chosen_path}"
|
||||
elif regexp "^13_[0-9]" "$vt_volume_id"; then
|
||||
set vt_freebsd_ver=13.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 regexp --set 1:vtBsdVerNum "^(14|13|12|11|10|9)_[0-9]" "$vt_volume_id"; then
|
||||
set vt_freebsd_ver=${vtBsdVerNum}.x
|
||||
elif [ -d (loop)/usr/midnightbsd-dist ]; then
|
||||
ventoy_get_midnightbsd_ver "$1" "${chosen_path}"
|
||||
set vtFreeBsdDistro=MidnightBSD
|
||||
elif [ -e (loop)/bin/freebsd-version ]; then
|
||||
vt_unix_parse_freebsd_ver (loop)/bin/freebsd-version vt_userland_ver
|
||||
if regexp "\"13\.[0-9]-" "$vt_userland_ver"; then
|
||||
set vt_freebsd_ver=13.x
|
||||
elif regexp "\"12\.[0-9]-" "$vt_userland_ver"; then
|
||||
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
|
||||
vt_unix_parse_freebsd_ver (loop)/bin/freebsd-version vt_userland_ver
|
||||
if regexp --set 1:vtBsdVerNum "\"(14|13|12|11|10|9)\.[0-9]-" "$vt_userland_ver"; then
|
||||
set vt_freebsd_ver=${vtBsdVerNum}.x
|
||||
fi
|
||||
elif [ -e (loop)/README.TXT ]; then
|
||||
vt_1st_line (loop)/README.TXT vt_freebsd_line1
|
||||
if regexp "FreeBSD 13\.[0-9]-" "$vt_freebsd_line1"; then
|
||||
set vt_freebsd_ver=13.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
|
||||
if regexp --set 1:vtBsdVerNum "FreeBSD (14|13|12|11|10|9)\.[0-9]-" "$vt_freebsd_line1"; then
|
||||
set vt_freebsd_ver=${vtBsdVerNum}.x
|
||||
fi
|
||||
elif vt_strstr "${chosen_path}" "MidnightBSD"; then
|
||||
set vt_freebsd_ver=9.x
|
||||
fi
|
||||
|
||||
|
||||
|
||||
if [ -e (loop)/usr/freebsd-dist/cloninst.sh ]; then
|
||||
set vtFreeBsdDistro=ClonOS
|
||||
@@ -523,7 +510,7 @@ function ventoy_freebsd_proc {
|
||||
fi
|
||||
|
||||
if [ "$vt_freebsd_ver" = "xx" ]; then
|
||||
set vt_freebsd_ver=13.x
|
||||
set vt_freebsd_ver=14.x
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -836,6 +823,16 @@ function uefi_linux_menu_func {
|
||||
configfile "mem:${vt_sys_menu_mem_addr}:size:${vt_sys_menu_mem_size}"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $vtback_cfg_find -eq 0 ]; then
|
||||
if [ -f (loop)/boot/isolinux/syslnx64.cfg ]; then
|
||||
syslinux_configfile (loop)/boot/isolinux/syslnx64.cfg
|
||||
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
|
||||
echo " "
|
||||
@@ -881,11 +878,6 @@ function ventoy_reset_nojoliet {
|
||||
}
|
||||
|
||||
function uefi_iso_menu_func {
|
||||
|
||||
if [ -d (loop)/ ]; then
|
||||
loopback -d loop
|
||||
fi
|
||||
|
||||
if [ -n "$vtisouefi" ]; then
|
||||
set LoadIsoEfiDriver=on
|
||||
unset vtisouefi
|
||||
@@ -899,21 +891,13 @@ function uefi_iso_menu_func {
|
||||
vt_select_auto_install "${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
|
||||
|
||||
if ! vt_is_udf "${1}${chosen_path}"; then
|
||||
# Lenovo EasyStartup need an addional sector for boundary check
|
||||
if vt_str_begin "$vt_volume_id" "EasyStartup"; then
|
||||
vt_skip_svd "${vtoy_iso_part}${vt_chosen_path}"
|
||||
vt_append_extra_sector 1
|
||||
fi
|
||||
fi
|
||||
|
||||
loopback loop "${1}${chosen_path}"
|
||||
get_os_type (loop)
|
||||
|
||||
if [ -d (loop)/EFI ]; then
|
||||
set vt_efi_dir=YES
|
||||
@@ -932,15 +916,6 @@ function uefi_iso_menu_func {
|
||||
vt_check_compatible (loop)
|
||||
fi
|
||||
|
||||
if vt_need_secondary_menu "$vt_chosen_name"; then
|
||||
vt_show_secondary_menu "$vt_chosen_path" "$vtoy_os" $vt_chosen_size
|
||||
if vt_check_mode 0 "$vt_chosen_name"; then
|
||||
uefi_iso_memdisk $vtoy_iso_part "$vt_chosen_path"
|
||||
vt_secondary_recover_mode
|
||||
return
|
||||
fi
|
||||
fi
|
||||
|
||||
vt_img_sector "${1}${chosen_path}"
|
||||
|
||||
if [ "$ventoy_fs_probe" = "iso9660" ]; then
|
||||
@@ -957,8 +932,7 @@ function uefi_iso_menu_func {
|
||||
uefi_linux_menu_func "$1" "${chosen_path}"
|
||||
fi
|
||||
|
||||
ventoy_gui_console
|
||||
vt_secondary_recover_mode
|
||||
ventoy_gui_console
|
||||
}
|
||||
|
||||
function uefi_iso_memdisk {
|
||||
@@ -1303,6 +1277,16 @@ function legacy_linux_menu_func {
|
||||
configfile "mem:${vt_sys_menu_mem_addr}:size:${vt_sys_menu_mem_size}"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $vtback_cfg_find -eq 0 ]; then
|
||||
if [ -f (loop)/boot/isolinux/syslnx64.cfg ]; then
|
||||
syslinux_configfile (loop)/boot/isolinux/syslnx64.cfg
|
||||
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
|
||||
set root=$vtback_root
|
||||
@@ -1336,26 +1320,10 @@ function legacy_unix_menu_func {
|
||||
|
||||
|
||||
function legacy_iso_menu_func {
|
||||
|
||||
if [ -d (loop)/ ]; then
|
||||
loopback -d loop
|
||||
fi
|
||||
|
||||
set chosen_path="$2"
|
||||
|
||||
vt_select_auto_install "${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
|
||||
set ventoy_compatible=YES
|
||||
@@ -1366,15 +1334,6 @@ function legacy_iso_menu_func {
|
||||
vt_check_compatible (loop)
|
||||
fi
|
||||
|
||||
if vt_need_secondary_menu "$vt_chosen_name"; then
|
||||
vt_show_secondary_menu "$vt_chosen_path" "$vtoy_os" $vt_chosen_size
|
||||
if vt_check_mode 0 "$vt_chosen_name"; then
|
||||
legacy_iso_memdisk $vtoy_iso_part "$vt_chosen_path"
|
||||
vt_secondary_recover_mode
|
||||
return
|
||||
fi
|
||||
fi
|
||||
|
||||
vt_img_sector "${1}${chosen_path}"
|
||||
|
||||
if [ "$ventoy_fs_probe" = "iso9660" ]; then
|
||||
@@ -1471,7 +1430,7 @@ function iso_common_menuentry {
|
||||
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 " 此ISO文件的大小 \"$vt_chosen_size\" 有问题,请确认文件是否损坏。\n"
|
||||
echo -e "\n press ENTER to continue (请按 回车 键继续) ..."
|
||||
echo -en "\n$VTLANG_ENTER_CONTINUE ..."
|
||||
read vtInputKey
|
||||
fi
|
||||
fi
|
||||
@@ -1483,6 +1442,33 @@ function iso_common_menuentry {
|
||||
if ventoy_vcfg_proc "${vt_chosen_path}"; then
|
||||
return
|
||||
fi
|
||||
|
||||
|
||||
|
||||
#secondary boot menu
|
||||
if vt_is_udf "${vtoy_iso_part}${vt_chosen_path}"; then
|
||||
set ventoy_fs_probe=udf
|
||||
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
|
||||
vt_skip_svd "${vtoy_iso_part}${vt_chosen_path}"
|
||||
@@ -1534,7 +1520,9 @@ function iso_common_menuentry {
|
||||
else
|
||||
uefi_iso_menu_func $vtoy_iso_part "$vt_chosen_path"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
vt_secondary_recover_mode
|
||||
}
|
||||
|
||||
function miso_common_menuentry {
|
||||
@@ -1559,7 +1547,7 @@ function miso_common_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"
|
||||
echo -e "\npress ENTER to exit (请按 回车 键返回) ..."
|
||||
echo -en "\n$VTLANG_ENTER_EXIT ..."
|
||||
read vtInputKey
|
||||
}
|
||||
|
||||
@@ -1706,7 +1694,7 @@ function vhd_common_menuentry {
|
||||
echo -e "!!! WARNING !!!\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 -n "press ENTER to continue boot (请按 回车 键继续) ..."
|
||||
echo -en "\n$VTLANG_ENTER_CONTINUE ..."
|
||||
read vtInputKey
|
||||
fi
|
||||
fi
|
||||
@@ -1815,7 +1803,7 @@ function vtoy_unsupport_menuentry {
|
||||
|
||||
function only_uefi_tip {
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1907,6 +1895,20 @@ function ventoy_img_openelec {
|
||||
loopback vtloopex $vtoy_efi_part/ventoy/vtloopex.cpio
|
||||
vt_img_extra_initrd_append (vtloopex)/$elec_ver/vtloopex.tar.xz
|
||||
|
||||
if [ "$elec_ver" = "LibreELEC" ]; then
|
||||
if [ -f (vtimghd,1)/system ]; then
|
||||
loopback elecsfs (vtimghd,1)/system
|
||||
vt_get_lib_module_ver (elecsfs) /usr/lib/kernel-overlays/base/lib/modules/ vt_module_ver
|
||||
if [ -n "$vt_module_ver" ]; then
|
||||
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
|
||||
|
||||
#boot image file
|
||||
@@ -1919,6 +1921,7 @@ function ventoy_img_openelec {
|
||||
vt_img_unhook_root
|
||||
vt_unset_boot_opt
|
||||
loopback -d vtloopex
|
||||
loopback -d elecsfs
|
||||
}
|
||||
|
||||
|
||||
@@ -2073,7 +2076,7 @@ function ventoy_img_openwrt {
|
||||
ventoy_gui_console
|
||||
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 "\n press ENTER to exit (请按 回车 键返回) ..."
|
||||
echo -en "\n$VTLANG_ENTER_EXIT ..."
|
||||
read vtInputKey
|
||||
ventoy_cli_console
|
||||
return
|
||||
@@ -2197,6 +2200,23 @@ function ventoy_img_cloudready {
|
||||
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 {
|
||||
chainloader (vtimghd,1)/efi/boot/BOOTX64.efi
|
||||
boot
|
||||
@@ -2205,7 +2225,7 @@ function ventoy_img_memtest86 {
|
||||
function img_unsupport_tip {
|
||||
echo -e "\n This IMG file is NOT supported now. \n"
|
||||
echo -e " 当前不支持启动此 IMG 文件 \n"
|
||||
echo -e "\npress ENTER to exit (请按 回车 键返回) ..."
|
||||
echo -en "\n$VTLANG_ENTER_EXIT ..."
|
||||
read vtInputKey
|
||||
}
|
||||
|
||||
@@ -2262,6 +2282,12 @@ function img_common_menuentry {
|
||||
vt_get_fs_label (vtimghd,2) vtImgHd2Label
|
||||
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
|
||||
vt_1st_line (vtimghd,1)/etc/hostname vtImgHostname
|
||||
fi
|
||||
@@ -2279,6 +2305,8 @@ function img_common_menuentry {
|
||||
elif [ -f (vtimghd,3)/etc/chrome_dev.conf ]; then
|
||||
ventoy_img_cloudready
|
||||
fi
|
||||
elif vt_str_begin "$vtImgHd3Label" "fwts-result"; then
|
||||
ventoy_img_fwts
|
||||
elif vt_str_begin "$vtImgHd1Label" "LAKKA"; then
|
||||
ventoy_img_openelec lakka
|
||||
elif vt_str_begin "$vtImgHd1Label" "LIBREELEC"; then
|
||||
@@ -2304,14 +2332,15 @@ function img_common_menuentry {
|
||||
elif [ -f (vtimghd,2)/loader/entries/ubos.conf ]; then
|
||||
ventoy_img_ubos
|
||||
elif [ -f (vtimghd,2)/etc/openwrt_version ]; then
|
||||
ventoy_img_openwrt
|
||||
elif [ -f (vtimghd,1)/efi/boot/mt86.png ]; then
|
||||
if [ "$grub_platform" = "pc" ]; then
|
||||
img_unsupport_tip
|
||||
else
|
||||
ventoy_img_memtest86
|
||||
fi
|
||||
ventoy_img_openwrt
|
||||
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}"
|
||||
ventoy_acpi_param ${vtoy_chain_mem_addr} 512
|
||||
if [ "$grub_platform" = "pc" ]; then
|
||||
@@ -2336,6 +2365,28 @@ function img_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
|
||||
}
|
||||
|
||||
#############################################################
|
||||
#############################################################
|
||||
#############################################################
|
||||
@@ -2344,7 +2395,7 @@ function img_unsupport_menuentry {
|
||||
#############################################################
|
||||
#############################################################
|
||||
|
||||
set VENTOY_VERSION="1.0.81"
|
||||
set VENTOY_VERSION="1.0.93"
|
||||
|
||||
#ACPI not compatible with Window7/8, so disable by default
|
||||
set VTOY_PARAM_NO_ACPI=1
|
||||
@@ -2368,6 +2419,7 @@ set VTOY_HELP_CMD="ventoy_show_help"
|
||||
set VTOY_CHKSUM_CMD="ventoy_checksum"
|
||||
set VTOY_HELP_TXT_LANGUAGE="en_US"
|
||||
set VTOY_CHKSUM_FILE_PATH="X"
|
||||
set VTOY_LANG_CMD="ventoy_language"
|
||||
|
||||
|
||||
if [ "$grub_platform" = "pc" ]; then
|
||||
@@ -2433,6 +2485,9 @@ fi
|
||||
#Load Partition Table
|
||||
vt_load_part_table $vtoydev
|
||||
|
||||
#Load menu lang file
|
||||
ventoy_load_menu_lang_file
|
||||
|
||||
#Load Plugin
|
||||
if [ -f $vtoy_iso_part/ventoy/ventoy.json ]; then
|
||||
clear
|
||||
@@ -2442,6 +2497,12 @@ else
|
||||
vt_check_json_path_case $vtoy_iso_part
|
||||
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
|
||||
set timeout=$VTOY_MENU_TIMEOUT
|
||||
else
|
||||
@@ -2463,10 +2524,8 @@ fi
|
||||
|
||||
if [ $VTOY_DEFAULT_MENU_MODE -eq 0 ]; then
|
||||
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
|
||||
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
|
||||
|
||||
terminal_output console
|
||||
@@ -2494,7 +2553,20 @@ elif [ "$vtoy_display_mode" = "serial_console" ]; then
|
||||
fi
|
||||
terminal_input 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
|
||||
vt_set_theme
|
||||
else
|
||||
@@ -2575,6 +2647,7 @@ export VTOY_HELP_CMD
|
||||
export VTOY_CHKSUM_CMD
|
||||
export VTOY_HELP_TXT_LANGUAGE
|
||||
export VTOY_CHKSUM_FILE_PATH
|
||||
export VTOY_LANG_CMD
|
||||
|
||||
|
||||
#colect all image files (iso files)
|
||||
|
18
INSTALL/grub/help/ar_AR.txt
Normal file
18
INSTALL/grub/help/ar_AR.txt
Normal 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 للعودة ......
|
19
INSTALL/grub/help/bn_BN.txt
Normal file
19
INSTALL/grub/help/bn_BN.txt
Normal 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 টিপুন ......
|
19
INSTALL/grub/help/cs_CZ.txt
Normal file
19
INSTALL/grub/help/cs_CZ.txt
Normal 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 ......
|
@@ -1,18 +1,19 @@
|
||||
h - Zeigt dieses Hilfe Menu
|
||||
F1 - Memdisk Modus (Nur für kleine WinPE/LiveCD ISO/IMG)
|
||||
F2 - Browse and boot files in local disk
|
||||
F3 - Menu wechsel zwischen Baum <-> Listen Ansicht
|
||||
F4 - Windows/Linux vom lokalem Datenträger starten
|
||||
F5 - Dienstprogramme
|
||||
L - Sprache auswählen
|
||||
F1 - Zeigt dieses Hilfemenü
|
||||
F2 - Durchsuchen und starten von Dateien auf lokalem Datenträger
|
||||
F3 - Wechsel zwischen Baum-/Listenansicht
|
||||
F4 - Windows/Linux von lokalem Datenträger starten
|
||||
F5 - Werkzeuge
|
||||
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)
|
||||
w/Ctrl+w - WIMBOOT Modus (Nur für Standard Windows ISO)
|
||||
r/Ctrl+r - Grub2 Modus (Nur für einige Linux distros)
|
||||
i/Ctrl+i - Kompatibilitäts Modus (Nur für Fehleranalyse)
|
||||
u/Ctrl+u - Lade ISO efi Treiber (Nur für Fehleranalyse, darf nicht offiziel benutzt werden)
|
||||
m/Strg+m - Prüfsumme von Abbilddatei prüfen (md5/sha1/sha256/sha512)
|
||||
d/Strg+d - Memdisk-Modus (Nur für kleine WinPE/LiveCD ISO/IMG)
|
||||
w/Strg+w - WIMBOOT-Modus (Nur für Windows/WinPE ISO)
|
||||
r/Strg+r - Grub2-Modus (Nur für einige Linux-Distributionen)
|
||||
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......
|
||||
|
19
INSTALL/grub/help/el_GR.txt
Normal file
19
INSTALL/grub/help/el_GR.txt
Normal 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 για επιστροφή ......
|
@@ -1,17 +1,18 @@
|
||||
h - Display this help information
|
||||
F1 - Memdisk Mode (Only for small WinPE/LiveCD ISO/IMG)
|
||||
F2 - Browse and boot files in local disk
|
||||
L - Language Select
|
||||
F1 - Display help information
|
||||
F2 - Browse and boot files in the local disk
|
||||
F3 - Switch menu mode between Treeview <-> ListView
|
||||
F4 - Boot Windows/Linux in local disk
|
||||
F4 - Boot Windows/Linux on the local disk
|
||||
F5 - Utilities
|
||||
F6 - Load Custom Grub2 Menu
|
||||
F7 - Switch between GUI Mode <-> TEXT Mode
|
||||
|
||||
m - Checksum image files (md5/sha1/sha256/sha512)
|
||||
w/Ctrl+w - WIMBOOT Mode (Only for standard Windows ISO)
|
||||
m/Ctrl+m - Checksum image files (md5/sha1/sha256/sha512)
|
||||
d/Ctrl+d - Memdisk Mode (Only for small WinPE/LiveCD ISO/IMG)
|
||||
w/Ctrl+w - WIMBOOT Mode (Only for Windows/WinPE ISO files)
|
||||
r/Ctrl+r - Grub2 Mode (Only for some Linux distros)
|
||||
i/Ctrl+i - Compatible Mode (Just only for debug)
|
||||
u/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)
|
||||
|
||||
|
||||
|
||||
|
19
INSTALL/grub/help/es_ES.txt
Normal file
19
INSTALL/grub/help/es_ES.txt
Normal 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 ......
|
@@ -1,16 +1,19 @@
|
||||
h - Afficher cette aide
|
||||
F1 - Mode Memdisk (Seulement pour WinPE/LiveCD ISO/IMG)
|
||||
F2 - Browse and boot files in local disk
|
||||
F3 - Basculer l'affichage 'Vue en arbre' <-> 'Vue en liste'
|
||||
F4 - Démarrer le système Windows/Linux local
|
||||
L - Sélection de la langue
|
||||
F1 - Afficher l’aide
|
||||
F2 - Démarrer à partir d’un disque local
|
||||
F3 - Basculer l’affichage Vue en arbre <-> Vue en liste
|
||||
F4 - Démarrer un système Windows ou Linux local
|
||||
F5 - Utilitaires
|
||||
F6 - Charger le menu Grub2 personnalisé
|
||||
F6 - Charger le menu GRUB 2 personnalisé
|
||||
F7 - Basculer entre le mode graphique <-> mode texte
|
||||
|
||||
m - Somme de contrôle des images (md5/sha1/sha256/sha512)
|
||||
w/Ctrl+w - Mode WIMBOOT (seulement pour les images standards Windows)
|
||||
r/Ctrl+r - Mode Grub2 (seulement pour quelques Linux)
|
||||
i/Ctrl+i - Mode Compatible (seulement à fins de tests)
|
||||
u/Ctrl+u - Load ISO efi driver (Just only for debug, can not be used officially)
|
||||
m/Ctrl+m - Somme de contrôle des images (md5/sha1/sha256/sha512)
|
||||
d/Ctrl+d - Mode Memdisk (pour WinPE/LiveCD ISO/IMG uniquement)
|
||||
w/Ctrl+w - Mode WIMBOOT (pour images Windows/WinPE uniquement)
|
||||
r/Ctrl+r - Mode GRUB 2 (pour quelques distributions Linux uniquement)
|
||||
i/Ctrl+i - Mode Compatible (pour débug uniquement)
|
||||
u/Ctrl+u - Charger l’ISO d’un pilote EFI (pour débug uniquement)
|
||||
|
||||
Appuyer sur Echap pour sortir ......
|
||||
|
||||
|
||||
Appuyer sur Echap pour sortir…
|
||||
|
19
INSTALL/grub/help/hi_HI.txt
Normal file
19
INSTALL/grub/help/hi_HI.txt
Normal 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 दबाएं ......
|
@@ -1,5 +1,5 @@
|
||||
h - Prikazuje ove informacije
|
||||
F1 - Memdisk način rada (samo za male WinPE/LiveCD imidž fajlove)
|
||||
L - Izaberite jezik
|
||||
F1 - Prikazuje ove informacije
|
||||
F2 - Pokreće imidž fajlove na lokalnom disku
|
||||
F3 - Mijenja meni između TreeView <-> ListView
|
||||
F4 - Pokreće Windows/Linux na lokalnom disku
|
||||
@@ -7,8 +7,9 @@ F5 - Alati
|
||||
F6 - Učitava prilagođen GRUB2 meni
|
||||
F7 - Mijenja između GUI <-> TEXT načina rada
|
||||
|
||||
m - Generira heš odabranog imidž fajla (md5/sha1/sha256/sha512)
|
||||
w/Ctrl+w - WIMBOOT način rada (samo za standardne Windows imidž fajlove)
|
||||
m/Ctrl+m - Generira heš odabranog imidž fajla (md5/sha1/sha256/sha512)
|
||||
d/Ctrl+d - Memdisk način rada (samo za male WinPE/LiveCD imidž fajlove)
|
||||
w/Ctrl+w - WIMBOOT način rada (samo za Windows/WinPE imidž fajlove)
|
||||
r/Ctrl+r - GRUB2 način rada (samo za neke Linux distribucije)
|
||||
i/Ctrl+i - Kompatibilni način rada (samo za testiranje)
|
||||
u/Ctrl+u - Učitava EFI drajver za imidž fajlove (samo za testiranje)
|
||||
|
19
INSTALL/grub/help/hu_HU.txt
Normal file
19
INSTALL/grub/help/hu_HU.txt
Normal 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 ......
|
@@ -1,14 +1,15 @@
|
||||
h - Tampilkan bantuan informasi ini
|
||||
F1 - Mode Memdisk (Hanya untuk ukuran WinPE/LiveCD ISO/IMG yang kecil)
|
||||
F2 - Browse and boot files in local disk
|
||||
L - Pilih Bahasa
|
||||
F1 - Tampilkan bantuan informasi ini
|
||||
F2 - Jelajah dan jalankan boot berkas pada disk lokal
|
||||
F3 - Beralih mode menu antara Treeview <-> ListView
|
||||
F4 - Jalankan (boot) Windows/Linux pada disk lokal
|
||||
F4 - Jalankan boot ke Windows/Linux pada disk lokal
|
||||
F5 - Alat Utilitas
|
||||
F6 - Memuat ubah suai Grub2 Menu
|
||||
F7 - Beralih antara mode GUI <-> Mode TEXT
|
||||
|
||||
m - Periksa berkas files (md5/sha1/sha256/sha512)
|
||||
w/Ctrl+w - Mode WIMBOOT (Hanya untuk berkas ISO Windows standar)
|
||||
m/Ctrl+m - Periksa berkas files (md5/sha1/sha256/sha512)
|
||||
d/Ctrl+d - Mode Memdisk (Hanya untuk ukuran WinPE/LiveCD ISO/IMG yang kecil)
|
||||
w/Ctrl+w - Mode WIMBOOT (Hanya untuk berkas ISO Windows/WinPE)
|
||||
r/Ctrl+r - Mode Grub2 (Hanya untuk distro Linux tertentu)
|
||||
i/Ctrl+i - Mode Kompatibel/Compatible (Hanya untuk debug saja)
|
||||
u/Ctrl+u - Memuat ISO efi driver (Hanya untuk debug saja, tidak dapat dipakai secara umum)
|
||||
|
@@ -1,5 +1,5 @@
|
||||
h - この画面を表示する
|
||||
F1 - 主記憶装置上に記憶域を作成する(容量の小さなWinPE・LiveCD専用)
|
||||
L - 言語を選択
|
||||
F1 - この画面を表示する
|
||||
F2 - 手元の記憶装置にある起動ファイルを選択して実行する
|
||||
F3 - 表示形式を切り替える(一覧 ↔ 階層)
|
||||
F4 - 手元の記憶装置にあるWindowsまたはLinuxを起動する
|
||||
@@ -7,8 +7,9 @@ F5 - 諸機能
|
||||
F6 - Grub2の構成を読み込む
|
||||
F7 - 操作形式を切り替える(GUI ↔ CUI)
|
||||
|
||||
m - イメージの検査合計を計算する (md5/sha1/sha256/sha512)
|
||||
w/Ctrl+w - WIMBOOTモード(標準的なWindows ISO専用)
|
||||
m/Ctrl+m - イメージの検査合計を計算する (md5/sha1/sha256/sha512)
|
||||
d/Ctrl+d - 主記憶装置上に記憶域を作成する(容量の小さなWinPE・LiveCD専用)
|
||||
w/Ctrl+w - WIMBOOTモード(Windows/WinPE ISO専用)
|
||||
r/Ctrl+r - Grub2モード(一部のLinuxディストリビューション専用)
|
||||
i/Ctrl+i - 互換モード(開発用)
|
||||
u/Ctrl+u - ISO efiドライバーを読み取る(開発用,非公式)
|
||||
|
19
INSTALL/grub/help/ka_GE.txt
Normal file
19
INSTALL/grub/help/ka_GE.txt
Normal file
@@ -0,0 +1,19 @@
|
||||
L - ინტერფეისის ენის არჩევა
|
||||
F1 - დამხმარე ინფორმაციის ჩვენება
|
||||
F2 - ლოკალური დისკის ფაილების დათვალიერება და ჩატვირთვა
|
||||
F3 - ჩვენების რეჟიმებს შორის გადართვა 'ხის ხედი' <-> 'სიის ხედი'
|
||||
F4 - ლოკალური დისკიდან Windows/Linux-ის ჩატვირთვა
|
||||
F5 - ხელსაწყოები
|
||||
F6 - მომხმარებლის მიერ შექმნილი Grub2 მენიუს ჩატვირთვა
|
||||
F7 - ჩვენების რეჟიმის გადართვა 'გრაფიკული' <-> 'ტექსტური'
|
||||
|
||||
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 დისტრიბუტივებისთვის)
|
||||
i/Ctrl+i - თავსებადი რეჟიმი (განკუთვნილია მხოლოდ გამართვისთვის)
|
||||
u/Ctrl+u - ISO EFI დრაივერის ჩატვირთვა (განკუთვნილია მხოლოდ გამართვისთვის, დაუშვებელია ოფიციალური გამოყენება)
|
||||
|
||||
|
||||
|
||||
დააჭირეთ ESC დაბრუნებისთვის ......
|
@@ -1,17 +1,18 @@
|
||||
h - 이 도움말 정보 표시
|
||||
F1 - Memdisk 모드 (작은 WinPE/LiveCD ISO/IMG 전용)
|
||||
L - 언어 선택
|
||||
F1 - 이 도움말 정보 표시
|
||||
F2 - 로컬 디스크에서 파일 찾아보기 및 부팅
|
||||
F3 - 트리보기 <-> 목록보기 간에 메뉴 모드 전환
|
||||
F4 - 로컬 디스크에서 Windows/Linux 부팅
|
||||
F5 - 유틸리티
|
||||
F6 - 사용자 지정 Grub2 메뉴 로드
|
||||
F7 - GUI 모드 <-> TEXT 모드 간에 전환
|
||||
F6 - 사용자 지정 Grub2 메뉴 불러오기
|
||||
F7 - 그래픽 모드 <-> 텍스트 모드 간에 전환
|
||||
|
||||
m - 체크섬 이미지 파일 (md5/sha1/sha256/sha512)
|
||||
w/Ctrl+w - WIMBOOT 모드 (표준 Windows ISO 전용)
|
||||
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 배포판에만 해당)
|
||||
i/Ctrl+i - 호환 모드 (디버그 전용)
|
||||
u/Ctrl+u - ISO eFi 드라이버 로드 (디버그 전용, 공식적으로 사용할 수 없음)
|
||||
i/Ctrl+i - 호환 모드 (디버그 전용, 공식적으로 사용할 수 없음)
|
||||
u/Ctrl+u - ISO EFI 드라이버 불러오기 (디버그 전용, 공식적으로 사용할 수 없음)
|
||||
|
||||
|
||||
|
||||
|
19
INSTALL/grub/help/pl_PL.txt
Normal file
19
INSTALL/grub/help/pl_PL.txt
Normal file
@@ -0,0 +1,19 @@
|
||||
L - Wybierz język
|
||||
F1 — Wyświetl informacje pomocy
|
||||
F2 — przeglądanie i uruchamianie plików na dysku lokalnym
|
||||
F3 — Przełącz tryb menu pomiędzy Treeview <-> ListView
|
||||
F4 — Uruchom system Windows/Linux na dysku lokalnym
|
||||
F5 — Narzędzia
|
||||
F6 — Załaduj niestandardowe menu Grub2
|
||||
F7 - Przełączanie między trybem GUI <-> trybem TEKST
|
||||
|
||||
m/Ctrl+m — Pliki obrazów z sumą kontrolną (md5/sha1/sha256/sha512)
|
||||
d/Ctrl+d — Tryb Memdisk (tylko dla małych WinPE/LiveCD ISO/IMG)
|
||||
w/Ctrl+w — tryb WIMBOOT (tylko dla standardowego systemu Windows/WinPE ISO)
|
||||
r/Ctrl+r — tryb Grub2 (tylko dla niektórych dystrybucji Linuksa)
|
||||
i/Ctrl+i — tryb zgodności (tylko do debugowania)
|
||||
u/Ctrl+u — Załaduj sterownik ISO EFI (tylko do debugowania, nie można go oficjalnie używać)
|
||||
|
||||
|
||||
|
||||
Naciśnij ESC, aby wrócić...
|
@@ -1,14 +1,15 @@
|
||||
h - Mostra esta informação de ajuda
|
||||
F1 - Modo Memdisk (Apenas para pequenos WinPE/LiveCD ISO/IMG)
|
||||
F2 - Browse and boot files in local disk
|
||||
L - Selecionar idioma
|
||||
F1 - Mostra esta informação de ajuda
|
||||
F2 - Navegar e arrancar ficheiros em disco local
|
||||
F3 - Alternar o modo menu entre Vista de árvore <-> Vista de lista
|
||||
F4 - Arrancar o Windows/Linux em disco local
|
||||
F5 - Utilitários
|
||||
F6 - Carregar menu Grub2 personalizado
|
||||
F7 - Alternar entre Modo GUI <-> Modo TEXTO
|
||||
|
||||
m - Checksum ficheiros de imagem (md5/sha1/sha256/sha512)
|
||||
w/Ctrl+w - Modo WIMBOOT (Apenas para Windows ISO padrão)
|
||||
m/Ctrl+m - Checksum ficheiros de imagem (md5/sha1/sha256/sha512)
|
||||
d/Ctrl+d - Modo Memdisk (Apenas para pequenos WinPE/LiveCD ISO/IMG)
|
||||
w/Ctrl+w - Modo WIMBOOT (Apenas para Windows/WinPE ISO padrão)
|
||||
r/Ctrl+r - Modo Grub2 (Apenas para algumas distros Linux)
|
||||
i/Ctrl+i - Modo Compatível (Apenas para depuração)
|
||||
u/Ctrl+u - Carregar o controlador ISO efi (Apenas para depuração, não pode ser utilizado oficialmente)
|
||||
|
19
INSTALL/grub/help/ru_RU.txt
Normal file
19
INSTALL/grub/help/ru_RU.txt
Normal file
@@ -0,0 +1,19 @@
|
||||
L - Выбор языка
|
||||
F1 - Показать эти справочные сведения
|
||||
F2 - Просмотр и загрузка файлов на локальном диске
|
||||
F3 - Переключить режим меню между «Вид древом» <-> «Вид списком»
|
||||
F4 - Загрузка Windows/Linux с локального диска
|
||||
F5 - Утилиты
|
||||
F6 - Загрузить пользовательское меню Grub2
|
||||
F7 - Переключиться между графическим режимом <-> текстовым режимом
|
||||
|
||||
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)
|
||||
i/Ctrl+i - Совместимый режим (только для отладки)
|
||||
u/Ctrl+u - Загрузить драйвер ISO EFI (только для отладки, нельзя использовать официально)
|
||||
|
||||
|
||||
|
||||
Нажмите «ESC», чтобы вернуться ......
|
@@ -1,5 +1,5 @@
|
||||
h - Приказује ове информације
|
||||
F1 - Memdisk начин рада (само за мале WinPE/LiveCD имиџ фајлове)
|
||||
L - Изаберите језик
|
||||
F1 - Приказује ове информације
|
||||
F2 - Покреће имиџ фајлове на локалном диску
|
||||
F3 - Мења мени између TreeView <-> ListView
|
||||
F4 - Покреће Windows/Linux на локалном диску
|
||||
@@ -7,8 +7,9 @@ F5 - Алати
|
||||
F6 - Учитава прилагођен GRUB2 мени
|
||||
F7 - Мења између GUI <-> TEXT начина рада
|
||||
|
||||
m - Генерира хеш одабраног имиџ фајла (md5/sha1/sha256/sha512)
|
||||
w/Ctrl+w - WIMBOOT начин рада (само за стандардне Windows имиџ фајлове)
|
||||
m/Ctrl+m - Генерира хеш одабраног имиџ фајла (md5/sha1/sha256/sha512)
|
||||
d/Ctrl+d - Memdisk начин рада (само за мале WinPE/LiveCD имиџ фајлове)
|
||||
w/Ctrl+w - WIMBOOT начин рада (само за стандардне Windows/WinPE имиџ фајлове)
|
||||
r/Ctrl+r - GRUB2 начин рада (само за неке Linux дистрибуције)
|
||||
i/Ctrl+i - Компатибилни начин рада (само за тестирање)
|
||||
u/Ctrl+u - Учитава EFI драјвер за имиџ фајлове (само за тестирање)
|
||||
|
19
INSTALL/grub/help/ta_IN.txt
Normal file
19
INSTALL/grub/help/ta_IN.txt
Normal file
@@ -0,0 +1,19 @@
|
||||
L - மொழி தேர்வு
|
||||
F1 - இந்த உதவித் தகவலைக் காட்டு
|
||||
F2 - உள்ளூர் வட்டில் கோப்புகளை உலாவவும் துவக்கவும்
|
||||
F3 - Treeview (மரப்பார்வை) <-> ListView (பட்டியல்பார்வை) இடையே மெனு பயன்முறையை மாற்றவும்
|
||||
F4 - விண்டோஸ்/லினக்ஸை உள்ளூர் வட்டில் துவக்கவும்
|
||||
F5 - பயன்பாடுகள்
|
||||
F6 - தனிப்பயன் Grub2 மெனுவை ஏற்றவும்
|
||||
F7 - GUI பயன்முறை <-> TEXT பயன்முறைக்கு இடையில் மாறவும்
|
||||
|
||||
m/Ctrl+m - செக்சம் படக் கோப்புகள் (md5/sha1/sha256/sha512)
|
||||
d/Ctrl+d - Memdisk பயன்முறை (சிறிய WinPE/LiveCD ISO/IMGக்கு மட்டும்)
|
||||
w/Ctrl+w - WIMBOOT பயன்முறை (நிலையான Windows/WinPE ISO க்கு மட்டும்)
|
||||
r/Ctrl+r - Grub2 பயன்முறை (சில லினக்ஸ் டிஸ்ட்ரோக்களுக்கு மட்டும்)
|
||||
i/Ctrl+i - இணக்கமான பயன்முறை (பிழைத்திருத்தத்திற்கு மட்டும்)
|
||||
u/Ctrl+u - ISO efi இயக்கியை ஏற்றவும் (பிழைத்திருத்தத்திற்கு மட்டும், அதிகாரப்பூர்வமாக பயன்படுத்த முடியாது)
|
||||
|
||||
|
||||
|
||||
திரும்புவதற்கு ESC ஐ அழுத்தவும் ......
|
@@ -1,17 +1,19 @@
|
||||
h - Yardım bilgilerini göster
|
||||
F1 - Memdisk Modu başlatır(Yalnızca küçük WinPE/LiveCD ISO/IMG ler için bu modu kullanabilirsiniz)
|
||||
F2 - Yerel diskteki dosyalara GÖZAT ve ÖNYÜKLE'meyi sağlar
|
||||
F3 - Ventoy Menü modu olarak,Klasör görünümü(Treeview) ile Liste görünümü(ListView) arasında geçiş yapmayı sağlar.
|
||||
F4 - Bilgisayarınızda yüklü olan Windows yada Linux işletim sistemini, sabit diskten başlatır.
|
||||
L - Dil Seçimi
|
||||
F1 - Yardım bilgilerini göster
|
||||
F2 - Yerel diskteki önyükleme dosyalarına GÖZAT ve Önyükleme yap
|
||||
F3 - Menü modunu Ağaç Görünümü <-> Liste Görünümü arasında değiştir
|
||||
F4 - Windows & Linux'u yerel diskten önyükle
|
||||
F5 - Ventoy Araçlar menüsü
|
||||
F6 - Özelleştirilmiş Grub2 menüsünü yükler
|
||||
F7 - Grafik Modu(GUI Mode) ile Metin Modu(Text Mode) arasında geçiş yapmayı sağlar
|
||||
F6 - Özelleştirilmiş Grub2 menüsünü yükle
|
||||
F7 - Grafik(GUI) <--> Metin(Text) modları arasında geçiş yap
|
||||
|
||||
m/Ctrl+m - Görüntü dosyalarını sağlama toplamı (md5/sha1/sha256/sha512)
|
||||
d/Ctrl+d - Memdisk Modu başlat(Yalnızca küçük WinPE/LiveCD ISO/IMG ler için)
|
||||
w/Ctrl+w - WIMBOOT Modu başlat(Yalnızca normal Windows/WinPE ISO ları için)
|
||||
r/Ctrl+r - Grub2 Modu başlat (Yalnızca bazı Linux dağıtımları için)
|
||||
i/Ctrl+i - Uyumluluk Modu (Yalnızca hata ayıklama için )
|
||||
u/Ctrl+u - ISO efi sürücüsünü yükle (Saedece hata ayıklama için, resmi olarak kullanılamaz)
|
||||
|
||||
m - İndirilen imaj dosyalarının hatasız indirildiğini teyit etmek için "md5/sha1/sha256/sha512" değerlerini kontrol etmeyi sağlar
|
||||
w/Ctrl+w - WIMBOOT Modu çalıştırmayı sağlar(Sadece normal Windows ISO ları için)
|
||||
r/Ctrl+r - Grub2 Modu çalıştırmayı sağlar (Sadece bazı Linux dağıtımları için)
|
||||
i/Ctrl+i - Uyumluluk Modu'nu (Compatible Mode) çalıştırmayı sağlar (Sadece hata ayıklama için bu modu kullanabilirsiniz)
|
||||
u/Ctrl+u - ISO efi sürücüsünü yükler(Sadece hata ayıklama için bu mod kullanılabilir, resmi olarak kullanılamaz)
|
||||
|
||||
|
||||
Geriye dönmek için ESC tuşuna basınız......
|
||||
|
19
INSTALL/grub/help/uk_UA.txt
Normal file
19
INSTALL/grub/help/uk_UA.txt
Normal file
@@ -0,0 +1,19 @@
|
||||
L - Обрати мову
|
||||
F1 - Показати довідку
|
||||
F2 - Переглянути та завантажити файли з локального диску
|
||||
F3 - Переключитись між видами деревом <-> списком
|
||||
F4 - Завантажити Windows/Linux з локального диску
|
||||
F5 - Інструменти
|
||||
F6 - Завантажити Custom Grub2 меню
|
||||
F7 - Переключитись між графічним інтерфейсом <-> текстовим інтерфейсом
|
||||
|
||||
m/Ctrl+m - Контрольна сума образу диску (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 - Сумісний режим (Тільки для зневадження)
|
||||
u/Ctrl+u - Завантажити драйвер ISO EFI (Тільки для зневадження, не офіційно)
|
||||
|
||||
|
||||
|
||||
Натисність ESC для того, щоб повернутися ......
|
@@ -1,5 +1,5 @@
|
||||
h - 显示本帮助信息
|
||||
F1 - 把文件加载到内存启动(只适用于文件很小的 WinPE/LiveCD等)
|
||||
L - 选择语言
|
||||
F1 - 显示本帮助信息
|
||||
F2 - 浏览并启动本地硬盘中的镜像文件
|
||||
F3 - 菜单显示模式切换。可在列表模式和目录模式之间自由切换。
|
||||
F4 - 启动本地硬盘上的 Windows/Linux 等系统。
|
||||
@@ -7,8 +7,9 @@ F5 - 各类工具
|
||||
F6 - 加载自定义 GRUB2 菜单。
|
||||
F7 - 界面在文本模式和图形模式之间切换。
|
||||
|
||||
m - 计算文件校验值(md5/sha1/sha256/sha512)
|
||||
w/Ctrl+w - WIMBOOT 模式 (只适用于标准的 Windows ISO文件)
|
||||
m/Ctrl+m - 计算文件校验值(md5/sha1/sha256/sha512)
|
||||
d/Ctrl+d - MEMDISK 模式,把文件加载到内存启动(只适用于文件很小的 WinPE/LiveCD等)
|
||||
w/Ctrl+w - WIMBOOT 模式 (只适用于 Windows/WinPE 的ISO文件)
|
||||
r/Ctrl+r - Grub2 模式 (只适用于常见的一些 Linux 系统ISO文件)
|
||||
i/Ctrl+i - 兼容模式 (只用作调试目的,不能正式使用)
|
||||
u/Ctrl+u - 加载 ISO efi 驱动(只用作调试目的,不能正式使用)
|
||||
|
18
INSTALL/grub/help/zh_TW.txt
Normal file
18
INSTALL/grub/help/zh_TW.txt
Normal file
@@ -0,0 +1,18 @@
|
||||
L - 選擇語言
|
||||
F1 - 顯示本説明資訊
|
||||
F2 - 瀏覽並啟動本地硬碟中的映像檔
|
||||
F3 - 功能表顯示模式切換。可在清單模式和目錄模式之間自由切換。
|
||||
F4 - 啟動本地硬碟上的 Windows/Linux 等系統。
|
||||
F5 - 各類工具
|
||||
F6 - 載入自訂 GRUB2 選單。
|
||||
F7 - 介面在文字模式和圖形模式之間切換。
|
||||
|
||||
m/Ctrl+m - 計算檔案校驗值(md5/sha1/sha256/sha512)
|
||||
d/Ctrl+d - MEMDISK 模式,把檔載入到記憶體啟動(只適用於檔很小的 WinPE/LiveCD等)
|
||||
w/Ctrl+w - WIMBOOT 模式 (只適用於 Windows/WinPE ISO檔)
|
||||
r/Ctrl+r - Grub2 模式 (只適用於常見的一些 Linux 系統ISO檔)
|
||||
i/Ctrl+i - 相容模式 (只用作調試目的,不能正式使用)
|
||||
u/Ctrl+u - 載入 ISO efi 驅動(只用作調試目的,不能正式使用)
|
||||
|
||||
|
||||
按 ESC 鍵返回 ......
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user