Unionfs etc Re: Packaging

Matthew Dillon dillon at apollo.backplane.com
Thu Mar 11 18:39:05 PST 2004


:# mkdir /tmp/a
:# mount_union /tmp/a /usr/local
:
:works fine and if I create a file in /usr/local it gets "really"
:created in /tmp and is only visible there after umounting /usr/local
:-- just what I wanted.  However,
:
:# mount_union /tmp/a /
:says 
:mount_union: /tmp/a (/usr/tmp/a) and / (/) are not distinct paths
:
:Is there a way around this?  I ask because I'd rather not assume
:anything about PREFIX, and I'd like this to be usable for
:badly-behaved installers that put stuff into other places like /etc,

    Well, /tmp/a on top of / creates a recursion within unionfs, which is
    why it is not allowed.  Actually, the more interesting mount is:

    mount_union -b / /tmp/a

    Which would create an image of the entire filesystem in /tmp/a, suitable
    for chroot'ing into /tmp/a.   But this is not currently allowed either.

    If you (or someone) would like to fix this, I think it's a fairly simple
    matter to have unionfs detect the recursion (e.g. /tmp/a/tmp/a) and
    disallow access to it.

    This would make unionfs a *very* powerful tool.

:Another question: the FreeBSD porters' handbook requires you to create
:a directory tree first in your temporary install directory when
:building pkg-plist, and add any newly created directories to pkg-plist
:with a @dirrm -- is this really necessary?  It seems to me that we can
:just make pkg_delete (or its successor) remove any empty directories
:it finds after deleting files, including /usr/local/share or other
:"standard" places -- there's no reason to have these directories if
:there's nothing in them.
:
:Rahul

    I don't know the answer to the second question.

					-Matt
					Matthew Dillon 
					<dillon at xxxxxxxxxxxxx>





More information about the Kernel mailing list