


		Debian/m68k GNU/Linux 2.2 (Potato).

		Installation Instructions for Macintosh (v2.0).

		Mark Scott June 2000

About this Guide. 

This guide is intended to help you install the Debian/m68k GNU/Linux
(Debian) base system onto your 68k based Macintosh.  The most recent version
of this document is on-line at the Linux/m68k web site
(www.linux-m68k.org/dists.html).


Introduction.

Debian for Macintosh, or other computers using the Motorola 680x0, is less
than four years old.  Considerable development progress has been made but
there is still a lot to do, and a lot of bugs may be undiscovered.  Debian
is not commercial software so installation is challenging and may not be
smooth or even possible for your hardware.  The Mac project web site lists
the supported models, if your model isn't listed, assume it's not supported
yet, ask on the mailing list, or give it a try, but please don't be
disappointed if it doesn't work.  Debian will not run on machines without a
paged memory management unit usually this means you will need a 68030 or
better cpu.  You may have success with a 68020 processor plus separate fpu.

Debian distributions are known by various names.  This version, 2.2, is
known as potato, the previous version, 2.1, is known as slink and the version
before is hamm.  You may find this helpful when navigating WWW and FTP
sites.


Before you start.

Backup your current System, you can do a lot of damage very easily if you
are new to Linux or Unix in general. If you have a spare hard drive or other
media, this is the chance to use it for creating a backup. You will be
required to partition your hard drive if you wish Linux to reside on the
same hard drive as the MacOS.  This can be a lengthy and tedious process but
is also highly dangerous. If in any doubt backup before going any further
and ensure you have the original system and software disks on hand.
	
	Check out if your system is suited for Linux/m68k
	(www.linux-m68k.org/status/sysreq.html)
	Read the Linux/m68k FAQ (www.linux-m68k.org)
	Check the Macintosh project web site.

Tools you will need.

MacOS tools required to prepare your system for Linux installation.  

You will need Disk Partitioning software.  As part of the partitioning
process you will need to edit the partition type.  If your chosen editor
lacks this functionality you will be able to do it as part of the
installation process.  You may need StuffIt expander (5.5 or newer) or
MacGzip in order to unpack or decompress the installation files you
downloaded. 


Files you will need.

Installation by downloading files from FTP sites.

Files can be obtained from one of Debian's FTP sites (ftp.debian.org). A
list of mirror sites can be found at www.debian.org/distrib/ftplist.  Please
choose the site closest to you.  No matter which site you use, the path to
locate the files should always be:
 debian/dists/potato/main/disks-m68k/current/

You will need all of these files:
	mac/linux			(install kernel)
	mac/root.bin			(install ramdisk image)
	mac/drivers.tgz			(kernel loadable modules archive)
	mac/images-1.44/rescue.bin 	(boot floppy image)
	mac/images-1.44/driver.bin	(drivers floppy image, see drivers.tgz)
	mac/Penguin*.hqx		(Penguin boot loader and documents)
	base2_2.tgz			(base System)

Or you will need these two files:
	macinstall.tgz			(tar archive of all the files above)
	base2_2.tgz			(base System)

When downloading, the precise directory structure, as shown on the FTP site,
needs to be preserved (with base2_2.tgz in some folder, and a subdirectory
mac/ and mac/images-1.44/ with the correct files in it). If you downloaded the
macinstall.tgz archive, just unpack it somewhere on your hard disk, e.g. in
a directory named "install" (the most recent version of StuffIt Expander
will handle the tar format) and the correct mac/ directory structure will be
created. macinstall.tgz may contain more files than absolutely needed for
installation, but don't worry about that. Just copy base2_2.tgz into the 
directory holding the install directory and you're set.

The files rescue.bin and driver.bin are not MacBinary encoded, using MacBinary
mode will corrupt these files. So use a simple binary transfer protocol. The
file base2_2.tgz is a gzipped encoded file and will transfer properly. If your
FTP application doesn't automatically decompress these files, decode using 
StuffIt Expander or other decoder. Do not decompress the base2_2.tgz or
drivers.tgz files. This will be done for you as part of the installation 
process.  You need these images because the Installer requires MS-DOS floppy
images (the rescue.bin and driver.bin files) to install the kernel and modules.


Partition your hard disk

I recommend you partition using Apple's HD SC Set-up utility obtained from
ftphqx.info.apple.com/Apple_Support_Area/Apple_Software_Updates/US/Macintosh/Utilities
or other proprietary disk tool. If your partition editor doesn't have an
option to edit the partition type, you can do this crucial step at a later
stage (from the booted temporary install ram disk).  There is a partitioning
tool for Linux/m68k called mac-fdisk.

