On 07/26/2012 11:26 AM, Rich Freeman wrote:
> Implementing it wouldn't necessarily be hard - just create a tmpfs
> under /var/tmp/portage, unshare off a new mount namespace, and
> read-only bind-mount everything needed from the root filesystem
> (including /var/tmp/portage/...), and chroot into it.  When the build
> is done the process governing it terminates and the kernel wipes out
> all the mounts and then portage unmounts the tmpfs.  You wouldn't need
> to use a tmpfs for the build - it would actually be zero-size as
> reported by df since it just contains a bazillion bind mounts, though
> all those mounts would consume slab memory.

It seems like you might need some kind of copy-on-write support, at
least to run pkg_setup. Apparently cowbuilder uses cow hardlinks for
that. Another way would be to use fiemap (cp --reflink).
-- 
Thanks,
Zac

Reply via email to