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)



- czyz - 2010-11-24

I'm still having the same issues trying to access mythtv URLs from xbmc on my appletv running Pin's crystalbuntu image, updated to the latest crystalhd driver and latest xbmc.

No errors are occurring in the mysql log when I try to access the mythtv backend from xbmc, so I'm not even sure if it's trying to reach the mythtv backend or is giving up at some earlier point.

On the xbmc, I'm running both "tail -f /var/log messages &" and "tail -f .xbmc/temp/xbmc.log &", to see if anything's written to a log when I try to connect to the mythtv backend, and nother other than those non-informative error messages I quoted before shows up.

Does anyone know whether xbmc only works with Mythbackend's that are pre-0.24? Maybe it doesn't support the latest protocol? I can't find any info on which Mythtv protocols are supported by xbmc's mythtv support.

Thanks for any help or info. And I definitely second the motion to break all of these discussions into their own threads.


- illiac4 - 2010-11-25

Jimmer Wrote:You will find a plist file on your USB stick. Edit this to change sdb to sda, as per this post:

http://forum.xbmc.org/showpost.php?p=554556&postcount=431

The reason is that with no internal disk to call sda, then the system assigns the USB as sda. In the plist file the USB is assumed to be sdb (which is normal if you have an internal drive).

Just edit the file and then on boot it will then find the / partition on the USB stick and it should boot no problems....

Jim
Ok i have found it but when i try to edit the .plist file i can not save it because it is read only. I'm usinq slax linux. Tried with direct rename and also with terminal.


Minimal Ubuntu pib87 Image to Apple TV Install HOW TO. - Bandit_Kaine - 2010-11-25

After Reading through just about every page in this thread and not being able to install the minimal ubuntu image to the Apple TV Hard drive so that I wouldn't have to use a USB Hub for my Music USB Drive I decided to put this guide together for others who like me who wanted the image loading off the internal hard drive and not a USB. There may be an easier/faster way to do it then the way I did it, but it works and i posted all the commands and steps exactly step by step as i did it. I did it twice using this very same post to make sure i didn't miss anything.

FOLLOWING MY GUIDE WILL REMOVE THE APPLE TV OS FROM THE HARD DRIVE AND WILL ONLY LEAVE THE MINIMAL UBUNTU IMAGE. READ (GOOGLE) ATV-BOOTLOADER PAGE FOR INSTRUCTIONS ON HOW TO BACKUP OR RESTORE THE APPLE TV OS IF YOU EVER WANT TO GO BACK. I USED WINDOWS 7 AND WINSCP + PUTTY TO ENTER ALL THE COMMANDS. YOU CAN DO THE SAME IN AN SSH TERMINAL WINDOW ON UBUNTU OR ANY OTHER LINUX DISTRO WITH A TERMINAL WINDOW.

#First thing you have to do is download pin87's image from any of the following links listed on the first page of this thread.
download:
http://www.surfanddestroy.org/resources/atv-usbboot-xbmcbuntu-crystalhd-hdmi-28256-R3.rar
http://meaninglesswebsite.com/atv-usbboot-xbmcbuntu-crystalhd-hdmi-28256-R3.rar
http://stmlabs.com/resources/atv-usbboot-xbmcbuntu-crystalhd-hdmi-28256-R3.rar

On windows download USB Image Tool to load the image into your 4gb or great USB drive.
Download USB Image Tool Link
http://www.alexpage.de/download/usbit/usbit.zip

1. Extract USB Image Tool Onto A Folder on your Desktop
2. Open USB Image Tool.exe
3. In the dropdown menu select Device Mode
4. Click on your device on the left hand side
Image

I Reccomend you make an initial backup image of your Unmodified USB Drive incase something goes wrong and you have to restore it after you put the Linux image on it to make it useable again.

4a. Click the Backup button, enter a name for the backup of your USB Drive and save it to your desktop.

