mirror of
https://github.com/ventoy/Ventoy.git
synced 2025-09-17 09:21:15 +00:00
Compare commits
12 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
3f65f0ef03 | ||
|
4faa5e4344 | ||
|
c7693d4ecd | ||
|
4527e1db79 | ||
|
757cacf274 | ||
|
39703cabb7 | ||
|
854d17a4e9 | ||
|
a326b13fc3 | ||
|
3ff1867a2a | ||
|
7f63a1c327 | ||
|
d617985093 | ||
|
605da1ba94 |
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.91
|
||||
placeholder: 1.0.96
|
||||
validations:
|
||||
required: true
|
||||
- type: dropdown
|
||||
|
@@ -53,6 +53,9 @@ typedef struct ko_param
|
||||
unsigned long sym_put_size;
|
||||
unsigned long kv_major;
|
||||
unsigned long ibt;
|
||||
unsigned long kv_minor;
|
||||
unsigned long blkdev_get_addr;
|
||||
unsigned long blkdev_put_addr;
|
||||
unsigned long padding[1];
|
||||
}ko_param;
|
||||
|
||||
@@ -78,15 +81,25 @@ static volatile ko_param g_ko_param =
|
||||
#define PATCH_OP_POS2 1
|
||||
#define CODE_MATCH2(code, i) \
|
||||
(code[i] == 0x0C && code[i + 1] == 0x80 && code[i + 2] == 0x89 && code[i + 3] == 0xC6)
|
||||
|
||||
#define PATCH_OP_POS3 4
|
||||
#define CODE_MATCH3(code, i) \
|
||||
(code[i] == 0x44 && code[i + 1] == 0x89 && code[i + 2] == 0xe8 && code[i + 3] == 0x0c && code[i + 4] == 0x80)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#elif defined(CONFIG_X86_32)
|
||||
#define PATCH_OP_POS1 2
|
||||
#define CODE_MATCH1(code, i) \
|
||||
(code[i] == 0x80 && code[i + 1] == 0xca && code[i + 2] == 0x80 && code[i + 3] == 0xe8)
|
||||
|
||||
#define PATCH_OP_POS2 2
|
||||
#define CODE_MATCH2(code, i) \
|
||||
(code[i] == 0x80 && code[i + 1] == 0xca && code[i + 2] == 0x80 && code[i + 3] == 0xe8)
|
||||
#define PATCH_OP_POS2 PATCH_OP_POS1
|
||||
#define CODE_MATCH2 CODE_MATCH1
|
||||
#define PATCH_OP_POS3 PATCH_OP_POS1
|
||||
#define CODE_MATCH3 CODE_MATCH1
|
||||
|
||||
|
||||
#else
|
||||
#error "unsupported arch"
|
||||
@@ -140,10 +153,11 @@ static volatile ko_param g_ko_param =
|
||||
|
||||
#define vdebug(fmt, args...) if(kprintf) kprintf(KERN_ERR fmt, ##args)
|
||||
|
||||
static unsigned int g_claim_ptr = 0;
|
||||
static unsigned char *g_get_patch[MAX_PATCH] = { NULL };
|
||||
static unsigned char *g_put_patch[MAX_PATCH] = { NULL };
|
||||
|
||||
static void notrace dmpatch_restore_code(unsigned char *opCode)
|
||||
static void notrace dmpatch_restore_code(int bytes, unsigned char *opCode, unsigned int code)
|
||||
{
|
||||
unsigned long align;
|
||||
|
||||
@@ -151,7 +165,14 @@ static void notrace dmpatch_restore_code(unsigned char *opCode)
|
||||
{
|
||||
align = (unsigned long)opCode / g_ko_param.pgsize * g_ko_param.pgsize;
|
||||
set_mem_rw(align, 1);
|
||||
*opCode = 0x80;
|
||||
if (bytes == 1)
|
||||
{
|
||||
*opCode = (unsigned char)code;
|
||||
}
|
||||
else
|
||||
{
|
||||
*(unsigned int *)opCode = code;
|
||||
}
|
||||
set_mem_ro(align, 1);
|
||||
}
|
||||
}
|
||||
@@ -173,7 +194,7 @@ static int notrace dmpatch_replace_code
|
||||
|
||||
vdebug("patch for %s style[%d] 0x%lx %d\n", desc, style, addr, (int)size);
|
||||
|
||||
for (i = 0; i < (int)size - 4; i++)
|
||||
for (i = 0; i < (int)size - 8; i++)
|
||||
{
|
||||
if (style == 1)
|
||||
{
|
||||
@@ -183,7 +204,7 @@ static int notrace dmpatch_replace_code
|
||||
cnt++;
|
||||
}
|
||||
}
|
||||
else
|
||||
else if (style == 2)
|
||||
{
|
||||
if (CODE_MATCH2(opCode, i) && cnt < MAX_PATCH)
|
||||
{
|
||||
@@ -191,8 +212,20 @@ static int notrace dmpatch_replace_code
|
||||
cnt++;
|
||||
}
|
||||
}
|
||||
else if (style == 3)
|
||||
{
|
||||
if (CODE_MATCH3(opCode, i) && cnt < MAX_PATCH)
|
||||
{
|
||||
patch[cnt] = opCode + i + PATCH_OP_POS3;
|
||||
cnt++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (cnt != expect || cnt >= MAX_PATCH)
|
||||
{
|
||||
vdebug("patch error: cnt=%d expect=%d\n", cnt, expect);
|
||||
@@ -213,6 +246,121 @@ static int notrace dmpatch_replace_code
|
||||
return 0;
|
||||
}
|
||||
|
||||
static unsigned long dmpatch_find_call_offset(unsigned long addr, unsigned long size, unsigned long func)
|
||||
{
|
||||
unsigned long i = 0;
|
||||
unsigned long dest;
|
||||
unsigned char *opCode = NULL;
|
||||
unsigned char aucOffset[8] = { 0, 0, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF };
|
||||
|
||||
opCode = (unsigned char *)addr;
|
||||
|
||||
for (i = 0; i + 4 < size; i++)
|
||||
{
|
||||
if (opCode[i] == 0xE8)
|
||||
{
|
||||
aucOffset[0] = opCode[i + 1];
|
||||
aucOffset[1] = opCode[i + 2];
|
||||
aucOffset[2] = opCode[i + 3];
|
||||
aucOffset[3] = opCode[i + 4];
|
||||
|
||||
dest = addr + i + 5 + *(unsigned long *)aucOffset;
|
||||
if (dest == func)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static unsigned int dmpatch_patch_claim_ptr(void)
|
||||
{
|
||||
unsigned long i = 0;
|
||||
unsigned long t = 0;
|
||||
unsigned long offset1;
|
||||
unsigned long offset2;
|
||||
unsigned long align;
|
||||
unsigned char *opCode = NULL;
|
||||
|
||||
vdebug("Get addr: 0x%lx %lu 0x%lx\n", g_ko_param.sym_get_addr, g_ko_param.sym_get_size, g_ko_param.blkdev_get_addr);
|
||||
vdebug("Put addr: 0x%lx %lu 0x%lx\n", g_ko_param.sym_put_addr, g_ko_param.sym_put_size, g_ko_param.blkdev_put_addr);
|
||||
|
||||
opCode = (unsigned char *)g_ko_param.sym_get_addr;
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
vdebug("%02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X\n",
|
||||
opCode[i + 0], opCode[i + 1], opCode[i + 2], opCode[i + 3],
|
||||
opCode[i + 4], opCode[i + 5], opCode[i + 6], opCode[i + 7],
|
||||
opCode[i + 8], opCode[i + 9], opCode[i + 10], opCode[i + 11],
|
||||
opCode[i + 12], opCode[i + 13], opCode[i + 14], opCode[i + 15]);
|
||||
}
|
||||
|
||||
offset1 = dmpatch_find_call_offset(g_ko_param.sym_get_addr, g_ko_param.sym_get_size, g_ko_param.blkdev_get_addr);
|
||||
offset2 = dmpatch_find_call_offset(g_ko_param.sym_put_addr, g_ko_param.sym_put_size, g_ko_param.blkdev_put_addr);
|
||||
if (offset1 == 0 || offset2 == 0)
|
||||
{
|
||||
vdebug("call blkdev_get or blkdev_put Not found, %lu %lu\n", offset1, offset2);
|
||||
return 1;
|
||||
}
|
||||
vdebug("call addr1:0x%lx call addr2:0x%lx\n",
|
||||
g_ko_param.sym_get_addr + offset1,
|
||||
g_ko_param.sym_put_addr + offset2);
|
||||
|
||||
opCode = (unsigned char *)g_ko_param.sym_get_addr;
|
||||
for (i = offset1 - 1, t = 0; (i > 0) && (t < 24); i--, t++)
|
||||
{
|
||||
/* rdx */
|
||||
if (opCode[i] == 0x48 && opCode[i + 1] == 0xc7 && opCode[i + 2] == 0xc2)
|
||||
{
|
||||
g_claim_ptr = *(unsigned int *)(opCode + i + 3);
|
||||
g_get_patch[0] = opCode + i + 3;
|
||||
vdebug("claim_ptr(%08X) found at get addr 0x%lx\n", g_claim_ptr, g_ko_param.sym_get_addr + i + 3);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (g_claim_ptr == 0)
|
||||
{
|
||||
vdebug("Claim_ptr not found in get\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
opCode = (unsigned char *)g_ko_param.sym_put_addr;
|
||||
for (i = offset2 - 1, t = 0; (i > 0) && (t < 24); i--, t++)
|
||||
{
|
||||
/* rsi */
|
||||
if (opCode[i] == 0x48 && opCode[i + 1] == 0xc7 && opCode[i + 2] == 0xc6)
|
||||
{
|
||||
if (*(unsigned int *)(opCode + i + 3) == g_claim_ptr)
|
||||
{
|
||||
vdebug("claim_ptr found at put addr 0x%lx\n", g_ko_param.sym_put_addr + i + 3);
|
||||
g_put_patch[0] = opCode + i + 3;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (g_put_patch[0] == 0)
|
||||
{
|
||||
vdebug("Claim_ptr not found in put\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
align = (unsigned long)g_get_patch[0] / g_ko_param.pgsize * g_ko_param.pgsize;
|
||||
set_mem_rw(align, 1);
|
||||
*(unsigned int *)(g_get_patch[0]) = 0;
|
||||
set_mem_ro(align, 1);
|
||||
|
||||
align = (unsigned long)g_put_patch[0] / g_ko_param.pgsize * g_ko_param.pgsize;
|
||||
set_mem_rw(align, 1);
|
||||
*(unsigned int *)(g_put_patch[0]) = 0;
|
||||
set_mem_ro(align, 1);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef VTOY_IBT
|
||||
static __always_inline unsigned long long dmpatch_rdmsr(unsigned int msr)
|
||||
{
|
||||
@@ -275,7 +423,8 @@ static int notrace dmpatch_init(void)
|
||||
|
||||
kprintf = (printk_pf)(g_ko_param.printk_addr);
|
||||
|
||||
vdebug("dmpatch_init start pagesize=%lu ...\n", g_ko_param.pgsize);
|
||||
vdebug("dmpatch_init start pagesize=%lu kernel=%lu.%lu ...\n",
|
||||
g_ko_param.pgsize, g_ko_param.kv_major, g_ko_param.kv_minor);
|
||||
|
||||
if (g_ko_param.struct_size != sizeof(ko_param))
|
||||
{
|
||||
@@ -294,13 +443,27 @@ 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(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)
|
||||
if (g_ko_param.kv_major > 6 || (g_ko_param.kv_major == 6 && g_ko_param.kv_minor >= 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);
|
||||
vdebug("new interface patch dm_get_table_device...\n");
|
||||
r = dmpatch_patch_claim_ptr();
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
r = dmpatch_replace_code(1, g_ko_param.sym_get_addr, g_ko_param.sym_get_size, 2, "dm_get_table_device", g_get_patch);
|
||||
if (r && g_ko_param.kv_major >= 5)
|
||||
{
|
||||
vdebug("new2 patch dm_get_table_device...\n");
|
||||
r = dmpatch_replace_code(2, g_ko_param.sym_get_addr, g_ko_param.sym_get_size, 1, "dm_get_table_device", g_get_patch);
|
||||
}
|
||||
|
||||
if (r && g_ko_param.kv_major >= 5)
|
||||
{
|
||||
vdebug("new3 patch dm_get_table_device...\n");
|
||||
r = dmpatch_replace_code(3, g_ko_param.sym_get_addr, g_ko_param.sym_get_size, 1, "dm_get_table_device", g_get_patch);
|
||||
}
|
||||
}
|
||||
|
||||
if (r)
|
||||
{
|
||||
rc = -EINVAL;
|
||||
@@ -308,7 +471,14 @@ static int notrace dmpatch_init(void)
|
||||
}
|
||||
vdebug("patch dm_get_table_device success\n");
|
||||
|
||||
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 (g_ko_param.kv_major >= 6 && g_ko_param.kv_minor >= 5)
|
||||
{
|
||||
r = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
r = dmpatch_replace_code(1, g_ko_param.sym_put_addr, g_ko_param.sym_put_size, 1, "dm_put_table_device", g_put_patch);
|
||||
}
|
||||
if (r)
|
||||
{
|
||||
rc = -EINVAL;
|
||||
@@ -340,10 +510,18 @@ static void notrace dmpatch_exit(void)
|
||||
msr = dmpatch_ibt_save();
|
||||
}
|
||||
|
||||
for (i = 0; i < MAX_PATCH; i++)
|
||||
if (g_claim_ptr)
|
||||
{
|
||||
dmpatch_restore_code(g_get_patch[i]);
|
||||
dmpatch_restore_code(g_put_patch[i]);
|
||||
dmpatch_restore_code(4, g_get_patch[0], g_claim_ptr);
|
||||
dmpatch_restore_code(4, g_put_patch[0], g_claim_ptr);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = 0; i < MAX_PATCH; i++)
|
||||
{
|
||||
dmpatch_restore_code(1, g_get_patch[i], 0x80);
|
||||
dmpatch_restore_code(1, g_put_patch[i], 0x80);
|
||||
}
|
||||
}
|
||||
|
||||
vdebug("dmpatch_exit success\n");
|
||||
|
@@ -1,10 +1,12 @@
|
||||
1. install ubuntu 21.10
|
||||
2. apt-get install build-essential flex libncurses-dev linux-headers-generic linux-source libssl-dev ...... and so on
|
||||
3. cp /lib/modules/5.13.0-23-generic/build/Module.symvers ./
|
||||
4. /boot/config-5.13.0-23-generic as .config make oldconfig
|
||||
1. install ubuntu 22.04 5.15.0-25
|
||||
2. apt-get install build-essential flex libncurses-dev linux-headers-generic linux-source libssl-dev bison yacc vim libelf-dev ...... and so on
|
||||
3. cp /lib/modules/5.15.0-25-generic/build/Module.symvers ./
|
||||
4. /boot/config-5.15.0-25-generic as .config make oldconfig
|
||||
5. make menuconfig
|
||||
1. close CONFIG_STACKPROTECTOR
|
||||
2. close CONFIG_RETPOLINE
|
||||
3. close CONFIG_UBSAN_BOUNDS
|
||||
4. close CONFIG_UBSAN_ENUM
|
||||
|
||||
6. modify ./scripts/mod/modpost.c
|
||||
1. skip add_srcversion (just return)
|
||||
|
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
FTPIP=168.0.0.209
|
||||
FTPIP=192.168.44.1
|
||||
FTPUSR='a:a'
|
||||
|
||||
rm -f dmpatch.c Makefile Makefile_IBT
|
||||
@@ -27,7 +27,7 @@ mkdir ./aa
|
||||
cp -a *.c aa/
|
||||
cp -a Makefile aa/
|
||||
|
||||
cd /home/panda/linux-source-5.13.0
|
||||
cd /home/panda/linux-source-5.15.0
|
||||
make modules M=/home/panda/build/aa/
|
||||
strip --strip-debug /home/panda/build/aa/dm_patch.ko
|
||||
cd -
|
||||
@@ -43,7 +43,7 @@ mkdir ./aa
|
||||
cp -a *.c aa/
|
||||
cp -a Makefile_IBT aa/Makefile
|
||||
|
||||
cd /home/panda/linux-source-5.13.0
|
||||
cd /home/panda/linux-source-5.15.0
|
||||
make modules M=/home/panda/build/aa/
|
||||
strip --strip-debug /home/panda/build/aa/dm_patch_ibt.ko
|
||||
cd -
|
||||
|
@@ -49,6 +49,8 @@ ventoy_get_debian_distro() {
|
||||
echo 'mll'; return
|
||||
elif $GREP -m1 -q 'stratodesk.com' /init; then
|
||||
echo 'stratodesk'; return
|
||||
elif $GREP -q "\bPVE\b" /init; then
|
||||
echo 'pve'; return
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@@ -54,6 +54,21 @@ if [ -z "$dmsetup_path" ]; then
|
||||
ventoy_os_install_dmsetup "/dev/${1:0:-1}"
|
||||
fi
|
||||
|
||||
if [ -f /proc/devices ]; then
|
||||
vtlog "/proc/devices exist OK"
|
||||
else
|
||||
for i in 1 2 3 4 5 6 7 8 9; do
|
||||
if [ -f /proc/devices ]; then
|
||||
vtlog "/proc/devices exist OK now"
|
||||
break
|
||||
else
|
||||
vtlog "/proc/devices NOT exist, wait $i"
|
||||
$BUSYBOX_PATH/sleep 1
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
ventoy_udev_disk_common_hook $*
|
||||
|
||||
# OK finish
|
||||
|
@@ -209,11 +209,20 @@ ventoy_check_dm_module() {
|
||||
vtlog "modprobe failed, now try to insmod ko..."
|
||||
|
||||
$FIND /lib/modules/ -name "dm-mod.ko*" | while read vtline; do
|
||||
vtlog "insmode $vtline "
|
||||
vtlog "insmod $vtline "
|
||||
$BUSYBOX_PATH/insmod $vtline >>$VTLOG 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
vtlog "insmod success"
|
||||
else
|
||||
vtlog "insmod failed, try decompress"
|
||||
if echo $vtline | $GREP -q "\.zst"; then
|
||||
$VTOY_PATH/tool/zstdcat $vtline > $VTOY_PATH/extract_dm_mod.ko
|
||||
$BUSYBOX_PATH/insmod $VTOY_PATH/extract_dm_mod.ko >>$VTLOG 2>&1
|
||||
fi
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
if $GREP -q 'device-mapper' /proc/devices; then
|
||||
vtlog "device-mapper found in /proc/devices after retry"
|
||||
$BUSYBOX_PATH/true; return
|
||||
@@ -292,6 +301,7 @@ ventoy_need_dm_patch() {
|
||||
}
|
||||
|
||||
ventoy_dm_patch() {
|
||||
vtDmPatchDebug=0
|
||||
vtMType=$($BUSYBOX_PATH/uname -m)
|
||||
|
||||
vtlog "######### ventoy_dm_patch ############"
|
||||
@@ -334,6 +344,15 @@ ventoy_dm_patch() {
|
||||
get_addr=$(echo $vtLine | $AWK '{print $1}')
|
||||
get_size=$(echo $vtLine | $AWK '{print $2}')
|
||||
|
||||
vtLine=$($VTOY_PATH/tool/vtoyksym blkdev_get_by_dev $VTOY_PATH/kallsyms)
|
||||
vtlog "get blkdev_get_by_dev address $vtLine"
|
||||
blkdev_get_addr=$(echo $vtLine | $AWK '{print $1}')
|
||||
|
||||
vtLine=$($VTOY_PATH/tool/vtoyksym blkdev_put $VTOY_PATH/kallsyms)
|
||||
vtlog "get blkdev_put address $vtLine"
|
||||
blkdev_put_addr=$(echo $vtLine | $AWK '{print $1}')
|
||||
|
||||
|
||||
if $GREP -m1 -q 'close_table_device.isra' $VTOY_PATH/kallsyms; then
|
||||
vtLine=$($VTOY_PATH/tool/vtoyksym close_table_device.isra $VTOY_PATH/kallsyms)
|
||||
vtlog "get close_table_device.isra address $vtLine"
|
||||
@@ -350,6 +369,15 @@ ventoy_dm_patch() {
|
||||
kprobe_unreg_addr=$($GREP ' unregister_kprobe$' /proc/kallsyms | $AWK '{print $1}')
|
||||
|
||||
if [ "$VTOY_DEBUG_LEVEL" = "01" ]; then
|
||||
vtDmPatchDebug=1
|
||||
fi
|
||||
|
||||
if $GREP -q 'dmpatch_debug' /proc/cmdline; then
|
||||
vtDmPatchDebug=1
|
||||
fi
|
||||
|
||||
|
||||
if [ $vtDmPatchDebug -eq 1 ]; then
|
||||
printk_addr=$($GREP ' printk$' /proc/kallsyms | $AWK '{print $1}')
|
||||
if [ -z "$printk_addr" ]; then
|
||||
printk_addr=$($GREP ' _printk$' /proc/kallsyms | $AWK '{print $1}')
|
||||
@@ -364,6 +392,7 @@ ventoy_dm_patch() {
|
||||
|
||||
vtlog get_addr=$get_addr get_size=$get_size
|
||||
vtlog put_addr=$put_addr put_size=$put_size
|
||||
vtlog blkdev_get_addr=$blkdev_get_addr blkdev_put_addr=$blkdev_put_addr
|
||||
vtlog kprobe_reg_addr=$kprobe_reg_addr kprobe_unreg_addr=$kprobe_unreg_addr
|
||||
vtlog ro_addr=$ro_addr rw_addr=$rw_addr printk_addr=$printk_addr
|
||||
|
||||
@@ -378,20 +407,25 @@ ventoy_dm_patch() {
|
||||
|
||||
|
||||
vtKv=$($BUSYBOX_PATH/uname -r)
|
||||
vtKVMajor=$(echo $vtKv | $AWK -F. '{print $1}')
|
||||
vtKVMinor=$(echo $vtKv | $AWK -F. '{print $2}')
|
||||
|
||||
if [ ! -d /lib/modules/$vtKv ]; then
|
||||
vtlog "No modules directory found"
|
||||
return
|
||||
elif [ -d /lib/modules/$vtKv/kernel/fs ]; then
|
||||
vtModPath=$($FIND /lib/modules/$vtKv/kernel/fs/ -name "*.ko*" | $HEAD -n1)
|
||||
else
|
||||
elif [ -d /lib/modules/$vtKv/kernel ]; then
|
||||
vtModPath=$($FIND /lib/modules/$vtKv/kernel/ -name "xfs.ko*" | $HEAD -n1)
|
||||
elif [ -d /lib/modules/$vtKv/initrd ]; then
|
||||
vtModPath=$($FIND /lib/modules/$vtKv/initrd/ -name "xfs.ko*" | $HEAD -n1)
|
||||
fi
|
||||
|
||||
|
||||
|
||||
if [ -z "$vtModPath" ]; then
|
||||
vtModPath=$($FIND /lib/modules/$vtKv/kernel/ -name "*.ko*" | $HEAD -n1)
|
||||
vtModPath=$($FIND /lib/modules/$vtKv/ -name "*.ko*" | $HEAD -n1)
|
||||
fi
|
||||
|
||||
|
||||
vtModName=$($BUSYBOX_PATH/basename $vtModPath)
|
||||
|
||||
vtlog "template module is $vtModPath $vtModName"
|
||||
@@ -405,6 +439,8 @@ ventoy_dm_patch() {
|
||||
$BUSYBOX_PATH/xzcat $vtModPath > $VTOY_PATH/$vtModName
|
||||
elif echo $vtModPath | $GREP -q "[.]ko[.]gz$"; then
|
||||
$BUSYBOX_PATH/zcat $vtModPath > $VTOY_PATH/$vtModName
|
||||
elif echo $vtModPath | $GREP -q "[.]ko[.]zst$"; then
|
||||
$VTOY_PATH/tool/zstdcat $vtModPath > $VTOY_PATH/$vtModName
|
||||
else
|
||||
vtlog "unsupport module type"
|
||||
return
|
||||
@@ -413,18 +449,27 @@ ventoy_dm_patch() {
|
||||
|
||||
|
||||
#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
|
||||
vtlog "$VTOY_PATH/tool/vtoykmod -u $vtKVMajor $vtKVMinor $VTOY_PATH/tool/$vtKoName $VTOY_PATH/$vtModName $vtDebug"
|
||||
$VTOY_PATH/tool/vtoykmod -u $vtKVMajor $vtKVMinor $VTOY_PATH/tool/$vtKoName $VTOY_PATH/$vtModName $vtDebug >>$VTLOG 2>&1
|
||||
|
||||
#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 $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
|
||||
|
||||
vtPrams="$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 $vtKVMajor $vtIBT $vtKVMinor $blkdev_get_addr $blkdev_put_addr $vtDebug"
|
||||
|
||||
|
||||
vtlog "$VTOY_PATH/tool/vtoykmod -f $vtPrams"
|
||||
$VTOY_PATH/tool/vtoykmod -f $vtPrams >>$VTLOG 2>&1
|
||||
|
||||
$BUSYBOX_PATH/insmod $VTOY_PATH/tool/$vtKoName
|
||||
|
||||
vtlog "insmod $VTOY_PATH/tool/$vtKoName"
|
||||
$BUSYBOX_PATH/insmod $VTOY_PATH/tool/$vtKoName >>$VTLOG 2>&1
|
||||
|
||||
if $GREP -q 'dm_patch' /proc/modules; then
|
||||
vtlog "dm_patch module OK"
|
||||
echo "done" > $VTOY_PATH/dm_patch_done
|
||||
else
|
||||
vtlog "dm_patch module FAILED"
|
||||
fi
|
||||
|
||||
}
|
||||
|
Binary file not shown.
Binary file not shown.
@@ -196,7 +196,7 @@ fi
|
||||
|
||||
#change current directory to Ventoy disk
|
||||
cd "$mtpnt"
|
||||
$OLDDIR/tool/$TOOLDIR/Plugson "$HOST" "$PORT" "$OLDDIR" "$DISK" $version "$fstype" $partstyle $secureboot &
|
||||
"$OLDDIR/tool/$TOOLDIR/Plugson" "$HOST" "$PORT" "$OLDDIR" "$DISK" $version "$fstype" $partstyle $secureboot &
|
||||
wID=$!
|
||||
sleep 1
|
||||
|
||||
|
@@ -2397,7 +2397,7 @@ function mimg_common_menuentry {
|
||||
#############################################################
|
||||
#############################################################
|
||||
|
||||
set VENTOY_VERSION="1.0.95"
|
||||
set VENTOY_VERSION="1.0.97"
|
||||
|
||||
#ACPI not compatible with Window7/8, so disable by default
|
||||
set VTOY_PARAM_NO_ACPI=1
|
||||
|
19
INSTALL/grub/help/it_IT.txt
Normal file
19
INSTALL/grub/help/it_IT.txt
Normal file
@@ -0,0 +1,19 @@
|
||||
L - Selezione lingua
|
||||
F1 - Mostra informazioni di aiuto
|
||||
F2 - Sfoglia e avvia file sul disco locale
|
||||
F3 - Cambia la modalità del menu tra VistaAlbero <-> VistaLista
|
||||
F4 - Avvia Windows/Linux sul disco locale
|
||||
F5 - Utilità
|
||||
F6 - Carica il menu Grub2 personalizzato
|
||||
F7 - Passa tra Modalità GUI <-> Modalità TESTO
|
||||
|
||||
m/Ctrl+m - Checksum dei file immagine (md5/sha1/sha256/sha512)
|
||||
d/Ctrl+d - Modalità Memdisk (Solo per i file ISO/IMG di WinPE/LiveCD piccoli)
|
||||
w/Ctrl+w - Modalità WIMBOOT (SOlo per i file ISO di Windows/WinPE)
|
||||
r/Ctrl+r - Modalità Grub2 (Solo per alcune distro Linux)
|
||||
i/Ctrl+i - Modalità Compatibile (Solo per debugging)
|
||||
u/Ctrl+u - Carica driver EFI ISO (Solo per debugging, non può essere usato ufficialmente)
|
||||
|
||||
|
||||
|
||||
Premi ESC per ritornare ......
|
93
INSTALL/grub/menu/it_IT.json
Normal file
93
INSTALL/grub/menu/it_IT.json
Normal file
@@ -0,0 +1,93 @@
|
||||
{
|
||||
"VTLANG_LANGUAGE_NAME": "Italiano (Italian)",
|
||||
|
||||
"VTLANG_STR_HOTKEY_LIST": "L:Lingua F1:Aiuto F2:Sfoglia F3:VistaLista F4:BootLocale F5:Strumenti F6:ExMenu",
|
||||
"VTLANG_STR_HOTKEY_TREE": "L:Lingua F1:Aiuto F2:Sfoglia F3:VistaAlbero F4:BootLocale F5:Strumenti F6:ExMenu",
|
||||
"VTLANG_RETURN_PREVIOUS": "Ritorna al menu precedente [Esc]",
|
||||
"VTLANG_RETURN_PRV_NOESC": "Ritorna al menu precedente",
|
||||
|
||||
"VTLANG_MENU_LANG": "Menu selezione lingua",
|
||||
|
||||
"VTLANG_LB_SBOOT_WINDOWS": "Cerca e avvia Windows",
|
||||
"VTLANG_LB_SBOOT_G4D": "Cerca e avvia Grub4dos",
|
||||
"VTLANG_LB_SBOOT_HDD1": "Avvia il 1° disco locale",
|
||||
"VTLANG_LB_SBOOT_HDD2": "Avvia il 2° disco locale",
|
||||
"VTLANG_LB_SBOOT_HDD3": "Avvia il 3° disco locale",
|
||||
"VTLANG_LB_SBOOT_X64EFI": "Cerca e avvia BOOTX64.EFI",
|
||||
"VTLANG_LB_SBOOT_IA32EFI": "Cerca e avvia BOOTIA32.EFI",
|
||||
"VTLANG_LB_SBOOT_AA64EFI": "Cerca e avvia BOOTAA64.EFI",
|
||||
"VTLANG_LB_SBOOT_XORBOOT": "Cerca e avvia xorboot",
|
||||
|
||||
"VTLANG_FILE_CHKSUM": "Checksum file",
|
||||
"VTLANG_CHKSUM_MD5_CALC": "Calcola md5sum",
|
||||
"VTLANG_CHKSUM_SHA1_CALC": "Calcola sha1sum",
|
||||
"VTLANG_CHKSUM_SHA256_CALC": "Calcola sha256sum",
|
||||
"VTLANG_CHKSUM_SHA512_CALC": "Calcola sha512sum",
|
||||
"VTLANG_CHKSUM_MD5_CALC_CHK": "Calcola e controlla md5sum",
|
||||
"VTLANG_CHKSUM_SHA1_CALC_CHK": "Calcola e controlla sha1sum",
|
||||
"VTLANG_CHKSUM_SHA256_CALC_CHK": "Calcola e controlla sha256sum",
|
||||
"VTLANG_CHKSUM_SHA512_CALC_CHK": "Calcola e controlla sha512sum",
|
||||
|
||||
"VTLANG_POWER": "Spegni",
|
||||
"VTLANG_POWER_REBOOT": "Riavvia",
|
||||
"VTLANG_POWER_HALT": "Arresta",
|
||||
"VTLANG_POWER_BOOT_EFIFW": "Riavvia nel setup EFI",
|
||||
|
||||
"VTLANG_KEYBRD_LAYOUT": "Layout di tastiera",
|
||||
"VTLANG_HWINFO": "Informazioni hardware",
|
||||
|
||||
"VTLANG_RESOLUTION_CFG": "Configurazione risoluzione",
|
||||
"VTLANG_SCREEN_MODE": "Modalità display schermo",
|
||||
"VTLANG_SCREEN_TEXT_MODE": "Forza modalità testuale",
|
||||
"VTLANG_SCREEN_GUI_MODE": "Forza modalità grafica",
|
||||
|
||||
"VTLANG_THEME_SELECT": "Seleziona tema",
|
||||
|
||||
"VTLANG_UEFI_UTIL": "Utilità UEFI Ventoy UEFI Utilities",
|
||||
"VTLANG_UTIL_SHOW_EFI_DRV": "Mostra driver EFI",
|
||||
"VTLANG_UTIL_FIX_BLINIT_FAIL": "Correzione del fallimento di BlinitializeLibrary di Windows",
|
||||
|
||||
"VTLANG_JSON_CHK_JSON": "Controlla la configurazione json dei plugin (ventoy.json)",
|
||||
"VTLANG_JSON_CHK_CONTROL": "Controlla il controllo globale della configurazione dei plugin",
|
||||
"VTLANG_JSON_CHK_THEME": "Controlla il tema della configurazione dei plugin",
|
||||
"VTLANG_JSON_CHK_AUTOINS": "Controlla l'installazione automatica della configurazione dei plugin",
|
||||
"VTLANG_JSON_CHK_PERSIST": "Controlla la persistenza della configurazione dei plugin",
|
||||
"VTLANG_JSON_CHK_MENU_ALIAS": "Controlla l'alias del menu della configurazione dei plugin",
|
||||
"VTLANG_JSON_CHK_MENU_TIP": "Controlla il suggerimento del menu della configurazione dei plugin",
|
||||
"VTLANG_JSON_CHK_MENU_CLASS": "Controlla la classe del menu della configurazione dei plugin",
|
||||
"VTLANG_JSON_CHK_INJECTION": "Controlla l'injection della configurazione dei plugin",
|
||||
"VTLANG_JSON_CHK_AUTO_MEMDISK": "Controlla il memdisk automatico della configurazione dei plugin",
|
||||
"VTLANG_JSON_CHK_IMG_LIST": "Controlla la lista delle immagini della configurazione dei plugin",
|
||||
"VTLANG_JSON_CHK_IMG_BLIST": "Controlla la lista nera delle immagini della configurazione dei plugin",
|
||||
"VTLANG_JSON_CHK_CONF_REPLACE": "Controlla la sostituzione della configurazione di avvio della configurazione dei plugin",
|
||||
"VTLANG_JSON_CHK_DUD": "Controlla dud della configurazione dei plugin",
|
||||
"VTLANG_JSON_CHK_PASSWORD": "Controlla password della configurazione dei plugin",
|
||||
|
||||
"VTLANG_NORMAL_MODE": "Avvia in modalità normale",
|
||||
"VTLANG_WIMBOOT_MODE": "Avvia in modalità wimboot",
|
||||
"VTLANG_GRUB2_MODE": "Avvia in modalità grub2",
|
||||
"VTLANG_MEMDISK_MODE": "Avvia in modalità memdisk",
|
||||
|
||||
"VTLANG_RET_TO_LISTVIEW": "Ritorna alla VistaLista",
|
||||
"VTLANG_RET_TO_TREEVIEW": "Ritorna alla VistaAlbero",
|
||||
|
||||
"VTLANG_NO_AUTOINS_SCRIPT": "Avvia senza il modello di installazione automatica",
|
||||
"VTLANG_AUTOINS_USE": "Avvia con",
|
||||
|
||||
"VTLANG_NO_PERSIST": "Avvia senza persistenza",
|
||||
"VTLANG_PERSIST_USE": "Avvia con",
|
||||
|
||||
"VTLANG_BROWER_RETURN": "Ritorna",
|
||||
|
||||
"VTLANG_ENTER_EXIT": "premi il tasto Invio per uscire",
|
||||
"VTLANG_ENTER_REBOOT": "premi il tasto Invio per riavviare",
|
||||
"VTLANG_ENTER_CONTINUE": "premi il tasto Invio per continuare",
|
||||
|
||||
"VTLANG_CTRL_TEMP_SET": "Impostazioni controllo temporaneo",
|
||||
"VTLANG_WIN11_BYPASS_CHECK": "Bypassa il controllo di CPU/TPM/SecureBoot durante l'installazione di Windows 11",
|
||||
"VTLANG_WIN11_BYPASS_NRO": "Bypassa il requisito di un account online durante l'installazione di Windows 11",
|
||||
"VTLANG_LINUX_REMOUNT": "Monta la partizione di Ventoy dopo l'avvio di Linux",
|
||||
"VTLANG_SECONDARY_BOOT_MENU": "Mostra il menu di avvio secondario",
|
||||
|
||||
"MENU_STR_XXX": ""
|
||||
}
|
@@ -195,7 +195,7 @@ if [ "$MODE" = "install" -a -z "$NONDESTRUCTIVE" ]; then
|
||||
fi
|
||||
|
||||
if [ "$PARTTOOL" = "parted" ]; then
|
||||
if parted $DISK p | grep -i -q 'sector size.*4096.*4096'; then
|
||||
if parted -s $DISK p 2>&1 | grep -i -q 'sector size.*4096.*4096'; then
|
||||
vterr "Currently Ventoy does not support 4K native device."
|
||||
exit 1
|
||||
fi
|
||||
|
Binary file not shown.
@@ -1 +1 @@
|
||||
20221204 15:15:33
|
||||
20231014 18:52:12
|
@@ -1 +1 @@
|
||||
ar_ARbn_BNde_DEen_USes_ESfr_FRhi_HIhr_HRhu_HUid_IDja_JPka_GEko_KRpl_PLpt_PTru_RUsr_RSta_INtr_TRzh_CNzh_TW
|
||||
ar_ARbn_BNcs_CZde_DEel_GRen_USes_ESfr_FRhi_HIhr_HRhu_HUid_IDit_ITja_JPka_GEko_KRpl_PLpt_BRpt_PTru_RUsr_RSta_INtr_TRuk_UAzh_CNzh_TW
|
@@ -757,7 +757,7 @@
|
||||
|
||||
<footer class="main-footer">
|
||||
<div class="pull-right hidden-xs">
|
||||
<b id="plugson_build_date">20221204 15:15:33</b>
|
||||
<b id="plugson_build_date">20231014 18:52:12</b>
|
||||
</div>
|
||||
<strong><a href="https://www.ventoy.net" target="_blank">https://www.ventoy.net</a></strong>
|
||||
</footer>
|
||||
@@ -777,10 +777,10 @@
|
||||
<script src="/static/js/jQuery-2.1.4.min.js"></script>
|
||||
<!-- jquery validate -->
|
||||
<script src="/static/js/jquery.validate.min.js"></script>
|
||||
<script src="/static/js/jquery.validate.vtoymethods.js?v=142"></script>
|
||||
<script src="/static/js/jquery.validate.vtoymethods.js?v=192"></script>
|
||||
|
||||
<script src="/static/js/jquery.vtoy.alert.js?v=142"></script>
|
||||
<script src="/static/js/vtoy.js?v=142"></script>
|
||||
<script src="/static/js/jquery.vtoy.alert.js?v=192"></script>
|
||||
<script src="/static/js/vtoy.js?v=192"></script>
|
||||
<script src="/static/js/md5.min.js"></script>
|
||||
|
||||
<!-- Bootstrap 3.3.5 -->
|
||||
|
@@ -1 +1 @@
|
||||
ar_ARbn_BNde_DEen_USes_ESfr_FRhi_HIhr_HRhu_HUid_IDja_JPka_GEko_KRpl_PLpt_PTru_RUsr_RSta_INtr_TRzh_CNzh_TW
|
||||
ar_ARbn_BNcs_CZde_DEel_GRen_USes_ESfr_FRhi_HIhr_HRhu_HUid_IDit_ITja_JPka_GEko_KRpl_PLpt_BRpt_PTru_RUsl_sisr_RSta_INtr_TRuk_UAzh_CNzh_TW
|
@@ -185,13 +185,13 @@
|
||||
CommonPasswordEntry($tbl, 'efipwd', '所有 .efi 文件的默认密码。', 'Default password for all .efi files.');
|
||||
CommonPasswordEntry($tbl, 'vtoypwd', '所有 .vtoy 文件的默认密码。', 'Default password for all .vtoy files.');
|
||||
|
||||
$('input:text[id=id_bootpwd]').val(data.bootpwd);
|
||||
$('input:text[id=id_isopwd]').val(data.isopwd);
|
||||
$('input:text[id=id_wimpwd]').val(data.wimpwd);
|
||||
$('input:text[id=id_imgpwd]').val(data.imgpwd);
|
||||
$('input:text[id=id_efipwd]').val(data.efipwd);
|
||||
$('input:text[id=id_vhdpwd]').val(data.vhdpwd);
|
||||
$('input:text[id=id_vtoypwd]').val(data.vtoypwd);
|
||||
$('input:password[id=id_bootpwd]').val(data.bootpwd);
|
||||
$('input:password[id=id_isopwd]').val(data.isopwd);
|
||||
$('input:password[id=id_wimpwd]').val(data.wimpwd);
|
||||
$('input:password[id=id_imgpwd]').val(data.imgpwd);
|
||||
$('input:password[id=id_efipwd]').val(data.efipwd);
|
||||
$('input:password[id=id_vhdpwd]').val(data.vhdpwd);
|
||||
$('input:password[id=id_vtoypwd]').val(data.vtoypwd);
|
||||
}
|
||||
|
||||
function FillMenuPwdTable(data) {
|
||||
@@ -240,13 +240,13 @@
|
||||
}
|
||||
|
||||
function VtoyGetCurrentPageItem(data) {
|
||||
data.bootpwd = $('input:text[id=id_bootpwd]').val();
|
||||
data.isopwd = $('input:text[id=id_isopwd]').val();
|
||||
data.wimpwd = $('input:text[id=id_wimpwd]').val();
|
||||
data.imgpwd = $('input:text[id=id_imgpwd]').val();
|
||||
data.efipwd = $('input:text[id=id_efipwd]').val();
|
||||
data.vhdpwd = $('input:text[id=id_vhdpwd]').val();
|
||||
data.vtoypwd = $('input:text[id=id_vtoypwd]').val();
|
||||
data.bootpwd = $('input:password[id=id_bootpwd]').val();
|
||||
data.isopwd = $('input:password[id=id_isopwd]').val();
|
||||
data.wimpwd = $('input:password[id=id_wimpwd]').val();
|
||||
data.imgpwd = $('input:password[id=id_imgpwd]').val();
|
||||
data.efipwd = $('input:password[id=id_efipwd]').val();
|
||||
data.vhdpwd = $('input:password[id=id_vhdpwd]').val();
|
||||
data.vtoypwd = $('input:password[id=id_vtoypwd]').val();
|
||||
}
|
||||
|
||||
function VtoySaveCurrentPage() {
|
||||
@@ -417,7 +417,7 @@ function VtoySetPassword(common, type, cb, data) {
|
||||
});
|
||||
|
||||
function set_common_pwd_callback(path, pwd, type, data) {
|
||||
var selector = 'input:text[id=id_'+ data +']';
|
||||
var selector = 'input:password[id=id_'+ data +']';
|
||||
var value = format_password(pwd, type);
|
||||
|
||||
$(selector).val(value);
|
||||
@@ -433,7 +433,7 @@ function VtoySetPassword(common, type, cb, data) {
|
||||
var id = $(this).attr('id');
|
||||
|
||||
//id_btn_clr_
|
||||
var selector = 'input:text[id=id_'+ id.substr(11) +']';
|
||||
var selector = 'input:password[id=id_'+ id.substr(11) +']';
|
||||
$(selector).val('');
|
||||
VtoySaveCurrentPage();
|
||||
});
|
||||
@@ -525,13 +525,13 @@ function VtoySetPassword(common, type, cb, data) {
|
||||
});
|
||||
|
||||
function VtoySaveCurrentPage() {
|
||||
var bootpwd = $('input:text[id=id_bootpwd]').val();
|
||||
var isopwd = $('input:text[id=id_isopwd]').val();
|
||||
var wimpwd = $('input:text[id=id_wimpwd]').val();
|
||||
var imgpwd = $('input:text[id=id_imgpwd]').val();
|
||||
var vhdpwd = $('input:text[id=id_vhdpwd]').val();
|
||||
var efipwd = $('input:text[id=id_efipwd]').val();
|
||||
var vtoypwd = $('input:text[id=id_vtoypwd]').val();
|
||||
var bootpwd = $('input:password[id=id_bootpwd]').val();
|
||||
var isopwd = $('input:password[id=id_isopwd]').val();
|
||||
var wimpwd = $('input:password[id=id_wimpwd]').val();
|
||||
var imgpwd = $('input:password[id=id_imgpwd]').val();
|
||||
var vhdpwd = $('input:password[id=id_vhdpwd]').val();
|
||||
var efipwd = $('input:password[id=id_efipwd]').val();
|
||||
var vtoypwd = $('input:password[id=id_vtoypwd]').val();
|
||||
|
||||
callVtoy({
|
||||
method : 'save_password',
|
||||
@@ -548,13 +548,13 @@ function VtoySetPassword(common, type, cb, data) {
|
||||
});
|
||||
}
|
||||
|
||||
$('input:text[id=id_bootpwd]').change(VtoySaveCurrentPage);
|
||||
$('input:text[id=id_isopwd]').change(VtoySaveCurrentPage);
|
||||
$('input:text[id=id_wimpwd]').change(VtoySaveCurrentPage);
|
||||
$('input:text[id=id_imgpwd]').change(VtoySaveCurrentPage);
|
||||
$('input:text[id=id_vhdpwd]').change(VtoySaveCurrentPage);
|
||||
$('input:text[id=id_efipwd]').change(VtoySaveCurrentPage);
|
||||
$('input:text[id=id_vtoypwd]').change(VtoySaveCurrentPage);
|
||||
$('input:password[id=id_bootpwd]').change(VtoySaveCurrentPage);
|
||||
$('input:password[id=id_isopwd]').change(VtoySaveCurrentPage);
|
||||
$('input:password[id=id_wimpwd]').change(VtoySaveCurrentPage);
|
||||
$('input:password[id=id_imgpwd]').change(VtoySaveCurrentPage);
|
||||
$('input:password[id=id_vhdpwd]').change(VtoySaveCurrentPage);
|
||||
$('input:password[id=id_efipwd]').change(VtoySaveCurrentPage);
|
||||
$('input:password[id=id_vtoypwd]').change(VtoySaveCurrentPage);
|
||||
|
||||
$('#id_tab_password a[href="#tab_0"]').click(OnClickMultiModeTab);
|
||||
$('#id_tab_password a[href="#tab_1"]').click(OnClickMultiModeTab);
|
||||
|
@@ -357,7 +357,12 @@
|
||||
var id = $(this).attr('id');
|
||||
if (typeof(id) != 'undefined' && id.startsWith('id_theme_file')) {
|
||||
$(this).change(function() {
|
||||
m_data_theme[current_tab_index].default_file =parseInt(id.substr(id.length - 1));
|
||||
var prelen = 'id_theme_file_radio'.length;
|
||||
m_data_theme[current_tab_index].default_file = parseInt(id.substr(id.length - 1));
|
||||
if (id.substr(0, prelen) === 'id_theme_file_radio') {
|
||||
m_data_theme[current_tab_index].default_file = parseInt(id.substr(prelen));
|
||||
}
|
||||
|
||||
VtoySaveCurrentPage();
|
||||
});
|
||||
}
|
||||
|
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,147 @@
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD
|
||||
*
|
||||
* Copyright (c) 2020 longpanda <admin@ventoy.net>
|
||||
* Copyright (c) 2004-2005 Pawel Jakub Dawidek <pjd@FreeBSD.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#ifndef _G_VENTOY_H_
|
||||
#define _G_VENTOY_H_
|
||||
|
||||
#include <sys/endian.h>
|
||||
|
||||
#define G_VENTOY_CLASS_NAME "VENTOY"
|
||||
|
||||
#define G_VENTOY_MAGIC "GEOM::VENTOY"
|
||||
/*
|
||||
* Version history:
|
||||
* 1 - Initial version number.
|
||||
* 2 - Added 'stop' command to gconcat(8).
|
||||
* 3 - Added md_provider field to metadata and '-h' option to gconcat(8).
|
||||
* 4 - Added md_provsize field to metadata.
|
||||
*/
|
||||
#define G_VENTOY_VERSION 4
|
||||
|
||||
#ifdef _KERNEL
|
||||
#define G_VENTOY_TYPE_MANUAL 0
|
||||
#define G_VENTOY_TYPE_AUTOMATIC 1
|
||||
|
||||
#define G_DEBUG(...) if (bootverbose) printf(__VA_ARGS__)
|
||||
#define G_VENTOY_DEBUG(lvl, ...) if (g_ventoy_debug) printf(__VA_ARGS__)
|
||||
#define G_VENTOY_LOGREQ(bp, ...) if (g_ventoy_debug) printf(__VA_ARGS__)
|
||||
|
||||
struct g_ventoy_disk {
|
||||
TAILQ_ENTRY(g_ventoy_disk) d_next;
|
||||
struct g_consumer *d_consumer;
|
||||
struct g_ventoy_softc *d_softc;
|
||||
off_t d_start;
|
||||
off_t d_end;
|
||||
off_t d_map_start;
|
||||
off_t d_map_end;
|
||||
int d_candelete;
|
||||
int d_removed;
|
||||
bool d_hardcoded;
|
||||
};
|
||||
|
||||
struct g_ventoy_softc {
|
||||
u_int sc_type; /* provider type */
|
||||
struct g_geom *sc_geom;
|
||||
struct g_provider *sc_provider;
|
||||
uint32_t sc_id; /* concat unique ID */
|
||||
|
||||
uint16_t sc_ndisks;
|
||||
TAILQ_HEAD(g_ventoy_disks, g_ventoy_disk) sc_disks;
|
||||
struct mtx sc_completion_lock; /* synchronizes cross-boundary IOs */
|
||||
struct sx sc_disks_lock; /* synchronizes modification of sc_disks */
|
||||
};
|
||||
#define sc_name sc_geom->name
|
||||
|
||||
|
||||
#pragma pack(1)
|
||||
#define VENTOY_UNIX_SEG_MAGIC0 0x11223344
|
||||
#define VENTOY_UNIX_SEG_MAGIC1 0x55667788
|
||||
#define VENTOY_UNIX_SEG_MAGIC2 0x99aabbcc
|
||||
#define VENTOY_UNIX_SEG_MAGIC3 0xddeeff00
|
||||
#define VENTOY_UNIX_MAX_SEGNUM 40960
|
||||
struct g_ventoy_seg {
|
||||
uint64_t seg_start_bytes;
|
||||
uint64_t seg_end_bytes;
|
||||
};
|
||||
|
||||
struct g_ventoy_map{
|
||||
uint32_t magic1[4];
|
||||
uint32_t magic2[4];
|
||||
uint64_t segnum;
|
||||
uint64_t disksize;
|
||||
uint8_t diskuuid[16];
|
||||
struct g_ventoy_seg seglist[VENTOY_UNIX_MAX_SEGNUM];
|
||||
uint32_t magic3[4];
|
||||
};
|
||||
#pragma pack()
|
||||
|
||||
#define VENTOY_MAP_VALID(magic2) \
|
||||
(magic2[0] == VENTOY_UNIX_SEG_MAGIC0 && magic2[1] == VENTOY_UNIX_SEG_MAGIC1 && magic2[2] == VENTOY_UNIX_SEG_MAGIC2 && magic2[3] == VENTOY_UNIX_SEG_MAGIC3)
|
||||
|
||||
#endif /* _KERNEL */
|
||||
|
||||
struct g_ventoy_metadata {
|
||||
char md_magic[16]; /* Magic value. */
|
||||
uint32_t md_version; /* Version number. */
|
||||
char md_name[16]; /* Concat name. */
|
||||
uint32_t md_id; /* Unique ID. */
|
||||
uint16_t md_no; /* Disk number. */
|
||||
uint16_t md_all; /* Number of all disks. */
|
||||
char md_provider[16]; /* Hardcoded provider. */
|
||||
uint64_t md_provsize; /* Provider's size. */
|
||||
};
|
||||
static __inline void
|
||||
ventoy_metadata_encode(const struct g_ventoy_metadata *md, u_char *data)
|
||||
{
|
||||
|
||||
bcopy(md->md_magic, data, sizeof(md->md_magic));
|
||||
le32enc(data + 16, md->md_version);
|
||||
bcopy(md->md_name, data + 20, sizeof(md->md_name));
|
||||
le32enc(data + 36, md->md_id);
|
||||
le16enc(data + 40, md->md_no);
|
||||
le16enc(data + 42, md->md_all);
|
||||
bcopy(md->md_provider, data + 44, sizeof(md->md_provider));
|
||||
le64enc(data + 60, md->md_provsize);
|
||||
}
|
||||
static __inline void
|
||||
ventoy_metadata_decode(const u_char *data, struct g_ventoy_metadata *md)
|
||||
{
|
||||
|
||||
bcopy(data, md->md_magic, sizeof(md->md_magic));
|
||||
md->md_version = le32dec(data + 16);
|
||||
bcopy(data + 20, md->md_name, sizeof(md->md_name));
|
||||
md->md_id = le32dec(data + 36);
|
||||
md->md_no = le16dec(data + 40);
|
||||
md->md_all = le16dec(data + 42);
|
||||
bcopy(data + 44, md->md_provider, sizeof(md->md_provider));
|
||||
md->md_provsize = le64dec(data + 60);
|
||||
}
|
||||
#endif /* _G_VENTOY_H_ */
|
@@ -0,0 +1,8 @@
|
||||
# $FreeBSD$
|
||||
|
||||
.PATH: ${SRCTOP}/sys/geom/ventoy
|
||||
|
||||
KMOD= geom_ventoy
|
||||
SRCS= g_ventoy.c
|
||||
|
||||
.include <bsd.kmod.mk>
|
@@ -164,6 +164,13 @@ struct modversion_info {
|
||||
char name[64 - sizeof(unsigned long)];
|
||||
};
|
||||
|
||||
struct modversion_info2 {
|
||||
/* Offset of the next modversion entry in relation to this one. */
|
||||
uint32_t next;
|
||||
uint32_t crc;
|
||||
char name[0];
|
||||
};
|
||||
|
||||
|
||||
typedef struct ko_param
|
||||
{
|
||||
@@ -181,6 +188,9 @@ typedef struct ko_param
|
||||
unsigned long sym_put_size;
|
||||
unsigned long kv_major;
|
||||
unsigned long ibt;
|
||||
unsigned long kv_minor;
|
||||
unsigned long blkdev_get_addr;
|
||||
unsigned long blkdev_put_addr;
|
||||
unsigned long padding[1];
|
||||
}ko_param;
|
||||
|
||||
@@ -236,7 +246,7 @@ static int vtoykmod_read_file(char *name, char **buf)
|
||||
return size;
|
||||
}
|
||||
|
||||
static int vtoykmod_find_section64(char *buf, char *section, int *offset, int *len)
|
||||
static int vtoykmod_find_section64(char *buf, char *section, int *offset, int *len, Elf64_Shdr **shdr)
|
||||
{
|
||||
uint16_t i;
|
||||
int cmplen;
|
||||
@@ -258,6 +268,10 @@ static int vtoykmod_find_section64(char *buf, char *section, int *offset, int *l
|
||||
{
|
||||
*offset = (int)(sec[i].sh_offset);
|
||||
*len = (int)(sec[i].sh_size);
|
||||
if (shdr)
|
||||
{
|
||||
*shdr = sec + i;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -265,7 +279,7 @@ static int vtoykmod_find_section64(char *buf, char *section, int *offset, int *l
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int vtoykmod_find_section32(char *buf, char *section, int *offset, int *len)
|
||||
static int vtoykmod_find_section32(char *buf, char *section, int *offset, int *len, Elf32_Shdr **shdr)
|
||||
{
|
||||
uint16_t i;
|
||||
int cmplen;
|
||||
@@ -287,6 +301,10 @@ static int vtoykmod_find_section32(char *buf, char *section, int *offset, int *l
|
||||
{
|
||||
*offset = (int)(sec[i].sh_offset);
|
||||
*len = (int)(sec[i].sh_size);
|
||||
if (shdr)
|
||||
{
|
||||
*shdr = sec + i;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -294,14 +312,15 @@ static int vtoykmod_find_section32(char *buf, char *section, int *offset, int *l
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int vtoykmod_update_modcrc(char *oldmodver, int oldcnt, char *newmodver, int newcnt)
|
||||
static int vtoykmod_update_modcrc1(char *oldmodver, int oldcnt, char *newmodver, int newcnt)
|
||||
{
|
||||
int i, j;
|
||||
struct modversion_info *pold, *pnew;
|
||||
|
||||
|
||||
pold = (struct modversion_info *)oldmodver;
|
||||
pnew = (struct modversion_info *)newmodver;
|
||||
|
||||
debug("module update modver format 1\n");
|
||||
for (i = 0; i < oldcnt; i++)
|
||||
{
|
||||
for (j = 0; j < newcnt; j++)
|
||||
@@ -318,6 +337,51 @@ static int vtoykmod_update_modcrc(char *oldmodver, int oldcnt, char *newmodver,
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int vtoykmod_update_modcrc2(char *oldmodver, int oldlen, char *newmodver, int newlen)
|
||||
{
|
||||
struct modversion_info2 *pold, *pnew, *pnewend;
|
||||
|
||||
pold = (struct modversion_info2 *)oldmodver;
|
||||
pnew = (struct modversion_info2 *)newmodver;
|
||||
pnewend = (struct modversion_info2 *)(newmodver + newlen);
|
||||
|
||||
debug("module update modver format 2\n");
|
||||
/* here we think that there is only module_layout in oldmodver */
|
||||
|
||||
for (; pnew < pnewend && pnew->next; pnew = (struct modversion_info2 *)((char *)pnew + pnew->next))
|
||||
{
|
||||
if (strcmp(pnew->name, "module_layout") == 0)
|
||||
{
|
||||
debug("CRC 0x%08x --> 0x%08x %s\n", pold->crc, pnew->crc, pnew->name);
|
||||
memset(pold, 0, oldlen);
|
||||
pold->next = 0x18; /* 8 + module_layout align 8 */
|
||||
pold->crc = pnew->crc;
|
||||
strcpy(pold->name, pnew->name);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int vtoykmod_update_modcrc(char *oldmodver, int oldlen, char *newmodver, int newlen)
|
||||
{
|
||||
uint32_t uiCrc = 0;
|
||||
|
||||
memcpy(&uiCrc, newmodver + 4, 4);
|
||||
|
||||
if (uiCrc > 0)
|
||||
{
|
||||
return vtoykmod_update_modcrc2(oldmodver, oldlen, newmodver, newlen);
|
||||
}
|
||||
else
|
||||
{
|
||||
return vtoykmod_update_modcrc1(oldmodver, oldlen / 64, newmodver, newlen / 64);
|
||||
}
|
||||
}
|
||||
|
||||
static int vtoykmod_update_vermagic(char *oldbuf, int oldsize, char *newbuf, int newsize, int *modver)
|
||||
{
|
||||
int i = 0;
|
||||
@@ -358,7 +422,7 @@ static int vtoykmod_update_vermagic(char *oldbuf, int oldsize, char *newbuf, int
|
||||
return 0;
|
||||
}
|
||||
|
||||
int vtoykmod_update(char *oldko, char *newko)
|
||||
int vtoykmod_update(int kvMajor, int kvMinor, char *oldko, char *newko)
|
||||
{
|
||||
int rc = 0;
|
||||
int modver = 0;
|
||||
@@ -366,6 +430,7 @@ int vtoykmod_update(char *oldko, char *newko)
|
||||
int newoff, newlen;
|
||||
int oldsize, newsize;
|
||||
char *newbuf, *oldbuf;
|
||||
Elf64_Shdr *sec = NULL;
|
||||
|
||||
oldsize = vtoykmod_read_file(oldko, &oldbuf);
|
||||
newsize = vtoykmod_read_file(newko, &newbuf);
|
||||
@@ -382,18 +447,18 @@ int vtoykmod_update(char *oldko, char *newko)
|
||||
{
|
||||
if (oldbuf[EI_CLASS] == ELFCLASS64)
|
||||
{
|
||||
rc = vtoykmod_find_section64(oldbuf, "__versions", &oldoff, &oldlen);
|
||||
rc += vtoykmod_find_section64(newbuf, "__versions", &newoff, &newlen);
|
||||
rc = vtoykmod_find_section64(oldbuf, "__versions", &oldoff, &oldlen, NULL);
|
||||
rc += vtoykmod_find_section64(newbuf, "__versions", &newoff, &newlen, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
rc = vtoykmod_find_section32(oldbuf, "__versions", &oldoff, &oldlen);
|
||||
rc += vtoykmod_find_section32(newbuf, "__versions", &newoff, &newlen);
|
||||
rc = vtoykmod_find_section32(oldbuf, "__versions", &oldoff, &oldlen, NULL);
|
||||
rc += vtoykmod_find_section32(newbuf, "__versions", &newoff, &newlen, NULL);
|
||||
}
|
||||
|
||||
if (rc == 0)
|
||||
{
|
||||
vtoykmod_update_modcrc(oldbuf + oldoff, oldlen / 64, newbuf + newoff, newlen / 64);
|
||||
vtoykmod_update_modcrc(oldbuf + oldoff, oldlen, newbuf + newoff, newlen);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -406,8 +471,8 @@ int vtoykmod_update(char *oldko, char *newko)
|
||||
{
|
||||
Elf64_Rela *oldRela, *newRela;
|
||||
|
||||
rc = vtoykmod_find_section64(oldbuf, ".rela.gnu.linkonce.this_module", &oldoff, &oldlen);
|
||||
rc += vtoykmod_find_section64(newbuf, ".rela.gnu.linkonce.this_module", &newoff, &newlen);
|
||||
rc = vtoykmod_find_section64(oldbuf, ".rela.gnu.linkonce.this_module", &oldoff, &oldlen, NULL);
|
||||
rc += vtoykmod_find_section64(newbuf, ".rela.gnu.linkonce.this_module", &newoff, &newlen, NULL);
|
||||
if (rc == 0)
|
||||
{
|
||||
oldRela = (Elf64_Rela *)(oldbuf + oldoff);
|
||||
@@ -425,13 +490,31 @@ int vtoykmod_update(char *oldko, char *newko)
|
||||
{
|
||||
debug("section .rela.gnu.linkonce.this_module not found\n");
|
||||
}
|
||||
|
||||
if (kvMajor > 6 || (kvMajor == 6 && kvMinor >= 3))
|
||||
{
|
||||
rc = vtoykmod_find_section64(oldbuf, ".gnu.linkonce.this_module", &oldoff, &oldlen, &sec);
|
||||
rc += vtoykmod_find_section64(newbuf, ".gnu.linkonce.this_module", &newoff, &newlen, NULL);
|
||||
if (rc == 0)
|
||||
{
|
||||
debug("section .gnu.linkonce.this_module change oldlen:0x%x to newlen:0x%x\n", oldlen, newlen);
|
||||
if (sec)
|
||||
{
|
||||
sec->sh_size = newlen;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
debug("section .gnu.linkonce.this_module not found\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Elf32_Rel *oldRel, *newRel;
|
||||
|
||||
rc = vtoykmod_find_section32(oldbuf, ".rel.gnu.linkonce.this_module", &oldoff, &oldlen);
|
||||
rc += vtoykmod_find_section32(newbuf, ".rel.gnu.linkonce.this_module", &newoff, &newlen);
|
||||
rc = vtoykmod_find_section32(oldbuf, ".rel.gnu.linkonce.this_module", &oldoff, &oldlen, NULL);
|
||||
rc += vtoykmod_find_section32(newbuf, ".rel.gnu.linkonce.this_module", &newoff, &newlen, NULL);
|
||||
if (rc == 0)
|
||||
{
|
||||
oldRel = (Elf32_Rel *)(oldbuf + oldoff);
|
||||
@@ -489,8 +572,11 @@ int vtoykmod_fill_param(char **argv)
|
||||
param->sym_put_size = strtoul(argv[8], NULL, 10);
|
||||
param->reg_kprobe_addr = strtoul(argv[9], NULL, 16);
|
||||
param->unreg_kprobe_addr = strtoul(argv[10], NULL, 16);
|
||||
param->kv_major = (unsigned long)(argv[11][0] - '0');
|
||||
param->kv_major = strtoul(argv[11], NULL, 10);
|
||||
param->ibt = strtoul(argv[12], NULL, 16);;
|
||||
param->kv_minor = strtoul(argv[13], NULL, 10);
|
||||
param->blkdev_get_addr = strtoul(argv[14], NULL, 16);
|
||||
param->blkdev_put_addr = strtoul(argv[15], NULL, 16);
|
||||
|
||||
debug("pgsize=%lu (%s)\n", param->pgsize, argv[1]);
|
||||
debug("printk_addr=0x%lx (%s)\n", param->printk_addr, argv[2]);
|
||||
@@ -504,6 +590,9 @@ int vtoykmod_fill_param(char **argv)
|
||||
debug("unreg_kprobe_addr=0x%lx (%s)\n", param->unreg_kprobe_addr, argv[10]);
|
||||
debug("kv_major=%lu (%s)\n", param->kv_major, argv[11]);
|
||||
debug("ibt=0x%lx (%s)\n", param->ibt, argv[12]);
|
||||
debug("kv_minor=%lu (%s)\n", param->kv_minor, argv[13]);
|
||||
debug("blkdev_get_addr=0x%lx (%s)\n", param->blkdev_get_addr, argv[14]);
|
||||
debug("blkdev_put_addr=0x%lx (%s)\n", param->blkdev_put_addr, argv[15]);
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -543,6 +632,8 @@ static int vtoykmod_check_ibt(void)
|
||||
int vtoykmod_main(int argc, char **argv)
|
||||
{
|
||||
int i;
|
||||
int kvMajor = 0;
|
||||
int kvMinor = 0;
|
||||
|
||||
for (i = 0; i < argc; i++)
|
||||
{
|
||||
@@ -553,13 +644,25 @@ int vtoykmod_main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
if (verbose)
|
||||
{
|
||||
printf("==== Dump Argv ====\n");
|
||||
for (i = 0; i < argc; i++)
|
||||
{
|
||||
printf("<%s> ", argv[i]);
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
if (argv[1][0] == '-' && argv[1][1] == 'f')
|
||||
{
|
||||
return vtoykmod_fill_param(argv + 2);
|
||||
}
|
||||
else if (argv[1][0] == '-' && argv[1][1] == 'u')
|
||||
{
|
||||
return vtoykmod_update(argv[2], argv[3]);
|
||||
kvMajor = (int)strtol(argv[2], NULL, 10);
|
||||
kvMinor = (int)strtol(argv[3], NULL, 10);
|
||||
return vtoykmod_update(kvMajor, kvMinor, argv[4], argv[5]);
|
||||
}
|
||||
else if (argv[1][0] == '-' && argv[1][1] == 'I')
|
||||
{
|
||||
|
@@ -21,6 +21,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
|
||||
@@ -30,10 +31,12 @@ static int verbose = 0;
|
||||
int vtoyksym_main(int argc, char **argv)
|
||||
{
|
||||
int i;
|
||||
int len = 0;
|
||||
unsigned long long addr1 = 0;
|
||||
unsigned long long addr2 = 0;
|
||||
char sym[256];
|
||||
char line[1024];
|
||||
char *start = NULL;
|
||||
const char *name = NULL;
|
||||
FILE *fp;
|
||||
|
||||
@@ -68,9 +71,11 @@ int vtoyksym_main(int argc, char **argv)
|
||||
snprintf(sym, sizeof(sym), " %s", argv[1]);
|
||||
debug("lookup for <%s>\n", sym);
|
||||
|
||||
len = (int)strlen(sym);
|
||||
while (fgets(line, sizeof(line), fp))
|
||||
{
|
||||
if (strstr(line, sym))
|
||||
start = strstr(line, sym);
|
||||
if (start && (start > line) && isspace(*(start + len)))
|
||||
{
|
||||
addr1 = strtoull(line, NULL, 16);
|
||||
if (!fgets(line, sizeof(line), fp))
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user