HOWTO

From Mactel-Linux

Jump to: navigation, search

Contents

Distro-specific Resources

A list of distribution-specific howtos:

Dual Booting

The Dual Booting page lists various alternatives for dual-booting Linux and Mac OS X with a boot menu. One of them is the rEFIt boot menu, but you can do without if you want to.

Triple Booting

The Triple Booting page lists various alternatives for triple-booting Linux, Mac OS X and Windows.

The (not so) simple instructions to get a dual boot on your MacBook

I went through a day of hackery to get to my first WiFi connection from Linux on my MacBook, so I thought I'd share my findings and write the Macbook dual boot wifi-with-WPA howto.


Dual boot with Fedora Core 6 and LVM on a Macbook Pro

As most topics explain how to install Gentoo or Ubuntu, I decided to share my experience of configuring my Macbook Pro with Fedora Core 6 and lvm.

Simple instructions to get Linux on your Intel iMac

!! These instructions are outdated and only work with an iMac with the original firmware !!

This article assumes basic knowledge surrounding Linux, terminal and the underlying Unix operating system. Those without basic knowledge will find this article hard to follow.

Info for the blessing the EFI part are taken from EFI Howto

  1. Download from the Intel site: EFI Sample Implementation
  2. Unzip the file to /efi
  3. do 'sudo bless --folder /efi --file /efi/Binary/BIOS32/Bin/GraphicsConsole.efi --setBoot'
  4. Download the following files : e.efi, elilo.conf, vmlinuz, initrd from Bootfiles/Kernel/Initrd
  5. If you have a 20" iMac change in elilo.conf "video=imacfb:i17" to "video=imacfb:i20"
  6. Copy the downloaded files to a FAT-formated USB memory stick/HDD into the root dir.
  7. Reboot with your memory stick connected.
  8. You'll get the familiar chime and gray screen, wait about 10 seconds then hit the spacebar.
  9. Select Boot Maintenance Manager.
  10. Select Boot From File.
  11. Select your USB memory stick/HDD.
  12. Select e.efi

To get back to OSX do steps 9,10. Then select your OSX HDD shown as "NO FILE SYSTEM INFO".

Use /System/Library/CoreServices/boot.efi to boot OSX.

Alternatively, it is possible to set up Dual Booting with separate partitions. That allows you to choose between Mac OS X and Linux using the built-in boot volume chooser (hold down Option while booting).


Simple instructions to get Linux on your Intel MacPro, using Fedora 7

Here is how I was able to get Fedora Core 7 installed on a 8-cpu MacPro. The quick summary: install rEFIt, and then simply install from the FC7 x86_64 DVD, using text mode. An external disk many be required. Install the NVIDIA linux drivers after installation.

There is also a detailed version for the MacBook Pro.

Step-by-step:

  1. Start with a fresh MacOS 10.4.10 install, and run Software Update
  2. Download and install rEFIt version 0.10 on the system disk
  3. Install a second disk
  4. Insert Fedora 7 x86_64 DVD (downloaded Aug 20, 2007)
  5. Reboot and select Linux DVD in rEFIt boot menu
  6. Select _text_ install when prompted (couldn't get graphical install to work)
  7. Install as usual, selecting the _NEW_ disk
  8. Reboot, and select Fedora boot disk in rEFIt menu
  9. Log in as root and installed latest NVIDIA drivers
  10. Reboot into Fedora and configure X to start

Fairly straightforward. Using a second disk may have made things easier.

Update: The keyboard and mouse don't work at boot roughly 50% of the time. Rebooting seems to fix it. Haven't investigated at all yet. Seems OK now...

Kernel Patches/Config

Here is the patch/config i used.

imac-2.6.16-rc4.patch is the all in one patch. Includes PATA support for the SATA controller, Sound support, imacfb and a corrected EFI bug.

Kernel Configuration Guide

Boot Files

e.efi
is elilo 3.6 compiled for ia32. (See Building elilo for some hints.)
elilo.conf
config file for elilo
vmlinuz
precompiled kernel
initrd
simple initrd which spawns a shell

HDD partitioning

First of all, do the firmware upgrade. Without the firmware upgrade, your computer won't boot either lilo or grub.

  • parted can handle EFI GPT partitions ;)

Be aware that you need to use a patch to get parted to set the proper GUID on your HFS/HFS+ partitions after shrinking them. Otherwise you will end up with a HFS partition that OSX refuses to recognize. The above patch is for 1.7.0rc1.

  • An alternative is to use OSX's disk utility; be advised that it is not able to delete partitions after they are created.
1. Open up a terminal window and type 'diskutil list'. It should look something like this:
 /dev/disk0
  #:                   type name               size      identifier
  0:  GUID_partition_scheme                    *74.5 GB disk0
  1:                    EFI                    200.0 MB  disk0s1
  2:              Apple_HFS Macintosh HD       74.2 GB  disk0s2 
2. Find the identifier of your Mac OS X partion (in this case disk0s2) and type the following in order to repartition the drive. In the example below, I have repartitioned a 74.5Gb Hard disk to contain 54Gb OSX and 20Gb Linux (no swap partition):
 sudo diskutil resizeVolume disk0s2 20G Linux <name of linux volume>
3. Boot with MacTel's Ubuntu LiveCD and format the partition with your preferred filesystem. For the good old ext3, do 'mke2fs -j /dev/sda3'.
4. When you have extensively used your OSX drive disktutil will fail to resize your resize your OSX drive, because the data is scattered over the whole drive, tools like iDefrag (will cost money!) will compact your drive so all data is moved to the beginning of your drive and letting diskutil resize you OSX drive.

