Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Jul 2014 11:41:13 -0500
From:      Brooks Davis <brooks@freebsd.org>
To:        Sean Fagan <sef@ixsystems.com>
Cc:        hackers@freebsd.org
Subject:   Re: Expanding on NO_ROOT:  Categorizing installed files
Message-ID:  <20140710164113.GA17057@lor.one-eyed-alien.net>
In-Reply-To: <D7C345D3-6027-45BC-AACB-8DEA03D5924F@ixsystems.com>
References:  <048B595B-6B91-40B6-84A4-E23948423354@ixsystems.com> <20140710153530.GA16174@lor.one-eyed-alien.net> <D7C345D3-6027-45BC-AACB-8DEA03D5924F@ixsystems.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--Q68bSM7Ycu6FN28Q
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Jul 10, 2014 at 09:26:19AM -0700, Sean Fagan wrote:
> On Jul 10, 2014, at 8:35 AM, Brooks Davis <brooks@freebsd.org> wrote:
>=20
> > I very much like the functionalty and think it's a good idea.
>=20
> It was mostly Xin and Jordan's idea :).  ("Wouldn't it be nice if we could
> use that somehow?  Sean, go do that.")
>=20
> >  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.
>=20
> 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 w=
asn'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.)
>=20
> I had initially called it "package", btw, and that shows up in some place=
s still.
> "category" seemed like a better name.

I'd prefer we just expand the use of tags.  Thus far a seperator isn't
defined, but : seems as good as any.  It would be worth checking if
NetBSD (where -T came from) uses anything.

> >> 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?
>=20
> I initially only used NO_ROOT.  However, then when I started making packa=
ges
> 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 pyt=
hon 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.  O=
r many other
> things.
>=20
> So I opted for the most flexible variant, which was to keep NO_ROOT behav=
ing as it did,
> and add another case that used most of the work from NO_ROOT.
>=20
> Does that make sense?

Yes.  I'm reluctant to add yet another option to the toplevel make as
that's one more thing to test or break.

Ideally we'd add support for filtering on catagory/tag to libarchive and
do all that stuff there.

Purly FYI, my eventual plan is to generate a METALOG as part of
buildworld/buildkernel so the install* targets just run tar and
dramatically limit root privilage use.

> >> 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 ne=
ed
> > for .EXPORTVAR.
>=20
> I will try that later; thanks.
>=20
> >> 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.
>=20
> 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.)

I think I wasn't clear here.  Given that META_CATEGORY=3Dbase should be in
the environment already, I don't see why you need to define it in some
of the library make files.  Thinking about it more, I find my self
wondering if it's a workaround for the failure to use Makefile.inc.

> >> 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.
>=20
> Odd choice how?

While section 9 manpages document the kernel, I don't see them as part of
it.

> >> 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).
>=20
> I'm not sure what you mean?

You use a variety of variables used to hold "" or "-P
${META_CATEGORY}..." in different Makefiles.  It seems like they should
be the same where possible.

-- Brooks

--Q68bSM7Ycu6FN28Q
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iKUEARECAGYFAlO+wihfFIAAAAAALgAoaXNzdWVyLWZwckBub3RhdGlvbnMub3Bl
bnBncC5maWZ0aGhvcnNlbWFuLm5ldDY1NUQ1MTlDMjZBNzgyRTcyNTI5OUJGMDVE
OEU4QkU5RjIzODFBRDQACgkQXY6L6fI4GtQ2AwCgzFHYZtvUytwWVisW6C/RYXjs
IcAAmI+pzo+vuX8NP/mVbDTGWcD+6Y8=
=m4yS
-----END PGP SIGNATURE-----

--Q68bSM7Ycu6FN28Q--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140710164113.GA17057>