1. Introduction
Simple Linux/MIPS is the first in a series of prototype
GNU/Linux distributions from Project Foobazco. The ultimate
goal is a source-only install-and-go distribution. I chose the
MIPS target for the first prototype because the only existing
complete MIPS distribution (Hard Hat
5.1), is getting quite outdated, and the Debian port isn't yet
ready. And I happened to have an Indigo2 lying around doing
nothing.
Note that this distribution is quite crude, but features
somewhat more up-to-date software than Hard Hat. It may be a
good place to start for someone looking for a system they can do
development on, or someone who wants to build his own
distribution. It is definitely not for the "user" community,
though with some work it could be made to be. The main point of
this distribution is that it contains enough software
precompiled for someone to build any other set of software. In
this way, Simple Linux/MIPS is similar to what the base
installation environment for Foobazco GNU/Linux will ultimately
look like.
2. Getting Started
In order to make use of Simple Linux/MIPS you will need:
- An SGI Indy or Indigo2 R4x00 or R5000 based system
- XL (Newport) graphics, or a serial terminal
- A network
- A BOOTP server, a TFTP server, and an NFS server. Note that
these can all be on the same system. You will need about
90-100 MB of free disk space on this system. Alternatively, you
could skip the NFS server and burn the distribution to a CDROM;
this plan would save you about 85 MB of disk space. This method
has not been tested.
- The distribution. You will need at least the ECOFF
kernel and the base.tar.gz distribution from the
Foobazco FTP site, and if you want to install
additional packages (see below) you will need to get those
as well.
- About an hour of free time
- Lots of patience and a desire to hack
Note that you will NOT need IRIX installed on any
system. It should be possible to install Simple Linux/MIPS on a
factory-clean disk.
Setting up the server
As yet, there is no way to boot an SGI system from disk or CDROM
without using IRIX. Therefore you must boot from the network,
requiring a BOOTP and TFTP server. For my examples, the
following are true:
- The target machine is named steel-penguin and has IP address
192.168.1.2. Its ethernet address is obtained from the system
monitor by running
printenv and noting the value of
the eaddr variable.
- The server is named fallout and has address 192.168.1.1. It
is a Sun SparcStation 20 running Linux, with ISC dhcpd 2.0,
inetd, and standard tftpd.
To set up bootp, modify /etc/dhcpd.conf on the server so that it
contains an entry for the target. Mine looks like this:
subnet 192.168.1.0 netmask 255.255.255.0 { }
host steel-penguin {
hardware ethernet 08:00:69:07:1d:47;
fixed-address 192.168.1.2;
option host-name "steel-penguin";
option domain-name-servers 192.168.1.1;
option broadcast-address 192.168.1.255;
option routers 192.168.1.254;
option root-path "/home/sgi-linux";
}
Naturally you will have different values for all of these
variables. The root-path option should be set to whatever
directory you are exporting via NFS. You can get more
information on this file by reading the dhcpd man page. Once
you've configured dhcpd appropriately, make sure to start or
restart dhcpd. Note that you can also use other DHCP or BOOTP
servers besides the ISC one. Consult your system's documentation
for information on configuring these servers.
The next step is configuring TFTP. On my system, as on most,
tftpd is set up to serve files from /tftpboot. This can be
usually be changed if desired. You may have to enable tftpd if
it's started from inetd. Make sure your /etc/inetd.conf has a
line like:
tftp dgram udp wait root /usr/sbin/tcpd in.tftpd
If not, you may need to add one or uncomment it. Then send inetd
SIGHUP (something like killall -HUP inetd works well in Linux
and in IRIX) to reread the configuration file. If you are using
tcpd to wrap tftpd, as my system does, you may need to add an
entry for the target system in /etc/hosts.allow. If your system
uses a different inetd or tftpd, or runs tftpd directly, you may
need to make other changes according to your system's
documentation. Once tftpd is set up, create a directory
/tftpboot and place the Linux kernel there. Make sure the
directory has permissions 755 and the kernel itself has
permissions at least 444. The kernel I use, which should work on
most Indigo2 systems, is available
here. There is also an Indy kernel, since the Indy seems not to like EISA support. I found that my system would not boot an ELF kernel
without sash (the IRIX bootloader), and thus I made use of the
ECOFF kernel that the make boot rule produces. This
issue is addressed in the HardHat
Installation Guide.
The last part of the server setup is NFS. You will need to have either the userspace NFS server, or the appropriate kernel support and userland support programs installed. Most modern Linux distributions come with kernel support ready to use out of the box. If your system already has the proper support for NFS, all you will need to do is create a directory on a filesystem with at least 85 MB free space to hold the root filesystem and distribution files. I call mine /home/sgi-linux. Then add an appropriate line to /etc/exports, such as:
/home/sgi-linux 192.168.1.2(ro,no_root_squash)
It is fine to export the filesystem read-only, but to prevent
installation problems the no_root_squash option is helpful. Once
you've done this, make sure your NFS server daemons are running
and run the command exportfs -a to export the
distribution. Note that you may need to do various other things
according to your exact system and software configuration.
Finally, copy the distribution files into your chosen directory
(/home/sgi-linux in my case). There are four main distribution
files:
- base.tar.gz - This package is required. It should be
unpacked in the root distribution directory. (12MB compressed,
40MB installed)
- devel.tar.gz - You will need this package if you want to
compile software. Since this distribution is fairly useless by
itself, I strongly recommend you install this. (20MB compressed,
??MB installed)
- doc.tar.gz - Contains the man pages, info pages, groff, man
page viewer, and info page viewer. This package is
optional. (6.5MB compressed, ??MB installed)
- extras.tar.gz - Contains a few bonus utilities including
flex, bison, readline, and ssh. This package will create
/usr/local and install there. Note that flex and bison are
required for building some software; however, you can build them
yourself without this package if you want. Take note of export
and/or patent restrictions on ssh. You are responsible for
complying with the law in this regard. (1MB compressed, ??MB
installed)
You must unpack base.tar.gz in the distribution root
(/home/sgi-linux). Do not unpack the other packages. Place all
four packages (or whichever ones you choose to install)
somewhere within the distribution tree - I simply placed them in
/usr/src for the time being. Do not place them in /mnt or /proc.
Your server should now be set up for installation.
3. Installing the Distribution
Actually installing the distribution will be quite simple
provided your server is working properly. To start, bring
up your SGI in boot monitor mode. If you are using a
serial console, choose option 5 when prompted. If you are
using a system with graphics, choose Stop for Maintenance
and then select Enter Monitor. Note: If your system has
an XZ framebuffer in it, you must remove it prior to
booting and use a serial console instead. The XZ
framebuffer will likely prevent your system from booting
Linux even if you are not using it.
Once in the firmware monitor, issue the following commands
(works on my Indigo2 at least; you may need to make some
modifications for your system. See SGI's publications for
system-specific information.
unsetenv netaddr
boot -f bootp()vmlinux-2.2.14-r4x00-cvs.ecoff init=/bin/sh
If everything is working properly, your system will boot
into single user mode and issue you a # prompt. If this
does not happen, check your server configuration again,
and read any pertinent log files (like /var/log/messages
or /var/adm/SYSLOG). If the kernel does not boot, but
issues an oops or panic, please contact me and I
will try to build a different kernel for you. The provided
kernel is quite generic and should support most common
hardware including SCSI controllers, disks, cdrom drives,
XL graphics, SGI Seeq ethernet adapters, and even Indy
Vino video, if present.
Getting to this point is by far the hardest part.
Hopefully a SILO-like bootloader will be available for SGI
systems in the future, which would allow booting from
ISO9660 CDROM or from ext2 filesystems (much as sash does
for efs and xfs filesystems). In the meantime, properly
configuring the server(s) is the most important part of
the installation process. Note that you may wish to try
setting the netaddr PROM variable to the target system's
address (192.168.1.2) instead of unsetting it. I found
that if I did not unset that variable, the boot process
would hang without fetching a kernel. Your mileage may
vary, however - SGI's documentation indicates that netaddr
should be set, so perhaps this is just a bug in ISC dhcpd.
Partition and mount your disk(s)
You will need to decide what disk(s) you want to use for
Linux. If you have two disks, I recommend leaving the
first as an IRIX disk and installing all of Linux on the
second. If you do not have or want IRIX, or have only one
disk, you can just scratch everything. I used a setup with
two disks and no IRIX; sda is a 1GB disk, and sdb is a 2GB
disk. We will assume that neither has disklabels of any
kind. Your labeling process will undoubtedly differ; this
is for illustration only:
# export PATH=/bin:/sbin:/usr/sbin
# fdisk /dev/sda
At this point I instructed fdisk to build a new SGI
disklabel ("g"). I then added two partitions, swap (sda2,
170MB), and root (sda1, 800MB). Note: it appears that
you need to "walk backwards" from the end of the disk to
the beginning for fdisk to generate the proper
partitions. This is obviously a bug. I then changed
type on sda2 to 82 (Linux swap), wrote the label, and
exited. I followed the same procedure for sda2, except I
made only one partition covering the entire disk.
Note: I recommend a single partition for the entire
distribution - you need about 180 MB if you install
everything, one for swap space, and optional partitions for
/usr/local and /home. Do NOT put /usr on its own
filesystem; your system will not boot if you do; this
is because, like IRIX, Simple Linux/MIPS avoids
complicated decisions on what to put in /bin versus
/usr/bin and simply has /bin as a link to /usr/bin. You
may safely assume that everything in the base.tar.gz
backage is required to be available for booting.
At this point you should enable the swap space if your
system has less than 64 MB of memory.
# mkswap /dev/sda2
# swapon /dev/sda2
Next, make ext2 filesystems on each of the partitions you
plan to use:
# mke2fs /dev/sda1
# mke2fs /dev/sdb1
Finally, mount your new root filesystem on /mnt:
# mount -n /dev/sda1 /mnt
Unpack the distribution and lay out your filesystem
You now must unpack the base distribution in your new root
directory. Use the following command:
# cd /mnt && tar xpzvf /usr/src/base.tar.gz
or whatever location you used for the distribution files.
You should now make any additional mount points under
/mnt. For example, if you will be using a filesystem
mounted at /opt, you will need to create a directory
/mnt/opt. Then, mount your additional filesystems below
/mnt. In my example, I will use /dev/sdb1 as /home:
# mkdir /mnt/home
# mount -n /dev/sdb1 /mnt/home
Note that this is not strictly necessary, unless some of
the files in the other packages should go into other
filesystems, or you wish to place some files on those
filesystems prior to rebooting.
Now unpack any remaining packages you wish to use:
# cd /mnt && tar xpzvf /usr/src/devel.tar.gz
# cd /mnt && tar xpzvf /usr/src/doc.tar.gz
# cd /mnt && tar xpzvf /usr/src/extras.tar.gz
At this time you may want to look around and familiarise
yourself with your new system - everything under /mnt will
be available to you when you reboot. If you wish to make
changes or bring in additional files from your NFS server,
now is as good a time as any.
Now it's time to configure your new system and reboot.