Apple IIgs Network: Netatalk

Hardware Setup.

The standard Apple IIgs has a LocalTalk port for AppleTalk networking.  To bridge to Ethernet and connect to a Linux system, you would need a LocalTalk-Ethernet bridge or router.  I am currently using a Farallon EtherWave adapter, but others may work as well.  Some adapters and routers that *may* also work are:

  • Asante AsanteTalk
  • Cayman Systems Gatorbox
  • Shiva FastPath
  • Compatible Systems EtherRoute TCP
  • Compatible Systems RISC Router 3000-E

 

Netatalk Setup.

Install the netatalk package in your Linux system.  From a Debian distribution (and similar ones like Ubuntu and its variants), this is done through the Advanced Packaging Tool:

    apt-get install netatalk

The AppleTalk daemon needs to be enabled in /etc/default/netatalk.  Look for the ATALKD_RUN setting and set it to “yes”.  You will also need to modify the configuration file /etc/netatalk/atalkd.conf.  Mine has the following:

    eth0 -router -phase 2 -net 0-65534 -addr 1.30 -zone "Default"

The “1.30” is the AppleTalk node address I assigned to my Linux system, and “Default” is the AppleTalk zone.  Some LocalTalk-Ethernet bridges have an AppleTalk zone setting.  The bridge I am using uses “Default” as the zone name, and that is also what I have configured here.

In the standard package installation, netatalk only listens on TCP/IP (similar to what the AppleShare/IP product does) and not on DDP/EtherTalk.  The configuration file /etc/netatalk/afpd.conf needs to be edited.  I have the following:

    - -tcp -ddp -uamlist uams_dhx2.so,uams_clrtxt.so,uams_guest.so -nosavepassword -uservolfirst

The “-ddp” is what enables the afpd daemon to listen on DDP/EtherTalk.  You can also combine both “-tcp” and “-ddp” options into a single “-transall” option.

You’d also want to create your additional users who will be allowed to attach to netatalk, unless you only need guest access.  If guest access is desired, the AFPD_GUEST setting in /etc/default/netatalk should pertain to a valid user that has a home directory.

Login (using SSH, for example) into the Linux system as a valid user and create an AppleVolumes file in your home directory.  My AppleVolumes file contains:

    ~/A2BOOT/       "A2BOOT" casefold:toupper options:prodos 
    /media/usb0/    "USB0"

As the valid user, I create an A2BOOT directory under my home directory.  The first entry points to my A2BOOT directory which will be exported by netatalk as the “A2BOOT” volume.  I have another entry that points to the first mount point of a USB drive that I subsequently attach to the Linux system and mounted automatically by the Linux usbmount package.  This volume “USB0” becomes another way for my Apple IIgs to transfer files to and from my PC through the USB drive.

Once all the configuration has been completed, issue the following to restart netatalk:

    /etc/init.d/netatalk restart

 

Apple IIgs Setup.

The Apple IIgs uses one of only two authentication mechanisms: Clrtxt or Randnum.

To attach to a netatalk volume using cleartext authentication, use Marsha Jackson’s patched AppleTalk CDEV.  The standard CDEV that comes with System 6.0.1 sends the password incorrectly across the network and netatalk returns an authentication failure.

To attach to a netatalk volume using Randnum authentication, you need to have the Randnum UAMS available in netatalk.  The current binary distribution of netatalk does not have Randnum authentication, so you’ll need to find pre-built binaries for it or recompile the netatalk source package.

 

Compiling Netatalk.

Netatalk needs to be recompiled if you need the Randnum UAMS (authentication module) or the a2boot (netbooting) capabilities.  The Randnum UAMS, and the corresponding afppasswd utility to set the password, are dependent on cryptographic libraries.  This is usually provided by the openssl library package, which certain Linux packages are reluctant to link to.  I’ve got some source patches to use libgcrypt instead of openssl, but they have yet to be sent upstream and included in the standard distributions.

For the meantime, the netatalk package can be compiled and installed (with Linux root privileges) using:

    apt-get update
    apt-get source netatalk
    apt-get build-dep netatalk
    DEB_CONFIGURE_USER_FLAGS="--with-openssl --enable-a2boot" dpkg-buildpackage -us -uc
    cp ./debian/netatalk/usr/lib/netatalk/uams_randnum.so /usr/lib/netatalk/
    cp ./debian/netatalk/usr/bin/afppasswd /usr/bin/
    chmod +s /usr/bin/afppasswd
    cp ./debian/netatalk/usr/sbin/a2boot /usr/sbin/

You can also apply Steven Hirsch’s file timestamp fix by commenting out line 827 (as of the netatalk source package 2.1.2) of etc/afpd/file.c where the value of the change_date variable is being set during the AFP FILPBIT_ATTR command before building the package.

