Subject: Re: shell scripts in an emulation environment
To: tech-kern@NetBSD.ORG, Bill Studenmund <wrstuden@loki.stanford.edu>
From: Matthias Drochner <drochner@zelux6.zel.kfa-juelich.de>
List: tech-kern
Date: 01/28/1998 10:32:57
Excerpts from netbsd: 27-Jan-98 shell scripts in an emulati.. Bill
Studenmund@loki.sta (1628*)

> The problem is that it for normal NetBSD users, it ends up being run by
> NetBSD's /bin/sh.  I'd prefer the matlab script be run by /emul/OS/bin/sh.

I had this problem too several times. It seems quite common
to determine the system type by"uname" not only in the
installation process but at runtime too.

> Looking at the source, basically my idea is to get the check_exec call
> made within exec_script_makecmds to try "/emul/OS/"+interp. name, then
> just interp. name.

check_exec() is called by sys_execve() too. My idea was to
delete the lookup of the emulation path from eg linux_sys_execve()
and provide a callback into the emulation code through the
"struct emul" instead which does the emulation specific lookup.
This callback would then be called by check_exec().
This was more than I wanted to do on that day (and the
structure of sys_execve() didn't encourage me much), so I 
didn't even try it.

best regards
Matthias