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
12b51bcf
"docs/developer_guide/setup_github_runner.md" did not exist on "7a0bbe6a64ee61f0bd22811a3b72bc7418e15c17"
Commit
12b51bcf
authored
Dec 24, 2022
by
longpanda
Browse files
Change the prompt format when check device failed. (#2094)
parent
911d5dca
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
22 deletions
+55
-22
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_cmd.c
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_cmd.c
+55
-22
No files found.
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_cmd.c
View file @
12b51bcf
...
@@ -5005,40 +5005,73 @@ int ventoy_load_part_table(const char *diskname)
...
@@ -5005,40 +5005,73 @@ int ventoy_load_part_table(const char *diskname)
return
0
;
return
0
;
}
}
static
grub_err_t
ventoy_cmd_load_part_table
(
grub_extcmd_context_t
ctxt
,
int
argc
,
char
**
args
)
static
void
ventoy_prompt_end
(
void
)
{
{
int
ret
;
int
op
=
0
;
char
c
;
char
c
;
(
void
)
argc
;
(
void
)
ctxt
;
ret
=
ventoy_load_part_table
(
args
[
0
]);
grub_printf
(
"
\n\n\n
"
);
if
(
ret
)
grub_printf
(
" 1 --- Exit grub
\n
"
);
{
grub_printf
(
" 2 --- Reboot
\n
"
);
grub_printf
(
"
\n\n
Press r/h/e for the corresponding operation.
\n
"
);
grub_printf
(
" 3 --- Shut down
\n
"
);
grub_printf
(
" r --- Reboot
\n
"
);
grub_printf
(
"Please enter your choice: "
);
grub_printf
(
" h --- Halt
\n
"
);
grub_refresh
();
grub_printf
(
" e --- Exit grub
\n
"
);
grub_refresh
();
while
(
1
)
while
(
1
)
{
c
=
grub_getkey
();
if
(
c
>=
'1'
&&
c
<=
'3'
)
{
{
c
=
grub_getkey
();
if
(
op
==
0
)
if
(
c
==
'r'
)
{
{
grub_reboot
();
op
=
c
-
'0'
;
grub_printf
(
"%c"
,
c
);
grub_refresh
();
}
}
else
if
(
c
==
'h'
)
}
{
else
if
(
c
==
'\r'
||
c
==
'\n'
)
grub_script_execute_sourcecode
(
"halt"
);
{
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
==
'e'
)
}
else
if
(
c
==
'\b'
)
{
if
(
op
)
{
{
grub_exit
();
op
=
0
;
grub_printf
(
"
\r
Please enter your choice: "
);
grub_printf
(
"
\r
Please 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
;
(
void
)
argc
;
(
void
)
ctxt
;
ret
=
ventoy_load_part_table
(
args
[
0
]);
if
(
ret
)
{
ventoy_prompt_end
();
}
g_ventoy_disk_part_size
[
0
]
=
ventoy_get_vtoy_partsize
(
0
);
g_ventoy_disk_part_size
[
0
]
=
ventoy_get_vtoy_partsize
(
0
);
g_ventoy_disk_part_size
[
1
]
=
ventoy_get_vtoy_partsize
(
1
);
g_ventoy_disk_part_size
[
1
]
=
ventoy_get_vtoy_partsize
(
1
);
...
...
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