Commit Graph

419 Commits

Author SHA1 Message Date
uebayasi 92b86764e1 Bump config(1) version.
config(1) still keeps backward-compatibility; it is more permissive than
before.  The tree, however, needs the updated config(1), mainly to strictly
define attribute ("module") ownership and dependencies.
2014-10-10 12:10:02 +00:00
wiz c8fb5a2e0f Fix two typos. 2014-10-10 11:58:59 +00:00
uebayasi b0d108d368 Document -M. 2014-10-10 11:49:15 +00:00
uebayasi eac891b935 Put TODO ideas (to keep your fun). 2014-10-10 11:38:42 +00:00
uebayasi d23bf64337 Allow dependency on undefined attributes, so that attribute definitions can
be written out-of-order, like:

	# b is not defined yet
	define	a: b
	file	a.c	a

	# b is defined here
	define	b
	fine	b.c
2014-10-10 11:09:50 +00:00
uebayasi 680ed4abc8 Select attributes for filesystem options too. 2014-10-10 10:46:05 +00:00
uebayasi 861847ab35 If an option is selected, select the matching (lowercased) attribute. Handle
dependencies too.
2014-10-10 10:22:49 +00:00
uebayasi 7a01ec4b08 If an attribute is selected, select its dependencies too. 2014-10-10 10:16:19 +00:00
uebayasi c24abed7e6 Implicitly define attribute for device. 2014-10-10 08:14:47 +00:00
uebayasi 6903e7639b Implicitly define attribute for options. 2014-10-10 07:48:50 +00:00
uebayasi d88f6cad14 Implicitly define attribute for filesystem. 2014-10-10 07:08:26 +00:00
uebayasi 82e22e6766 Implicitly define empty "attribute" for "device attachment". Much less
troublesome than "device" and "interface attribute".
2014-10-10 06:59:38 +00:00
uebayasi bd3d511493 Split plain/interface/devclass attribute initializers. 2014-10-10 06:13:30 +00:00
uebayasi b4d3dfc64a Refactor attr definition and initialization a little. 2014-10-10 05:27:28 +00:00
uebayasi 1c89d26524 Style. 2014-10-09 19:33:43 +00:00
uebayasi b35679c08e FIT_FORCESELECT is never set anywhere. 2014-10-09 19:27:04 +00:00
uebayasi 9a04781594 FIT_NOPROLOGUE is never set anywhere. 2014-10-09 19:24:36 +00:00
uebayasi eb981efe66 Kill more unused indent code in emitfiles(). 2014-10-09 19:22:31 +00:00
uebayasi 7603d666f0 Steal -M to enable "modular" build. 2014-10-09 19:20:56 +00:00
uebayasi aeeeb994e8 Print one file per line. Simplify code. 2014-10-09 17:36:10 +00:00
uebayasi 745a9de44a Correct inverted logic. 2014-10-09 17:22:55 +00:00
uebayasi ae77717cc7 Implement code to generate Makefile to build netbsd via intermediate relocatable
object files.  Disabled for now.  Commit this for further experiments.

Kernel (netbsd) has been built as:

	netbsd: *.o
		ld -o netbsd *.o

Change this to:

	netbsd: *.ko
		ld -o netbsd *.ko
	acpica.ko: ${OBJS.acpica}
		ld -r acpica.ko ${OBJS.acpica}
	:

You can call *.ko as a module, but this is not only beneficial for loadable
module, but also localize related text/data.  Various options/flags/params
will be able to be per-ko.  Unnecessary symbols can be hidden.  Many ideas
will follow.
2014-10-09 17:00:15 +00:00
uebayasi 3586467df2 Always select the fallback allattr. 2014-10-09 16:08:36 +00:00
uebayasi adf6a4556b Define an implicit attribute "netbsd" internally to collect files that don't
belong to any specific attribute.

Eventually, all operations doing "foreach (files)" can be rewritten as "foreach
(attributes) foreach (files)".
2014-10-09 15:25:26 +00:00
uebayasi fa3d850434 If a file is marked by an atom expression, like "file a.c foo", and if the
specified expression is an attribute, mark the file as belonging to the
attribute.

