Differences between revisions 6 and 8 (spanning 2 versions)
Revision 6 as of 2007-06-15 01:52:24
Size: 7700
Editor: RicardoYanez
Comment:
Revision 8 as of 2007-06-15 03:36:07
Size: 9154
Editor: RicardoYanez
Comment:
Deletions are marked like this. Additions are marked like this.
Line 2: Line 2:

Written by Ricardo Yanez
Line 7: Line 9:
For the inpatient, the next section explains how to install Debian with a custom mini installer CD and custom kernel in a few steps. For the inpatient, the next section explains how to install Debian with a custom mini installer CD and custom kernel in few steps.
Line 13: Line 15:
Download this [http://debian.calel.org/macpro/mini.iso Debian Installer Mini CD for Intel Mac Pro] (md5sum 355637030cc685b1c37d037ee9ec926b), burn it to a CD, for example, 'wodim -v -eject dev=/dev/cdrw -data mini.iso'. Download this [http://debian.calel.org/macpro/mini.iso Debian Installer Mini CD for Intel Mac Pro] (md5sum {{{355637030cc685b1c37d037ee9ec926b}}}), burn it to a CD, for example,

{{{$
wodim -v -eject dev=/dev/cdrw -data mini.iso}}}
Line 19: Line 23:
Still under Mac OS X, open the CD bay, insert the Debian Installer Mini CD and reboot. In the boot menu choose the penguin CD. 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 21: Line 25:
Boot the installer in expert mode. 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). Boot the installer in expert mode. 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}}}' for the kernel to install. During GRUB installation, install GRUB in MBR (won't destroy rEFIt, nor any Mac partition).
Line 23: Line 27:
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'. 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 Linux kernel image] (md5sum {{{97e201408b7bd1a5848d6be2f682dbb5}}}) and install it with '{{{dpkg -i}}}'.
Line 25: Line 29:
You may have to install initramfs-tools with, 'apt-get -f install initramfs-tools' before installing the kernel, depending on what software you installed. You may have to install {{{initramfs-tools}}} with, '{{{apt-get -f install initramfs-tools}}}' before installing the kernel, depending on what software you installed during software installation.
Line 27: Line 31:
To get the custom kernel I used a USB key. Did 'tail -f /var/log/syslog' before
inserting the key to get the device it attached to, then 'chroot
/target', mounted the key '
mount /dev/sdb1 /mnt' and installed the
kernel image 'dpkg -i /mnt/linux-image-2.6.20-macpro-amd64_2.4.20_amd64.deb'. You may use the network to get the kernel image as well, for example, with wget.
To get the custom kernel I used a USB key. I did '{{{tail -f /var/log/syslog}}}' before inserting the key to get the device it attached to, then
'{{{chroot /target}}}', mounted the key '{{{mount /dev/sdb1 /mnt}}}' and installed the
kernel image '{{{dpkg -i /mnt/linux-image-2.6.20-macpro-amd64_2.4.20_amd64.deb}}}'. You may use the network to get the kernel image as well, for example, with {{{wget}}}.
Line 32: Line 35:
'update-grub' just in case, then go back to the installation terminal, <ctrl>-<alt>-<f1> and finish the installation. '{{{update-grub}}}' just in case, then go back to the installation terminal, <ctrl>-<alt>-<f1> and finish the installation.
Line 35: Line 38:

