Thursday, June 23, 2016

OpenIndiana Hipster: SunOS 5.11 + awesome sauce

A brief (if circuitous) history

For the uninitiated, OpenIndiana Hipster is preceded by a long and winding historical road, which I'll attempt to recap here with the caveat that this is only my own understanding of a fascinating but complicated story.

Early 1970s: UNIX is developed at Bell Labs (owned by AT&T) by Ken Thompson, Dennis Ritchie, and other brilliant engineers.

Mid to late 1970s: UNIX installations start proliferating at universities and other institutions. At UC Berkeley, student Bill Joy helps maintain that school's UNIX installation, and begins writing some extra software tools, an effort that will expand in scope to become "Berkeley UNIX", or the Berkeley Software Distribution (BSD). Initially known as a set of extensions for use with AT&T UNIX installations, BSD will go on to become a wholly separate UNIX-derived operating system in its own right. Meanwhile, much of the BSD source code finds its way into AT&T UNIX, thus blurring the line between the two. (In other words, while today's BSD-derived systems can't legally call themselves UNIX, they are just as UNIX in spirit and source code genetics as their "official" UNIX cousins.)

Early 1980s: Bill Joy is lured to the fledging Sun Microsystems early enough to be considered a "founder". One of his tasks is to adapt his BSD for use on Sun's line of workstations. This modified version of BSD is christened "SunOS".

Early 1990s: Sun Microsystems decides to merge SunOS's BSD-derived codebase with AT&T's SVR4-derived codebase. While the post-merge UNIX base of their product continues to be called SunOS, the entire operating system (comprised of SunOS plus the GUI and a multitude of extra tools and utililties) is now marketed as "Solaris". (I'll avoid a rundown of the version numbering here. It's complicated.)

Early to mid 2000s: Sun begins the process of open-sourcing as much of Solaris as possible, an initiative that will culminate in the release of OpenSolaris, a binary distribution codenamed internally as "Project Indiana". The idea is that the work done on OpenSolaris by Sun engineers and the wider community will find its way into Solaris 11.0 (as undergirded by what will be known as SunOS 5.11).

Mid to late 2000s: OpenSolaris takes flight, only to have its wings clipped by muddled thinking and short-sighted decisions from the suits at Sun.  I guess that's why the men in the corner offices make the big bucks.

2010: Sun Microsystems is bought by Oracle. One of Oracle's first orders of business is to kill OpenSolaris. On an unforgivable note, Oracle decides that any updated versions of open source code created by the OpenSolaris community will henceforth become closed source. (Bryan Cantrill's rant on this is as epic as it is cathartic.) Meanwhile, some former Sun engineers (and other soon-to-be-disenfranchised members of the OpenSolaris community) have already seen this coming, and set about preparing the OpenIndiana project to ensure that the OpenSolaris codebase will continue to be maintained and improved independently of Oracle. (To make matters a little more confusing for those who don't eat, sleep and breathe this stuff, OpenIndiana, a full desktop OS, is shepherded by the illumos Project, which oversees the open source version of the SunOS 5.11 code, which is also used by other OpenSolaris distributions such as OmniOS, SmartOS and Tribblix.)

2013: The OpenIndiana project introduces "Hipster", its fast-moving development branch following a rolling-release model. This is where the latest OI and illumos stuff happens, though with the caveat that you can expect breakages every now and then due to things occuring at a full gallop. Users are advised to use the Legacy branch (151a8) for production purposes.

Some bumps on the road back

As for my own recent personal history, I'm now running Hipster for the first time in a few months, and so far it has been a very smooth experience after a previous one that was quite dodgy - I was unable to go to console mode and thus switch to an alternate desktop or window manager, and the screensaver would lock up if I didn't remember to at least jiggle the mouse every now and then.

After filing bug reports for both of those issues, I found wasn't able to upgrade from the 2015.10 iso to the newest build in order see if said bugs were fixed. Shortly after entering the upgrade commands (pfexec pkg refresh --full and pfexec pkg image-update -v), the process would halt with an error message reading "Segmentation Fault (core dumped)". Not cool.

And so I had spent the intervening months with a waning sense of enthusiasm for the project, thinking that perhaps it was in too much of an experimental state to be remotely useful for reliable daily use. A few days ago, however, I downloaded the newest iso (2016.04), hoping this cut would resolve my issues, only to find my ThinkPad T61p wouldn't even boot the live DVD. Waning enthusiasm was now turning to outright frustration at a system that I otherwise knew to be a jewel within the UNIX world.

What happened since then to turn the tide?

After the non-booting iso fiasco, I then noticed that other newly-burned iso images were also failing to boot, indicating there could be a hardware problem on my end. This lead me to think that perhaps I should retry upgrading from the bootable OI Hipster image already on hand. After installing from the DVD and trying to upgrade anew, I got the same error message noted above, but this time resolved to do some reading, and on the OI Hipster wiki saw that the package repository had changed since the 2015.10 iso. And so I changed from the old repository to the new one as follows:

# pfexec pkg unset-publisher
# pfexec pkg set-publisher -O

And wouldn't you know it, I was then able to upgrade to the latest build as of June 22. (I have since upgraded again, and am working from a build that is current as of two hours ago.) Upon checking that everything worked, I was finally able to close off the two delinquent bug reports.

The (open source) SunOS also rises

All-in-all, I am absolutely smitten with OpenIndiana Hipster, and am very pleasantly surprised by how polished it now seems compared to my previous experiences. I now have most of my favorite stuff installed, and am happy to report that with the upgrade from 2015.10, the Firefox version jumped from 24.something to 45.2.0. With this newer version, YouTube videos play on this machine with maximum smoothness, even in fullscreen mode.

Any complaints or issues I do have are as follows:

Support for Flash - My initial Google searches for Flash on OI Hipster are giving me a tension headache. I suppose it can be done, but I'll have to really dig in to make it happen.

Emacs not booting in GUI mode - I can start Emacs either in the console (i.e. without booting X11 first), or by entering emacs -nw in gnome-terminal. How am I supposed to play Snake? Very troubling, indeed.

gcc can't even compile hello.c - For some reason, dev/gcc doesn't recognize stdio.h, and so for now my longstanding mission to knuckle down and learn C programming will have to wait (for now). 

The above issues aren't insurmountable, and will surely result in some bug reports in my near future. Otherwise, OI Hipster is now a thing of beauty.