At this moment this information is not used for any purpose, but can be
traced by config -ddd.
2014-10-09 10:29:36 +00:00
uebayasi 567430ccec Sort definition/selection rules to clarify which is which. 2014-10-09 09:39:24 +00:00
martin 012985802d Provide a CFGDBG version for the tools build. 2014-10-09 07:43:55 +00:00
uebayasi fc2a41ac40 The word "configuration" is too ambiguous; use "selection" meaning that
user selects some of provided "definitions".
2014-10-09 07:05:01 +00:00
uebayasi 2820acceff Debug print where things are selected (by user). 2014-10-09 06:49:53 +00:00
uebayasi 99af41ba8d Add debug print function. 2014-10-09 06:45:31 +00:00
joerg aa44bc3b18 Bump CONFIG_VERSION. 2014-08-24 20:22:18 +00:00
joerg 6616828fd2 Restore explicit rule for swap*.o. 2014-08-18 08:07:02 +00:00
joerg a26164117a Reorganize symbol table embedding. The existing option SYMTAB_SPACE is
replaced by the make option COPY_SYMTAB set to any value. The copy of
the symbol table is no longer put into a buffer in kern_ksyms.o, but a
small helper object. This object is build first with a dummy size, then
the kernel is linked to compute the real dimension of the symbol table
buffer. After that, the helper object is rebuild and the kernel linked
again.
2014-08-17 21:17:43 +00:00
bad 2a950d2831 Treat an undefined option as a warning instead of an error when undoing an
option.

Allows one to win with declarations like:
no options 	MSGBUFSIZE
options 	MSGBUFSIZE="128*1024"