Distribution install

Please see BootstrappingDistributions

  • Debian A step by step MacMini howto for Debian
  • Gentoo Gentoo on MacBooks
  • [1] Ubuntu Edgy on MacBooks

Video

(Submitted by Jeremiah Sypult) (Updated by gimli)

I haven't verified the following changes with anyone else, but if you have a 20" iMac Core Duo you can modify elilo.conf:

elilo.conf
append="video=imacfb:i20 init=/linuxrc root=/dev/ram0 acpi=force irqpoll"


How to modify the "screen_info" for my own screen of 20" iMac?

Disclaimer

We take no warranty for broken devices.

Live CD

Here you find the first Live CD

Note: The current Live CD (20060326) has problems with the updated firmware (a.k.a. "Boot Camp").

Download the file, unpack it and burn it as iso.

  1. Boot and hold down the "Option Key"
  2. Select The CD Drive
  3. Select Boot Maintenance Manager.
  4. Select Boot From File.
  5. Select your Removeable Media.
  6. Change into the folder elilo
  7. Select e.efi
  8. On the elilo prompt hit enter for the 17" iMac. If you have the 20" one, input i20 and hit enter
  9. If all went well Linux should boot.
  10. When the system is up try startx on the commandline
  11. Happy penguin :)

Another LiveCD supporting MacIntel is the upcoming dyne:II The latest version boots straight from bootcamp->CD, installation is easy as copying a directory in your harddisk and all partitions are recognized (but no 3d hardware support yet). For more informations see http://dynebolic.org (just for documentation, stable version 1.4.1 doesn't works on Mac-intel)


Then build the kernel

make

Copy the kernel to the compact flash.

Now you need to build elilo. Follow the instructions on the Building Elilo page. As we are booting directly to elilo, don't forget to include the mentioned patch to switch to text mode.

Once you have built it, copy the resulting elilo.efi to the compact flash, along with an elilo.config like below

#
# force chooser to textmenu
chooser=simple
legacy-free

delay=50
prompt

image=/efi/vmlinuz
        label=Linux
        description="Linux 2.6.16.1"
        append="video=imacfb:mini root=/dev/sda3 acpi=force libata.atapi_enabled=1"

Now put the OSX install cd into the mac mini and boot it by holding down C.

Go to the install disk "Disk Utility", and set the main hard disc partitions to 2 partitions. Make a small boot partition (I made it 20MB - but you might want more for various kernels etc). Use the Mac OS Extended (Case-sensitive) format. Call the partition Boot. Set the second partition to empty space.

Insert the USB compact flash reader, and load the Terminal program from the menu.

The compact flash will be mounted under /Volumes/*Name*

In the following case it is called "Stuff"

Now do the following. We are making a folder efi on the boot partition, and setting the elilo.efo to automatically be loaded.

cd /Volumes/Boot
mkdir efi
cp /Volumes/Stuff/bzImage efi/vmlinuz
cp /Volumes/Stuff/elilo.efi efi/elilo.efi
cp /Volumes/Stuff/elilo.conf efi/elilo.conf
bless --folder efi --file efi/elilo.efi --setBoot

Now reboot. The elilo prompt should show. But we can't boot just yet...Time to install Linux.

Booted from the Mactel-Linux Live CD (holding down the C key to boot) and select linux and enter the option "mini" at the elilo prompt.

Once booted, you will probably want to type "reset" as you loose the last few lines off the bottom of the screen and its hard to work when you can't see what you're typing.

At this point I did the following

passwd root (and changed it to something)
dhclient eth0
apt-get install ssh

I then went to another machine on my network and ssh'd to the mac mini (easier to work with cut and paste etc).

Time to make some partitions.

Load "parted", and add a linux root partition and a swap partition.

Use "print" to display the current partitions and then

"mkpart ext2 231MB 59GB"

to make an ext2 partition from the end of the boot partition to the end of the disk minus 1gb (for swap) - Modify the start and end according to your disk size, and where the boot partition ends. Leave some space at the end for the swap partition.

Now do "mkpart linux-swap 59GB 60GB" (adjusting accordingly) to make the swap partition.

Now type "quit" to exit from parted.

Assuming you have just the Hidden EFI partition (does not show in the OSX Disk Utility), the Boot partition, the ext3 partition and SWAP, then the ext3 will be on partition 3.

Let's set up the filesystem

mkfs.ext3 /dev/sda3

Once it's setup as ext3, mount it on /mnt with

mount /dev/sda3 /mnt

Now it's time to install kubuntu (or debian if you would prefer. just bootstrap accordingly)

apt-get install debootstrap
debootstrap --arch i386 breezy /mnt http://archive.ubuntu.com/ubuntu/

Then make a few config files in /mnt

/mnt/etc/fstab

# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    defaults        0       0
/dev/sda3       /               ext3    defaults,errors=remount-ro 0       1

and

echo "nameofyourmachine" >/mnt/etc/hostname

Put your local dns in /mnt/etc/resolv.conf if required.

and "127.0.0.1 localhost" in /mnt/etc/hosts

Make a simple interfaces file for /mnt/etc/network/interfaces

 Used by ifup(8) and ifdown(8). See the interfaces(5) manpage or
# /usr/share/doc/ifupdown/examples for more information.

# The loopback network interface
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

now reboot.. your new install should start up.

once booted you can do

base-config
dpkg-reconfigure locales

/BuZz

Personal tools