Differences between revisions 28 and 29
Revision 28 as of 2010-10-14 21:20:23
Size: 13307
Editor: GeoffSimmons
Comment: Remove spam added in revision 26.
Revision 29 as of 2010-10-18 03:07:19
Size: 13712
Editor: ?MikeWarren
Comment:
Deletions are marked like this. Additions are marked like this.
Line 23: Line 23:
Otherwise, Mac OS X 10.4.6 and later have online resizing of HFS+ volumes and support for hybrid GPT/MBR partition tables in Disk Utility. To boot multiple operating systems, use OS X's tools to split up your drive and make room for everything. Remember that booting in the BIOS compatibility mode means having an MBR partition table (either hybrid GPT/MBR or plain MBR) so be sure to make the needed changes to your hard drive before continuing, and remember to select either the LILO or GRUB bootloaders from within the Debian installer so that you can access the BIOS compatibility mode described above. Otherwise, Mac OS X 10.4.6 and later have online resizing of HFS+ volumes and support for hybrid GPT/MBR partition tables in Disk Utility. To boot multiple operating systems, use OS X's tools to split up your drive and make room for everything. Remember that booting in the BIOS compatibility mode means having an MBR partition table (either hybrid GPT/MBR or plain MBR) so be sure to make the needed changes to your hard drive before continuing (that is, once the "partition" step has written changes, even just the type of a partition, '''reboot and use gptsync''' or "Partition Tool" from rEFIt to resync GPT/MBR tables and then re-run the installer). Remember to select either the LILO or GRUB bootloaders from within the Debian installer so that you can access the BIOS compatibility mode described above.
Line 38: Line 38:

With the mid-2009 (macmini 3,1) model, you need a "testing" installer to get a recent enough kernel for reboot to work (with kernels from lenny and prior a hard power-off is needed after shutdown).

Translation(s): none

(!) ?Discussion


Installing Debian on a Mac Mini

This page describes how to install Debian on an Intel-based Mac Mini.

For the earlier PowerPC-based model, see MacMini.

Verify that your computer has the latest firmware: http://support.apple.com/kb/HT1237

The latest firmware adds a BIOS compatibility mode, including detection of BIOS-bootable disks and CDs in the built-in boot volume chooser. In addition, if you want good graphics support in Linux, you must boot it using the BIOS compatibility mode. This is because the X.org / XFree86 drivers for Intel and ATI, as well as the Linux text console, rely on the Video BIOS and Apple's firmware only provides a Video BIOS when booting in BIOS compatibility mode. Without it, you only get unaccelerated frame buffer graphics. Booting in the BIOS compatibility mode also means using either the LILO or GRUB bootloaders, and having an MBR partition table (either hybrid GPT/MBR or plain MBR).

If you are unwilling or unable to update the machine's firmware, elilo (the EFI Linux Loader) can be used to boot the Mac mini. However, this requires a specially prepared kernel and has some drawbacks (like not having 2D/3D accelerated graphics.) James McKenzie published a hack to elilo that activates the Video BIOS without activating the full BIOS compatibility mode. This actually allows the accelerated drivers to work without booting through LILO/GRUB. Unfortunately it hasn't been updated in months.

In consideration of all of the above, updating the computer's firmware is the simplest way to easily install and boot Linux and also get 2D/3D graphics acceleration.

Dual/Triple Boot

If you're not planning to dual boot OS X and Debian (or triple boot OS X, Debian and Windows), you can skip this step.

Otherwise, Mac OS X 10.4.6 and later have online resizing of HFS+ volumes and support for hybrid GPT/MBR partition tables in Disk Utility. To boot multiple operating systems, use OS X's tools to split up your drive and make room for everything. Remember that booting in the BIOS compatibility mode means having an MBR partition table (either hybrid GPT/MBR or plain MBR) so be sure to make the needed changes to your hard drive before continuing (that is, once the "partition" step has written changes, even just the type of a partition, reboot and use gptsync or "Partition Tool" from rEFIt to resync GPT/MBR tables and then re-run the installer). Remember to select either the LILO or GRUB bootloaders from within the Debian installer so that you can access the BIOS compatibility mode described above.

Download The Installer

If you have the early or late 2006 Mac mini models, go to http://debian.org/CD and download the installer for i386. If you have the mid 2007 model, you can use either the i386 or AMD64 installer.

Once the download is complete, you can use Disk Utility to burn the installer to CD or DVD and (thanks to the BIOS compatibility mode in later firmware versions), directly boot the CD by holding down the C button on your keyboard when the computer starts.

Once you've booted into the installer, you can proceed with installation. See the installation guide for information on how to use the installer. Remember to select either the LILO or GRUB bootloaders from within the Debian installer so that you can access the BIOS compatibility mode described above.

A useful note is that, after the installation is complete, it is normal for your computer to boot up to a folder icon with a question mark. Assuming that the GRUB bootloader and everything was installed successfully, the computer will sit there for approximately 15 seconds and then being to boot.

For dual or triple boot situations, hold down the Option key on your keyboard and the built-in boot volume chooser will let you select what you'd like to boot from.

Known Issues

On the Mac mini (late 2006 model) with Debian 4.0r3 I was unable to get the full 1920 x 1200 resolution on my Apple Cinema HD Display (23".) I was able to resolve it by using the 915resolution package. Debian 4.0r4 is expected to make updated software available, so the 915resolution package may longer be necessary at that point.

With the mid-2009 (macmini 3,1) model, you need a "testing" installer to get a recent enough kernel for reboot to work (with kernels from lenny and prior a hard power-off is needed after shutdown).

mid-2010 model Mac Mini

Two things prevent Debian from working flawlessly on (June 2010 model) Mac Mini. First is that Nvidia NCP89 is broken. link Second is that BCM57765 ethernet chipset support first appears in 2.6.34. link

Both issues can be solved by upgrading to linux kernel 2.6.35. After that, everything in squeeze/i386 seems to be working fine (2010-08-28).

This is the install CD image that I made for this. (SHA:44519bbfc48f5728ed6597a89b8f99ccd848fd61) Make sure to choose "-mac-mini" kernel package during install. Lastly, after installation, add "reboot=p" to kernel boot flags to avoid this reboot issue.

At the end of installation (before exiting installer), I added this line to lilo.conf

append="reboot=p nouveau.modeset=0"

NOTE: I would really appreciate for someone to mirror the Mac Mini install iso. If it becomes unavailable, request it from me at "Seunghun Thomas Lee" <stlee42@gmail.com>. mirror 1

To start from scratch, it is necessary to 1) create custom kernel package and 2) create custom installer image with the package. I was inspired by RicardoYanez's guide for Mac Pro. You should configure ata_generic as built-in as per here.

Outdated Info

The rest of this document remains purely for historical purposes for installation without the latest firmware and the BIOS compatibility mode that it provides.

Legacy Installation Instructions

I've tried several howtos to install Linux on my mini. None of them worked perfectly. So I decided to document my installation procedure here.

I decided to install Debian to an external USB disk. You need the following for this howto:

  • an USB harddisk that is supported by Linux
  • a machine with a running Debian

Install EFI boot loader

First boot MacOS. You need to download the precompiled Mac disk image from the rEFIt project. Open the dmg and start rEFIt.mpkg which will install the EFI boot loader.

Compile Kernel

Now you need your working Debian machine. I am using the latest git tree and the intel mac patches from Mactel-Linux.

mkdir MacMini && cd MacMini
git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git linux-2.6
cvs -z3 -d:pserver:anonymous@mactel-linux.cvs.sourceforge.net:/cvsroot/mactel-linux co -P misc
mv misc mactel
cd linux-2.6
patch -p1 < ../mactel/misc/imac-2.6.16-rc6.patch
make mrproper
cp ../mactel/misc/config-2.6.16-rc5 .config
make menuconfig
make

Set up hard disk

Connect the hard disk and create some partitions. The first primary partition should be a vfat partition. It is needed to boot elilo from the EFI bootloader. Because my mini has a lot of RAM I left out the swap partition. But it might be a good idea to create one. Here my partition table:

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1          30       30704    c  W95 FAT32 (LBA)
/dev/sdb4              31       38204    39090176    5  Extended
/dev/sdb5              31       14336    14649328   83  Linux
/dev/sdb6           14337       38204    24440816   83  Linux

The next step is to format the partitions:

mkfs.vfat -n Debian /dev/sdb1
mkfs.ext3 /dev/sdb5
mkfs.ext3 /dev/sdb6

The volume label of the vfat partition is diplayed late in the EFI bootloader.

