Skip to content

Instantly share code, notes, and snippets.

@startergo
Last active May 6, 2024 12:25
Show Gist options
  • Save startergo/18e7fc4f2b1125e80b677181cc6c77e7 to your computer and use it in GitHub Desktop.
Save startergo/18e7fc4f2b1125e80b677181cc6c77e7 to your computer and use it in GitHub Desktop.
Extract Firmware from OS X installer
  • Download the full installer:
softwareupdate --list-full-installers
Finding available software
Software Update found the following full installers:
* Title: macOS Ventura, Version: 13.1, Size: 11931164KiB, Build: 22C65
* Title: macOS Ventura, Version: 13.0.1, Size: 11866460KiB, Build: 22A400
* Title: macOS Ventura, Version: 13.0, Size: 11866804KiB, Build: 22A380
* Title: macOS Monterey, Version: 12.6.2, Size: 12104568KiB, Build: 21G320
* Title: macOS Monterey, Version: 12.6.1, Size: 12108491KiB, Build: 21G217
* Title: macOS Monterey, Version: 12.6, Size: 12104042KiB, Build: 21G115
* Title: macOS Big Sur, Version: 11.7.2, Size: 12119307KiB, Build: 20G1020
* Title: macOS Big Sur, Version: 11.7.1, Size: 12119247KiB, Build: 20G918
* Title: macOS Big Sur, Version: 11.7, Size: 12118755KiB, Build: 20G817
* Title: macOS Big Sur, Version: 11.6.6, Size: 12121263KiB, Build: 20G624
* Title: macOS Big Sur, Version: 11.6.5, Size: 12121404KiB, Build: 20G527
* Title: macOS Big Sur, Version: 11.6.4, Size: 12147782KiB, Build: 20G417
* Title: macOS Big Sur, Version: 11.6.3, Size: 12143674KiB, Build: 20G415
* Title: macOS Big Sur, Version: 11.6.2, Size: 12141944KiB, Build: 20G314
* Title: macOS Big Sur, Version: 11.6.1, Size: 12137180KiB, Build: 20G224
* Title: macOS Big Sur, Version: 11.5.2, Size: 12149332KiB, Build: 20G95
* Title: macOS Catalina, Version: 10.15.7, Size: 8055650KiB, Build: 19H15
* Title: macOS Catalina, Version: 10.15.7, Size: 8055522KiB, Build: 19H2
* Title: macOS Catalina, Version: 10.15.6, Size: 8055450KiB, Build: 19G2021
* Title: macOS Mojave, Version: 10.14.6, Size: 5896894KiB, Build: 18G103
* Title: macOS High Sierra, Version: 10.13.6, Size: 5099306KiB, Build: 17G66

softwareupdate --fetch-full-installer --full-installer-version 12.6.2
softwareupdate --fetch-full-installer --full-installer-version 10.14.6
cp /Applications/Install\ macOS\ Mojave.app/Contents/Resources/Firmware/MP51.fd  ~/Desktop

For older systems officially supporting:

Apple security updates

pkgutil --expand [Double click the dmg file and drop file here] /destination/path/

pkgutil --expand /Volumes/macOS\ Catalina\ Security\ Update\ 2021-008/SecUpd2021-008Catalina.pkg ~/Desktop/Expanded
cp ~/Desktop/Expanded/FirmwareUpdate.pkg/Scripts/Tools/EFIPayloads/MM61.scap ~/Desktop/MM61.scap

Please check here for the latest firmware version and the latest full installer version or latest security update.

  • Mounting Big Sur SharedSupport disk image:
/usr/bin/hdiutil mount /Applications/Install\ macOS\ Big\ Sur*.app/Contents/SharedSupport/SharedSupport.dmg
  • Store ZIP file path to variable (handle unpredictable file name)
ZIP_FILE=`ls /Volumes/Shared\ Support/com_apple_MobileAsset_MacSoftwareUpdate/*.zip`
  • List firmware files in ZIP file:
unzip -l-qq "$ZIP_FILE" "AssetData/boot/EFI/EFIPayloads/*"
  • In Terminal.app, first verify your EFI version using the following command:
/usr/libexec/firmwarecheckers/eficheck/eficheck --integrity-check | grep "EFI Version"
  • Note: macOS Sonoma no longer prifides the eficheck utility. That has been removed from Sonoma. All T2 and Apple silicon models automatically check the integrity of their firmware in the early part of the boot process anyway.

  • locate the firmware file and store the exact file path into the variable FIRMWARE_FILE:

FIRMWARE_FILE=<firmware file path here>
  • An example command would be:
