Skip to content

Commit

Permalink
autofill SMBIOS in the case of manual change product
Browse files Browse the repository at this point in the history
Signed-off-by: Slice <[email protected]>
  • Loading branch information
SergeySlice committed Jun 5, 2024
1 parent b7b5037 commit e8933cd
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 9 deletions.
2 changes: 2 additions & 0 deletions CloverPackage/CloverV2/EFI/CLOVER/config-sample.plist
Original file line number Diff line number Diff line change
Expand Up @@ -990,6 +990,8 @@
<false/>
<key>ExternalDiskIcons</key>
<false/>
<key>ForceAquantiaEthernet</key>
<false/>
<key>ForceExitBootServices</key>
<false/>
<key>ForceOcWriteFlash</key>
Expand Down
2 changes: 1 addition & 1 deletion OpenCorePkg
6 changes: 3 additions & 3 deletions buildme
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ if [[ "$SYSNAME" == Darwin ]]; then
if [[ $MYTOOLCHAIN == GCC* ]] && [[ ! -x "${GCC131_BIN}" ]]; then
if [[ $MYTOOLCHAIN == GCC131 ]]; then
cd "${CLOVERROOT}"
./build_gcc13.sh
./build_gcc14.sh
else
MYTOOLCHAIN=XCODE8
fi
Expand Down Expand Up @@ -264,7 +264,7 @@ BLC() {
if [[ ! -d "${CLOVERROOT}"/CloverPackage/BootLoaderChooser ]]; then
mkdir -p "${CLOVERROOT}"/CloverPackage/BootLoaderChooser
fi
curl -sLq https://github.com/jief666/BootloaderChooser/releases/download/0.5/BootX64.efi > "${CLOVERROOT}"/CloverPackage/BootLoaderChooser/BootX64.efi
curl -sLq https://github.com/jief666/BootloaderChooser/releases/download/1.4/BootX64.efi > "${CLOVERROOT}"/CloverPackage/BootLoaderChooser/BootX64.efi
chmod 775 "${CLOVERROOT}"/CloverPackage/BootLoaderChooser/BootX64.efi
}

Expand Down Expand Up @@ -846,7 +846,7 @@ done
Extra
}

menu() {
menu()
#clear
echo
echo -e $COL_GREEN" ---------------------------------------------------------------------------------"
Expand Down
5 changes: 3 additions & 2 deletions rEFIt_UEFI/Platform/platformdata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -804,8 +804,9 @@ XString8 GetReleaseDate(MacModel Model)

void SetDMISettingsForModel(MacModel Model, SETTINGS_DATA* settingsData)
{
// GlobalConfig.CurrentModel = Model; // 2022-05 Not using Goblal config to avoid inter-dependancy. CCPV wouldn't compile anymore.
// be sure to to assign GlobalConfig.CurrentModel if you need to.
// GlobalConfig.CurrentModel = Model; // 2022-05 Not using Goblal config to avoid inter-dependancy.
// CCPV wouldn't compile anymore.
// be sure to to assign GlobalConfig.CurrentModel if you need to.
settingsData->Smbios.BiosVersion = ApplePlatformDataArray[Model].firmwareVersion;
settingsData->Smbios.BiosReleaseDate = GetReleaseDate(Model);
settingsData->Smbios.EfiVersion = ApplePlatformDataArray[Model].efiversion;
Expand Down
7 changes: 4 additions & 3 deletions rEFIt_UEFI/Settings/ConfigManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -599,16 +599,17 @@ EFI_STATUS ConfigManager::LoadSMBIOSPlist(const XStringW& ConfName)
void ConfigManager::ReloadSmbios(XStringW& str)
{
size_t N = SmbiosList.size();
if (OldChosenSmbios == 0) {
if (OldChosenSmbios == 0) { // this is auto fill by OSName
for (size_t i=1; i<N; i++) {
if (SmbiosList[i].contains(str)) {
OldChosenSmbios = i;
break;
}
}
FillSmbiosWithDefaultValue(GlobalConfig.CurrentModel, configPlist.getSMBIOS());
DBG("SMBIOS reloaded with model %s\n", gSettings.Smbios.ProductName.c_str());
}
FillSmbiosWithDefaultValue(GlobalConfig.CurrentModel, configPlist.getSMBIOS());
DBG("SMBIOS reloaded with model %s\n", gSettings.Smbios.ProductName.c_str());

}

void ConfigManager::FillSmbiosWithDefaultValue(MacModel Model, const SmbiosPlistClass::SmbiosDictClass& smbiosDictClass)
Expand Down
2 changes: 2 additions & 0 deletions rEFIt_UEFI/refit/menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ XBool gResetSMC = false;
extern APPLE_SMC_IO_PROTOCOL *gAppleSmc;
extern ConfigManager gConf;


void FillInputs(XBool New)
{
UINTN i,j; //for loops
Expand Down Expand Up @@ -790,6 +791,7 @@ void ApplyInputs(void)
if (Model != MaxMacModel) {
GlobalConfig.CurrentModel = Model;
SetDMISettingsForModel(Model, &gSettings);
FillInputs(false);
}
}

Expand Down

0 comments on commit e8933cd

Please sign in to comment.