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
bb7e10d9
Commit
bb7e10d9
authored
Mar 02, 2021
by
longpanda
Browse files
Add VTOY_MAX_SEARCH_LEVEL option in global control plugin
parent
324c9788
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
0 deletions
+18
-0
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy.c
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy.c
+17
-0
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_def.h
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_def.h
+1
-0
No files found.
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy.c
View file @
bb7e10d9
...
@@ -74,6 +74,7 @@ int g_ventoy_img_count = 0;
...
@@ -74,6 +74,7 @@ int g_ventoy_img_count = 0;
grub_device_t
g_enum_dev
=
NULL
;
grub_device_t
g_enum_dev
=
NULL
;
grub_fs_t
g_enum_fs
=
NULL
;
grub_fs_t
g_enum_fs
=
NULL
;
int
g_img_max_search_level
=
-
1
;
img_iterator_node
g_img_iterator_head
;
img_iterator_node
g_img_iterator_head
;
img_iterator_node
*
g_img_iterator_tail
=
NULL
;
img_iterator_node
*
g_img_iterator_tail
=
NULL
;
...
@@ -1194,6 +1195,11 @@ static int ventoy_collect_img_files(const char *filename, const struct grub_dirh
...
@@ -1194,6 +1195,11 @@ static int ventoy_collect_img_files(const char *filename, const struct grub_dirh
if
(
info
->
dir
)
if
(
info
->
dir
)
{
{
if
(
node
->
level
+
1
>
g_img_max_search_level
)
{
return
0
;
}
if
((
len
==
1
&&
filename
[
0
]
==
'.'
)
||
if
((
len
==
1
&&
filename
[
0
]
==
'.'
)
||
(
len
==
2
&&
filename
[
0
]
==
'.'
&&
filename
[
1
]
==
'.'
))
(
len
==
2
&&
filename
[
0
]
==
'.'
&&
filename
[
1
]
==
'.'
))
{
{
...
@@ -1224,6 +1230,7 @@ static int ventoy_collect_img_files(const char *filename, const struct grub_dirh
...
@@ -1224,6 +1230,7 @@ static int ventoy_collect_img_files(const char *filename, const struct grub_dirh
new_node
=
grub_zalloc
(
sizeof
(
img_iterator_node
));
new_node
=
grub_zalloc
(
sizeof
(
img_iterator_node
));
if
(
new_node
)
if
(
new_node
)
{
{
new_node
->
level
=
node
->
level
+
1
;
new_node
->
plugin_list_index
=
index
;
new_node
->
plugin_list_index
=
index
;
new_node
->
dirlen
=
grub_snprintf
(
new_node
->
dir
,
sizeof
(
new_node
->
dir
),
"%s%s/"
,
node
->
dir
,
filename
);
new_node
->
dirlen
=
grub_snprintf
(
new_node
->
dir
,
sizeof
(
new_node
->
dir
),
"%s%s/"
,
node
->
dir
,
filename
);
...
@@ -2054,6 +2061,16 @@ static grub_err_t ventoy_cmd_list_img(grub_extcmd_context_t ctxt, int argc, char
...
@@ -2054,6 +2061,16 @@ static grub_err_t ventoy_cmd_list_img(grub_extcmd_context_t ctxt, int argc, char
g_img_iterator_head
.
tail
=
&
tail
;
g_img_iterator_head
.
tail
=
&
tail
;
if
(
g_img_max_search_level
<
0
)
{
g_img_max_search_level
=
GRUB_INT_MAX
;
strdata
=
ventoy_get_env
(
"VTOY_MAX_SEARCH_LEVEL"
);
if
(
strdata
&&
ventoy_is_decimal
(
strdata
))
{
g_img_max_search_level
=
(
int
)
grub_strtoul
(
strdata
,
NULL
,
10
);
}
}
for
(
node
=
&
g_img_iterator_head
;
node
;
node
=
node
->
next
)
for
(
node
=
&
g_img_iterator_head
;
node
;
node
=
node
->
next
)
{
{
fs
->
fs_dir
(
dev
,
node
->
dir
,
ventoy_collect_img_files
,
node
);
fs
->
fs_dir
(
dev
,
node
->
dir
,
ventoy_collect_img_files
,
node
);
...
...
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_def.h
View file @
bb7e10d9
...
@@ -205,6 +205,7 @@ typedef struct img_iterator_node
...
@@ -205,6 +205,7 @@ typedef struct img_iterator_node
img_info
**
tail
;
img_info
**
tail
;
char
dir
[
400
];
char
dir
[
400
];
int
dirlen
;
int
dirlen
;
int
level
;
int
isocnt
;
int
isocnt
;
int
done
;
int
done
;
int
select
;
int
select
;
...
...
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