Archive:HOW-TO:Install Gentoo and XBMC on Apple TV 1

From Official Kodi Wiki
Jump to navigation Jump to search

Install Gentoo and XBMC on the AppleTV

These instructions will help you on your way to getting Gentoo intalled on your Apple TV. This guide is for a total ATV overhaul -- which is to say replacing the OSX-lite ATV OS with Gentoo. As such it has the possibility of totally toasting your pretty silver box. These steps do NOT require you to crack open your ATV and slave up its disk to an existing pc. This is of course an option, but IMHO, totally unnecessary.

Most of this guide was stolen right off http://code.google.com/p/atv-bootloader. I give full praise and credit to these guys. atv-bootloader is a truely awesome little bit of work. This guide assumes you are comfortable with a gentoo command-line installation and kernel configuration, telnet/ssh connections, network basics, partition/disk schemes, etc. If terms like "dd", "mbr", "efi" and "parted" don't mean anything to you, you should probably close this document and go grab a Ubuntu ISO. Not that I don't love Ubuntu :-)

You will also need an existing linux machine (or, yes, OSX would work too). This linux machine will be used to build the initial ATV-Bootloader USB stick, as well as telnet into your atv during the process. I used a gentoo box, and thus these instructions will be geared in that direction. Keep in mind some part may deviate, depending on your distro.

Your ATV and linux machine will need to be on the same lan with dhcp setup (should be a no brainer)

Herrrrrreeee we go...




Create an AppleTV Patchstick

(not to be confused with the atv-bootloader stick)

Head on over to http://code.google.com/p/atvusb-creator/ and download whatever flavor of the patchstick tool suites your OS. Extract it to a directory and run it. It will download a new version of the ATV firmware for you, put it in a juicer and pop out a nice little .img file for you to put on a USB drive. It will also produce you your very own boot.efi file. Hold on to this file, it will be important later.

Create an ATV-Bootloader USB Stick

All the linux commands I've listed here should be run as root, unless otherwise noted

On your linux machine, get your distros copy of GNU Parted. On gentoo, the package is called parted, so;

emerge -v parted


You will also need HFS+ tools. Portage has got a package called sys-fs/hfsplusutils, but I found it to suck. Your best bet is to grab the tar off the atv-bootloader site, do the following as your root;

cd ~	
wget http://atv-bootloader.googlecode.com/files/hfs_support-1.0.tar.gz
tar -xzf hfs_support-1.0.tar.gz
cd hfs_support/
./build_diskdev_cmds.sh


You'll now have your own copies of various hfsp utilities you will need moving forward. Get an empty usb drive of at least 512mb and plug it into your linux machine, lets assume it gets assigned to device node /dev/sdb The following commands zero out the device then create and format the usb partitions:

dd if=/dev/zero of=/dev/sdb bs=4096 count=1M
partprobe /dev/sdb
parted -s /dev/sdb mklabel gpt
parted -s /dev/sdb mkpart primary HFS 40s 69671s
parted -s /dev/sdb set 1 atvrecv on
partprobe /dev/sdb
mkfs.hfsplus -v Recovery /dev/sdb1
cd ~
mkdir atvbootloader
mount /dev/sdb1 atvbootloader/


Now download and copy over the atv-bootloader files;

wget http://atv-bootloader.googlecode.com/files/recovery-0.6.tar.gz
tar -xzf recovery-0.6.tar.gz
cp -arp recovery/* atvbootloader/


That disk is now set up, so copy over that handy boot.efi that the Patchstick util found for you. If you created the patchstick on windows you'll need to copy the boot.efi file over to your linux machine, then copy it to the bootloader stick. You can use PSCP, ftp, or another flash disk, whatever you want. Just make sure it ends up on your atv-bootloader disk:

cp -ap boot.efi atvbootloader/


Now edit the boot.plist file from the recovery software to drop you to a command prompt. I'm a vi-guy, but you can use nano or whatever you want:

vi atvbootloader/penboot/com.apple.Boot.plist


Change one of the last lines in that file to read:

<string>atv-boot=none video=vsesafb</string>

Save and quit vi (:wq [enter]), unmount your usb atv-bootloader.

You've now got an awesome little usb drive that will boot your appletv to a live linux installation. W00t.


Backup your internal ATV Hard Drive

Partition your internal ATV Hard Drive

Install the atv-bootloader onto the internal disk

Installing Gentoo

Basic Gentoo Environment

Chroot in and Edit Environment

Make.conf options

System config and Update

Kernel Config

Boot Setup and Options

Install Packages

Basic Stuff

Xorg

Installing XBMC