Briefly discussed with cube@, lukem@ and martin@.
2014-08-09 12:40:14 +00:00
wiz 910ba5f05b Bump date for previous. 2014-05-29 08:13:17 +00:00
mrg ebf7669ed7 implement "no ident". 2014-05-29 07:47:45 +00:00
dholland d8da1d6013 avoid error path SIGSEGV 2014-05-21 05:25:34 +00:00
wiz 9237f38b59 Sort options in usage. 2014-05-05 21:04:09 +00:00
wiz 5f345558c9 Sort SYNOPSIS. Bump date for previous. 2014-05-05 20:52:45 +00:00
martin 1957b5eaba Add two new options, -U and -D, that can be used to define "makeoptions"
on the config command line. While there, rename the undocumented (internal)
parser debug option from -D to -d.
Discussed on tech-toolchain.
2014-05-05 19:08:13 +00:00
riastradh da030fc8bd `Controller' takes two l's. 2014-03-06 15:00:21 +00:00
wiz 26dba06cb7 Fix some typos found by Rich Neswold and reported in PR 48597. 2014-02-13 22:36:28 +00:00
christos 6fce9f6ad7 go back to using file:line: from uwe. 2013-11-01 21:39:13 +00:00
christos 8ae3ff1668 make config errors look more like other programs: <file>,<line>:
instead of <file>:<line>:
2013-11-01 17:09:59 +00:00
pooka 26b4d3d169 ioconf/pseudo-root have been in here unchanged for 3+ years and their use
has spread from rump kernels into dozens of kernel modules.  Let's pretend
we don't want to see config yell about them being experimental every time.
2013-08-11 10:37:08 +00:00
christos fbb3db86f7 Don't support sysctl for the tools version of config. It is too complicated
to do so, and config -x is not used during the build.
2012-08-31 01:23:49 +00:00
wiz 686e48a4a3 Use more markup. Wording. 2012-08-30 12:42:41 +00:00
christos c9ffe47f54 bump date. 2012-08-30 12:32:07 +00:00
christos 8aaed51273 make config -x look at the booted kernel first. 2012-08-30 12:31:25 +00:00
martin fcbf6c86a2 If we build several kernel (variants) within the same build directory, bad
things may happen in a parallel build - especially with rules like the
automatic size adjustment for SYMTAB_SPACE, see long standing failure of
evbarm on the build cluster.
Easy fix: .WAIT for each config to complete, before going on with the
next. Low impact, only minor loss of paralellism, and only in cases where
needed.
2012-06-08 08:56:45 +00:00
matt d34c2845b8 Use C89 function definitions 2012-03-20 20:34:57 +00:00
dholland 471d829aae Remove the NV_OBSOLETE flag, which is no longer needed. While here,
update an outdated comment about condition expressions.
2012-03-12 03:04:56 +00:00
dholland cb79ede2d1 Give option definitions their own data structure instead of using nvlists.
(and using messy hacks to make up for nvlists not holding quite the right
things)
2012-03-12 02:58:55 +00:00
dholland a883398ef5 Introduce type-safe wrappers around the hash tables. Use them for a
selected set of tables affected by the next nvlist cleanup in the
works.
2012-03-12 00:20:30 +00:00
dholland f5d4142b2d 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.
2012-03-11 21:16:07 +00:00
dholland 25c56bd707 Add some organizational comments 2012-03-11 20:02:55 +00:00
dholland 237116305d More naming improvements. 2012-03-11 19:27:26 +00:00
dholland a551c5e8b7 Create a struct condexpr type to hold condition expressions, instead
of abusing struct nvlist to make trees.

(These are the a|b and a&b constructs.)
2012-03-11 08:21:53 +00:00
dholland 4fbb702df0 Rename a few more things; try to use the same terminology as config(5). 2012-03-11 07:46:47 +00:00
dholland bbe96a5ad8 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.)
2012-03-11 07:32:41 +00:00
dholland 720c7fbc2a Strengthen the logic that wraps allocations going on the parser stack.
(This allows cleaning up when a syntax error occurs, because yacc just
dumps the parser stack on the floor.)

The new logic can handle arbitrary data types instead of being limited
to struct nvlist.
2012-03-11 07:27:02 +00:00
dholland 285c15fc92 Remove cf_swap, which hasn't been used in a long time. 2012-03-11 05:31:37 +00:00
dholland cfffb8a2c1 Write out the expression grammar for dependency constraints instead of
using precedence rules. Precedence rules (besides being a hack) often
lead to unexpected/unwanted behavior in corner cases.
2012-03-11 02:56:25 +00:00
dholland 6df4c5ae47 Sort productions in grammar. No functional change. 2012-03-11 02:43:33 +00:00
dholland 70f2148fe7 Simplify some things. Rename some productions for clarity. 2012-03-11 02:21:04 +00:00
dholland 60c605bb74 A bit more of previous. 2012-03-11 01:09:42 +00:00
dholland 540fdf9f5e Reformat according to (my) basic standards for yacc grammars.
No functional change.
2012-03-11 00:57:44 +00:00
dholland f3063ae30c Comments. 2012-03-11 00:14:20 +00:00
dholland 671dbef5d6 Use __printflike. Build products unchanged. 2012-03-10 21:53:38 +00:00
matt 105471657d When making the symlink for machine -> arch/foo/include
also make foo -> arch/foo/include.  This allows one to include <foo/bar.h>
include <machine/bar.h> which can be handy.
2011-07-09 08:01:58 +00:00
nakayama c09c2a7b34 Fix build on Solaris 10. 2011-03-03 14:53:01 +00:00
cube 3f1dd008b1 Emit compatible struct devsw_conv when version is older than 20100430. 2010-07-30 16:23:49 +00:00
pooka 00ed8a38a3 Prefer a real device for pseudoroot and only create a fake device
in the case we are attaching to a pure attribute.  Otherwise we
end up creating a fake device instance every time ...
2010-05-02 15:35:00 +00:00
pooka 145a3f9eec ignore mainbus in previous for now 2010-05-01 23:54:35 +00:00
pooka 194e1c80bc Support interface attributes as pseudoroots. This makes things like
"pseudo-root audiobus*" possible.
2010-05-01 22:17:58 +00:00
pooka 3da3ab250b For the simple cases, augment device-major with information on how
a driver expects /dev/node -> minor mappings to go and include that
information in devsw_conv.
(no, I didn't plow through all the MD majors files)
2010-04-30 20:47:17 +00:00
pooka 3718acd4b5 output __arraycount instead of homegrown macro 2010-04-15 12:35:57 +00:00
pooka b7a2b071f9 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.
2010-03-26 15:51:17 +00:00
pooka abc34bd561 Generate cfdriver and cfattach lists for ioconf configs. 2010-03-25 19:39:05 +00:00
pooka d0e5d93744 Some drivers want to include ioconf.h, so generate it if doing
"ioconf" config.
2010-03-22 14:40:54 +00:00
pooka 523c21179c print ioconf WARNING in caps too 2010-03-08 11:12:32 +00:00
pooka 90ac64de16 Add a highly experimental pseudo-root feature to be used in conjuction
with the also-experimental ioconf keyword.  pseudo-root allows to
specify a root at any point in the device tree without having
attachments from the actual root.

For example, instead of having a config file like this:
mainbus0 at root
bus_a? at mainbus0
bus_b? at bus_a*
device7 at bus_b?

You can have one like this:
pseudo-root bus_b*
device7 at bus_b?

This will produce the relevant ioconf.c glue for device number 7
only instead of the whole 9 yards from root.  Perhaps needless to
say, this can be used to generate snippets of config glue for
modules and, let's not deny that my main motivation for doing this,
rump components.

This is part 2/3 of my modifications to config (the last part is
autogenerating source file lists and component Makefiles).

No strong objection from cube (after a little pressuring ;), but
like he said, the implementation will most likely need some more
tweaking and may not work correctly under all pseudo-root uses yet.
2010-03-08 10:19:14 +00:00
pooka e6e6744f43 reflect previous change in comment 2010-03-03 13:56:29 +00:00
pooka c96070654c Remove fs_foo.h support from deffs now that nothing uses it. 2010-03-03 13:53:22 +00:00
pooka 7547791dd3 Fix off-by-one (config -x works again) and improve editing artifacts
(actually the whole "config -x must be used alone" change was made
unnecessary along the way.  cest la vie).
2010-02-13 22:57:03 +00:00
pooka ec78f798c7 ... aaand make the emit-order slightly more sensible for ioconf.c to
actually work again.
2010-02-03 21:32:27 +00:00
pooka e239742f9b 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 ;)
2010-02-03 21:00:49 +00:00
pooka 830034140c Add static to packdevi() like the local prototype says. 2010-01-21 18:06:38 +00:00
christos c2261f6766 don't '#define yywrap() 1', use '%option noyywrap'. This is because the
#define is doomed to failure if --prefix is used.
2009-10-28 02:42:20 +00:00
wiz a7c1bdeb22 New sentence, new line. 2009-08-31 07:45:24 +00:00
cube 9a23b0e1a5 .Sx to refer to a section, and add one ref to the lint stuff for clarity. 2009-08-31 03:39:00 +00:00
cube 323b339462 For {pseudo-,}devices, check if an instance of the pseudo or the considered
attachment of the device has already been done by the template config file.
If so, don't emit a line.  Reported by John Nemeth.
2009-08-30 21:07:41 +00:00
cube d502f7a8c0 Dependency on config_time.src was removed today from Makefile.kern.inc, so
starting from that date it's not necessary to create it.  (Of course that
won't happen until config version is bumped for some other reason.)
2009-05-13 18:54:34 +00:00
wiz a44b9acd01 Use Sx. Remove superfluous .Pp. 2009-05-04 21:11:53 +00:00
lukem 5cc303e13d Fix WARNS=4 issues (-Wcast-qual -Wsign-compare -Wshadow) 2009-04-11 12:41:10 +00:00
joerg 833d1509e8 .sp -> .Pp 2009-03-24 00:14:01 +00:00
cube 1894a7d27b Now that condmkopttab isn't a hash table anymore, don't initialise it with
ht_new()...  So actually rename it to condmkoptions to avoid confusion.

Reported build failure on amd64 (strange that I wouldn't get it on i386) on
current-users by Kurt Schreiner.
2009-03-13 20:44:59 +00:00
cube a16a636500 Actually allow a full expression for the condition for "makeoptions" in
files.*

Patch from Yorick Hardy.
2009-03-13 18:24:41 +00:00
cube 723938ea23 Bump date. 2009-02-20 05:26:51 +00:00
cube 083c47ad52 Remove mentions that a kernel configuration file must support at least one
file-system because it's no longer true.
2009-02-20 05:22:59 +00:00
cube 46251c8d6e Ignore line starting with # in Makefile.${arch}. It might be valid make(1)
syntax to have a line that starts with # that is not comment, but well,
let's just say it's not valid syntax for Makefile.${arch}.

Breakage on a couple archs reported by he@.
2009-02-20 05:20:25 +00:00
enami 2c8977b0b4 Fix compiler warning. 2009-02-15 03:45:44 +00:00
cube 016c56ea2f - Allow substition of options values in the generated Makefile using the
syntax %OPTION%.
- Make it possible to specify a syntax version information in the Makefile.
- Bump version to 20090214.
2009-02-15 01:39:54 +00:00
cube 0367057be6 Error out if one f the mkxxx() prints an error. 2009-02-14 21:28:58 +00:00
drochner d767912be3 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.
2009-01-20 18:20:47 +00:00
uebayasi 547b81ca4c Better whitespace in ioconf.c output. 2009-01-16 09:43:41 +00:00
christos 0001b92828 rename nv_int -> nv_num and make it long long, so that dev_t will fit when
we change it.
2008-12-28 01:23:46 +00:00
martin 9cd0cde30f bump version due to recent rootfs changes 2008-12-21 11:39:56 +00:00
pgoyette 9c68331911 Store config(1)'s root filesystem type as a text string rather than
embedding the address of its xxx_mountroot() in swapnetbsd.c.  This
permits booting of kernels with hard-wired filesystem type even if the
filesystem is in a loadable module (ie, not linked into the kernel
image).

Discussed on current-users.  Tested on amd64 and i386 with both hard-
wired and '?' filesystem times, and on both modular and monolithic
kernels.

Thanks to pooka@ for code review and suggestions.

Addresses my PR kern/40167
2008-12-19 17:11:57 +00:00
ad eb1a865124 Don't complain about a missing 'file-system' directive. File system code
can be provided by modules.
2008-10-20 11:02:18 +00:00
dholland 3b398d5c25 Adjust previous; apb@ points out that _PATH_TMP is provided by compat_defs.h;
thus, this shouldn't need a paranoid fallback definition.
And, use _PATH_TMP also in the second place that was using a hardwired "/tmp".
2008-10-16 05:41:13 +00:00
dholland 36c1b19ba1 Fix ridiculously small filename buffer for temporary file and resulting
truncation if $TMPDIR is set; also, fix an error path to not leave the
temporary file behind. From Gao Ya'nan in PR 39746.
While here, use _PATH_TMP instead of a hardwired "/tmp".
2008-10-16 05:35:01 +00:00
dholland 3251535c47 Avoid memory leak in error case. From Gao Ya'nan in PR bin/39721. 2008-10-09 07:18:15 +00:00
cube baebbcf71a Bump CONFIG_VERSION after the previous fix to main.c. 2008-08-30 02:59:55 +00:00
cube 8e3d873278 In find_declared_option, use the correct hash for file-systems. That way,
information about dependencies are actually processed.
2008-08-30 02:57:42 +00:00
lukem 98e5374ccb Remove the \n and tabs from the __COPYRIGHT() strings.
Tweak to use a consistent format.
2008-07-21 14:19:20 +00:00
kent ecafa994fb * emitrules()
- code cleanup
 - support for extensions of which length is not 1
2008-07-16 11:45:56 +00:00
cube 7490b3179c It actually makes no sense to warn on a behaviour that was allowed in
previous versions, when we know we're working on an old file.  That way,
a -current config(1) works on a 4.0 source tree (or older) without
warning.  Pointed out by Christos Zoulas.

XXX We should set up way to note compatibility code we can get rid of
XXX the day we choose to bump CONFIG_MINVERSION.
2008-07-07 16:10:27 +00:00
drochner b66156c7c9 Disable use of pseudo-devices defined "defpseudo" with interface
attributes, but provide compatibility for older source trees (according
to the "version" in conf/files and other files.*.
reviewed by cube
2008-06-10 18:11:31 +00:00
cube 53faa53d5a Do proper config(5) version checking after previous changes [hi drochner!].
The rule is, if you change scan.l or gram.y, you bump the config(5)
version.  If you implement the changes under sys/conf/files or affiliate,
you bump the required version in sys/conf/files or in an appropriate place
to minimise annoyance.  If the changes makes new config(1) incompatible
with a previous version of config(5), embed it in config(1) using the
CONFIG_MINVERSION definition along with CONFIG_VERSION.

This has been in the tree for what, 3 years now?  It's even documented...
2008-06-10 14:03:57 +00:00
wiz 3c60159914 Bump date for previous. 2008-06-10 12:56:33 +00:00
drochner 8456b350de Seperate pseudo-devs which don't use device_t et al. (the classical
ones, mostly network pseudo interfaces) and those which use autoconf
to attach instances dynamically, or to attach child devices.
Use a new keyword "defpseudodev" for the latter.
Issue a warning if interface attributes are used with "old" pseudodevs,
but let it work as before for now. This will be removed soon.
approved by cube
2008-06-10 12:35:32 +00:00
martin 11a6dbe728 Convert TNF licenses to new 2 clause variant 2008-04-30 13:10:46 +00:00
martin 3028e483e4 Convert to new 2 clause license 2008-04-29 06:53:00 +00:00
martin ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
skrll 280a563bc4 Typo. 2008-03-26 14:41:00 +00:00
perry 8b0f9554ff convert __attribute__s to applicable cdefs.h macros 2007-12-15 19:44:37 +00:00
lukem 82d7cb8306 Use a common function to generate the "MACHINE GENERATED" comment,
and ensure mkswap.c adds it too.
2007-12-12 00:03:33 +00:00
dsl 8222554340 Be more informative about duplicated device names. 2007-11-30 23:19:18 +00:00
cube 66a59dcc4f Don't defattr machinearch if it's NULL. Pointed out by
Juergen Hannken-Illjes.
2007-11-11 17:35:27 +00:00
cube 66796c65e4 Make the "machine" statement define attributes for `machine', `arch' and
all the `subarch' given as parameters.  This is useful in combination with
ifdef...
2007-11-10 00:15:43 +00:00
cube 656cdcc8fb Add support for "ifdef <attribute>" blocks. It goes like this:
ifdef <attr> / ifndef <attr>
elifdef <attr>
elifndef <attr>
else
endif

No indentation is possible for now, it will come later.
2007-11-09 23:41:08 +00:00
cube baec5c01fc Don't pollute fsopttab with duplicate options for the sake of a test that
has probably been gone for a very long time.  Produces identical output.
2007-11-09 05:21:30 +00:00
cube f51c36b80a - Make include/cinclude/package eat up to the next new-line character.
- Fix casts in getincludepath() and re-work it to ignore the unused end of
  the line.
2007-11-09 05:06:08 +00:00
cube 7a185660d8 Some more licence clean up. 2007-09-10 10:54:20 +00:00
cube 14a82de83a Improve the structure of the man page to make it more usual, with the hope
that people might actually read it some day.  Yeah, I know, dream on, dream
on.

Thanks schmonz@ for a quick english check.
2007-09-09 00:35:14 +00:00
veego 9ec62257da Using ${NETBSDSRCDIR} requires <bsd.own.mk> 2007-05-13 20:22:45 +00:00
dsl e934daaae7 Enable the code that adds global constants to every kernel object file
that uses each configuration parameter.
This will stop kernel objects build with different options (that come from
config files) being linked together or loaded as a LKM.
Currently some options that have an effect on the kernel DDI/KI are passed
directly as parameters to cc.
An aim (for anyone adequately bored) would be to reduce the number of these
constants that appear in each .o file.  .o files with the same constants
should be sharable between kernels (even between XEN and i386).
2007-05-12 10:15:31 +00:00
dsl c1079eace9 Use '.equ' instead of '.set' when defining global constants.
On alpha '.set' has a non-standard purpose.
2007-05-10 21:01:14 +00:00
cube bfc250f292 Add some sanity checking in order to avoid some segfaults. There might be
other ways of producing a segfault, but keep in mind those happens when the
negation applies to an erroneous instance.
2007-04-06 19:21:09 +00:00
christos c7295a4c51 - 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.
2007-01-13 23:47:36 +00:00
cube 718ffd7615 Handle defopt lists properly, as ':=' syntax introduce an additional
element...  For that, introduce nvcat(nv1, nv2).
2007-01-12 21:49:51 +00:00
cube 072ab00089 Change the name of the resulting kernel binary, because "lint" confuses
our Makefiles.  While there, add a couple comments to explain how all
attachments are found.
2007-01-10 15:17:43 +00:00
cube 904262675b Add new syntaxic sugar to provide a value in lint (i.e., config -L)
configurations for defparams.  It will be used _only_ by config -L.

This will greatly help automating tests with lint configurations,
hopefully.
2007-01-09 13:03:47 +00:00
wiz 81c929da0c Bump date for previous (year was wrong). 2007-01-09 06:58:46 +00:00
cube 6ebb2291dc Print pseudo-devices in their own section and print all of them (d'oh). 2007-01-08 18:08:24 +00:00
cube aa3d024933 One %s is enough to print one string. 2007-01-08 17:50:43 +00:00
cube 59c945452a Introduce a new option to config(1): -L. What it does is takes a regular
configuration file (although it is meant to be used mostly with
std.${ARCH}), and prints out a configuration file that includes it and
select every single option and parameter, and define an instance for every
single possible attachment.  IOW, selects everything, into a would-be
"LINT" config.

The resulting config really isn't meant to be runnable, but should be
somewhat buildable on most archs.  It still needs adjustments because some
options are peculiar (e.g., ACPI_DSDT_FILE wants an existing file as its
value), so it's not yet possible to do "config -L; config; build" in an
automated way.
2007-01-08 16:08:08 +00:00
wiz b8808a8b5c Improve formatting, fix typo, bump date for previous. 2007-01-08 07:18:25 +00:00
cube f55d783c32 - Document "source /path" and "build /path".
- Move documentation for "package", because as I learned tonight, it's not
  allowed before setmachine.  You get to discover scary new stuff about
  config(1) each time you look at it.
2007-01-07 23:22:04 +00:00
cube db31f3b5e0 Mention that newlines mid-statement are allowed, and clarify how
needs-count and needs-flag work, notably for simple attributes.
2007-01-06 21:58:54 +00:00
cube c93963e680 Make deffilesystem check all defined options, not just defopttab (which
ought to be empty nowadays).
2007-01-06 18:54:32 +00:00
alc 0c17aa264d Fix a typo in ht_free() which caused the last list of the hashtable to be ignored.
It caused config(1) to crash on the following assert() if the list was used.

This bug shows up after the recent change in files.c which fixed a memory leak.

pointed out by dogcow@
reviewed by cube@
2006-12-27 17:50:27 +00:00
alc 2f403ebe4f CID-4275: don't leak `fixdevmtab' 2006-12-26 00:07:18 +00:00
christos 1665d5e960 fix spelling of accommodate; from Zapher. 2006-11-24 19:46:58 +00:00
christos bbfbbde1e9 eliminate the only alloca use and simplify the code. 2006-11-09 20:42:45 +00:00
uwe 4e4935bba0 Include <sys/cdefs.h> and use __used on config[] instead of the ifdef dance.
Prevents gcc4 from g/c'ing embedded config from VAX kernels.
2006-10-29 23:00:44 +00:00
dsl 342d35797b 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).
2006-10-04 20:34:48 +00:00
christos c0156a4952 Coverity CID 175: Avoid memory leak; add new function to destroy a hash table. 2006-09-27 19:05:46 +00:00
christos f11da4b014 make this compile again. 2006-09-04 18:42:14 +00:00
wiz 2ba7db1893 Fix typo. 2006-09-04 18:32:54 +00:00
cube 1e2d115e84 Bump version after last feature addition (default value for defparam). 2006-09-04 07:32:50 +00:00
dsl 6467d53e48 Add support for specifying a default value on a 'defparam' line.
If a default is specified then the option is always defined in the
corresponding .h file.
Particularly useful for parameters where the default action isn't the
same a defining the value zero, given that the current use of #if defined(opt)
is open to problems wehere the relevant .h file isn't actually included, so
requiring an option to always have a value makes sense.
Also included (but commented out) is code that adds a global symbol to
the object file to stop objects compiled with different values for the
same option being linked together - I'm not quite happy with it yet!
2006-09-04 06:45:14 +00:00
dsl 17ff309c84 There isn't really any point in the 'union' for nv_str and nv_ptr, all it
does is cause confusion when I try to add default values for defparam.
Also if malloc()/free() aren't efficient enough for us, we ought to fix
them rather than having local free list - so kill the local free lists.
2006-09-03 07:45:40 +00:00
he d425dd3b69 Remove unused local variable. 2006-08-30 15:03:56 +00:00
cube 08ba9c9303 Bump version after deffs change. 2006-08-30 13:48:11 +00:00
matt 4a82747a8f Allow deffs to take dependencies like defflag and defopt 2006-08-30 10:12:25 +00:00
christos 55ee861f25 protect libutil with HOSTPROG 2006-08-29 16:54:03 +00:00
christos e07b7e508b build complete initializations. 2006-08-28 01:45:41 +00:00
christos d0fb89015b Now that this is part of tools, we don't need the extra build glue. 2006-08-26 18:17:13 +00:00
drochner fe5f2a85b5 Make sure that only specisications for _interface_ attributes are
emitted, the rest is useless at runtime.
saves some bloat in ioconf.c
2006-08-09 18:03:23 +00:00
cube 71af9028c9 Check that the device is not a pseudo-device in deldev(), too (as in
deldevi()).

