exclude SMCHelper as the service is embedded

Signed-off-by: SergeySlice <sergey.slice@gmail.com>
This commit is contained in:
SergeySlice 2022-07-26 19:57:36 +03:00
parent 632e3d60e6
commit 735987a8b1
6 changed files with 41 additions and 27 deletions

View File

@ -843,12 +843,12 @@ if [[ -d "${SRCROOT}/CloverV2/EFI/CLOVER/drivers/$DRIVERS_LEGACY" && ${NOEXTRAS}
--subst="INSTALLER_CHOICE=$packageRefId" MarkChoice
# Add postinstall script for SMCHelper drivers to remove it if VirtualSMC driver exists
if [[ "$driver" == SMCHelper* ]]; then
addTemplateScripts --pkg-rootdir="${PKG_BUILD_DIR}/${driverChoice}" \
--subst="DRIVER_NAME=$driver" \
--subst="DRIVER_DIR=$(basename $driverDestDir)" \
"VirtualSMC"
fi
# if [[ "$driver" == SMCHelper* ]]; then
# addTemplateScripts --pkg-rootdir="${PKG_BUILD_DIR}/${driverChoice}" \
# --subst="DRIVER_NAME=$driver" \
# --subst="DRIVER_DIR=$(basename $driverDestDir)" \
# "VirtualSMC"
# fi
# mandatory drivers starts all selected only if /Library/Preferences/com.projectosx.clover.installer.plist does not exist
# (i.e. Clover package never run on that target partition).
# Otherwise each single choice start selected only for legacy Clover and only if you previously selected it
@ -1011,12 +1011,12 @@ if [[ -d "${SRCROOT}/CloverV2/EFI/CLOVER/drivers/$DRIVERS_UEFI" ]]; then
--subst="INSTALLER_CHOICE=$packageRefId" MarkChoice
# Add postinstall script for SMCHelper drivers to remove it if VirtualSMC driver exists
if [[ "$driver" == SMCHelper* ]]; then
addTemplateScripts --pkg-rootdir="${PKG_BUILD_DIR}/${driverChoice}" \
--subst="DRIVER_NAME=$driver" \
--subst="DRIVER_DIR=$(basename $driverDestDir)" \
"VirtualSMC"
fi
# if [[ "$driver" == SMCHelper* ]]; then
# addTemplateScripts --pkg-rootdir="${PKG_BUILD_DIR}/${driverChoice}" \
# --subst="DRIVER_NAME=$driver" \
# --subst="DRIVER_DIR=$(basename $driverDestDir)" \
# "VirtualSMC"
# fi
buildpackage "$packageRefId" "${driverChoice}" "${PKG_BUILD_DIR}/${driverChoice}" "${driverDestDir}"
addChoice --group="Recommended64UEFI" \

View File

@ -282,11 +282,7 @@ struct _APPLE_SMC_IO_PROTOCOL {
SMC_INDEX Index; ///<
SMC_ADDRESS Address; ///<
BOOLEAN Mmio; ///<
/* SMC_IO_SMC_UNKNOWN_1 SmcUnknown1; ///<
SMC_IO_SMC_UNKNOWN_2 SmcUnknown2; ///<
SMC_IO_SMC_UNKNOWN_3 SmcUnknown3; ///<
SMC_IO_SMC_UNKNOWN_4 SmcUnknown4; ///<
SMC_IO_SMC_UNKNOWN_5 SmcUnknown5; ///< */
};

View File

@ -481,11 +481,7 @@ APPLE_SMC_IO_PROTOCOL SMCHelperProtocol = {
0,
SMC_PORT_BASE,
FALSE,
/* SmcUnknown1Impl,
SmcUnknown2Impl,
SmcUnknown3Impl,
SmcUnknown4Impl,
SmcUnknown5Impl */
};
APPLE_SMC_STATE_PROTOCOL SMCStateProtocol = {

View File

@ -799,7 +799,7 @@ MainPostBuildScript() {
# Mandatory drivers
echo "Copy Mandatory drivers:"
binArray=( XhciDxe SMCHelper EnglishDxe )
binArray=( XhciDxe EnglishDxe )
for efi in "${binArray[@]}"
do
copyBin "$BUILD_DIR_ARCH"/$efi.efi "$CLOVER_PKG_DIR"/EFI/CLOVER/drivers/$DRIVERS_LEGACY/$efi.efi
@ -823,7 +823,7 @@ MainPostBuildScript() {
# fi
binArray=( SMCHelper EnglishDxe )
binArray=( EnglishDxe )
for efi in "${binArray[@]}"
do
copyBin "$BUILD_DIR_ARCH"/$efi.efi "$CLOVER_PKG_DIR"/EFI/CLOVER/drivers/$DRIVERS_UEFI/$efi.efi

View File

@ -775,7 +775,7 @@ MainPostBuildScript() {
# Mandatory drivers
echo "Copy Mandatory drivers:"
binArray=( FSInject XhciDxe SMCHelper AudioDxe )
binArray=( FSInject XhciDxe AudioDxe )
for efi in "${binArray[@]}"
do
copyBin "$BUILD_DIR_ARCH"/$efi.efi "$CLOVER_PKG_DIR"/EFI/CLOVER/drivers/$DRIVERS_LEGACY/$efi.efi
@ -798,7 +798,7 @@ MainPostBuildScript() {
fi
binArray=( FSInject SMCHelper AudioDxe )
binArray=( FSInject AudioDxe )
for efi in "${binArray[@]}"
do
copyBin "$BUILD_DIR_ARCH"/$efi.efi "$CLOVER_PKG_DIR"/EFI/CLOVER/drivers/$DRIVERS_UEFI/$efi.efi

View File

@ -128,6 +128,9 @@ REFIT_MENU_SCREEN AboutMenu(2, L"About"_XSW, L""_XSW);
REFIT_MENU_SCREEN HelpMenu(3, L"Help"_XSW, L""_XSW);
REFIT_MENU_SCREEN OptionMenu(4, L"Options"_XSW, L""_XSW);
XBool gResetSMC = false;
extern APPLE_SMC_IO_PROTOCOL *gAppleSmc;
void FillInputs(XBool New)
{
@ -461,6 +464,9 @@ void FillInputs(XBool New)
InputItems[InputItemsCount].ItemType = BoolValue; //128
InputItems[InputItemsCount++].BValue = gSettings.Quirks.OcKernelQuirks.ProvideCurrentCpuInfo;
InputItems[InputItemsCount].ItemType = BoolValue; //129
InputItems[InputItemsCount++].BValue = gResetSMC;
//menu for drop table
@ -929,7 +935,7 @@ void ApplyInputs(void)
gSettings.Quirks.OcBooterQuirks.DisableSingleUser = ((gSettings.Quirks.QuirksMask & QUIRK_SU) != 0); //0
gSettings.Quirks.OcBooterQuirks.DisableVariableWrite = ((gSettings.Quirks.QuirksMask & QUIRK_VAR) != 0); //0
gSettings.Quirks.OcBooterQuirks.DiscardHibernateMap = ((gSettings.Quirks.QuirksMask & QUIRK_HIBER) != 0); //0
gSettings.Quirks.OcBooterQuirks.EnableSafeModeSlide = ((gSettings.Quirks.QuirksMask & QUIRK_SAFE) != 0); //1
gSettings.Quirks.OcBooterQuirks.EnableSafeModeSlide = ((gSettings.Quirks.QuirksMask & QUIRK_SAFE) != 0); //0
gSettings.Quirks.OcBooterQuirks.EnableWriteUnprotector = ((gSettings.Quirks.QuirksMask & QUIRK_UNPROT) != 0); //1
gSettings.Quirks.OcBooterQuirks.ForceExitBootServices = ((gSettings.Quirks.QuirksMask & QUIRK_EXIT) != 0); //0
gSettings.Quirks.OcBooterQuirks.ProtectMemoryRegions = ((gSettings.Quirks.QuirksMask & QUIRK_REGION) != 0); //0
@ -1112,6 +1118,21 @@ void ApplyInputs(void)
gSettings.Quirks.OcKernelQuirks.ProvideCurrentCpuInfo = InputItems[i].BValue != 0;
DBG("applied ProvideCurrentCpuInfo=%s\n", gSettings.Quirks.OcKernelQuirks.ProvideCurrentCpuInfo ? "Y" : "N" );
}
i++; //129
if (InputItems[i].Valid) {
gResetSMC = InputItems[i].BValue != 0;
if (gResetSMC) {
// reset controller
if (gAppleSmc && (gAppleSmc->Signature == NON_APPLE_SMC_SIGNATURE)) {
gAppleSmc->SmcReset(gAppleSmc, 1);
DBG("SMC store is resetted\n");
} else {
DBG("SMC protocol not found\n");
}
gResetSMC = false;
}
}
if (NeedSave) {
ApplySettings();
@ -2489,6 +2510,7 @@ REFIT_ABSTRACT_MENU_ENTRY* SubMenuSystem()
SubScreen->AddMenuItemInput(2, "Block kext:", true);
SubScreen->AddMenuItemInput(51, "Set OS version if not detected:", true);
SubScreen->AddMenuItemInput(118, "Booter Cfg Command:", true);
SubScreen->AddMenuItemInput(129, "Reset SMC", false);
SubScreen->AddMenuEntry(SubMenuCSR(), true);
SubScreen->AddMenuEntry(SubMenuBLC(), true);