From owner-freebsd-hackers@FreeBSD.ORG Thu Jul 10 16:26:24 2014 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 46ADA301 for ; Thu, 10 Jul 2014 16:26:24 +0000 (UTC) Received: from mail.iXsystems.com (newknight.ixsystems.com [206.40.55.70]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2041E2B9A for ; Thu, 10 Jul 2014 16:26:23 +0000 (UTC) Received: from localhost (mail.ixsystems.com [10.2.55.1]) by mail.iXsystems.com (Postfix) with ESMTP id ACEC174B89 for ; Thu, 10 Jul 2014 09:26:22 -0700 (PDT) Received: from mail.iXsystems.com ([10.2.55.1]) by localhost (mail.ixsystems.com [10.2.55.1]) (maiad, port 10024) with ESMTP id 94391-02 for ; Thu, 10 Jul 2014 09:26:22 -0700 (PDT) Received: from [10.0.1.11] (base.kithrup.com [173.164.180.195]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.iXsystems.com (Postfix) with ESMTPSA id C416A74B84 for ; Thu, 10 Jul 2014 09:26:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=ixsystems.com; s=newknight0; t=1405009582; bh=p8TzIhjo7ZG1VUkDkb0zKVMMhE7xGOAHEDMMObo4FhU=; h=Subject:From:In-Reply-To:Date:References:To; b=kVSyh3Wi/S3DXaMwBt6eJsTWJyZATdHYqWmQwDPgp1Ell7pJODyy2O031g1o8x65S V6mnGicDKgVyysMQ/Msah2Pn/t7QWN69zLN1ufaC+u0BIT3bSycHPw5AwiRlRnqmfh L0yEw4sYbv7AvCO7KfY9vyY85uoALCPZST9+wGl0= Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: Expanding on NO_ROOT: Categorizing installed files From: Sean Fagan In-Reply-To: <20140710153530.GA16174@lor.one-eyed-alien.net> Date: Thu, 10 Jul 2014 09:26:19 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <048B595B-6B91-40B6-84A4-E23948423354@ixsystems.com> <20140710153530.GA16174@lor.one-eyed-alien.net> To: hackers@freebsd.org X-Mailer: Apple Mail (2.1878.6) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jul 2014 16:26:24 -0000 On Jul 10, 2014, at 8:35 AM, Brooks Davis wrote: > I very much like the functionalty and think it's a good idea. It was mostly Xin and Jordan's idea :). ("Wouldn't it be nice if we = could use that somehow? Sean, go do that.") > I don't > understand why you didn't use the existing -T/tags=3D mechanism in > install which we're already using for debug info. A couple of reasons: first, because it wasn't clear to me who was using = -T, and I didn't want to alter the functionality of that; second, because I = wasn't clear how one would have multiple tags. (The latter is not a huge deal, I can = obviously code that up easily enough, and make a comma-separated list in install.) I had initially called it "package", btw, and that shows up in some = places still. "category" seemed like a better name. >=20 >> diff --git a/Makefile.inc1 b/Makefile.inc1 >> index c0591b6..b9edd0d 100644 >> --- a/Makefile.inc1 >> +++ b/Makefile.inc1 >> @@ -14,6 +14,7 @@ >> # -DNO_KERNELOBJ do not run ${MAKE} obj in ${MAKE} buildkernel >> # -DNO_PORTSUPDATE do not update ports in ${MAKE} update >> # -DNO_ROOT install without using root privilege >> +# -DLOG_META_INFO Log metadata about installed files >=20 > I don't see much value in supporting the metadata log in the install = as > root case. Is there are reason it's needed? I initially only used NO_ROOT. However, then when I started making = packages using that, I found out that I really did need to have the install run = as root, because I could not specify all of the mode bits in the PKGNG manifest, and thus = I needed tar to pick them up. (Eventually, admittedly, I did end up using the = python tarfile module, and so that's an option. However, getting the right bits in the = tarfile module in python is a pain, and it's easier to let it set things from the = actual filesystem.) Further, I didn't assume everyone who wanted to use this would want to = do full packaging, but might want to instead simply use grep and tar to pick which files. = Or many other things. So I opted for the most flexible variant, which was to keep NO_ROOT = behaving as it did, and add another case that used most of the work from NO_ROOT. Does that make sense? >>=20 >> distributekernel distributekernel.debug: >> diff --git a/bin/Makefile b/bin/Makefile >> index e5052ca..ca218ac 100644 >> --- a/bin/Makefile >> +++ b/bin/Makefile >> @@ -1,6 +1,9 @@ >> # From: @(#)Makefile 8.1 (Berkeley) 5/31/93 >> # $FreeBSD$ >>=20 >> +META_CATEGORY=3D base >=20 > I belive this should be in bin/Makefile.inc which will eliminate the = need > for .EXPORTVAR. I will try that later; thanks. >> diff --git a/lib/csu/amd64/Makefile b/lib/csu/amd64/Makefile >> index afe7fe6..5616e04 100644 >> --- a/lib/csu/amd64/Makefile >> +++ b/lib/csu/amd64/Makefile >> @@ -9,6 +9,9 @@ CFLAGS+=3D -I${.CURDIR}/../common \ >> -I${.CURDIR}/../../libc/include >> CFLAGS+=3D -fno-omit-frame-pointer >>=20 >> +META_CATEGORY=3D base >> +.EXPORTVAR: META_CATEGORY >> + >=20 > I think the .EXPORTVAR is gratutious here and in the other > lib/*/Makefiles. For that matter, I don't understand why it's needed = at > all given the presence of META_CATEGORY in lib/Makefile. I didn't put it in all of the Makefiles, and the reason for having it in the environment was to allow for sub-directories to pick it up; it also allows for them to easily over-ride it. (E.g., for any library in = src/lib which someone might decide shouldn't really be part of base.) >> diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile >> index dfa450e8..268ce8a 100644 >> --- a/share/man/man9/Makefile >> +++ b/share/man/man9/Makefile >> @@ -1,5 +1,8 @@ >> # $FreeBSD$ >>=20 >> +META_CATEGORY=3D kernel >=20 > I can see some loging in this, but it seems like a somewhat odd = choice. Odd choice how? >>=20 >> diff --git a/share/mk/bsd.links.mk b/share/mk/bsd.links.mk >> index 1e4d57e..c9f83f0 100644 >> --- a/share/mk/bsd.links.mk >> +++ b/share/mk/bsd.links.mk >> @@ -8,7 +8,8 @@ afterinstall: _installlinks >> .ORDER: realinstall _installlinks >> _installlinks: >> .if defined(LINKS) && !empty(LINKS) >> - @set ${LINKS}; \ >> + @echo LINKFOO >> + set ${LINKS}; \ >=20 > This looks like a debug leftover. >=20 >> while test $$# -ge 2; do \ >> l=3D${DESTDIR}$$1; \ >> shift; \ >> @@ -19,7 +20,8 @@ _installlinks: >> done; true >> .endif >> .if defined(SYMLINKS) && !empty(SYMLINKS) >> - @set ${SYMLINKS}; \ >> + @echo SYMFOO >> + set ${SYMLINKS}; \ >=20 > This too. snicker. Yeah, sorry. I thought I'd gotten rid of those after I = figured out what to do :). >> diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk >> index cd11e3a..ea50d33 100644 >> --- a/sys/conf/kmod.mk >> +++ b/sys/conf/kmod.mk >> @@ -68,6 +68,10 @@ KMODLOAD?=3D /sbin/kldload >> KMODUNLOAD?=3D /sbin/kldunload >> OBJCOPY?=3D objcopy >>=20 >> +.if defined(META_CATEGORY) >> +META_LOG_SYMBOLS=3D -P ${META_CATEGORY}:dev >=20 > There seem to be more spellings of META_LOG_SYMBOLS than necessicary > (_META_INFO). I'm not sure what you mean? Thank you very much for the feedback! (Replying to just the list for now; if you would rather I reply to you = as well in the future, please let me know.) Sean.