Kodi Community Forum
[LINUX] Apple TV Crystalbuntu (Ubuntu Linux and Crystal HD) Disk Image for Apple TV - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: Linux (https://forum.kodi.tv/forumdisplay.php?fid=52)
+---- Thread: [LINUX] Apple TV Crystalbuntu (Ubuntu Linux and Crystal HD) Disk Image for Apple TV (/showthread.php?tid=74992)



- simonp - 2010-11-14

I'm doing fine with SMB through XBMC. The server is a ubuntu 9.10 machine running samba. I don't use SMB through the linux user/kernel command line. I use the smb:// urls directly from within XBMC. I'm hoping this is bypassing the kernel filesystem cache. nfs and smb (smbmount, etc) from within the linux OS would use the kernel cache and I'm not sure if that memory usage could potentially be an issue on the super memory tight ATV. Maybe not though. If I had to pick a protocol I'd prolly go with NFS over SMB.

One other option I've played with is using the ccxstream program on the linux server side to stream files (xbmsp:// urls). I've done it with XBMC on an OS X Mac mini, but not with the crystalbuntu atv setup yet.

In any case... it does sound like the issue is between XBMC and your SAN device. Triple check the login and password if you're using one on your NAS. You might also try enabling a read-only guest mode on the NAS if possible. That's how I'm serving the data.

as to installing the latest xbmc dharma and a good set of crystalbuntu drivers try this:

Code:
#update XBMC to latest nightly for the first time, do this:
echo "deb http://ppa.launchpad.net/nvidia-vdpau/ppa/ubuntu hardy main" | sudo tee -a /etc/apt/sources.list.d/xbmc.org.list
echo "deb-src http://ppa.launchpad.net/nvidia-vdpau/ppa/ubuntu hardy main" | sudo tee -a /etc/apt/sources.list.d/xbmc.org.list
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys CEC06767

sudo apt-get update
sudo apt-get install python-qt3
sudo apt-get install xbmc
#if above 'install xbmc' doesn't complete, use "-f"
sudo apt-get install -f

#update XBMC going forward will only require this: if there is an update, it will ask if you want to install it
sudo apt-get update
sudo apt-get install xbmc

#Update CrystalHD Drivers to recommended r156 (as of 8/27)
svn checkout http://crystalhd-for-osx.googlecode.com/svn/trunk crystalhd-r156
cd crystalhd-r156/crystalhd/linux_lib/libcrystalhd
make
sudo make install
cd ../../driver/linux
autoconf
./configure
make
sudo make install
sudo modprobe crystalhd

#Reboot Your box
reboot

Cheers,

--Chris


- Nico7as - 2010-11-14

Hi everyone, I'm calling for help here, I'm struggling with my Apple TV....

here's the picture :
I have an AppleTV with a CrystalHD card, running aTV OS, patched with Patchstick.ca
It works, but shows its limits with HD content, and I want to improve that.

could you tell me the basic steps to get crystalbuntu booting on usb, and running well.
I have a Mac, and atvusb creator, if it helps....

my first questions:
should I do a Factory Restore? should I patch aTVOS first? (i wish i could still boot on aTV OS from time to time)
I hope you guys have some directions to give me :-)

meanwhile, I'll try to get pin78 image on my 4GB stick (I don't know why, but it ain't working...see my post page 143 or 142)

thanks!


- generikb - 2010-11-16

Man oh man, I just spend a few solid hours reading through all 145 pages, stopping and trying various thing, and doing a lot of head scratching.

I apologize in advance, I know this has been answered 10 times over. I've read every answer. None of them work and/or go way over my head.

Here's where I'm at:

*Running Windows 7 on my main computer
*Downloaded Sam's image, got it installed on a flash drive, plugged it into the ATV...XBMC, huzzah!
*Decided it would be really cool to copy this onto the ATV's hard drive (I don't care about the ATVOS whatsoever.
*Here's where it gets reaaaaalllly fuzzy, as I don't know a single thing about linux. I figured out how to SSH and log into the ATV, but all of these sba2's and fsckhsf's and all that business, not only do I not know what it all means, but it seems that the 10 answers in the past 145 pages are all different!

Is there a very simple, plain english, "linux ignoramus" instructions someone could give? Literally, I need a "Step 1, 2, 3" type deal.

*really* would appreciate it...ready to give an xbmc donation (or paypal for 1-on-1 support LOL) if you can sort me out!