PR#34111 by jmmv@.
2006-08-07 12:03:32 +00:00
cube 15f9f25144 s/setmachine/machine. Overlook pointed out by Havard Eidnes. 2006-07-05 10:11:02 +00:00
cube 93e398b3e3 Reference config(5). Noted by perry@.
XXX options(4), config(9) and probably some others still have to be changed
XXX a bit.  A chaque jour suffit sa peine.
2006-06-04 20:07:52 +00:00
cube 3bde459b8f Set a more realistic date than the day I started writing it. 2006-06-04 20:06:14 +00:00
cube ecfd193d31 Install config.5 and config.samples.5. 2006-06-04 19:42:18 +00:00
cube 8a5d15c785 Everything you've always wanted to know about config(1) without daring
asking (with reason).

You've entered the config(1) dungeon--More--
An option hits you.  You die.
2006-06-04 19:41:26 +00:00
cube 1baa475170 Bump version after fix to obsolete syntax. 2006-06-04 13:52:27 +00:00
cube 87ab9060e2 D'uh. Forgot the file name argument in the "obsolete" statements. 2006-06-04 13:07:24 +00:00
cube ac24e16176 Introduce two new statements:
obsolete defflag <option> [, <option> [, ...]]
    obsolete defparam <option> [, <option> [, ...]]

