have a way to embed the revision number into the kernel's "uname -v"
output. The patch below does this, by generating a new keyword "ident"
that can be followed by any string, e.g.
ident "NOON-$Revision$"
will lead to
vvvvvvvvvvvvvvvvvvvvvv
char version[] = "NetBSD 1.4P (NOON-$Revision: 1.21 $) #37: Thu Jan
20 02:01:23 MET 2000\n feyrer@noon:/usr/cvs.local/src-current/sys/arch/i386/c
ompile/NOON\n";
This will lead to a version of "MYMACHINE-$Revision$" instead of the
kernel config file name. If "ident" is not present, the current behaviour
of using the kernel config file's name as identifier is used.
Implement by writing the ident to a file ("ident") in the compile dir,
which newvers.sh will pick up for generating the ident.
to file specifications. The prefixes are arranged in a stack, and
nest, so that file, object, and include specifications are normalized,
and all end up relative to the kernel compile directory.
For example, in the kernel config file:
# Pull in config fragments for kernel crypto
prefix ../crypto-us/sys # push it
cinclude "conf/files.crypto-us" # include it if it's there
prefix # pop it
and in files.crypto-us:
file netinet6/esp_core.c ipsec & ipsec_esp
file netinet6/esp_output.c ipsec & ipsec_esp
file netinet6/esp_input.c ipsec & ipsec_esp
...generates the following in the kernel Makefile:
$S/../crypto-us/sys/netinet6/esp_core.c \
$S/../crypto-us/sys/netinet6/esp_output.c \
$S/../crypto-us/sys/netinet6/esp_input.c \
By placing this all in the kernel config file, all the magic involved in
reaching into non-standard kernel source directories is placed into a file
that the user is expected to edit anyway, and reasonable examples (and
sane defaults, for typical source checkouts) can be provided.
is declared at most once.
* Do option dependency across all def{opt,param, flag}.
* Make the default value of otherwise-unspecified defopt's be 1,
for consistency with non-defopt'ed options.
* Wrap an abstraction layer (macros) around tests for defopt, filesystem,
defparam, etc. to catch outdated defopt-vs-filesystem tests.
* machinery for nonfatal warnings.
* new backend config-file keywords:
defparam -- like defopt, but each defparam option is required
to have a value when configured via "options".
defflag -- like defopt, but defflag options may not have a value.
Also, on "option FOO", a needs-count style flag
(NFOO, either 0 or 1) is emitted to the .h file.
* Warn about old-style options that aren't defined via def{opt,param,flag}
and which are added to IDENT. (These behave subtly differently
to defopt options when no explicit value is given.)
Only things defined with this keyword will be allowed on "file-system"
lines in the kernel config files.
By default, -D... directives for file systems are not generated, since
they are not needed for most file systems now that vfs_conf.c is gone.
However, some file systems must have dependencies generated on them
(e.g. NFS, UNION). So, provide a way to specify an option file for
these file systems.
a change to the config grammar, to specify a device's class (i.e. DV_xxx)
like:
device sd class disk: ...
Also emit an ioconf.h, which contains extern declarations of the
cfdriver structures.
While I'm here, add support for specifying multiple options per defopt
line, as well as specifying the file name in which the options will
appear.
defopt foo bar baz
generates "opt_foo.h", "opt_bar.h", and "opt_baz.h"
defopt opt_mumble.h foo bar baz
generates "opt_mumble.h" which contains all three options.
Also, clean up and fix some bugs in the code that generates header files.
Syntax is like the `file' keyword; e.g.:
object arch/i386/i386/mumble.o [mumble] [needs-flag]
Largely from Michael Richardson in PR 3833, with some changes by me.
reported in PR #3668 from maximum entropy <entropy@tanstaafl.bernstein.com>.
The problem: The unit number is not being conveyed to the configuration
crosscheck with root is a network interface; the device number is set
to NODEV, which sets up the (correct) defaults for swap/dump devices.
We can't change NODEV to a unit number, as the PR's patch suggests, as
this breaks the swap/dump defaults. Rewriting that code is not really
justified, since it's soon to be obsoleted.
The kludge: add an "nv_ifunit" member to struct nvlist, which convey's
a network interface's unit number to the crosscheck routine. It's not
pretty, but it's not terribly invasive, and can be garbage-collected
easily when the swap/dump goo is obsoleted.
be included in object dependencies. config(8) is told to generate
a header for a particular option with the new "defopt" keyword, used
in the files.* system description files. Options that are placed in
header files are not given -D... cpp flags.
This approach allows options to be turned into headers incrementally,
rather than all at once, and allows for non-header options, as well.
and the root device:
- New "file-system" keyword is used to configure file systems into
the kernel.
- New way of specifying root device, which allows root file system
type to always be specified. Examples:
config gennetbsd swap generic
config sdnetbsd root on sd0a swap on sd0b
config nfsnetbsd root on nfs
are replaced by:
config gennetbsd root on ? type ?
config sdnetbsd root on sd0a type ffs swap on sd0b
config nfsnetbsd root on ? type nfs
config lenetbsd root on le0 type nfs
Note that specific network interfaces may now be specified as
the root device.
- swapgeneric.c is no longer used; generate a swap*.c file for each
"config" line in the kernel configuration file.
on tech-kern. (See man page.) Implementation by Greg Hudson.
Also, remove special case for i386 in vector handling, although this code isn't
actually used any more.
in XXX-marked comments in the recent attachment changes), this was a
long-standing bug in config.
The problem: If a device is attached to a device via an attribute exported
by that device (i.e. foo* at bar0, where 'bar' exports an attribute that
'foo' attaches to), but the device attached to is not present in the
kernel configuration file, AND another device which exports an attribute
that 'foo' attaches to _is_ present (e.g. a device baz0, if one could
specify 'foo0 at baz0'), then: the configuration file will (incorrectly)
be accepted by config, and the resulting ioconf.c will include a bogus
cfdata entry for the device (in the example, 'foo*'). This typically
causes the resulting kernel to crash during autoconfiguration.
The solution: Be much more careful about keeping track of where a device
was attached, and, in particular, if a device was attached to another device,
_always_ keep track of what device it was attached to. Then, when
cross-checking, if the attached-to device isn't present, give up and do not
check attributes. Also, document the process much more thoroughly.
- split softc size and match/attach out from cfdriver into
a new struct cfattach.
- new "attach" directive for files.*. May specify the name of
the cfattach structure, so that devices may be easily attached
to parents with different autoconfiguration semantics.
is different than the "machinename" internal variable, read
machinearch's files.${machinearch} and add it to the list of files
for the machine. Also, regardless of whether or not they're different,
create a ${machinearch} sylink (or directory) pointing to the machinearch
include files (or containing them).
and files.kernel has now been completely replaced.
features supported: not nearly as broken as the stuff before
expression support for dependencies
support for 'requires'
no longer generates lots of stupid unnecessary .h files
broke lots of broken stuff, and forced fixing it.
(docs to arrive later)
added '-k' option for continue even after error
documented '-g'