			PPC Macs as LTSP Clients
			    Version 0.1

This is a writeup of how to get started using Power Macintoshes
as LTSP clients. My system uses a Power Mac 6100 and an Intel server
running Linux Mandrake 8.1. Obtaining and reading the references,
especially 1-3, is important. I assume a familiarity with the Mac
in general, and a familiarity with how the LTSP server works.

Skip Gaede

sgaede@attbi.com
20-Mar-2002

References:

1) LTSP Document
2) Nubus-Pmac web site: http://nubus-pmac.sourceforge.net
3) HOWTO install Linux on Nubus 6100
http://www.sonic.net/~mroeder/beowoof/installingLinux.html
4) HOWTO Cross-Compile Linux Kernel
http://lists.linuxppc.org/linuxppc-nubus/200103/msg00035.html
5) Devfs FAQ
http://www.atnf.csiro.au/~rgooch/linux/docs/devfs.html
6) Root over NFS clients & Server HOWTO
http://www.linuxdoc.org
7) YellowDog Linux: http://www.yellowdoglinux.com

What's Supported with this kernel:

The kernel I compiled supports:

Apple Power Macintosh 6100,7100,8100
Apple PowerBook 1400,2300,5300
Apple Performa 5200,6200,6300

(See the Nubus-pmac web site and YDL for more details)

Limitations:

The kernel used for Nubus PMacs is considerably hacked 
from the stock kernel.If you have a PCI-based PowerMac
you might be able to use the YDL 2.1 Kernel and XFree86
4.x.

I am using the MkLinux Boot code. 

The 6100s use the Xpmac frame buffer driver for X 3.3.6.
This driver totally ignores the XF86Config file. 

The fix for the backspace and delete keys applies to the
script /etc/X11/xinit/fixkeyboard in Mandrake 8.1. 

Basic Concept:

The client starts to boot the MacOS (7.5.3), and loads 
the MkLinux Boot Extension. It then finds out we are 
booting Linux and loads the image "Mach Kernel" which
contains the Linux kernel and an attached InitRD. The
startup script obtains a DHCP address and where to find
the root directory, which is then mounted RO using NFS.
A Pivot_Root call is then made to switch over to the NFS
mounted filesystem, and the SysVinit process is executed.
Based on configuration parameters in the /etc/lts.conf
file, the runlevel is established, the video driver is
selected, and the swap partition on the local hard drive 
is prepared and enabled. A small RAMDISK is setup for 
apps that need to write configuration files, and the 
client is logged into the remote server.

Changes:

If you're not using a Nubus PMac, you'll need to recompile
the kernel. If you have different Video, you will need only
to modify the lts.conf file.

Kernel build options not in the standard build:

1) Support for devfs
2) Packet and Socket filtering (for dhclient application)
3) Input layer support for YDL 2.x software. 

Things you will need:

Client:

MkLinux Boot code
Stuffit Expander
MacOS 7.5.3 or better. (I used a virtual disk shared from
   a Mac used as a repository for the client software. The
   OS and a Network Access floppy can be d/l from Apple.)
Linux kernel with InitRD.

Server:

DHCP daemon
LTSP Kit for i386 (to setup NFS,etc.)
Ppc tarball (about 30 MB)
Netatalk code for downloading from Linux server.


Things you may need include:

BusyBox 0.6.1
LTSP Utilities source code
LTSP InitRd kit
YDL 1.2 Install CD (or Cable Modem connection for FTP)
Kernel sources
 
Getting started:

Get either your server or a Mac setup as a repository
for the MacOS install volume and the various software
you'll need on the development client. I used a Mac
with 7.5.3 OS, Netscape 4.0 and Stuffit Expander 5.5.
Files on my server were transferred to the Mac using
Netscape / FTP, and were unpacked with Stuffit. They
were placed in a shared directory tree for the clients.

To get the first Mac running Linux, I followed the 
reference on Installing Linux PPC on a Power Macintosh
6100. Use custom partitioning, and allocate 

1) A Macintosh partition, size = 25000 (sda3)
2) A swap partition, size = 100000     (sda4)
3) Root+Usr partition, size=<the rest> (sda5)

Install the MacOS:

I installed 

1) the minimum kernel
2) Appleshare
3) OpenTransport
4) CD support
5) Chooser
6) Startup disk
7) Memory widget in Control Panel
8) Date/Time applet in Control Panel

