WARNING : This procedure is quite risky and you may end up bricking your mac. I am not responsible for what you do with these instructions. Be sure to know what you are doing before doing it.

I own a mid-2011 MacBook Air (MacBookAir 4,2) and I was quite frustrated that I wasn't able to keep my firmware up to date because I chose to remove OS X completely and only run Linux on it.

This is my journey into the Apple updates and how I managed to update my EFI bios to the latest version.

Get the firmware

First things first, find and download the latest firmware for your Mac from the support pages at the apple website. For me it was this one http://support.apple.com/kb/DL1497

Get to the content

The file is a DMG but it cannot be mounted, contrary to most reports on the internet. And using dmg2img on it yields and image that cannot be mounted either. I ended up using hfsleuth (which can be found, among other useful resources here

It is a cli so just start it and then issue :

fs <path_to_the_dmg_image>

This loads the image into the program and should give you some information about it.

Now if you type

ls

You should see the content of the DMG archive and specifically a .pkg file which contains the interesting bits. To extract the file from the archive we issue the command

pull <name_of_the_file>

This will copy the file in your /tmp directory where you can get to it.

Now if you run the file command on this file you'll see that it's actually and XAR archive. Unfortunately utilities to decompress those kind of files don't seem to be packaged under the major distributions. So you can grab and build xar from here

Now you can just decompress the file like so

xar -xf <the_file>

this creates a new directory containing 4 files :

  • Bom
  • PackageInfo
  • Payload
  • Scripts

PackageInfo is a bzip2-compressed xml file that contains... the package information The interesting parts are Payload and Scripts. These are both gzip-compressed cpio files, here is how I uncompressed them.

mv Payload Payload.gz
gunzip Payload.gz
mkdir payload
cd payload
cpio -idv < ../Payload

This can be repeated for scripts and should create the directory tree that contains the Payload. At the very end of the tree is a file with a .scap extension, this is the EFI firmware.

Installing the firmware

In this part we consider that your EFI partition is mounted under /boot/efi You should have a directory called /boot/efi/EFI/APPLE and that directory should contain a FIRMWARE directory and an EXTENSIONS directory. If it is not the case you should create them.

Now to install the firmware simply copy the .scap file to /boot/efi/EFI/APPLE/FIRMWARE

Checking the version of the firmware

To check which version of the firmware you are currently running issue :

sudo dmidecode | grep -A 5 "BIOS Information"

This should give you the BIOS version currently running.

Final step

Now you can reboot your Mac and once it's booted re-run dmidecode and you should see that the bios version has changed to the new version.

Upgrading other firmwares

This method of unpacking a dmg works for other firmwares and it yield and efi application and a firmware file. In my next blog post I will explain how to upgrade those firmwares using an efi shell.