Friday, August 30, 2013

Implementation Details of Enterprise, my Custom UEFI Booting Solution for Linux on Intel Macs

My repository on GitHub holding the source code for my program Enterprise is currently sparse on commits - no updates in over a month. But before you accost me for being lazy, listen up, for I have not been lazy, nor has the project been abandoned. I simply have been using this time to figure out exactly how I'm going to implement the program instead of simply throwing code together like before.

So, what do I have in mind? Well, listen up.

My booting solution for booting Linux distributions via EFI is a three-stage loading process, involving (at least) three files instead of the present two (two EFI executables and one ISO file of your preferred Linux distribution). These programs will be executed in sequential order. This works out as follows:
  1. The user boots into the USB drive made by Mac Linux USB Loader. Enterprise will then perform some hardware checks to ensure that you actually booted on a Mac. It will then display a menu similar to those found in gummiboot or GRUB. I'm looking at rather basic options at this point - the options will be to boot normally, boot with certain options (like no graphical X desktop and/or disabling kernel mode setting), or reloading and/or dropping into an EFI shell.
  2. If the user chooses to boot the operating system, we then write out a configuring file detailing exactly what is needed to boot Linux on the current hardware. Then we pass control off to GRUB, which is another EFI executable in the same directory. GRUB reads this configuration file and boots the Linux distribution included in the installed ISO file.
  3. GRUB loads the kernel and RamDisk from the ISO using loopback. Together the kernel starts up the remainder of the operating system.
This approach will ultimately yield itself to be a more viable alternative to the current solution, which works with hard coded kernel locations inside of the ISO (however, loopback support will still be required, as this is required for GRUB to boot from the ISO file - there isn't really any way around this). Additionally, it will allow me to add support for more distributions with relative simplicity.

For those of you who want to see the directory structure, here's what it will look like:


I know many of you have been waiting very patiently for a solution. Tails, Knoppix, Backtrack, and Arch Linux are all distributions that I've been requested to support. I assure you that I am working as fast as I can to get these distributions working with Mac Linux USB Loader. I have no idea when this solution will be ready for beta testing, but everything should be on track now.

What do you think of this setup? Comment below. If you prefer to communicate via email, I can be reached here.