If you are doing a Network Install, you can install
the MkLinux boot code (and the YDL Installer kernel
if you plan on installing YDL.)

Reboot to the Mac OS and turn off memory management.
Edit the Lilo.conf file from the MkLinux Control Panel
widget, as described in Michael Roeder's article.

Install Linux:

The only omission from Roeder's article was the fact 
that the install of YDL 1.2.1 neglects to create a
/etc/fstab. I created one (for /proc and / by going
to the second terminal while loading the rpms and doing 

cat >/mnt/etc/fstab <<EOF
/dev/sda5  /          ext2     defaults     1 1
proc       /proc      proc     defaults     0 0
/dev/scd0  /mnt/cdrom iso9660  ro,noauto    0 0
EOF

I installed Linux on the first client to verify that it
worked. As things were found to work, I could then create
a Mach Kernel with an InitRD and test it without 
disturbing the development environment. I installed a base
system (150MB) + X Window support (70-80MB). Later, I added
the compiler. The libraries needed on the server can be 
copied from the development client using NFS.

For subsequent clients, you only need to partition the
disk and install the MacOS, MkLinux boot code and the Mach
Kernel with InitRD image (and Stuffit Expander). 


Development environment:

You'll need a way to get the boot image down to the Macs.
The easiest way is to use Netscape on the client and FTP
on the server. A second way is to setup Appletalk on the
server and create a share with the Gzipped files for
download. Stuffit 5.5 is used to uncompress the files
after download. A second Mac with Netscape and Stuffit 
makes it possible to download from the internet and share
the files to other clients. For production clients, the
kernel(s), the MkLinux boot package, and the kernel image
are all you need.

Random notes for building the kernel for MkLinux boot:

For building the kernel, the command is "make zImage".
For building a kernel with initRD the command is 
"make zImage.initrd". The gzipped RAMDISK needs to be named
ramdisk.image.gz, and copied into the linux/arch/ppc/appleboot
directory before building the kernel. The final product
will also be in the appleboot directory, and it will be
called "Mach Kernel".

Deployment steps:

Get Mac MAC addresses for all clients.

Server:

1)  Install dhcpcd RPM
2)  Install i386 Core and configure nfs, dhcp, ...
3)  Install PPC tarball
4)  Setup DHCP, hosts, FTP, NFS, Appletalk, kdm
5)  Fix keyboard script (discuss what's going on)
6)  Create client accounts with custom desktop (include custom
    kickerrc file. Note: assign trash location to an area that
    the user does not have write access to.)
7)  Login to custom accounts and init Netscape
8)  Create autologon entries in kdmrc file
9)  Make adjustments to rc.local and lts.conf as desired.
10) Make changes to the font server port, and include AbiWord
    fonts in font path if desired...

Clients:

1) partition disk
2) Install MacOS
3) Install MkLinux boot code
4) Install Stuffit Expander
5) Install Mach Kernel with InitRD for LTSP


Software Kits:

1) ltsp_server_v0.1.ppc.tar.gz: unpack from /opt/ltsp
   This contains the binaries and config files
   lts.conf will need to be edited
   
2) ClientKernels_v0.1.ppc.tar.gz: unpack under your FTP  
   directory or netatalk Macintosh volume. The one you need
   for production is MachKernel2.4.6-3aRAM.gz. Download this
   to the extensions folder, decompress it with Stuffit Expander
   and rename it to "Mach Kernel". 

3) ltsp_initrd_ppc_v0.1.tar.gz: unpack in a directory of your 
   choice. You may wish to also unpack the i386 kit for reference
   and for the Busybox config file.
   
4) ltsp_utils_kit (noarch): if you need to recompile them. Note 
   getltscfg.c needs to be patched as the variable 'c' in main
   needs to be defined as a long at line 399, and then cast as 
   type char in line 421.
   
5) Stuffit Expander 5.5 (www.aladdinsys.com)

6) Netscape 4.05 (68k) (www.netscape.com)

7) MkLinux Boot code (nubus-pmac.sourceforge.net)

8) Network Access Disk / MacOS 7.5.3 (www.apple.com)

9) YellowDog Linux 1.2.1 (www.yellowdoglinux.com)
   (NB: I found a site in Austrailia that still had the ISO image,
   ftp://planetmirror.com.au/pub/yellowdog/iso)

10) Netatalk source code (http://sourceforge.net/projects/netatalk)