(side note: in randomly attempting a few of those solutions earlier in this massive thread, my ATV no longer boots up without the usb drive in place...I probably monkeyed up a partition or something, but seeing as how I don't care about the original ATVOS, I should still be ok, right?)

1000 thanks in advance!


- haifischjunge - 2010-11-16

Ive searched this thread, but just want to ask for confirmation:

1) I use component video output and optical audio. This should work or am I wrong?

2) Next year Ill upgrade my tv and want to change to hdmi only, will this also work? (as far as I understud, it will)

3) Are there any major disatvantages in using linux besides no access to the itunes movie rentals? (dual boot whould be great in this case)

4) can appletv os (10.4) really only decode (even with crystalhd help) 720p and then upscales it to 1080i? (my av receiver maxes out at 1080i, so 1080p is not really necessary for me)

thanks


- Sam.Nazarko - 2010-11-16

generikb Wrote:Man oh man, I just spend a few solid hours reading through all 145 pages, stopping and trying various thing, and doing a lot of head scratching.

I apologize in advance, I know this has been answered 10 times over. I've read every answer. None of them work and/or go way over my head.

Here's where I'm at:

*Running Windows 7 on my main computer
*Downloaded Sam's image, got it installed on a flash drive, plugged it into the ATV...XBMC, huzzah!
*Decided it would be really cool to copy this onto the ATV's hard drive (I don't care about the ATVOS whatsoever.
*Here's where it gets reaaaaalllly fuzzy, as I don't know a single thing about linux. I figured out how to SSH and log into the ATV, but all of these sba2's and fsckhsf's and all that business, not only do I not know what it all means, but it seems that the 10 answers in the past 145 pages are all different!

Is there a very simple, plain english, "linux ignoramus" instructions someone could give? Literally, I need a "Step 1, 2, 3" type deal.

*really* would appreciate it...ready to give an xbmc donation (or paypal for 1-on-1 support LOL) if you can sort me out!

(side note: in randomly attempting a few of those solutions earlier in this massive thread, my ATV no longer boots up without the usb drive in place...I probably monkeyed up a partition or something, but seeing as how I don't care about the original ATVOS, I should still be ok, right?)

1000 thanks in advance!

Really, this means you should wait for the UI installer, not mess around in uncharted territory. But I will tell you what to do anyway, as simply as I can. Just give a little time to give a guide.

haifischjunge Wrote:Ive searched this thread, but just want to ask for confirmation:

1) I use component video output and optical audio. This should work or am I wrong?

2) Next year Ill upgrade my tv and want to change to hdmi only, will this also work? (as far as I understud, it will)

3) Are there any major disatvantages in using linux besides no access to the itunes movie rentals? (dual boot whould be great in this case)

4) can appletv os (10.4) really only decode (even with crystalhd help) 720p and then upscales it to 1080i? (my av receiver maxes out at 1080i, so 1080p is not really necessary for me)

thanks

1. Yes
2. Yes
3. No
4. Decodes 1080p > XBMC > 720 > scales 1080p (stupid process)


- Sam.Nazarko - 2010-11-16

1. You will need Linux to install it on the HDD. I'm going to presume your using my image, which will make this a lot easier for you.
2. Boot into Linux off the USB
3. Make an OpenSSH connection - logging in with xbmc, xbmc.
4. Back up the internal drive (see atv-bootloader page)
5. Zero the internal drive:
Code:
sudo dd if=/dev/zero of=/dev/sda bs=4096 count=1M
6. Fetch patched parted, hfs tools, etc...

Code:
sudo apt-get install build-essential patch
# fetch hfs_support
wget http://atv-bootloader.googlecode.com/files/hfs_support-1.0.tar.gz
tar -xzf hfs_support-1.0.tar.gz

# build and install
cd hfs_support/
sudo ./build_diskdev_cmds.sh

# remove the existing parted
sudo /usr/bin/apt-get remove parted

# fetch the patched parted
wget http://atv-bootloader.googlecode.com/files/parted-1.8.8-atv.tar.gz
tar -xzf parted-1.8.8-atv.tar.gz

# build and install the patched parted
cd parted
#nano install_parted and CHANGE inline functions
nano ./install_parted.sh
#Change ./configure --enable-static=yes to ./configure CFLAGS="-fgnu89-inline" --enable-static=yes
sudo ./install_parted.sh
sudo ln -s /usr/local/sbin/parted /sbin/parted
# verify the install
parted --version
# you should see "parted (GNU parted) 1.8.8"
#(adapted from atv-bootloader page)

7. Create the three partitions, Recovery, Swap and Linua-eat3 (this way we can resize):
The recovery partition (straightforward):

Code:
sudo parted -s /dev/sda mkpart primary HFS 40s 69671s
sudo parted -s /dev/sda set 1 atvrecv on

