apocryph.org Notes to my future self

20Nov/050

Moving from OpenBSD 3.8-Release to -Stable

I just upgraded jane to OpenBSD 3.8-Release, and now I need to install the ports collection, then update to the -stable code line.

Recall that OpenBSD is released in a number of OpenBSD flavors. Release is the major versions released on CD-ROM and for download. When you install from a CD or the web, you’re usually installing -Release. Stable is Release plus important security and functionality fixes. Current is the latest code.

I usually move up from Release to Stable, not so much for the updates to the kernel and userland code, but so I can follow the latest ports tree. Unfortunately, this involves a series of painful steps:

  • Download the -Release ports tree and extract it to /usr/ports.

    The ports.tar.gz tarball contains the ports directory, so it should get tar xzfd in /usr/.

  • Download the -Release kernel and userland sources, and extract it to /usr/src

    The src.tar.gz and sys.tar.gz source tarballs do not contain the src directory, so they should get tar xzfd in /usr/src. I always forget this, and end up spewing source files all across /usr as a result.

  • Get the -Stable ports, kernel, and userland sources from CVS (getting the -Release stuff first makes this alot faster)

    Upgrading to -stable from -release is pretty straightforward; the following commands from the OpenBSD faq section on building the system from source are pretty simple:

    # cd /usr
    # export CVSROOT=anoncvs@anoncvs.example.org:/cvs
    # cvs -d$CVSROOT checkout -rOPENBSD_3_8 -P src
    

    In my case, my server is in the central US, so instead of anoncvs.example.org I use anoncvs3.usa.openbsd.org from the AnonCVS server list.

    You repeat the cvs command for src and ports both.

  • Build the -Release kernel and userland binaries

    For my purposes the standard, GENERIC kernel is fine. From the same ‘building the system from source‘ faq section as above, the following build commands are provided:

    # cd /usr/src/sys/arch/i386/conf
    # config GENERIC
    # cd ../compile/GENERIC
    # make clean && make depend && make
        [...lots of output...]
    # make install
    

    This takes so long you’ll swear it’ll never finish, but eventually it does. It took about 45 minutes on jane. Don’t forget to reboot afterwards, and before you build userland.

    Next, build userland:

    # rm -rf /usr/obj/*
    # cd /usr/src
    # make obj
    # cd /usr/src/etc && env DESTDIR=/ make distrib-dirs
    # cd /usr/src
    # make build
    

    That last step, make build, really takes forever. I’d estimate it ran for about 10 hours on jane. Once it’s done, reboot and you’ll have 3.8-stable userland.

  • Rebuild any ports that have been updated.

    There are a few utilities that help out with this process, but nothing as easy as FreeBSD provides.

    In /usr/ports/infrastructure/build, there’s out-of-date, which shows a list of installed packages/ports and the ports versions which are newer. This won’t actually do the upgrade for you, but it points you in the right direction. I like to do a make uninstall followed by a make reinstall to upgrade ports.

  • Keep up to date

    The -stable ports tree changes frequently, while the -stable kernel and userland sources only change when critical fixes are released. Regardless of the frequency, it’s important to keep them up to date. Once you’ve done the cvs checkout steps above, updating from CVS is much easier:

    # cd /usr/src
    # export CVSROOT=anoncvs@anoncvs.example.org:/cvs
    # cvs -d$CVSROOT up -Pd
    

    Obviously replacing anoncvs.example.org with a real CVS server. Do this once in /usr/src and again in /usr/ports to make sure you have the latest both.

    It’s not supposed to be easy. If you want easy, run Fedora Core or Windows.

This most painful part of all this is that the builds take anywhere between aeons and an eternity, depending upon the hardware.

Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


No trackbacks yet.

Delicious Bookmarks

Recent Posts

Meta

Current Location