logo_kerberos.gif

Solaris Build Environment

From K5Wiki
Revision as of 02:01, 19 November 2016 by Ghudson (talk | contribs)

Jump to: navigation, search

This page contains notes on the setup of a Solaris buildbot worker for MIT krb5.

Our current Solaris build hardware is a Sun Fire V240 running Solaris 10 U10.

Solaris 10 includes a variety of free software tools in /usr/sfw, but not the full set of dependencies needed to checkout, build, and test the krb5 tree. We have chosen to use OpenCSW to add most of the dependencies, and local builds in /usr/local for the remaining few.

Shell setup

A root login by default uses a very minimal shell (/bin/sh) with a very minimal path (/usr/sbin:/usr/bin). For any operations performed as root, we begin by starting a functional shell as follows:

   bash
   export PATH=/opt/csw/bin:/usr/sbin:/usr/bin:/usr/sfw/bin:/usr/ccs/bin
   export MANPATH=/opt/csw/share/man:/usr/share/man:/usr/sfw/share/man

Setting up OpenCSW

Begin by installing the pkgutil command (in /opt/csw/bin/pkgutil) and updating its catalog.

   pkgadd -d http://get.opencsw.org/now
   pkgutil -U

"pkgutil -l" lists installed packages. "pkgutil -a string" looks up string in the catalog. "pkgutil -i packagename" installs a package; the -y flag can be used to skip prompts.

Install required OpenCSW packages

   pkgutil -y -i git
   pkgutil -y -i libssl_dev
   pkgutil -y -i autoconf
   pkgutil -y -i expect
   pkgutil -y -i bison
   pkgutil -y -i emacs
   pkgutil -y -i gdb

OpenSSL 0.9 is present in /usr/sfw/lib, but we need 1.0 or later for PKINIT so we install the OpenCSW version. emacs and gdb are not needed to build krb5, but are handy to have around for manual testing and debugging work.

Local builds of remaining dependencies

For now, the only dependency we need to build by hand is dejagnu:

   mkdir /usr/local /usr/local/src
   From https://ftp.gnu.org/gnu/dejagnu/ fetch the latest dejagnu; untar it in /usr/local/src
   cd /usr/local/src/dejagnu-version
   ./configure && gmake install

Create user accounts

By default, /home on Solaris is controlled by the automounter. To avoid needing to change the automounter configuration, we create user accounts with home directories in /export/home:

   useradd -d /export/home/ghudson -s /bin/bash -m ghudson

Creating an account allows the Kerberos principal of the same name in the ATHENA.MIT.EDU realm to log in on that account.

To set a reasonable path for development work, the user can edit .profile to add:

   PATH=/usr/local/bin:/opt/csw/bin:/usr/bin:/usr/sfw/bin:/usr/ccs/bin
   MANPATH=/usr/local/share/man:/opt/csw/share/man:/usr/share/man:/usr/sfw/share/man
   export PATH MANPATH

The following shell function, or a variant of it, may be useful for configuring a build with the correct paths. This variant is designed to work in a separate build directory placed next to the src directory within a checkout.

   k5configure() { ../src/configure --enable-maintainer-mode --prefix=$HOME/inst --with-ldap CFLAGS=-g CPPFLAGS="-I/opt/csw/include" LDFLAGS="-L/opt/csw/lib -R/opt/csw/lib" "$@"; }

To do

  • We do not install OpenLDAP and the MIT krb5 build currently fails with the native Solaris LDAP library for a couple of reasons (see [krbdev.mit.edu #8167]). This should be fixed.
  • The system needs to be set up as a buildbot worker.