The ext3 (note in future I will put eat3 at end for the sake of simpler mathematics)

To calculate the endsector in s, you need to enter the result of:
(sudo parted -s /dev/sda unit s print - 1048615). That leaves 512Mbytes, and the 40sectors to be left blank.

Now we make the eat3 partition (substitute e for value above)

Code:
sudo parted -s /dev/sda mkpart primary eat3 69672s Es

sudo parted -s /dev/sda sudo parted -s /dev/sda mkpart primary linua-swap Es (Final Sector - 40s)

** Es should be Es + 1 if it is not an even number
** Final Sector is basically the result of parted -s /dev/sda unit s print but without minusing 1048615, instead minusing 40s

8. Sync partition tables:
Code:
sudo partprobe /dev/sda
9. Duplicate each partition from USB:
Code:
sudo dd if=/dev/sdb1 of=/dev/sda1
sudo dd if=/dev/sdb2 of=/dev/sda2
sudo dd if=/dev/sdb3 of=/dev/sda3

10. We have to mount /dev/sda1 to edit the com.apple.boot.plist (replace /dev/sdbX with /dev/sdaX), because Recovery is HFS journal, we take some extra steps:
Code:
fsck.hfsplus /dev/sda1
mkdir mnt
mount -t hfsplus -o rw /dev/sda1 mnt
cd mnt
sudo nano com.apple.boot.plist
cd
sudo umount /dev/sda1
rm -rf mnt

11.
Code:
sudo resize2fs -f /dev/sda2
(resizes ext3 partition to take full advantage of internal drive)

12. Remove USB, boot in off HDD. Verify HDD space with
Code:
df -h

Hope this helps! I will introduce an installer that will do this on the next image, but here is my method and I think this works best.


- haifischjunge - 2010-11-16

thanks a lot for the answers, this sounds promissing.

does using linux have an impact on the power consumtion?

the appletv osx doesnt hibernate and sucks 25w all the time, does linux have an impact here.


- Sam.Nazarko - 2010-11-16

aTV isn't ACPI compliant. It will draw ~23-25W whatever state it is in


- frumpy_uk - 2010-11-16

Sam.Nazarko Wrote:1. You will need Linux to install it on the HDD. I'm going to presume your using my image, which will make this a lot easier for you.
2. Boot into Linux off the USB
.
.
.
.
.
.

Sam - you're a credit. Well done that man


- generikb - 2010-11-17

Sam.Nazarko Wrote:1. You will need Linux to install it on the HDD. I'm going to presume your using my image, which will make this a lot easier for you.

*snip*

Hope this helps! I will introduce an installer that will do this on the next image, but here is my method and I think this works best.

Bless your heart Sam! I'm going to try this tonight and let you know how it works!!!


- generikb - 2010-11-17

Ok sam, I get to this part:

Code:
sudo parted -s /dev/sda mkpart primary HFS 40s 69671s

and it gives me this error:

Error: /dev/sda: unrecognized disk label

is this because I monkeyed around with the hard drive before?


- thebookfreak58 - 2010-11-17

n00b question.

Can I run this image from a USB drive while keeping the HDD "clean"? I'd like to be able to keep the aTV stuff there so I can rent movies from iTunes, while at the same time taking advantage of the benefits of running XBMC from Linux over running it from the aTV (OSX)

If it is possible to boot the image, will the settings and mods be saved to the USB? And how can I go about doing this.
Thanks!


revert back to beta 2? - mrhyde69 - 2010-11-17

I installed pin's image to my hdd and updated to the latest beta.....how can I revert back to beta 2?


- tuckbodi - 2010-11-17

haifischjunge Wrote:3) Are there any major disatvantages in using linux besides no access to the itunes movie rentals? (dual boot whould be great in this case)

No AirTunes. For parties I have music streaming from iTunes (Mac mini w/powered speakers) in the back of the house, to my AppleTV connected to my main receiver in the front of the house, and another receiver in the basement connected to an AirPort Express, all via AirTunes.

I then use computers throughout the house (and a laptop outside) which act as jukebox kiosks using a tool called Signal (basically a webserver connected to iTunes), which I adapted the kiosk web pages to fit the different screens. In sync all the screens automatically flip the album art to what is currently playing, I can go to the next/prev songs, and go to songs in a playlist..from any of the kiosk screens. Think of the iPhone Remote app (which also works with this setup, BTW) on all the computer screens. Looks just like it..


- mbetter - 2010-11-17

Maybe this is a stupid question but I just installed my CHD. I was running pin's image without the CHD card for a week, is there anything I need to do to enable it?