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
4707022e
Commit
4707022e
authored
Dec 23, 2022
by
longpanda
Browse files
Add prompt and wait for key when Ventoy check device failed. (#2094)
parent
e03c7397
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
4 deletions
+24
-4
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_cmd.c
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_cmd.c
+24
-4
No files found.
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_cmd.c
View file @
4707022e
...
@@ -497,6 +497,7 @@ static int ventoy_set_check_result(int ret, const char *msg)
...
@@ -497,6 +497,7 @@ static int ventoy_set_check_result(int ret, const char *msg)
if
(
ret
)
if
(
ret
)
{
{
grub_cls
();
grub_printf
(
VTOY_WARNING
"
\n
"
);
grub_printf
(
VTOY_WARNING
"
\n
"
);
grub_printf
(
VTOY_WARNING
"
\n
"
);
grub_printf
(
VTOY_WARNING
"
\n
"
);
grub_printf
(
VTOY_WARNING
"
\n\n\n
"
);
grub_printf
(
VTOY_WARNING
"
\n\n\n
"
);
...
@@ -504,10 +505,7 @@ static int ventoy_set_check_result(int ret, const char *msg)
...
@@ -504,10 +505,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
(
"This is NOT a standard Ventoy device and is NOT supported (%d).
\n
"
,
ret
);
grub_printf
(
"Error message: <%s>
\n\n
"
,
msg
);
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
(
"You should follow the instructions in https://www.ventoy.net to use Ventoy.
\n
"
);
grub_printf
(
"
\n\n
Will exit after 10 seconds ...... "
);
grub_refresh
();
grub_refresh
();
grub_sleep
(
10
);
}
}
return
ret
;
return
ret
;
...
@@ -4975,6 +4973,7 @@ int ventoy_load_part_table(const char *diskname)
...
@@ -4975,6 +4973,7 @@ int ventoy_load_part_table(const char *diskname)
static
grub_err_t
ventoy_cmd_load_part_table
(
grub_extcmd_context_t
ctxt
,
int
argc
,
char
**
args
)
static
grub_err_t
ventoy_cmd_load_part_table
(
grub_extcmd_context_t
ctxt
,
int
argc
,
char
**
args
)
{
{
int
ret
;
int
ret
;
char
c
;
(
void
)
argc
;
(
void
)
argc
;
(
void
)
ctxt
;
(
void
)
ctxt
;
...
@@ -4982,7 +4981,28 @@ static grub_err_t ventoy_cmd_load_part_table(grub_extcmd_context_t ctxt, int arg
...
@@ -4982,7 +4981,28 @@ static grub_err_t ventoy_cmd_load_part_table(grub_extcmd_context_t ctxt, int arg
ret
=
ventoy_load_part_table
(
args
[
0
]);
ret
=
ventoy_load_part_table
(
args
[
0
]);
if
(
ret
)
if
(
ret
)
{
{
grub_exit
();
grub_printf
(
"
\n\n
Press r/h/e for the corresponding operation.
\n
"
);
grub_printf
(
" r --- Reboot
\n
"
);
grub_printf
(
" h --- Halt
\n
"
);
grub_printf
(
" e --- Exit grub
\n
"
);
grub_refresh
();
while
(
1
)
{
c
=
grub_getkey
();
if
(
c
==
'r'
)
{
grub_reboot
();
}
else
if
(
c
==
'h'
)
{
grub_script_execute_sourcecode
(
"halt"
);
}
else
if
(
c
==
'e'
)
{
grub_exit
();
}
}
}
}
g_ventoy_disk_part_size
[
0
]
=
ventoy_get_vtoy_partsize
(
0
);
g_ventoy_disk_part_size
[
0
]
=
ventoy_get_vtoy_partsize
(
0
);
...
...
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