5. Click the restore button and select the Minimal ubuntu image (atv-usbboot-xbmcbuntu-crystalhd-hdmi-28256-R3.img) that you downloaded earlier. Let it image to your USB device, this may take some time.
6. Your Linux Apple TV USB Drive is ready.
7. Connect the patchstick to your Apple TV and power it on (unplug, plug)
8. Let it do it's thing (may take a few moments)
9. Once you are at the XBMC Home Screen you are ready to begin copying the USB Image to your Apple TV Hard Drive
10. Leave the Apple TV On the XBMC Home Screen During the Entire Process.
11. Download Putty.exe (SSH Client for windows) from http://the.earth.li/~sgtatham/putty/latest/x86/putty.exe
12. Open putty.exe and you will get the following screen
Image
13. Enter the IP Address of your Apple TV (You may have to look in your router Client list for this.
14. Click Open and you will get a command window saying "login as" enter xbmc for user and xbmc for password
so
xbmc
xbmc
15. If you logged in succesfully you should now have a window that looks like this
Image
16. You can continue following the instructions below.

Anything that is after a # sign are comments anything that DOES NOT start with a # is commands you have to enter in the putty SSH window. You can copy and right click paste them into the window. Whenever it asks for password remember its xbmc.

After entering a command do not continue to the next one until you have
"xbmc@appleTV:~$" indicating the previous command is finished. Some commands take time and will look like this while it is executing them
Image

Do NOT continue writing commands until it is done and the window looks like this:
Image

Each line is 1 command and must be entered by line. Some commands will ask for your input, such as do you want to continue, or some will ask you to press CTRL + O to save a file etc. Make sure you type "y" and press enter and CTRL + O + Enter and then CTRL + X to exit accordingly. You will see as you get to them.

################################################################################################################################################

#Copy Minimal Ubuntu to Apple TV Hard Drive. This will DELETE the Apple TV OS and leave ONLY the linux installation. Read ATV-BOOTLOADER page for instructions on backing up and restoring the original Apple TV OS and how to Restore if you didn't backup the Apple TV OS#

All the commands are inside command quotes line by line as you have to enter them into SSH, comments are outside the CODE marked with a #

#Zero Apple TV Hard Drive, This will Wipe All Partitions from the drive#
Code:
sudo dd if=/dev/zero of=/dev/sda bs=4096 count=1M

#Install Patched Parted, HFS Tools#
Code:
sudo apt-get install build-essential patch
wget [url]http://atv-bootloader.googlecode.com/files/hfs_support-1.0.tar.gz[/url]
tar -xzf hfs_support-1.0.tar.gz
cd hfs_support/
sudo ./build_diskdev_cmds.sh
sudo /usr/bin/apt-get remove parted
wget [url]http://atv-bootloader.googlecode.com/files/parted-1.8.8-atv.tar.gz[/url]
tar -xzf parted-1.8.8-atv.tar.gz
cd parted
#Read the Comment after this command#
Code:
nano ./install_parted.sh

###Scroll through the text and find the line that says "./configure --enable-static and change it to
Code:
./configure CFLAGS="-fgnu89-inline" --enable-static=yes"
, CTRL O to Write Out and then CTRL X to exit###

Code:
sudo ./install_parted.sh
sudo ln -s /usr/local/sbin/parted /sbin/parted

#Verify you have parted version 1.8.8 If yes continue, if anything else repeat steps from "Install Patched parted"#
Code:
parted --version


##Initiate GPT Partition##
Code:
sudo parted -s /dev/sda mklabel gpt

##Check Drive Names using parted print all##
Code:
sudo parted
print all
##Here Check that the Apple TV Hard Drive is named /dev/sda and that the USB Stick is /dev/sdb, all the commands below this are based on apple tv hard drive being /dev/sda and usb stick being /dev/sdb##
Image

#Once you verify the names quit parted with the following command
quit

#Clone USB Drive to Apple TV Hard Drive, This Clones the USB Drive and all partitions to the Internal Apple TV Hard Drive, This May take a few minutes#
Code:
sudo dd if=/dev/sdb of=/dev/sda bs=4096
reboot

#AFTER REBOOT the connection will close, close the putty window, check your TV, once its back to the XBMC Home Screen Re-Open putty and recconect using the same IP Address as before, user is the same as password (xbmc)#
Code:
sudo fsck.hfsplus /dev/sda2
sudo mkdir tmp
sudo mount /dev/sda2 tmp

#Read Comment after this command to know what to do#
Code:
sudo nano tmp/com.apple.Boot.plist

###Change the line near the bottom that says /dev/sdbX to /dev/sdaX, Just change the b to an a, leave the number the same. CTRL O + Enter to write out and CTRL X to exit###

Code:
reboot

###If you are not using the internal hard drive for storage you can stop now and remove the USB stick from the Apple TV, The apple tv will now boot from the hard drive and no longer needs the USB Stick. The Hard Drive will be recognized as a total of 4GB since we cloned it from the USB stick.

If you want all the space of your Apple TV Hard Drive LEAVE THE USB STICK PLUGGED IN and continue below after reboot, Close the putty window and re-open/reconnect using the same IP Address and user/password as before once its back to the XBMC Home Screen###

Code:
sudo parted
sudo select /dev/sda
#Parted will give you a message saying the GPT Partition table needs to be fixed, type "fix" and press enter#
#quit parted using below command#
Code:
quit
sudo swapoff /dev/sda4
sudo parted
sudo rm 3
sudo rm 4
quit


##We are not going to create new partitions using the full size of the hard drive and copy the files from the USB partitions into the corresponding hard drive partitions.
The Below Examples are for 40GB Hard Drives. If you have 60GB You would put 58.9GB and 60.0GB Accordingly. 160GB Hard Drive would me 158.9GB and 160.0GB etc etc the first command is always from 236m as that is where the 2nd partition (Recovery) ends. the end sector is 1.1GB less then your hard drive. The 2nd Commands Starts where the first command left off and the final sector is the final size of your hard drive as you can see below##

Code:
sudo parted -s /dev/sda mkpart primary ext3 236m 38.9GB
sudo cp /dev/sdb3 /dev/sda3
sudo parted -s /dev/sda mkpart primary linux-swap 38.9GB 40.0GB
sudo cp /dev/sdb4 /dev/sda4
reboot

#When the Apple TV Starts Rebooting wait until the screen turns black and remove the USB Drive and it should boot from the Internal Hard Drive and you will have the full size of your hard drive available to you for files, you can now also close putty or any other ssh terminal you are using#


- robertalison - 2010-11-25

thankyou so much "Bandit_Kaine" for you step bu step guid
can i use it on sams image


- illiac4 - 2010-11-25

Sam.Nazarko Wrote:@dietcokefiend: Thanks for the kind comments. Note that if you unplug the internal drive, the USB will no longer be /dev/sdb, and will be located at /dev/sda. You will therefore need to update com.apple.boot.plist on /dev/sdb1 and change the reference to /dev/sdb to /dev/sda for the mach kernel startup flags.



OK tnx but when i try to change the file and save it says read only system. I'm doing this in Salx live cd. What tool do you recommend to edit the content of file.
If i use vi editor it also says that the file system is read only.
Well i'm not really linux guy Smile but my ide cable went dead so i have to use usb to save the apple tv.


- haifischjunge - 2010-11-25

defiler Wrote:1) Eventually, badly. It *should* be able to pick itself up (I've certainly cut the power on mine a few times), but at some point it'll likely foo the FS in some ugly way. If you're switching it off, you're best to shut it down from the power icon on the left of the main menu. When it says "System Halted" you're good for powerdown.

I could tell create an shutdown action on my universal remote with telling xbmc to shutdown the computer and then (after a long wait) to pull the power Wink )

