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
b32cf97f
Commit
b32cf97f
authored
Jul 05, 2020
by
longpanda
Browse files
update
parent
f7b35f37
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
23 deletions
+42
-23
IMG/cpio/ventoy/hook/debian/udev_disk_hook.sh
IMG/cpio/ventoy/hook/debian/udev_disk_hook.sh
+12
-1
INSTALL/grub/grub.cfg
INSTALL/grub/grub.cfg
+6
-7
Ventoy2Disk/Ventoy2Disk/Utility.c
Ventoy2Disk/Ventoy2Disk/Utility.c
+9
-0
Ventoy2Disk/Ventoy2Disk/Ventoy2Disk.c
Ventoy2Disk/Ventoy2Disk/Ventoy2Disk.c
+15
-15
No files found.
IMG/cpio/ventoy/hook/debian/udev_disk_hook.sh
View file @
b32cf97f
...
...
@@ -99,7 +99,18 @@ ventoy_udev_disk_common_hook $*
# So if ventoy is installed on a non-USB device, we just mount /cdrom here except
# for these has boot=live or boot=casper parameter in cmdline
#
if
echo
$ID_BUS
|
$GREP
-q
-i
usb
;
then
VT_BUS_USB
=
""
if
[
-n
"
$ID_BUS
"
]
;
then
if
echo
$ID_BUS
|
$GREP
-q
-i
usb
;
then
VT_BUS_USB
=
"YES"
fi
else
if
$BUSYBOX_PATH
/ls
-l
/sys/class/block/
${
1
:0:-1
}
|
$GREP
-q
-i
usb
;
then
VT_BUS_USB
=
"YES"
fi
fi
if
[
-n
"
$VT_BUS_USB
"
]
;
then
vtlog
"
$1
is USB device"
else
vtlog
"
$1
is NOT USB device (bus
$ID_BUS
)"
...
...
INSTALL/grub/grub.cfg
View file @
b32cf97f
...
...
@@ -650,15 +650,14 @@ else
set gfxmode=1920x1080,1366x768,1024x768
fi
if [ -n "$vtoy_theme" ]; then
set theme=$vtoy_theme
else
set theme=$prefix/themes/ventoy/theme.txt
fi
if [ "$vtoy_display_mode" = "CLI" ]; then
terminal_output console
else
else
if [ -n "$vtoy_theme" ]; then
set theme=$vtoy_theme
else
set theme=$prefix/themes/ventoy/theme.txt
fi
terminal_output gfxterm
fi
...
...
Ventoy2Disk/Ventoy2Disk/Utility.c
View file @
b32cf97f
...
...
@@ -549,6 +549,7 @@ int VentoyFillGpt(UINT64 DiskSizeBytes, VTOY_GPT_INFO *pInfo)
VTOY_GPT_PART_TBL
*
Table
=
pInfo
->
PartTbl
;
static
GUID
WindowsDataPartType
=
{
0xebd0a0a2
,
0xb9e5
,
0x4433
,
{
0x87
,
0xc0
,
0x68
,
0xb6
,
0xb7
,
0x26
,
0x99
,
0xc7
}
};
static
GUID
EspPartType
=
{
0xc12a7328
,
0xf81f
,
0x11d2
,
{
0xba
,
0x4b
,
0x00
,
0xa0
,
0xc9
,
0x3e
,
0xc9
,
0x3b
}
};
//static GUID BiosGrubPartType = { 0x21686148, 0x6449, 0x6e6f, { 0x74, 0x4e, 0x65, 0x65, 0x64, 0x45, 0x46, 0x49 } };
VentoyFillProtectMBR
(
DiskSizeBytes
,
&
pInfo
->
MBR
);
...
...
@@ -588,6 +589,14 @@ int VentoyFillGpt(UINT64 DiskSizeBytes, VTOY_GPT_INFO *pInfo)
Table
[
1
].
Attr
=
1
;
memcpy
(
Table
[
1
].
Name
,
L"VTOYEFI"
,
7
*
2
);
#if 0
memcpy(&(Table[2].PartType), &BiosGrubPartType, sizeof(GUID));
CoCreateGuid(&(Table[2].PartGuid));
Table[2].StartLBA = 34;
Table[2].LastLBA = 2047;
Table[2].Attr = 0;
#endif
//Update CRC
Head
->
PartTblCrc
=
VentoyCrc32
(
Table
,
sizeof
(
pInfo
->
PartTbl
));
Head
->
Crc
=
VentoyCrc32
(
Head
,
Head
->
Length
);
...
...
Ventoy2Disk/Ventoy2Disk/Ventoy2Disk.c
View file @
b32cf97f
...
...
@@ -107,6 +107,21 @@ static BOOL IsVentoyPhyDrive(int PhyDrive, UINT64 SizeBytes, MBR_HEAD *pMBR, UIN
return
FALSE
;
}
for
(
i
=
0
;
i
<
4
;
i
++
)
{
Log
(
"=========== Partition Table %d ============"
,
i
+
1
);
Log
(
"PartTbl.Active = 0x%x"
,
MBR
.
PartTbl
[
i
].
Active
);
Log
(
"PartTbl.FsFlag = 0x%x"
,
MBR
.
PartTbl
[
i
].
FsFlag
);
Log
(
"PartTbl.StartSectorId = %u"
,
MBR
.
PartTbl
[
i
].
StartSectorId
);
Log
(
"PartTbl.SectorCount = %u"
,
MBR
.
PartTbl
[
i
].
SectorCount
);
Log
(
"PartTbl.StartHead = %u"
,
MBR
.
PartTbl
[
i
].
StartHead
);
Log
(
"PartTbl.StartSector = %u"
,
MBR
.
PartTbl
[
i
].
StartSector
);
Log
(
"PartTbl.StartCylinder = %u"
,
MBR
.
PartTbl
[
i
].
StartCylinder
);
Log
(
"PartTbl.EndHead = %u"
,
MBR
.
PartTbl
[
i
].
EndHead
);
Log
(
"PartTbl.EndSector = %u"
,
MBR
.
PartTbl
[
i
].
EndSector
);
Log
(
"PartTbl.EndCylinder = %u"
,
MBR
.
PartTbl
[
i
].
EndCylinder
);
}
if
(
MBR
.
PartTbl
[
0
].
FsFlag
==
0xEE
)
{
pGpt
=
malloc
(
sizeof
(
VTOY_GPT_INFO
));
...
...
@@ -143,21 +158,6 @@ static BOOL IsVentoyPhyDrive(int PhyDrive, UINT64 SizeBytes, MBR_HEAD *pMBR, UIN
{
CHECK_CLOSE_HANDLE
(
hDrive
);
for
(
i
=
0
;
i
<
4
;
i
++
)
{
Log
(
"=========== Partition Table %d ============"
,
i
+
1
);
Log
(
"PartTbl.Active = 0x%x"
,
MBR
.
PartTbl
[
i
].
Active
);
Log
(
"PartTbl.FsFlag = 0x%x"
,
MBR
.
PartTbl
[
i
].
FsFlag
);
Log
(
"PartTbl.StartSectorId = %u"
,
MBR
.
PartTbl
[
i
].
StartSectorId
);
Log
(
"PartTbl.SectorCount = %u"
,
MBR
.
PartTbl
[
i
].
SectorCount
);
Log
(
"PartTbl.StartHead = %u"
,
MBR
.
PartTbl
[
i
].
StartHead
);
Log
(
"PartTbl.StartSector = %u"
,
MBR
.
PartTbl
[
i
].
StartSector
);
Log
(
"PartTbl.StartCylinder = %u"
,
MBR
.
PartTbl
[
i
].
StartCylinder
);
Log
(
"PartTbl.EndHead = %u"
,
MBR
.
PartTbl
[
i
].
EndHead
);
Log
(
"PartTbl.EndSector = %u"
,
MBR
.
PartTbl
[
i
].
EndSector
);
Log
(
"PartTbl.EndCylinder = %u"
,
MBR
.
PartTbl
[
i
].
EndCylinder
);
}
if
(
MBR
.
PartTbl
[
0
].
StartSectorId
!=
2048
)
{
Log
(
"Part1 not match %u"
,
MBR
.
PartTbl
[
0
].
StartSectorId
);
...
...
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