_         _ _       _
| |       | | |     | |
| | ____ _| | | ___ | | __
| |/ / _` | | |/ _ \| |/ /
|   < (_| | | | (_) |   <
|_|\_\__,_|_|_|\___/|_|\_\

Gentoo on a SPARC T4-1 server


Categories: sparc linux servers

This Sun/Oracle SPARC T4-1 server is one of my latest Ebay finds. I got it pretty cheap because the seller thought it was broken. According to the seller, there is no picture from the VGA port. But I know that the VGA port is disabled by default. It must be enabled separately. Normally these are controlled via the serial port.

Specs

This is the entry level model of the T4 line of SPARC servers. It has a single SPARC T4 CPU. It has 8 cores and 8 threads on every core. Overall 64 threads. The CPU frequency is 2.85 GHz. It uses normal DDR3 ECC memory, maximum of 256 GB. It has 8x 2.5" SAS/SATA slots and a DVD drive. There are 4x gigabit ethernet ports, a serial management port and a network management port.

Operating systems

Being a server from Sun / Oracle, this of course supports Solaris. However, Solaris is pretty much dead to everyone who don’t have paid support subscription with Oracle. Without a subscription, there is no access to the premium repositories. You will have to use older versions of the packages. Of course, it is possible to compile the latest software manually, GCC is included in the repos and Sun C Compiler can be downloaded for free with Oracle Developer Studio.

Why Gentoo?

I wanted to install another operating system instead of Solaris myself. I researched the different options and ended up choosing Gentoo. It seems to have the best SPARC support of the currently active distros supporting SPARC. It is also good that programs can be optimized with the optimization compilation flags made directly for this CPU. Other SPARC distros that are still supported are Debian 10, which has a port for sparc64.

Installation notes and tips

I found out that getting a working installation on this machine requires some tricks. After few failed attempts I managed to get it working.

These are my installation notes and tips for installing Gentoo on SPARC with 64-bit userland. Follow the SPARC Handbook to install, but note the following configurations that are needed.

Tip: use SSH instead of serial port for installation

When using the console on ILOM, it uses the serial port interface which is very slow compared to SSH. I recommend using SSH for doing the installation.

First reset the root password

# passwd root

Then start the SSH server

# rc-service sshd start

From your workstation, SSH to the server using the root account and the password you just changed.

Partitions

Your disk should be using Sun partition table. You can create one with the fdisk command s. It might be difficult to get a working Sun partition table using fdisk. In that case I recommend installing Solaris 11 first on that disk in order to have a proper Sun partition table generated for you.

I made two partitions, root and swap. A separate boot partition is not needed

# mkfs.ext4 /dev/sda1
# mkswap /dev/sda2
# swapon /dev/sda2

/etc/portage/make.conf settings

This file provides settings for compiling packages.

Add the following lines (or customize according to your needs):

COMMON_FLAGS="-O2 -mcpu=niagara4 -mtune=niagara4 -pipe"
MAKEOPTS="-j32"
GRUB_PLATFORMS="ieee1275"

Explanations:

fstab

If you are going to use genkernel, you need to have the fstab file. Edit the /etc/fstab according to your tastes. In my case the fstab looks like this:

/dev/sda1   /            ext4    noatime              0 1
/dev/sda2   none         swap    sw                   0 0

Pretty simple.

Compiling the kernel

Download linux-firmware and gentoo-sources packages, and then select the kernel with eselect.

# emerge --ask sys-kernel/linux-firmware
# emerge --ask sys-kernel/gentoo-sources
# eselect kernel list
# eselect kernel set <number>

You can decide if you want to compile the kernel manually or use the genkernel tool. I’m going to use genkernel with menuconfig. Genkernel is convenient, because it will compile the kernel, initramfs and the modules all at once. And you can still edit the kernel with menuconfig.

Make sure you edited your fstab. Install genkernel with

# emerge --ask sys-kernel/genkernel

Edit the configuration file in /etc/genkernel.conf and make sure the option MENUCONFIG="yes" is set.

Now we can run the genkernel. Use the following parameters (or edit them according to your preferences)

# genkernel --menuconfig --makeopts=-j32 --loglevel=5 all

Explanations:

Required kernel modules

Now we need to select few modules in the menuconfig. Read the “Activating required options” from the SPARC Handbook and make sure you have those options selected. You don’t need all of them on this specific machine and most of them are automatically selected. You might also need to enable some options if you are going to use systemd.

Note! In order to boot from the SSD or hard disk on this machine, we need to enable the driver for the SAS/SATA HBA. We need the mpt3sas kernel module. Enable the following options:

Save the config and exit the menuconfig. Now the kernel should compile and copy automatically to /boot.

Serial port access

Important! In order to use the server with ILOM ssh or serial port, you need to enable the serial port access from /etc/inittab. The handbook has incorrect information in the case of this server. Edit the # SERIAL CONSOLES part of the file according to this:

# SERIAL CONSOLES
s0:12345:respawn:/sbin/agetty -L 9600 ttyHV0 vt100

Boot loader

The SPARC Handbook is using SILO. But SILO doesn’t compile with the 64-bit userland. Luckily the GRUB bootloader works with 64-bit SPARC systems too.

Install GRUB with

# emerge --ask --newuse --deep sys-boot/grub

Edit the file /etc/default/grub and add the following option

GRUB_PRELOAD_MODULES="iso9660"

Create the /boot/grub directory if it doesn’t exist yet

# mkdir -p /boot/grub

Generate the GRUB configuration file

# grub-mkconfig -o /boot/grub/grub.cfg

Now install the GRUB. This command will print some warnings, but it still works. Remember to change the drive/partition according to your setup. Note that you must use the root partition instead the whole disk.

# grub-install --force  --skip-fs-probe /dev/sda1

GRUB should now be installed.

Conclusion

I hope these tips were helpful. If everything went right, you should now have a working installation on your SPARC T4-1 server!

If you have problems, feel free to contact me and I will try my best to help.