1.\" $NetBSD: compat_sunos.8,v 1.15 2002/02/13 08:18:22 ross 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 February 3, 2001 34.Dt COMPAT_SUNOS 8 35.Os 36.Sh NAME 37.Nm compat_sunos 38.Nd setup procedure for m68k, sparc and sparc64 architectures 39.Sh DESCRIPTION 40.Nx Ns Tn /sparc64 , 41.Nx Ns Tn /sparc 42and some of the 43.Nx Ns Tn /m68k 44architectures can run 45.Tn SunOS 46executables. Most executables will work. 47.Pp 48The exceptions include programs that use the 49.Tn SunOS 50kvm library, 51and various system calls, 52.Fn ioctl Ns 's , 53or kernel semantics that are difficult to emulate. 54The number of reasons why a program might fail to work is (thankfully) 55longer than the number of programs that fail to run. 56.Pp 57Static executables will normally run without any extra setup. 58This procedure details the directories and files that must be 59setup to allow dynamically linked executables to work. 60.Pp 61The files you need are on your 62.Tn SunOS 63machine. 64You need to worry about the legal issues of ensuring that you 65have a right to use the required files on your machine. 66On your 67.Nx 68machine, do the following: 69.Pp 70.Bl -enum -inset -offset 123 -compact 71.It 72.Li mkdir -p /emul/sunos/usr/lib /emul/sunos/usr/5lib 73.fi 74.Pp 75.It 76.Li cp SunOS:/usr/lib/lib*.so.*.* NetBSD:/emul/sunos/usr/lib 77.Pp 78.It 79.Li cp SunOS:/usr/5lib/lib*.so.*.* NetBSD:/emul/sunos/usr/5lib 80.Pp 81.It 82.Li cp SunOS:/usr/lib/ld.so NetBSD:/emul/sunos/usr/lib/ld.so 83.Pp 84.It 85If you ever expect to use YP, you will want to create a link: 86.nf 87.Li ln -s /var/run/ypbind.lock /etc/ypbind.lock 88.fi 89.El 90.Pp 91Alternatively, you can use an NFS mount to accomplish the same 92effect. 93On your 94.Nx 95machine, do the following: 96.Pp 97.Bl -enum -inset -offset 123 -compact 98.Pp 99.It 100.Li mkdir -p /emul/sunos/usr 101.Pp 102.It 103.Li mount SunOS:/usr /emul/sunos/usr 104.fi 105.El 106.Pp 107This will place the 108.Tn SunOS 109libraries on your 110.Nx 111machine 112in a location where the 113.Tn SunOS 114compatibility code will look for 115first, where they do not conflict with the standard libraries. 116.Sh NOTES 117When using 118.Nm 119on 120.Nx Ns Tn /sparc64 , 121the 122.Dv COMPAT_NETBSD32 123option must also be used. 124.Sh BUGS 125A list of things which fail to work in compatibility mode should 126be here. 127.Pp 128.Tn SunOS 129executables can not handle directory offset cookies \*[Gt] 32 bits. 130Should such an offset occur, you will see the message 131.Dq sunos_getdents: dir offset too large for emulated program . 132Currently, this can only 133happen on NFS mounted filesystems, mounted from servers that return 134offsets with information in the upper 32 bits. These errors should 135rarely happen, but can be avoided by mounting this filesystem with offset 136translation enabled. See the 137.Fl X 138option to 139.Xr mount_nfs 8 . 140The 141.Fl 2 142option to 143.Xr mount_nfs 8 144will also have the desired effect, but is less preferable. 145.Pp 146The 147.Nx Ns Tn /sparc64 148support is less complete than the other ports. 149