Macintosh LC 475

Him
Home page  Photo gallery  Information

Installing NetBSD on an LC 475

As far as installation is concerned, I pretty much just followed this Guide to installing NetBSD, but I wanted to have all my notes in one place, hence I wrote this.

Requirements:

  • Mac with a 68020+68851PMMU, 68030+68882FPU or a 68040*
  • 8 MB RAM
  • A few 100 MB of hard disk to do anything useful
  • A supported ethernet card

*I replaced my LC's unsupported 68LC040 with a full '040

Installing

Firstly, you'll want to partition your hard disk if you've not done so already. I have a non-apple SCSI drive, so I used a patched version of HDSC Setup on a bootable system 7 floppy. It is worth noting that the NetBSD files themselves (temporarily) take up 50 MB on the Mac partition. I took 150 MB for the Mac Partition, 50 MB for NetBSD swap and the rest for NetBSD root&usr .

  • Boot from the boot floppy and start HD SC Setup
  • If you have multiple hard drives, click 'Drive' until you get the right SCSI ID for your drive
  • Click Partition
  • Delete the Macintosh partition (ERASES all your data!)
  • Create:
    • 150 MB standard Macintosh partition
    • 50 MB A/UX Swap
    • Whatever's left, use as a A/UX Root&usr partition
    • Click Done and Quit

I now had a blank hard disk, so I had to reinstall (as a minimum) 7.5.3, 7.5.5 updates, OpenTransport, Stuffit Expander and iCab. I used iCab to download the following:

Place these in a folder called 'Mac':

Place these in a folder called 'BSD':

Extract the Mac files but do not extract the BSD *.tgz files, this will happen automatically during the install.

Run the Mkfs program you extracted placed in the Mac folder and select the SCSI disk you partitioned.

Select the Root&usr partition and 'CHANGE' it to NetBSD Root & usr, then select the Swap partition and Change it to NetBSD Swap. Click each patition and 'FORMAT' them in turn - this takes a while. Click DONE to exit.

It's time to install, start the 'NetBSD/Mac68k Installer' program and choose your SCSI disk. Click File -> Install, then Add all of the .tgz files you placed in the BSD folder and then click 'done'.

Go to sleep, wash the cars, cook and eat Sunday lunch or whatever at this point, because this took hours on my LC. When the install Finally completes, choose File -> Build Devices and then quit the installer.

Run the BSD/Mac68k Booter. Choose Options -> Booting and tick 'Single User'

Click OK and choose Options -> Boot Now (cmd+b). If NetBSD boots, rejoice! If not, and you get an error regarding reading the filesystem here's that bad news: You need to start over from the Mkfs point and reinstall substituting kern-GENERIC.tgz for kern-GENERICSBC.tgz. Otherwise, lets continue.

Choose sh for the shell when prompted. Type:

# export TERM=vt100
# tset vt100
# clear
# mount /dev/sd0a

Mount might complain that the file system is dirty - don't worry, this gets taken care of. Now vi /etc/rc.conf and make these changes:

# Use program=YES to enable program, NO to disable it. program_flags are
# passed to the program on the command line.
#
sshd=yes
#JS: This enables you to log in through ssh

# Load the defaults in from /etc/defaults/rc.conf (if it's readable).
# These can be overridden below.
#
if [ -r /etc/defaults/rc.conf ]; then
. /etc/defaults/rc.conf
fi

# If this is not set to YES, the system will drop into single-user mode.
rc_configured=YES

# Add local overrides below
# JS: The host/domain name are for you to choose.  The default route is your
# gateway or router.
hostname="lc475"
domainname="local"
defaultroute="172.16.0.1"

Save the file and that's it, reboot by typing, err... reboot

Your Mac boots the Mac OS again, so load the NetBSD booter once more. Boot as before, but this time don't set single user mode (just hit cmd+b to boot). The Mac will pause for a looong time while generating the SSH keys - this made me chuckle, since it takes the blink of an eye on a modern PowerPC or x86.

Log in as root. Right away, set a password for root by typing:

# passwd

Now create a user for yourself (not stocksy!):

# useradd -m stocksy
# passwd stocksy

Add yourself to the wheel group by doing vi /etc/group. Add your name to the first line so it looks like:

wheel:*:0:root,stocksy

Type exit and log in as yourself. Now use type su to get root access again.

To set up networking, you need to know what type of card you have. Type dmesg | grep -i ethernet, it will return something like:

sn0 at nubus0 slot e: Macintosh LC Ethernet Adapter
sn0: Ethernet address 00:01:98:34:0c:05

We are interested in the first part of each line, in this case sn0. Create a file accordingly, e.g. vi /etc/ifconfig.sn0 and in it, specify your network settings:

inet 172.16.0.82 netmask 255.255.255.0

Those of you who have been paying attention will note that we haven't entered any nameserver addresses. Lets do that now by typing vi /etc/resolv.conf

domain spruce
nameserver 172.16.0.80
nameserver 172.16.0.81
lookup file bind

Enter as many nameservers as you (or your ISP) have. Set the domain to whatever you like, but do keep the lookup order as shown.

Save the file, reboot into Mac OS and boot NetBSD again. Try pinging/sshing to your Mac, if you can't, go back over the steps and see if you missed somthing.

I hate the csh/ksh shells that BSDs have and want to install bash right away. Lets do that.

% su -
# ftp ftp.gnu.org
ftp> cd /gnu/bash
ftp> get [latest version] e.g.
ftp> get bash-3.2.tar.gz
ftp> quit

# tar zxf bash-3.2.tar.gz
# cd bash-3.2
# ./configure && make
# make install
# /usr/local/bin/bash

Use chsh to set your shell to /usr/local/bin/bash. Do not set root's shell to bash with chsh, instead add the line /usr/local/bin/bash to the end of /root/.cshrc. In truth, it won't matter for this setup, but it is bad practice to use a 'fancy' shell for BSD root accounts since /usr could be on a separate (umountable) partition so that you can't get a shell in single user mode. It's also really easy to fat finger it and leave yourself unable to log in as (or su to) root!

Do Stuff

I hate faffing about with the default ftp client, so the first thing I did was get curl.

$ su -
# ftp ftp.sunet.se
ftp> cd pub/www/utilities/curl
ftp> get [latest version] e.g.
ftp> get curl-7.16.0.tar.gz
ftp> quit

# tar zxf curl*
# rm curl*.gz
# cd curl*
# ./configure && make
# make install

Now I can just retreive stuff with curl -O http://your.url/file.tar.gz

Because I am used to using sudo rather than su-ing to root, I wanted to install this.

$ su -
# curl -O http://www.courtesan.com/sudo/dist/sudo-1.6.8p12.tar.gz
# tar zxf sudo-1.6.8p12.tar.gz
# cd sudo-1.6.8p12.tar.gz
# ./configure && make
# make install