OneFreeVoice

May 6, 2006

Debian on SPARC

Filed under: Code — Gregory Haase @ 11:50 am

Last Tuesday at the LUG/IP Hardware SIG Jerry showed up with a couple of old Sun SPARCstation4 machines. They were going to the great machine recycling center in the sky unless someone wanted them. While I don’t necessarily have a use for the machine, I thought that attempting to get Linux running on it might provide some new experiences, so I grabbed the machines. These were just boxes – no keyboard, mouse or monitor included.

LUG/IP President Ed Corrado has a few of these machines laying around, and offered me a monitor and keyboard, but I declined the offer – one of my main goals being to get a bit of experience using a serial terminal.

The one I’m working with has a 110Mhz CPU, 96MB of ram, and 1.1GB SCSI Hard Drive. Not very big/fast for today’s standards, but I think I might be able to so something with it, so I’m giving it the benefit of the doubt.

The first thing I needed to be able to do was see what was going on when the thing powered-on. A quick google told me that with no keyboard or monitor, the default output is routed to serial. I went out and got a db9 to db25 adapter and a null modem adapter at RadioShack (I already have various cables laying around). I’d previously read Brian Jones‘s minicom hack in Linux Server Hacks, volume Two, so I knew this was the way to get into the machine. Unfortunately, it just didn’t seem to be working. After about an hour of digging, I discovered more udev/devfs madness going on with my workstation. It had /dev/ttyS0 symlinked to /dev/tty/0 which was symlinked back to /dev/ttyS0. Well that’s no good. I deleted the symlinks and restarted udev. Contrary to most posts that I read on the Internet, you don’t actually have to reboot your machine to fix a udev issue. There is a shell commnad “udevstart” that will populate the initial device directory. Once this was done, I fired up minicom again and I was looking right into the SPARCstation.

The next thing I needed to do was see if I could actually get some form of linux running on this thing. With no CDRom or Floppy drive, that meant using netboot. Since my workstation is a gentoo-amd64 machine, I looked there first for help. The first google hit turned up the very helpful Gentoo Linux based Netboot HOWTO. I just followed the instructions on screen, and in less than 15 minutes I had the SPARC running a minimalist Linux kernel.

Now that it was confirmed the machine would actually run, it was time to see if I could actually get a permanent install going. Surfing around, I found that SPARC isn’t exactly currently supported – a lot of posts and references referred to Red Hat 6.x and other ditros that were current more or less when the SPARCstations were current. I found that Debian has a currently maintained port. That’s okay, since I run Debian on one of my laptops, and I’m pretty familiar with it.

The Debian SPARC Installation guide is a bit out of date, but it had the necessary information required to complete the install. I grabbed the SPARC net-install image off of a mirror, and replaced the previous netboot image with it. I rebooted the SPARC, and in no time at all the installer started up. This was going to be a piece of cake — or so I thought.

The first major problem I had was with drive partitioning. Apparently, there’s a problem with the SunOS disk label. When you try to partition the drive, it only sees the first 68MB. It presents you with 1.1GB, lets you select the size (defaulting to 1.1GB), but when you write the changes, it defaults down to 68MB and says there is no more space on the disk. After searching around a bit, I found this was a known issue, and the way to fix it was to reset the disk label. All of the instructions I found showed how to do this in fdisk – go back to the main installer window and execute a shell and use fdisk. That became another problem because the particular version/flavor of installer I was using had parted instead of fdisk. After floundering around a bit, I found the mklabel command in parted and got the disk relabeled. The machine had to be rebooted, and the net-installer was now able to use the whole disk.

The second major problem was again with drive partitioning. In a way, I created this problem myself, but it really wasn’t my fault. All the documentation, posts, etc. that I read concerning the partitioning (quite a few!) mentioned that for SPARC the third partition always needed to be a special “Whole Disk” partition. So I’m dinking around in both the installer area and in the shell trying to figure out how to make this special partition. I print the partition schema in parted, and I don’t see it. I tried setting up a third partition and looking at the FS-TYPE settings and everything, but I never found what I was looking for so I always backed out without writing changes. I spent maybe two hours trying to figure this out – of course most of that time was just sitting there staring at the screen waiting for things to happen. Finally, I had an idea that I needed to first create the partition, and then go back and change it to be a whole disk partition or something. So I just made a single partition using the remaining space and wrote the changes. I was really suprised to see that the partition showed up as #4. What I figured out after the fact was that parted was taking into account that the disk had a SunOS label, and was automagically setting the 3rd partition as a whole disk partition. There was just no way to tell, because it wasn’t being displayed on the screen. I have a feeling that if the installer had fdisk instead of parted, I would have seen this immediately and just proceeded with the rest of the partitions (I later verified this after the install: fdisk does in fact show the “Whole Disk” partition). Taking something on blind faith is kind of hard sometimes, especially if you’re attempting something completely new.

After finishing the partitioning and getting it right, the installer proceeded with the base package installation. It was getting late and I knew that it was going to take a long time, so I headed over to drink some beers and celebrate Cinco de Mayo at a friend’s house.

When I got back a few hours later I discovered my next major issue. The machine was sitting there, “base-installation complete” message on the screen, prompting for a reboot. I rebooted the machine… nothing. No boot loader. So I rebooted off the net and tried to rescue it. Not happening – none of the mount points where set and it wouldn’t let me install the bootloader until the base install was done. I had to redo the partitions and redo the base installation. This time, before rebooting, I cancelled out and went back to the main installer menu and chose “install Silo bootloader”. I got back an error message saying that the installation failed, and the bootloader couldn’t be installed. This wasn’t a good sign. I tried it again to be sure (but mostly because I couldn’t think of what else to do). Same message again. I executed a shell to poke around, and I saw that the /boot directory contained a silo.conf file. I resigned myself to failure and rebooted the machine. This time the machine came up with the silo prompt, though without a menu. It was okay, because while I was staring at the screen wondering what to do next it timed-out and started booting the default. A few seconds later init had finished it’s process and I was into the tail end of the install – setting up root password, user accounts, etc.

Now to poke around and figure out what I’m going to actually do with this machine.

Theme: Silver is the New Black. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.