Fix the latest Kicksecure boot issue. (#3651)

This commit is contained in:
longpanda
2026-06-25 19:16:48 +08:00
parent d51e76daa9
commit 31648a0d4b
2 changed files with 35 additions and 1 deletions

View File

@@ -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;
}
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)
{
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_mod", ventoy_cmd_mod, 0, NULL, "{Int} {Int} {Var}", "mod integer variable", 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_casebegin", ventoy_cmd_strcasebegin, 0, NULL, "", "", NULL },
{ "vt_debug", ventoy_cmd_debug, 0, NULL, "{on|off}", "turn debug on/off", NULL },