Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
dadigang
Ventoy
Commits
0aff8f51
Commit
0aff8f51
authored
Apr 14, 2021
by
longpanda
Browse files
update vtoytool
parent
2750f0c5
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
36 additions
and
32 deletions
+36
-32
VtoyTool/vtoydump.c
VtoyTool/vtoydump.c
+36
-32
VtoyTool/vtoytool/00/vtoytool_32
VtoyTool/vtoytool/00/vtoytool_32
+0
-0
VtoyTool/vtoytool/00/vtoytool_64
VtoyTool/vtoytool/00/vtoytool_64
+0
-0
VtoyTool/vtoytool/00/vtoytool_aa64
VtoyTool/vtoytool/00/vtoytool_aa64
+0
-0
VtoyTool/vtoytool/00/vtoytool_m64e
VtoyTool/vtoytool/00/vtoytool_m64e
+0
-0
No files found.
VtoyTool/vtoydump.c
View file @
0aff8f51
...
...
@@ -435,6 +435,33 @@ static int vtoy_printf_iso_path(ventoy_os_param *param)
return
0
;
}
static
int
vtoy_check_device
(
ventoy_os_param
*
param
,
const
char
*
device
)
{
unsigned
long
long
size
;
uint8_t
vtguid
[
16
]
=
{
0
};
uint8_t
vtsig
[
4
]
=
{
0
};
debug
(
"vtoy_check_device for <%s>
\n
"
,
device
);
size
=
vtoy_get_disk_size_in_byte
(
device
);
vtoy_get_disk_guid
(
device
,
vtguid
,
vtsig
);
debug
(
"param->vtoy_disk_size=%llu size=%llu
\n
"
,
(
unsigned
long
long
)
param
->
vtoy_disk_size
,
(
unsigned
long
long
)
size
);
if
(
memcmp
(
vtguid
,
param
->
vtoy_disk_guid
,
16
)
==
0
&&
memcmp
(
vtsig
,
param
->
vtoy_disk_signature
,
4
)
==
0
)
{
debug
(
"<%s> is right ventoy disk
\n
"
,
device
);
return
0
;
}
else
{
debug
(
"<%s> is NOT right ventoy disk
\n
"
,
device
);
return
1
;
}
}
static
int
vtoy_print_os_param
(
ventoy_os_param
*
param
,
char
*
diskname
)
{
int
cnt
=
0
;
...
...
@@ -442,16 +469,20 @@ static int vtoy_print_os_param(ventoy_os_param *param, char *diskname)
const
char
*
fs
;
cnt
=
vtoy_find_disk_by_size
(
param
->
vtoy_disk_size
,
diskname
);
if
(
cnt
>
1
)
debug
(
"find disk by size %llu, cnt=%d...
\n
"
,
(
unsigned
long
long
)
param
->
vtoy_disk_size
,
cnt
);
if
(
1
==
cnt
)
{
cnt
=
vtoy_find_disk_by_guid
(
param
,
diskname
);
if
(
vtoy_check_device
(
param
,
diskname
)
!=
0
)
{
cnt
=
0
;
}
}
else
if
(
cnt
==
0
)
else
{
cnt
=
vtoy_find_disk_by_guid
(
param
,
diskname
);
debug
(
"find
0
disk by
size, try with
guid cnt=%d...
\n
"
,
cnt
);
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
];
...
...
@@ -472,33 +503,6 @@ static int vtoy_print_os_param(ventoy_os_param *param, char *diskname)
}
}
static
int
vtoy_check_device
(
ventoy_os_param
*
param
,
const
char
*
device
)
{
unsigned
long
long
size
;
uint8_t
vtguid
[
16
]
=
{
0
};
uint8_t
vtsig
[
4
]
=
{
0
};
debug
(
"vtoy_check_device for <%s>
\n
"
,
device
);
size
=
vtoy_get_disk_size_in_byte
(
device
);
vtoy_get_disk_guid
(
device
,
vtguid
,
vtsig
);
debug
(
"param->vtoy_disk_size=%llu size=%llu
\n
"
,
(
unsigned
long
long
)
param
->
vtoy_disk_size
,
(
unsigned
long
long
)
size
);
if
(
memcmp
(
vtguid
,
param
->
vtoy_disk_guid
,
16
)
==
0
&&
memcmp
(
vtsig
,
param
->
vtoy_disk_signature
,
4
)
==
0
)
{
debug
(
"<%s> is right ventoy disk
\n
"
,
device
);
return
0
;
}
else
{
debug
(
"<%s> is NOT right ventoy disk
\n
"
,
device
);
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.
...
...
VtoyTool/vtoytool/00/vtoytool_32
View file @
0aff8f51
No preview for this file type
VtoyTool/vtoytool/00/vtoytool_64
View file @
0aff8f51
No preview for this file type
VtoyTool/vtoytool/00/vtoytool_aa64
View file @
0aff8f51
No preview for this file type
VtoyTool/vtoytool/00/vtoytool_m64e
View file @
0aff8f51
No preview for this file type
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment