1.\" $NetBSD: compat_sunos.8,v 1.18 2003/12/10 12:06:25 agc 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.\" 15.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND 16.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE 19.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25.\" SUCH DAMAGE. 26.\" 27.Dd February 3, 2001 28.Dt COMPAT_SUNOS 8 29.Os 30.Sh NAME 31.Nm compat_sunos 32.Nd setup procedure for m68k, sparc and sparc64 architectures 33.Sh DESCRIPTION 34.Nx Ns Tn /sparc64 , 35.Nx Ns Tn /sparc 36and some of the 37.Nx Ns Tn /m68k 38architectures can run 39.Tn SunOS 40executables. Most executables will work. 41.Pp 42The exceptions include programs that use the 43.Tn SunOS 44kvm library, 45and various system calls, 46.Fn ioctl Ns 's , 47or kernel semantics that are difficult to emulate. 48The number of reasons why a program might fail to work is (thankfully) 49longer than the number of programs that fail to run. 50.Pp 51Static executables will normally run without any extra setup. 52This procedure details the directories and files that must be 53set up to allow dynamically linked executables to work. 54.Pp 55The files you need are on your 56.Tn SunOS 57machine. 58You need to worry about the legal issues of ensuring that you 59have a right to use the required files on your machine. 60On your 61.Nx 62machine, do the following: 63.Pp 64.Bl -enum -offset 123 -compact 65.It 66.Li mkdir -p /emul/sunos/usr/lib /emul/sunos/usr/5lib 67.fi 68.Pp 69.It 70.Li cp SunOS:/usr/lib/lib*.so.*.* NetBSD:/emul/sunos/usr/lib 71.Pp 72.It 73.Li cp SunOS:/usr/5lib/lib*.so.*.* NetBSD:/emul/sunos/usr/5lib 74.Pp 75.It 76.Li cp SunOS:/usr/lib/ld.so NetBSD:/emul/sunos/usr/lib/ld.so 77.Pp 78.It 79If you ever expect to use YP, you will want to create a link: 80.nf 81.Li ln -s /var/run/ypbind.lock /etc/ypbind.lock 82.fi 83.El 84.Pp 85Alternatively, you can use an NFS mount to accomplish the same 86effect. 87On your 88.Nx 89machine, do the following: 90.Pp 91.Bl -enum -offset 123 -compact 92.Pp 93.It 94.Li mkdir -p /emul/sunos/usr 95.Pp 96.It 97.Li mount SunOS:/usr /emul/sunos/usr 98.fi 99.El 100.Pp 101This will place the 102.Tn SunOS 103libraries on your 104.Nx 105machine 106in a location where the 107.Tn SunOS 108compatibility code will look for 109first, where they do not conflict with the standard libraries. 110.Sh NOTES 111When using 112.Nm 113on 114.Nx Ns Tn /sparc64 , 115the 116.Dv COMPAT_NETBSD32 117option must also be used. 118.Sh BUGS 119A list of things which fail to work in compatibility mode should 120be here. 121.Pp 122.Tn SunOS 123executables can not handle directory offset cookies \*[Gt] 32 bits. 124Should such an offset occur, you will see the message 125.Dq sunos_getdents: dir offset too large for emulated program . 126Currently, this can only 127happen on NFS mounted filesystems, mounted from servers that return 128offsets with information in the upper 32 bits. These errors should 129rarely happen, but can be avoided by mounting this filesystem with offset 130translation enabled. See the 131.Fl X 132option to 133.Xr mount_nfs 8 . 134The 135.Fl 2 136option to 137.Xr mount_nfs 8 138will also have the desired effect, but is less preferable. 139.Pp 140The 141.Nx Ns Tn /sparc64 142support is less complete than the other ports. 143