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
09162e8d
Commit
09162e8d
authored
Oct 27, 2021
by
longpanda
Browse files
Improvement for multi-mode option.
Now you can use for example theme_uefi and theme at the same time.
parent
eb8fcc8f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
20 deletions
+31
-20
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
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_plugin.c
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_plugin.c
+30
-20
No files found.
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_def.h
View file @
09162e8d
...
@@ -550,6 +550,7 @@ typedef struct plugin_entry
...
@@ -550,6 +550,7 @@ typedef struct plugin_entry
const
char
*
key
;
const
char
*
key
;
ventoy_plugin_entry_pf
entryfunc
;
ventoy_plugin_entry_pf
entryfunc
;
ventoy_plugin_check_pf
checkfunc
;
ventoy_plugin_check_pf
checkfunc
;
int
flag
;
}
plugin_entry
;
}
plugin_entry
;
typedef
struct
replace_fs_dir
typedef
struct
replace_fs_dir
...
...
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_plugin.c
View file @
09162e8d
...
@@ -2338,45 +2338,55 @@ static int ventoy_plugin_image_list_check(VTOY_JSON *json, const char *isodisk)
...
@@ -2338,45 +2338,55 @@ static int ventoy_plugin_image_list_check(VTOY_JSON *json, const char *isodisk)
static
plugin_entry
g_plugin_entries
[]
=
static
plugin_entry
g_plugin_entries
[]
=
{
{
{
"control"
,
ventoy_plugin_control_entry
,
ventoy_plugin_control_check
},
{
"control"
,
ventoy_plugin_control_entry
,
ventoy_plugin_control_check
,
0
},
{
"theme"
,
ventoy_plugin_theme_entry
,
ventoy_plugin_theme_check
},
{
"theme"
,
ventoy_plugin_theme_entry
,
ventoy_plugin_theme_check
,
0
},
{
"auto_install"
,
ventoy_plugin_auto_install_entry
,
ventoy_plugin_auto_install_check
},
{
"auto_install"
,
ventoy_plugin_auto_install_entry
,
ventoy_plugin_auto_install_check
,
0
},
{
"persistence"
,
ventoy_plugin_persistence_entry
,
ventoy_plugin_persistence_check
},
{
"persistence"
,
ventoy_plugin_persistence_entry
,
ventoy_plugin_persistence_check
,
0
},
{
"menu_alias"
,
ventoy_plugin_menualias_entry
,
ventoy_plugin_menualias_check
},
{
"menu_alias"
,
ventoy_plugin_menualias_entry
,
ventoy_plugin_menualias_check
,
0
},
{
"menu_tip"
,
ventoy_plugin_menutip_entry
,
ventoy_plugin_menutip_check
},
{
"menu_tip"
,
ventoy_plugin_menutip_entry
,
ventoy_plugin_menutip_check
,
0
},
{
"menu_class"
,
ventoy_plugin_menuclass_entry
,
ventoy_plugin_menuclass_check
},
{
"menu_class"
,
ventoy_plugin_menuclass_entry
,
ventoy_plugin_menuclass_check
,
0
},
{
"injection"
,
ventoy_plugin_injection_entry
,
ventoy_plugin_injection_check
},
{
"injection"
,
ventoy_plugin_injection_entry
,
ventoy_plugin_injection_check
,
0
},
{
"auto_memdisk"
,
ventoy_plugin_auto_memdisk_entry
,
ventoy_plugin_auto_memdisk_check
},
{
"auto_memdisk"
,
ventoy_plugin_auto_memdisk_entry
,
ventoy_plugin_auto_memdisk_check
,
0
},
{
"image_list"
,
ventoy_plugin_image_list_entry
,
ventoy_plugin_image_list_check
},
{
"image_list"
,
ventoy_plugin_image_list_entry
,
ventoy_plugin_image_list_check
,
0
},
{
"image_blacklist"
,
ventoy_plugin_image_list_entry
,
ventoy_plugin_image_list_check
},
{
"image_blacklist"
,
ventoy_plugin_image_list_entry
,
ventoy_plugin_image_list_check
,
0
},
{
"conf_replace"
,
ventoy_plugin_conf_replace_entry
,
ventoy_plugin_conf_replace_check
},
{
"conf_replace"
,
ventoy_plugin_conf_replace_entry
,
ventoy_plugin_conf_replace_check
,
0
},
{
"dud"
,
ventoy_plugin_dud_entry
,
ventoy_plugin_dud_check
},
{
"dud"
,
ventoy_plugin_dud_entry
,
ventoy_plugin_dud_check
,
0
},
{
"password"
,
ventoy_plugin_pwd_entry
,
ventoy_plugin_pwd_check
},
{
"password"
,
ventoy_plugin_pwd_entry
,
ventoy_plugin_pwd_check
,
0
},
{
"custom_boot"
,
ventoy_plugin_custom_boot_entry
,
ventoy_plugin_custom_boot_check
},
{
"custom_boot"
,
ventoy_plugin_custom_boot_entry
,
ventoy_plugin_custom_boot_check
,
0
},
};
};
static
int
ventoy_parse_plugin_config
(
VTOY_JSON
*
json
,
const
char
*
isodisk
)
static
int
ventoy_parse_plugin_config
(
VTOY_JSON
*
json
,
const
char
*
isodisk
)
{
{
int
i
;
int
i
;
char
key
[
128
];
char
key
[
128
];
VTOY_JSON
*
cur
=
json
;
VTOY_JSON
*
cur
=
NULL
;
grub_snprintf
(
g_iso_disk_name
,
sizeof
(
g_iso_disk_name
),
"%s"
,
isodisk
);
grub_snprintf
(
g_iso_disk_name
,
sizeof
(
g_iso_disk_name
),
"%s"
,
isodisk
);
while
(
cur
)
for
(
cur
=
json
;
cur
;
cur
=
cur
->
pstNext
)
{
{
for
(
i
=
0
;
i
<
(
int
)
ARRAY_SIZE
(
g_plugin_entries
);
i
++
)
for
(
i
=
0
;
i
<
(
int
)
ARRAY_SIZE
(
g_plugin_entries
);
i
++
)
{
{
grub_snprintf
(
key
,
sizeof
(
key
),
"%s_%s"
,
g_plugin_entries
[
i
].
key
,
g_arch_mode_suffix
);
grub_snprintf
(
key
,
sizeof
(
key
),
"%s_%s"
,
g_plugin_entries
[
i
].
key
,
g_arch_mode_suffix
);
if
(
grub_strcmp
(
g_plugin_entries
[
i
].
key
,
cur
->
pcName
)
==
0
||
grub_strcmp
(
key
,
cur
->
pcName
)
==
0
)
if
(
g_plugin_entries
[
i
].
flag
==
0
&&
grub_strcmp
(
key
,
cur
->
pcName
)
==
0
)
{
{
debug
(
"Plugin entry for %s
\n
"
,
g_plugin_entries
[
i
].
key
);
debug
(
"Plugin entry for %s
\n
"
,
g_plugin_entries
[
i
].
key
);
g_plugin_entries
[
i
].
entryfunc
(
cur
,
isodisk
);
g_plugin_entries
[
i
].
entryfunc
(
cur
,
isodisk
);
g_plugin_entries
[
i
].
flag
=
1
;
break
;
}
}
for
(
i
=
0
;
i
<
(
int
)
ARRAY_SIZE
(
g_plugin_entries
);
i
++
)
{
if
(
g_plugin_entries
[
i
].
flag
==
0
&&
grub_strcmp
(
g_plugin_entries
[
i
].
key
,
cur
->
pcName
)
==
0
)
{
debug
(
"Plugin entry for %s
\n
"
,
g_plugin_entries
[
i
].
key
);
g_plugin_entries
[
i
].
entryfunc
(
cur
,
isodisk
);
g_plugin_entries
[
i
].
flag
=
1
;
break
;
break
;
}
}
}
}
cur
=
cur
->
pstNext
;
}
}
return
0
;
return
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