xref: /netbsd-src/share/man/man8/compat_sunos.8 (revision b1c86f5f087524e68db12794ee9c3e3da1ab17a0)
1.\"	$NetBSD: compat_sunos.8,v 1.19 2009/10/14 23:49:50 joerg 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.Bl -enum -offset 123
64.It
65.Li mkdir -p /emul/sunos/usr/lib /emul/sunos/usr/5lib
66.It
67.Li cp SunOS:/usr/lib/lib*.so.*.* NetBSD:/emul/sunos/usr/lib
68.It
69.Li cp SunOS:/usr/5lib/lib*.so.*.* NetBSD:/emul/sunos/usr/5lib
70.It
71.Li cp SunOS:/usr/lib/ld.so NetBSD:/emul/sunos/usr/lib/ld.so
72.It
73If you ever expect to use YP, you will want to create a link:
74.Bd -literal -compact
75ln -s /var/run/ypbind.lock /etc/ypbind.lock
76.Ed
77.El
78.Pp
79Alternatively, you can use an NFS mount to accomplish the same
80effect.
81On your
82.Nx
83machine, do the following:
84.Bl -enum -offset 123
85.It
86.Li mkdir -p /emul/sunos/usr
87.It
88.Li mount SunOS:/usr /emul/sunos/usr
89.El
90.Pp
91This will place the
92.Tn SunOS
93libraries on your
94.Nx
95machine
96in a location where the
97.Tn SunOS
98compatibility code will look for
99first, where they do not conflict with the standard libraries.
100.Sh NOTES
101When using
102.Nm
103on
104.Nx Ns Tn /sparc64 ,
105the
106.Dv COMPAT_NETBSD32
107option must also be used.
108.Sh BUGS
109A list of things which fail to work in compatibility mode should
110be here.
111.Pp
112.Tn SunOS
113executables can not handle directory offset cookies \*[Gt] 32 bits.
114Should such an offset occur, you will see the message
115.Dq sunos_getdents: dir offset too large for emulated program .
116Currently, this can only
117happen on NFS mounted filesystems, mounted from servers that return
118offsets with information in the upper 32 bits. These errors should
119rarely happen, but can be avoided by mounting this filesystem with offset
120translation enabled. See the
121.Fl X
122option to
123.Xr mount_nfs 8 .
124The
125.Fl 2
126option to
127.Xr mount_nfs 8
128will also have the desired effect, but is less preferable.
129.Pp
130The
131.Nx Ns Tn /sparc64
132support is less complete than the other ports.
133