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)



- Scott B - 2010-08-17

tooshna Wrote:Well as you know I am not very knowledgeable when it comes to linux and coding etc. This is why it would have been helpful for someone to give me step by step instructions from the beginning instead of giving me bits and pieces of information and then trying to put them together through trial and error to get the system to work. It would have saved a lot of time and effort. Its not that I don't appreciate everyone's help and technical expertise, I do. I just think it would be more helpful if there was a straight forward step by step guide to doing this. The first post in this thread assumes you have knowledge of the linux system and how to navigate it. If a guide was created I think it would benefit a lot of people, not just myself.

It sounds like you have a new project! We all appreciate it when fellow tinkerers post up guides giving everyone all the shortcuts.


Performance? - oconnellc - 2010-08-17

Hello all, I currently have xbmc running on an old mac mini and performance is ok with sd rips, any skin other than the old project mayhem is pretty laggy and I can't even think about playing blue ray rips (as .ts). So, I just found this thread and this seems like it might be the thing, as they say. So, can someone who has an atv and is running it using this solution comment on the overall performance of things? How do blue ray rips play? Any stuttering? Dropped frames? General problems?

I'm sorry if this seems like me being lazy and not bothering to read the thread. I admit, it is. I just can't bring myself to commit to reading all 80 or 90 pages of comments without first checking to see if someone out there can give me an idea of it is all really worth the trouble. If a few kind souls would comment with their experiences, I would really appreciate it and would let me know if a project like this is worth throwing my little remaining free time at (5 week old daughter, so hours spent tinkering are few and far between).

Thanks,
Chris


- Sam.Nazarko - 2010-08-17

@tooshna: http://wiki.xbmc.org/index.php?title=HOW-TO_install_a_Miminal_Ubuntu_and_XBMC_with_sound_over_HDMI_on_the_AppleTV


- defiler - 2010-08-17

oconnellc Wrote:Hello all, I currently have xbmc running on an old mac mini and performance is ok with sd rips, any skin other than the old project mayhem is pretty laggy and I can't even think about playing blue ray rips (as .ts). So, I just found this thread and this seems like it might be the thing, as they say. So, can someone who has an atv and is running it using this solution comment on the overall performance of things? How do blue ray rips play? Any stuttering? Dropped frames? General problems?

Okay - this took about 5 minutes to find:
http://forum.xbmc.org/showpost.php?p=548148&postcount=82

But of course that only answers part of your question.

Don't know what it'll be like on the Mac Mini, but the AppleTV is a 1GHz P3 processor with 256MB of RAM. Running XBMC on the ATV OS is a painful lesson in memory usage - there's just not enough free RAM to run HD content (in my opinion). By getting rid of the guff, and booting a minimal OS with just what XBMC needs, you stand to gain by:

1) Freeing up precious memory
2) Having full access to the video API (although Apple just recently opened theirs, finally)

