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
620bcad3
Commit
620bcad3
authored
Jan 26, 2021
by
longpanda
Browse files
update for vdiskchain
parent
bae671bd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
57 additions
and
1 deletion
+57
-1
EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/VDiskChain/VDiskChain.c
...le201911/MdeModulePkg/Application/VDiskChain/VDiskChain.c
+57
-1
No files found.
EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/VDiskChain/VDiskChain.c
View file @
620bcad3
...
@@ -72,6 +72,9 @@ CONST CHAR16 *gEfiBootFileName[] =
...
@@ -72,6 +72,9 @@ CONST CHAR16 *gEfiBootFileName[] =
UINT8
*
g_disk_buf_addr
=
NULL
;
UINT8
*
g_disk_buf_addr
=
NULL
;
UINT64
g_disk_buf_size
=
0
;
UINT64
g_disk_buf_size
=
0
;
STATIC
EFI_GET_VARIABLE
g_org_get_variable
=
NULL
;
STATIC
EFI_EXIT_BOOT_SERVICES
g_org_exit_boot_service
=
NULL
;
VOID
EFIAPI
VDiskDebug
(
IN
CONST
CHAR8
*
Format
,
...)
VOID
EFIAPI
VDiskDebug
(
IN
CONST
CHAR8
*
Format
,
...)
{
{
VA_LIST
Marker
;
VA_LIST
Marker
;
...
@@ -217,6 +220,54 @@ STATIC EFI_STATUS vdisk_patch_vdisk_path(CHAR16 *pos)
...
@@ -217,6 +220,54 @@ STATIC EFI_STATUS vdisk_patch_vdisk_path(CHAR16 *pos)
return
0
;
return
0
;
}
}
EFI_STATUS
EFIAPI
vdisk_get_variable_wrapper
(
IN
CHAR16
*
VariableName
,
IN
EFI_GUID
*
VendorGuid
,
OUT
UINT32
*
Attributes
,
OPTIONAL
IN
OUT
UINTN
*
DataSize
,
OUT
VOID
*
Data
OPTIONAL
)
{
EFI_STATUS
Status
=
EFI_SUCCESS
;
Status
=
g_org_get_variable
(
VariableName
,
VendorGuid
,
Attributes
,
DataSize
,
Data
);
if
(
StrCmp
(
VariableName
,
L"SecureBoot"
)
==
0
)
{
if
((
*
DataSize
==
1
)
&&
Data
)
{
*
(
UINT8
*
)
Data
=
0
;
}
}
return
Status
;
}
EFI_STATUS
EFIAPI
vdisk_exit_boot_service_wrapper
(
IN
EFI_HANDLE
ImageHandle
,
IN
UINTN
MapKey
)
{
return
g_org_exit_boot_service
(
ImageHandle
,
MapKey
);
}
STATIC
EFI_STATUS
EFIAPI
vdisk_disable_secure_boot
(
IN
EFI_HANDLE
ImageHandle
)
{
/* step1: wrapper security protocol. */
/* Do we still need it since we have been loaded ? */
/* step2: fake SecureBoot variable */
g_org_exit_boot_service
=
gBS
->
ExitBootServices
;
gBS
->
ExitBootServices
=
vdisk_exit_boot_service_wrapper
;
g_org_get_variable
=
gRT
->
GetVariable
;
gRT
->
GetVariable
=
vdisk_get_variable_wrapper
;
return
EFI_SUCCESS
;
}
STATIC
EFI_STATUS
EFIAPI
vdisk_parse_cmdline
(
IN
EFI_HANDLE
ImageHandle
)
STATIC
EFI_STATUS
EFIAPI
vdisk_parse_cmdline
(
IN
EFI_HANDLE
ImageHandle
)
{
{
CHAR16
*
Pos
=
NULL
;
CHAR16
*
Pos
=
NULL
;
...
@@ -254,6 +305,11 @@ STATIC EFI_STATUS EFIAPI vdisk_parse_cmdline(IN EFI_HANDLE ImageHandle)
...
@@ -254,6 +305,11 @@ STATIC EFI_STATUS EFIAPI vdisk_parse_cmdline(IN EFI_HANDLE ImageHandle)
vdisk_patch_vdisk_path
(
Pos
+
6
);
vdisk_patch_vdisk_path
(
Pos
+
6
);
if
(
StrStr
(
pCmdLine
,
L"secureboot=off"
))
{
vdisk_disable_secure_boot
(
ImageHandle
);
}
FreePool
(
pCmdLine
);
FreePool
(
pCmdLine
);
return
EFI_SUCCESS
;
return
EFI_SUCCESS
;
}
}
...
...
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