defiler Wrote:2) Generally that'll come down to the speed of the USB drive. It's been a while, but I'm sure I can get above 4MB/sec on SFTP. That's ~40Mb/sec on a 100Mb connection. If it's a USB2 HDD, it'll be waiting for the network. If it's a thumb drive, the network will be waiting for the drive. Generally.
4 MBs would already be great (under osx I get about 1.5 MBs). Maybe Samba would also allow better transfer speed.

I will sit and wait for my crystal hd to arrive and then have a look what I can squeeze out of the network. (because I want to use the network share for hd recordings from my dreambox)


- Bandit_Kaine - 2010-11-25

robertalison Wrote:thankyou so much "Bandit_Kaine" for you step bu step guid
can i use it on sams image

I'm not sure if it works on sam's full image, if it has the same number of partitions it will work all the way through. If it has different number of partitions the guide will only work up to where the internal drive stays at 4gb.


- JDizzy - 2010-11-25

Bandit_Kaine Wrote:I'm not sure if it works on sam's full image, if it has the same number of partitions it will work all the way through. If it has different number of partitions the guide will only work up to where the internal drive stays at 4gb.

Damn! I thought "I started with the minimal image, then updated to XBMC RC1, CrystalHD r174, and have my skin, database already configured, all on my stick."

Now, how easy it looks above to move it all onto the internal HD. Guess I'll hang loose for a while.....
Thanks


