Commit Graph

18 Commits

Author SHA1 Message Date
cube 42b52b8a61 Add 'no config <name>'. 2006-02-11 20:15:53 +00:00
cube c454f920b9 Having explicit locators is not a sufficient condition to be able to have
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.
2005-12-18 23:43:15 +00:00
erh 570d41f826 The swap*.o files actually do need to be specified on the individual kernel
build lines instead of in ${OBJS}.  Partially revert previous change.
2005-11-07 18:45:34 +00:00
erh cd42936263 Remove special hack for swapnetbsd.c when generating the makefile.
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.
2005-11-07 03:26:20 +00:00
cube 437f8925a6 Introduce versioning to config(1). This will allow us to provide a way to
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.
2005-10-12 01:17:43 +00:00
cube a31ff6b408 - Make sure to try aliases of removed device instances when walking
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.
2005-10-04 20:13:39 +00:00
cube 9ea755eb2f Remove extra new line. 2005-10-04 13:33:20 +00:00
cube 5ec393e9ef Add a flag to mark broken instances. That might happen when there is a
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.
2005-10-04 13:06:45 +00:00
cube 0dbd1c0e04 - Keep track of the file in which we find the device instance
- 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.
2005-10-04 12:35:00 +00:00
cube 895e5687a9 Allow 'maxusers' redefinition. 'maxusers 0' will cancel the existing
value and make config(1) use the machine-dependent default.
2005-10-02 00:18:09 +00:00
cube 7aa6070d4e o Keep track of negated devices in deaddevitab
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 :)
2005-10-01 23:30:37 +00:00
cube 7b7c582a4f Introduce two new statements:
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
2005-09-30 22:51:46 +00:00
cube c130d400ba Rework the way orphan device instances are handled. To achieve that, keep
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'.
2005-09-30 22:36:20 +00:00
cube 3b40577510 - Make sure devitab is correctly handled, in case we're removing the entry
it contains,
- Properly update the d_ihead list:  if we have remaining aliases, use them
  to fill in the gap

Thanks to Bernd Ernesti for the test cases.
2005-08-07 15:11:12 +00:00
cube c3414672de The devi lists in struct devbase and struct deva really should use the
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.
2005-07-25 22:31:07 +00:00
cube 878c29f51a Correct an if test. 2005-07-25 06:22:09 +00:00
cube e499d8b53e Implement the long overdue syntax "no <dev> at <attachment>". We can't
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.
2005-07-24 21:31:02 +00:00
thorpej 5ecc953bdb config and genassym are not sysadmin tools, they are development tools.
As such, they don't belong in /usr/sbin, but rather /usr/bin.  Move them
there.
2005-06-05 18:19:52 +00:00