From owner-freebsd-toolchain@FreeBSD.ORG Thu Dec 6 07:30:57 2012 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3F1068A1 for ; Thu, 6 Dec 2012 07:30:57 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-oa0-f54.google.com (mail-oa0-f54.google.com [209.85.219.54]) by mx1.freebsd.org (Postfix) with ESMTP id F254B8FC0C for ; Thu, 6 Dec 2012 07:30:56 +0000 (UTC) Received: by mail-oa0-f54.google.com with SMTP id n9so7777539oag.13 for ; Wed, 05 Dec 2012 23:30:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=ddY9AZO7LWLaHKyFV8iy187WcnWF0/t0p3inlZTmGag=; b=o1e7DKnXrhW6Wn+z3PghaG5pHu5utS1v3UR7+434z8sPblMegGNZyzA38232vF4Ymz JBsozGFtp9xYgydbYExQqh2FPk324I/ztCVXgeEwgm9esJr+qAUdXEZtnq3FVItSzRTG j94DNGhLO2xNf9dm66DTohDJr82uYFfmizO9CWz0sqsD6kuJJNlMqyspuUMkRgakD/Ml 50NFUvT11RDG6Cpuxamf9EGYKOQSeGBnoVQVwVmDag4WgcubSKWodoxkLzb/JSbadaBm YJ0TLb6lzBzFjJJyUUkHGkmQj5tU6VHS/KsSq1eEFLtOnssR/+1M3Kjk36OUU2sOCMby JoYQ== MIME-Version: 1.0 Received: by 10.182.95.205 with SMTP id dm13mr336877obb.9.1354778696705; Wed, 05 Dec 2012 23:24:56 -0800 (PST) Received: by 10.76.143.33 with HTTP; Wed, 5 Dec 2012 23:24:56 -0800 (PST) In-Reply-To: References: Date: Wed, 5 Dec 2012 23:24:56 -0800 Message-ID: Subject: Re: [RFC] teach config(8) about KERNCONFDIR From: Garrett Cooper To: freebsd-toolchain@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Dec 2012 07:30:57 -0000 On Wed, Dec 5, 2012 at 9:23 PM, Garrett Cooper wrote: > (Sorry in advance for GMail mangling). > > I recently moved all of my svn trees to git and in order to ensure > that my trees are in as pristine a state as possible I've started > setting KERNCONFDIR=/root in /etc/src.conf and I specify KERNCONF?= > -DEBUG. This works pretty well in a standard setup (when > files are located in /sys//conf, are standalone, etc). In order > to eliminate duplication, I wrote -DEBUG to include and > augment it a bit (enable WITNESS, INVARIANTS, etc). However, I > discovered that if I do this, config fails to find the file because it > only knows how to find 1) absolute paths, 2) relative paths to the obj > dir, and 3) as a last ditch effort it tries to use ../../conf/ > (/sys/conf I believe for the generic KERNCONF directory). I added the > patch below to teach config(8) about KERNCONFDIR for my own local use > (and I think fixed a subtle bug with asprintf and free usage), but the > support seems hacky. Another alternative (after doing a bit of > research) that looks better is NetBSD's concept of prefix paths: (for the archive's sake) I ran buildkernel again and the patch doesn't work as-is if it's not defined in the environment as it isn't one of the variables that's passed through by default via make to buildkernel when running config(8), so one needs to modify Makefile.inc1 as well in order for things to function properly as described with my patch. Thanks, -Garrett