+static int ventoy_plugin_image_list_entry(VTOY_JSON *json, const char *isodisk)
+{
+ VTOY_JSON *pNode = NULL;
+ image_list *node = NULL;
+ image_list *next = NULL;
+
+ (void)isodisk;
+
+ if (json->enDataType != JSON_TYPE_ARRAY)
+ {
+ debug("Not array %d\n", json->enDataType);
+ return 0;
+ }
+
+ if (g_image_list_head)
+ {
+ for (node = g_image_list_head; node; node = next)
+ {
+ next = node->next;
+ grub_free(node);
+ }
+
+ g_image_list_head = NULL;
+ }
+
+ g_plugin_image_list = 1;
+
+ for (pNode = json->pstChild; pNode; pNode = pNode->pstNext)
+ {
+ if (pNode->enDataType == JSON_TYPE_STRING)
+ {
+ node = grub_zalloc(sizeof(image_list));
+ if (node)
+ {
+ node->pathlen = grub_snprintf(node->isopath, sizeof(node->isopath), "%s", pNode->unData.pcStrVal);
+
+ if (g_image_list_head)
+ {
+ node->next = g_image_list_head;
+ }
+
+ g_image_list_head = node;
+ }
+ }
+ }
+
+ return 0;
+}
+
+static int ventoy_plugin_image_list_check(VTOY_JSON *json, const char *isodisk)
+{
+ VTOY_JSON *pNode = NULL;
+
+ if (json->enDataType != JSON_TYPE_ARRAY)
+ {
+ grub_printf("Not array %d\n", json->enDataType);
+ return 1;
+ }
+
+ for (pNode = json->pstChild; pNode; pNode = pNode->pstNext)
+ {
+ if (pNode->enDataType == JSON_TYPE_STRING)
+ {
+ grub_printf("<%s> ", pNode->unData.pcStrVal);
+
+ if (ventoy_check_file_exist("%s%s", isodisk, pNode->unData.pcStrVal))
+ {
+ grub_printf(" [OK]\n");
+ }
+ else
+ {
+ grub_printf(" [NOT EXIST]\n");
+ }
+ }
+ }
+
+ return 0;
+}
+