Search:  
Gentoo Wiki

Apple_Mac_Pro

This article is part of the Hardware series.
Laptops TV Tuner Cards Wireless Servers Storage Other Hardware Motherboards Related

Contents

Gentoo MacPro HOWTO

Foreword

This page is about the Apple Mac Pro workstation. See Apple MacBook Pro for the laptop computer.

Introduction

This will be a complete system users guide for Gentoo on MacPro desktops. Not every part is complete, so bear with us, or even better help contribute if you can. Please note many parts were copies from the MacBook wiki page, and updates on what is relevant to the MacPro system are appreciated. Enjoy!

Disclaimer

First, this article started off as a direct copy of the MacBook HOWTO. There are numerous inaccuracies in this article; however, it is coming along nicely. You've been forewarned.

Currently MacPro support is quite unstable, if you have a sony dvdrom, there are reports of this booting up correctly with gentoo. If you have a Pioneer dvdrom, the current drivers have problems with the emulated bios drivers for the cdrom. Please do the following:

  1. burn the amd64 iso image to a hardware partition (or USB drive)
  2. burn the amd64 iso image to a cd
  3. boot off the cd
  4. the computer will be tricked into using the hardware partition image

Or simply boot off an external usb cd/dvd drive.

Contributors

Installation

So, you've decided you want to install Gentoo on your intel Mac. While the move to Intel has simplified some parts of installing Gentoo, the use of EFI-based GPT partitioning and relatively new hardware has complicated others. So keep in mind that this is still a work in progress!

First Things First

First, there are some things you have to do in OSX to get started:

Install Boot Camp

Install rEFIt

rEFIt is a great tool that lets you multiboot your system much more effectively than Boot Camp and also gives you access to important EFI tools ( EFI shell, open source EFI tools, etc. )

mv ~/Desktop/efi /
cd /efi/refit
sudo ./enable.sh

Burn your ISOs

cd ~/Desktop
hdiutil burn gentoo-<version>-.iso

Note: The current version of the Gentoo amd64 live-cd (as well as many other live-cds) might not work on your new MacPro. If this is the case, look out for a live-cd with a rather new Linux kernel, like 2.6.22. The cd that finally worked for me, and that I used to install Gentoo, was the OpenSuse live-cd.

Note: The Gentoo amd64 live-cd 2008.0-r1 boots the 2008 edition of Mac Pro with Intel Xeon E5426 CPUs (Quad Core) without any problems.

Partitioning

At the moment, it seems there are two options for partitioning your Mac Pro: the OS X/Gentoo Linux option, and the OS X/Windows/Gentoo Linux option. (Single-booting just Gentoo Linux might be an option but it is currently not recommended as firmware updates [which are likely] will likely be .dmg files containing Mac OS X binaries.)

Gentoo Linux and OS X (obviously) can read GPT partitions, which are part of the EFI standard. However, Windows cannot, as it relies on antiquated MBR partitions, as explained at http://wiki.onmac.net/index.php/Triple_Boot_via_BootCamp.

It seems that the four partition limit is only relevant if having to use both GPT and MBR partitions. But, since the integrated graphics needs to be initialized in BIOS compatibility mode, one needs to install Boot Camp, seemingly, making much of this discussion moot (at least until there is some other way to enable BIOS emulation) as its initialization will result in the four partition limit.

With that out of the way, on to the partitioning.

OS X/Gentoo Linux

It's possible that if one does not install Windows, they can use the unused partition (out of the four possible) for something else, perhaps swap, or a boot partition? This has not been tried yet, to our knowledge. But, you can of course just not install Windows and follow the directions below, ignoring anything about Windows. It is not necessary for anything (hooray).

You could use the "extra" partition for swap or boot. However if you are dual booting I would recommend that you just use the one partition. Create a swapfile instead and just leave /boot on /. The reason is this if you ever need to wipe the linux partition from Mac OS X you will be able to with Boot Camp. If you create additional partitions then Boot Camp will refuse to run. Nnutter 08:55, 21 June 2006 (UTC). (You can also delete the additional partitions and replace them with a single NTFS partition using a Linux rescue liveCD like Knoppix -- after which Boot Camp Assistant will remove it for you and restore the HD to 100% Mac OS X use.)

