compat_hpux - setup for running HP-UX binaries under emulation
OpenBSD supports running HP-UX binaries. This applies only
to m68k systems
(such as hp300 systems). Most programs should work,
such as Matlab
4.2c and the HP-UX X11R5 server. Programs that will not
work are fairly
uncommon, and often involve very low level hardware access.
The HP-UX compatibility feature is active for kernels compiled with the
COMPAT_HPUX and COMPAT_M68K4K options and the kern.emul.hpux
sysctl(8)
enabled. HP-UX for m68k uses 4 KB page sizes, and OpenBSD
for all m68k
platforms now uses 8 KB page sizes.
A lot of programs are dynamically linked. This means that
the HP-UX
shared libraries that the programs depend on are also needed. Additionally,
a "shadow root" directory for HP-UX binaries on the
OpenBSD system
will have to be created. This directory is named
/emul/hpux. Any file
operations done by HP-UX programs run under OpenBSD will
look in this directory
first. So, if a HP-UX program opens, for example,
/etc/passwd,
OpenBSD will first try to open /emul/hpux/etc/passwd, and if
that does
not exist open the `real' /etc/passwd file. It is recommended that HP-UX
packages that include configuration files, etc., be installed under
/emul/hpux, to avoid naming conflicts with possible OpenBSD
counterparts.
Shared libraries should also be installed in the shadow
tree.
Generally, it will only be necessary to look for the shared
libraries
that HP-UX binaries depend on the first few times that HP-UX
programs are
installed on the OpenBSD system. After a while, there will
be a sufficient
set of HP-UX shared libraries on the system to be able
to run newly
imported HP-UX binaries without any extra work.
Setting up shared libraries [Toc] [Back]
How to get to know which shared libraries HP-UX binaries
need, and where
to get them? Basically, there are 2 possibilities. (When
following
these instructions, root privileges are required on the
OpenBSD system to
perform the necessary installation steps).
1. Access to an HP-UX system: These instructions apply to
HP-UX 9.10
(the latest version of HP-UX available for m68k-based
systems), although
the instructions should be similar for earlier
versions of
HP-UX. By far, the easiest method is to copy the essential files
locally to the OpenBSD system.
Use tar(1), or a similar utility, to collect the following files:
All files in the /usr/lib directory ending in .sl.
There should be
about 46 files and two soft links.
All files in the /lib directory ending in .sl. There
should be 5
files.
Copy these files to the OpenBSD system, and extract
them into
/emul/hpux. The following files should be present:
/emul/hpux/lib/dld.sl
/emul/hpux/lib/libc.sl
/emul/hpux/lib/libm.sl
/emul/hpux/lib/libM.sl
/emul/hpux/lib/libcurses.sl
And a whole bunch of files in /emul/hpux/usr/lib.
Overall, HP-UX
9.10 has about 10 MB of shared libraries that will need
to be copied
to the OpenBSD system.
2. Access to an HP-UX system with its entire root drive
exported via
NFS: In this case, simply mount the entire HP-UX system
under
/emul/hpux. For example, on the OpenBSD system, mount
it as:
$ mount -t nfs hpux-host.test.net:/ /emul/hpux
Note that, in this case, the HP-UX emulation will use
the configuration
files from the HP-UX system (/etc/passwd, for example,) and
that might not be desirable.
Setting up X11R5 [Toc] [Back]
Although the OpenBSD based X11R5 server is the preferred way
to run X, it
is possible to run the HP-UX X11R5 server instead. To do
so, a few additional
files are necessary:
/usr/bin/X11/X
/usr/lib/grmd
The shared libraries in /usr/lib/X11R5.
/usr/lib/Motif1.2/libXm.sl
All the subdirectories and files in
/usr/lib/X11/fonts.
All the files in /usr/lib/X11/nls/Xhp.
All the files in /usr/lib/X11/extensions.
/usr/lib/X11/XHPKeymaps
/usr/lib/X11/XHPmodmap
/usr/lib/X11/XPCmodmap
/usr/lib/X11/XKeysymDB
/usr/lib/X11/Xconsoles
/usr/lib/X11/X0screens
/usr/lib/X11/X0devices
/usr/lib/X11/X0pointerkeys
/usr/lib/X11/rgb.txt
/usr/lib/X11/rgb.dir
/usr/lib/X11/rgb.pag
The following configuration steps will also need to be performed:
1. Get and extract the xbase.tgz set for OpenBSD to provide the X11R6
clients which are going to be used with the new X server.
2. Create the following directory for the X server to deposit its socket
files in:
$ mkdir -p /usr/spool/sockets/X11
$ chmod 777 /usr/spool/sockets/X11
3. Add the following lines to /etc/rc.local to create the
necessary directories
for the X server to deposit its files in,
when the system
boots:
$ mkdir /tmp/.X11-unix
$ chmod 777 /tmp/.X11-unix
$ ln -s /usr/spool/sockets/X11/0
/tmp/.X11-unix/X0
4. It's also possible to link the X server to a more convenient location,
such as:
$ ln -s /emul/hpux/usr/bin/X /usr/X11R6/bin/X
options(4), config(8)
It might not be possible to run the X server on multiple
framebuffers,
even though both the X server and OpenBSD support them.
OpenBSD 3.6 November 29, 2001
[ Back ] |