Home | History | Annotate | Download | only in config
History log of /src/usr.bin/config/mkioconf.c
RevisionDateAuthorComments
 1.36  05-Apr-2024  riastradh config(1): Make sort order deterministic.

Ensure we break ties in every case. This way, even though we use the
unstable qsort(3) library routine, the output is reproducible, no
matter what algorithm is behind qsort(3).

It would be nice if we could just use a stable sort function here,
but mergesort(3) is nonstandard, so we'd have to add it to
tools/compat, which is a big pain.

Instead, put a tie-breaking rule in every comparison function we use
with qsort, and abort() in the event of ties -- that way, we noisily
refuse to rely on unstable sort order.

While here, dispense with any question of integer overflow, and
sprinkle comments.

PR bin/58115
 1.35  19-Nov-2017  christos branches: 1.35.6; 1.35.14;
Don't print instances we've already printed.
 1.34  18-Nov-2017  christos Allow multiple attachments methods to the same child+parent combination:

foo* at bar? with baz
foo* at bar? with barf

Do this by scanning the list of iba's and allocating a new cfparent for
each. Keep track of the shared parent+child combinations by using the
same id for them.
 1.33  12-Nov-2015  pooka In ioconfname mode, #define IOCONF as the ioconf token.

Avoids having to retype the name to call config_init/fini_component().
 1.32  03-Sep-2015  uebayasi After thought, revert "Generate *.c files under conf/". Generate *.c files
under top build directory. *.c files are never placed just under $S/. Keep
this exclusiveness.
 1.31  02-Sep-2015  uebayasi In `-S' mode, generate *.c files under conf/ subdirectory. Register generated
.c files to the `files' list internally.
 1.30  28-Aug-2015  uebayasi Global paths looked up at output stage (mk*()) are relative to `srcdir'.
Ignore "prefix" by not calling sourcepath().
 1.29  20-Aug-2015  christos move driver attach declarations to ioconf.h
 1.28  01-Nov-2014  uebayasi config(1): Don't emit unused empty loc[]
 1.27  01-Nov-2014  uebayasi config(1): Emit pdevinit[] into .rodata
 1.26  01-Nov-2014  uebayasi config(1): Set NULL to unused cfdata::cf_loc
 1.25  31-Oct-2014  uebayasi config(1): Better indent of cfdata in ioconf.c
 1.24  31-Oct-2014  uebayasi config(1): KNF generated ioconf.c
 1.23  31-Oct-2014  uebayasi config(1): Emit only referenced interface attributes in ioconf.c
 1.22  29-Oct-2014  christos - add RCSID's
- fix -Wconversion (except scanner)
 1.21  11-Mar-2012  dholland branches: 1.21.10;
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.
 1.20  11-Mar-2012  dholland 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.)
 1.19  03-Mar-2011  nakayama branches: 1.19.4;
Fix build on Solaris 10.
 1.18  26-Mar-2010  pooka branches: 1.18.2;
Put cfdata* in a similar namespace with cfdriver** cfattachinit*.
This was nagging me already yesterday, but I decided to leave it
alone for better compat with old ioconf.c builds. But as it turns
out, new code depends on newly built ioconf.c with a new config(1)
anyway, so renaming is not an issue (at least not at this stage).

While renaming, namespace cfdriver and cfattach in "ioconf" rather
than "comp", since the former reflects the config(5) keyword.
 1.17  25-Mar-2010  pooka Generate cfdriver and cfattach lists for ioconf configs.
 1.16  03-Feb-2010  pooka ... aaand make the emit-order slightly more sensible for ioconf.c to
actually work again.
 1.15  03-Feb-2010  pooka Introduce experimental support for ioconf-only configuration files.
This is done by giving the "ioconf" keyword in the config file.
As a result, config produces only ioconf.c and locators.h. Currently,
only "monolithic" configurations with the device path starting from
root are supported. Eventually, the goal is to support a local
root in the input file from any point along the device tree using
files.* in our kernel tree. This will make autogenerating the
config glue for device modules possible instead of having to write
it by hand like is currently required (yes, it sounds simple to
implement, but ...).

reviewed by cube.
(the next part will demand major discussions with you, so prepare ;)
 1.14  11-Apr-2009  lukem Fix WARNS=4 issues (-Wcast-qual -Wsign-compare -Wshadow)
 1.13  20-Jan-2009  drochner branches: 1.13.2;
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.
 1.12  16-Jan-2009  uebayasi Better whitespace in ioconf.c output.
 1.11  28-Dec-2008  christos rename nv_int -> nv_num and make it long long, so that dev_t will fit when
we change it.
 1.10  12-Dec-2007  lukem Use a common function to generate the "MACHINE GENERATED" comment,
and ensure mkswap.c adds it too.
 1.9  13-Jan-2007  christos branches: 1.9.4;
- rename {x,}error -> cfg{x,}error and {x,}warn -> cfg{x,}warn so that we
can use err(3) and warn(3) to display errors instead of using inconsistent
fprintf's.
- remove emalloc/estrdup etc. We have them in libutil.
 1.8  04-Oct-2006  dsl Instead of trying to check the return value of every fprintf() and fputs()
call - which makes the code completely impossibly to follow, call fflush()
and ferror() just prior to calling fclose().
This has the advantage of actually detecting the any write errors, since
the output is block bufferred and will typically not happen during fprintf()
but only during the fclose() - where it is difficult to report.
I also singlilarly refuse to add (void) casts to every printf call in the
system - since it almost never makes any sense to look at the return value
(unless you want to know how many bytes were actually writtem).
 1.7  28-Aug-2006  christos build complete initializations.
 1.6  09-Aug-2006  drochner Make sure that only specisications for _interface_ attributes are
emitted, the rest is useless at runtime.
saves some bloat in ioconf.c
 1.5  01-Oct-2005  cube 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 :)
 1.4  30-Sep-2005  cube 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'.
 1.3  25-Aug-2005  drochner Replace the "locnames", attached to cfdata, which was solely good for
userconf, by more complete information (including default values) about
interface attributes, attached to the drivers which provide them.
 1.2  28-Jun-2005  drochner don't put the xxxcf_locnames[] into the global namespace
 1.1  05-Jun-2005  thorpej 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.
 1.9.4.1  09-Jan-2008  matt sync with HEAD
 1.13.2.1  13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.18.2.1  05-Mar-2011  bouyer Sync with HEAD
 1.19.4.1  17-Apr-2012  yamt sync with head
 1.21.10.1  06-Mar-2015  snj Pull up following revision(s) (requested by mrg in ticket #572):
usr.bin/config/Makefile: up to 1.10
usr.bin/config/TODO: up to 1.14
usr.bin/config/config.1: up to 1.17
usr.bin/config/config.5: up to 1.25
usr.bin/config/defs.h: up to 1.64
usr.bin/config/files.c: up to 1.18
usr.bin/config/gram.y: up to 1.46
usr.bin/config/hash.c: up to 1.11
usr.bin/config/lint.c: up to 1.15
usr.bin/config/main.c: up to 1.74
usr.bin/config/mkdevsw.c: up to 1.12
usr.bin/config/mkheaders.c: up to 1.26
usr.bin/config/mkioconf.c: up to 1.28
usr.bin/config/mkmakefile.c: up to 1.37
usr.bin/config/mkswap.c: up to 1.8
usr.bin/config/pack.c: up to 1.9
usr.bin/config/scan.l: up to 1.22
usr.bin/config/sem.c: up to 1.71
usr.bin/config/sem.h: up to 1.19
usr.bin/config/util.c: up to 1.19
sync config(1) with HEAD.
 1.35.14.1  23-Aug-2024  martin Pull up following revision(s) (requested by riastradh in ticket #798):

usr.bin/config/defs.h: revision 1.109
usr.bin/config/files.c: revision 1.38
usr.bin/config/mkmakefile.c: revision 1.73
usr.bin/config/pack.c: revision 1.11
usr.bin/config/mkioconf.c: revision 1.36

config(1): Make sort order deterministic.

Ensure we break ties in every case. This way, even though we use the
unstable qsort(3) library routine, the output is reproducible, no
matter what algorithm is behind qsort(3).

It would be nice if we could just use a stable sort function here,
but mergesort(3) is nonstandard, so we'd have to add it to
tools/compat, which is a big pain.

Instead, put a tie-breaking rule in every comparison function we use
with qsort, and abort() in the event of ties -- that way, we noisily
refuse to rely on unstable sort order.

While here, dispense with any question of integer overflow, and
sprinkle comments.

PR bin/58115
 1.35.6.1  23-Aug-2024  martin Pull up following revision(s) (requested by riastradh in ticket #1875):

usr.bin/config/defs.h: revision 1.109
usr.bin/config/files.c: revision 1.38
usr.bin/config/mkmakefile.c: revision 1.73
usr.bin/config/pack.c: revision 1.11
usr.bin/config/mkioconf.c: revision 1.36

config(1): Make sort order deterministic.

Ensure we break ties in every case. This way, even though we use the
unstable qsort(3) library routine, the output is reproducible, no
matter what algorithm is behind qsort(3).

It would be nice if we could just use a stable sort function here,
but mergesort(3) is nonstandard, so we'd have to add it to
tools/compat, which is a big pain.

Instead, put a tie-breaking rule in every comparison function we use
with qsort, and abort() in the event of ties -- that way, we noisily
refuse to rely on unstable sort order.

While here, dispense with any question of integer overflow, and
sprinkle comments.

PR bin/58115

RSS XML Feed