Fix a bug when booting TrueNAS Core 13.0. (#1684)

This commit is contained in:
longpanda 2022-06-20 15:29:27 +08:00
parent ecbf45defe
commit 1ee65a60c2

View File

@ -445,12 +445,16 @@ grub_err_t ventoy_cmd_parse_freenas_ver(grub_extcmd_context_t ctxt, int argc, ch
ver = vtoy_json_get_string_ex(json->pstChild, "Version");
if (ver)
{
debug("freenas version:<%s>\n", ver);
debug("NAS version:<%s>\n", ver);
if (grub_strncmp(ver, "TrueNAS-", 8) == 0)
{
ver += 8;
}
ventoy_set_env(args[1], ver);
}
else
{
debug("freenas version:<%s>\n", "NOT FOUND");
debug("NAS version:<%s>\n", "NOT FOUND");
grub_env_unset(args[1]);
}