Set up kernel and elilo

For booting the Linux kernel you need the EFI aware version of lilo called elilo. You can get a working binary from the mactel guys here. You need the the e.efi (elilo itself) and the configuration file elilo.conf. Copy them and the build kernel into the root of the vfat partition. As last step you need to adjust the elilo config file. I had to change the root device to /dev/sdb5 and the framebuffer type to mini (instead if i17 or i20).

mount /dev/sdb1 /mnt
cp mactel/boot/e.efi mactel/boot/elilo.conf /mnt
cp linux-2.6/arch/i386/boot/bzImage /mnt/vmlinuz
vim /mnt/elilo.conf
umount /mnt

Bootstrapping Debian

The next step is to bootstrap Debian. The man page of debootstrap provides some useful examples. After bootstrapping you need to setup the fstab, hosts and hostname files.

mount /dev/sdb5 /mnt
debootstrap sid /mnt http://ftp.de.debian.org/debian/
vim /mnt/fstab
vim /mnt/hosts
vim /mnt/hostname

In my setup they contain the following things:

$ more /etc/fstab /etc/hostname /etc/hosts
::::::::::::::
/etc/fstab
::::::::::::::
/dev/sdb5       /       ext3    defaults        0       1
tmpfs           /tmp    tmpfs   defaults        0       0
proc            /proc   proc    defaults        0       0
/dev/sda1       /boot   vfat    defaults        0       0
/dev/sdb6       /home   ext3    defaults        0       1
::::::::::::::
/etc/hostname
::::::::::::::
Rincewind
::::::::::::::
/etc/hosts
::::::::::::::
127.0.0.1       localhost

After mounting the proc filesystem, you can chroot into your new installation an install some additional software with dselect.

mount proc /mnt/proc -t proc
chroot /mnt /bin/bash
dselect
exit
umount /mnt/proc
umount /mnt

If the umount fails because the filesystem is busy you must terminate the daemons that were started during package installation.

Boot into the new system

Now plug your usb disk into your mini and boot it. After the chime sound the rEFIt bootloader should appear. In my setup it displays among other menu entries the possibility to boot e.efi and the installed MacOS. If you select e.efi than elilo gets loaded and stops at its prompt. Just press return to load the default kernel image. If everything is set up right, you should see the framebuffer console with the two penguin logos. The default resolution with a mini is 1024x786. If you own a bigger display, you could specify the resolution at the kernel parameter line in elilo.conf. Or if you are as lazy as me, change the imac patch to use your resolution.

Setting up X11

The integrated intel video controller is not supported by Sid yet. You must use the fbdev driver to get a working X11.

apt-get install xserver-xorg x-window-system xterm
dpkg-reconfigure xserver-xorg

During the xserver configuration select the fbdev driver and let the driver use the kernel frambuffer interface. Select 24bit as default depth. Ather finished the configuration you must tweak it a little bit to tell the driver that the framebuffer uses 32 bits per pixel. Add the Line "DefaultFbBpp 32" after the DefaultDepth entry in the Screen section of the xorg.conf file.

vim /etc/X11/xorg.conf

Section "Screen"
        ...
        DefaultDepth    24
        DefaultFbBpp    32
        ...
EndSection

Installation on the internal hard disk using DebianInstaller (daily build 2007-03-16)

Only the most important parts (which probably also apply to Etch once released)

  • install rEFIt under MacOSX
  • use 'diskutil' under MacOSX to resize your harddisk
  • put in the DebianInstaller CD, reboot

  • you should now see the CD as possible choice in the rEFIt menu
  • boot from it, proceed with the normal installation in text mode. Use manual partitioning and create a root and swap partition
  • do _not_ install grub or elilo
  • install lilo as bootloader. This is really important. elilo and grub both do _not_ work. I had to chroot into the /target partition and adapt lilo.conf to contain boot=/dev/sda3 and root=/dev/sda3 (execute lilo afterwards). While you are at it, start fdisk and check that your root partition (/dev/sda3) has the bootable flag
  • reboot, rEFIt should give you the choice to start your new linux system. After a short while you should be greeted with the graphical login screen.

  • Mactel-Linux They provided nearly everything I have used during my setup.

  • rEFIt boot menu and maintenance toolkit for EFI-based machines

  • elilo bootloader for EFI machines