In the last part I explained how the Joggler boots its retail firmware, and the ways in which the boot process can be interfered with. The first step to getting somewhere is to get a proper bootloader on there; one that can give you access to an EFI shell and tools, and can boot other things without fiddly editing of scripts or pressing ESC repeatedly.
rEFIt is a Mac EFI bootloader which gives you a nice graphical menu of possible EFI programs to boot, and comes with a shell and tools. It's not the ideal bootloader for Linux since it can't directly load a Linux kernel, but it can load an EFI GRUB binary for that. I don't want to rely on rEFIt permanently because I don't know how to build it or where to obtain a binary of guaranteed provenance; this defeats the point of the "booting stock Debian" exercise; but it's a useful tool while messing around with the boot configuration.
The rEFIt binaries available from the project itself don't work on the Joggler; Apple invented a "fat" EFI binary format that supports both 32-bit and 64-bit x86, but this isn't in the EFI spec and non-Mac implementations don't support it. Compiling rEFIt from source is also difficult; the toolchain provided by Intel runs on Windows as part of Visual Studio, and the free toolchains that run on Linux are not fully compatible and can't compile rEFIt, at least not with the default configuration.
Since I only intend for this to be temporary, I'm just using binaries made for the Joggler by someone else, available here. The setup instructions there are a pain, though, as they assume you have already hacked the Joggler's original firmware to have SSH access. So, what I did:
- Pull the "efi" directory out of the tarball and put it on a FAT-formatted USB stick.
- Power up the joggler and hammer on ESC until it stops booting and drops to the invisible builtin shell.
- Launch rEFIt directly from the USB stick by typing, blindly:
- fs1:
- cd efi\refit
- refit
- Pick "Start EFI Shell", then hit ESC to stop that shell from executing startup.nsh (which would just boot the original firmware).
- Copy rEFIt onto the internal eMMC:
- cp -r fs1:\efi fs0:
- Add a boot manager entry, before the default one, which launches rEFIt from the internal eMMC:
- bcfg boot add 01 fs0:\efi\refit\refit.efi
No comments:
Post a Comment