Installing Linux & OSX on a MAC Mini System by [[StephenDavies]]

This article is a result of my experiences and nothing else. There are probably better ways to do some things but I didn't find them or failed to get them to work.

The task was to install both OSX & Linux on a Mac Mini system.

The Mini came with OSX 10.3 already installed as it was one I won on an Ebay auction. So, my first exercise was to remove the existing OSX installation and look at how its inbuilt partitioning will work. Ar first, it seemed to be pretty straightforward using the GUI to partition the 80GB HDD. The following statement might be slightly controversial. I soon found that there are some fundamental issues that make what Apple has done with their fork of BSD and what we are used to with Linux and even Windows that make the partition tables written on OSX unable to be read by conventional Linux utilities such as FDISK. After going round the loop of installing Linux & OSX and the Linux again I got wise to these inconsistancies and found a way to install everything so I could dual boot into Fedora Core 4 and OSX 10.4 (Another Ebay purchase) This was not the end of my troubles and there is one issue that I have yet to be able to solve. More about that later.

Tools

I used the following items to complete this.

  1. Apple OSX 10.4 (Tiger)
  2. Fedora Core 4 for PPC
  3. Ubuntu 5.10 Live on CD
  4. Apple Wireless Mouse & Keyboard

  5. PC Style USB Keyboard & USB Mouse

Disk Partitioning

After my initial failures to get a partition table that was readable by both OSX & Fedora Installers I turned to Ubuntu Live and after booting it, I used parted to initialise a clean partition map. If you create a partition map using FDISK on FC4 or Ununtu it is unreadable by OSX & the FC4 Installer Anaconda. The latter will actually throw a real wobbly when in tries to read the disk layout. On the reverse, once a partition map has been created using “parted”, some “fdisk” implementations can't read it. It actually reports that there is nothing on the disk and the map is actually empty.

One thing the differs on the PPC architecture is that the has to be an extra partition to contain the yaboot secondary boot loaded used on PPC Systems.

The Ubuntu fdisk reports the following partitions:

/dev/hda
{{{
        #                    type name                  length   base      ( size )  system
/dev/hda1     Apple_partition_map Apple                     63 @ 1         ( 31.5k)  Partition map
/dev/hda2                         untitled            33554433 @ 64        ( 16.0G)  Unknown
/dev/hda3                         untitled             2097153 @ 33554497  (  1.0G)  Unknown
/dev/hda4                         untitled            87091201 @ 35651650  ( 41.5G)  Unknown
/dev/hda5                         untitled            33553534 @ 122742851 ( 16.0G)  Unknown
/dev/hda6              Apple_Free Extra                   5103 @ 156296385 (  2.5M)  Free space

}}}

While Parted on FC4 reports the following:

Disk geometry for /dev/hda 0.000-76319.085 megabytes
Disk label type: mac
Minor      Start          End     Filesystem  Name                   Flags
1            0.000         0.031              Apple
2            0.031     16384.031 ext3         untitled
3        16384.032     17408.032 linux-swap   untitled
4        17408.032     59933.032 fat32        untitled
5        59933.033     76316.594 hfs+         untitled
6        76316.594     76319.085 hfs          untitled               boot 

If you look at the above partition maps, you can get a picture of the layout I implemented.

hda1    used for the apple bootstrap 
hda2    root filesystem for FC4
hda3    swap space for FC4
hda4    fat32 partition for sharing files between OSX & Linux
hda5    hfs+ filesystem for OSX 10.4
hda6    yaboot bootstrap partition 

If I had to do this again, I would do it slightly differently. I would make the shared partition smaller (4GB) and have an ext3 filesystem using the rest.

The parted application has an option to inititalse the apple partition map and create the base map and the hda1 filesystem. I then used parted to create the remaining partitions and wrote the new map back to disk.

Installing FC4

The first thing to say is that FC4 for PPC is 99% identical to the FC4 release for x86 architectures. The only real differences are under the hood and handles things like installing yaboot instead of LILO or Grub.

The Mac Mini is not quite a standard PPC system. If you boot FC4 from CD1, the graphical version of Anaconda that uses “X” will not work. You get a white rectangular box with the text in red saying “Input Not Supported” appearing on the screen. It moves around thereafter. I was using an AOC LCD screen so after a bit of googleing, I found the additional kernel option I needed to apply to get Anaconda to work. At the boot prompt, type:-

boot: linux resolution=1024x768

You can then install FC4 exactly in the same way as you would on an X86 system. Don't delete any partitions, just reformat them as appropriate.

At the end of the installation, reboot into FC4. On a Mac Mini, /etc/inittab will be configured to goto runlevel 5 and thus automatically start X. It won't work OOTB. So, either boot it into single user mode and edit /etc/inittab to change the runlevel to 3 (its at line 53 in the file) or ssh into the system after boot from another system and do the change that way.

I will cover getting X to work later in this artccle.

Now that you have a basic FC4 system running, you can updated it using “yum” from the command line. After rebooting you can turn your attention to OSX.

Installing OSX

Reboot the system and after inserting the OSX DVD hold down the “C” key on the keyboard and eventually, OSX will boot up. Proceed through a few screens to the point where you have to choose a disk/partition to install OSX to. The main section of the installer display will be empty indicating that you have no suitable partitions avaiable. From the toolbar, start the disk utility. Select the 16Gb partition and ERASE it after setting the format to Apple HFS Journalled. (Not Case Sensitive). Once this is done, quit the disk utility and the installer partition selection will show the freshly formatted partition. Select this with the mouse and proceed to install OSX.

