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.
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.
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.
configuration file (although it is meant to be used mostly with
std.${ARCH}), and prints out a configuration file that includes it and
select every single option and parameter, and define an instance for every
single possible attachment. IOW, selects everything, into a would-be
"LINT" config.
The resulting config really isn't meant to be runnable, but should be
somewhat buildable on most archs. It still needs adjustments because some
options are peculiar (e.g., ACPI_DSDT_FILE wants an existing file as its
value), so it's not yet possible to do "config -L; config; build" in an
automated way.
children for a pseudo-device. Depending on an interface attribute is,
though.
Instead of looking at locators, walk the 'attrs' list and look for an
interface attribute (which might have been added just a few lines before
in case there was explicit locators defined).
Fixes PR#32329 by Valeriy E. Ushakov. Regression test is PSEUDO_PARENT.
Instead, just add it to the list of files.
Make "prefix foo" lines actually work right when foo is an absolute path,
and make sure the length calculations correspond to the output.
Provide a way to specify a file that will always be included, and a way
to omit the prologue ("$S/") on that file.
error out in a bit more friendly way when the user is trying to use
config(1) on a too old or too recent source tree.
To achieve that, introduce the "version NUMBER" statement which can be use
about anywhere in the config files. Also, use two defines, CONFIG_VERSION
(which is the actual version of binary), and CONFIG_MINVERSION, which is
the minimum version the binary supports.
Allowing a range of versions serves several purposes: first it allows me
to introduce the versioning without requiring it to be used right away in
the kernel tree, which means it will be possible to introduce new features
of config(1) rather progressively in the future. E.g., using 'no pci' in
a config file could only require the new version in that config file, so
that the rest remains compatible.
In the end, an actual bump of the main config system (i.e., in conf/files)
will only be required when e.g., ioconf.c semantics change.
(Mostly-)silently accepted on tech-kern. Error messages turned into
correct and meaningful English thanks to Tracy and Perry.
deaddevitab.
- Record the position in the config file of device instances so it is
possible to tell if a device instance was declared before or after its
parent's removal.
E.g.:
child* at parent?
no parent
will have the child instance ignored as an explicit orphan, while
no parent
child* at parent?
will error out because now the child instance is a real orphan.
That let the POSTPONED_ORPHAN regression test pass.
syntax error in the file, yet we want to somehow gracefully go on in order
to print out all the errors in the file, which means we have to take
special care with those structures.
Reported by Simon Burge in private mail.
- Introduce xwarn() for delayed warnings
- Use xerror() and xwarn() in fixdevis() to notify about orphans
That way the correct file is printed when listing orphaned devices.
Reported by Juergen Hannken-Illjes in private mail.
o Rework do_kill_orphans() to use that information and mark explicitely
orphaned devices (i.e., the ones whose missing ancestor has been
negated)
o Make a distinction between erroneous orphans and explicit orphans.
Error out on the former, ignore the later (but print a warning when -v
is used)
Yes, now config(1) will actually stop if you comment out a parent. That
should help people still hoping adjustkernel is relevant these days :)
no device at <attachment>
<attachment> can take two forms: either numbered/wildcarded, in which
case only exactly matching instances will be removed, or plain (with
no number or wildcard), in which case all matching instances will be
removed.
When <attachment> is a plain interface attribute, all instances using
that attribute (either directly or through an explicit device) will be
removed.
E.g.:
auich* at pci? dev ? function ?
audio0 at audiobus?
audio1 at auich?
audio* at auich0
no device at auich0 -> removes audio*
no device at auich? -> removes audio1
no device at auich -> removes audio1 _and_ audio*
no device at audiobus? -> removes audio0
no device at audiobus -> removes audio0, audio1 and audio*
no <device>
As in the previous case, <device> can either be numbered/starred, in
which case all exactly matching instances are removed, or plain, in
which case all instances of the device are removed.
E.g.: (continuing previous example)
no audio* -> removes 'audio* at auich0'
no audio -> removes all audio instances
track of instances attaching at root, and walk down the tree of active
device instances. Then, all instances that are not marked active are
found as orphans.
Doing it that way allows us to simply ignore orphan devices, instead of
warning about them and still keep them in the configuration. Now, orphaned
instances are considered as never having existed.
In the end, this allows 'no <device> at <attachment>' to be much more
efficient, as the user doesn't have to negate all descendents of the
instance s/he actually wants to negate. Warnings are still emitted,
though.
While there, make official a side-effect of the previous lack of action
against orphaned instances: config(1) used to warn about instances that
attach at a numbered device when no instance of that device with that
number existed, even though there was a starred instance of the device.
E.g. (provided by Alan Barrett):
pciide* at pci? dev ? function ? flags 0x0000
wdc0 at isa? port 0x1f0 irq 14 flags 0x00
wdc1 at isa? port 0x170 irq 15 flags 0x00
atabus* at ata?
wd0 at atabus0 drive 0
With this commit, config(1) will no longer warn about 'wd0 at atabus0'.
TAILQ set of macros from queue.h... It's way too easy to make mistakes...
config(1) was segfaulting in deldev() in some situations... Reported by
Brend Ernesti.
pretend anymore we don't have it.
This is the result of 7 hours of work on the train journey forth and
back to the family reunion for the birthday of my cousin Mickael, whom
I thank for living just far away enough.