After boot, you may want to install the [http://debian.calel.org/macpro/linux-headers-2.6.20-macpro-amd64_2.4.20_amd64.deb Custom Intel Mac Pro Linux kernel headers] (md5sum {{{10faa85348474389be7e81501ff067a3}}}).
Line 40: Line 45:
I have two 64-bit dual Quad-Core Xeon E5335 "Clovertown" machines at work. One is an HP server, the other an Apple Mac Pro. Both are primarily used to run Monte Carlo simulations in parallel, or otherwise. 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 Monte Carlo simulations in parallel, or otherwise.
Line 42: Line 47:
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 bay to insert the installation CD, boot and choose the penguin. 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.
Line 44: Line 49:
The Debian installer boots and allows me to configure the early steps of installation, like language, keyboard, but it doesn't mount the CD-ROM. Eventually, no media is available to continue 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 that Mac firmware does not support USB-key installations. The Debian installer boots and allows me to configure the early steps of installation, like language, keyboard, but it doesn't mount the CD-ROM. Eventually, no media is available to continue 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 that Mac firmware does not support USB-key installations.
Line 46: Line 51:
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 recipies, 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 partition (Why this is necessary beats me). Here is my infinitely simpler recipe: 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 (Why this is necessary beats me). Here is my infinitely simpler recipe:
Line 61: Line 66:
In short, kernel 2.6.20 is compiled with the mactel patches, then debian-installer is used to create the mini installation image. In short, kernel 2.6.20 is compiled with the mactel-linux patches, then debian-installer is used to create the mini installation image.
Line 65: Line 70:
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. 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}}}.
Line 67: Line 72:
Install subversion and get the Mactel kernel patches, Install {{{subversion}}} and get the mactel-linux kernel patches,
Line 69: Line 74:
# svn co https://mactel-linux.svn.sourceforge.net/svnroot/mactel-linux mactel-linux {{{# svn co https://mactel-linux.svn.sourceforge.net/svnroot/mactel-linux mactel-linux}}}
Line 71: Line 76:
Go to trunk/kernel/mactel-patches-[kernel-version] and apply patches with, Go to {{{trunk/kernel/mactel-patches-[kernel-version]}}} and apply patches with,
Line 73: Line 78:
# ./apply /usr/src/[linux-source-directory] {{{# ./apply /usr/src/[linux-source-directory]}}}
Line 75: Line 80:
Install kernel-package and libncurses5-dev. Go the the source directory and 'make menuconfig'. Install {{{kernel-package}}} and {{{libncurses5-dev}}}. Go the the kernel source directory and '{{{make menuconfig}}}'.
Line 77: Line 82:
I configured the kernel as generic as possible, and with mactel addenda, I configured the kernel as generic as possible, plus mactel-linux addenda,
Line 79: Line 84:
        Macintosh device drivers --->
                [*] Support for mouse button 2+3 emulation

Hardware Monitoring support --->
< > Apple SMC (Motion sensor, light sensor, keyboard backlight)

USB support --->
<M> Apple Mac Mini USB IR receiver (built in)
{{{Device Drivers --->}}}
 {{{
Hardware Monitoring support --->}}}
 {{{
< > Apple SMC (Motion sensor, light sensor, keyboard backlight)}}}
 {{{
USB support --->}}}
 {{{
<M> Apple Mac Mini USB IR receiver (built in)}}}
Line 90: Line 92:
This is the [http://debian.calel.org/macpro/config-2.6.20-macpro-amd64 .config] file.
Line 92: Line 96:
# make-kpkg --initrd --append-to-version=-macpro-amd64 --revision=2.4.20 kernel_image kernel_headers {{{# make-kpkg --initrd --append-to-version=-macpro-amd64 --revision=2.4.20 kernel_image kernel_headers}}}
Line 100: Line 104:
Install devscripts and kernel-wedge. Install {{{devscripts}}} and {{{kernel-wedge}}}.
Line 102: Line 106:
Unpack the source package linux-kernel-di-amd64-2.6, Unpack the source package {{{linux-kernel-di-amd64-2.6}}},
Line 104: Line 108:
# apt-get source linux-kernel-di-amd64-2.6 {{{# apt-get source linux-kernel-di-amd64-2.6}}}
Line 106: Line 110:
Go to the directory and edit kernel-versions to match the new version, 2.6.20-mactel-amd64. Uncomment or delete the existing line. Go to the directory and edit {{{kernel-versions}}} to match the new version, {{{2.6.20-macpro-amd64}}}. Comment out or delete the existing line.
Line 108: Line 112:
Check for build dependencies with dpkg-checkbuilddeps, and install dependencies as needed. Check for build dependencies with {{{dpkg-checkbuilddeps}}}, and install dependencies as needed.
Line 110: Line 114:
If you have a GPG signature you can do 'debchange -i' to edit the changelog with your e-mail address and some comments. You may also want to change the Maintainer: field in debian/control.stub. 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}}} with appropriate values, then source it.
Line 112: Line 116:
Build the package with debuild, or 'debuild -rfakeroot' if not root. Build the package with {{{debuild}}}, or '{{{debuild -rfakeroot}}}' if not root.
Line 114: Line 118:
If you have no GPG signature, build with 'debuild binary', or 'debuild -rfakeroot binary' if not root instead. If you have no GPG signature, build with '{{{debuild binary}}}', or '{{{debuild -rfakeroot binary}}}' if not root instead.
Line 116: Line 120:
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. 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.
Line 121: Line 125:

