Subject: chroot+union pkgsrc builds (was Re: pkg_install BIG problem)
To: Douglas Wade Needham <cinnion@ka8zrt.com>
From: Eric Haszlakiewicz <erh@nimenees.com>
List: tech-pkg
Date: 12/10/2004 16:16:39
On Fri, Dec 10, 2004 at 08:20:12AM -0500, Douglas Wade Needham wrote:
> 1) What are your null and union mounts?  I only have union mounts, and
>    here is the output for df on my system, as it currently does the
>    pkgsrc phase of a build.

Snippet of mount output:

/usr/pkgsrc.current on /space/netbsd/image-current/usr/pkgsrc type null (local)
<below>:/usr/pkgsrc.base on /space/netbsd/image-current/usr/pkgsrc type union
/space/netbsd/image-netbsd-2-0/usr/pkgsrc.2.0 on
	/space/netbsd/image-netbsd-2-0/usr/pkgsrc type null (local)
<below>:/usr/pkgsrc.base on /space/netbsd/image-netbsd-2-0/usr/pkgsrc type union
/home/ftp on /space/netbsd/image-current/home/ftp type null (local)
/home/ftp on /space/netbsd/image-netbsd-2-0/home/ftp type null (local)

I have:
 - a clean pkgsrc tree in /usr/pkgsrc.base
 - /usr/pkgsrc.base/distfiles pointing to ~ftp so I can share them with
	another machine that occasionally does pkgsrc builds.
	(by setting PKG_PATH)
 - NetBSD-current and NetBSD-2 images installed in /space/netbsd/image-<foo>
 - Null mounts to get pkgsrc.base to show up in the chroots.
 - Null mounts to make ~ftp show up in the chroots.
 - Union mounts so any files created by pkgsrc builds end up in
	/usr/pkgsrc.2.0 or /usr/pkgsrc.current

Since the base system has build.sh I don't use a chroot to build those.

> 2) Have you seen any oddities with files on the bottom side of union
>    mounts behaving oddly?  I see the jdk/jre distfiles appear
>    corrupted about 50% of the time, and so have taken to copying them
>    into the top directory before I do the union mount.  Unfortunately,
>    I have not had enough time to diagnose it further so that I could
>    express it in a PR.

	Nope.  I've been pleasantly surprised with how stable things have been.
However, I have gotten occasional panic's if I reboot w/o unmounting the
union mounts.
	Corrupted how?  Does the actual file data get corrupted, or just
when you try to access it through the mounted directory?

eric