Mike Hommey: Debian EFI mode boot on a Macbook Pro, without rEFIt
Diego s post got me to switch from grub-pc to grub-efi to boot Debian on my Macbook Pro. But I wanted to go further: getting rid of rEFIt.
rEFIt is a pretty useful piece of software, but it s essentially dead. There is the rEFInd fork, which keeps it up-to-date, but it doesn t really help with FileVault. Moreover, the boot sequence for a Linux distro with rEFIt/rEFInd looks like: Apple EFI firmware rEFIt/rEFInd GRUB Linux kernel. Each intermediate step adding its own timeout, so rEFIt/rEFInd can be seen as not-so-useful intermediate step.
Thankfully, Matthew Garrett did all the research to allow to directly boot GRUB from the Apple EFI firmware. Unfortunately, his blog post didn t have much actual detail on how to do it.
So here it is, for a Debian system:
And the Startup disk preferences dialog under OSX, like this:
- Install a few packages you ll need in this process:
# apt-get install hfsprogs icnsutils
- Create a small HFS+ partition. I have a 9MB one, but it s only filled by about 500K, so even smaller should work too. If, like me, you were previously using grub-pc, you probably have a GRUB partition, you can repurpose it. In
gdisk, it looks like this:
Number Start (sector) End (sector) Size Code Name 5 235284480 235302943 9.0 MiB AF00 Apple HFS/HFS+ Partition GUID code: 48465300-0000-11AA-AA11-00306543ECAC (Apple HFS/HFS+) Partition unique GUID: AD1F5465-B777-4178-AC4D-1DE8B2EB1B4B First sector: 235284480 (at 112.2 GiB) Last sector: 235302943 (at 112.2 GiB) Partition size: 18464 sectors (9.0 MiB) Attribute flags: 0000000000000000 Partition name: 'Apple HFS/HFS+'
- Create a HFS+ filesystem on that partition:
(replace# mkfs.hfsplus /dev/sda5 -v Debian/dev/sda5with whatever your partition is) - Add a
fstabentry for that filesystem:
# echo $(blkid -o export -s UUID /dev/sda5) /boot/efi auto defaults 0 0 >> /etc/fstab
- Mount the filesystem:
# mkdir /boot/efi # mount /boot/efi
- Edit
/usr/sbin/grub-install, look forxfat, and remove the block of code that looks like:
if test "x$efi_fs" = xfat; then :; else echo "$ efidir doesn't look like an EFI partition." 1>&2 efidir= fi - Run
grub-install. At this point, there should be a/boot/efi/EFI/debian/grubx64.efifile (if usinggrub-efi-amd64). - Create a
/boot/efi/System/Library/CoreServicesdirectory:
# mkdir -p /boot/efi/System/Library/CoreServices
- Create a hard link:
# ln /boot/efi/EFI/debian/grubx64.efi /boot/efi/System/Library/CoreServices/boot.efi
- Create a dummy
mach_kernelfile:
# echo "This file is required for booting" > /boot/efi/mach_kernel
- Grab the
mactel-bootsource code, unpack and build it:
# wget http://www.codon.org.uk/~mjg59/mactel-boot/mactel-boot-0.9.tar.bz2 # tar -jxf mactel-boot-0.9.tar.bz2 # cd mactel-boot-0.9 # make PRODUCTVERSION=Debian
- Copy the
SystemVersion.plistfile:
# cp SystemVersion.plist /boot/efi/System/Library/CoreServices/
- Bless the boot file:
# ./hfs-bless /boot/efi/System/Library/CoreServices/boot.efi
- (optional) Add an icon:
# rsvg-convert -w 128 -h 128 -o /tmp/debian.png /usr/share/reportbug/debian-swirl.svg # png2icns /boot/efi/.VolumeIcon.icns /tmp/debian.png # rm /tmp/debian.png
And the Startup disk preferences dialog under OSX, like this:
Since
A minor bug-fix release 3.4.4 of
After my last post I got curious about booting the Macbook in EFI mode. Because, well, why not? So I googled for a while and found 
A few months ago,
So far, Logitech has been kind enough to help me understanding part of the
protocol and even sent me a few devices so I can play and test my work with
them. Unfortunately, this will probably requires some work and time, and so
far Logitech was not able to help with that.
There should be enough information out there to at least add support for
battery to HID++ 2.0 devices, and probably a few other things too. I hope
I'd get the time do this at some point, but feel free to beat me in this
race!
As a followup to my toy over at
When someone wants to give you access to a Cisco VPN, they might give you a .mobileconfig file. This is apparently used by MacOS and iOS to encapsulate the configuration parameters needed to connect to a VPN. You should be able to connect to it with open source software (such as NetworkManager and vpnc) as long as you have the right configuration. Some helpful soul has tried to give you that configuration, but it s wrapped up in an Apple-specific container. Here s how you rip it open and get the goodies.
File format
A .mobileconfig appears to contain:


A year ago I wrote in
Contrary to
As systems developer I like just being able to pick the most useful Perl modules from CPAN and preferably use quite recent versions of the modules I need. On the other hand our systems administrators prefer running Debian Stable and deploy software using .deb packages.
I do not want to maintain hundred small packages by hand. I just want a single package with all needed the Perl dependencies for a given project. After looking at different possibilities for bundling Perl dependencies I finally found
With python-dbusmock you can
A (well, now former) coworker let me know about a problem he was having with a Lenovo Thinkcentre M92p. It booted Fedora UEFI install media fine, but after an apparently successful installation refused to boot. UEFI installs on Windows worked perfectly. Secure Boot was quickly ruled out, but this could still have been a number of things. The most interesting observation was that the Fedora boot option didn't appear in the firmware boot menu at all, but Windows did. We spent a little while comparing the variable contents, gradually ruling out potential issues - Linux was writing an entry that had an extra 6 bytes in a structure, for instance[1], and a sufficiently paranoid firmware implementation may have been tripping up on that. Fixing that didn't help, though. Finally we tried just taking the Windows entry and changing the descriptive string. And it broke.
Wishing everyone reading this a happy Gujarati New Year (Vikram Samvat 2069, called Krodhin,)
Diwali was a bit of a squib this year thanks to the aftermath of Hurricane Sandy but we survived relatively unscathed so I pray that in the upcoming year Lakshmi Ma will give a portion of my good fortune to those who are still suffering.