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
0b81845e
Commit
0b81845e
authored
Jun 30, 2022
by
longpanda
Browse files
.ventoyignore also works in F2 browser mode.
parent
3c621e4a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
0 deletions
+29
-0
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_browser.c
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_browser.c
+29
-0
No files found.
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_browser.c
View file @
0b81845e
...
...
@@ -171,6 +171,11 @@ static int ventoy_browser_iterate_partition(struct grub_disk *disk, const grub_p
fs
->
fs_label
(
dev
,
&
Label
);
if
(
ventoy_check_file_exist
(
"(%s)/.ventoyignore"
,
partname
))
{
return
0
;
}
if
(
g_tree_view_menu_style
==
0
)
{
grub_snprintf
(
title
,
sizeof
(
title
),
"%-10s (%s,%s%d) [%s] %s %s"
,
...
...
@@ -311,6 +316,25 @@ static int ventoy_browser_valid_filename(const char *filename, int len, int *typ
return
1
;
}
static
int
ventoy_browser_check_ignore
(
const
char
*
device
,
const
char
*
root
,
const
char
*
dir
)
{
grub_file_t
file
;
char
fullpath
[
1024
]
=
{
0
};
grub_snprintf
(
fullpath
,
1023
,
"(%s)%s/%s/.ventoyignore"
,
device
,
root
,
dir
);
file
=
grub_file_open
(
fullpath
,
GRUB_FILE_TYPE_NONE
);
if
(
!
file
)
{
grub_errno
=
0
;
return
0
;
}
else
{
grub_file_close
(
file
);
return
1
;
}
}
static
int
ventoy_browser_iterate_dir
(
const
char
*
filename
,
const
struct
grub_dirhook_info
*
info
,
void
*
data
)
{
int
type
;
...
...
@@ -328,6 +352,11 @@ static int ventoy_browser_iterate_dir(const char *filename, const struct grub_di
return
0
;
}
if
(
ventoy_browser_check_ignore
(
g_menu_device
,
g_menu_path_buf
,
filename
))
{
return
0
;
}
node
=
grub_zalloc
(
sizeof
(
browser_node
));
if
(
!
node
)
{
...
...
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