I have pre-built binaries for the Seagate DockStar (armel architecture) running the Debian “squeeze” distribution at //peterwong.net/files/apple2/netatalk-armel-files.tar.gz

 

Randnum Authentication.

If the Randnum UAMS is available, then the initial /etc/netatalk/afppasswd file can be created by logging in with root privileges and running “afppasswd -c”.  Standard users can then log in and set their own password entry in the /etc/netatalk/afppasswd file by using the “afppasswd” utility.

The Apple IIgs will always prefer Randnum authentication over cleartext authentication if the Randnum UAMS is available on the server.

 

Netbooting.

To accommodate netbooting, the a2boot daemon should be found in /usr/sbin/a2boot and needs to be enabled in /etc/default/netatalk.  Look for the A2BOOT_RUN setting and set it to "yes".  Create the /etc/netatalk/a2boot directory and copy the IIe and IIgs network boot blocks into that directory.  The boot blocks can be found in //peterwong.net/files/apple2/troika-3.tar.gz

Modify the /etc/init.d/netatalk script to invoke the a2boot daemon.  A sample modified script is included in //peterwong.net/files/apple2/netatalk-armel-files.tar.gz

Issue the following to restart netatalk:

    /etc/init.d/netatalk restart

To netboot an Apple IIgs, we need to temporarily create an AppleShare boot disk and perform a Network Server Startup installation from the System 6.0.1 installer.  An AppleShare boot disk can be created from the installer itself, but pre-made disk images, updated with Marsha Jackson’s patched AppleShare CDEV are available at //peterwong.net/files/AppleIIgsBootDisks/AppleShare-ROM1.zip (for ROM1 machines) and //peterwong.net/files/AppleIIgsBootDisks/AppleShare-ROM3.zip (for ROM3 machines).

Boot with the AppleShare boot disk, then attach the A2BOOT volume using the AppleShare CDEV.  Run the Installer from the System 6.0.1 Install disk, selecting a Network Server Startup installation.  It will copy files from the Install, SystemTools1, and SystemTools2 disks into the A2BOOT volume.

Aside from the patched AppleShare CDEV, the AppleTalk-related “Start” application found in the System 6.0.1 SystemTools2 disk should also be patched in the same way.  Geoff Body has provided the patch information and a patched “Start” file is available at //peterwong.net/files/apple2/AT.START.SHK.  The “Start” file gets installed in the SYSTEM folder on the A2BOOT volume.

An additional file needed during netbooting is the user’s ATINIT file.  This informs GS/OS what startup program to launch.  I’ve provided an example ATINIT file that simply launches the GS/OS Finder application located in the System folder of the A2BOOT volume.  You can edit this file using a binary file utility and change the startup application and the startup prefix.  Note the string length value on the byte preceding the actual strings.  The Apple IIgs Technical Note #77 describes the ATINIT file format.

ATINIT

For example, using the A2BOOT volume of the user “peter”, I create the ~/A2BOOT/USERS/PETER/SETUP directory and place the file in here.  Note the directory name corresponding to the user name.  You can either place the file from either within Linux or within the GS/OS mounted volume (from booting the AppleShare boot disk).  In the Linux system, the full directory path could be like /home/peter/A2BOOT/USERS/PETER/SETUP.

The need for the ATINIT file is because of the AppleTalk-related “Start” boot application that gets installed with the Network Server Startup installation.  If you don’t want to bother with the ATINIT stuff, merely copy a valid boot application into the “Start” boot application.  An example is replacing the SYSTEM/START file in the A2BOOT volume with a copy of the Finder application.  Another example is replacing the SYSTEM/START file in the A2BOOT volume with the “Start” boot application found in the System 6.0.1 Installer disk, which consults the SetStart setting in the control panel for the boot application to chain to.

Pictures of the Apple IIgs netbooting from netatalk:

SeagateDockStarNetatalk-1

SeagateDockStarNetatalk-2

SeagateDockStarNetatalk-3

 

Acknowledgements.

Thanks to Steven Hirsch for his efforts in getting Apple II support in netatalk; to Geoff Body for his great insight into AppleTalk and AppleShare, and Ivan Drucker for his work in Apple IIe netbooting that inspired me to investigate the same for the Apple IIgs.  A simplified description of netbooting an Apple IIgs from AppleShare 3.x running on a Mac can be found at http://www.vintagemacworld.com/iigs_rb.html.

One Response to Apple IIgs Network: Netatalk

  1. Peter Maloney says:

    As you probably already know, the vintagemacworld site is parked. Any alternatives?
    Apart from that I found your article just what I wanted; sincere thanks.
    Since the article isn’t date-stamped I don’t know if I’m talking to a ghost or what :).

    Thanks again,
    Peter M.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.