embed FirmwareVolume protocol, separate driver excluded

Signed-off-by: SergeySlice <sergey.slice@gmail.com>
This commit is contained in:
SergeySlice 2022-07-02 13:08:16 +03:00
parent 5fb7d28ffb
commit 373008f57b
9 changed files with 43 additions and 24 deletions

View File

@ -771,7 +771,7 @@
FSInject/FSInject.inf
Protocols/MsgLog/MsgLog.inf
Protocols/SMCHelper/SMCHelper.inf
Protocols/FirmwareVolume/FirmwareVolume.inf
#Protocols/FirmwareVolume/FirmwareVolume.inf
Protocols/AppleImageCodec/AppleImageCodec.inf
#Protocols/AppleUITheme/AppleUITheme.inf
Protocols/HashServiceFix/HashServiceFix.inf

View File

@ -228,7 +228,7 @@ SmbiosGenEntrypoint (
SmbiosGenDxeStrings,
NULL
);
ASSERT (gStringHandle != NULL);
// ASSERT (gStringHandle != NULL);
InstallProcessorSmbios (Smbios);
InstallCacheSmbios (Smbios);

View File

@ -967,13 +967,13 @@ if [[ -d "${SRCROOT}/CloverV2/EFI/CLOVER/drivers/$DRIVERS_OFF/$DRIVERS_LEGACY/Fi
packageRefId=$(getPackageRefId "${packagesidentity}" "${driverName}")
# Add postinstall script for old FileVault2 drivers to remove it if AppleUiSupport driver exists
if [[ "$driver" == AppleImageCodec* || "$driver" == AppleKeyAggregator* ||
"$driver" == AppleUITheme* || "$driver" == FirmwareVolume* || "$driver" == HashServiceFix* ]]; then
addTemplateScripts --pkg-rootdir="${PKG_BUILD_DIR}/${driverName}" \
--subst="DRIVER_NAME=$driver" \
--subst="DRIVER_DIR=$(basename $driverDestDir)" \
"AppleUiSupport"
fi
# if [[ "$driver" == AppleImageCodec* || "$driver" == AppleKeyAggregator* ||
# "$driver" == AppleUITheme* || "$driver" == FirmwareVolume* || "$driver" == HashServiceFix* ]]; then
# addTemplateScripts --pkg-rootdir="${PKG_BUILD_DIR}/${driverName}" \
# --subst="DRIVER_NAME=$driver" \
# --subst="DRIVER_DIR=$(basename $driverDestDir)" \
# "AppleUiSupport"
# fi
addTemplateScripts --pkg-rootdir="${PKG_BUILD_DIR}/${driverName}" \
--subst="INSTALLER_CHOICE=$packageRefId" MarkChoice
@ -1197,13 +1197,13 @@ if [[ -d "${SRCROOT}/CloverV2/EFI/CLOVER/drivers/$DRIVERS_OFF/$DRIVERS_UEFI/File
packageRefId=$(getPackageRefId "${packagesidentity}" "${driverName}")
# Add postinstall script for old FileVault2 drivers to remove it if AppleUiSupport driver exists
if [[ "$driver" == AppleImageCodec* || "$driver" == AppleKeyAggregator* ||
"$driver" == AppleUITheme* || "$driver" == FirmwareVolume* || "$driver" == HashServiceFix* ]]; then
addTemplateScripts --pkg-rootdir="${PKG_BUILD_DIR}/${driverName}" \
--subst="DRIVER_NAME=$driver" \
--subst="DRIVER_DIR=$(basename $driverDestDir)" \
"AppleUiSupport"
fi
# if [[ "$driver" == AppleImageCodec* || "$driver" == AppleKeyAggregator* ||
# "$driver" == AppleUITheme* || "$driver" == FirmwareVolume* || "$driver" == HashServiceFix* ]]; then
# addTemplateScripts --pkg-rootdir="${PKG_BUILD_DIR}/${driverName}" \
# --subst="DRIVER_NAME=$driver" \
# --subst="DRIVER_DIR=$(basename $driverDestDir)" \
# "AppleUiSupport"
# fi
addTemplateScripts --pkg-rootdir="${PKG_BUILD_DIR}/${driverName}" \
--subst="INSTALLER_CHOICE=$packageRefId" MarkChoice
buildpackage "$packageRefId" "${driverName}" "${PKG_BUILD_DIR}/${driverName}" "${driverDestDir}"

View File

@ -15,7 +15,8 @@
//#include <Framework/FirmwareVolumeImageFormat.h>
#include <Protocol/FirmwareVolume.h>
EFI_HANDLE mHandle = NULL;
EFI_HANDLE mHandle2 = NULL;
typedef struct {
EFI_GUID Guid;
@ -406,7 +407,7 @@ FVEntrypoint (IN EFI_HANDLE ImageHandle,
if (EFI_ERROR(Status)) {
Status = gBS->InstallMultipleProtocolInterfaces (
&mHandle,
&mHandle2,
&gEfiFirmwareVolumeProtocolGuid,
&FirmwareVolume,
NULL

View File

@ -805,7 +805,7 @@ MainPostBuildScript() {
copyBin "$BUILD_DIR_ARCH"/$efi.efi "$CLOVER_PKG_DIR"/EFI/CLOVER/drivers/$DRIVERS_LEGACY/$efi.efi
done
binArray=( AppleImageCodec AppleKeyAggregator FirmwareVolume )
binArray=( AppleImageCodec AppleKeyAggregator )
for efi in "${binArray[@]}"
do
copyBin "$BUILD_DIR_ARCH"/$efi.efi "$CLOVER_PKG_DIR"/EFI/CLOVER/drivers/$DRIVERS_OFF/$DRIVERS_LEGACY/FileVault2/$efi.efi
@ -829,7 +829,7 @@ MainPostBuildScript() {
copyBin "$BUILD_DIR_ARCH"/$efi.efi "$CLOVER_PKG_DIR"/EFI/CLOVER/drivers/$DRIVERS_UEFI/$efi.efi
done
binArray=( AppleImageCodec AppleKeyAggregator FirmwareVolume )
binArray=( AppleImageCodec AppleKeyAggregator )
for efi in "${binArray[@]}"
do
copyBin "$BUILD_DIR_ARCH"/$efi.efi "$CLOVER_PKG_DIR"/EFI/CLOVER/drivers/$DRIVERS_OFF/$DRIVERS_UEFI/FileVault2/$efi.efi

View File

@ -781,7 +781,7 @@ MainPostBuildScript() {
copyBin "$BUILD_DIR_ARCH"/$efi.efi "$CLOVER_PKG_DIR"/EFI/CLOVER/drivers/$DRIVERS_LEGACY/$efi.efi
done
binArray=( AppleImageCodec AppleKeyAggregator FirmwareVolume )
binArray=( AppleImageCodec AppleKeyAggregator )
for efi in "${binArray[@]}"
do
copyBin "$BUILD_DIR_ARCH"/$efi.efi "$CLOVER_PKG_DIR"/EFI/CLOVER/drivers/$DRIVERS_OFF/$DRIVERS_LEGACY/FileVault2/$efi.efi
@ -804,7 +804,7 @@ MainPostBuildScript() {
copyBin "$BUILD_DIR_ARCH"/$efi.efi "$CLOVER_PKG_DIR"/EFI/CLOVER/drivers/$DRIVERS_UEFI/$efi.efi
done
binArray=( AppleImageCodec AppleKeyAggregator FirmwareVolume )
binArray=( AppleImageCodec AppleKeyAggregator )
for efi in "${binArray[@]}"
do
copyBin "$BUILD_DIR_ARCH"/$efi.efi "$CLOVER_PKG_DIR"/EFI/CLOVER/drivers/$DRIVERS_OFF/$DRIVERS_UEFI/FileVault2/$efi.efi

View File

@ -23,6 +23,8 @@
#include "Injectors.h"
#include "../Platform/Settings.h"
#include <Protocol/FirmwareVolume.h>
#ifndef DEBUG_ALL
#define DEBUG_PRO 1
#else
@ -366,7 +368,7 @@ STATIC APPLE_USER_INTERFACE_THEME_PROTOCOL mAppleUserInterfaceThemeProtocol = {
};
extern EFI_FIRMWARE_VOLUME_PROTOCOL FirmwareVolume;
EFI_STATUS
SetPrivateVarProto(void)
@ -385,8 +387,11 @@ SetPrivateVarProto(void)
&mKeyboardInfo,
&gAppleUserInterfaceThemeProtocolGuid,
&mAppleUserInterfaceThemeProtocol,
&gEfiFirmwareVolumeProtocolGuid,
&FirmwareVolume,
NULL
);
//obligatory protocol
Status = gBS->InstallProtocolInterface (&gImageHandle,
&gEfiDevicePathPropertyDatabaseProtocolGuid,

View File

@ -393,6 +393,8 @@
Settings/Self.h
Settings/SelfOem.cpp
Settings/SelfOem.h
../Protocols/FirmwareVolume/FirmwareVolume.c
[Sources.IA32]
PlatformIA32/ftol.asm | MSFT
@ -528,6 +530,7 @@
gEfiOSInfoProtocolGuid
gEfiKeyboardInfoProtocolGuid
gAppleUserInterfaceThemeProtocolGuid
gEfiFirmwareVolumeProtocolGuid
gFSInjectProtocolGuid
gMsgLogProtocolGuid

View File

@ -86,6 +86,7 @@
#include "../include/OC.h"
#ifndef DEBUG_ALL
# ifdef DEBUG_ERALY_CRASH
# define DEBUG_MAIN 2
@ -121,7 +122,7 @@
XBool gGuiIsReady = false;
XBool gThemeNeedInit = true;
XBool DoHibernateWake = false;
UINT32 mCurrentColor;
UINT32 mCurrentColor;
//EFI_HANDLE ConsoleInHandle;
//EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL* SimpleTextEx;
@ -831,6 +832,15 @@ void LOADER_ENTRY::StartLoader()
//debugStartImageWithOC();
// check exists
// void *ExistingFirmwareVolume;
// Status = gBS->LocateProtocol (gEfiFirmwareVolumeProtocolGuid, NULL, (VOID **)&ExistingFirmwareVolume);
// if (EFI_ERROR(Status)) {
// DBG ("FirmwareVolumeProtocol is not installed\n");
// } else {
// DBG ("FirmwareVolumeProtocol is installed\n");
// }
DBG("Beginning OC\n");