|
Installing Linux
Starting the Installation Program
Note: This section is based on installing Yellow Dog Linux, Champion Server version 1.2.1
To install Linux, you have to boot the iMac from a bootable Linux distribution CD. To do this:
- Put the Linux Distribution CD in the CD-ROM Drive.
- Click on the Special menu.
- Click on Restart.
-
Hold down the letter C key while the iMac restarts. This time you will not see a smiling Mac, but rather some text at the top of the screen that says:
Welcome to yaboot version 0.8.
Wrong partition 1 signature
Config file read, 556 bytes.
Welcome to Yellow Dog Linux!
Hit for boot options.
boot:
I am not positive about this, but the message "Wrong partition 1 signature" is either an issue with the Yellow Dog CD I burnt, or it is a message relating to the fact that there is a Apple Mac OS partition on the hard drive. If someone knows what this really refers to please send a note and I will update this document. Hit the Tab key. If you don't hit the Tab key within a couple of seconds the system will boot into the default (install) configuration.
-
When you hit the Tab key, the display will look something like this:
boot:
linux linux-novideo *install
install-novideo cd-linux cd-linux-novideo
You can also type in custom image locations, in the format
{prom-path;}partno/path-to-image or {prom-path;}{partno}[start-end]
boot: I recommend you use the:
install-novideo
option. This is a confusing point, and one that is poorly labelled. The "novideo" implied to me that the installation would proceed with no user prompts or messages, an unintended install if you will. So I was reluctant to select this option. With my iMac, if you do not choose a "novideo" then Linux hangs during the boot process after initializing the USB ports. It seems as if "novideo" really means "safe video", and it actually appears to effect the configuration of the video parameters. The only way I can work with the Yellow Dog distribution of Linux on my iMac is with "novideo". Therefore at the boot: prompt type
install-novideo
and then press the return key to boot into the Linux installation program.
- You will see a few messages such as "loading kernel" and "loading ramdisk", and you may see a few more instances of the "Wrong partition 1 signature" message, but eventually you will see "Tux" the Linux icon and a variety of text messages about devices, and processes that Linux is starting up. Eventually you will see a Welcome screen, acknowledging the installation program and some copyright information. Hit the return key to select Ok.
At this point you are in the Linux installation program, and frankly this is pretty straight forward. Use the Tab and the Arrow keys to move the cursor from field to field on the screens or from a field to a button. Use the space bar to select options. In some cases, the highlighted field will be a different color. Use the return key to select buttons (like the Ok or the Back button).
Eventually you will get to the first really tricky part-Disk Setup. As this requires some explanation, it is covered in the section below.
Creating Linux Partitions
I found creating the Linux partitions do be one of the most confusing steps. It was like playing the old version of Adventure ("you are in a maze of twisty passages"), and everything you type only gets you more frustrated.
Here is why this may be confusing. First of all you have already run one partitioning program when (if you are following these guidelines) you logically split the hard drive in your iMac into one partition for the Apple Mac OS, and left the remaining space for Linux. So now, you are going to run a Linux based partition program to allocate the Linux space into logical pieces that the Linux OS will mount as file systems.
Another reason why this is confusing is that when you run the Linux partitioning program and look at the Apple partition you already created you will see that the Apple installation program has further subdivided it into even more pieces. Let's continue and you will see what I mean:
- The Disk Setup screen implies you can use either Disk Druid, or fdisk, but as we are creating a dual boot system, and there is a Macintosh partition on the disk, the only choice is fdisk. So press the tab key to move the cursor to fdisk, then press the return key to start the fdisk utility.
- The Partition Disks screen will show you the drive in your iMac. In my case, it finds a single device:
/dev/hda - Model QUANTUM FIREBALL SE4.3A - Model Q
If you had more than one drive, it would list here too. But for the case of the normal iMac, press the Tab key to move the cursor to Edit andthen press the return key.
-
You will move to a command mode console. You will see a message:
This is the fdisk program for partitioning your drive.
It is running on /dev/hda.
Edit /tmp/hda -
Command (? for help):
Type in a ? and press the return key. In addition a list of the available commands, here are the important instructions for the fdisk program. Read them carefully:
Notes:
Base and length fields are blocks, which vary in size between media.
The base field can be p; i.e. use the base of the nth partition.
The length field can be a length followed by k, m, g, or t to indicate
kilo, mega, giga, or tera bytes; also the length can be p; i.e. use
the length of the nth partition.
The name of the partition is descriptive text.
The key information in these directions is that you can specify the area of the drive you wish to work on relative to the partition number. Also you can specify the length of the partition you want to create in kilo-, mega- or gigabytes. The following table lists the commands for your reference:
| Command |
Description |
|
h
|
Help-See a list of the available commands. |
|
p
|
Print-Print out or list the current partition table. |
|
P
|
Print-Print ordered by the base address. |
|
i
|
Initialize the partition map. |
|
s
|
Size-Change the size of the partition map. |
|
c
|
Create-Create a new partition, standard MkLinux type. |
|
C
|
Create-Create a new partition with type also specified. |
|
n
|
Name-Rename a partition. |
|
d
|
Delete-Delete or remove a partition. |
|
r
|
Reorder-Reorder a partition map. |
|
w
|
Write-Write out, or make permanent, any changes you have made. |
|
q
|
Quit-Quit the partitioning program, if you quit before doing a write (w), then all of the changes you made are lost (this is a safe way to just back out any changes). |
Note: The commands (letters) above are mixed case. Upper case letters may signify a different command then the same lower case letter.
- So, when you start the Linux partition program, the first command you want to type is p, and then hit the return key just to see the current state of the drive. The display will look something like this table:
I have pulled the output into a table to make it easier to read.
|
#
|
type
|
name
|
length
|
base
|
size
|
|
1
|
Apple_partition_map
|
Apple
|
63
|
@ 1
|
|
|
2
|
Apple_Driver_ATA*
|
Macintosh
|
54
|
@ 64
|
|
|
3
|
Apple_Driver_ATA*
|
Macintosh
|
74
|
@ 118
|
|
|
4
|
Apple_Driver_IOKit
|
Macintosh
|
512
|
@ 192
|
|
|
5
|
Apple_Patches
|
Patch Partition
|
512
|
@ 704
|
|
|
6
|
Apple_HFS
|
untitled
|
4208640
|
@ 1216
|
( 2.0G)
|
|
7
|
Apple_Free
|
Extra
|
4208960
|
@ 4209856
|
( 2.0G)
|
Under the partition table is some additional information:
Device block size=512, Number of Blocks=8418815 (4.0G)
DeviceType=0x0, DeviceID=0x0
Drivers-
1: @ 64 for 20, type 0x701
2: @ 118 for 33, type 0xf8ff
Command (? for help):
These partitions are created by the Apple Mac OS installation program for the following reasons:
|
Partition Name
|
Partition Contains
|
|
Apple_Partition_Map
|
A partition map
|
|
Apple_Driver_
|
A device driver
|
|
Apple_Driver43
|
A SCSI Manager 4.3 device driver
|
|
Apple_MFS_Partition
|
Original Macintosh File System (64K ROM version)
|
|
Apple_HFS_Partition
|
Hierarchical File System implemented in 128K and later ROM versions
|
|
Apple_UNIX_SVR2
|
Partition uses the UNIX file system
|
|
Apple_PRODOS
|
ProDOS file system
|
|
Apple_Scratch or Apple_Free
|
Partition is empty or unused
|
For more information on Apple disk partitioning you might want to read the following articles:
So, with all this information, how do you read this information. Well, the first five partitions on the hard drive contain information that the iMac needs to boot and run the Apple Mac OS, including a map of the partition, device drivers and patches. The sixth partition is the drive ("untitled") where I actually installed the Apple Mac OS. The seventh partition is free or available.
If you try to allocate space in an existing partition, or you try to allocate more space for a partition, then you will see this message:
requested base and length is not within an existing free partition
If you followed the earlier instructions for partitioning the drive to reinstall the Apple Mac OS then there should be about 2.0 gigabytes free. I wanted to create at least four distinct Linux partitions, with the following names: root, usr, home and swap. To do this:
- At the Command (? for help): prompt type c then press the return key.
- At the First block: prompt type 7p then press the return key.
- At the Length in blocks: prompt type 500m then press the return key.
- At the Name of partition: prompt type root then press the return key.
- At the Command (? for help): prompt type p then press the return key. Note that now the Apple_Free Extra partition is partion 8.
- At the Command (? for help): prompt type c then press the return key.
- At the First block: prompt type 8p then press the return key.
- At the Length in blocks: prompt type 800m then press the return key.
- At the Name of partition: prompt type usr then press the return key.
- At the Command (? for help): prompt type p then press the return key. Note that now the Apple_Free Extra partition is partion 9.
- At the Command (? for help): prompt type c then press the return key.
- At the First block: prompt type 9p then press the return key.
- At the Length in blocks: prompt type 500m then press the return key.
- At the Name of partition: prompt type home then press the return key.
-
At the Command (? for help): prompt type p then press the return key. Note that now the Apple_Free Extra partition is partion 10.
Note: Now it is time to create a swap partition. Having read the fdisk instructions, I assumed that I had to use the uppercase letter C, and then allocate the swap partition with a type of "swap". But when I did this, the Yellow Dog Linux installation program could not recognize it for the next step.
- At the Command (? for help): prompt type c and then press the return key.
- At the First block: prompt type 10p then press the return key.
- At the Length in blocks: prompt type 128m then press the return key.
- At the Name of partition: prompt type swap then press the return key.
- At the Command (? for help): prompt type p then press the return key. Note that now the Apple_Free Extra partition is partion 11.
At this point you can go ahead and create another partition with the remaining space, or continue on by writing out these changes and making them permanent. Before you do that, it wouldn't hurt to write down the information on the partition map so you will have it for later reference. At this point, if I type in the letter p to see the print-out of the partition changes I have made, my new partitions look something like this
|
#
|
type
|
name
|
length
|
base
|
size
|
|
7
|
Apple_UNIX_SVR2
|
root
|
1024000
|
@ 4209856
|
(500.0M)
|
|
8
|
Apple_UNIX_SVR2
|
usr
|
1638400
|
@ 5233856
|
(800.0M)
|
|
9
|
Apple_UNIX_SVR2
|
home
|
1024000
|
@ 6872256
|
(500.0M)
|
|
10
|
swap
|
swap
|
262144
|
@ 7896256
|
(128.0M)
|
|
11
|
Apple_Free
|
Extra
|
260416
|
@ 8158400
|
(127.2M)
|
-
Type in w and press return to write (save the changes you made) to the partition table. You will see a message that says:
Writing the map destroys what was there before. Is that okay [n/y]:
-
Type in y and press return. You will get a message that says:
pdisk: Re-read of partition table failed (Device or resource busy)
Reboot your system to ensure the partition table is updated.
- Type in q and press return.
- Power off and restart the iMac, holding down the C key to boot from the Linux distribution CD. If you need instructions on doing this see Starting Linux earlier in this document.
Note: I know of no way restart the installation at the step after creating the Linux partition. Therefore you will have to go through the screens to get back to the fdisk program.
- When you get back to the fdisk program again, type p to print out the partition table to ensure that the changes you made are in effect. So after looking at the partition table, type q (to quit the fdisk program).
- At the Partition Disks screen press the Tab key to select Done and then press return.
- You will see a screen that says Current Disk Partitions, and in the upper right hand side of the screen it may say "Setup Filesystems". You should be working with a drive named hda, and it should show you information about the allocated space, free space and other drive parameters. Use the down arrow key to select hda7, which is the first Linux native partition in the list. Then press the Tab key to move the cursor to Edit and then press return.
- In the Mount Point: text box, type in / (forward slash, which represents root). Then press the Tab key to move the cursor to Ok and press return.
- Press the Tab key and the up or down arrows to move the cursor to highlight hd8, and then press Tab to move the cursor to Edit. Press return.
- In the Mount Point: text box, type in /usr Then press the Tab key to move the cursor to Ok and press return.
- Press the Tab key and the up or down arrows to move the cursor to highlight hd9, and then press Tab to move the cursor to Edit. Press return.
- In the Mount Point: text box, type in /home Then press the Tab key to move the cursor to Ok and press return.
- In the Current Disk Partitions table you will see that hda7, hda8, hda9 respectively will be mounted as / (root), /usr, and /home. Press Tab key to move the cursor to Ok. Then press return.
- Leave the Mount Point: text box empty and then press the Tab key to move the cursor to Ok and press return.
-
At the Active Swap Space screen, make sure the selected device is the swap space. On my iMac following the instructions outlined here, it would be:
/dev/hda10
- The asterik in the square brackets [*] means the drive is selected. Use the Tab key to move to the Check for bad blocks during format option and press the space bar to select the option. Press Tab to move the cursor to Ok and press return.
- You will see a message that the swap space is being formatted and then a message that the packages are being scanned. Then you will see a Partions To Format Screen. Use the Tab and the Arrow keys and the space bar to select every Linux drive (/, /home and /usr or /dev/hda7, /dev/hda8, and /dev/hda9 respectively. Then press the Tab key to move the cursor to Ok and press return.
Selecting the Packages You Want
Eventually you will get to a Components to Install screen, so carefully think about the packages or software and utilities you want to install. Once you have made a primary selection, you may be told that you have to install some additional packages, because the packages that you selected have dependencies on packages you did not select.
Finishing the Installation
From here on the end of the installation is pretty straight forward. You may want to select the option to emulate a three button mouse, and you may want to configure a printer and network parameters, such as an IP address for your iMac's ethernet card. Again, this is hard to provide details as the mouse, printer and network address that I use are not likely to be appropriate in your scenario. These steps are not too confusing if you understand your own environment.
Once the installation completes, the computer will need to be rebooted. Are you done? Almost, you still have to tell the iMac how you want it to boot now that there are two operating systems installed on it, and you have to finish configuring Linux. Back to Table of Contents
Changing How the iMac Boots
yaBoot
yaBoot is an Open Firmware based boot loader for New World ROM iMacs (and other PowerPC- based computers). For more information on yaBoot, including sources and binary files see , which also contains information about alternative boot loaders.
After completing the installation of Linux, boot the iMac to the Apple Mac OS. In my case (using YellowDog Linux) the yaBoot files that I needed are in the installation folder of the Yellow-Dog Linux. Copy these files to the Apple Mac OS System folder:
|
File
|
Description
|
| yaboot |
The yaboot (executable) program. |
| yaboot.conf |
The configuration file for yaboot. Right now this contains the options you saw when booting from the YellowDog Linux CD. |
| vmlinux |
The linux kernel to boot the computer from. |
| bootscript |
A script that controls the booting (if the space key is pressed during the power on sequence, then the iMac will boot from Linux, if the C key is pressed the iMac will boot from the CD) otherwise, the iMac will boot into the Apple Mac OS. |
| ramdiskimage.gz |
A ram disk file. |
Double-click on the yaboot.conf file to open it for editing with SimpleText. You can delete all of the lines in the file and then type in:
image=hd:6,vmlinux
novideo
label=linux
root=/dev/hda7
The first line points to the Linux kernel. The hd:6 is partition six on the harddrive, which on my iMac was the Apple_HFS partition.
|
6
|
Apple_HFS
|
untitled
|
4208640
|
@ 1216
|
( 2.0G)
|
The four backslashes () point to the system folder in this partition, and the vmlinux is the Linux kernel file that was copied into the system folder.
The second line, novideo is the command that seems to create a stable video environment for Linux on the iMac (which is why you selected the Install-Novideo option when booting from the Linux CD-ROM).
The third line, label=linux tells the yaboot program to load the kernel vmlinux.
The fourth line root=/dev/hda7 indicates where the root Linux partition is; on my iMac, the root partition is Apple_UNIX_SVR2 root.
|
7
|
Apple_UNIX_SVR2
|
root
|
1024000
|
@ 4209856
|
(500.0M)
|
Save yaboot.conf with the appropriate parameters for your iMac.
Open Firmware
Open Firmware is the process that controls the microprocessor after hardware initialization and diagnostics are performed, but before the main Operating System is passed control. It is responsible, among other things, for building the device tree and probing the expansion slots for I/O devices. Open Firmware queries PCI devices for its address space needs and dynamically assigns this space to each device. It is during this probing process that each device and motherboard ASIC is given a node in the device tree. Open Firmware also represents the scariest part of installing Linux on an iMac. For more information on Open Firmware see (the opening paragraph of this section was cut and pasted from this source) or you can go to
To enter the world of Open Firmware, restart your iMac while holding down the four keys, the Command, Option, O and F keys.
When your iMac boots into Open Firmware the screen will display something like this:
Apple iMac Open Firmware 3.0.f2 built on 04/23/99 at 14:31:03
Copyright 1994-1999 Apple Computer, Inc.
All Rights Reserved.
Ok
0>
At this point, type in printenv and hit return to see a list of the current Open Firmware parameters and their values:
Needs formatting
0>printenv
------------- Partition: common -------- Signature: 0x70 -----------
little-endian? false false
real-mode? false false
auto-boot? truetrue
diag-switch? false false
fcode-debug? false false
oem-banner? false false
oem-logo? false false
use-nvramrc? false false
use-generic? true true
default-mac-address? false false
real-base -1 -1
real-size -1 -1
load-base 0x800000 0x800000
virt-base -1 -1
pci-probe-mask -1 -1
screen-#columns 100 100
screen-#rows 40 40
boot-device
boot-file
diag-device floppy floppy
diag-file diags diags
input-device keyboard keyboard
output-device screen screen
mouse-device mouse mouse
oem-banner
oem-logo
nvramrc
boot-command mac-boot mac-boot
forced-boot
fw-scsicfg
fw-boot-path
default-client-ip
default-server-ip
default-gateway-op
boot-script
ASVP 0110??01063;
More [, , q] ? _
ok
0>
At the > prompt, type in:
setenv boot-device hd:6,bootscript
and then hit the return key.
This is setting the Open Firmware boot device to the correct partition, and telling Open Firmware to execute the bootscript file in the system directory. The bootscript is a program that detects whether or not the spacebar or a letter c is being pressed when the iMac is booting. If the space bar is depressed, then Open Firmware will pass control to yaBoot and Linux. If the letter C is depressed then Open Firmware and yaBoot will pass control to the operating system on the CD in the CD-ROM drive. Otherwise, Open Firmware will boot into the Apple Mac OS.
At the >: prompt, type in:
boot
and hit the return key.
At this point when I reboot, I expect to be able to hold down the space bar to get the iMac to boot Linux, but regardless of which key I hold down, I get a diskette with a ? over it, and eventually the Mac OS. What am I doing wrong. Back to Table of Contents
Configuring Linux
Conflinux Back to Table of Contents
Back to page 1...
|