Differences between revisions 2 and 22 (spanning 20 versions)
Revision 2 as of 2007-06-14 23:50:59
Size: 2680
Editor: RicardoYanez
Comment:
Revision 22 as of 2007-07-29 17:33:51
Size: 8425
Editor: RicardoYanez
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
= Introduction = = Debian On Intel Mac Pro =
 
This page describes a method to install Debian on Apple Intel Mac Pro computers. It has been tested in two computer systems with a Quad-Core and dual Quad-core Xeon 5300-series "Clovertown" processors.
Line 3: Line 5:
This page describes a method to install Debian on Apple Intel Mac Pro computers. It has been tested in two computer systems with a Quad-Core and dual Quad-core Xeon 5300-series "Clovertown" machines. If you have already tried to install Debian on Intel Mac Pro, you may have noticed the Debian Installer CD doesn't mount the CD-ROM properly. Eventually, no media is available to continue with the installation.
Line 5: Line 7:
If you have already tried to install Debian on Intel Mac Pro, you may have experienced the fact that the Debian Installer CD boots and allows you to configure the early steps of installation, like language, keyboard, etc. but it doesn't mount the CD-ROM. Eventually, no media is available to continue with the base-system installation. For the inpatient, the next section explains how to install Debian with a custom Debian Installer mini CD and custom Linux kernel in few steps.
Line 7: Line 9:
I tried the standard approaches given in several wikies on the subject, e.g. kernel boot parameters like, In the "Details" section I explain how I compiled the custom kernel and how I made the custom Debian Installer CD.
Line 9: Line 11:
boot: install noapic irqpoll acpi=force Input can be sent through my [http://www.calel.org/contact.html contact page].
Line 11: Line 13:
and combinations thereof, but none really helped. I also tried a USB-key installation, only to learn that Apple Mac firmware does not support USB-key installations. If you have a MacBook Pro, you may want to see MacBookPro instead.
Line 13: Line 15:
= Short-short version = == Debian Installation ==
Line 15: Line 17:
Download this [http://debian.calel.org/macpro/mini.iso Debian Installer Mini CD fot Intel Mac Pro] (md5sum 355637030cc685b1c37d037ee9ec926b), burn it in a CD, for example, Download the [http://debian.calel.org/macpro/mini.iso Debian Installer Mini CD for Intel Mac Pro] (`MD5SUM 023dadbea2bb5bc064d81b4fc62f184f`), burn it to a CD, for example,
Line 17: Line 19:
{{{
Line 18: Line 21:
}}}
Line 19: Line 23:
Being a mini CD, it contains only .udeb packages, no .deb packages. You will need a network connection to install the base system. In the long version section I explain how I made this Debian Installer CD. Being a mini CD, it contains no `.deb` packages. You will need a network connection to install the base system.
Line 23: Line 27:
Still under Mac OS X, open the CD bay, insert the Debian Installer Mini CD and reboot. In the boot menu choose the penguin. Still under Mac OS X, open the CD tray, insert the Debian Installer Mini CD and reboot. In the boot menu choose the penguin CD.
Line 25: Line 29:
Boot the installer in expert mode, Boot the installer in '''expert''' mode. Install as you would in any system.
Line 27: Line 31:
boot: expert Choose to partition manually, then set the root partition '''bootable flag''' on.
Line 29: Line 33:
Install as you would in any system, except when partitioning the disk. Choose to partition manually, then set the '''bootable flag''' on the partition mounted in /. During the installation of the base system choose 'none' when selecting kernel to install. During GRUB installation, install GRUB in MBR (won't destroy rEFIt, nor any Mac partition). During the installation of the base system, choose '`none`' for the kernel to install.
Line 31: Line 35:
After GRUB installation, just before finishing the installation and rebooting, open a virtual terminal, <ctrl>-<alt>-<f2> for instance, chroot /target, get the [http://debian.calel.org/macpro/linux-image-2.6.20-macpro-amd64_2.4.20_amd64.deb Custom Intel Mac Pro kernel image] and install it with 'dpkg -i'. Choose to continue without boot loader.
Line 33: Line 37:
You may have to install initramfs-tools with, Just before finishing the installation, open a virtual terminal, {{{<ctrl>-<alt>-<f2>}}} for instance, and run a shell. Change the root directory with,
Line 35: Line 39:
# apt-get -f install initramfs-tools {{{
# chroot /target
}}}
Line 37: Line 43:
before installing the kernel, depending on what software you installed. Install `grub` and `initramfs-tools` with,
Line 39: Line 45:
'update-grub' just in case, then go back to the installation terminal, <ctrl>-<alt>-<f1> and finish the installation. {{{
# apt-get install grub initramfs-tools
}}}
Line 41: Line 49:
= Long version = Run,
{{{
# grub-install /dev/sda
}}}

to install GRUB on the first disk drive.

Edit `/etc/apt/sources.list` and add line,

{{{
 deb http://debian.calel.org/macpro etch main
}}}

Run '`apt-get update`' and install the custom kernel,

{{{
# apt-get install linux-image-2.6.20-2-macpro-amd64
}}}

Say no to abort kernel installation.

Run {{{update-grub}}} and create {{{/boot/grub/menu.lst}}}.

Go back to the installation terminal, {{{<ctrl>-<alt>-<f1>}}} and finish the installation.

In the boot menu choose the penguin disk.

After boot, you may want to install the kernel headers,

{{{
# apt-get install linux-headers-2.6.20-2-macpro-amd64
}}}

If you like to make Debian the first boot device, under Mac OS X, edit `/efi/refit/refit.conf` and uncomment option `legacyfirst`.

If you feel uncomfortable using my custom kernel, compile your own using the mactel-linux patches as described below.

== Details ==

(This part requires some familiarity with kernel compilation and debian packaging).

I have two 64-bit dual Quad-Core Xeon E5335 "Clovertown" machines at work. One is an HP server, the other an Apple Intel Mac Pro. Both are primarily used to run and develop Monte Carlo simulations in parallel, or otherwise.

I obviously had no trouble installing Debian Etch on the HP server. On the Mac, the first thing one needs to do is to install rEFIt under Mac OS X, open the CD tray to insert the installation CD, boot and choose the penguin.

The Debian installer boots, but it doesn't mount the CD-ROM. Eventually, no media is available to continue with the base-system installation. I tried the standard approaches given in several wikies on the subject, e.g. boot parameters like '{{{install noapic irqpoll acpi=force}}}', and combinations thereof, but none really helped. I also tried a USB-key installation, only to learn Mac firmware doesn't support USB-key installations, at least in the machines I have.

Then a co-worker handed me an Ubuntu 7.04 Feisty server installation CD, which recognized the CD-ROM, mounted the CD, installed the base system, and went all the way to the finish line. After boot, the kernel would not load, though. I read several guides describing some very intricate recipes, which included the need of Live CDs and disk partition utilities. None of these approaches is really necessary, once you realize the only thing they are trying to do is to set the boot flag on the root partition.

This exercise made me realize the installer needs to attach the CD-ROM not as ATAPI IDE (ide-cd) as the Debian Installer does, but under SATA (not sure here why, nor if this statement is absolutely true.)

My plan of action was then to compile a custom kernel a la Ubuntu (which has the Mactel-linux patches included) that attaches the CD-ROM as the hardware requires, then make a new Debian Installer CD with it.

I followed closely ["DebianInstaller/Modify/CustomKernel"] and ["DebianInstaller/BuildEtch"].

In short, kernel 2.6.20 is compiled with the mactel-linux patches, then debian-installer is used to create the mini installation image.

=== Custom kernel 2.6 ===

I compiled the kernel in the HP server running Debian Etch. I used kernel version 2.6.20, downloaded from kernel.org. Untar the tarball in {{{/usr/src}}}.

Install `subversion` and get the mactel-linux kernel patches,

{{{
# svn co https://mactel-linux.svn.sourceforge.net/svnroot/mactel-linux mactel-linux
}}}

Go to `trunk/kernel/mactel-patches-[kernel-version]` and apply patches with,

{{{
# ./apply /usr/src/[linux-source-directory]
}}}

Install `kernel-package` and `libncurses5-dev`. Go the the kernel source directory and '`make menuconfig`'.

This is the current [http://debian.calel.org/macpro/config-2.6.20-2-macpro-amd64 .config] file.

Before compiling, edit `Makefile` and remove the `EXTRAVERSION` introduced by the Mactel-linux patching. Leave it blank.

Compile with,

{{{
# make-kpkg --initrd --append-to-version=-1-macpro-amd64 --revision=2.6.20 kernel_image kernel_headers
}}}

Install the custom kernel. No need to boot it in what follows.

=== Kernel udebs ===

I'm repeating here some, if not most, of ["DebianInstaller/Modify/CustomKernel"].

Install `devscripts` and `kernel-wedge`.

Unpack the source package `linux-kernel-di-amd64-2.6`,

{{{
# apt-get source linux-kernel-di-amd64-2.6
}}}

Go to the directory and edit `kernel-versions` to match the new version, `2.6.20-1-macpro-amd64`. Comment out or delete the existing line.

Check for build dependencies with `dpkg-checkbuilddeps`, and install dependencies as needed.

If you have a GPG signature you can do '`debchange -i`' to edit the changelog with your e-mail address and some comments. The directory name will change, reflecting the new version number. You will have to go to the parent directory, then back into the new directory. You may also want to change the `Maintainer:` field in `debian/control.stub`, and define the `EMAIL` and `GNUPGHOME` environment variables in the user's `.bashrc`, then source it.

Build the package with `debuild`, or '`debuild -rfakeroot`' if not root.

If you have no GPG signature, build with '`debuild binary`', or '`debuild -rfakeroot binary`' if not root instead.

The building may fail due to missing kernel modules. Edit module listings in `modules/amd64` needed be. I copied some of the include files into the directory and put a `?` at the end of the missing module. See kernel-wedge documentation for more options. I had to delete some module-list files that generated empty udebs.

If you have a GPG signature, sign the files.

You should end up with a bunch of udebs in the parent directory.

=== Debian Installer ===

Get the source,

{{{
# apt-get source debian-installer
}}}

Go to directory and check for dependencies.

Edit `build/config/amd64.cfg` and change `KERNELVERSION`. Uncomment monolithic image type.

Copy all kernel udebs into `build/localudebs`.

Go to `build/` and build the monolithic image,

{{{
# make build_monolithic
}}}

The image is placed in `dest/monolithic`.

Now you have the CD image and the kernel image. Install as described in the installation section.

Good luck!

Debian On Intel Mac Pro

This page describes a method to install Debian on Apple Intel Mac Pro computers. It has been tested in two computer systems with a Quad-Core and dual Quad-core Xeon 5300-series "Clovertown" processors.

If you have already tried to install Debian on Intel Mac Pro, you may have noticed the Debian Installer CD doesn't mount the CD-ROM properly. Eventually, no media is available to continue with the installation.

For the inpatient, the next section explains how to install Debian with a custom Debian Installer mini CD and custom Linux kernel in few steps.

In the "Details" section I explain how I compiled the custom kernel and how I made the custom Debian Installer CD.

Input can be sent through my [http://www.calel.org/contact.html contact page].

If you have a MacBook Pro, you may want to see MacBookPro instead.

Debian Installation

Download the [http://debian.calel.org/macpro/mini.iso Debian Installer Mini CD for Intel Mac Pro] (MD5SUM 023dadbea2bb5bc064d81b4fc62f184f), burn it to a CD, for example,

$ wodim -v -eject dev=/dev/cdrw -data mini.iso

Being a mini CD, it contains no .deb packages. You will need a network connection to install the base system.

Under Mac OS X, install [http://refit.sourceforge.net/ rEFIt], the EFI boot menu for Intel Mac. Easiest is to download the Mac disk image, double click on the icon and run the installer.

Still under Mac OS X, open the CD tray, insert the Debian Installer Mini CD and reboot. In the boot menu choose the penguin CD.

Boot the installer in expert mode. Install as you would in any system.

Choose to partition manually, then set the root partition bootable flag on.

During the installation of the base system, choose 'none' for the kernel to install.

Choose to continue without boot loader.

Just before finishing the installation, open a virtual terminal, <ctrl>-<alt>-<f2> for instance, and run a shell. Change the root directory with,

# chroot /target

Install grub and initramfs-tools with,

# apt-get install grub initramfs-tools

Run,

# grub-install /dev/sda

to install GRUB on the first disk drive.

Edit /etc/apt/sources.list and add line,

 deb http://debian.calel.org/macpro etch main

Run 'apt-get update' and install the custom kernel,

# apt-get install linux-image-2.6.20-2-macpro-amd64

Say no to abort kernel installation.

Run update-grub and create /boot/grub/menu.lst.

Go back to the installation terminal, <ctrl>-<alt>-<f1> and finish the installation.

In the boot menu choose the penguin disk.

After boot, you may want to install the kernel headers,

# apt-get install linux-headers-2.6.20-2-macpro-amd64

If you like to make Debian the first boot device, under Mac OS X, edit /efi/refit/refit.conf and uncomment option legacyfirst.

If you feel uncomfortable using my custom kernel, compile your own using the mactel-linux patches as described below.

Details

(This part requires some familiarity with kernel compilation and debian packaging).

I have two 64-bit dual Quad-Core Xeon E5335 "Clovertown" machines at work. One is an HP server, the other an Apple Intel Mac Pro. Both are primarily used to run and develop Monte Carlo simulations in parallel, or otherwise.

I obviously had no trouble installing Debian Etch on the HP server. On the Mac, the first thing one needs to do is to install rEFIt under Mac OS X, open the CD tray to insert the installation CD, boot and choose the penguin.

The Debian installer boots, but it doesn't mount the CD-ROM. Eventually, no media is available to continue with the base-system installation. I tried the standard approaches given in several wikies on the subject, e.g. boot parameters like 'install noapic irqpoll acpi=force', and combinations thereof, but none really helped. I also tried a USB-key installation, only to learn Mac firmware doesn't support USB-key installations, at least in the machines I have.

Then a co-worker handed me an Ubuntu 7.04 Feisty server installation CD, which recognized the CD-ROM, mounted the CD, installed the base system, and went all the way to the finish line. After boot, the kernel would not load, though. I read several guides describing some very intricate recipes, which included the need of Live CDs and disk partition utilities. None of these approaches is really necessary, once you realize the only thing they are trying to do is to set the boot flag on the root partition.

This exercise made me realize the installer needs to attach the CD-ROM not as ATAPI IDE (ide-cd) as the Debian Installer does, but under SATA (not sure here why, nor if this statement is absolutely true.)

My plan of action was then to compile a custom kernel a la Ubuntu (which has the Mactel-linux patches included) that attaches the CD-ROM as the hardware requires, then make a new Debian Installer CD with it.

I followed closely ["DebianInstaller/Modify/CustomKernel"] and ["DebianInstaller/BuildEtch"].

In short, kernel 2.6.20 is compiled with the mactel-linux patches, then debian-installer is used to create the mini installation image.

Custom kernel 2.6

I compiled the kernel in the HP server running Debian Etch. I used kernel version 2.6.20, downloaded from kernel.org. Untar the tarball in /usr/src.

Install subversion and get the mactel-linux kernel patches,

# svn co https://mactel-linux.svn.sourceforge.net/svnroot/mactel-linux mactel-linux

Go to trunk/kernel/mactel-patches-[kernel-version] and apply patches with,

# ./apply /usr/src/[linux-source-directory]

Install kernel-package and libncurses5-dev. Go the the kernel source directory and 'make menuconfig'.

This is the current [http://debian.calel.org/macpro/config-2.6.20-2-macpro-amd64 .config] file.

Before compiling, edit Makefile and remove the EXTRAVERSION introduced by the Mactel-linux patching. Leave it blank.

Compile with,

# make-kpkg --initrd --append-to-version=-1-macpro-amd64 --revision=2.6.20 kernel_image kernel_headers

Install the custom kernel. No need to boot it in what follows.

Kernel udebs

I'm repeating here some, if not most, of ["DebianInstaller/Modify/CustomKernel"].

Install devscripts and kernel-wedge.

Unpack the source package linux-kernel-di-amd64-2.6,

# apt-get source linux-kernel-di-amd64-2.6

Go to the directory and edit kernel-versions to match the new version, 2.6.20-1-macpro-amd64. Comment out or delete the existing line.

Check for build dependencies with dpkg-checkbuilddeps, and install dependencies as needed.

If you have a GPG signature you can do 'debchange -i' to edit the changelog with your e-mail address and some comments. The directory name will change, reflecting the new version number. You will have to go to the parent directory, then back into the new directory. You may also want to change the Maintainer: field in debian/control.stub, and define the EMAIL and GNUPGHOME environment variables in the user's .bashrc, then source it.

Build the package with debuild, or 'debuild -rfakeroot' if not root.

If you have no GPG signature, build with 'debuild binary', or 'debuild -rfakeroot binary' if not root instead.

The building may fail due to missing kernel modules. Edit module listings in modules/amd64 needed be. I copied some of the include files into the directory and put a ? at the end of the missing module. See kernel-wedge documentation for more options. I had to delete some module-list files that generated empty udebs.

If you have a GPG signature, sign the files.

You should end up with a bunch of udebs in the parent directory.

Debian Installer

Get the source,

# apt-get source debian-installer

Go to directory and check for dependencies.

Edit build/config/amd64.cfg and change KERNELVERSION. Uncomment monolithic image type.

Copy all kernel udebs into build/localudebs.

Go to build/ and build the monolithic image,

# make build_monolithic

The image is placed in dest/monolithic.

Now you have the CD image and the kernel image. Install as described in the installation section.

Good luck!