OS X/Windows/Gentoo Linux

For the most part, the wonderful folks at OnMac.net get us through this section with their wonderful article on the subject and we can just point to that for the majority of this step.

First, read "A Quick Note on Disk Partitioning" for a better explanation of the partitioning complications mentioned above, and if you want to, download the necessary tools (Boot Camp and rEFIt) in OS X right now. Make sure your Mac Pro is up to date and otherwise meets the specifications listed.

As "Booting your Mac" states, we must use LILO as our boot loader when we get to that step, and we will select rEFIt to be the boot system for all OSes installed. We will return to LILO and rEFIt later in the installation, but for now, know that our selections are LILO and rEFIt. Update: Grub is an option now.

You can follow the triple boot guide for a while, with a couple notes:

Once you've booted into the Gentoo Live CD, you can follow the Gentoo Handbook from "Creating Filesystems". Be sure to create the swap file as detailed in the OnMac.net guide, however.

Kernels and Configs

At this point, things mostly progress the same as the Gentoo Handbook, starting with creating filesystems. We will pick up doing special things again when we get to the bootloader chapter. In the meantime, some notes regarding the chapters in the Handbook follow.

CFLAGS

The Xeon CPU based off of the Intel Core Microarchitecture can be found in Mac pros. Appropriately, the following CFLAGS are a good, conservative choice.

CFLAGS="-O2 -march=nocona -fomit-frame-pointer -pipe"

From the AMD AMD handbook nocona is the proper march type for the MacPro desktop. GCC's documentation also -- byrne

The Prescott is a Pentium 4 cpu, whereas the Core Duo is based off the Pentium-M which is actually a re-vamped Pentium 3. In essence, the Core Duo is a P3 with SSE2 and SSE3 support. The closest GCC match is "prescott" simply because it supports all these (from GCC manual, "prescott - Improved version of Intel Pentium4 CPU with MMX, SSE, SSE2 and SSE3 instruction set support."). However the system will then be optimised for a P4, which the Core Duo is not. Maybe we are better off using "-march=pentium3 -msse2 -msse3" or "-march=pentium-m -msse3"? (Afterall, we don't use "pentium4" for a "pentium-m" system, even though they support the same instruction sets.) --Chris

You're right that the Core Duo is based on the Pentium-M microarch, but it's had some major updates done to it. Fex, the SSE front and backend are completely redone. On the P-M, it took twice as long to decode SSE than X87. Core can handle up to three packed and micro-op SSE instructions at once, making using SSE the advantage. However, when you set -march=pentium-m, GCC prefers to generate x87 instructions. There's other changes that make Core more similar to Netburst than P-M when it comes to cost calculation, prefetch block size, etc., all of which are dependent on -march. Check out gcc/config/i386/i386.c and the IA32 Intel Architecture Optimization Reference Manual. -qed([1])

Note that gcc-4.3 will be adding "-march=merom" to support core 2 duo & xeon 5100 --dan

Kernel Configuration and frequency scaling

Emerge the newest kernel sources you can get. There are a number of good options (although you may need to accept the ~x86 keyword for some of them):

As of the writing of this guide (2.6.16-based kernels), there are a couple outside patches you probably want to apply.


Example Config

Using genkernel --menuconfig all you need to make sure that

Device Drivers --->

SCSI low-level drivers -->
  <*> Intel PIIX/ICH SATA support 
Networking Drivers -->
 Ethernet (1000 Mbit) -->
  <M> Intel(R) PRO/1000 Gigabit Ethernet Support

are activated.

Manual configuration from scratch

Here is a working kernel config - firewire untested, but it should work.

For framebuffer:

This needs to be filled out for MacPro.  Details on both the nvidia and ati cards that ship by default with mac pro.

Intel HD Audio

As of 2.6.20-gentoo-r8, the kernel's built-in ALSA drivers don't work and alsa-drivers-1.0.14_rc3 must be unmasked and installed. Once that is done, the headphone jack on the front panel still doesn't work, but the rear jack does.


/etc/fstab

For those not familiar with using swap files, their entry in /etc/fstab is straightforward. Just replace the partition name with the swap file (e.g. /swap).

Setting up a Bootloader

LILO

LILO is the best choice in that it works out of the box. Emerge it, and then use the sample configuration provided by OnMac.net (changing the partitions if appropriate, of course).

Grub

You can try grub-0.97-r3, but I would suggest grub-0.97-r4, as at least for me, grub-0.97-r3 didn't work as expected. Simply emerge it and set up grub.conf like in the handbook, then do the following (modifying if on a different partition):

grub
root (hd0,2)
setup (hd0,2)
quit

You should see mostly good results except it will fail on embedding stage1_5, but as it points out it is ok. Now if your partition is not already flagged bootable then you will need to use fdisk to do that:

fdisk /dev/sda
a
3
w

Note: When you reboot and rEFIt comes up you need to select the Linux on Partition 3 Nnutter 08:55, 21 June 2006 (UTC)

Post-install

Reboot and if everything was successful, you should have a convenient boot menu from which to select OS X and Linux (and Windows too, if you also installed that). Congratulations! Now you can start doing some real work in Gentoo.

Note: on my Mac Pro with 3 partitions (EFI, OS X, Linux), GRUB is unable to find stage 2, even though grub-install claims to have installed it correctly. It simply displays the GRUB prompt, at which I have to manually enter:

root (hd0,2)
kernel /boot/vmlinuz-2.6.20-gentoo-r8 root=/dev/sda3
boot

to boot Gentoo. Fortunately, I never reboot into OS X so this is not a huge problem.

Hardware

Specifications

  • Processors: Two dual-core Xeon 5100 Series ("Woodcrest" Core architecture with EM64T instruction set) processors or two quad-core Xeon 5365 ("Clovertown") @ 3 GHz
    • 2.0 GHz
    • 2.66 GHz
    • 3.0 GHz
  • Memory: 1 to 16 GB of DDR2-667 buffered ECC, in eight FB-DIMM slots
  • Graphics:
    • nVidia GeForce 7300 GT 256 MB (up to 4 total)
    • ATI Radeon X1900 XT 512 MB
    • nVidia Quadro FX 4500 512 MB
  • Storage: Four drive bays for Serial ATA II hard disks: included disks run at 7200 RPM (Apple )
  • Optical Drive: One or two 16x SuperDrives (DVD-R DL, DVD+/-R(W), CD-R(W)). Optical bays support ATA/100 and SATA.
  • Networking: Dual Gigabit Ethernet, optional AirPort Extreme Card 802.11 a/b/g/Draft-N, optional Bluetooth 2.0+EDR
  • I/O: Five USB 2.0 (two on front), two FireWire 400 (one on front), two FireWire 800 (one on front), optical audio input and output, 3.5 mm stereo audio input and output (one output on front)

More information can be found on the MacPro Developer Notes page.

CPU

Support for VT

As of Mac Pro EFI Firmware Update 1.1, the processors are VMX-capable. The update can be downloaded from Apple's website, or by Software Update.

Support for Multiple CPUs/Cores

A recommended kernel configuration is below. If you've upgraded your Mac Pro to dual quad-core processors, then change "4" to "8" below.

Hyper-Threading is in cold storage for the time being (says Intel), so be sure to disable SMT support.

Linux Kernel Configuration: Multiple CPUs/Cores
Processor type and features  --->
 Processor family (Intel EM64T)
  <*> /dev/cpu/*/msr - Model-specific register support
  <*> /dev/cpu/*/cpuid - CPU information support
  [*] MTRR (Memory Type Range Register) support
  [*] Symmetric multi-processing support
  [ ]   SMT (Hyperthreading) scheduler support
  [*]   Multi-core scheduler support
  Preemption Model (No Forced Preemption (Server))
  (4) Maximum number of CPUs (2-256)
  [*] Provide RTC interrupt
  [*] Machine check support
  [*]   Intel MCE features
  [*] Function reordering

For optimal performance, you may want to add "threads" to your USE flags to enable multithreading in packages that support it.

Support for SSE

The processors fully support MMX, SEE, SSE2, SSE3, and SSSE3. At this time, though, GCC does not support SSSE3.

Support for 64-bit

The Mac Pro has full EM64T support in Gentoo, when using the AMD64 profiles. (x86 profiles are only 32-bit). The CPU's automatically go into long mode when the kernel is loaded.

Memory

Support for Large Amounts of Memory

The 64-bit kernel has high memory support built-in. There are no kernel options to configure.

On 32-bit systems, you will need to configure high memory support.

Linux Kernel Configuration: Memory
Processor type and features  --->
 High Memory Support  --->
  ( ) None
  (X) 4GB
  ( ) 64GB
  • Select "None" if you have 896 MB of memory or less. (PROTIP: No Mac Pro has this configuration.)
  • Select 4GB if you have between 1 and 4 gigabytes of RAM.
  • Select 64 GB if you have more than 4 GB of RAM. Otherwise you will only see 2GB. (This is for MacPro boxes ONLY!)

In order to enable the NX bit, this must be set to 64 GB.

Input Devices

Use the apple drivers

It could be that udev loads usbhid before appleir and appletouch and the apple drivers cannot bnd to the devices any more. To circumvent this problem you should add the following to your /etc/conf.d/local.start:

rmmod usbhid appletouch appleir
modprobe appleir
modprobe appletouch
modprobe usbhid pb_fnmode=2

you can look in modinfo to see what pb_fnmode does:

# modinfo -p usbhid
mousepoll:Polling interval of mice
pb_fnmode:Mode of fn key on PowerBooks (0 = disabled, 1 = fkeyslast, 2 = fkeysfirst)

I for one like to have them first for kde's ALT+F2 = "Run command"

Ethernet

The MacPro uses the e1000 driver for the machines two ethernet jacks (eth0 and eth1).

EDIT:
The Core2Duo MBP uses the sky2 driver. This driver is listed as experimental in the 2.6.22 kernel but it appears to work fine for me.

Sound

Sound now works with alsa-driver-0.14-r3 with intel-hda

Wifi

See the MadWifi article.

Bluetooth

To enable bluetooth edit /etc/conf.d/bluetooth for hid2hci: Just change HID2HCI_ENABLE=false to true and make sure that bluetooth is started at boot with rc-update show.


DVD/CD burning

The cdrom does not work with the "classical" IDE drivers. However as of 2.6.19-rc1 the libata PATA drivers are in the mainline kernel and if you enable this new libata based IDE driver (CONFIG_PATA_MPIIX) and also activate SCSI CDROM support (CONFIG_BLK_DEV_SR) you will be able to use your CD drive as /dev/sr0.

This is complete nonsense. WHY??


Power Management

Frequency Scaling

Works perfectly using speedstep_centrino (using kernel 2.6.16 and 2.6.17).

Software

Input

Using the brightness/volume events including MacOS-Like OSD with pbbuttonsd

WARNING: I have gotten this working but it works only for the first time I hit a button

http://pbbuttons.sourceforge.net/projects/gtkpbbuttons/gfx/macosx_audio.png
[I] app-laptop/gtkpbbuttons (0.6.8-r1): On screen display client for pbbuttonsd 
[I] app-laptop/pbbuttonsd (0.7.6): Handles power management and special keys on laptops.
emerge -va app-laptop/pbbuttonsd app-laptop/gtkpbbuttons
File: /etc/pbbuttonsd.conf
# Configuration file for PBButtonsd >= Version 0.5
# for complete list of options please see pbbuttonsd.conf man-page

# [SYSTEM]
userallowed           = "your_user"        ; user who is allowed to use IPC
autorescan            = yes             ; automatic rescan of event devices
CmdTimeout            = 8

# [MODULE MIXER]
SoundSystem           = ALSA            ; none, auto, OSS or ALSA
#Volume                = 50             ; initial volume level
#Speakers_muted        = no             ; mute after startup?
#VolumeUpKey           = 176
#VolumeDownKey         = 174
MuteKey               = 160
#ALSA_Card             = "default"      ; settings for ALSA
ALSA_Elements         = "PCM"
#MixerInitDelay        = no

# [MODULE CDROM]
dev_CDROM             = "/dev/cdrom"
EjectCDKey            = 204
EjectCDKeyDelay       = 1

I have not yet gotten CDROM or Muteing working but I cannot see the problem with the config. Start the daemon:

/etc/init.d/pbbuttonsd start

as user:

gtkpbbuttons -t MacOSX

Remote Control

Note: The Mac Pro does not have a built-in IR sensor, like all of the other Macs do. You will need to purchase a USB-infrared adapter, with which the Apple Remote will work normally, even in Mac OS X.
Warning: The keyboard driver can only be used up to kernel 2.6.21. For newer kernels, you need to use LIRC

Assigning key values to remote control buttons through xmodmap

The Apple remote control (RC) can work without Lirc; it works out of the box as an extension to the keyboard, and can easily be assigned key values through xmodmap, which is a command that comes with Xorg. Running the command xev, you can find out each RC key keycode; after that, you can bind those keys to keyboard keys. For example, I've created ~/.xmodmap with

keycode 153 = Right
keycode 144 = Left
keycode 176 = 0
keycode 174 = 9
keycode 162 = space
keycode 158 = v

so I can control mplayer with it ;-)

After creating the file, you should run

xmodmap ~/.xmodmap

and don't forget to run it each time you run Xorg. You can also do it automagically.

Using the volume and remote control events in applications with inputlircd

emerge -va inputlircd
USE=lirc emerge -va mplayer
/etc/init.d/inputlircd start

You may want to use the irexec daemon additionally to manage the volume level independant of the media application. To do so you'll want to edit the /etc/lircrc file as below, run "irexec --daemon", and then start mplayer.

#

begin
        prog = mplayer
        button = KEY_PLAYPAUSE
        config = pause
end

begin
        prog = mplayer
        button = KEY_PREVIOUSSONG
        config = seek -10
        repeat = 1
end

begin
        prog = mplayer
        button = KEY_NEXTSONG
        config = seek +10
        repeat = 1
end

#begin
#       prog = mplayer
#       button = KEY_VOLUMEUP
#       config = volume 1
#       repeat = 1
#end

#begin
#       prog = mplayer
#       button = KEY_VOLUMEDOWN
#       config = volume -1
#       repeat = 1
#end

begin
prog = irexec
button = KEY_VOLUMEUP
config = amixer set PCM 3%+ &
repeat = 2
end
begin
prog = irexec
button = KEY_VOLUMEDOWN
config = amixer set PCM 3%- &
repeat = 2
end

Apple Keyboard layout - use with Xmodmap

The keyboard is supported by USB-HID. but there seem to be no good keymaps for it.

One possible solution (for an X environment) is to use a xmodmap, my first try looks like this:

!!
!! xmodmap for Apple MacBook - German layout 
!!
! Let the left apple key act as mode switch
keycode 115 = Mode_switch
! Use the right apple switch as "ALT_GR" key, provides the additional
! characters you find on a tradition pc keyboard (example @)
! !! Also this key acts as right mouse button when used with left apple key
keycode 116 = ISO_Level3_Shift NoSymbol Pointer_Button3
! Use the Delete key correctly
! Maps to center mouse if used with left apple key
keycode 108 = Delete Delete Pointer_Button2
! Page Up/Down 
keycode 98 = 0xff52 NoSymbol 0xff55
keycode 104 = 0xff54 NoSymbol 0xff56
keycode 100 = 0xff51 NoSymbol 0xff50
keycode 102 = 0xff53 NoSymbol 0xff57
! Switch keys ( lt/gt <-> circle/accent )
keycode 94 = 0xfe52 0x00b0 0x00ac 0x00ac 0x00ac 0x00ac
keycode 49 = 0x003c 0x003e 0x007c 0x00a6 0x007c 0x00a6

This .xmodmap file is for the german keyboard layout, the last two lines will propably not apply to other versions. To make the keyboard -> Mouse click mappings work you will need to install a small tool (i could not find in in portage), get it here. When installed run at the beggining of each X-session:

xmodmap <the_file_above>
xkbset exp m
xkbset m

Please note that this key-mapping will not make the keyboard work as printed on the keys, but will match a standard german keyboard. Hints for your own tries: xev (event debugger - lets you see what keycodes are sent), xmodmap and its man-page.

Map F11 and F12 to mouse button 2 and 3

Note: The Mac Pro ships with a Mighty Mouse (4 buttons), so this section is not needed. It remains for historical reference (or if you're a big fan of one-button mice).

Linux doesn't support Ctrl-clicking like Mac OS X does. To use keys for the missing second and third mouse button you need to enable CONFIG_MAC_EMUMOUSEBTN in the kernel, you need the patch to show it on x86 and do the following:

echo 1 > /proc/sys/dev/mac_hid/mouse_button_emulation
echo 87 > /proc/sys/dev/mac_hid/mouse_button2_keycode #for F11
echo 88 > /proc/sys/dev/mac_hid/mouse_button3_keycode #for F12

Getting the X11 running

Nvidia

- nvidia-drivers work fine with nvidia 7300

ATI

References to the nvidia and ati wiki pages to setup X11 should be placed here

Xen

XGL

XGL works out perfectly on MacPro. Rain effects run smoothely. I suggest you use the Gentoo-based distro Sabayon to get a quick start on making machine to use XGL.

Mac Inspired Themes

information on mac-like gtk engines and themes should go here

Accessing OSX HFS+ Filesystem

Warning: HFS support in Linux is rather poor. Your best bet is to use a FAT32 disk to share files between Linux and Mac OS X (and Windows).
Note: Currently, there are no Linux drivers for HFSX (case-sensitive) or ZFS filesystems.

Full article: hfs+

To read, write, and mount HFS+ partitions in Gentoo, enable GPT partition table support and Mac filesystem support in your kernel, and then emerge sys-fs/hfsplusutils.

It is highly recommended that any Mac filesystems that you mount in Gentoo have journaling disabled.

As an alternative, you can install ExtFSManager in Mac OS X, which will let you mount ext2 and ext3 volumes.

Specifications

CPU/Memory

 Machine Name:	Mac Pro
 Machine Model:	MacPro1,1
 Processor Name:	Dual-Core Intel Xeon
 Processor Speed:	2.0/2.66/3 GHz
 Number Of Processors:	2
 Total Number Of Cores:	4
 L2 Cache (per processor):	4 MB
 Memory:	1-16 GB
 Bus Speed:	1.33 GHz
 Boot ROM Version:	MP11.005C.B00
 SMC Version:	1.7f6

/proc/cpuinfo contents

CDROM/DVD

MacPro ships out two types of DVD drives:

 ATA Bus:
 PIONEER DVD-RW  DVR-111D:
 Model:	PIONEER DVD-RW  DVR-111D
 Revision:	AB09
 Detachable Drive:	No
 Protocol:	ATAPI
 Unit Number:	0
 Socket Type:	Internal
 Low Power Polling:	Yes
 Firmware Revision:	AB09
 Interconnect:	ATAPI
 Burn Support:	Yes (Apple Shipped/Supported)
 Cache:	2000 KB
 Reads DVD:	Yes
 CD-Write:	-R, -RW
 DVD-Write:	-R, -RW, +R, +RW, +R DL
 Burn Underrun Protection CD:	Yes
 Burn Underrun Protection DVD:	Yes
 Write Strategies:	CD-TAO, CD-SAO, CD-Raw, DVD-DAO
 Media:	No

or

SONY DVD RW DW-D150A:

Model: SONY DVD RW DW-D150A Revision: 1.MD Serial Number: Detachable Drive: No Protocol: ATAPI Unit Number: 0 Socket Type: Internal Low Power Polling: No

Audio

MacPro can play basic audio through the Alsa snd-hda-intel driver. Unfortunately, there is a bug in this driver that will play sound, but the sound will be VERY VERY quiet. I have to crank up my stereo just to give anything. Sound does not simultaneously output to the internal speakers. I'm not sure if its even possible as an output.


Intel High Definition Audio:
 Available Devices:
 Line Out:
 Connection:	1/8 inch Jack
 Headphone:
 Connection:	1/8 inch Jack
 Line In:
 Connection:	1/8 inch Jack
 Speaker:
 Connection:	Internal
 S/P-DIF Out:
 Connection:	Optical
 S/P-DIF In:
 Connection:	Optical

Links


Last modified: Sat, 27 Sep 2008 13:04:00 +0000 Hits: 19,606