Tuesday, April 1, 2008

Take 2 Full Update - AwkwardTV

Take 2 Full Update

From AwkwardTV

Jump to: navigation, search

What follows are step by step instructions for upgrading your Apple TV to the 2.0 (Take 2) software, and then loading back on all the "extras". First thing to do is grab all the required files and put them in a folder called AppleTVUpdate which is located on your desktop.

Contents

[hide]

[edit] Required Hardware

  • Apple TV running the Take2 update firmware version 1, since version 1.1 doesn't have AFP and VNC support.
  • Intel Mac - there are ways to do this on PC's and PPC Macs, but they are not covered here.
  • USB "thumb drive" of at least 128 MB. Some users have reported problems with drives with more than 2 GB.

[edit] Required Files

- ATVFiles-1.0.take2a2.run
- turbo_kext_enabler.bin


From Perian:
- AC3MovieImport.component - provides ac3 sound for perian (bundled in perian install)
- A52Codec.component - (bundled in perian install)
- Perian.component - provides divx, xvid, flv,mkv, srt support


From Flip4Mac:
- Flip4Mac WMV Import.component - provides windows media support
Note: The above files (with exception of the .DMG) can be found under /Library/Audio/Plug-Ins/Components and /Library/QuickTime, if you have Perian (and Flip4Mac) installed on your Intel Mac.


From MacOS X 10.4.9 Combo Updater (Download and mount, open the pkg with Pacifist):
- IOUSBMassStorageClass.kext
- IOSCSIArchitectureModelFamily.kext
- IOStorageFamily.kext
- msdosfs.kext
- ntfs.kext
- smbfs.kext
- udf.kext
Note: The above files can be found inside /System/Library/Extensions inside the package mentioned above using Pacifist.
- mount_smbfs
Note: The above files can be found inside /sbin inside the package mentioned above using Pacifist.

[edit] Steps

NOTE: All commands are to be run one at a time, do not try pasting everything in and running all at once

[edit] 1) Install Apple TV Take 2 update from your Apple TV

[edit] 2) Install SSH

Either use a Patchstick (see Take2patch) or install by physically removing the AppleTV's hard drive from the AppleTV, mounting the drive on another computer, and copying over the appropriate files (see Install SSH, including Install SSH / Notes for Take 2).

[edit] 3) Install ATVFiles


a) on Mac:

scp -1 -r ~/Desktop/AppleTVUpdate/ATVFiles-1.0.take2b1.run frontrow@AppleTV.local:~


b) on AppleTV

sudo sh ~/ATVFiles-1.0.take2b1.run
[edit] Alternate 3 to 8

a) Copy MacOS X 10.4.9 Combo Updater to ~/Documents folder on AppleTV

b) Install nitoTV http://forum.awkwardtv.org/viewtopic.php?f=6&t=1262

c) Once on the menu, install (from the nitoTV installer menu)

c1) Perian, say NO when asked to use Perian h.264 instead of Quicktime's

c2) mplayer codecs

c3) Turbo's Kextloader

c4) Smart Installer (not the updater)

d) jump to step 9

  • Note: added c3 and moved Smart Installer to c4! otherwise the Smart Installer will throw errors at the end, and the kextloader is needed for the USB patch anyway.

[edit] 4 Install Perian and other Quicktime Components


a) on Mac:

scp -1 -r ~/Desktop/AppleTVUpdate/AC3MovieImport.component frontrow@AppleTV.local:~
scp -1 -r ~/Desktop/AppleTVUpdate/Flip4Mac\ WMV\ Import.component frontrow@AppleTV.local:~
scp -1 -r ~/Desktop/AppleTVUpdate/Perian.component frontrow@AppleTV.local:~
scp -1 -r ~/Desktop/AppleTVUpdate/A52Codec.component frontrow@AppleTV.local:~


b) on AppleTV

sudo mount -uw /
sudo mv ~/AC3MovieImport.component /Library/Quicktime/
sudo mv ~/Flip4Mac\ WMV\ Import.component /Library/Quicktime/
sudo mv ~/Perian.component /Library/Quicktime/
sudo mv ~/A52Codec.component /Library/Audio/Plug-Ins/Components/

