Commit Graph

77 Commits

Author SHA1 Message Date
christos
ea8949d86b define the attribute first. 2016-09-13 16:06:59 +00:00
christos
3a8503931f Make attribute deselection work:
- when deselecting attributes, remove files that depend on them
- when deselecting attributes, remove devices that depend on them
2016-09-09 21:09:11 +00:00
christos
f138f6c50d Accept "-no" as a "no" that does not cause errors if the object deleted
does not exist.
2016-08-07 10:37:24 +00:00
mlelstv
6fc95ff617 Extend syntax of config phrase, a quoted string instead of a device name
is passed as root specification string. This can be used to specify a
wedge by name.
2016-04-29 18:18:22 +00:00
uebayasi
8b68b0de02 Fix previous. 2015-08-29 07:24:49 +00:00
uebayasi
4401376950 Define MAXUXERS in opt_param.h. Bump config(1) version. 2015-08-29 07:08:38 +00:00
christos
c8da6eb49b Use proper index types, delete casts, use correct sizeof() in allocations. 2014-11-21 20:46:56 +00:00
uebayasi
70dd8e7d2a config(1): Sort objects by weight in modular build
Sort per-module kernel objects (*.ko) by dependency weight.  Important modules
are placed in lower addresses.  The ``machdep'' module will be always placed
in the lowest.

(At this moment, the order is not exact because dependency information is
incomplete in config files (files.*).  Thus ``sysmon_power.ko'' comes lower
than ``machdep.ko'' and/or ``uvm.ko''; but still much better than alphabetical
sort.)
2014-11-15 08:21:38 +00:00
joerg
4e288682c2 nv_num is not a dev_t, so add explicit cast for the sake of
-Wconversion.
2014-11-04 23:02:14 +00:00
joerg
e7051a1953 To make -Wconversion happy, cast return value of tolower/toupper to
char.
2014-11-04 23:00:35 +00:00
uebayasi
e1a6328057 config(1): KNF 2014-11-01 04:34:27 +00:00
uebayasi
c42523f496 config(1), config(5): Introduce "select"
o Introduce a new selection directive "select" to select an attribute (as a
  module) and its dependencies.
o Support "no select" too.
o Stop abusing "options" to select an attribute.
o Bump config(1) version.
2014-10-31 07:38:36 +00:00
christos
d12b0036c5 - add RCSID's
- fix -Wconversion (except scanner)
2014-10-29 17:14:50 +00:00
uebayasi
023c161bb6 Keep track of attribute (module) dependency using hash2. 2014-10-18 06:36:40 +00:00
uebayasi
6e01290960 Don't shadow global 'devname' on macppc. 2014-10-12 15:35:40 +00:00
martin
db3a752aed Remove a set but not used variable 2014-10-11 17:27:42 +00:00
uebayasi
6d52c530bb More debug messages. 2014-10-11 15:47:38 +00:00
uebayasi
77259bf204 On second thought, resolving "device" dependency in enddefs() is correct.
The problem was to select things.  So put back the code to record dependency
as attributes.

While here, sprinkle more debug messages.
2014-10-11 15:20:36 +00:00
uebayasi
d1bb5c1f69 Don't conplain devclass redifition to the same value; it can happen while
resolving dependency.
2014-10-11 09:27:51 +00:00
uebayasi
984251350e Redo "device" dependency. It was completely wrong to select things just
after definitions at enddefs().  Resolve dependency in selectbase().
2014-10-11 09:06:29 +00:00
uebayasi
1140e58262 Pass stricter build. 2014-10-11 06:18:29 +00:00
uebayasi
84fb961fd3 Resolve "device" definition dependency lazily. 2014-10-11 06:07:20 +00:00
uebayasi
d23bf64337 Allow dependency on undefined attributes, so that attribute definitions can
be written out-of-order, like:

	# b is not defined yet
	define	a: b
	file	a.c	a

	# b is defined here
	define	b
	fine	b.c
2014-10-10 11:09:50 +00:00
uebayasi
7a01ec4b08 If an attribute is selected, select its dependencies too. 2014-10-10 10:16:19 +00:00
uebayasi
c24abed7e6 Implicitly define attribute for device. 2014-10-10 08:14:47 +00:00
uebayasi
6903e7639b Implicitly define attribute for options. 2014-10-10 07:48:50 +00:00
uebayasi
d88f6cad14 Implicitly define attribute for filesystem. 2014-10-10 07:08:26 +00:00
uebayasi
82e22e6766 Implicitly define empty "attribute" for "device attachment". Much less
troublesome than "device" and "interface attribute".
2014-10-10 06:59:38 +00:00
uebayasi
bd3d511493 Split plain/interface/devclass attribute initializers. 2014-10-10 06:13:30 +00:00
uebayasi
b4d3dfc64a Refactor attr definition and initialization a little. 2014-10-10 05:27:28 +00:00
uebayasi
3586467df2 Always select the fallback allattr. 2014-10-09 16:08:36 +00:00
uebayasi
adf6a4556b Define an implicit attribute "netbsd" internally to collect files that don't
belong to any specific attribute.

Eventually, all operations doing "foreach (files)" can be rewritten as "foreach
(attributes) foreach (files)".
2014-10-09 15:25:26 +00:00
uebayasi
fa3d850434 If a file is marked by an atom expression, like "file a.c foo", and if the
specified expression is an attribute, mark the file as belonging to the
attribute.

At this moment this information is not used for any purpose, but can be
traced by config -ddd.
2014-10-09 10:29:36 +00:00
uebayasi
2820acceff Debug print where things are selected (by user). 2014-10-09 06:49:53 +00:00
mrg
ebf7669ed7 implement "no ident". 2014-05-29 07:47:45 +00:00
pooka
26b4d3d169 ioconf/pseudo-root have been in here unchanged for 3+ years and their use
has spread from rump kernels into dozens of kernel modules.  Let's pretend
we don't want to see config yell about them being experimental every time.
2013-08-11 10:37:08 +00:00
dholland
f5d4142b2d Move locator lists to their own data structure. This can use more tidying;
it is not clear to me at the moment what the "string" and "num" values
pushed around in locator lists are supposed to actually mean.
2012-03-11 21:16:07 +00:00
dholland
a551c5e8b7 Create a struct condexpr type to hold condition expressions, instead
of abusing struct nvlist to make trees.

(These are the a|b and a&b constructs.)
2012-03-11 08:21:53 +00:00
dholland
bbe96a5ad8 Create a new type struct attrlist to manage lists of attributes,
instead of using struct nvlist.

(struct nvlist holds lists (or trees!) of semi-arbitrary stuff with no
structure and almost no type safety; it should go away.)
2012-03-11 07:32:41 +00:00
pooka
00ed8a38a3 Prefer a real device for pseudoroot and only create a fake device
in the case we are attaching to a pure attribute.  Otherwise we
end up creating a fake device instance every time ...
2010-05-02 15:35:00 +00:00
pooka
145a3f9eec ignore mainbus in previous for now 2010-05-01 23:54:35 +00:00
pooka
194e1c80bc Support interface attributes as pseudoroots. This makes things like
"pseudo-root audiobus*" possible.
2010-05-01 22:17:58 +00:00
pooka
3da3ab250b For the simple cases, augment device-major with information on how
a driver expects /dev/node -> minor mappings to go and include that
information in devsw_conv.
(no, I didn't plow through all the MD majors files)
2010-04-30 20:47:17 +00:00
pooka
90ac64de16 Add a highly experimental pseudo-root feature to be used in conjuction
with the also-experimental ioconf keyword.  pseudo-root allows to
specify a root at any point in the device tree without having
attachments from the actual root.

For example, instead of having a config file like this:
mainbus0 at root
bus_a? at mainbus0
bus_b? at bus_a*
device7 at bus_b?

You can have one like this:
pseudo-root bus_b*
device7 at bus_b?

This will produce the relevant ioconf.c glue for device number 7
only instead of the whole 9 yards from root.  Perhaps needless to
say, this can be used to generate snippets of config glue for
modules and, let's not deny that my main motivation for doing this,
rump components.

This is part 2/3 of my modifications to config (the last part is
autogenerating source file lists and component Makefiles).

No strong objection from cube (after a little pressuring ;), but
like he said, the implementation will most likely need some more
tweaking and may not work correctly under all pseudo-root uses yet.
2010-03-08 10:19:14 +00:00
lukem
5cc303e13d Fix WARNS=4 issues (-Wcast-qual -Wsign-compare -Wshadow) 2009-04-11 12:41:10 +00:00
drochner
d767912be3 Change major()/minor() to return 32-bit types again, called
devmajor_t/devminor_t, as proposed on tech-kern.
This avoids 64-bit arithmetics and 64-bit printf formats in parts
of the kernel where it is not really useful, and helps clarity.
2009-01-20 18:20:47 +00:00
christos
0001b92828 rename nv_int -> nv_num and make it long long, so that dev_t will fit when
we change it.
2008-12-28 01:23:46 +00:00
cube
7490b3179c It actually makes no sense to warn on a behaviour that was allowed in
previous versions, when we know we're working on an old file.  That way,
a -current config(1) works on a 4.0 source tree (or older) without
warning.  Pointed out by Christos Zoulas.

XXX We should set up way to note compatibility code we can get rid of
XXX the day we choose to bump CONFIG_MINVERSION.
2008-07-07 16:10:27 +00:00
drochner
b66156c7c9 Disable use of pseudo-devices defined "defpseudo" with interface
attributes, but provide compatibility for older source trees (according
to the "version" in conf/files and other files.*.
reviewed by cube
2008-06-10 18:11:31 +00:00
cube
bfc250f292 Add some sanity checking in order to avoid some segfaults. There might be
other ways of producing a segfault, but keep in mind those happens when the
negation applies to an erroneous instance.
2007-04-06 19:21:09 +00:00