Commit Graph

287 Commits

Author SHA1 Message Date
itojun e99b62a1d7 realloc pedant 2003-09-19 06:11:35 +00:00
jmmv 94114f39df Use tabs for indentation; pointed out by simonb@. 2003-09-14 12:43:04 +00:00
jmmv fc7230200f Fix crash when using the '-x' flag. 2003-09-14 12:35:46 +00:00
jmmv ce413b6dd1 Fix some warnings. 2003-09-14 12:33:05 +00:00
cl 289a48a2fc free string only after it's no longer used through dirname reference. 2003-09-08 17:50:12 +00:00
thorpej d00feb8a89 Allow file inclusions to be relative to the file currently being
included.  This is done by tracking the current directory for the
file being parsed, and constructing a path relative to that directory
when an include directive's file name begins with "./".
2003-09-03 18:56:37 +00:00
agc 326b2259b7 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22366, verified by myself.
2003-08-07 11:25:11 +00:00
itojun bd719499fb use bounded string op 2003-07-15 12:33:17 +00:00
itojun 9e765fb451 use bounded string op 2003-07-13 12:39:08 +00:00
itojun e8f0e61fd7 use bounded string op 2003-07-13 12:29:20 +00:00
jrf d9791f82a0 This addresses PR 19797, a small patch made by Tor Stormwall to add
a simple print statement showing the build directory location after
running config and creating a usage() function instead of using the
goto usage statement. Approved by christos@ and thanks to Tor for
the suggestions and patch.
2003-07-02 16:47:53 +00:00
heas 566bb2555a Deref the nv_list pointer and take it's address; cleaner and more clear.
as suggested by enami.
2003-06-27 18:42:11 +00:00
heas 3ff52bc3f5 Correct comment string "mkoptions" -> "makeoptions" 2003-06-25 07:02:04 +00:00
heas 626ce79cef When removing a nvlist entry (describing an option, makeoption, etc) in
undo_config, if that entry is the tail of the LL, also update the appropriate
tail point (nextopt, etc).
2003-06-25 06:42:40 +00:00
atatat d2f781064e If the file being stuffed into the config file string for inclusion in
the kernel is missing the newline at the end of the file, the string
doesn't get closed properly, resulting in a message from the compiler
about a missing #endif.  It's somewhat misleading, so config will now
point it out and compensate for the missing newline.

Addresses PR kern/21920: including kernel config fails in some cases.
2003-06-18 04:19:49 +00:00
lukem 826a14607a Now that <bsd.prog.mk> DTRT if HOSTPROG is defined (i.e, it is a no-op),
there's no need to special-case .include-ing it.
2003-05-18 07:57:31 +00:00
itojun f35cce81c8 strncpy -> strlcpy 2003-05-17 18:51:13 +00:00
jmmv 42c016f444 Note when the -x option appeared; this was in the original patch... 2003-04-26 18:12:00 +00:00
jmmv f37b7f38ab Let config extract embedded configuration data from kernels that were built
with either "options INCLUDE_CONFIG_FILE" or "options INCLUDE_JUST_CONFIG".

The program can now be invoked like:
- config -b objdir -s srcdir /netbsd
  This will use configuration data from /netbsd to automatically create the
  build directory of the new kernel.
- config -x /netbsd > CONFFILE
  This will store configuration data from /netbsd in the CONFFILE file for
  further editing.
2003-04-26 12:53:43 +00:00
jmmv 595e7da8dc New sentence, new line. 2003-04-24 13:23:55 +00:00
jmmv 85cbefaced Avoid running config on directories (i.e., config /tmp), as the error message
given is unclear.  Closes my own PR bin/18785.
2003-04-11 10:53:52 +00:00
matt e86e032c61 Make cfroots const. 2003-03-16 08:09:58 +00:00
wiz 990562bfef .Nm does not need a dummy argument ("") before punctuation or
for correct formatting of the SYNOPSIS any longer.
2003-02-25 10:34:36 +00:00
thorpej a151e17b89 Allow pseudo-devices to be declared with an interface attribute. For
such pseudo-devices, create cfdrivers for them which carry the appropriate
attributes.  This allows devices in the config file to be attached to
pseudo-devices.
2003-01-27 05:00:54 +00:00
gehenna c8d83dee30 Accept the block-device-only devices.
Reported by ragge.
2003-01-23 15:05:45 +00:00
gehenna d0c0162e9c Not necessary to put fixdevmtab in global section. 2003-01-23 15:03:44 +00:00
gehenna 02681cddbc check the duplication or the inconsistency before evaluating fopts. 2003-01-23 15:01:54 +00:00
gehenna 27e67caceb reject the duplication of the same device-major lines. 2003-01-23 14:57:40 +00:00
gehenna 2c4d3430fb fix typo. 2003-01-23 14:55:39 +00:00
simonb 1bee87041f Add CWARNFLAGS+=-Wno-format-y2k so this builds again with the pc532
toolchain.
2002-11-20 05:33:58 +00:00
atatat 15d85dcb14 Alter config so that it emits a config_time.src file (the source file
for config_time.h) that contains, for example:

/* Sun Nov 17 05:37:51 2002 GMT */
#define CONFIG_TIME     1037511471
#define CONFIG_YEAR     2002
#define CONFIG_MONTH    11
#define CONFIG_DATE     17
#define CONFIG_HOUR      5
#define CONFIG_MINS     37
#define CONFIG_SECS     51

These values represent the current time as of when config was last
run, so that functions (eg, inittodr()) can use these values instead
of being updated once every year or so with the "current" time.

The associated modification to Makefile.kern.inc makes config_time.h
depend on this depend on this and the kernel Makefile, so that
granularity of kernel builds is not reduced.
2002-11-19 04:29:19 +00:00
atatat 399c5e40ce Define KERNEL_BUILD at the top of the emitted kernel Makefile. This
means that the appropriate combination of checking for KERNEL_BUILD,
RELEASEDIR, DESTDIR, and/or BSD_PKG_MK, can allow the setting of COPTS
or CFLAGS (or anything else) depending on the specific task at hand.
Personally, I think that per-kernel install rules are the best part.
2002-11-19 04:24:16 +00:00
thorpej 42ea935cff Add a "package" keyword, which makes it somewhat easier to add 3rd
party software packages to the kernel.  The statment:

package "../path/to/some/directory/files.package"

is equivalent to the sequence:

prefix "../path/to/some/directory"
include "files.package"
prefix
2002-11-17 23:36:19 +00:00
thorpej aceaa7e184 When emitting -I directives for prefix'd paths, use EXTRA_INCLUDES
rathern than INCLUDES, so that it works with sys/conf/Makefile.kern.inc.
2002-11-17 22:10:05 +00:00
jrf 2547287233 Corrected the comment and error message. 2002-11-07 21:06:04 +00:00
jrf fb826ed9ad Detect NULL characters in a config file and error out. 2002-11-07 20:07:07 +00:00
thorpej 93854e538b Allow devices to be orphaned, but emit an informational message when
this occurs.
2002-10-11 02:02:24 +00:00
thorpej a27b30b1f8 Oops, fix editor mistake. 2002-10-11 01:54:50 +00:00
thorpej bd86bbe5e9 Add support for specifying attributes as option-dependencies,
allowing for the following:

file foo.c	foobar | bar

defflag BAR

device foobar

...to be expressed in the following (more natural) way:

define foo
file foo.c	foo

defflag BAR: foo

device foobar: foo
2002-10-11 01:48:25 +00:00
thorpej 1f5fa983ab Add support for specifiying attribute dependencies on attributes. This
allows for the following:

define foo
define bar { }: foo

device foobar: bar

An instance of "foobar" will select "bar", which will in turn select
"foo" due to "bar"'s dependency on "foo".

Circular dependencies are not allowed, and a dependency may also not
be an interface attribute.
2002-10-09 20:17:00 +00:00
thorpej 9b10cf346e Use DVUNIT_ANY. 2002-10-09 03:10:19 +00:00
thorpej d90d300b7b Overhaul the way cfattach structures are looked up. The cfdata entry
now carries the name of the attachment (e.g. "tlp_pci" or "audio"),
and cfattach structures are registered at boot time on a per-driver
basis.  The cfdriver and cfattach pointers are cached in the device
structure when attached.
2002-10-04 01:50:53 +00:00
thorpej ab0f429042 Add a trailing ; to CFDRIVER_DECL. 2002-10-02 16:49:03 +00:00
thorpej f4a263573b Use CFDRIVER_DECL(). 2002-09-30 18:54:36 +00:00
thorpej bf97c13c6c Declare all cfattach structures const. 2002-09-27 20:41:46 +00:00
thorpej d1ad2ac4f2 Rather than referencing the cfdriver directly in the cfdata entries,
instead use a string naming the driver.  The cfdriver is then looked
up in a list which is built at run-time.
2002-09-27 02:24:06 +00:00
thorpej 09354b26ef Fix an uninitialized pointer bug in emitcfdata(). 2002-09-26 21:07:49 +00:00
thorpej fc0fe0347d Overhaul the way parent attachments are specified; instead of using
a vector of indices into the cfdata table to specify potential parents,
record the interface attributes that devices have and add a new "parent
spec" structure which lists the iattr, as well as optionally listing
specific parent device instances.

See:

    http://mail-index.netbsd.org/tech-kern/2002/09/25/0014.html

...for a detailed description.

While here, const poison some things, as suggested by Matt Thomas.
2002-09-26 04:07:35 +00:00
dbj df3f757254 add mkdevsw.o to OBJS 2002-09-22 06:22:50 +00:00
enami 78948a7123 Salvage pre-devsw config support so that one can config such as other
branch's kernel.
2002-09-11 06:20:09 +00:00