After rebooting, verify that it all works ok and then apply the OSX Updates.

When you reboot this time, you will see a new option screen. It contains two main graphical icons that signify the two different operating system that are installed on the system

One Icon has the Apple OSX “X” and the other has a nice “Penguin” that naturally enough identifies the FC4 installation.

Reboot into the OS of your choice.

Understanding the Apple Boot partition (/dev/hda6)

This is where yaboot resides after a “yabootconfig” command has run. It is a small hfs formatted partition of less than 1Mb in size. You can mount it by using the mount command in the following way. I think this is a neat little tip and makes yaboot as easily configurable as grub!

  1. mount -t auto /dev/hda6 /mnt/hda6

In the filesystem just mounted, there is the “yaboot.conf” file. It is easily editable and this is what I did to get the kernel options correct for X (see below). If you do edit it in this manner, be sure to copy it back to /etc/yaboot.conf after you are done or the next kernel upgrade will wipe it away! YOU HAVE BEEN WARNED!

Getting Xorg to work on FC4.

As I indicated earlier, OOTB, it won't work. There are two reasons for this.

  1. The /etc/X11/xorg.conf file is wrongly generated

  2. The 2.6.* kernel is started by default with incorrect options.

So, to get “X11” to work both have to be corrected.

2.6.* Kernel Boot Options

The lack of these are identified by the warning message “Input Not Supported” as described above. There are many references to this issue available via google but it took a while before I found the missing key. I experimented with various stanzas in yaboot.conf to try different options. Here is what worked for me:

image/boot/vmlinuz-2.6.14-1.1637_FC4
        label=Radeon
        read-only
        initrd=/boot/initrd-2.6.14-1.1637_FC4.img
        append=”video=radeonfb resolution=1024x768 rhgb quiet root=LABEL=/”

The key points seem to be setting the video type (video=radeon) and the resolution.

I then rebooted to this stanza and then tried to fix the next part of the problem.

xorg.conf options

There are literally dozens of different options that can be put into this file and if you have ever played with it before, you will know only too well, how easy it is to get a version that won't work at all. So care and making all your version numbered sequentially will go some way to avoid problems.

I looked at an FC4 installation on an x86 system that also used an ATI graphics card. Just copying this over didn't work (before anyone asks). The problems I identified in the generated xorg.conf were as follows:-

  1. Had non existent directories in the fontpath
  2. Used an invalid device name for the mouse
  3. Used an invalid vendor name for the videocard
  4. Used a PCI bus address that was incorrectly specified (mixed up hex & decimal)

As you can see, the problems were varied and many. It took several hours to get this file in a state where X would actually startup. Most of the issues were solved using the /var/log/Xorg.log.0 and comparing its contents to the working X86 system with the ATI Card. I know there are some things missing from the working xorg.conf that I will eventually get around to including in my working version. I have included my current /etc/X11/xorg.conf at the end of this document.

Conclusions

After a lot of trial and error, I have a working system however there are some things that don't work. These are:

  1. Apple wireless(bluetooth) mice & keyboards. Fine for OSX but don't easily work on Linux. I have not tried very hard to get bluetooth enabled but I know you can;t used it at boot time to select a kernel etc. You need to have a wired keyboard for this.

  2. Apple Airport WLAN. This uses a Broadcomm chip and therefore has no Linux support. Its on my list to try using ndiswrapper to get it going using the windows driver. My Dell 8600 laptop had a Dell1300 WLAN adapter. This uses an almost identical Broadcomm chip so I'm hopefull that it will work.
  3. I have a “Lacie Mini 250GB HDD” that nicely matched the Mini in size & style. Works fine on OSX & Windows but fails miserably to connect over firewire on Linux. It does get recognised when connected but thats as far as it goes. The output from dmesg is as follows:

ieee1394: Node Resumed: ID:BUS[0-00:1023] GUID[00d04b5a110b1c24]
scsi1 : SCSI emulation for IEEE-1394 SBP-2 Devices
ieee1394: sbp2: Logged into SBP-2 device
ieee1394: Node 0-00:1023: Max Speed [S400] – Max payload [2048]
{{{
  Vendor: Maxtor 6  Model: L250R0               Rev:BAH4
  Type:   Direct-Access-RBC             ANSI SCSI Revision 04
Attached scsi generic sg0 at scsi, channel 0, id 0, lun 0, type 14

If anyone knows how I can proceed from there I would be most greatful.

  1. I have to get Samba working like it is OOTB on OSX but that is a matter of time & patience.

}}}

The purpose of this system is to be a repository for all that useful stuff you find on a daily basis and think “I need to remember that”. I'm installing the mediawiki software on it and will also use it an an FTP & NFS Server for other various things that I use quite often. If I can get the 250Gb disk working then I'll index all my 30,000+ digital images on it. As its firewire I can daisy chain another one as well if needed.

Overall, the Mini is going to be a useful system. I intend to put it up on my comms rack and sit alongside my Wifi router etc. It is very quiet indeed.

LinuxHints/MacMini (last edited 2011-05-16 20:25:05 by AdamTrickett)