- /.ryd - 2010-11-26

Right, I'm pretty much losing my mind here. Someone PLEASE help.

I've redone pins image on a new USB drive, as the previous one was too slow.

I've managed to update the version of xbmc, I've got the new CrystalHD drivers on there, I've even got the SMB connection working.

But I can't seem to get the xorg.conf file updated to enable component video out, which means it's all for nothing, as I can't get the bugger to work on my TV set!

Every time I try to save the revised file, I get told I don't have adequate permission.

The weird thing is that I managed this when I was setting up the previous USB drive.

I just can't figure out what I'm doing wrong.

Can someone give me step by step instructions as to how to update that file using a mac?

Please, I'm desperate!


- w00dst0ck - 2010-11-26

/.ryd Wrote:Every time I try to save the revised file, I get told I don't have adequate permission.

Do you use sudo to edit the configuration file?

#sudo vi conf.file


- jelleeelco - 2010-11-26

I had the same issue; below instructions from Sam worked for me (using Linux though):

Sam.Nazarko Wrote:Okay, put the USB in:

First unmount Recovery as it will automount

Code:
sudo umount /dev/sdXn

where X is device letter, n is disk number. Most likely B, 1

Next, fsck.hfsplus the volume:

Code:
fsck.hfsplus /dev/sdXn

Now, force the drive to mount with r/w

Code:
mkdir mnt
mount -t hfsplus -o rw /dev/sdXn mnt

Next edit the com.apple.boot.plist

Code:
cd mnt
sudo nano com.apple.boot.plist

Done - so now you clean up

Code:
cd
sudo umount /dev/sdXn
rm -rf mnt

Problem should be solved. Try not to post in two threads with the same problem next time. Let me know how it goes.



Resizing internal disk - moonwalker - 2010-11-26

Bandit_Kaine Wrote:When the Apple TV Starts Rebooting wait until the screen turns black and remove the USB Drive and it should boot from the Internal Hard Drive and you will have the full size of your hard drive available to you for files,

Very good tutorial! Thank you! All worked well!
But I had to use the next two commands too to make it all happen on my internal drive.

resize2fs /dev/sda3
tune2fs -j /dev/sda3

Regards


- maartenst - 2010-11-26

maartenst Wrote:I have problems running some movies after installing and updating pin's image on an external usb harddisk.
I updated the chd drivers to r174 (autoconf, configure, make, make install), and updated the xbmc debs by downloading them from a site and installing the following packages:

xbmc_10.00~svn35326-hardy1_all.deb
xbmc-bin_10.00~svn35326-hardy1_i386.deb
xbmc-data_10.00~svn35326-hardy1_all.deb
xbmc-skin-confluence_10.00~svn35326-hardy1_all.deb

I also ran apt-get update ; apt-get upgrade;

The output from xbmc.log is here:

http://pastebin.com/vXekE1Bd

in reply to my own post:
somehow (some of the?) not working movies seem to work after trying it several times...odd..


- brddd - 2010-11-26

Thanks to everyone for providing tons of info in this thread. I've been trying to solve a problem with my installation and will try a few things.

I'm running:

Ubuntu Hardy -- installed by me (before I knew there was an image available)
xbmc 2:10.00~svn35326-hardy1
crystalhd r171 (was the latest version at the time)

Based on what I've read here, people seem to like crystalhd r156.

I'm experiencing issues with 720p playback, that after the initial 5 seconds or so of syncing issues, all plays well until I pause the video. Then it has a hard time catching up after resuming. Also in scene changes from TV shows where the commericals were removed, there are brief video/audio sync issues.

I have never been successful with 1080p H.264 content.

I'm going to try r156 to see if that makes a difference, although I see some claim success with r174 too.

At the time, Ubuntu 8.0.4 was recommended, but it seems like people are using Ubuntu 9 now. Are there any known issues with 8.0.4?

What is the recommended stable crystalhd driver? How can I tell if my crystalhd board is the old layout? (or does it matter?)

Thanks


- xpo_dk - 2010-11-26

Hi there,

I've just installed the file from the first page of this - and it rocks! Thanks a lot!

Only thing I can't figure out is why XBMC suddentley is so slow loading movies. In macOS XBMC load a movie in seconds - now we're talking 4-5 minutes...

My movies is stored on a timecapsule - everything is connected "with wire"...

Any ideas?

Thanks a lot for this cool thing!!!!