FIRMWARE_FILE=AssetData/boot/EFI/EFIPayloads/MBP112.scap
  • Extract the firmware file ( "-j" means don't create directory structure and "-d" designates that output directory):
unzip -j "$ZIP_FILE" $FIRMWARE_FILE -d ~/Desktop/
  • Set your MacBook to upgrade the firmware on the next bootup (SIP must be disabled). Fill in the file name of your specific firmware file:
sudo /usr/sbin/bless -firmware ~/Desktop/<firmware file name here> --verbose --recovery
  • Trigger firmware upgrade: Shut down your computer. (Do not choose the restart option!) After the MacBook is powered off, power it back on by pressing the power button. Next be patient, and if everything goes well your firmware will be updated.
@startergo
Copy link
Author

I mentioned that in the guide. Use SUS-inspector
https://github.com/hjuutilainen/sus-inspector

@maverick85
Copy link

maverick85 commented May 2, 2024

Ok, I didn't understand from the guide that I would be using softwareupdate --fetch-full-installer --full-installer-version 12.7.4 and the tool sus-inspector, I thought it was an alternative gui tool for the same end.

edit: sus-inspector requires python2 to work...

@startergo
Copy link
Author

startergo commented May 2, 2024

Things may have changed. They were supposed to be in the full installer as well.

@maverick85
Copy link

If they are not, how should I get it?
I'm figuring the .fd file isn't it.

Should I download versions before that 12.7.4 until I find one with the .scap file?

I had installed OpenCore Legacy Patcher on my Mac and didn't like it at all. I reverted back to Monterey but I believe my EFI is altered but signaled as OK because of OCLP. I am really looking for a way to reinstall the native Apple firmware.

@startergo
Copy link
Author

If they are not, how should I get it? I'm figuring the .fd file isn't it.

Should I download versions before that 12.7.4 until I find one with the .scap file?

I had installed OpenCore Legacy Patcher on my Mac and didn't like it at all. I reverted back to Monterey but I believe my EFI is altered but signaled as OK because of OCLP. I am really looking for a way to reinstall the native Apple firmware.

Firmware has nothing to do with the EFI and it cannot be altered by OCLP especially on the MBP11,4 or 11,5. I have 11.4. Using SilentKnight 2:
image
This is what is within my EFI folder:
image
So I guess .fd file is what you need now.

@startergo
Copy link
Author

After the update:

/usr/bin/hdiutil mount /Applications/Install\ macOS\ Monterey*.app/Contents/SharedSupport/SharedSupport.dmg
ZIP_FILE=`ls /Volumes/Shared\ Support/com_apple_MobileAsset_MacSoftwareUpdate/*.zip`  
unzip -l-qq "$ZIP_FILE" "AssetData/boot/EFI/EFIPayloads/*"
FIRMWARE_FILE=AssetData/boot/EFI/EFIPayloads/MBP114.fd
unzip -j "$ZIP_FILE" $FIRMWARE_FILE -d ~/Desktop/  
sudo /usr/sbin/bless -firmware ~/Desktop/MBP114.fd --verbose --recovery
image

@maverick85
Copy link

maverick85 commented May 3, 2024

First let me thank you for your time and effort in putting these answers here. I really appreciate it and I'm sure others will too.

Screenshot 2024-05-03 at 14 56 38

Firmware has nothing to do with the EFI and it cannot be altered by OCLP especially on the MBP11,4 or 11,5. I have 11.4.

Immediately after installing OCLP one issue that arised on my Mac was that the boot Chime was distorted. This persisted after removing OCLP and doing a clean install of Monterey.

After reading about the problem there was some discussion on the Apple forums mentioning it could be a firmware problem on how the sound was being processed, which let me into this.
But if OCLP has nothing to do with firmware, how can I make sure my EFI partition doesn't have any leftovers from OCLP?

@startergo
Copy link
Author

Chime sound volume can be set through NVRAM. That is how OC sets it. Just do an NVRAM reset. Or better yet set the desired volume level through the NVRAM variable in the configuration file for OC.

@maverick85
Copy link

maverick85 commented May 3, 2024

It's not really about volume, rather a distortion. I have reset the NVRAM plenty since and did not resolve. (when I removed ventura and did a clean install, reset both nvram and smc)
what is the configuration file for OC?

Anyway, I haven't reinstalled the firmware using the bless command yet, I will do it in a bit after work. I am thinking when updating the firmware you're supposed to use the command bless, rather than just copying the file over to EFI/APPLE/FIRMWARE. So I was really hoping the process would trigger something that would fix my problem.

@startergo
Copy link
Author

No you should not copy anything just follow the instructions above. I just performed firmware update.

@maverick85
Copy link

I performed the firmware update as well but didn't resolve anything. Ah well, thanks for all the help!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment