Introduction
On January 11th, when Jobs’ announced that the rumors of a small, cheap Mac were true, I hopped on the Mac mini bandwagon. Minutes after the keynote wrapped up, I swung by Apple’s online store and managed to place the order before the throngs of people crushed the site. I wasn’t exactly sure what I would use it for, but I was certain I wouldn’t need anything more than the base model. Using my discount as an IBM employee, I was able to get the already inexpensive Mac mini for a whopping $420 dollars. Delivery took about a week from the time I ordered it, but it was surprising as it was delivered well before Apple’s scheduled January 22nd ship date, not to mention the free upgrade to priority overnight shipping.
I’m a big fan of OS X, having used and provided technical support for the OS for years at OIT, but after using it for a week or so on my desktop, I decided to turn this little beast into a server. The rationale for this was the simple fact that I had no need for another desktop computer, especially since my primary desktop is considerably faster in all respects. Nonetheless, I was not going to let this little guy go unused! I decided to turn the mini into a full-blown Linux box for my still unfulfilled server needs.
The first item on the agenda was a RAM upgrade. The Mac mini ships with a measly 256MB of RAM, which is totally useless when running a memory hog of an OS like OS X. While Linux would have run fine with this amount of RAM, I had a 512MB stick of PC2700 RAM lying around unused. Beware: opening the Mac mini is not an exercise for the weary. Thank goodness someone posted the repair manual, since Apple discourages user meddling (but will not void your warranty if you do so, unless you break something).
For the mini’s virgin voyage into the uncharted worlds of Linux, I chose the very powerful and flexible Gentoo Linux distribution. I’ve had an excellent experience running Gentoo in the past, and they excellent support for the PPC architecture. So, if you’d like, grab the LiveCD and let’s get started!
Installation
To boot off the CD, press and hold the C-key while booting. You should see the bootloader appear in a few seconds. Press ENTER, since the default kernel parameters are correct for the mini.
For the most part, install Gentoo on the Mac mini according to the Gentoo Linux PPC handbook, which is almost completely straightforward. There are, however, a few inconsistencies that must be taken into account.
Here is my partition table (I do not dual-boot with OS X, since I plan on running OS X in Gentoo via MOL):
/dev/hda
# type name length base ( size ) system
/dev/hda1 Apple_partition_map Apple 63 @ 1 ( 31.5k) Partition map
/dev/hda2 Apple_Bootstrap bootstrap 1600 @ 64 (800.0k) NewWorld bootblock
/dev/hda3 Apple_UNIX_SVR2 swap 1048576 @ 1664 (512.0M) Linux swap
/dev/hda4 Apple_UNIX_SVR2 root 77089920 @ 1050240 ( 36.8G) Linux native
Block size=512, Number of Blocks=78140160
DeviceType=0x0, DeviceId=0x0
Drivers-
1: @ 64 for 23, type=0x1
2: @ 120 for 36, type=0xffff
3: @ 176 for 21, type=0x701
4: @ 232 for 34, type=0xf8ff
When you arrive at the step that requires you to set up your fstab, beware: the instructions are for x86 architecture and don’t take into account the different boot methods employed by PPC. Here is my /etc/fstab, which will probably be the same as yours if you followed the previous partitioning instructions (note the exclusion of the /boot partition):
/dev/hda3 none swap sw 0 0 /dev/hda4 / ext3 noatime 0 1 /dev/cdroms/cdrom0 /mnt/cdrom iso9660 noauto,ro 0 0 none /proc proc defaults 0 0 none /dev/shm tmpfs defaults 0 0
When it comes time to manually compile the kernel, you may wish to use my working kernel .config for kernel-2.6.10-gentoo-r6.
Here is my working /etc/yaboot.conf, generated by yabootconfig:
## yaboot.conf generated by yabootconfig 1.0.7
##
## run: "man yaboot.conf" for details. Do not make changes until you have!!
##
## For a dual-boot menu, add one or more of:
## bsd=/dev/hdaX, macos=/dev/hdaY, macosx=/dev/hdaZ
boot=/dev/hda2
device=/pci@f4000000/ata-6@d/disk@0:
partition=4
root=/dev/hda4
timeout=30
install=/usr/lib/yaboot/yaboot
magicboot=/usr/lib/yaboot/ofboot
image=/boot/kernel-2.6.10-gentoo-r6
label=Linux
read-only
Xorg and Window Manager
I needed a window manager that was lightweight, fast and good looking, so I went with the relative newcomer Xfce 4.2.
To install the window manager, you must first install Xorg (this will take a while):
# emerge xorg-x11
Reinitialize environment variables:
# env-update # source /etc/profile
You will now need to configure Xorg for your system. If you need help, refer to The X Server Configuration HOWTO. You may wish to try Xautoconfig, available through portage.
Install xfce (this will take a while):
# emerge xfce4
Comment out the last line of /etc/rc.conf so it reads:
#XSESSION="Gnome"
If you want, set xdm to run on boot for a graphical login:
# rc-update add xdm default
You may need to fix a pam bug in order to make xfce start. To do so, open /etc/security/pam_env.conf and comment out:
#DISPLAY DEFAULT= OVERRIDE=@{DISPLAY}
Now that xfce is installed, make it your default window manager by creating (or editing) .xsession to include:
startxfce4
When you log in through xdm either locally or remotely, it should open xfce.
Terminal Server
I will be both working locally and accessing the computer remotely, so I decided to set up the Mac mini as a terminal server using TightVNC.
Install tightvnc:
# emerge tightvnc
Install xinetd:
# emerge xinetd # rc-update add xinetd default
Allow >xinetd to listen to external calls by opening /etc/xinetd.conf and commenting out the line:
#only_from = localhost
Change the xdm configuration so it listens to XDCMP request. Open /etc/X11/xdm/xdm-config and comment out the last line with a !:
!DisplayManager.requestPort :0
Open /etc/X11/xdm/Xaccess and uncomment the following line by removing the single quote:
'* #any host can get a login window
Add some services to the services file by adding the following lines to /etc/services:
# # VNC Servers # vnc-640x480x8 5950/tcp vnc-800x600x8 5951/tcp vnc-1024x768x8 5952/tcp vnc-1280x1024x8 5953/tcp vnc-1600x1200x8 5954/tcp vnc-640x480x16 5960/tcp vnc-800x600x16 5961/tcp vnc-1024x768x16 5962/tcp vnc-1280x1024x16 5963/tcp vnc-1600x1200x16 5964/tcp vnc-640x480x24 5970/tcp vnc-800x600x24 5971/tcp vnc-1024x768x24 5972/tcp vnc-1280x1024x24 5973/tcp vnc-1600x1200x24 5974/tcp vnc-640x480x32 5980/tcp vnc-800x600x32 5981/tcp vnc-1024x768x32 5982/tcp vnc-1280x1024x32 5983/tcp vnc-1600x1200x32 5984/tcp
Create a file called /etc/xinetd.d/xvncserver with the following contents:
service vnc-640x480x8
{
protocol = tcp
socket_type = stream
wait = no
user = nobody
server = /usr/bin/Xvnc
server_args = -inetd -query localhost -once -geometry 640x480 -depth 8
}
service vnc-800x600x8
{
protocol = tcp
socket_type = stream
wait = no
user = nobody
server = /usr/bin/Xvnc
server_args = -inetd -query localhost -once -geometry 800x600 -depth 8
}
service vnc-1024x768x8
{
protocol = tcp
socket_type = stream
wait = no
user = nobody
server = /usr/bin/Xvnc
server_args = -inetd -query localhost -once -geometry 1024x768 -depth 8
}
service vnc-1280x1024x8
{
protocol = tcp
socket_type = stream
wait = no
user = nobody
server = /usr/bin/Xvnc
server_args = -inetd -query localhost -once -geometry 1280x1024 -depth 8
}
service vnc-1600x1200x8
{
protocol = tcp
socket_type = stream
wait = no
user = nobody
server = /usr/bin/Xvnc
server_args = -inetd -query localhost -once -geometry 1600x1200 -depth 8
}
service vnc-640x480x16
{
protocol = tcp
socket_type = stream
wait = no
user = nobody
server = /usr/bin/Xvnc
server_args = -inetd -query localhost -once -geometry 640x480 -depth 16
}
service vnc-800x600x16
{
protocol = tcp
socket_type = stream
wait = no
user = nobody
server = /usr/bin/Xvnc
server_args = -inetd -query localhost -once -geometry 800x600 -depth 16
}
service vnc-1024x768x16
{
protocol = tcp
socket_type = stream
wait = no
user = nobody
server = /usr/bin/Xvnc
server_args = -inetd -query localhost -once -geometry 1024x768 -depth 16
}
service vnc-1280x1024x16
{
protocol = tcp
socket_type = stream
wait = no
user = nobody
server = /usr/bin/Xvnc
server_args = -inetd -query localhost -once -geometry 1280x1024 -depth 16
}
service vnc-1600x1200x16
{
protocol = tcp
socket_type = stream
wait = no
user = nobody
server = /usr/bin/Xvnc
server_args = -inetd -query localhost -once -geometry 1600x1200 -depth 16
}
service vnc-640x480x24
{
protocol = tcp
socket_type = stream
wait = no
user = nobody
server = /usr/bin/Xvnc
server_args = -inetd -query localhost -once -geometry 640x480 -depth 24
}
service vnc-800x600x24
{
protocol = tcp
socket_type = stream
wait = no
user = nobody
server = /usr/bin/Xvnc
server_args = -inetd -query localhost -once -geometry 800x600 -depth 24
}
service vnc-1024x768x24
{
protocol = tcp
socket_type = stream
wait = no
user = nobody
server = /usr/bin/Xvnc
server_args = -inetd -query localhost -once -geometry 1024x768 -depth 24
}
service vnc-1280x1024x24
{
protocol = tcp
socket_type = stream
wait = no
user = nobody
server = /usr/bin/Xvnc
server_args = -inetd -query localhost -once -geometry 1280x1024 -depth 24
# port = 5973
}
service vnc-1600x1200x24
{
protocol = tcp
socket_type = stream
wait = no
user = nobody
server = /usr/bin/Xvnc
server_args = -inetd -query localhost -once -geometry 1600x1200 -depth 24
}
service vnc-640x480x32
{
protocol = tcp
socket_type = stream
wait = no
user = nobody
server = /usr/bin/Xvnc
server_args = -inetd -query localhost -once -geometry 640x480 -depth 32
}
service vnc-800x600x32
{
protocol = tcp
socket_type = stream
wait = no
user = nobody
server = /usr/bin/Xvnc
server_args = -inetd -query localhost -once -geometry 800x600 -depth 32
}
service vnc-1024x768x32
{
protocol = tcp
socket_type = stream
wait = no
user = nobody
server = /usr/bin/Xvnc
server_args = -inetd -query localhost -once -geometry 1024x768 -depth 32
}
service vnc-1280x1024x32
{
protocol = tcp
socket_type = stream
wait = no
user = nobody
server = /usr/bin/Xvnc
server_args = -inetd -query localhost -once -geometry 1280x1024 -depth 32
}
service vnc-1600x1200x32
{
protocol = tcp
socket_type = stream
wait = no
user = nobody
server = /usr/bin/Xvnc
server_args = -inetd -query localhost -once -geometry 1600x1200 -depth 32
}
(Re)start the xinetd service:
# /etc/init.d/xinetd restart
Restart the xdm service:
/etc/init.d/xdm restart
Open a vncviewer to test it:
vncviewer localhost:71
This will open up an 800×600x24bit client. If you want another resolution or color-depth, just use the two last number shown in the /etc/services file.
Miscellaneous
Here is various output that may or may not be helpful.
omega root # lspci 0000:00:0b.0 Host bridge: Apple Computer Inc. UniNorth 2 AGP 0000:00:10.0 VGA compatible controller: ATI Technologies Inc RV280 [Radeon 9200] (rev 01) 0001:10:0b.0 Host bridge: Apple Computer Inc. UniNorth 2 PCI 0001:10:17.0 Class ff00: Apple Computer Inc. KeyLargo/Intrepid Mac I/O 0001:10:18.0 USB Controller: Apple Computer Inc. KeyLargo/Intrepid USB 0001:10:19.0 USB Controller: Apple Computer Inc. KeyLargo/Intrepid USB 0001:10:1a.0 USB Controller: Apple Computer Inc. KeyLargo/Intrepid USB 0001:10:1b.0 USB Controller: NEC Corporation USB (rev 43) 0001:10:1b.1 USB Controller: NEC Corporation USB (rev 43) 0001:10:1b.2 USB Controller: NEC Corporation USB 2.0 (rev 04) 0002:20:0b.0 Host bridge: Apple Computer Inc. UniNorth 2 Internal PCI 0002:20:0d.0 Class ff00: Apple Computer Inc. UniNorth/Intrepid ATA/100 0002:20:0e.0 FireWire (IEEE 1394): Apple Computer Inc. UniNorth 2 FireWire (rev 81) 0002:20:0f.0 Ethernet controller: Apple Computer Inc. UniNorth 2 GMAC (Sun GEM) (rev 80) omega root # lsmod Module Size Used by snd_mixer_oss 22624 0 snd 63992 1 snd_mixer_oss af_packet 26312 2 omega root # dmesg Total memory = 512MB; using 1024kB for hash table (at c0400000) Linux version 2.6.10-gentoo-r6 (root@livecd) (gcc version 3.4.1 20040803 (Gentoo Linux 3.4.1-r3, ssp-3.4-2, pie-8.7.6.5)) #1 Thu Feb 10 19:24:18 EST 2005 Found UniNorth memory controller & host bridge, revision: 210 Mapped at 0xfdf66000 Found a Intrepid mac-io controller, rev: 0, mapped at 0xfdee6000 Processor NAP mode on idle enabled. PowerMac motherboard: Unknown Intrepid-based Found UniNorth PCI host bridge at 0xf0000000. Firmware bus number: 0->0 Found UniNorth PCI host bridge at 0xf2000000. Firmware bus number: 0->0 Found UniNorth PCI host bridge at 0xf4000000. Firmware bus number: 0->0 via-pmu: Server Mode is disabled PMU driver 2 initialized for Core99, firmware: 55 On node 0 totalpages: 131072 DMA zone: 131072 pages, LIFO batch:16 Normal zone: 0 pages, LIFO batch:1 HighMem zone: 0 pages, LIFO batch:1 Built 1 zonelists Kernel command line: root=/dev/hda4 ro PowerMac using OpenPIC irq controller at 0x80040000 OpenPIC Version 1.2 (4 CPUs and 64 IRQ sources) at fc699000 OpenPIC timer frequency is 4.166666 MHz PID hash table entries: 4096 (order: 12, 65536 bytes) time_init: decrementer frequency = 41.620997 MHz Console: colour dummy device 80x25 Dentry cache hash table entries: 131072 (order: 7, 524288 bytes) Inode-cache hash table entries: 65536 (order: 6, 262144 bytes) Memory: 514048k available (2496k kernel code, 1328k data, 144k init, 0k highmem) AGP special page: 0xdffff000 Calibrating delay loop... 1245.18 BogoMIPS (lpj=622592) Mount-cache hash table entries: 512 (order: 0, 4096 bytes) NET: Registered protocol family 16 PCI: Probing PCI hardware PCI: Cannot allocate resource region 0 of device 0001:10:18.0 PCI: Cannot allocate resource region 0 of device 0001:10:19.0 Registering openpic with sysfs... usbcore: registered new driver usbfs usbcore: registered new driver hub Thermal assist unit not available Initializing Cryptographic API inotify device minor=63 Generic RTC Driver v1.07 Linux agpgart interface v0.100 (c) Dave Jones agpgart: Detected Apple UniNorth 2 chipset agpgart: Maximum main memory to use for agp memory: 440M agpgart: configuring for size idx: 4 agpgart: AGP aperture is 16M @ 0x0 PCI: Enabling device 0000:00:10.0 (0006 -> 0007) [drm] Initialized radeon 1.11.0 20020828 on minor 0: PCI device 1002:5962 (ATI Technologies Inc) radeonfb: Invalid ROM signature 0 should be 0xaa55 radeonfb: Retreived PLL infos from Open Firmware radeonfb: Reference=27.00 MHz (RefDiv=12) Memory=190.00 Mhz, System=250.00 MHz radeonfb: PLL min 12000 max 35000 radeonfb: Monitor 1 type CRT found radeonfb: EDID probed radeonfb: Monitor 2 type CRT found radeonfb: EDID probed Console: switching to colour frame buffer device 80x30 radeonfb: ATI Radeon Yb DDR SGRAM 32 MB pmac_zilog: 0.6 (Benjamin Herrenschmidt <benh>) ttyS0 at MMIO 0x80013020 (irq = 22) is a Z85c30 ESCC - Serial port ttyS1 at MMIO 0x80013000 (irq = 23) is a Z85c30 ESCC - Serial port mice: PS/2 mouse device common for all mice io scheduler noop registered io scheduler anticipatory registered io scheduler deadline registered io scheduler cfq registered sungem.c:v0.98 8/24/03 David S. Miller (davem@redhat.com) eth0: Sun GEM (PCI) 10/100/1000BaseT Ethernet 00:0d:93:42:71:58 PHY ID: 4061e4, addr: 0 eth0: Found BCM5221 PHY MacIO PCI driver attached to Intrepid chipset Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2 ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx PCI: Enabling device 0002:20:0d.0 (0000 -> 0002) ide0: Found Apple UniNorth ATA-6 controller, bus ID 3, irq 39 Probing IDE interface ide0... hda: ST940110A, ATA DISK drive hdb: MATSHITACD-RW CW-8123, ATAPI CD/DVD-ROM drive hda: Enabling Ultra DMA 5 hdb: Enabling Ultra DMA 2 elevator: using anticipatory as default io scheduler ide0 at 0xe1022000-0xe1022007,0xe1022160 on irq 39 ide1: Found Apple KeyLargo ATA-3 controller, bus ID 0, irq 24 Probing IDE interface ide1... ide1: Bus empty, interface released. hda: max request size: 1024KiB hda: 78140160 sectors (40007 MB) w/2048KiB Cache, CHS=16383/255/63, UDMA(100) hda: cache flushes supported hda: [mac] hda1 hda2 hda3 hda4 hdb: ATAPI 24X DVD-ROM CD-R/RW drive, 2048kB Cache, UDMA(33) Uniform CD-ROM driver Revision: 3.20 ieee1394: Initialized config rom entry `ip1394' ohci1394: $Rev: 1223 $ Ben Collins <bcollins> PCI: Enabling device 0002:20:0e.0 (0000 -> 0002) ohci1394: fw-host0: Unexpected PCI resource length of 1000! ohci1394: fw-host0: OHCI-1394 1.1 (PCI): IRQ=[40] MMIO=[f5000000-f50007ff] Max Packet=[2048] PCI: Enabling device 0001:10:1b.2 (0004 -> 0006) ehci_hcd 0001:10:1b.2: NEC Corporation USB 2.0 ehci_hcd 0001:10:1b.2: irq 63, pci mem 0x80080000 ehci_hcd 0001:10:1b.2: new USB bus registered, assigned bus number 1 ehci_hcd 0001:10:1b.2: USB 2.0 initialized, EHCI 1.00, driver 26 Oct 2004 hub 1-0:1.0: USB hub found hub 1-0:1.0: 5 ports detected ohci_hcd: 2004 Nov 08 USB 1.1 'Open' Host Controller (OHCI) Driver (PCI) PCI: Enabling device 0001:10:18.0 (0000 -> 0002) ohci_hcd 0001:10:18.0: Found HC with no IRQ. Check BIOS/PCI 0001:10:18.0 setup! PCI: Enabling device 0001:10:19.0 (0000 -> 0002) ohci_hcd 0001:10:19.0: Found HC with no IRQ. Check BIOS/PCI 0001:10:19.0 setup! PCI: Enabling device 0001:10:1a.0 (0000 -> 0002) ohci_hcd 0001:10:1a.0: Apple Computer Inc. KeyLargo/Intrepid USB (#3) ohci_hcd 0001:10:1a.0: irq 29, pci mem 0x80083000 ohci_hcd 0001:10:1a.0: new USB bus registered, assigned bus number 2 hub 2-0:1.0: USB hub found hub 2-0:1.0: 2 ports detected PCI: Enabling device 0001:10:1b.0 (0000 -> 0002) ohci_hcd 0001:10:1b.0: NEC Corporation USB ohci_hcd 0001:10:1b.0: irq 63, pci mem 0x80082000 ohci_hcd 0001:10:1b.0: new USB bus registered, assigned bus number 3 hub 3-0:1.0: USB hub found hub 3-0:1.0: 3 ports detected PCI: Enabling device 0001:10:1b.1 (0000 -> 0002) ohci_hcd 0001:10:1b.1: NEC Corporation USB (#2) ohci_hcd 0001:10:1b.1: irq 63, pci mem 0x80081000 ohci_hcd 0001:10:1b.1: new USB bus registered, assigned bus number 4 hub 4-0:1.0: USB hub found hub 4-0:1.0: 2 ports detected usbcore: registered new driver hiddev usb 3-1: new low speed USB device using ohci_hcd and address 2 input: USB HID v1.00 Keyboard [IBM IBM Standard USB Keyboard] on usb-0001:10:1b.0-1 input: USB HID v1.00 Mouse [IBM IBM Standard USB Keyboard] on usb-0001:10:1b.0-1 usbcore: registered new driver usbhid drivers/usb/input/hid-core.c: v2.0:USB HID core driver i2c /dev entries driver Found KeyWest i2c on "uni-n", 2 channels, stepping: 4 bits Found KeyWest i2c on "mac-io", 1 channel, stepping: 4 bits NET: Registered protocol family 2 IP: routing cache hash table of 4096 buckets, 32Kbytes TCP: Hash tables configured (established 131072 bind 65536) NET: Registered protocol family 1 802.1Q VLAN Support v1.8 Ben Greear <greearb> All bugs added by David S. Miller <davem> kjournald starting. Commit interval 5 seconds EXT3-fs: mounted filesystem with ordered data mode. VFS: Mounted root (ext3 filesystem) readonly. Freeing unused kernel memory: 144k init 4k chrp 32k prep Adding 524280k swap on /dev/hda3. Priority:-1 extents:1 EXT3 FS on hda4, internal journal NET: Registered protocol family 17 PHY ID: 4061e4, addr: 0 eth0: Link is up at 100 Mbps, full-duplex. eth0: Pause is disabled drivers/usb/input/hid-input.c: event field not found usb 4-1: new low speed USB device using ohci_hcd and address 2 input: USB HID v1.00 Mouse [04b3:310b] on usb-0001:10:1b.1-1 usb 4-1: USB disconnect, address 2 usb 4-1: new low speed USB device using ohci_hcd and address 3 input: USB HID v1.00 Mouse [04b3:310b] on usb-0001:10:1b.1-1
11 Comments
First thanks for posting this.
I am a long time Gentoo user, but never used any type of mac before. I am about to start and wondered about the dual boot, can I shrink the existing OSX partition, put gentoo in the space created and dual boot? Or will I need to reload OSX after I have installed Gentoo (as the gentoo installation manual hints).
An incridebly useful article – thanks very much for posting it. Would you mind posting your USE flags as well? I went a bit overboard first time round and ended up with a number of compile errors.
Very helpful, thanks so much for posting your fstab that really helped.
Can you post your XFree86.conf file?
Sorry, I can’t, as I’ve canned X.org in favor of a slimmer machine.
Very Cool,
I’ve been using Debian on my Mini, but I’m thinking about playing around with Gentoo, would it be possible for you to post or mail me the USE flags you used, I ended up with some erros last time I tried
Hi, thank you for the posting.
Did you tried to get the sound working? I am using gentoo, too. But I cannot get the powermac driver working, either with kernel (2.6.10) or alsa-driver.
Magus
This kernel config worked great. I tried manually compiling the kernel, but it would boot until I used this config. Thank You.
I want to get a mac mini as a dedicated server, and this is just the kind of page that I need to get the ball rolling! That kernel config file I know will come in handy and save me a lot of time! But being the “Wannabe Linux Guru” that I am, I know I will still mess arround, hacking away at the kernel to get it lean and mean.
Must say though, xorg.conf would be nice (for us lazy and stupid people out there) and I hope there is not a complex sound issue waiting for me (refering to Magnus’s comment above).
Thanks for Blog!
where is:
.config
xorg.conf
:,(
One Trackback
[...] Installing Gentoo Linux on the Mac Mini [...]