Difference between revisions of "Enable SSH Without Opening the Apple TV"

From AwkwardTV
Jump to: navigation, search
(The Steps)
(Added an alternative approach that doesn't work yet)
Line 2: Line 2:
 
*External USB drive
 
*External USB drive
 
*<tt>partition.img</tt>, <tt>recovery.img</tt>, and <tt>efi.img</tt> from an Apple TV drive. (These images are explained and can be created using the steps found in [[Prepare a Hard Drive]].)
 
*<tt>partition.img</tt>, <tt>recovery.img</tt>, and <tt>efi.img</tt> from an Apple TV drive. (These images are explained and can be created using the steps found in [[Prepare a Hard Drive]].)
 +
 +
 +
==Alternative approach==
 +
Currently this approach won't work because the kernel 'cuts of its own head' - it boots, but it has no kext for a USB external storage device, so the kernel is loaded by the EFI but can't proceed any further.
 +
 +
Another possibility is to attempt to get it to boot the hacked OSX install.  The Apple TV will currently book a restore partition with the rather lovely type <tt>5265636F-7665-11AA-AA11-00306543ECAC</tt> from a usb drive.  Unfortunately, OSX won't read this to be able to install anything to it.  Moreover, the current restore.img taken from the appleTV hard disk is a little too small for an OSX install.  So while we can create a large partition of type 5254... using gpt, how can we read write that as a HFS+ drive?  Alternatively, can we change the type of a working partition to 5254...
 +
 +
So I'm stuck, but that seems to me the most promising approach to getting it to boot to the termnal from an external drive.
  
 
==The Steps==
 
==The Steps==

Revision as of 14:27, 3 April 2007

Parts Needed

  • External USB drive
  • partition.img, recovery.img, and efi.img from an Apple TV drive. (These images are explained and can be created using the steps found in Prepare a Hard Drive.)


Alternative approach

Currently this approach won't work because the kernel 'cuts of its own head' - it boots, but it has no kext for a USB external storage device, so the kernel is loaded by the EFI but can't proceed any further.

Another possibility is to attempt to get it to boot the hacked OSX install. The Apple TV will currently book a restore partition with the rather lovely type 5265636F-7665-11AA-AA11-00306543ECAC from a usb drive. Unfortunately, OSX won't read this to be able to install anything to it. Moreover, the current restore.img taken from the appleTV hard disk is a little too small for an OSX install. So while we can create a large partition of type 5254... using gpt, how can we read write that as a HFS+ drive? Alternatively, can we change the type of a working partition to 5254...

So I'm stuck, but that seems to me the most promising approach to getting it to boot to the termnal from an external drive.

The Steps

FIRST ATTEMPT DID NOT WORK. CHANGING A FEW THINGS AND WILL TRY AGAIN


We are going to modify the repair image and the OS that it installs when you factory reset your Apple TV.

  1. Mount recovery.img on your Intel-based Mac.
  2. Convert the existing OS.img on the Recovery volume to one that is writable.
 hdiutil convert -format UDRW -o RW.dmg /Volumes/Recovery/OS.dmg
  1. Mount the new RW.img
  2. Copy sshd and the ssh.plist file onto the new OSBoot you created.
 cp /System/Library/LaunchDaemons/ssh.plist /Volumes/OSBoot/System/Library/LaunchDaemons/ssh.plist
 cp /usr/sbin/sshd /Volumes/OSBoot/usr/sbin/sshd
  1. Convert the new RW.img back into a read-only compressed image.
hdiutil convert -format UDZO -o NEWOS.dmg RW.dmg
  1. Copy the NEWOS.dmg image onto the repair image
 
cp NEWOS.dmg /Volumes/Recovery/OS.dmg
  1. Unmount the recovery image by either ejecting it in the Finder or using diskutil unmount.
  2. Now we are going to setup the external drive:
 
dd if=partition.img of=/dev/disk# bs=1024k count=100
 dd if=efi.img of=/dev/disk#s1
 dd if=recovery.img of=/dev/disk#s2
  1. Plug in the USB drive to the Apple TV after its booted
  2. Press menu and - (minus) on the remote
  3. Then run factory restore