Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
dadigang
Ventoy
Commits
e5fa5e6d
Commit
e5fa5e6d
authored
Jan 12, 2022
by
longpanda
Browse files
VTOY_LINUX_REMOUNT support for both 64bit(x86_64) and 32bit(i386) linux distro.
parent
76a6b806
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
3 deletions
+13
-3
DMPATCH/dmpatch.c
DMPATCH/dmpatch.c
+10
-2
DMPATCH/readme.txt
DMPATCH/readme.txt
+1
-1
IMG/cpio/ventoy/hook/ventoy-hook-lib.sh
IMG/cpio/ventoy/hook/ventoy-hook-lib.sh
+2
-0
IMG/cpio_x86/ventoy/tool/dm_patch_32.ko
IMG/cpio_x86/ventoy/tool/dm_patch_32.ko
+0
-0
IMG/cpio_x86/ventoy/tool/dm_patch_64.ko
IMG/cpio_x86/ventoy/tool/dm_patch_64.ko
+0
-0
No files found.
DMPATCH/dmpatch.c
View file @
e5fa5e6d
...
...
@@ -68,9 +68,17 @@ static volatile ko_param g_ko_param =
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
};
#if defined(CONFIG_X86_64)
#define PATCH_OP_POS 3
#define CODE_MATCH(code, i) \
(code[i] == 0x40 && code[i + 1] == 0x80 && code[i + 2] == 0xce && code[i + 3] == 0x80)
#elif defined(CONFIG_X86_32)
#define PATCH_OP_POS 2
#define CODE_MATCH(code, i) \
(code[i] == 0x80 && code[i + 1] == 0xca && code[i + 2] == 0x80 && code[i + 3] == 0xe8)
#else
#error "unsupported arch"
#endif
#define vdebug(fmt, args...) if(kprintf) kprintf(KERN_ERR fmt, ##args)
...
...
@@ -88,7 +96,7 @@ static int notrace dmpatch_replace_code(unsigned long addr, unsigned long size,
{
if
(
CODE_MATCH
(
opCode
,
i
)
&&
cnt
<
MAX_PATCH
)
{
patch
[
cnt
]
=
opCode
+
i
+
3
;
patch
[
cnt
]
=
opCode
+
i
+
PATCH_OP_POS
;
cnt
++
;
}
}
...
...
DMPATCH/readme.txt
View file @
e5fa5e6d
1. install ubuntu 21.10
2. apt-get install build-essential flex ncurse linux-headers-generic linux-source ...... and so on
2. apt-get install build-essential flex
lib
ncurse
s-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
5. make menuconfig
...
...
IMG/cpio/ventoy/hook/ventoy-hook-lib.sh
View file @
e5fa5e6d
...
...
@@ -256,6 +256,8 @@ ventoy_dm_patch() {
if
echo
$vtMType
|
$EGREP
-i
-q
"x86.64|amd64"
;
then
vtKoName
=
dm_patch_64.ko
elif
echo
$vtMType
|
$EGREP
-i
-q
"i[3-6]86"
;
then
vtKoName
=
dm_patch_32.ko
else
vtlog
"unsupported machine type
$vtMType
"
return
...
...
IMG/cpio_x86/ventoy/tool/dm_patch_32.ko
0 → 100644
View file @
e5fa5e6d
File added
IMG/cpio_x86/ventoy/tool/dm_patch_64.ko
View file @
e5fa5e6d
No preview for this file type
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment