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
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
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.
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`
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
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
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 |
|
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
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.
An older screenshot.
A newer screenshot with some recommended customizations:
Notes on building on OpenBSD 7.0:
ld
no longer searches for libraries in /usr/local/lib by default. You mustexport LIBRARY_PATH="/usr/local/lib
before you start buildingexport AUTOMAKE_VERSION=x.xx; export AUTOCONF_VERSION=x.xx
before you run autogen.shCFLAGS="-I/usr/local/include" CXXFLAGS="-I/usr/local/include"
to the./configure
commanddoas
instead ofsudo
rpc.cmsd
to work properlyLast edit: vmlinuz719 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.
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.
Last edit: vmlinuz719 2021-10-19
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
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
If you're comfortable, post the contents of your hosts file. Make sure it contains an entry like:
so if your fully qualified hostname (see
uname -a
) isopenbsd.localdomain
, you wantMaybe 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
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
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
Any OpenBSD packages?
This is the pure desktop :)
I have been publishing built packages for OpenBSD, the last I did was for CDE 2.5.0
https://sourceforge.net/projects/rhubarb-pi/files/OpenBSD/7.1/amd64/
https://sourceforge.net/projects/rhubarb-pi/files/OpenBSD/7.1/aarch64/
and have a script to perform the whole procedure documented at https://sourceforge.net/p/rhubarb-pi/wiki/pkg-cdesktopenv/ . Also hosted at https://github.com/rhubarb-geek-nz/cdesktopenv
Last edit: Roger Brown 2022-12-04