The two statements actually do the same thing (there could be only one),
but it makes things less cryptic that way.  The optional ": deps" part of
a 'defflag' or 'defparam' still has to be dropped when it gets obsoleted.

When the user has 'options OBSOLETE_OPTION' in his configuration file, it
is ignored (that is, opt_*.h files are generated as if it wasn't there),
and the user gets a warning about it.

Bump version to 20060525.

When someone first uses that syntax in the tree, a "version 20060525"
statement should be added before its occurrence, preferably at the top
of sys/conf/files.

Suggested by Matt Thomas a few months ago.
2006-05-25 22:28:38 +00:00
christos fc19b961ac s/vax/__vax__/ 2006-05-25 22:06:53 +00:00
christos f81561404f deal with the vax gcc that does not understand __attribute__ used. 2006-05-24 23:16:50 +00:00
christos 9a02ff9b42 gcc-4.0 needs attribute used. Variables with attribute unused get removed. 2006-05-14 23:47:34 +00:00
cube c002406624 Fix a broken conditional that confused coverity. It cannot happen, anyway.
CID 178.
2006-03-29 09:16:36 +00:00
cube 6a6299eb8f Panic on an unlikely error condition. CID 177. 2006-03-19 23:36:10 +00:00
cube e50e4ee4b2 Free a nvlist used temporarily.
Found by Coverity, CID 179 and 180.
2006-03-19 23:12:59 +00:00
cube 11820066f8 Close file on error. CID 176. 2006-03-19 22:34:44 +00:00
cube 8e4130e5ee Fix various resource leaks, all happenning on error situations (IOW,
shortly before exit(1)).  CIDs 181, 182, 183, 184 and 185.
2006-03-19 22:27:14 +00:00
cube 3eaff5cb14 Proper resource handling in mkmakefile().
Coverity CIDs: 186, 187, 188 and 189.
2006-03-19 16:27:13 +00:00
wiz 5d1e8b2745 Fix some typos. 2006-02-25 02:28:55 +00:00
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
cube 4225631532 The loop detection code could not detect the negation of an instance that
made a device its own parent.  Add a test that checks that and stop looping
in that special case (after all, everything is already being handled by the
parent instance).

Reported by Jukka Salmi on current-user.
2005-12-10 13:39:47 +00:00
cube 7230395132 Invert the meaning of a comment to match reality. Pointed out by uwe@. 2005-11-13 17:24:31 +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 b7505c1571 Stop walking the tree when two conditions are met: we've seen the device
already (one of its instances has been changed), and we have made no change
on any of the instances.

Previously, it stopped as soon as it detected the device had been seen.
While all the instances of the device at stake were eventually seen, the
same wasn't true for its children...

Fixes hpcmips's GENERIC.
2005-10-04 23:00:34 +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 2fb411a123 Don't return immediately when detecting that a devbase has already been
seen:  aliases might have to be activated, too.  Fixes GENERIC of alpha
and amiga.
2005-10-02 21:22:56 +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
martin 6fd5c01546 Move package/cinclude/include handling from the parser to the scanner,
where it belongs. This has the side effect of fixing PR toolchain/30903.
2005-09-10 15:38:46 +00:00
drochner f46880afbf in locators.h, also emit definitions about the number of locators per
interface attribute
2005-08-25 15:02:18 +00:00
drochner 0d6cb6f10c 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.
2005-08-25 15:01:07 +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
yamt 19ff568b84 allow configuration without swap. 2005-07-30 06:40:30 +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
drochner fd816c4745 don't put the xxxcf_locnames[] into the global namespace 2005-06-28 20:21:05 +00:00
thorpej dbe5d1e1f7 Remove bogus BINDIR assignment. 2005-06-06 06:12:09 +00:00
wiz d3918ffef7 config(1), not (8) 2005-06-05 18:59:35 +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