[f] [Project Foobazco]

Unsuccessfully predicting the end of the world since 1765.

Simple Linux/MIPS 0.1 Installation

Updates

2000-06-18: Chris Ruvolo has reported that if you use Linux 2.3 on your TFTP server you will need to do

echo 1 > /proc/sys/net/ipv4/ip_no_pmtu_disc

or else your SGI will not boot. Linux 2.2 and IRIX work fine with no special tweaking. You'll know you have this problem if your tcpdump output shows the Don't Fragment (DF) bit is being set.

2000-05-31:

It turns out that the requirement to unsetenv netaddr before booting is in fact a dhcpd bug. The latest 3.0 beta of ISC dhcpd fixes the problem.

2000-05-20:

I've added an Indy kernel (same as the other without EISA) to the kernels/ directory after finding that my other one panics on Indy. I also found that Newport console support does indeed work. Unfortunately I can't do a lot of testing on Indy.

What is this?

This document describes, in a non-HOWTO-compliant format, how and why to get Simple Linux/MIPS 0.1 up and running. Simple Linux/MIPS is a product of Project Foobazco and the distribution itself is made available to you under the GNU General Public License. The software comprising Simple Linux/MIPS may be distributed under different licenses.

Table of Contents

  1. Introduction
  2. Getting started
  3. Installing the distribution
  4. Configuring your system
  5. Notes

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.

4. Configuring your System

There's a lot you can do here - I'm sure the experienced admins are thinking that they'll want to replace simpleinit with something less crude, or install PAM and shadow passwords, or make any number of other sweeping changes. That's fine; this section is not for you. I will cover here only the basics, especially what you'll need to get a functional, networked system up and running. Note that you can skip this section entirely if you want a standalone machine, or one which uses my default network settings (you don't).

The basics

First, chroot yourself:

          # cd /mnt && chroot .
	  

This will put you in a working environment identical to what you will have when you next boot up.

Choose a password for root. By default, root has the empty password. If you have installed ssh, the ssh daemon will start by default, so it's important to restrict root access. To do this, use

          # passwd root
	  

You may wish to add a user account at this time; you'll have to do this by hand using vipw and passwd as there is no other method for user management. After this, the most important changes to make are the creation of an /etc/fstab, and network configuration. You will want to list each of your filesystems, along with a procfs and your swap partition(s), in /etc/fstab. To do this, edit /etc/fstab and add lines of the form:

          /dev/sda1    /       ext2 rw 1 1
          /dev/sda2    none    swap defaults 0 0
          /dev/sdb1    /home   ext2 rw 1 2
          /proc        /proc   proc defaults 0 0
	  

Next, you will need to configure your network. Please note that the default configuration has no NIS support. The relevant files to modify are /etc/resolv.conf, /etc/rc.local, and /etc/rc.net. You will probably want to specify a nameserver to use for DNS, if one exists on your network. To do this, add a line like

          nameserver 192.168.1.1
	  
to /etc/resolv.conf. You can read more about this file if you installed the doc package by doing "man resolver".

You will next want to change your hostname in /etc/rc.local. Specifically, change the lines:

          echo "hostname is steel-penguin"
          hostname steel-penguin
	  
to reflect your choice of hostname. Note that if you are booting over the network using a suitable dhcpd you will have routing and interface configuration done for you by the kernel. If you have additional ethernet devices, or if you need to add or modify routes, you can do this in /etc/rc.net. Normally, you will not need to modify this file.

Console setup

If you are using a serial console on serial port 0, you will not need to make any further changes. If you are using a serial console on port 1, or if you are using the framebuffer console, you will need to make changes to /etc/inittab. Change the line

          ttyS0:vt100:/sbin/agetty -Lh 9600 ttyS0
	  
to something like
          tty1:linux:/sbin/agetty 9600 tty1
	  
if you are using the graphics console.

That should be it. At this point, you should give the following commands to unmount your filesystems and reboot:

          # exit
          # cd /
          # umount /mnt/home
          # umount /mnt/other_filesystem ...
          # umount -n /mnt
          # swapoff /dev/sda2
          # sync
          # reboot
	  

When your system next comes up, go into the firmware monitor and issue a command like:

          boot -f bootp()vmlinux-2.2.14-r4x00-cvs.ecoff root=/dev/sda1
	  
to boot from the network and use your new system disk. If all goes well, your system should come up and offer you a login prompt. If you installed the extras package, you should now be able to log in using ssh from a remote system in addition to the console. Have fun!

5. Notes

You can find out more about Linux on SGI systems at the SGI Linux site. Though some of the material is dated, they have some FAQs, installation guides, source code, and patches.

There is also a majordomo mailing list at linux@cthulhu.engr.sgi.com. This is an active list.

Most (all?) of the source for Simple Linux/MIPS is available, along with some patches, at the Simple Linux/MIPS ftp site, along with the distribution and kernels. I believe in Free Software, and this is a 100% Free system. If you are aware of anything I'm distributing that does not have source available at the above location please let me know. I am not trying to circumvent the distribution requirement; it's just that some parts got lost in the shuffle. I will be happy to make them available to you.

You can contact me with questions, praise, and damnation at wesolows@foobazco.org. I'll try to help you if I can, but since I've been using Linux/MIPS for all of seven days now, you're probably better off asking general questions (ie, not questions about this distribution specifically - don't bother them with that) on the main mailing list. If you want to work on a MIPS GNU/Linux distribution, I would prefer that you work with the Debian MIPS people to get that going instead, as they are trying to produce a full-featured distribution, which Simple obviously is not, and never will be. If, however, you are interested in working with me on Foobazco GNU/Linux, I welcome all interest.

( top ) ( home )