|
|
@ -435,6 +435,24 @@ static int vtoy_printf_iso_path(ventoy_os_param *param)
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static int vtoy_printf_fs(ventoy_os_param *param)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
const char *fs[] =
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
"exfat", "ntfs", "ext", "xfs", "udf", "fat"
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (param->vtoy_disk_part_type < 6)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
printf("%s\n", fs[param->vtoy_disk_part_type]);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
printf("unknown\n");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static int vtoy_check_device(ventoy_os_param *param, const char *device)
|
|
|
|
static int vtoy_check_device(ventoy_os_param *param, const char *device)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
unsigned long long size;
|
|
|
|
unsigned long long size;
|
|
|
@ -551,12 +569,13 @@ int vtoydump_main(int argc, char **argv)
|
|
|
|
int rc;
|
|
|
|
int rc;
|
|
|
|
int ch;
|
|
|
|
int ch;
|
|
|
|
int print_path = 0;
|
|
|
|
int print_path = 0;
|
|
|
|
|
|
|
|
int print_fs = 0;
|
|
|
|
char filename[256] = {0};
|
|
|
|
char filename[256] = {0};
|
|
|
|
char diskname[256] = {0};
|
|
|
|
char diskname[256] = {0};
|
|
|
|
char device[64] = {0};
|
|
|
|
char device[64] = {0};
|
|
|
|
ventoy_os_param *param = NULL;
|
|
|
|
ventoy_os_param *param = NULL;
|
|
|
|
|
|
|
|
|
|
|
|
while ((ch = getopt(argc, argv, "c:f:p:v::")) != -1)
|
|
|
|
while ((ch = getopt(argc, argv, "c:f:p:s:v::")) != -1)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (ch == 'f')
|
|
|
|
if (ch == 'f')
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -575,6 +594,11 @@ int vtoydump_main(int argc, char **argv)
|
|
|
|
print_path = 1;
|
|
|
|
print_path = 1;
|
|
|
|
strncpy(filename, optarg, sizeof(filename) - 1);
|
|
|
|
strncpy(filename, optarg, sizeof(filename) - 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (ch == 's')
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
print_fs = 1;
|
|
|
|
|
|
|
|
strncpy(filename, optarg, sizeof(filename) - 1);
|
|
|
|
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
fprintf(stderr, "Usage: %s -f datafile [ -v ] \n", argv[0]);
|
|
|
|
fprintf(stderr, "Usage: %s -f datafile [ -v ] \n", argv[0]);
|
|
|
@ -627,6 +651,10 @@ int vtoydump_main(int argc, char **argv)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
rc = vtoy_printf_iso_path(param);
|
|
|
|
rc = vtoy_printf_iso_path(param);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (print_fs)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
rc = vtoy_printf_fs(param);
|
|
|
|
|
|
|
|
}
|
|
|
|
else if (device[0])
|
|
|
|
else if (device[0])
|
|
|
|
{
|
|
|
|
{
|
|
|
|
rc = vtoy_check_device(param, device);
|
|
|
|
rc = vtoy_check_device(param, device);
|
|
|
|