Sunday, September 16, 2012

Ubuntu Precise (12.04) on Apple TV (1st generation)

I have an Apple TV(1st generation) that I use as a HTPC running XBMC. I planned to swap out the original hard drive with a compact flash card (poor man's SSD). One of the biggest issue with swapping the original hard drive out and replacing it with a compact flash card is to find a compact flash card that will boot. It is supposed that only compact flash card that identifies itself as "fixed disk" can boot as a replacement drive inside the Apple TV. Off late most vendors dont sell compact flash card that identifies itself as a "fixed disk" when using a compact flash to IDE adapter nor do they provide any utility to do the same as they have done in the past. Finding a compact flash card that will boot as a replacement drive has been the toughest part. After experimenting with a few myself and talking with other people who have tried I was close to giving up on using a compact flash card as the bootable drive. I finally found a card that did boot.

To boot linux on the apple tv one needs to use the atv-bootloader [1]. One can use the atv-bootloader to kexec into the stock distribution kernel. Since I dont upgrade my kernel often I would rather avoid the kexec step. I built my own kernel with using a config that works with the atv-bootloader. After I install that kernel I create the mach_kernel that I copied into the recovery partition. I am not covering the details in this post.
Now just go ahead and replace the stock IDE hard drive with this compact flash and now you have a poor mans SSD booting in your apple tv.

The recovery partition is required for the apple tv to boot. You need to create the first partition just as mentioned in this guide, dont change even the sectors. You can then install linux however you want.