A number of disk tools (mostly the 'Lite or 'PE' editions) lack this
functionality, so make sure you get the right tool for this step.  Apple HD
SC Set-up can be used for third party disks if patched as described in
http://www.euronet.nl/users/ernstoud/patch.html.

The partition editor from the MkLinux project is at
ftp://ftp.mklinux.apple.com/pub/wip/pdisk/latest/ and is available as a 68k
version.

DiskTool (available at the Mac68k FTP site
ftp.linux-m68k.org/pub/linux-mac/mac-utils/), FWB's HDT 1.8 (not the PE
version) and SilverLining (not the Lite version) all have the required
functionality.  This list is not complete, if you know of other options,
please let me know.

When partitioning, please keep in mind that Linux will be launched by the
'Penguin' bootstrap program, which is a MacOS application. This application
will shutdown your Mac and start Linux.  Therefore you need a working MacOS
system to boot Linux, so if you destroy your MacOS start-up partition in
this step you will have to reinstall the MacOS before you can start over
again!

If your Mac's hard drive has only one partition make sure you have all
necessary media to boot and reinstall MacOS after partitioning, or get a
spare hard disk instead. You cannot boot Linux directly from a loader in the
boot sector of your disk on a Mac.

You should reserve at least two partitions for Linux.  One for the "root
file system" and another for a "swap partition".  Size recommendations are:

Root partition

The absolute minimum should be 42 MB  This is just enough to install the
base system and nothing else - probably enough for testing it, but not for
really using it.  A reasonable system starts at around 200 - 400 MB, with no
upper limit.

Swap partition

At least twice the size of your main memory.  Especially on systems with
little main memory (e.g. 8 MB RAM).  Do not go below 20 MB for swap space.


Naming conventions

This is important because under Linux your partitions referred to with
different names than under MacOS.  This is the naming scheme:

	The first SCSI hard disk is referred to as "sda"
	The second SCSI hard disk (if you have one) is referred to as "sdb", and
        so on.
	The first IDE hard disk is referred to as "hda", the second IDE hard
	disk is named "hdb", and so on.

Note that you do not need to rename your hard drives when operating your MacOS.

The partitions on each hard disk are represented by appending a decimal
number to the hard disk name: sda1, sda2, sda3 represent the first, second,
and third partition of the first SCSI hard disk in your system. MacOS uses a
separate partition for the partition table and driver data, so there will be
more partitions around, usually partition 1 and 2.

Here is an example: assume you have a system with 2 SCSI hard disks, one at
SCSI address 2 the other at SCSI address 4.
The first disk (at address 2) will be named "sda", and the second "sdb".  If
the "sda" hard disk has 5 partitions on it, these will be named "sda1",
"sda2", ...,"sda5".  Similarly for the "sdb" hard disk and its partitions. 
Note Linux refers to all components of a system as devices.  The full name
of your hard drive will be /dev/sdan where 'n' is the number of each
partition.  Now that we know the partition names, you can change their type
from within your partition editor so that the Installation program can
detect them.

Start your chosen partition editor, select the disk you want to use, select
the "Partition Drive" function and select/create the partition you want to
use as the Debian root file system.  For Apple's HD SC Set-up select
'Custom' partition option, and create partitions as needed.

Debian needs A/UX type partitions to install Linux on, 'A/UX Root' or 'A/UX
or Root&Usr' should be fine for the data partitions. You may need to delete
partitions to create space for new ones; HD SC Set-up doesn't support just
changing the partition type.  DiskTool offers these choices and allows
editing of the partition type.

After creating the root partition, create a partition to be used as a swap
partition, set the partition type to 'A/UX swap'.
Note:
	Your root and swap partitions do not need to be on the same hard disk.
	You can have more than one partition for files besides the root file 
	system.  For example separating the user's home directories from the
	system file area. If you want to use more partitions, prepare them
	just like the root partition.
	If you're only going to try Linux for a short time, it's enough to
	just have a single partition for files.

Write down the partition names, "sda1" etc., of all the partitions you are
going to use for Linux.  Also write down the partition name, Linux-wise, of
the partition in which you have downloaded the installation files i.e sda3
or whatever it is.  You will need this information later in the installation
process.  When you have made all required changes go back to the main window
of the editor and prepare to "Save Changes". At this point be very careful, a
mistake will cause you to lose valuable data.  Double check you have the
right information in the right place before you save your changes.


