int c1 = 0;
int c2 = 0;
- if (g_plugin_image_list)
+ if (g_plugin_image_list == VENTOY_IMG_WHITE_LIST)
{
return (img1->plugin_list_index - img2->plugin_list_index);
}
int c1 = 0;
int c2 = 0;
- if (g_plugin_image_list)
+ if (g_plugin_image_list == VENTOY_IMG_WHITE_LIST)
{
return (node1->plugin_list_index - node2->plugin_list_index);
}
return 0;
}
- if (g_plugin_image_list)
+ if (g_plugin_image_list == VENTOY_IMG_WHITE_LIST)
{
grub_snprintf(g_img_swap_tmp_buf, sizeof(g_img_swap_tmp_buf), "%s%s/", node->dir, filename);
index = ventoy_plugin_get_image_list_index(vtoy_class_directory, g_img_swap_tmp_buf);
{
grub_snprintf(g_img_swap_tmp_buf, sizeof(g_img_swap_tmp_buf), "%s%s", node->dir, filename);
index = ventoy_plugin_get_image_list_index(vtoy_class_image_file, g_img_swap_tmp_buf);
- if (index == 0)
+ if (VENTOY_IMG_WHITE_LIST == g_plugin_image_list && index == 0)
{
debug("File %s not found in image_list plugin config...\n", g_img_swap_tmp_buf);
return 0;
}
+ else if (VENTOY_IMG_BLACK_LIST == g_plugin_image_list && index > 0)
+ {
+ debug("File %s found in image_blacklist plugin config...\n", g_img_swap_tmp_buf);
+ return 0;
+ }
}
img = grub_zalloc(sizeof(img_info));
extern int g_ventoy_case_insensitive;
extern grub_uint8_t g_ventoy_chain_type;
extern int g_vhdboot_enable;
+
+#define VENTOY_IMG_WHITE_LIST 1
+#define VENTOY_IMG_BLACK_LIST 2
extern int g_plugin_image_list;
+
extern ventoy_gpt_info *g_ventoy_part_info;
extern grub_uint64_t g_conf_replace_offset;
extern grub_uint64_t g_svd_replace_offset;
g_image_list_head = NULL;
}
- g_plugin_image_list = 1;
+ if (grub_strcmp(json->pcName, "image_blacklist") == 0)
+ {
+ g_plugin_image_list = VENTOY_IMG_BLACK_LIST;
+ }
+ else
+ {
+ g_plugin_image_list = VENTOY_IMG_WHITE_LIST;
+ }
for (pNode = json->pstChild; pNode; pNode = pNode->pstNext)
{
{ "injection", ventoy_plugin_injection_entry, ventoy_plugin_injection_check },
{ "auto_memdisk", ventoy_plugin_auto_memdisk_entry, ventoy_plugin_auto_memdisk_check },
{ "image_list", ventoy_plugin_image_list_entry, ventoy_plugin_image_list_check },
+ { "image_blacklist", ventoy_plugin_image_list_entry, ventoy_plugin_image_list_check },
{ "conf_replace", ventoy_plugin_conf_replace_entry, ventoy_plugin_conf_replace_check },
{ "dud", ventoy_plugin_dud_entry, ventoy_plugin_dud_check },
{ "password", ventoy_plugin_pwd_entry, ventoy_plugin_pwd_check },
unset pager
}
+ menuentry 'Check image blacklist plugin configuration' --class=debug_imageblacklist {
+ set pager=1
+ vt_check_plugin_json $vt_plugin_path image_blacklist $vtoy_iso_part
+
+ echo -e "\npress ENTER to exit ..."
+ read vtInputKey
+ unset pager
+ }
+
menuentry 'Check boot conf replace plugin configuration' --class=debug_bootconf_replace {
set pager=1
vt_check_plugin_json $vt_plugin_path conf_replace $vtoy_iso_part
read vtInputKey
fi
+for vtTFile in ventoy.json ventoy_grub.cfg; do
+ if [ -f $vtoy_efi_part/ventoy/$vtTFile ]; then
+ clear
+ echo -e "\n You need to put $vtTFile in the 1st partition which hold the ISO files.\n"
+ echo -e " $vtTFile 放错分区了,请放到镜像分区里的 ventoy 目录下(此目录需要手动创建)!\n"
+ echo -e "\n press ENTER to continue (请按 回车 键继续) ..."
+ read vtInputKey
+ fi
+done
+
+
#export necessary variable
export theme
export gfxmode