.\" $OpenBSD: compat_hpux.8,v 1.8 2005/03/27 06:29:16 jmc Exp $ .\" $NetBSD: compat_hpux.8,v 1.2 2001/12/16 23:47:19 wiz Exp $ .\" from: compat_linux.8,v 1.23 2001/10/07 10:12:05 mbw Exp .\" .\" Copyright (c) 1995 Frank van der Linden .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" 3. All advertising materials mentioning features or use of this software .\" must display the following acknowledgement: .\" This product includes software developed for the NetBSD Project .\" by Frank van der Linden .\" 4. The name of the author may not be used to endorse or promote products .\" derived from this software without specific prior written permission .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .Dd March 26, 2005 .Dt COMPAT_HPUX 8 .Os .Sh NAME .Nm compat_hpux .Nd setup for running HP-UX binaries under emulation .Sh DESCRIPTION .Ox supports running HP-UX binaries. This applies to m68k (such as hp300) and hppa systems. Most programs should work, such as Matlab 4.2c and the HP-UX X11R5 server on m68k platforms. Programs that will not work are fairly uncommon, and often involve very low level hardware access, such as the X11 server on hppa machines. .Pp The HP-UX compatibility feature is active for kernels compiled with the .Nm COMPAT_HPUX and .Nm COMPAT_M68K4K options and the kern.emul.hpux .Xr sysctl 8 enabled. The .Nm COMPAT_M68K4K option is only required for m68k platforms. HP-UX for m68k uses 4 KB page sizes, and .Ox for all m68k platforms now uses 8 KB page sizes. .Pp 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 .Ox system will have to be created. This directory is named .Pa /emul/hpux . Any file operations done by HP-UX programs run under .Ox will look in this directory first. So, if a HP-UX program opens, for example, .Pa /etc/passwd , .Ox will first try to open .Pa /emul/hpux/etc/passwd , and if that does not exist open the .Sq real .Pa /etc/passwd file. It is recommended that HP-UX packages that include configuration files, etc., be installed under .Pa /emul/hpux , to avoid naming conflicts with possible .Ox counterparts. Shared libraries should also be installed in the shadow tree. .Pp 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 .Ox 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. .Ss Setting up shared libraries 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 .Ox system to perform the necessary installation steps). .Bl -enum .It 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 .Ox system. .Pp Use .Xr tar 1 , or a similar utility, to collect the following files: .Pp .Bl -item -compact .It All files in the .Pa /usr/lib directory ending in .Li ".sl" . There should be about 46 files and two soft links. .It All files in the .Pa /lib directory ending in .Li ".sl" . There should be 5 files. .El .Pp Copy these files to the .Ox system, and extract them into .Pa /emul/hpux . The following files should be present: .Bd -unfilled -offset indent /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 .Ed .Pp And a whole bunch of files in .Pa /emul/hpux/usr/lib . Overall, HP-UX 9.10 has about 10 MB of shared libraries that will need to be copied to the .Ox system. .It 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 .Pa /emul/hpux . For example, on the .Ox system, mount it as: .Pp .Dl $ mount -t nfs hpux-host.test.net:/ /emul/hpux .Pp Note that, in this case, the HP-UX emulation will use the configuration files from the HP-UX system .Po .Pa /etc/passwd , for example, .Pc and that might not be desirable. .El .Ss Setting up X11R5 Although the .Ox 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: .Bd -unfilled -offset indent /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 .Ed .Pp The following configuration steps will also need to be performed: .Bl -enum .It Get and extract the .Pa xbase.tgz set for .Ox to provide the X11R6 clients which are going to be used with the new X server. .It Create the following directory for the X server to deposit its socket files in: .Pp .Dl $ mkdir -p /usr/spool/sockets/X11 .Dl $ chmod 777 /usr/spool/sockets/X11 .It Add the following lines to .Pa /etc/rc.local to create the necessary directories for the X server to deposit its files in, when the system boots: .Pp .Dl $ mkdir /tmp/.X11-unix .Dl $ chmod 777 /tmp/.X11-unix .Dl $ ln -s /usr/spool/sockets/X11/0 /tmp/.X11-unix/X0 .It It's also possible to link the X server to a more convenient location, such as: .Pp .Dl $ ln -s /emul/hpux/usr/bin/X /usr/X11R6/bin/X .El .Sh SEE ALSO .Xr options 4 , .Xr config 8 .Sh BUGS It might not be possible to run the X server on multiple framebuffers, even though both the X server and .Ox support them.