With the ATV + CrystalHD card, using one of these minimal installs, HD playback is quite feasible. There are still some bugs being worked on (it's still pre-release software after all), and for me that's causing problems with VC1 playback. Other than that, H.264 video plays nicely. You'll get a few dropped frames when you first start up, but that's generally just swapping stuff out to disk to free up RAM.

The SVN builds are getting better all the time, and the i386/Hardy debs drop straight into these USB images. For my money it's worth trying it out. Don't know if the image will work on a Mac Mini rather than ATV, but for the cost of mucking about with a flash drive for an hour, it's worth a shot.

Here's my quick-and-dirty guide to getting started with it:
http://forum.xbmc.org/showpost.php?p=566887&postcount=624

Wry chuckle at your free time... Congrats on the daughter, but you should try twins! And wait until she's crawling - then you're in a world of trouble! Ah - new parents. So young and naive! Wink


- tooshna - 2010-08-17

Philmatic Wrote:There is, it's called dd. All you need is a atv-boot enabled thumb-drive, and a second thumb-drive with JUST the IMG file on it, NOT A RESTORED VERSION OF THE IMAGE. It should literally be pin87a's IMG file on the root of a thumb-drive.

Then you need to mount the thumb-drive with the IMG file and cd into the directory, the following should then work.

Code:
sudo dd if=atv-usbboot-xbmcbuntu-crystalhd-hdmi-28256-R3.rar of=/dev/sda
Then when you're done, change the com.apple.Boot.plist parameter to /dev/sda3 and reboot. You should be golden...

This is all well and good and what I am trying to achieve, however if someone could tell me the exact code i need to mount the thumb with the img and cd into the directory it would be appreciated. To avoid any mix ups here is what is on each sd* http://img64.imageshack.us/img64/2232/photopa.jpg

EDIT: How do I install plugins like youtube? Is it just a matter of downloading the SVN repo installer and ssh the repo files to the correct folder?


- defiler - 2010-08-17

tooshna Wrote:This is all well and good and what I am trying to achieve, however if someone could tell me the exact code i need to mount the thumb with the img and cd into the directory it would be appreciated. To avoid any mix ups here is what is on each sd* http://img64.imageshack.us/img64/2232/photopa.jpg

EDIT: How do I install plugins like youtube? Is it just a matter of downloading the SVN repo installer and ssh the repo files to the correct folder?

What might be simpler (since you're only wanting the image as a file on an existing drive) is just to pop it onto your external USB drive (which looking at your photo there is /dev/sdc2, already mounting on /media/MediaHD) using your regular computer. Once the image is on, pop the USB drive back into your ATV and reboot it. It should pick up the drive and remount it as before.

If you want to install the image onto another drive, then, you just have to enter:

Code:
sudo dd if=/media/MediaHD/atv-usbboot-xbmcbuntu-crystalhd-hdmi-28256-R3.rar of=/dev/sd* bs=16384

Make sure the of=/dev/sd* points to the particular sd you want to overwrite. You'll bin the contents of that drive and put the Ubuntu image onto it. Looking at your photo (and assuming you have a 160GB ATV) /dev/sda is the internal drive, so only use /dev/sda if you want to overwrite the contents of your internal drive - it won't be able to run as a regular AppleTV after this.

If you're not sure which sd you want to install the image to (and it's a USB device), start up the ATV without the target drive plugged in, connect via an SSH session, and enter the following command:

Code:
tail -f /var/log/dmesg

Then when you plug in the target USB drive, your SSH session will display the registration of the drive, and the storage device assignment. Then just replace the "of=" section of the dd command with the correct device.

Adding "bs=16384" on the end of the command means it'll write 16k blocks at a time. This will be faster, and beat up your target drive a lot less.

As for plugins - I don't know. Not tried them.


- tooshna - 2010-08-17

defiler Wrote:What might be simpler (since you're only wanting the image as a file on an existing drive) is just to pop it onto your external USB drive (which looking at your photo there is /dev/sdc2, already mounting on /media/MediaHD) using your regular computer. Once the image is on, pop the USB drive back into your ATV and reboot it. It should pick up the drive and remount it as before.


Thanks defiler, I think what you've said is simpler and should work. Just to clarify, Am I simply copying the .img file to the media hd drive or am I writing the .img file to media hd with dd command? The problem if it is the latter is that all my movies are on that hard drive, although I guess I could partition the drive and split it into 2 and make a 4gb partition to copy the image to. I wouldn't have to format the whole drive to create two partitions would I?


- davilla - 2010-08-17

oconnellc Wrote:Hello all, I currently have xbmc running on an old mac mini and performance is ok with sd rips, any skin other than the old project mayhem is pretty laggy and I can't even think about playing blue ray rips (as .ts). So, I just found this thread and this seems like it might be the thing, as they say. So, can someone who has an atv and is running it using this solution comment on the overall performance of things? How do blue ray rips play? Any stuttering? Dropped frames? General problems?

I'm sorry if this seems like me being lazy and not bothering to read the thread. I admit, it is. I just can't bring myself to commit to reading all 80 or 90 pages of comments without first checking to see if someone out there can give me an idea of it is all really worth the trouble. If a few kind souls would comment with their experiences, I would really appreciate it and would let me know if a project like this is worth throwing my little remaining free time at (5 week old daughter, so hours spent tinkering are few and far between).

Thanks,
Chris

Drop a CrystalHD card in place of the internal wifi card and enjoy playback of raw decrypted bluray rips under OSX. My dev box is a 1.6GHz CoreDuo MacMini, it does not break a sweat under this setup.


- defiler - 2010-08-17

tooshna Wrote:Thanks defiler, I think what you've said is simpler and should work. Just to clarify, Am I simply copying the .img file to the media hd drive or am I writing the .img file to media hd with dd command? The problem if it is the latter is that all my movies are on that hard drive, although I guess I could partition the drive and split it into 2 and make a 4gb partition to copy the image to. I wouldn't have to format the whole drive to create two partitions would I?

You're just copying the image onto the drive as a staging point before writing it to a flash drive. The first half-dozen blocks on the image are the partition table for the drive, so it'll define the size and shape of the whole drive. Partitioning your media drive to create an extra partition for the image, and then dding it will *not* work, and it'll wipe your media drive. That's why you *must* be careful with the destination drive, and that's why the drive you're dding the image to *must* be a separate physical drive.

Because the image will destroy the whole partition table on the destination device, whichever drive you write it to will be truncated to 4GB, and you won't be able to use parted to allocate the extra space without a lot of fannying about. (By fannying about I mean writing down the partition map, in bytes, overwriting the first 3 blocks of the drive with zeros, and then using parted to put the partition table back before allocating the remaining space.)


- davilla - 2010-08-17

defiler Wrote:Because the image will destroy the whole partition table on the destination device, whichever drive you write it to will be truncated to 4GB, and you won't be able to use parted to allocate the extra space without a lot of fannying about. (By fannying about I mean writing down the partition map, in bytes, overwriting the first 3 blocks of the drive with zeros, and then using parted to put the partition table back before allocating the remaining space.)

Not really true, this is GPT partitions not the other kind. You can easily expand a partition by deleting it and then adding back a larger one that starts at the same sector number. When you delete a partition, the contents are unchanged so when you add it back, as long as it starts at the same sector number, the original contents are preserved. The real question is if the file system at this partition will see the increased size or not. I suspect not.

OSX's gpt can resize partitions (grow or shrink) while preserving the contents and I seem to remember seeing something about Linux tools that can do the same thing.


- Sam.Nazarko - 2010-08-18

Similar routine:

http://ubuntuforums.org/showpost.php?p=8721017&postcount=3


- tooshna - 2010-08-18

Thanks for your reply Defiler, I think what you're describing I have already done though. I have the image written to a usb inserted into the ATV, what I wanted to do was copy it over to the internal drive. But I didn't know the code to do so. What I know and understand so far.

I have to copy the img file to a usb thumb, not write it with the dd command. Then I have to boot up the atv with a patchstick inserted, the second i see the penguin i insert the other usb with the .img file on it. Then log in as root/root.

Mount the usb drive, cd into the directory (this is the part where i dont know what to do) and then dd the .img file over using the following
Code:
sudo dd if=xbmc-r28256-crystalHD-1.0.3-alsa-1.019-nvidia100.14.19-hardy-cust_machkernel-2.6.24.27.img of=/dev/sda

P.S Sam how do you get add ons with your image? I have searched this topic but cant find an answer. Mainly just want youtube plugin and possibly firefox. And also add the imdb scraper.


Losing settings - DrDardis - 2010-08-18

Hi Guys,

This works great, awesome work!

I am using pin87a's image. The only issue I am running into is that upon restart of xbmc, my setting are nixed. All system setting and skin settings are back to default. It is as if they are not being written to the usb drive. Interestingly enough, the sources remain, but that is it.

I am unsure where to get meaningful information from xbmc/ubuntu to add to this post as well, any suggestions? Not looking to be spoonfed, but I am stumped...

Apple is restored and unpatched, with broadcom chip. Usb is Corsair 8gb. runs smooth apart from this issue

Thanks for any suggestions!


- defiler - 2010-08-18

Right, Tooshna. Let's see if I've got this right:

1) You have your ATV with the internal drive that you're happy to wipe because XBMC is clearly superior to Frontrow, and getting better every other day.
2) You have your external drive with all your media on it.
3) You have your ATV booting up from a USB flash drive already.
4) You've copied the image file to your external media drive, and the file's just sitting there at the top folder of the drive, amongst your movies.
5) When you start up into XBMC and check your available drives, you get the drives listed in your photo, mounted exactly as you showed.
6) You've moved all your media off the internal drive because you know it's going to be wiped.
7) You have a backup of the internal drive (in case you want to revert) or you really don't care about going back.

