Menu

OpenBSDBuild

Attachments
cde.png (36875 bytes)
openbsd_cde.jpg (124970 bytes)

OpenBSD 6.2+ setup and guide to building and installing CDE

These instructions are verified with a default OpenBSD 6.3 install. X windows components installed from CD. Make sure OpenBSD ports and packages system are set up. See here for instructions: http://www.openbsd.org/faq/faq15.html

All instructions done using root

Table of Contents

Install the following packages:

pkg_add git
pkg_add ksh93         # OpenBSD ksh is still _not_ sufficient
pkg_add motif         # OpenBSD 6.0+
pkg_add tcl-8.6.6p0   # or whatever tcl v8.6 version is available
pkg_add gmake autoconf automake libtool bison opensp

Download and build CDE

OpenBSD support is broken in release 2.2.4, but fixed in git 2.2.4a and later versions.

Use the git clone command here:

On most platform you can use HTTPS:

git clone https://git.code.sf.net/p/cdesktopenv/code cdesktopenv-code

If that doesn't work (for instance some BSD distros) , use the native git protocol instead

git clone git://git.code.sf.net/p/cdesktopenv/code cdesktopenv-code

Or download the latest source release:

Note: The source archive will become out of date. When you want the latest code, clone the git repository.

Build

Version 2.4.0a and newer (autoconf)

For the BSD's, you must use gmake, and you must specify the location of the TCL install directory (the below example assumes TCL v8.6). This should be the directory that contains the tclConfig.sh file. On OpenBSD specifically, you must set some environment variables and add some C/CXXFLAGS to the configure step:

$ export AUTOMAKE_VERSION=x.xx # whatever versions you have installed
$ export AUTOCONF_VERSION=x.xx
$ export LIBRARY_PATH="/usr/local/lib"
$ ./autogen.sh
$ ./configure --with-tcl=/usr/local/lib/tcl/tcl8.6 MAKE="gmake" \
        CFLAGS="-I/usr/local/include" CXXFLAGS="-I/usr/local/include"
$ gmake
$ doas gmake install

Note: Documentation does not build as of version 2.4.0a. This is an issue with the new build system and is currently being worked on.

Version 2.4.0 and earlier (imake)

cd cdesktopenv-code/cde
make World
admin/IntegTools/dbTools/installCDE -s `pwd`

Configure system

add to /etc/rc.conf.local

shlib_dirs="/usr/dt/lib"

You will need to add entries for your hostname (NOT just localhost) in /etc/hosts

127.0.0.1    myname    myname.my.domain
::1          myname    myname.my.domain

and create an init script for rpc.cmsd, for example:

daemon="/usr/dt/bin/rpc.cmsd &"

. /etc/rc.d/rc.subr

pexp="rpc.cmsd: ${daemon}${daemon_flags:+ ${daemon_flags}} \[listener\].*"

rc_reload() {
        ${daemon} ${daemon_flags} -t && pkill -HUP -xf "${pexp}"
}

rc_cmd $1

Save as /etc/rc.d/cmsd

doas rcctl enable cmsd
doas rcctl enable inetd # not sure this does anything but might be needed
doas rcctl enable portmap # needed to get past dthello

Reboot

Start and test CDE

You can now start dtlogin manager as root (not recommended):

/usr/dt/bin/dtlogin -nodaemon

Alternatively, you can start an X session as a normal user:

startx /usr/dt/bin/Xsession

Cleanup and post-install

To automatically source your .profile when opening a terminal in CDE uncomment the last line in your user's .dtprofile file:

DTSOURCEPROFILE=true

To automatically go into the CDE graphical login at system startup add the following line to /etc/rc.conf.local

xenodm_flags=NO
pkg_scripts=dtlogin

And create a new file /etc/rc.d/dtlogin with the following contents:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/sh

daemon="/usr/dt/bin/dtlogin"

. /etc/rc.d/rc.subr

rc_reload=NO

if [ -n "${INRC}" ]; then
# on boot: make sure we don't hang in _rc_wait
_rc_wait() {
    return 0
}
# on boot: wait for ttys to be initialized
rc_start() {
    ( local i=0
    while ! pgrep -qf "^/usr/libexec/getty "; do
        sleep 1
        [ $((i++)) -ge 10 ] && return 1
    done
    ${rcexec} "${daemon} ${daemon_flags}" ) &
}
fi

rc_cmd $1

Then make it executable:

chmod +x /etc/rc.d/dtlogin

if you don't like dtlogin, you can start CDE via xenodm:

ln -s /usr/dt/bin/Xsession ~/.xsession

Or to make it default for all newly created users:

ln -s /usr/dt/bin/Xsession /etc/skel/.xsession

Man pages

To make man work:

cp /etc/examples/man.conf /etc/man.conf

Then add the following to /etc/man.conf

manpath /usr/dt/share/man

You will need to logout/login for the change to take effect.

Screenshots


An older screenshot.


A newer screenshot with some recommended customizations:

  • Lines in dtwm's en_US.utf-8 app defaults have been uncommented so the front panel uses the correct color
  • The mailer is old and broken, so its icon has been replaced with the Internet application group
  • Dtinfo does not currently build, so its icon has been replaced with the Help Manager (this was the default long ago)

Related

Wiki: SupportedPlatforms

Discussion

  • vmlinuz719

    vmlinuz719 - 2021-10-18

    Notes on building on OpenBSD 7.0:

    • You need to install bison as well
    • ld no longer searches for libraries in /usr/local/lib by default. You must export LIBRARY_PATH="/usr/local/lib before you start building
    • export AUTOMAKE_VERSION=x.xx; export AUTOCONF_VERSION=x.xx before you run autogen.sh
    • Add CFLAGS="-I/usr/local/include" CXXFLAGS="-I/usr/local/include" to the ./configure command
    • Use doas instead of sudo
    • Documentation does not even try to build on 2.4.0a and up, I think it's an issue with the new build system; build an older version and install docs separately
    • I cannot for the life of me figure out how to get rpc.cmsd to work properly
    • The mailer is old, junky and should be replaced with the Internet application group
     

    Last edit: vmlinuz719 2021-10-18
  • Jon Trulson

    Jon Trulson - 2021-10-18

    Hi, I've added you to the member list - please fee free to edit/update the wiki as you see fit.

    As for the docs - yes, documentation building and dtinfo are currently not buildable in master. These are the last remaining things to do there.

     
    • vmlinuz719

      vmlinuz719 - 2021-10-18

      Thank you :) Soon we'll see how it builds on PowerPC64 little endian and ARM64...

      Consider making OpenBSD the reference platform for CDE development. They have always worked together reasonably well, plus OpenBSD has unique security features that can help find bugs in unexpected places.

       
      👍
      1

      Last edit: vmlinuz719 2021-10-19
      • Roger Brown

        Roger Brown - 2021-12-12

        Hi, I have a build of 2.4.0 on ARM64 for both 6.8 and 7.0.
        I do have a question about groups, on most platforms /usr/dt/bin/dtmail and /usr/dt/bin/dtmainpr are assigned to the mail group and have the setgid bit set, what is the equivalent for OpenBSD? I see no equivalent of mail in /etc/group

         
  • Agent133

    Agent133 - 2021-11-05

    First off thanks for this guide on how to setup CDE for OpenBSD. I downloaded the source and after a couple of changes I was apple to compile it on my old iBook G4 (which should be a lot more powerful than the Gecko that I used to have at work :)

    Anyhow, I am having issues with the Desktop starting up. After logging in via xenodm I get the familiar blue screen giving the copyright information with the hourglass present. After a couple of minutes the blue screen dissappears and a blank screen appears. The mouse pointer is present but that is all that appears. The .xsession file is a symbolic link to the one provided by CDE (as described in the instructions above)

    The logs that I know of /var/log and ~./dt/dterrors etc don't indicate any issues. I tried switching to dtlogin but it failed because it couldn't start an Xserver.

    I know that X is setup on the machine because I can login via xenodm into the stock fvwm environment.

    Any suggestions as to where I can look to get more information on what's happenning during startup? Elsewhere in these forums a user indicated that they changed the /etc/hosts file. I tried ammending mine but I'm not sure if I did it correctly since I'm not sure what this is trying to achieve. My system is connected to a home router and gets its' IP address via DHCP

    Thanks

     
    • vmlinuz719

      vmlinuz719 - 2021-11-05

      If you're comfortable, post the contents of your hosts file. Make sure it contains an entry like:

      127.0.0.1 hostname hostname.domainname
      

      so if your fully qualified hostname (see uname -a) is openbsd.localdomain, you want

      127.0.0.1 openbsd openbsd.localdomain
      

      Maybe you also need to have portmap and inetd running - I figured those were only needed to run cmsd back in the day, but I could be wrong. Try also adding

      inetd_flags=
      portmap_flags=
      

      to your /etc/rc.conf.local. (UPDATE: that was probably your issue, my bad for not including that in the manual!)

      Otherwise it could be any number of issues related to running on a big endian platform. I will investigate as soon as my POWER9 hardware shows up.

       

      Last edit: vmlinuz719 2021-11-05
  • Agent133

    Agent133 - 2021-11-05

    Awesome :)

    I made the changes you suggested above in your comments and farther up in the instructions and things seem to now work.

    Oh, the nostalgia. In a previous job I used to work with HP-UX daily and of course the desktop was CDE.

    Just have to install the documentation now. We had the manuals at work but they were kind of light on some details.

    Thanks again

     

Log in to post a comment.