Start the Linux Installation process.

Double-clicking on the "Penguin" icon in the "install" folder starts the
Installer.  The Penguin starts up, shuts down the MacOS, loads a kernel in a
ram disk and starts the installation program.  

You need to set the path for the Kernel and ram disk (root.bin) correctly for
your system on first start. Start up holding down the 'command' key until
Penguin has finished loading and reading the preferences file.  Go to the 
Settings" dialogue (shortcut: command-T) and adjust the path for Kernel and
ram disk by clicking on the appropriate buttons in the upper right corner of
the panel.  The Kernel and ram disk are in the 'install/mac' directory on the
drive where you unpacked the macinstall.tgz archive.  Save the settings to the
preferences file in that directory (using command-S) and boot using the
command-B shortcut. The Penguin will shut down the MacOS and start the
installation process.

If installing from CD-ROM, double click on the "Penguin" icon in the
/install/mac directory on the CD.  Do this after you have copied the
Penguin18.hqx file to your hard drive, deBinhexed and unpacked it. Put
root=/dev/ram in the kernel options and set kernel and ramdisk path.

The screen will change colours, a few seconds of delay, and after that a
black screen with white text should come up, displaying all kinds of kernel
debugging information. After a couple of seconds, the installation program
should start automatically. If you get up to this point, you can be quite
confident that you will be able to install Linux on your system.  If the
installation program complains about not finding any disks or partitions to
install on check your partition types and paths again.

The installation program will lead you through a series of steps, preparing
the partitions for Linux, unpacking and configuring the kernel modules and
base system and finally rebooting.  You move through the information
presented in each screen by using the cursor keys, use the TAB key to
confirm your selection and Return or Enter to move to the next step.  Some
of the steps are not necessary or even possible on m68k platforms. The
installation program is the same on all architectures supported by Debian
and some features are not available in the m68k version.


The main installation screen.

This lists all the actions you can take, with the next logical step
highlighted at the top of the list.  Please follow the recommendations
unless you know what you are doing or like to live dangerously.


Configure the keyboard.

Select the one appropriate for you.

Partition a hard disk
If you have not done so under MacOS, you can now partition your
harddisk(s) and select some of them to use them as Linux ext2 and swap
partitions. Type "m" for a short help, "p" to print the partition table,
"t" to change the partition type.


Initialise and Activate a Swap Partition.

After pressing Return, you will see a list of partitions that the
installation program has found as being prepared by you for use as a swap
partition.  There is probably only one choice, and it should have the same
partition name you wrote down while you were preparing that partition with
your disk utility.  If the installation program doesn't offer any swap
partitions to chose from, switch to a shell (Execute a Shell in the menu)
and run the command mac-fdisk -l. The output of this command should help you
in troubleshooting the problem.  If you have chosen to use several swap
partitions, repeat these steps for all of them.  When asked whether you
really want to initialise this partition as a swap partition, think twice,
then press Return.  At this point the swap partition will be initialised,
formatted and ready for Linux.


Initialise a Linux partition.

Similar to the previous step, but this time referring to partitions used to
carry files.  You will be presented with a list of partitions that the
Installer found to be valid as Linux file system partitions. Again, for each
of the partitions you have chosen to use (sda4 etc.), accept it by selecting
it from the list and (when you are sure) select "Yes" to initialise the
partition.  You will then be asked if you want to mount the currently active
partition (e.g. sda4) as root ("/") partition. Say "Yes" here at the first
partition you use.


Install Operating System Kernel and Modules.

Select the medium on which you have the installation files, i.e. CDROM,
if you are installing with the official CD-ROM, or the harddisk
partition on which you copied the mac subdirectory (or unpacked the 
"macinstall.tgz" archive).
After that you can either enter the path to the directory containing
the installation files or press <Return> to let the installer build a
list of all directories with installation files (this may take a little
time).

The hard disk will operate for a while, the activity light may also blink,
as the kernel and modules are unpacked onto the root partition, and returns
you to the main screen.


Configure Device Driver Modules.

This step is necessary if certain device drivers need to be loaded very
early when Linux starts up later.  For example, an Ethernet driver has to be
pre-loaded so that networking will be initialised and ready at boot-time.
For a stand-alone system you probably don't have to configure anything here,
but you should still select this item. This will enable the Installer to
build a list of available kernel modules. When you see the next screen,
select "Exit: Finished with modules. Return to previous menu".

