Subject: Re: read-only nfs mounted pkgsrc problems
To: Axel Scheepers <ascheepers@vianetworks.nl>
From: Douglas Wade Needham <cinnion@ka8zrt.com>
List: tech-pkg
Date: 02/23/2004 09:34:56
The problem is that builds in pkgsrc put countless files into the
pkgsrc tree when the package source is unpacked, the source is built,
build status files are touched, etc.  A quick review of the mk.conf and
bsd.pkg.defaults.mk files points to WRKOBJDIR which should work for
you, but I do not happen to use it.  However, you also need to keep in
mind that you will want to change things like DISTDIR and PACKAGES
since the retrieved source archives and created packages are placed
into those directory structures as well, which are by default under
your pkgsrc.

You also mentioned not wanting to do union mounts.  I am a little
curious why this is the case, since I have been using union mounts for
all my builds for a couple of years now with no problems.  Indeed, my
builds in pkgsrc are done with union mounts in a chroot'ed sandbox
[pointers to info about that are in another message I recently sent].
I happen to have my source tree NFS mounted from another host and then
a union mount placing it under my sandbox right now to build the
packages I use for -current.  Here is an df from that system (sorry
for the width):

    Filesystem                          1K-blocks     Used     Avail Capacity  Mounted on
    /dev/wd0a                               63549    38646     21725    64%    /
    /dev/wd0g                             1016607   203531    762245    21%    /var
    /dev/wd0i                            14453482  9039673   4691134    65%    /u0
    /dev/wd0h                             2032447  1704404    226420    88%    /usr
    /dev/wd0e                               63455        1     60281     0%    /stand
    /dev/wd0m                            20972825 16272117   4700708    77%    /msdos
    mfs:371                                127023        4    120667     0%    /tmp
    kernfs                                      1        1         0   100%    /kern
    procfs                                      4        4         0   100%    /proc
    fargone:/u0/source                   37884761 19897844  16092678    55%    /u0/source
    fargone:/u0/distfiles                37884761 19897844  16092678    55%    /u0/distfiles
    pell:/var/mail                        2032447   292030   1638794    15%    /var/mail
    pell:/u1                             36868346 26206770   8818158    74%    /amd/pell/u1
    <below>:/u0/source/usr/src.current   13379806  7965997   4691134    62%    /u0/dist_current.pkgs/usr/src
    <below>:/u0/source/usr/xsrc.current  13379806  7965997   4691134    62%    /u0/dist_current.pkgs/usr/xsrc
    <below>:/u0/source/usr/pkgsrc        13379806  7965997   4691134    62%    /u0/dist_current.pkgs/usr/pkgsrc
    <below>:/u0/distfiles                13379806  7965997   4691134    62%    /u0/dist_current.pkgs/source/distfiles
    kernfs                                      1        1         0   100%    /u0/dist_current.pkgs/kern
    procfs                                      4        4         0   100%    /u0/dist_current.pkgs/proc

Nary a problem from this which I can attribute to union mounts.  I did
see a few panics on 1.6ZH, but I got the same without union mounts as
I did other tasks of very heavy compute+IO, so I have to rule the
union mounts out.   I had held off on upgrading the kernel due to
extreme slowness, but I just updated to ZK and I do not see that now.

- Doug

Quoting Axel Scheepers (ascheepers@vianetworks.nl):
> Hello All,
> 
> I have a problem with a read-only mouted pkgsrc:
> janis:~ root$ mount
> ...
> sirius:/usr/src on /usr/src type nfs (read-only)
> sirius:/usr/pkgsrc on /usr/pkgsrc type nfs (read-only)
> janis:~ root$ cd /usr/pkgsrc/pkgtools/digest/
> janis:/usr/pkgsrc/pkgtools/digest root$ make install PKG_DEBUG_LEVEL=2 2>&1
> | tee /tmp/build.log
> ...
> + cd /usr/pkgsrc/pkgtools/digest
> + make DIGEST=/usr/local/bin/digest HOST_OSTYPE=NetBSD-1.6.2-i386
> LOWER_OPSYS=netbsd OPSYS=NetBSD OS_VERSION=1.6.2 PKGTOOLS_VERSION=20030918
> PKG_DEBUG_LEVEL=2 _SRC_TOP_= OPSYS=NetBSD OS_VERSION=1.6.2
> LOWER_OPSYS=netbsd /tmp/pkgsrc/work/pkgtools/digest/work/.PLIST
> make: don't know how to make /tmp/pkgsrc/work/pkgtools/digest/work/.PLIST.
> Stop
> 
> make: stopped in /usr/pkgsrc/pkgtools/digest
> *** Error code 2
> 
> janis:~ root$ cat /etc/mk.conf
> 
> # package stuff. Install in /usr/local by default and
> # keep obj's local (when we nfs mount pkgsrc)
> LOCALBASE="/usr/local"
> 
> WRKOBJDIR="/tmp/pkgsrc/work"
> DISTDIR="/tmp/pkgsrc/distfiles"
> 
> So far, all building is done ok, but it keeps failing with above error after
> installing the binaries.
> 
> If possible I don't want to use a union mount.
> 
> Anyone an idea about what I'm doing wrong here?
> (please cc: me, I'm not on the list (yet))
> 
> Thanks a million,
> Axel

-- 
Douglas Wade Needham - KA8ZRT        UN*X Consultant & UW/BSD kernel programmer
Email:  cinnion @ ka8zrt . com       http://cinnion.ka8zrt.com
Disclaimer: My opinions are my own.  Since I don't want them, why
            should my employer, or anybody else for that matter!