1.\" $NetBSD: compat_sunos.8,v 1.4 1994/11/30 19:36:22 jtc Exp $ 2.\" 3.\" Copyright (c) 1984 Theo de Raadt 4.\" All rights reserved. 5.\" 6.\" Redistribution and use in source and binary forms, with or without 7.\" modification, are permitted provided that the following conditions 8.\" are met: 9.\" 1. Redistributions of source code must retain the above copyright 10.\" notice, this list of conditions and the following disclaimer. 11.\" 2. Redistributions in binary form must reproduce the above copyright 12.\" notice, this list of conditions and the following disclaimer in the 13.\" documentation and/or other materials provided with the distribution. 14.\" 3. All advertising materials mentioning features or use of this software 15.\" must display the following acknowledgement: 16.\" This product includes software developed by Theo de Raadt. 17.\" 4. Neither the name of the author nor the names of its contributors 18.\" may be used to endorse or promote products derived from this software 19.\" without specific prior written permission. 20.\" 21.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND 22.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE 25.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31.\" SUCH DAMAGE. 32.\" 33.Dd June 15, 1994 34.Dt COMPAT_SUNOS 8 35.Os BSD 4 36.Sh NAME 37.Nm COMPAT_SUNOS 38.Nd setup procedure for m68k and sparc architectures 39.Sh DESCRIPTION 40NetBSD/sparc and some of the NetBSD/m68k architectures can run 41SunOS executables. Most executables will work. 42.Pp 43The exceptions include programs that use the SunOS kvm library, 44and various system calls, ioctl()'s, or kernel semantics 45that are difficult to emulate. 46The number of reasons why a program might fail to work is (thankfully) 47longer than the number of programs that fail to run. 48.Pp 49Static executables will normally run without any extra setup. 50This procedure details the directories and files that must be 51setup to allow dynamically linked executables to work. 52.Pp 53The files you need are on your Sun machine. 54You need to worry about the legal issues of ensuring that you 55have a right to use the required files on your machine. 56.Pp 57.Bl -tag -width 123 -compact 58.It 1. 59On your NetBSD machine, do the following: 60.nf 61mkdir /sun 62mkdir /sun/lib 63mkdir /sun/5lib 64ln -s /sun/5lib /usr/5lib 65.fi 66.Pp 67.It 2. 68cp 69.Pa SunOS:/usr/lib/lib*.so.*.* 70.Pa NetBSD:/sun/lib 71.Pp 72.It 3. 73cp 74.Pa SunOS:/usr/5lib/lib*.so.*.* 75.Pa NetBSD:/sun/5lib 76.Pp 77.It 4. 78cp 79.Pa SunOS:/usr/lib/ld.so 80.Pa NetBSD:/usr/lib/ld.so 81.Pp 82.It 5. 83On your NetBSD machine, edit the 84.Pa ld.so 85binary using a binary editor. 86In the binary, change every occurance of a path that starts with 87.Pa /usr 88so that it starts with 89.Pa /sun . 90Note that the strings "/usr" and "/sun" are the same length. 91.Pp 92.It 6. 93If you ever expect to use YP, you will want to create a link: 94.nf 95ln -s /var/run/ypbind.lock /etc/ypbind.lock 96.fi 97.El 98.Pp 99This will place the SunOS libraries on your NetBSD machine 100in a location where they do not conflict with the standard libraries, 101and also teach the SunOS dynamic linker to search for the SunOS 102dynamic libraries in that place. 103.Pp 104.Sh BUGS 105A list of things which fail to work in compatibility mode should 106be here. 107