Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kaloprominat/7cc0864ee843d7b3c0be1f0f15f568a7 to your computer and use it in GitHub Desktop.
Save kaloprominat/7cc0864ee843d7b3c0be1f0f15f568a7 to your computer and use it in GitHub Desktop.
mac os: run macbook firmware updater create package
Procedure followed by Pepijn to run the high sierra firmware installer:
1. get the FirmwareUpdate.pkg file from the OS installer app's installESD.dmg
2. extract the contents using pkgutil --expand FirmwareUpdate.pkg <path somewhere>/FirmwareUpdate
3. in terminal, cd to the Scripts directory inside the expanded firmwareupdate pkg.
4. with Scripts as your working directory, run these 2 commands, then reboot:
/usr/libexec/FirmwareUpdateLauncher -p "$PWD/Tools"
/usr/libexec/efiupdater -p "$PWD/Tools/EFIPayloads"
5. at the reboot, firmware will be updated if there are any updates to be applied.
## Firmware
To be able to boot from a APFS formatted disk, the target Mac's firmware needs to be updated. An update package can be generated using the following script (thanks to Greg Neagle & Pepijn Bruienne for their work on this).
```
#!/bin/sh
/usr/bin/hdiutil mount /Applications/Install\ macOS\ High\ Sierra*.app/Contents/SharedSupport/InstallESD.dmg
/usr/sbin/pkgutil --expand /Volumes/InstallESD/Packages/FirmwareUpdate.pkg /tmp/FirmwareUpdate
/bin/mkdir -p /tmp/FirmwareUpdateStandalone/scripts
/bin/cp /tmp/FirmwareUpdate/Scripts/postinstall_actions/update /tmp/FirmwareUpdateStandalone/scripts/postinstall
/bin/cp -R /tmp/FirmwareUpdate/Scripts/Tools /tmp/FirmwareUpdateStandalone/scripts/
/usr/bin/pkgbuild --nopayload --scripts /tmp/FirmwareUpdateStandalone/scripts --identifier com.foo.FirmwareUpdateStandalone --version 1.0 /tmp/FirmwareUpdateStandalone/FirmwareUpdateStandalone.pkg
```
The resulting package should be used in a `package` component that is installed during the Imagr run (so `first_boot` should be `<false/>`) and installed prior to restoring your APFS image.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment