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.