Commit graph

33 commits

Author SHA1 Message Date
Warner Losh d0b2dbfa0e Remove $FreeBSD$: one-line sh pattern
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
2023-08-16 11:55:03 -06:00
Kristof Provost e4c36b7aa9 libnv: bump library version
Now that we version symbols we should bump the library major version.
While here use version FBSD_1.7 to match the current HEAD FreeBSD
namespace and remove extraneous 'All rights reserved' and incorrect
copyright statement.

Reviewed by:	kevans
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D35875
2022-07-22 00:23:08 +02:00
Reid Linnemann 000321bab7 namespace nv names, version libnv and libnvpair library symbols
libnv and libnvpair have aliased symbols, and as a result a single process which
dlopens a shared object that is dynamically linked to libnv and another to
libnvpair will wind up with a single set of resolved symbols for those in
conflict. A source file also cannot include both libnv and libnvpair headers
because of aliased identifiers. To resolve the situation, libnv types and
functions are namespaced via nv_namespace.h, and libnv symbols are
versioned. The msgio functions are not namespaced or exported as they are not
part of the external API.

Reviewed by:	kevans
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D35261
2022-07-21 18:35:23 +02:00
Kristof Provost 8403170b3d libpfct: Fix PIC flag
Use ${PICFLAG} rather than hard-adding -fPIC, which removes the
requirement for libnv to be built PIC.

MFC after:      4 weeks
Sponsored by:   Rubicon Communications, LLC ("Netgate")
2021-04-17 22:10:13 +02:00
Kristof Provost 15ca662208 libnv: Use PICFLAG rather than -fPIC
Suggested by:	andrew
MFC after:	4 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-04-10 15:43:28 +02:00
Kristof Provost 0dd13c7743 libnv: Build PIC
Build libnv as position independent code so we can use it from shared
libraries.

MFC after:	4 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D29561
2021-04-10 11:16:01 +02:00
Matt Macy 4928d02766 Fix libnv build post rename
Submitted by:	Neel Chauhan
Differential Revision:	https://reviews.freebsd.org/D25481
2020-06-27 02:17:04 +00:00
Emmanuel Vadot a7b5a3d486 pkgbase: Put a lot of binaries and lib in FreeBSD-runtime
All of them are needed to be able to boot to single user and be able
to repair a existing FreeBSD installation so put them directly into
FreeBSD-runtime.

Reviewed by:    bapt, gjb
Differential Revision:  https://reviews.freebsd.org/D21503
2019-09-05 14:13:08 +00:00
Kyle Evans 50a2c22918 libnv: Remove -I${SRCTOP}/sys
This should have been done as part of r336019 -- including ${SRCTOP}/sys is
not a good business model for something that's build in legacy/bootstrap
stages.

Beyond that, libnv seems to build quite alright as legacy, part of
buildworld, and standalone without. Axe it.

Reported by:	truckman (head building stable/11)
Tested by:	Shawn Webb (HardenedBSD)
MFC after:	3 days
2018-08-09 20:29:44 +00:00
Alex Richardson 63889bbde0 No longer install sys/nv.h and sys/cnv.h in lib/libnv/Makefile
Use tools/build/Makefile to install the headers into ${WORLDTMP}/legacy
instead. Compared to r336026 this has the minor advantage that it avoids
unncessary header installation when building the non-bootstrap libnv.

Reviewed By:	bdrewery, kevans
Approved By:	brooks (mentor)
Differential Revision: https://reviews.freebsd.org/D16187
2018-07-16 10:57:26 +00:00
Kyle Evans 3cafc9a654 config(8): Fix broken ABI
r336019 introduced ${SRCTOP}/sys to the include paths in order to pull in a
new sys/{c,}nv.h. This is wrong, because the build tree's ABI isn't
guaranteed to match what's running on the host system.

Fix instead by removing -I${SRCTOP}/sys and installing the libnv headers
with `make -C lib/libnv includes`... this may or may not get re-worked in
the future so that a userland lib isn't installing includes from sys/.

Reported by:	bdrewery
2018-07-06 11:23:14 +00:00
Enji Cooper d511b20a69 Add HAS_TESTS to all Makefiles that are currently using the
`SUBDIR.${MK_TESTS}+= tests` idiom.

This is a follow up to r321912.
2017-08-02 08:50:42 +00:00
Enji Cooper 4b330699f8 Convert traditional ${MK_TESTS} conditional idiom for including test
directories to SUBDIR.${MK_TESTS} idiom

This is being done to pave the way for future work (and homogenity) in
^/projects/make-check-sandbox .

No functional change intended.

MFC after:	1 weeks
2017-08-02 08:35:51 +00:00
Enji Cooper a9468a4e63 Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
This implifies pathing in make/displayed output

MFC after:    3 weeks
Sponsored by: Dell EMC Isilon
2017-01-20 04:40:55 +00:00
Mariusz Zaborski 5ef231f6f7 Add cnv API.
cnv API is a set of functions for managing name/value pairs by cookie.
The cookie can be obtained by nvlist_next(), nvlist_get_parent() or
nvlist_get_pararr() function. This patch also includes unit tests.

