Subject: Re: Using overlay+chroot for emul (Was Re: printing with acroread7 and cups)
To: Eric Haszlakiewicz <erh@nimenees.com>
From: Quentin Garnier <cube@cubidou.net>
List: tech-kern
Date: 09/03/2005 18:55:43
--M0++IvaR8xIqBMhe
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, Sep 03, 2005 at 10:36:13AM -0500, Eric Haszlakiewicz wrote:
> 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:
> > >=20
> > > 	_currently_ it's not a chroot, but it sure acts an awful lot like on=
e.
> > > 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 chroo=
t.
> > > If you just mount an overlay on / it's going to affect _all_ processe=
s,
> > > not just emul'd ones, so you need to mount it elsewhere and make that
> > > be the root for emul'd processes.
> > >=20
> >=20
> > 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:
> >=20
> > arcoread /home/user/blymn/something.pdf
> >=20
> > will open a pdf document in my home directory.  Are you intending this
> > not to work in your new proposed scheme?
>=20
> You're misunderstanding.  This is what I'm proposing:
>=20
> 	mount_union -b / /emul/linux   # not quite, but close
> 	chroot /emul/linux             # would happen automatically...
> 	acroread /home/user/blymn/something.pdf  # ...when this runs
>=20
> 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:
>=20
> 	mkdir /emul/linux/...
> 	mount_null / /emul/linux/...
> 	chroot /emul/linux
> 	cat /.../etc/ld.so.conf

I really don't see how it is different from the CHECK_ALT stuff:  you
can access everything in / through its own path, unless it is shadowed
and therefore found by the first lookup of emul_find.  And of course,
a path starting with '/../' will always start at the real root.

The only thing it changes is the handling of absolute symbolic links
within the emulation root.  I have ranted a lot about that in the past
and proposed some patches to solve it, but even that doesn't answer
all questions, like the realpath() stuff.

But the main problem will always be how to make it automatic?

--=20
Quentin Garnier - cube@cubidou.net - cube@NetBSD.org
"When I find the controls, I'll go where I like, I'll know where I want
to be, but maybe for now I'll stay right here on a silent sea."
KT Tunstall, Silent Sea, Eye to the Telescope, 2004.

--M0++IvaR8xIqBMhe
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (NetBSD)

iQEVAwUBQxnVj9goQloHrPnoAQKMDAgAm83vlJYSgiUFeovb04281oP/4WETF2Ud
o/L0RPY1etXH7J06QkrBhGhI2hYKQFw1b4x81AP662r3jING16geJrnTgtLfl259
PRK64ATaHxawf3XO3lXhj0eKj/WkvYvnCEWvCNiYPwMTHtxguRv3dMtHeV1+bK37
fkqRt2H2Lg6DaVUo8yttp8IrfiPxD+oWNljEzP4sHm64Evg9oRvWFNCbFW0BfABh
72jEBZ1VaMV6XGDSaSTbEN8CdiJV8eqILe7BAjLFGKlM1qU89zzpgqmCuMpv7riB
nPqhA9CdwzQegwkPSi/IFhJoNwUH0av+oRL7uRDmUXIE67qnw/b80A==
=Zey5
-----END PGP SIGNATURE-----

--M0++IvaR8xIqBMhe--