== 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 in {{{dest/monolithic}}}.

Now you have the CD image and the kernel image. Install as described in the short-short version section.

Good luck!

Introduction

Written by Ricardo Yanez

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 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 mini installer CD and custom kernel in few steps.

In the long version section I explain how I made the Debian Installer CD.

Short-short version

Download this [http://debian.calel.org/macpro/mini.iso Debian Installer Mini CD for Intel Mac Pro] (md5sum 355637030cc685b1c37d037ee9ec926b), burn it to a CD, for example,

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

Being a mini CD, it contains only .udeb packages, 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, 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' for the kernel to install. During GRUB installation, install GRUB in MBR (won't destroy rEFIt, nor any Mac partition).

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 Linux kernel image] (md5sum 97e201408b7bd1a5848d6be2f682dbb5) and install it with 'dpkg -i'.

You may have to install initramfs-tools with, 'apt-get -f install initramfs-tools' before installing the kernel, depending on what software you installed during software installation.

To get the custom kernel I used a USB key. I did 'tail -f /var/log/syslog' before inserting the key to get the device it attached to, then 'chroot /target', mounted the key 'mount /dev/sdb1 /mnt' and installed the kernel image 'dpkg -i /mnt/linux-image-2.6.20-macpro-amd64_2.4.20_amd64.deb'. You may use the network to get the kernel image as well, for example, with wget.

'update-grub' just in case, then 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 [http://debian.calel.org/macpro/linux-headers-2.6.20-macpro-amd64_2.4.20_amd64.deb Custom Intel Mac Pro Linux kernel headers] (md5sum 10faa85348474389be7e81501ff067a3).

Long version

(This part requires you have 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 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 and allows me to configure the early steps of installation, like language, keyboard, but it doesn't mount the CD-ROM. Eventually, no media is available to continue 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 that Mac firmware does not support USB-key installations.

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 (Why this is necessary beats me). Here is my infinitely simpler recipe:

  • Install in expert mode
  • GPT partition type
  • Flag the root partition as bootable
  • Install GRUB in MBR (won't destroy rEFIt, nor Mac partition)

This may work with other Linux distributions than Ubuntu.

This exercise made me realize the installer needs to attach the CD-ROM as SCSI, not IDE as the Debian Installer does, perhaps under SATA (not sure here.)

My plan of action was then to compile a custom kernel a la Ubuntu, that attaches the CD-ROM as the hardware requires, then make a new Debian Installer CD with it.

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

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'.

I configured the kernel as generic as possible, plus mactel-linux addenda,

Device Drivers  --->

  •         Hardware Monitoring support  --->                 < > Apple SMC (Motion sensor, light sensor, keyboard backlight)         USB support  --->                 <M> Apple Mac Mini USB IR receiver (built in)

The Apple SMC module failed to compile, so it was unmarked.

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

Compile,

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

Install the custom kernel. No need to boot it.

Kernel udebs

I'm repeating here some of the ["DebianInstaller/Modify/CustomKernel"] wiki.

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-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 with appropriate values, 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.

If you have a GPG signature, sign the files.

You 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 in dest/monolithic.

Now you have the CD image and the kernel image. Install as described in the short-short version section.

Good luck!