I tried Debian 3.0 for Sparc, but the version of kmail that it installed is not able to work correctly with my mailboxes (connecting via IMAP4 over SSL.) I know that the newer versions of kmail are able to work with these mailboxes correctly because my old workstation was an Intel machine running RedHat 7.3 and it works just fine, but there was no newer kmail package available (or any KDE3 packages available) at the time.
I downloaded the ISO file from the Gentoo-Sparc download site because I couldn't find any mirrors that had the ISO files.
I started the installation procedure by following the excellent Gentoo Sparc/Sparc64 Linux Installation Guide by Maarten Thibaut and adjusted the directions to match my situation.
One of the first things it tells you to do is to read through the Gentoo x86 Installation Guide. DO IT. It contains a functional overview of how the Gentoo installation system is structured, and if you've installed Linux before it illustrates the differences between Gentoo and most other distributions out there.
Following is a line-by-line list of the commands I used in order to get the system running. Note that the cyan-colored text is what I actually typed. Other colors appearing below reflect the actual colors of what I saw on the screen.
The Linux kernel loads itself, and eventually ends up with a root shell prompt. The first thing I did was moved the mouse a little bit (more to prevent its "initialized" message from showing up by surprise later on than anything else) and pressed ENTER to get another prompt.
The documentation wasn't entirely clear on this, but before you do anything else you need to make sure the machine has a working IP connection. When I set up the machine it was on a private network inside my office, behind a firewall.
After configuring the card, wait a few seconds for the ethernet card to announce that it's working, and then press ENTER.
Once the card is up, make sure you can reach your gateway, and then set the machine's default route. The default route should point to a live Internet gateway machine, because we will be using it later to download the Gentoo packages.
The next step is to create and initialize the disk partition which will become the root of your Gentoo system.
My system has a 36GB sda and a 9GB sdb. I actually ran fdisk twice- once for /dev/sda and once for /dev/sdb. I started by deleting all of the existing partitions and creating sda1 as a Linux (type 83) partition covering the entire disk. I also created a 2GB sdb1 partition for swap (type 82) and used the remainder of the second drive as sdb2, another Linux (type 83) partition.
Note: On SPARC machines, each physical disk will have a partition #3 with type 5, "Whole disk". DO NOT DELETE THIS PARTITION. The SPARC boot loader needs to see this partition in order to work with the disk. BAD THINGS WILL HAPPEN if you delete this partition. You have been warned.
The next step is to format the filesystems.
The next step is to mount the partition which will become your root filesystem and extract the installer image. Note that the image supplied on the CD contains stage-1, stage-2, and stage-3 images for the 32-bit "sparc" architecture only. Since I'm running a "sparc64" machine (and because I like the idea that every program running on my system was compiled on my system) I choose to go with the stage-1 image. This is the longest process because everything that ends up on your finished system is compiled from source. I'm not sure if the stage-2 or stage-3 images would also work on my machine- I would imagine they would, but it may leave you with a 32-bit-only kernel or something silly like that...
We need to set up the system's /etc/resolv.conf so that DNS names can be resolved, which makes it possible to find the download servers.
Note: Obviously you need to put in your own nameserver's IP address. Also, note that the file name here does NOT have a "/" in front of "etc".
We also need to set up /etc/make.conf, which controls how Gentoo builds the packages which will become your system. The stage-1 image contains this file, we simply need to customize it to match our machine.
Note that this file name also does NOT have a "/" in front of "etc".
The first change is to configure where to get the packages. Either I was using a development version of the CD, or Gentoo has moved their package repository since mastering the CD... anyway. Find the line containing:
Change the hostname and directory name to:
The other changes tell the compiler what kind of machine you have and what flags need to be in place when compiling the packages. You will see a bunch of commented-out blocks defining CHOST, CFLAGS, and CXXFLAGS. Somewhere in the file we need to add these three lines, but NOT commented out (i.e. no "#" in front of them.)
Note that there should be exactly ONE set of these lines which is NOT commented. Their placement within the file is not really important.
Also note that the "-O3" contains a capital letter "O" after the dash, not a number zero.
Save your changes. We are now ready to start compiling packages.
The documentation I was referring to containted a mount command for /proc at this point, followed by the chroot command which will lock the compiler into what will be our finished system. However, the mount command didn't seem to do anything, and the "makedev" package later on complains about not being able to read /proc/devices to figure out which /dev nodes to create.
Further investigation showed that the intent of the mount command was to have a live /proc filesystem accessible from within the chroot jail. This is the correct sequence of commands to set this up:
We are now running inside the stage-1 environment. The next step is to prepare the linker's cache and download the list of packages.
At this point the computer downloads a list of the package installers (not the actual packages) which make up the Gentoo distribution. This took about two minutes over a cable modem.
Watch these messages- the name rsync.gentoo.org actually points to several machines around the world, all of which are mirroring the packages. I happened to hit a mirror in Portugal which sent the first 450K or so and then unexpectedly closed the connection. Running emerge rsync again caused it to choose a different mirror (this time in Germany) and I was able to download the list in full.
When this step completes correctly, you will see a summary of the process- how many files were downloaded, the total bytes downloaded, and so forth.
The next step is to update the build system. The older versions of Gentoo used a file called /etc/make.profile to configure the build process. Newer versions use a set of files inside a directory with the same name.
The stage-1 environment (which was downloaded with "emerge rsync" above) contains a directory pre-configured for the sparc build environment. We need to remove the existing file and make the name into a symlink to the right directory.
We can now run the stage-1 script, which does the following:
When this process is done, the system is a Stage 2 Gentoo, and we can download and compile the next set of packages. THIS WILL ALSO TAKE A LONG TIME (on my system this took 5 1/2 hours.)
When this process is done, the system is a Stage 3 Gentoo, and we can download and compile our kernel. However, before we can build the 64-bit kernel (which the Sun Ultra series uses,) we need to compile and install the 64-bit compiler.
The next step is to get the actual kernel itself. However, because there are problems with the sparc64 kernel available through the Gentoo "portage" system, the document recommends that you download your kernel directly from kernel.org and compile it by hand.
I then expanded the source tree. The documentation tells about using the default configuration by copying arch/sparc64/defconfig to .config and then gives a convoluted sed command to customize the kernel.
Instead of manually doing this, I chose to manually configure the kernel in order to get rid of a lot of extras that my machine doesn't need (i.e. support for Sun SCSI controllers which aren't in my system, support for PCI, IDE, PCMCIA, USB, etc.) and to add modules to support just about every type of filesystem known to mankind (or "linux-kind"... my job involves reading and converting data from several other types of systems and it never hurts to have the modules available to support other filesystem types.)
If you customize your kernel, MAKE SURE TO INCLUDE SUPPORT FOR THE "devfs" AND "tmpfs" FILESYSTEMS. Gentoo's system boot scripts will not work without these two items enabled. When setting the options for "devfs", make sure to enable the "mount the /dev filesystem at boot" option, and disable the "devfs debugging" option.
The kernel and modules took a little over an hour to build. Once the kernel itself was built, the documentation said to check and make sure it's not bigger than 3.6MB due to a limitation of SILO. I'm not 100% sure what this is about, but it doesn't hurt anything to look.
We now need to compress the kernel for SILO, place it where SILO will find it, and set up SILO to be able to boot it.
My finished file contained:
The next step is to run silo to install the boot loader.
At this point the machine should be bootable. Time to try it out.
Eject the CD-ROM, and then press STOP-A.
This should reboot the machine, and when it boots it should boot into your new Gentoo Linux system.
For what it's worth, this is the point where I discovered that Gentoo requires the devfs and tmpfs options in the kernel. Luckily the core system was in place and I was able to manually rebuild the kernel. (Note that I did NOT use clean on the make line this time.)
The SUN boot monitor takes over and reboots the machine into the new kernel... the problem is now that the kernel's idea of the keyboard is totally wrong... time to boot the rescue kernel (the kernel on the CD is sorta rescue... it at least reads the keyboard correctly.)
Insert CD. STOP-A.
Here again I tried to log in as root and it wouldn't read the keyboard correctly. In addition, while it booted there was a message complaining about not being able to find /lib/modules/2.4.18/modules.dep.
At this point I did another STOP-A...
I waited about thirty seconds and turned the machine back on... it booted right into Gentoo by itself, and now was able to read the keyboard correctly for some reason. Who knows...
Since then, I have started using Aurora Linux on the machine, but this "war story" was too good not to hang on to.