Submitted by:	Adam Starak <starak.adam@gmail.com>
2016-08-27 13:37:30 +00:00
Glen Barber 52259a98ad MFH
Sponsored by:	The FreeBSD Foundation
2016-03-02 16:14:46 +00:00
Bryan Drewery d48a2d2303 Remove WARNS inherited fine by ../Makefile.inc.
Sponsored by:	EMC / Isilon Storage Division
2016-02-26 22:14:23 +00:00
Glen Barber a70cba9582 First pass through library packaging.
Sponsored by:	The FreeBSD Foundation
2016-02-04 21:16:35 +00:00
Mariusz Zaborski 54f98da930 Move the nvlist source and private includes from sys/kern to seperate
directory sys/contrib/libnv.

The goal of this operation is to NOT install header files which shouldn't
be used outside the nvlist library.

Approved by:	pjd (mentor)
2015-07-04 16:33:37 +00:00
Mariusz Zaborski 58c86148dd Move nvlist documentation to the FreeBSD Kernel Developer's sections.
Approved by:	pjd (mentor)
2015-07-04 10:27:30 +00:00
Mariusz Zaborski c36e54bb32 Let the nv.h and dnv.h includes be only in sys directory.
Change consumers to include those files from sys.
Add duplicated files to ObsoleteFiles.

Approved by:	pjd (mentor)
2015-07-02 21:58:10 +00:00
Baptiste Daroussin 18b2ee82db Revert r284417 it is not necessary anymore 2015-06-15 19:28:07 +00:00
Baptiste Daroussin 4232f82668 Enforce overwritting SHLIBDIR
Since METAMODE has been added, sys.mk loads bsd.mkopt.mk which ends load loading
bsd.own.mk which then defines SHLIBDIR before all the Makefile.inc everywhere.

This makes /lib being populated again.

Reported by:	many
2015-06-15 15:34:20 +00:00
Mariusz Zaborski 24f93ee714 Add nvlist_flags() function, which returns nvlist's public flags.
Approved by:	pjd (mentor)
2015-05-01 17:50:24 +00:00
Mariusz Zaborski 041392bc29 Sort MLINKS alphabetically.
Approved by:	pjd (mentor)
2015-05-01 16:41:46 +00:00
Mariusz Zaborski 0bb5e6ef80 Remove the nvlist_.*[fv] functions.
Those functions are problematic, because there is no way to report
memory allocation problems without complicating the API, so we can
either abort or potentially return invalid results. None of which is
acceptable.

In most cases the caller knows the size of the name, so he can allocate
buffer on the stack and use snprintf(3) to prepare the name.

After some discussion the conclusion is to removed those functions,
which also simplifies the API.

Discussed with: pjd, rstone
Approved by:	pjd (mentor)
2015-04-29 22:57:04 +00:00
Ryan Stone 4d6a976e37 Move libnv into the kernel and hook it into the kernel build
Differential Revision:		https://reviews.freebsd.org/D1883
Reviewed by:			jfv
MFC after:			1 month
Sponsored by:			Sandvine Inc.
2015-03-01 00:34:27 +00:00
Ryan Stone a87e516267 Add function to force an nvlist into the error state
Add an nvlist_set_error() function that can be used to force an
nvlist into the error state.  This is useful both for writing
tests and for writing APIs that use nvlists internally.

Differential Revision:		https://reviews.freebsd.org/D1878
Reviewed by:			pjd, jfv
MFC After:			1 month
Sponsored by:			Sandvine Inc.
2015-03-01 00:22:23 +00:00
Pawel Jakub Dawidek b4b884751b Add missing nvlist_get_parent(3) link.
Submitted by:	Mariusz Zaborski <oshogbo@FreeBSD.org>
2015-01-30 12:57:35 +00:00
John-Mark Gurney 55edfde154 fix typo, properly install a link to nv for nvlist_freev... 2014-10-27 23:03:17 +00:00
Enji Cooper 1f771f4603 Include src.opts.mk after SHLIBDIR has been defined so libnv is installed to
/lib , not /usr/lib

MFC after: 3 days
Approved by: rpaulo (mentor)
Submitted by: antoine
Pointyhat to: me
Phabric: D739
2014-09-07 22:56:57 +00:00
Enji Cooper b236bcf168 Integrate lib/libnv into the build/kyua
Rename all of the TAP test applications from <test> to <test>_test
to match the convention described in the TestSuite wiki page

Phabric: D538
Approved by: jmmv (mentor)
Sponsored by: EMC / Isilon Storage Division
2014-08-05 18:41:27 +00:00
Pawel Jakub Dawidek 36da5199bb Bring in libnv library for managing name/value pairs. The following types
are currently supported:

- NV_TYPE_NULL - only name, no data;
- NV_TYPE_BOOL - boolean (true or false);
- NV_TYPE_NUMBER - 64bit unsigned integer;
- NV_TYPE_STRING - C string;
- NV_TYPE_NVLIST - nested nvlist;
- NV_TYPE_DESCRIPTOR - file descriptor;
- NV_TYPE_BINARY - binary data.

For detailed documentation and examples see nv(3) manual page.

Sponsored by:	The FreeBSD Foundation
2013-11-12 19:39:14 +00:00