9 minute read

Last year I saved two HP/Compaq nc6000 from the workplace’s junk box: they are nice little systems equipped with a Centrino/Pentium M processor, up to 2GB of DDR RAM, a very nice keyboard and some kind of catch-all ATI video card (they even sport S-Video on the back!). They are in somewhat decent shape, given their story: one is very dirty and has broken lid lock tabs, the other is cosmetically fine but has a little bright spot on the screen. Since I can’t be bothered with swapping the screens, I decided to restore the latter and keep the other unit as a cold spare.

Powering up

First issue: I have no power brick for the units, and they are rated for 18.5V… The only HP brick I could find is rated for 19V, and I decided to give it a go on the dirty one: no immediate smoke. Knowing that the regulators would likely not pop immediately, I stress tested the unit for a while with an old live Linux distro I had lying around, cranking the CPU.

Since nothing unusual happened I decided to fire up the nice-looking one as well: needless to say, it works fine with the 19V brick as well, so it seems like the little overvoltage won’t be a problem for those sturdy laptops.

Solaris

Once I felt comfortable with the PSU situation, I popped in my Solaris 10/09 install media and gave it a go: I’ve always wanted to have a little portable Solaris machine lying around, and figured that it would be just perfect for this little guy.

The kernel began loading, yet it soon decided to panic and sputter a rather incomprehensible error:

SunOS Release 5.10 Version Generic_141445-09 32-bit
Copyright 1983-2009 Sun Microsystems, Inc.  All rights reserved.
Use is subjected to license terms.

panic[cpu0]/thread=fec20160: page_unlock: page fe09be20 is not locked

It can’t unlock a page… which is already unlocked?

Let’s try and dissect the cryptic message:

  • cpu0 means that the panic has happened on the kernel tied to the first processor, which is redundant since we only have one core.
  • We know which thread failed, in case we want to attach a kernel debugger session (spoiler: we don’t).
  • The kernel tried to unlock a page, which is a mechanism I’m not familiar with but is likely related to memory management.
  • We have a page number (fe09be20), which confirms that suspicion.

A quick search on the ‘net soon revealed the culprit:

On trying to install the latest version of Solaris 10 on my Laptop, I received a similar error. On Googling a bit, I found that this was an error related to lower memory. The machine had 512MB RAM. I upgraded the memory to 1GB and was able to install Solaris 10/9 without any issues :-) .

From this blog post.

A quick excursion in the BIOS confirms that this is exactly the case: we don’t have enough memory. I removed both units’ keyboards just to find out that they had very little RAM installed, so I dug up some old DDR SODIMMs from the pile and found a nice pair of PC2700 333MHz 1GB sticks that fit perfectly: time to get serious.

Setup

The installation went smoothly: basically all I had to do was follow the on-screen prompts: however, the Solaris WebStart installer makes it very, very clear that you’ll have to do most of the work yourself (or so I thought at first).

After this lengthy process, I was greeted with a barebone but completely functional system. To my surprise there were no hiccups, no lengthy waits for DHCP leases, no never-ending DNS lookups: the system just… worked. I logged in as root with the previously inserted password and it asked me whether I wanted to use the JDS or the classic CDE: I went with the latter (it’s pure nostalgia).

Configuration

Hostname

If you choose DHCP upon installation, hostname discovery will be turned on by default, so the system tries to infer the hostname from the DHCP server: while this could be useful in the datacenter, it’s basically a nuisance for an home/portable machine. To change this behavior, hostname discovery must be disabled: it’s as simple as changing some lines in as this Chad found out. Please do not edit the defaults though, it’s wiser to just make a copy.

I did the following:

$ su
Password:
# cd /etc
# cp default/dhcpagent .
# vi dhcpagent

Line 80 (REQUEST_HOSTNAME=no) was uncommented to stop hostname discovery, and “12” from line 90 was removed (PARAM_REQUEST_LIST=1,3,6,15,28,43) to disable the request entirely.

To set your own hostname I did the following as superuser:

# echo "polaris" > /etc/nodename
# reboot

From now on the system will be brought up as polaris.

Users

After being used to the excellent smit and yast2 config tools, I’d hoped to find a suitable replacement in Solaris. I’d soon learn that I could just issue:

# smc

and run the System Management Console with its ugly Swing UI from pretty much anywhere. To be honest smc is not that great, but I’m a little scared by useradd since it’s quirky and different on any damn system, so I decided to use it only to manage users.

I dialed in my user’s data and went back to Dtlogin (yes, there’s good ol’ Dtlogin under that glossy interface) to login anew. For my regular user I choose JDS, which is definitely more usable than CDE. I’m also quite fond of it as it was probably my first real Unix experience (via VNC on a Sun Fire V100).

The ksh

NOTICE

Since I’m using an Italian locale, translation of console messages might not be 100% accurate.

After a quick tour of JDS, which brought back a lot of (mixed) memories, I decided that I could not live without ksh and began configuring it. Here’s a quickie, keep in mind that quartz is my username:

$ su
Passsword:
# passwd -e quartz
Old shell: /bin/sh
New shell: /usr/bin/ksh
passwd: the password has been changed for quartz

I logged out and in again and the deed was done.

Customizing .profile

Solaris’ default .profile is kinda bland, which is good, but I need some stuff to be there. Here’s what it looks like by default:

#
# Copyright (c) 2001 by Sun Microsystems, Inc.
# All rights reserved.
#
# ident "@(#)local.profile      1.10    01/06/23 SMI"
stty istrip
PATH=/usr/bin:/usr/ucb:/etc:.
export PATH

The ksh, unlike bash, does not read ~/.<name>rc by default: you have to specify where the configuration file is in your .profile. Add the following:

ENV=/export/home/quartz/.kshrc
export $ENV

Solaris has some free software bundled in, which resides in /usr/sfw, and you can add more from the Companion CD (it will reside in /opt/sfw). Be sure to modify your path accordingly:

PATH=/usr/sfw/bin:/opt/sfw/bin:/usr/bin:/usr/ucb:/etc:.

And that’s it. Now on to the .kshrc

Dead simple.kshrc

It’s quite simple: since I use defaults in vi mode, I just did this:

$ cd ~
$ echo "set -o vi" > .kshrc

Friendly reminder: now pressing Esc enables vi-like commands, then \ autocompletes and - rolls through command history.

Now that I could use the shell without getting OCD, it was time to install some commodities.

Software

By default, Solaris 10 includes a nice bit of software: more of it can be obtained through other means though, such as this site, which conveniently hosts a lot of Sun freeware packages.

Personally, I’ve downloaded the following (which all come from the Companion CD):

Packages:      
SFWaconf.pkg SFWamake.pkg SFWcoreu.pkg SFWcurl.pkg
SFWgdb.pkg SFWncur.pkg SFWrline.pkg SFWruby.pkg
SFWsudo.pkg SFWvim.pkg SFWxpdf.pkg  

To install them I wrote the following script:

#!/usr/bin/ksh

for pkg in $(ls *.pkg) 
do
	pkgadd -d $pkg
done

I then ran the script and answered the prompts. Be wary that pkgadd might warn you about dependencies: I did my homework and manually downloaded all of the packages needed (basically ncurses and readline), so don’t worry about them.

After installing the packages I was able to use most of the software, but I still needed to configure some things, like sudo

Configuring sudo

The default sudo configuration, when installed from SFWsudo.pkg is, well, quite broken. See for yourself:

$ sudo
sudo: must be setuid root

This is telling us that the sudo executable needs to have the setuid bit set. Let’s flip it.

$ which sudo
/opt/sfw/bin/sudo
$ su
Password:
# chown root:root /opt/sfw/bin/sudo
# chmod 4755 /opt/sfw/bin/sudo
# exit
$ sudo
usage: sudo -K | -L | -V | -h | -k | -l | -v
usage: sudo [-HPSb] [-p prompt] [-u username|#uid]
            { -e file [...] | -i | -s | <command> }

At this point sudo works, but we need to configure it: there is no visudo command and the sudoers file is located in the /opt/sfw/etc folder.

$ su
Password:
# chmod 644 /opt/sfw/etc/sudoers
# vi /opt/sfw/etc/sudoers

Uncomment line 21 of sudoers to let members of group wheel use sudo. We’re almost done: let’s reset sudoers’ permissions and create the wheel group and add our user to it.

# chmod 440 /opt/sfw/etc/sudoers
# groupadd wheel

Be wary that Solaris 10’s usermod does not have the -a flag, so -G will replace your actual secondary groups! I’m only member of staff, so it does not bother me.

# groups quartz
staff
# usermod -G wheel quartz
UX: usermod: quartz is currently logged in, some changes may not take effect until next login.
# groups quartz
staff wheel
# exit

Now, I found out that as you’re not supposed to use superuser commands as a regular user, the sbins are not in your path. Let’s add them.

$ cd ~
$ vim .profile

Now add :/usr/sbin somewhere in your path, and it’s done! Logout and in again from JDS to be able to use sudo.

Wrapping it up

I don’t know if it’s just me or Solaris is a very good all-rounder: the system is stable, it survived me accidentally killing the laptop at least twice, and it’s not that weird if you’re used to mainstream *nixes like Linux and BSD. To be honest I dont’t think it would be of any use if there wasn’t at least some OSS available, since I’m so used to having it around that it’s become the norm. The little nc6000 itself does a really good job of coping both with me and the little overvoltage, I’m really pleased of it.

I’m not done with Solaris: I have plenty of free disk space so I want to try and install Sun Studio if I can, and I want to build a newer version of ssh so I can log into modern machines from polaris. I’d also love to try and build PuTTY, since I think I’ll be using the serial port a lot in the near future: stay tuned for part 2.

2020-05-10:jack23247 I did not forget about part two, I simply changed my plans for the system. Consider the latest article as of today 10-MAY-2021 (I love VMS-style dates, they’re so unambiguous) a kind of follow-up to this one. I also must admit that I’ve abandoned ksh and succumbed to the convenience of bash :(