[edit] 5) Install AFP

Both the processes listed below presume a 1.0 recovery partition on the AppleTV, and have been tailed towards that. Many of the files can likely be gotten from the 10.4.9 combo updater, but probably not all. A full install of 10.4.9 on an Intel Mac would also do nicely, but both the script and the manual process would need to be tweaked in order to properly get and place the files.
a) Automatic Process:
On Mac:
Download the script.

 scp -1 -r ~/Desktop/AppleTVUpdate/afpinstall.sh frontrow@AppleTV.local:~


On AppleTV:

sudo sh afpinstall.sh


b) Manual Process: Because the sed command wasn't working, we'll just create out own hostconfig file.
On Mac:
Create a text file with the following contents:

AFPSERVER=-YES-
AUTHSERVER=-NO-
AUTOMOUNT=-YES-
CUPS=-AUTOMATIC-
NFSLOCKS=-AUTOMATIC-
NISDOMAIN=-NO-
TIMESYNC=-YES-
QTSSERVER=-NO-
WEBSERVER=-NO-
SMBSERVER=-NO-
SNMPSERVER=-NO-
SPOTLIGHT=-YES-


Name it "hostconfig" (no quotes, no extension) and place it in your AppleTVUpdate folder on your desktop.

scp -1 -r ~/Desktop/AppleTVUpdate/hostconfig frontrow@AppleTV.local:~

On AppleTV:

