diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_cmd.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_cmd.c index 4cad3ca2..1911d916 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_cmd.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_cmd.c @@ -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 }, diff --git a/INSTALL/grub/grub.cfg b/INSTALL/grub/grub.cfg index 04392163..d66ccafa 100644 --- a/INSTALL/grub/grub.cfg +++ b/INSTALL/grub/grub.cfg @@ -1457,7 +1457,10 @@ function ventoy_iso_busybox_ver { set ventoy_busybox_ver=64 elif vt_strstr "$vt_volume_id" "x86_64"; then 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 }