From owner-freebsd-hackers Thu Jan 31 1:20:15 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from dastardly.newsbastards.org.72.27.172.IN-addr.ARPA.NetScum.dyndns.dk (dclient217-162-110-65.hispeed.ch [217.162.110.65]) by hub.freebsd.org (Postfix) with ESMTP id E2C8A37B402 for ; Thu, 31 Jan 2002 01:20:08 -0800 (PST) Received: from beerswilling.netscum.dyndns.dk (dcf77-zeit.netscum.dyndns.dk [172.27.72.27] (may be forged)) by dastardly.newsbastards.org.72.27.172.IN-addr.ARPA.NetScum.dyndns.dk (8.11.6/8.11.6) with ESMTP id g0V9K1I00788 (using TLSv1/SSLv3 with cipher EDH-RSA-DES-CBC3-SHA (168 bits) verified FAIL); Thu, 31 Jan 2002 10:20:05 +0100 (CET) (envelope-from bounce@dcf77-zeit.netscum.dyndns.dk) Received: (from root@localhost) by beerswilling.netscum.dyndns.dk (8.11.6/8.11.6) id g0V9K1L00787; Thu, 31 Jan 2002 10:20:01 +0100 (CET) (envelope-from bounce@dcf77-zeit.netscum.dyndns.dk) Date: Thu, 31 Jan 2002 10:20:01 +0100 (CET) Message-Id: <200201310920.g0V9K1L00787@beerswilling.netscum.dyndns.dk> From: BOUWSMA Beery To: hackers@freebsd.org Subject: Re: buildworld via ro mounted /usr/src Cc: "Simon 'corecode' Schubert" References: <20020130170244.6f1cdf09.corecode@corecode.ath.cx> Organization: Men not wearing any pants that dont shave X-Hacked: via telnet to your port 25, what else? X-Internet-Access-Provided-By: Mountain Informatik AG Zuerich X-NetScum: Yes X-One-And-Only-Real-True-Fluffy: No Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Moin, moin! %s wrote on %.3s, %lld Sep 1993 > and building world/kernel via nfs mounts. > in order not to get things mixed up i share /usr/ports and /usr/src ro and > /usr/ports/distfiles, /usr/obj rw. > should work as desired: > WRKDIRPREFIX set to a reasonable value (depending on arch and cpu) and > MAKEOBJDIRPREFIX too. Okay, what, and how? I just encountered this problem some weeks ago, and found a solution that seems to work for me, that I'll share with you. There may be some subtleties that will later sneak up upon me, but this does work with a read-only source tree: As seen in my /etc/make.conf file: WRKDIRPREFIX= /usr/obj/ports/${OSREL} (note that there *are* problems with this in /usr/obj, but I haven't rediscovered them with this particular incantation, and it keeps a separate ports build tree for both 4.x and 5.0 that I have on the same disk which was one of my original goals) RELNAME!= /usr/bin/uname -r MAKEOBJDIRPREFIX?= /usr/obj/${RELNAME} ^^ IMPORTANT!! WICHTIG!!@!! This probably failed for you because you set an absolute value for this (using `=' rather than `?='). One of the makefiles or mk files says more about this, as it's something you should use as an `env' environment variable, as it gets reset in the build process, which results in the failure you see (and that I saw). I've used this, and it seems to work just fine. Again, I do this to keep a separate build object tree for each of the three OSen on my disk, for whatever reason. Now, later, you'll come to the problem that you need to configure and build a kernel, and if you're trying to do that with a read-only source, the default location for your kernel config file is within that. This is solved in -CURRENT and is trivial to patch -STABLE to fix. Then the following lines in /etc/make.conf will work, to allow you to keep your kernel config outside the source tree, and on your local machine. Change as you see fit, and you may give these instead on the build like like you probably do now (and if you do, it will override these customized defaults): KERNCONF?= FreeBEER KERNCONFDIR?= /usr/local/etc/config For this to work, you need the following patch to /usr/src/Makefile.inc1 : --- /usr/local/system/src/Makefile.inc1-DIST Mon Dec 17 16:41:55 2001 +++ /usr/local/source-hacks/Makefile.inc1 Tue Dec 18 07:38:10 2001 @@ -400,11 +400,12 @@ KRNLSRCDIR= ${.CURDIR}/sys KRNLCONFDIR= ${KRNLSRCDIR}/${MACHINE}/conf KRNLOBJDIR= ${OBJTREE}${KRNLSRCDIR} +KERNCONFDIR?= ${KRNLCONFDIR} BUILDKERNELS= INSTALLKERNEL= .for _kernel in ${KERNCONF} -.if exists(${KRNLCONFDIR}/${_kernel}) +.if exists(${KERNCONFDIR}/${_kernel}) BUILDKERNELS+= ${_kernel} .if empty(INSTALLKERNEL) INSTALLKERNEL= ${_kernel} @@ -438,7 +439,8 @@ .if !defined(NO_KERNELCONFIG) cd ${KRNLCONFDIR}; \ PATH=${TMPPATH} \ - config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} ${_kernel} + config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} \ + ${KERNCONFDIR}/${_kernel} .endif .if !defined(NOCLEAN) && !defined(NO_KERNELCLEAN) .if defined(MODULES_WITH_WORLD) || defined(NO_MODULES) || !exists(${KRNLSRCDIR}/modules) Taken verbatim out of the -current Makefile.inc1 (Someday I'll get off my lazy butt and submit this as a pr, to try and get it incorporated in -stable, to make my life easier) > but *somehow* some tools appear to be built into /usr/src and not into /usr/obj > (as it should be). > might be that's just the bootstrapping tools, > but why? and how do i change this behavior? The key to this is how you've set MAKEOBJDIRPREFIX. > i didn't find a good (any) guide to this on the net. Hope my experience (reported to freebsd-bugs a little while back) helps you out. It works fine for me... barry bouwsma, netscum To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message