If you can say "yes" to all of those, ssh into the machine while it's running XBMC from the flash drive and enter the following:

Code:
sudo umount /media/pata
sudo dd if=/media/MediaHD/atv-usbboot-xbmcbuntu-crystalhd-hdmi-28256-R3.rar of=/dev/sda bs=16384

That'll put the XBMCbuntu image onto your internal drive. Then you need to edit the boot.plist. As liquidinsect said here:

Quote:-Back in SSH run:
sudo fsck.hfsplus /dev/sda2
sudo mount /dev/sda2 /mnt
sudo nano /mnt/com.apple.boot.plist

-Change the entry with /dev/sdb3 to /dev/sda3

-Remove the USB stick and reboot. You should be running completely off HDD now. If you have problems (like I did) try running dd if=/dev/zero of=/dev/sda to blow away any partitions that may have been on the drive previous and start the whole process over. Good luck.

When you want to expand your partitions, the instructions Sam linked to are pretty close, but the problemgpt being clever. Fdisk keeps the old-style partition table in sector 0 of the drive, and that's the only place. GPT keeps a dummy table in sector 0, and the GPT table spans at least the next couple of sectors. Fair enough. But it *also* keeps a backup copy on the last couple of sectors in case you're foolish enough to wipe the start of the drive.

Parted (on Pin's image at least) throws a strop when you try to use it because it's got a bug (quite an old version) and can't handle the fact that the table says 4GB, the drive says 40/160GB, and there's no backup GPT at the end. So you need to write over the fdisk table (sector 0) and the start of the GPT table (sectors 1 and 2) in order to convince it that it's a blank drive.

So long as you took a note of the partition layout (either in bytes, or as Sam says in sectors), you can put the same table back in again (by hand) and parted will create (1) the GPT table from sector 1, (2) the dummy fdisk table at sector 0, and (3) the GPT backup table at the end.

Once you have that, you can swapoff the swap drive, delete it, extend the ext3 partition (via Sam's link), making sure to leave yourself 1GB at the end, re-add the swap partition on the end of the drive, swapon the swap drive again, and finally resize2fs the ext3 drive to activate the extra space. Phew!


- tooshna - 2010-08-18

defiler Wrote:Right, Tooshna. Let's see if I've got this right:

1) You have your ATV with the internal drive that you're happy to wipe because XBMC is clearly superior to Frontrow, and getting better every other day.
2) You have your external drive with all your media on it.
3) You have your ATV booting up from a USB flash drive already.
4) You've copied the image file to your external media drive, and the file's just sitting there at the top folder of the drive, amongst your movies.
5) When you start up into XBMC and check your available drives, you get the drives listed in your photo, mounted exactly as you showed.
6) You've moved all your media off the internal drive because you know it's going to be wiped.
7) You have a backup of the internal drive (in case you want to revert) or you really don't care about going back.

If you can say "yes" to all of those, ssh into the machine while it's running XBMC from the flash drive and enter the following:

Code:
sudo umount /media/pata
sudo dd if=/media/MediaHD/atv-usbboot-xbmcbuntu-crystalhd-hdmi-28256-R3.rar of=/dev/sda bs=16384

That'll put the XBMCbuntu image onto your internal drive. Then you need to edit the boot.plist. As liquidinsect said here:

Much appreciated mate. I will try this soon!