If you do need to configure a device driver for your system, please follow
the on-screen explanations for selecting modules to be pre-loaded.  After
selection, the installation program will ask if the selected module should
be installed, then display help text explaining possible module options
(mostly empty) and prompt for module parameters.  Few modules are available
for the Mac kernel, none of which require module parameters, so leave the
module parameters empty. When done, select "Exit". Once your Linux system is
installed, you can get back to the configuration of modules at any time by
starting the "modconf" program.


Configure the Network.

This last step will enable networking if you are connected to a Network. 
The help screen suggests you answer "No" to the question whether your
computer is connected to a Network.  I advise you follow this suggestion and
complete the Network configuration after booting the system. The 'pppconfig'
utility is included in the base system for this purpose.  You also have a
DHCP option.  DHCP is commonly used on Ethernet and Ethernet like Networks
to automatically give hosts an IP address and network address information at
startup.  If you need this option consult a good book, it is beyond the scope
of this guide.

If you are not connected to a Network all you need enter is your hostname. 
Linux requires every computer to have a name, pick something you like -- just
one word, please, with no gaps or spaces.

If you are connected to a Network, you need to enter:
	Your Network's name
	The IP address of your computer
	The netmask
	Your broadcast address
	Your gateway's IP address, if one is available
	Your nameserver's IP address, if there is one available.
	Your type of connection - Ethernet, PPP, Slip or whatever else.


Install the Base System.

Specify where the base system archive is located. This file is named
"base2_2.tgz".  If you put it into the same directory as the other
installation files, you know what to do now.  Select "Hard disk: File system
on the hard disk", pick the correct partition and (if necessary) enter the
path name to the directory containing those files.

If you are installing from CD-ROM, select "CD-ROM" and enter "/install" as
the path.  Press Return, scroll down to the proper path press Return
accepting the default options.  At this point you've got a few minutes time
(depending on the speed of your processor/hard disk) while the base archive
is unpacked onto the Linux root partition. On a slow Mac, e.g. IIsi,
unpacking the base system takes around 30 to 45 minutes. Be patient; this is
a good time to make a cup of coffee or whatever you prefer and relax.


Configure the Base System.

Select the timezone that you're in.  Use TAB to select your nearest city
location. When asked whether your system clock is set to "GMT" (Greenwich
Mean Time), you have a choice. Most users use the local time instead of GMT. 
You choose.

Ignore the next suggested step, "Make Linux bootable directly from hard
disk", this is not possible on a Mac.  Select "Reboot the System". After a
few seconds, the Mac should reboot automatically into MacOS.  If the Linux
kernel hangs on attempting to reboot, just press the reset button at the
back of your Mac.

One last step is required before you can startup your freshly installed
Linux directly.  Go to the directory containing the installation files and
start up the Penguin, holding down the 'command' key.  Go to the Settings'
dialogue (command-T), and locate the kernel options line which should look
like root=/dev/ram video=font:VGA8x16 or similar.

You need to change the entry  root=/dev/yyyy.  Replace the yyyy with the
Linux name of the partition onto which you installed the system (e.g.
/dev/sda1), you wrote this down earlier.  The 'video=font:VGA8x8' is
recommended especially for users with tiny screens, the kernel would pick a
prettier (6x11) font but the console driver for this font can hang the
machine, so using 8x16 or 8x8 is safer at this stage.  You can change this
at any time.

If you don't want to start Linux immediately each time you start, uncheck
the 'Auto Boot' option.  Save that file, using the 'Save Settings As
Default' option.  If you installed from CD-ROM, copy "Penguin-18" and
"Linux" to a folder on your hard drive, and create the preferences as
described above.

Now double click the "Penguin" icon to start your freshly installed Linux
from the hard disk instead of the ram disk file system.  The boot sequence
will take longer than when you installed the system because a database of
filenames has to be built.  You are then automatically logged in as root,
the privileged or superuser, and need to take these steps:

	Set a password for the root user (the administrator account)
	Create another (unprivileged) user account
	Activate Shadow passwords giving you improved security -- a good idea !
	Determine whether you want to continue installing the system via a PPP line 
	or not, and configuration of the PPP connection scripts.
	Set an "installation profile" of packages you want to install.

After these steps, you are automatically directed into the interface-driven
package installation manager.  Packages give you the ability to do work with
your new Linux.  Packages can be found in the following directories:-

	/pub/debian/dists/potato/main/binary-m68k/		Core section
	/pub/debian/dists/potato/contrib/binary-m68k/	Contributed section
	/pub/debian/dists/potato/non-free/binary-m68k/	Packages not conforming to 
							the Debian Free Software 
							Guidelines

