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
b0208c8c
Commit
b0208c8c
authored
Feb 04, 2021
by
longpanda
Browse files
Only use acpi when secureboot if enabled in UEFI mode.
parent
b1d52370
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
1 deletion
+35
-1
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy.c
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy.c
+32
-0
INSTALL/grub/arm64-efi/true.mod
INSTALL/grub/arm64-efi/true.mod
+0
-0
INSTALL/grub/grub.cfg
INSTALL/grub/grub.cfg
+3
-1
INSTALL/grub/i386-efi/true.mod
INSTALL/grub/i386-efi/true.mod
+0
-0
INSTALL/grub/x86_64-efi/true.mod
INSTALL/grub/x86_64-efi/true.mod
+0
-0
No files found.
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy.c
View file @
b0208c8c
...
@@ -36,6 +36,7 @@
...
@@ -36,6 +36,7 @@
#include <grub/misc.h>
#include <grub/misc.h>
#include <grub/kernel.h>
#include <grub/kernel.h>
#ifdef GRUB_MACHINE_EFI
#ifdef GRUB_MACHINE_EFI
#include <grub/efi/api.h>
#include <grub/efi/efi.h>
#include <grub/efi/efi.h>
#endif
#endif
#include <grub/time.h>
#include <grub/time.h>
...
@@ -3370,6 +3371,36 @@ static grub_err_t ventoy_cmd_img_unhook_root(grub_extcmd_context_t ctxt, int arg
...
@@ -3370,6 +3371,36 @@ static grub_err_t ventoy_cmd_img_unhook_root(grub_extcmd_context_t ctxt, int arg
return
0
;
return
0
;
}
}
#ifdef GRUB_MACHINE_EFI
static
grub_err_t
ventoy_cmd_check_secureboot_var
(
grub_extcmd_context_t
ctxt
,
int
argc
,
char
**
args
)
{
int
ret
=
1
;
grub_uint8_t
*
var
;
grub_size_t
size
;
grub_efi_guid_t
global
=
GRUB_EFI_GLOBAL_VARIABLE_GUID
;
(
void
)
ctxt
;
(
void
)
argc
;
(
void
)
args
;
var
=
grub_efi_get_variable
(
"SecureBoot"
,
&
global
,
&
size
);
if
(
var
&&
*
var
==
1
)
{
return
0
;
}
return
ret
;
}
#else
static
grub_err_t
ventoy_cmd_check_secureboot_var
(
grub_extcmd_context_t
ctxt
,
int
argc
,
char
**
args
)
{
(
void
)
ctxt
;
(
void
)
argc
;
(
void
)
args
;
return
1
;
}
#endif
static
grub_err_t
ventoy_cmd_acpi_param
(
grub_extcmd_context_t
ctxt
,
int
argc
,
char
**
args
)
static
grub_err_t
ventoy_cmd_acpi_param
(
grub_extcmd_context_t
ctxt
,
int
argc
,
char
**
args
)
{
{
int
i
;
int
i
;
...
@@ -4249,6 +4280,7 @@ static cmd_para ventoy_cmds[] =
...
@@ -4249,6 +4280,7 @@ static cmd_para ventoy_cmds[] =
{
"vt_img_hook_root"
,
ventoy_cmd_img_hook_root
,
0
,
NULL
,
""
,
""
,
NULL
},
{
"vt_img_hook_root"
,
ventoy_cmd_img_hook_root
,
0
,
NULL
,
""
,
""
,
NULL
},
{
"vt_img_unhook_root"
,
ventoy_cmd_img_unhook_root
,
0
,
NULL
,
""
,
""
,
NULL
},
{
"vt_img_unhook_root"
,
ventoy_cmd_img_unhook_root
,
0
,
NULL
,
""
,
""
,
NULL
},
{
"vt_acpi_param"
,
ventoy_cmd_acpi_param
,
0
,
NULL
,
""
,
""
,
NULL
},
{
"vt_acpi_param"
,
ventoy_cmd_acpi_param
,
0
,
NULL
,
""
,
""
,
NULL
},
{
"vt_check_secureboot_var"
,
ventoy_cmd_check_secureboot_var
,
0
,
NULL
,
""
,
""
,
NULL
},
};
};
...
...
INSTALL/grub/arm64-efi/true.mod
deleted
100644 → 0
View file @
b1d52370
File deleted
INSTALL/grub/grub.cfg
View file @
b0208c8c
...
@@ -1224,7 +1224,9 @@ function vtoyboot_common_func {
...
@@ -1224,7 +1224,9 @@ function vtoyboot_common_func {
linux16 $vtoy_path/ipxe.krn ${vtdebug_flag} bios80 sector512 mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size}
linux16 $vtoy_path/ipxe.krn ${vtdebug_flag} bios80 sector512 mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size}
boot
boot
else
else
vt_acpi_param ${vtoy_chain_mem_addr} 512
if vt_check_secureboot_var; then
vt_acpi_param ${vtoy_chain_mem_addr} 512
fi
ventoy_cli_console
ventoy_cli_console
chainloader ${vtoy_path}/ventoy_${VTOY_EFI_ARCH}.efi sector512 env_param=${ventoy_env_param} ${vtdebug_flag} mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size}
chainloader ${vtoy_path}/ventoy_${VTOY_EFI_ARCH}.efi sector512 env_param=${ventoy_env_param} ${vtdebug_flag} mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size}
boot
boot
...
...
INSTALL/grub/i386-efi/true.mod
deleted
100644 → 0
View file @
b1d52370
File deleted
INSTALL/grub/x86_64-efi/true.mod
deleted
100644 → 0
View file @
b1d52370
File deleted
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