Skip to content

Instantly share code, notes, and snippets.

@startergo
Last active July 1, 2024 07:30
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

If I specify an older firmware file, will it indeed flash it anyway after blessing it?

Not sure you will have to try this.

Also, I'm curious why all the use of variables above.

Try without assigning them and see if it will list the firmware within.

@storkinsj
Copy link

I don't see any "listing" being done above after the $FIRMWARE_FILE variable is set; however, the "bless" apple command is executed. Indeed it may check the variable.

Regardless, thanks for your help. I will report back here my results.

@startergo
Copy link
Author

If you follow the commands as shown skip this:

ZIP_FILE=`ls /Volumes/Shared\ Support/com_apple_MobileAsset_MacSoftwareUpdate/*.zip`

And try the unzip command.

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