mirror of
https://github.com/ventoy/Ventoy.git
synced 2026-06-29 06:28:13 +00:00
Fix the latest Kicksecure boot issue. (#3651)
This commit is contained in:
@@ -896,6 +896,36 @@ static grub_err_t ventoy_cmd_strstr(grub_extcmd_context_t ctxt, int argc, char *
|
|||||||
return (grub_strstr(args[0], args[1])) ? 0 : 1;
|
return (grub_strstr(args[0], args[1])) ? 0 : 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static grub_err_t ventoy_cmd_istrstr(grub_extcmd_context_t ctxt, int argc, char **args)
|
||||||
|
{
|
||||||
|
grub_err_t ret = 1;
|
||||||
|
char *s1 = NULL;
|
||||||
|
char *s2 = NULL;
|
||||||
|
|
||||||
|
(void)ctxt;
|
||||||
|
|
||||||
|
if (argc != 2)
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
s1 = grub_strdup(args[0]);
|
||||||
|
s2 = grub_strdup(args[1]);
|
||||||
|
if (s1 == NULL || s2 == NULL)
|
||||||
|
{
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
|
ventoy_str_toupper(s1);
|
||||||
|
ventoy_str_toupper(s2);
|
||||||
|
ret = (grub_strstr(s1, s2)) ? 0 : 1;
|
||||||
|
|
||||||
|
end:
|
||||||
|
grub_check_free(s1);
|
||||||
|
grub_check_free(s2);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
static grub_err_t ventoy_cmd_strbegin(grub_extcmd_context_t ctxt, int argc, char **args)
|
static grub_err_t ventoy_cmd_strbegin(grub_extcmd_context_t ctxt, int argc, char **args)
|
||||||
{
|
{
|
||||||
char *c0, *c1;
|
char *c0, *c1;
|
||||||
@@ -6944,6 +6974,7 @@ static cmd_para ventoy_cmds[] =
|
|||||||
{ "vt_incr", ventoy_cmd_incr, 0, NULL, "{Var} {INT}", "Increase integer variable", NULL },
|
{ "vt_incr", ventoy_cmd_incr, 0, NULL, "{Var} {INT}", "Increase integer variable", NULL },
|
||||||
{ "vt_mod", ventoy_cmd_mod, 0, NULL, "{Int} {Int} {Var}", "mod integer variable", NULL },
|
{ "vt_mod", ventoy_cmd_mod, 0, NULL, "{Int} {Int} {Var}", "mod integer variable", NULL },
|
||||||
{ "vt_strstr", ventoy_cmd_strstr, 0, NULL, "", "", NULL },
|
{ "vt_strstr", ventoy_cmd_strstr, 0, NULL, "", "", NULL },
|
||||||
|
{ "vt_istrstr", ventoy_cmd_istrstr, 0, NULL, "", "", NULL },
|
||||||
{ "vt_str_begin", ventoy_cmd_strbegin, 0, NULL, "", "", NULL },
|
{ "vt_str_begin", ventoy_cmd_strbegin, 0, NULL, "", "", NULL },
|
||||||
{ "vt_str_casebegin", ventoy_cmd_strcasebegin, 0, NULL, "", "", NULL },
|
{ "vt_str_casebegin", ventoy_cmd_strcasebegin, 0, NULL, "", "", NULL },
|
||||||
{ "vt_debug", ventoy_cmd_debug, 0, NULL, "{on|off}", "turn debug on/off", NULL },
|
{ "vt_debug", ventoy_cmd_debug, 0, NULL, "{on|off}", "turn debug on/off", NULL },
|
||||||
|
|||||||
@@ -1457,7 +1457,10 @@ function ventoy_iso_busybox_ver {
|
|||||||
set ventoy_busybox_ver=64
|
set ventoy_busybox_ver=64
|
||||||
elif vt_strstr "$vt_volume_id" "x86_64"; then
|
elif vt_strstr "$vt_volume_id" "x86_64"; then
|
||||||
set ventoy_busybox_ver=64
|
set ventoy_busybox_ver=64
|
||||||
|
elif vt_istrstr "${vt_chosen_path}" "x86_64"; then
|
||||||
|
set ventoy_busybox_ver=64
|
||||||
|
elif vt_istrstr "${vt_chosen_path}" "amd64"; then
|
||||||
|
set ventoy_busybox_ver=64
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user