sudo mount -uw /
sudo touch /.readwrite
cd ~
sudo dd if=/dev/disk0s2 of=recovery.dmg bs=1m
hdiutil mount recovery.dmg
hdiutil mount /Volumes/Recovery/OS.dmg
sudo cp -pRvn /Volumes/OSBoot\ 1/* /
echo -ne 'Installing the Filesystem Extensions...\n'
sudo ln -s /System/Library/Filesystems/AppleShare/afpfs.kext /System/Library/Filesystems/afpfs.fs
echo -ne 'Installing into /usr/sbin...\n'
sudo ln -s /System/Library/CoreServices/AppleFileServer.app/Contents/MacOS/AppleFileServer /usr/sbin/AppleFileServer
echo -ne 'Updating /etc/hostconfig to start AFP at boot...\n'
echo -en 'AFPSERVER=-YES-\nAUTHSERVER=-NO-\nAUTOMOUNT=-YES-\nCUPS=-AUTOMATIC-\nNFSLOCKS=-AUTOMATIC-\nNISDOMAIN=-NO-\nTIMESYNC=-YES-\nQTSSERVER=-NO-\nWEBSERVER=-NO-\nSMBSERVER=-NO-\nSNMPSERVER=-NO-\nSPOTLIGHT=-YES-'
sudo mv hostconfig /etc/hostconfig
sudo chown root:wheel /etc/hostconfig
echo -ne 'Done!\n'

For Apple TV OTB 1.1 or later: If you have a recovery partition of 1.1 or later, look for OS.dmg from 1.0 and copy it into the same folder as afpinstall.sh and comment out these:

sudo dd if=/dev/disk0s2 of=recovery.dmg bs=1m
sudo hdiutil mount recovery.dmg

Make sure the path to OS.dmg is correct, then run sudo sh afpinstall.sh

--Yargok 18:49, 5 March 2008 (CET) Does anyone have a similar procedure for those who have a recovery partition of 1.1?
--pheno 14:20, 12 March 2008 (CET) Please note if you will use the command "sudo cp -pRvn /Volumes/OSBoot\ 1/* /" to run aftwards "/usr/sbin/diskutil repairPermissions"

[edit] 6) Reboot AppleTV


a) on AppleTV:

sudo reboot

[edit] 7) Install USB


a) on Mac:
Download Take 2 DMG and mount it.
Download the kernel patcher, and extract the three files into a folder (this currently requires an Intel Mac).
Copy the file mach_kernel.prelink from the mounted image (it is in the root directory) and place it in the same folder as the kernel patcher files you just extracted.
Open up terminal and do the following:

cd (to the directory you have the kernel patching files)
./do_usb_patch.sh


--Bloo 08:49, 9 March 2008 (CET) Running ./prelink_tool -d mach_kernel.prelink mach_kernel_patched.bin fails with: Bus error.. thoughts?
--blues 08:46, 16 March 2008 (CET) Problem occurs because of binary incompatibility with the tools. One solution is to recompile source on your system.

2.0.1 Note: the offsets have changed in the 2.0.1 prelink, thanks to some notes from jphelp32 on the forum the following will be sufficient changes to the do_usb_patch.sh script

#
# ==== patch the decompressed kernel
#
echo ======== patch kernel =========
./poke mach_kernel_patched.bin 0x52055e 0x75:0x75 0x34:0x30
if [ $? -ne 0 ]; then exit 1; fi
./poke mach_kernel_patched.bin 0x52123E 0x75:0x75 0x34:0x30
if [ $? -ne 0 ]; then exit 1; fi
./poke mach_kernel_patched.bin 0x520576 0x75:0x75 0x1c:0x18
if [ $? -ne 0 ]; then exit 1; fi
./poke mach_kernel_patched.bin 0x521256 0x75:0x75 0x1c:0x18
if [ $? -ne 0 ]; then exit 1; fi

The 2.0.1 patch is tested and works! --Nito 12:28, 1 April 2008 (CEST)


Once the kernel is patched, rename it to mach_kernel.prelink and place it in your AppleTVUpdate folder on your desktop

scp -1 -r ~/Desktop/AppleTVUpdate/mach_kernel.prelink frontrow@AppleTV.local:~
scp -1 -r ~/Desktop/AppleTVUpdate/turbo_kext_enabler.bin frontrow@AppleTV.local:~
scp -1 -r ~/Desktop/AppleTVUpdate/IOUSBMassStorageClass.kext frontrow@AppleTV.local:~
scp -1 -r ~/Desktop/AppleTVUpdate/smbfs.kext frontrow@AppleTV.local:~
scp -1 -r ~/Desktop/AppleTVUpdate/udf.kext frontrow@AppleTV.local:~
scp -1 -r ~/Desktop/AppleTVUpdate/msdosfs.kext frontrow@AppleTV.local:~
scp -1 -r ~/Desktop/AppleTVUpdate/ntfs.kext frontrow@AppleTV.local:~
scp -1 -r ~/Desktop/AppleTVUpdate/IOStorageFamily.kext frontrow@AppleTV.local:~
scp -1 -r ~/Desktop/AppleTVUpdate/IOSCSIArchitectureModelFamily.kext frontrow@AppleTV.local:~


b) on AppleTV:

sudo mv /mach_kernel.prelink /mach_kernel.prelink.bak
sudo mv ~/mach_kernel.prelink /mach_kernel.prelink
sudo mv ~/turbo_kext_enabler.bin /sbin/
sudo mv ~/IOUSBMassStorageClass.kext /System/Library/Extensions/
sudo mv ~/smbfs.kext /System/Library/Extensions/
sudo mv ~/udf.kext /System/Library/Extensions/
sudo mv ~/msdosfs.kext /System/Library/Extensions/
sudo mv ~/ntfs.kext /System/Library/Extensions/
sudo mv ~/IOStorageFamily.kext /System/Library/Extensions/
sudo mv ~/IOSCSIArchitectureModelFamily.kext /System/Library/Extensions/
sudo chown -R root:wheel /System/Library/Extensions/*.kext
sudo chmod -R 755 /System/Library/Extensions/*.kext
sudo chmod 755 /sbin/turbo_kext_enabler.bin
sudo defaults write /Library/Preferences/SystemConfiguration/autodiskmount AutomountDisksWithoutUserLogin -bool true

[edit] 8) Install mount_smbfs


a) on Mac:

scp -1 -r ~/Desktop/AppleTVUpdate/mount_smbfs frontrow@AppleTV.local:~


b) on AppleTV:

sudo mv ~/mount_smbfs /sbin/
sudo chown root:wheel /sbin/mount_smbfs
sudo chmod +s /sbin/mount_smbfs

[edit] 9) Create rc.local


a) on Mac:
Create a text file with the following contents:

# rc.local
# enable USB
/sbin/turbo_kext_enabler.bin
/sbin/kextload -v /System/Library/Extensions/IOUSBMassStorageClass.kext
/sbin/kextload -v /System/Library/Extensions/smbfs.kext
/sbin/kextload -v /System/Library/Extensions/udf.kext
/sbin/kextload -v /System/Library/Extensions/msdosfs.kext
/sbin/kextload -v /System/Library/Extensions/ntfs.kext
# enable cron
/usr/sbin/cron


Name it "rc.local" (no quotes) and place it in your AppleTVUpdate folder on your desktop.

scp -1 -r ~/Desktop/AppleTVUpdate/rc.local frontrow@AppleTV.local:~
scp -1 /usr/bin/crontab frontrow@AppleTV.local:~
scp -1 /usr/bin/nano frontrow@AppleTV.local:~
scp -1 /usr/sbin/cron frontrow@AppleTV.local:~


b) on AppleTV:

sudo mv ~/rc.local /etc/
sudo chown root:wheel /etc/rc.local
sudo mv ~/crontab /usr/bin
sudo mv ~/nano /usr/bin
sudo mv ~/cron /usr/sbin
sudo chown root:wheel /usr/bin/crontab
sudo chown root:wheel /usr/bin/nano
sudo chown root:wheel /usr/sbin/cron
sudo chmod 4555 /usr/bin/crontab
sudo chmod 555 /usr/bin/nano
sudo chmod 555 /usr/sbin/cron

[edit] 10) Enable VNC


a) on AppleTV:

echo 71463E00FFDAAA95FF1C39567390ADCA > /Library/Preferences/com.apple.VNCSettings.txt
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart \
-configure -clientopts -setvnclegacy -vnclegacy yes
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart \
-activate -configure -access -on -users frontrow -privs -all -restart -agent -menu

--PatentBoy 01:15, 28 March 2008 (CET) Where can I grab the ARDAgent.app? From Tiger or Leopard install, for example?
--Kheops 18:22, 28 March 2008 (GMT+7) You can copy the RemoteManagement folder from the recovery.dmg:

sudo mount -uw /
sudo touch /.readwrite
cd ~
sudo dd if=/dev/disk0s2 of=recovery.dmg bs=1m
sudo hdiutil mount recovery.dmg
sudo hdiutil mount /Volumes/Recovery/OS.dmg
sudo cp -pr /Volumes/OSBoot\ 1/System/Library/CoreServices/RemoteManagement/ /System/Library/CoreServices/
sudo cp -pr /Volumes/OSBoot\ 1/System/Library/Perl/ /System/Library/Perl/
sudo cp -pr /System/Library/Perl/Extras/5.8.6/ /System/Library/Perl/5.8.6/

Then you will be able to run the 'kickstart' commands above, but still I didn't succeed to connect (the ARDAgent is running, but I have "connection refused(16001)" from my VNC client

[edit] 11) Disable Updates

To prevent future updates from breaking your custom Apple TV don't forget to add the Apple update site to your hosts file as a loop back:
a) on AppleTV:

sudo bash -c 'echo "127.0.0.1       mesu.apple.com" >> /etc/hosts'

[edit] 12) Reboot the AppleTV


a) on AppleTV:

sudo reboot

[edit] Watchdog

--Elchubi 06:22, 22 March 2008 (CET) Might be missing something (However, I'd done several Take 1 AppleTVs in the past) but I have been unsuccessfully disabling watchdog... Would some some confirm old method is working? Mine keeps rebooting so I have to enable it and Finder keeps restarting when running other app (as MythTV or Miro for example) instead of Finder. Thanks in advance

[edit] Aftermath

At this point your AppleTV should come back up with full 1080i/1080p support, AirTunes working, HD Rentals working, AFP running, USB working (and the drive should automount), ATVFiles should be running, and ssh should be working.

No comments: