diff --git a/VtoyTool/vtoydump.c b/VtoyTool/vtoydump.c index d33151a4..34c1ee7e 100644 --- a/VtoyTool/vtoydump.c +++ b/VtoyTool/vtoydump.c @@ -435,43 +435,6 @@ static int vtoy_printf_iso_path(ventoy_os_param *param) return 0; } -static int vtoy_print_os_param(ventoy_os_param *param, char *diskname) -{ - int cnt = 0; - char *path = param->vtoy_img_path; - const char *fs; - - cnt = vtoy_find_disk_by_size(param->vtoy_disk_size, diskname); - if (cnt > 1) - { - cnt = vtoy_find_disk_by_guid(param, diskname); - } - else if (cnt == 0) - { - cnt = vtoy_find_disk_by_guid(param, diskname); - debug("find 0 disk by size, try with guid cnt=%d...\n", cnt); - } - - if (param->vtoy_disk_part_type < ventoy_fs_max) - { - fs = g_ventoy_fs[param->vtoy_disk_part_type]; - } - else - { - fs = "unknown"; - } - - if (1 == cnt) - { - printf("/dev/%s#%s#%s\n", diskname, fs, path); - return 0; - } - else - { - return 1; - } -} - static int vtoy_check_device(ventoy_os_param *param, const char *device) { unsigned long long size; @@ -499,6 +462,47 @@ static int vtoy_check_device(ventoy_os_param *param, const char *device) } } +static int vtoy_print_os_param(ventoy_os_param *param, char *diskname) +{ + int cnt = 0; + char *path = param->vtoy_img_path; + const char *fs; + + cnt = vtoy_find_disk_by_size(param->vtoy_disk_size, diskname); + debug("find disk by size %llu, cnt=%d...\n", (unsigned long long)param->vtoy_disk_size, cnt); + if (1 == cnt) + { + if (vtoy_check_device(param, diskname) != 0) + { + cnt = 0; + } + } + else + { + cnt = vtoy_find_disk_by_guid(param, diskname); + debug("find disk by guid cnt=%d...\n", cnt); + } + + if (param->vtoy_disk_part_type < ventoy_fs_max) + { + fs = g_ventoy_fs[param->vtoy_disk_part_type]; + } + else + { + fs = "unknown"; + } + + if (1 == cnt) + { + printf("/dev/%s#%s#%s\n", diskname, fs, path); + return 0; + } + else + { + return 1; + } +} + /* * Find disk and image path from ventoy runtime data. * By default data is read from phymem(legacy bios) or efivar(UEFI), if -f is input, data is read from file. diff --git a/VtoyTool/vtoytool/00/vtoytool_32 b/VtoyTool/vtoytool/00/vtoytool_32 index a9e11f86..6cda86be 100644 Binary files a/VtoyTool/vtoytool/00/vtoytool_32 and b/VtoyTool/vtoytool/00/vtoytool_32 differ diff --git a/VtoyTool/vtoytool/00/vtoytool_64 b/VtoyTool/vtoytool/00/vtoytool_64 index 52a4e561..1acd940f 100644 Binary files a/VtoyTool/vtoytool/00/vtoytool_64 and b/VtoyTool/vtoytool/00/vtoytool_64 differ diff --git a/VtoyTool/vtoytool/00/vtoytool_aa64 b/VtoyTool/vtoytool/00/vtoytool_aa64 index c342a796..9a429bc5 100644 Binary files a/VtoyTool/vtoytool/00/vtoytool_aa64 and b/VtoyTool/vtoytool/00/vtoytool_aa64 differ diff --git a/VtoyTool/vtoytool/00/vtoytool_m64e b/VtoyTool/vtoytool/00/vtoytool_m64e index 35098d76..3fd69195 100644 Binary files a/VtoyTool/vtoytool/00/vtoytool_m64e and b/VtoyTool/vtoytool/00/vtoytool_m64e differ