Subject: Re: directory-scanning in linux emulation
To: None <smb@cs.columbia.edu>
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
List: current-users
Date: 07/07/2006 00:24:41
smb@cs.columbia.edu wrote:

> When running firefox-linux (though I've heard the problem also happens
> with gaim), it doesn't DTRT in the dialog box for selecting an application
> to handle a particular file.  In particular, it seems to show only the
> Linux emulation tree, rather than the whole system; this in turn means
> that things in /usr/pkg/bin -- a likely source -- aren't visible.

Isn't it a design of compat_linux(8) implementation?

>>  [..] This directory is named /emul/linux.  Any file operations done
>>  by Linux programs run under NetBSD will look in this directory first.
>>  So, if a Linux program opens, for example, /etc/passwd, NetBSD will
>>  first try to open /emul/linux/etc/passwd, and if that does not exist
>>  open the `real' /etc/passwd file.

So if the dialog box tries to open /usr, it shows /emul/linux/usr,
not real /usr. If there is no /emul/linux/usr/pkg dir it doesn't
show pkg dir on the shadow /usr dialog box, though you could type
"/usr/pkg/bin" directly in the dialog to see real /usr/pkg/bin dir.

If you want to make linux binaries not to search /emul/linux
shadow tree, you could use /../ prefix for file path.
(undocumented but noted in sys/compat/common/compat_util.c)
I.e. if you create a symlink "netbsd@ -> /.." under /emul,
you could see whole NetBSD native tree under /emul/netbsd/
even on any dialog box.
---
Izumi Tsutsui