Subject: Re: an emulation environment dilema...
To: NetBSD-current Discussion List <current-users@netbsd.org>
From: Greg A. Woods <woods@most.weird.com>
List: current-users
Date: 10/22/1998 21:31:19
[ On Thu, October 22, 1998 at 18:01:45 (-0700), Jonathan Stone wrote: ]
> Subject: an emulation environment dilema...
>
> I think is lossage due to the order of  emul prefixing:
> it isn't being applied to the  target of the symlink.
> 
> If we did that (which in this case we clearly should), everything
> would Just Work.

Ah!  Symlinks.  I should probably also reveal that my /emul directory is
itself a symlink too:

	20:59 [233] $ ls -l /emul
	lrwxr-xr-x  1 root  wheel  8 May 16 16:49 /emul -> usr/emul

(and I should point out that I'm running NetBSD/sparc 1.3.2)

Making /emul/sunos/bin a real directory and putting a hardlink to the
arch binary doesn't help any....

Your comments seem to suggest that this should already be working.  I
didn't get that impression from the compat_sunos(8) manual page, though
it's fairly shy on how things are implemented and I hadn't read any of
the other compat_*(8) documents recently.  I see that in compat_linux(8)
for example there's a good description of how files will be tried with
the /emul/linux/ prefix first.  I guess my report really should have
been a PR, and I suppose someone in the know should clean up the
compat_*(8) pages, perhaps with one common page for "how it works" and
OS specific ones for how to set it up...

AH!  I note there's a related bug described in compat_linux(8):

     Pathnames pointed to by symbolic links are not looked up in the shadow
     root when running a Linux executable. This is not consistent.

compat_svr4(8) and compat_freebsd(8) has a similar description of
the prefixing of open()s, but do not include the above bug.

compat_sunos(8) and compat_ultrix(8) do not mention the prefixing magic,
though the latter does allude to it rather explicilty by giving examples
showing such prefixes.  Neither mention the symlink bug.

-- 
							Greg A. Woods

+1 416 218-0098      VE3TCP      <gwoods@acm.org>      <robohack!woods>
Planix, Inc. <woods@planix.com>; Secrets of the Weird <woods@weird.com>