Thursday, November 21, 2013

CentOS 6 on Apple hardware

I don't know how long Apple have been using intel hardware. I have never owned or used any and I know pretty much nothing about OS-X.

Inevitably, a user asked me if they could have Linux on the their mac. They have both a MacBook Pro and in iMac. I said I would look into it and my findings are listed below.

There are two main areas which cause trouble installing on to Mac hardware, drivers and booting. Drivers is relatively easy. Most hardware is supported by recent OS versions. Booting is much more complex. UEFI, GPT, 64bit support, bootcamp and rEFIt are all intentionally shrouded in mystery and made unnecessarily complex.

The aim is to leave a working OS X install for admin tasks but boot into linux for every day use. The starting point is a working OS X install with GPT partitioning.

MacBook Pro 7,1 (13-inch, Mid 2010)

Status: Not Supported

The Nvidia MCP89 is not supported. This means no hard disks to install onto.
There are a number of setpci commands floating around the internet which promise to activate the chipset as an AHCI controller. None of the commands I tried could get this to work.

Some other observations:
CentOS 6 UEFI boot did not work. The GRUB menu works but it will not boot any entries. Escape will return you to the menu. Entering quit on the command line will take you back to the OSX boot environment (I was using rEFIt).

I wanted to use our corporate PXE boot environment. I burned an iPXE boot CD which worked once. It successfully booted into pxelinux and booted CentOS-6 installer. After the initial success, I could not get it to work ever again. It would lock up after prompting to press ^B.

iMac 27"

Status: Supported (using bootcamp and rEFIt)

Installation was a bit involved and seems to vary depending on the current version of OS X and bootcamp. The procedure was:
  • Boot into OSX
  • Install rEFIt (not rEFInd) (and reboot two times to activate)
  • Run bootcamp (because we will not use EFI booting)
  • Create a fat32 filesystem to keep bootcamp happy
  • Boot off a CentOS-6 CD
  • Remove the fat32 partition
  • Create a /boot partition (/dev/sda3)
  • Create a LVM partition (/dev/sda4)
  • Select /dev/sda as the boot loader location
  • Complete the install and reboot
  • Boot into the CD rescue mode
  • open a shell
  • chroot /mnt/sysimage
  • grub-install /dev/sda
  • parted /dev/sda
  • toggle 3 legacy boot
  • quit
  • exit
  • exit
  • reboot
  • Open rEFIt partition tool
  • Synchronise partition tables
  • Boot linux from rEFIt
  • Install ATI binary video drivers
  • Done

iMac 7,1 (20-inch, Mid 2007)

Status: Supported (using rEFIt)

Installation was done using our PXE network install. Substituting a CentOS Install CD for iPXE would presumably also work.
  • Boot into OSX
  • Install rEFIt (and reboot two times to activate)
  • Boot into OSX
  • Run the Disk Utility
  • 'Partition' the disk and change the size of 'Macintosh HD' to make room for linux (I used 50Gig)
  • Download iPXE and burn to CD
  • Reboot into rEFIt
  • Boot of iPXE CD (by selecting the CD icon from rEFIt)
  • PXE boot into the CentOS-6 installer
  • Select 'Use free space'
  • Install boot loader to /dev/sda
  • Complete the install and reboot
  • Reboot into CentOS rescue mode
  • open a shell and run these commands:
  • chroot /mnt/sysimage
  • grub-install /dev/sda (probably not needed if grub was installed to /dev/sda during the install)
  • parted /dev/sda
  • toggle 3 legacy boot
  • quit
  • yum update (there seems to be a bug in the kernel/initd shipped with 6.4 where a fresh install can't find the hard disk. Fixed with an update)
  • exit
  • exit
  • reboot
  • Open rEFIt partition tool
  • Synchronise partition tables
  • Boot linux from rEFIt
  • ATI binary video drivers are not compatable
  • Done

Conclusion

It is possible to run CentOS on your Mac. The procedure is complex and unpredictable.

I will update this page if I identify any ways to simplify the process.

Friday, November 1, 2013

XBMC on CentOS 6

After years of putting it off I have finally taken the plunge into XBMC.

My plan is to hook it up as a front end for the Digital ORB pvr.

RpmFusion have packages for XBMC version 11 for CentOS 6. This is a good start as many of the audio & video packages from RpmForge (which I am sure most CentOS 6 users have) are too old for XBMC.

Unfortunately there is no package for XBMC version 12 which apparently has much better pvr support. The bug database entry suggested that it would be relatively easy to fix... and it was https://bugzilla.rpmfusion.org/show_bug.cgi?id=2699

So now I have a relatively stable base to start my integration. Lets hope that I get it working before XBMC version 13 comes out and changes everything again.

If you want to run XBMC yourself, you will need my xbmc and taglib packages from http://www.chrysocome.net/downloads and any dependencies from rpmfusion and epel.

You can also get the Digital ORB from my downloads directory. It does come with instructions but has not been widely tested yet. Stay tuned.