Subject: Re: Using overlay+chroot for emul (Was Re: printing with acroread7 and cups)
To: Brett Lymn <blymn@baesystems.com.au>
From: Eric Haszlakiewicz <erh@nimenees.com>
List: tech-kern
Date: 09/03/2005 10:36:13
On Sat, Sep 03, 2005 at 02:52:31PM +0930, Brett Lymn wrote:
> On Fri, Sep 02, 2005 at 08:53:21AM -0500, Eric Haszlakiewicz wrote:
> > 
> > 	_currently_ it's not a chroot, but it sure acts an awful lot like one.
> > If the /emul path stuff was implemented w/o all the wrapper syscalls that
> > just have CHECK_ALT_*, the easiest way to do it would be with a chroot.
> > If you just mount an overlay on / it's going to affect _all_ processes,
> > not just emul'd ones, so you need to mount it elsewhere and make that
> > be the root for emul'd processes.
> > 
> 
> I may be misunderstanding this but it sounds here a lot like you may
> break how things work at the moment.  Currently with the emul
> framework I can reference a file in my home directory which is outside
> the /emul tree as an argument to a linux binary and it will just work:
> 
> arcoread /home/user/blymn/something.pdf
> 
> will open a pdf document in my home directory.  Are you intending this
> not to work in your new proposed scheme?

You're misunderstanding.  This is what I'm proposing:

	mount_union -b / /emul/linux   # not quite, but close
	chroot /emul/linux             # would happen automatically...
	acroread /home/user/blymn/something.pdf  # ...when this runs

Everything in / would be accesible through /emul/linux except for
things that are shadowed.  e.g. since there's a /emul/linux/etc/ld.so.conf
you wouldn't be able to get to /etc/ld.so.conf, unless you also did:

	mkdir /emul/linux/...
	mount_null / /emul/linux/...
	chroot /emul/linux
	cat /.../etc/ld.so.conf

eric