Package selection has already been performed if you didn't skip the
"installation profile step" above.  I advise you, at least, select the media
you are going to install packages from and update the package listing.  You
have the ability to set network servers to use for downloading packages when
using the apt facility if you have a suitably fast link. You may also use
the apt installation facility for new installations from CDROM. The APT
facility is the next generation package installation manager for Debian
Installations.  There is a good explanation of this system in the file
release-notes.en.txt in the mac branch of the ftp site tree.  The package
listing file is in each of the directories above.

You can complete installation and configuration when ready.  When leaving
this program, you are logged out automatically and can now log in as root or
as an unprivileged user if you created one before.

Hopefully you now have a basic Debian Linux installation running on your
Macintosh.  There are, however, a few tasks left for example configuring
your network protocol.


Configuring your Network Protocol.

You will need to do this if you wish to use a Network and did not configure
PPP or SLIP earlier. Edit /etc/chatscripts/provider (entering your username
and password for your ISP account, plus change the 'name' and 'word' to
whatever the prompt at login is.  Some configurations require you send the
string 'ppp' to start up PPP after login, just add another expect/send pair
after the password for that. Rename and save the file with a name of your
choice The commands "pon" <your filename here> and "poff" <your filename
here> start and stop the connection respectively.  By default only the root
user has permission to use these files.  Of course when logged in as root
you may grant this privilege to any other user.  This is probably a good
idea as it is very easy to do damage when logged in as root unnecessarily.

SLIP is more difficult.  Examine the "/etc/init.d/network" start-up script
the "ifconfig" command has already been inserted for you.  Add a "slattach"
command before this, if you use static SLIP.  Dynamic SLIP should be set up
using "dip", so you'll need to install this package.

If you answered "No" to the question is your computer is connected to a
Network you will have to create the file /etc./resolv.conf `containing the
line "nameserver <ip-addr>" where <ip-addr> is the address of your ISP's
name server host.


Shutting down the System.

To shut down a running Linux system, you must not reboot with the reset
switch on the front or back of your Macintosh, or turn off the computer. 
Linux must be shutdown in a controlled manner, otherwise files may be lost
and disk damage incurred.  You will need to perform recovery procedures
which are detailed in any good book on Linux or Unix.  You have a selection
of shutdown options, press the key combination Ctrl-Alt-Del,
Control-Shift-Power should also work. Or log in as root and type shutdown -h
now, if either of the key combinations do not work or you prefer to type
commands.

More information sources :-
		The Debian GNU/Linux homepage.
		The Linux/m68k domain's homepage.
		The Macintosh project pages.
		Visit us on IRC, channel #linux68k, server irc.lame.org (or connected 
		servers).
		hundreds of other Linux- or Debian-related Web sites around the world.
		comp.os linux.m68k.

History of this installation guide:.
v0.1	July 20th, 1998		First version, only ASCII text.
v1.0	August 3rd,1998		Pushed to HTML, small additions & typo corrections.

Macintosh version:.
v1.0	August 9th, 1998	Based on Frank Neumann's Amiga version.
v1.1	August 29th, 1998	Updated for 2.0r2.
v1.2	September 5th 1998	More warnings .
v1.3	September 24th, 1998	Even more warnings .
v1.4	February 11th, 1999	Modified for Debian 2.1.
v1.5	March 6th, 1999		Addition of CD install option.
v2.0	June 21st, 2000		Rewrite for Potato, minor format changes, 
				additions and minor corrections.
Acknowledgements 
Frank Neumann 		for generating the Amiga install guide on which the first 
			Mac Guide version was based.
Michael Schmitz 	for authoring the previous Guides used as the template for 
			this Guide and helping many, including me, install Linux on 
			a Macintosh.
Adam di Carlo		for managing the boot-floppies area of the Debian CVS which
			contains this, other Guides and much much more :-)
Christian Steiges	for building new distributions and being tolerant under 
			extreme provocation.

and the many others who have contributed in some way to the Debian Project.

Disclaimer and small print

Published under the Terms of the Debian GNU/Linux Licence.  All trademarks,
mentioned explicitly or not, are acknowledged and are the property of their
respective Owners.  This guide draws on many sources including the
experiences of the Linux m68k user base.  However the responsibility for all
errors and omissions remains mine alone.

Mark Scott, Last change: June 21, 2000.

