- g_img_replace_list = &pGrubParam->img_replace;
- ventoy_proc_img_replace_name(g_img_replace_list);
- old_cnt = g_img_replace_list->old_file_cnt;
- debug("img replace: magic:0x%x virtid:%u name count:%u <%a> <%a> <%a> <%a>",
- g_img_replace_list->magic,
- g_img_replace_list->new_file_virtual_id,
- old_cnt,
- old_cnt > 0 ? g_img_replace_list->old_file_name[0] : "",
- old_cnt > 1 ? g_img_replace_list->old_file_name[1] : "",
- old_cnt > 2 ? g_img_replace_list->old_file_name[2] : "",
- old_cnt > 3 ? g_img_replace_list->old_file_name[3] : ""
- );
+
+ for (i = 0; i < VTOY_MAX_CONF_REPLACE; i++)
+ {
+ replace = pGrubParam->img_replace + i;
+ if (replace->magic == GRUB_IMG_REPLACE_MAGIC)
+ {
+ ventoy_proc_img_replace_name(replace);
+ old_cnt = replace->old_file_cnt;
+ debug("img replace[%d]: magic:0x%x virtid:%u name count:%u <%a> <%a> <%a> <%a>",
+ i, replace->magic,
+ replace->new_file_virtual_id,
+ old_cnt,
+ old_cnt > 0 ? replace->old_file_name[0] : "",
+ old_cnt > 1 ? replace->old_file_name[1] : "",
+ old_cnt > 2 ? replace->old_file_name[2] : "",
+ old_cnt > 3 ? replace->old_file_name[3] : ""
+ );
+ g_img_replace_list = pGrubParam->img_replace;
+ }
+ }
+