summaryrefslogtreecommitdiffstats
path: root/usr.sbin/config/mkoptions.c
Commit message (Collapse)AuthorAgeFilesLines
* Turns out that it is a bad idea to have a missing compat option be aimp2010-08-151-3/+5
| | | | | | | | | | | | | fatal condition. While it works out really well for diagnosing the case where you want it, but don't have it, it works really badly for the case where you don't have it and don't want it. Remove the printf and exit pair. Replate it with simple return to silently ignore this condition. This is needed to fix the COMPAT_IA32 being required in options.* in stable, but we need to run this change through -current first... MFC after: 3 days
* Put warnings out to stderr rather than stdout.imp2010-07-151-15/+20
| | | | MFC after: 3 days
* Enhance config to handle MACHINEs with multiple architectures:nwhitehorn2010-07-131-0/+14
| | | | | | | | | | | | | - Passing -m to config will now print the MACHINE and MACHINE_ARCH given in the passed kernel configuration file and then exit. - If an option is defined in options.MACHINE with the same name as the architecture of the kernel being configured, that option will be considered set. This allows conditional compilation based on CPU architecture. Config version is now 600010. Reviewed by: imp
* Require the option that's mapped be listed in the options file. Thisimp2010-04-271-9/+28
| | | | | | | | | | | | | | | | | will allow people with old config options to either have it just work (if config is new enough), or get a version error (if their config is about 7.0 or newer) rather than getting a cryptic error about duplicated options in the options file, or getting an error about an unknown option, at which point they'd update their config file only to learn they need a new config, only to learn they didn't really need to update their config file... All this because our version checking was in the wrong place for the past decade... # hopefully this is the last change, and we'll be able to config with an # 8.0 GENERIC file on stable/8 after I merge this change and add the # compat options. MFC after: 3 days
* Redo how we add compat options so as to be compatible with oldimp2010-04-271-77/+80
| | | | | | | | | | | | | | versions of config. Remove support for the syntax OLD = NEW form the options file, and instead have a new file $S/conf/options-compat. This file will be parsed as OLD NEW on each line. Bump version of config. Since nothing in -current ever used this, there's no hazards for current users, so I'm not bumping the version in the Makefiles.$MACHINE. No need, really, for this version bump in -current, but this was introduced into -stable before I realized the version check was ineffective there, so the verison bump doesn't hurt here and keeps the two branches in sync, versionwise, after the MFC. MFC after: 3 days
* Allow option aliasing. Lines of the form:imp2010-04-151-1/+26
| | | | | | | | | | | | OLD_OPT = NEW_OPT in options* files will now map OLD_OPT to NEW_OPT with a friendly message. This is indented for situations where we need to preserve an interface in the config file in an upwards compatible fashion on a stable branch. Reviewed by: nwhitehorn@ MFC after: 3 days
* - Handle calloc() allocation failures.ru2010-03-301-0/+10
| | | | | | | | | - Fixed a comment. - 2 -> EXIT_FAILURE in some places. - errx() -> err() where appropriate. PR: 144644 Submitted by: Garrett Cooper
* Use calloc() instead of zeroing the memory our own.delphij2006-06-071-10/+5
|
* Clean up most of the "XXX"-tagged items:ru2005-12-301-4/+0
| | | | | | | | | | | - The code that creates hints.c and env.c from the skeleton files moved into separate functions. - Sanity checks for missing "ident" and "cputype" directives moved into main(), alongside the existing check for "machine". PR: bin/90310 Submitted by: Matt Emmerton <matt@gsicomp.on.ca>
* Per letter dated July 22, 1999, delete clause 3 from code directlyimp2004-08-071-4/+0
| | | | from Berkeley.
* Whitespace nit.des2004-02-171-1/+1
|
* Convert to using <sys/queue.h> macros.ru2003-02-151-25/+23
|
* Allow maxusers to be specified as 0 in the kernel config, which willdillon2001-12-091-2/+1
| | | | | | | cause the system to auto-size to between 32 and 512 depending on the amount of memory. MFC after: 1 week
* Untangle some special magic that happened for conflicting defintions forpeter2001-02-281-7/+0
| | | | local files.* and options.* files on the third pass.
* Collect together a handful of copies of the option generator code into apeter2001-02-221-4/+4
| | | | | single newopt(char *name, char *value) function. Change newdev() to do the same thing rather than depending on the evil 'cur' device hack.
* ${BDECFLAGS} work. And fix a real error in the process. A "MAXUSERS"peter2001-02-191-2/+3
| | | | | string could have been passed to free(); There are some warnings here I am not sure how to fix as they are in the lex scanner code, etc.
* Remove the need to list each and every cpu platform. Config will nowpeter2001-02-041-22/+8
| | | | take your word for the 'machine' switch.
* Redo the stray header file cleanup code to not depend on timestampspeter2001-01-311-0/+1
| | | | | or access times or anything. Just bite the bullet and keep a list of header files that we know about.
* Add support for configuring PowerPC kernels.benno2001-01-221-0/+1
| | | | Reviewed by: peter
* Implement option strings that we can use in #ifdefs (where unavoidable)peter2001-01-191-1/+1
| | | | | | | | as a replacement for the evil #define NFOO. If 'device npx' is in the static kernel, a synthetic option '#define DEV_NPX 1' will be available to stick in an opt_xxx.h file. "#if NNPX > 0" can be replaced with "#ifdef DEV_NPX" and we can get rid of the overloaded meaning of the device count mechanism.
* Fix buffer overflows in filenames. If you had a path > 80 charactersimp2000-11-211-9/+10
| | | | | | | | | | for your /usr/obj/path/to/my/files path to the kernel, then weird things happened. make buildkernel would fail because config was dumping core or generating bad file names (depending on the lenght of the path). While I was here, also use strlcpy, strlcat and snprintf (or asprintf) as necessary. Minor format policing for the snprintf calls as well.
* Add ia64 support.dfr2000-09-291-0/+1
|
* Borrow phk's axe and apply the next stage of config(8)'s evolution.peter2000-06-131-14/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use Warner Losh's "hint" driver to decode ascii strings to fill the resource table at boot time. config(8) no longer generates an ioconf.c table - ie: the configuration no longer has to be compiled into the kernel. You can reconfigure your isa devices with the likes of this at loader(8) time: set hint.ed.0.port=0x320 userconfig will be rewritten to use this style interface one day and will move to /boot/userconfig.4th or something like that. It is still possible to statically compile in a set of hints into a kernel if you do not wish to use loader(8). See the "hints" directive in GENERIC as an example. All device wiring has been moved out of config(8). There is a set of helper scripts (see i386/conf/gethints.pl, and the same for alpha and pc98) that extract the 'at isa? port foo irq bar' from the old files and produces a hints file. If you install this file as /boot/device.hints (and update /boot/defaults/loader.conf - You can do a build/install in sys/boot) then loader will load it automatically for you. You can also compile in the hints directly with: hints "device.hints" as well. There are a few things that I'm not too happy with yet. Under this scheme, things like LINT would no longer be useful as "documentation" of settings. I have renamed this file to 'NOTES' and stored the example hints strings in it. However... this is not something that config(8) understands, so there is a script that extracts the build-specific data from the documentation file (NOTES) to produce a LINT that can be config'ed and built. A stack of man4 pages will need updating. :-/ Also, since there is no longer a difference between 'device' and 'pseudo-device' I collapsed the two together, and the resulting 'device' takes a 'number of units' for devices that still have it statically allocated. eg: 'device fe 4' will compile the fe driver with NFE set to 4. You can then set hints for 4 units (0 - 3). Also note that 'device fe0' will be interpreted as "zero units of 'fe'" which would be bad, so there is a config warning for this. This is only needed for old drivers that still have static limits on numbers of units. All the statically limited drivers that I could find were marked. Please exercise EXTREME CAUTION when transitioning! Moral support by: phk, msmith, dfr, asmodai, imp, and others
* A checkpoint of a part of a work-in-progress. Some more cleanups forpeter2000-06-101-0/+7
| | | | | | | | config(8). This commit allows control of the creation of the #include "foo.h" files. We now only create them explicitly when needed. BTW; these are mostly bad because they usually imply static limits on numbers of units for devices. eg: struct mysoftc sc[NFOO]; These static limits have Got To Go.
* Remove even known options if they are in the wrong options header. Thisbde2000-01-091-1/+11
| | | | fixes movement of options. Stale copies were left behind.
* Support getting *.$MACHINE from sys/conf as well as sys/$MACHINE/conf.peter2000-01-081-6/+10
| | | | | | | | | | | | This would mean that we could move files.alpha, files.i386, files.pc98 etc all next to conf/files, and the various Makefiles next to each other. This should go a long way towards committers "seeing" the Alpha etc stuff and remembering to update that too as it would be right next to the i386 config files. Note this does not include the GENERIC etc files as they can't be shared. I haven't actually moved the files, but the support is here for it. It still supports the per-machine conf directories so that folks working on a new arch can just distribute a subdir of files.
* Fixed removal of unknown options. For options files with only a singlebde2000-01-081-1/+1
| | | | | | | known option, unknown options following the known option were not removed. Now I think only unknown options in unknown options files are not removed. This is harmless because unknown options files should not be used, but removing the files would be cleaner.
* Further cleanup. Also remove the following unused or defunct tokens:peter1999-10-101-8/+3
| | | | and, bio, cam, master, minor, net, priority, sequential, size, slave, trace
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Detect and remove defunct or unknown options from opt_*.h files. Thispeter1999-07-011-11/+23
| | | | can happen when options are removed from the options files.
* More cleanups, tweaks and features.peter1999-04-241-2/+2
| | | | | | | | | | - make this work: options FOO123=456 *without quotes* - grumble (but accept) vector xxxintr, and tty/net/bio/cam flags. - complain if a device is specified twice (eg: 2 x psm0) - don't require quotes around: port IO_COM2 - recognize negative numbers. (ie: options CAM_DEBUG_UNIT=-1) - GC some more unused stuff (we don't have composite disks from config(8)). - various other nits (snprintf paranoia etc)
* Further cleanups. i386_ioconf.c and alpha_ioconf.c were essentially thepeter1999-04-181-2/+2
| | | | | same and were merged into a single newbus_ioconf.c. CG'd some more unused code.
* Get out the blow torch and hack away all the unused stuff. Note thatpeter1999-04-171-17/+11
| | | | | | I zapped the MACHINE_MIPS stuff, it isn't likely to be useful apart from recognition of the machine name. It would be reasonable to expect new ports would look something like the alpha/i386 from a config perspective.
* Convert the maxusers directive to a normal MAXUSERS option (normallybde1998-07-121-8/+50
| | | | | | | | | | define MAXUSERS in opt_param.h as directed in /sys/conf/options; if it's not mentioned there, then define it in IDENT; never define it in PARAM). MAXUSERS probably should be a completely normal option. Don't define PARAM now that it is empty. Cleaned up similar conversion of cpu directives to XXX_CPU options.
* Warn about redefined options. Keep using the last value processed.bde1998-07-121-2/+8
| | | | | | Options are processed reverse file order, so the first definition in the config file wins (except for directives that are converted to option).
* Use err(3), add usage(). -Wall clean.charnier1997-09-151-10/+15
|
* Part #2 of the config cleanup. More aggressive, replaced an NIHjoerg1996-12-141-3/+7
| | | | | | | | | | version of strdup() by a macro, killed many calls to strdup(), thus potentially wasting less malloc'ed space (their args were never be free()ed desptie despite of being malloc'ed). Probably still a huge memory leak at all... Also killed two totally useless variables. I've tested it as i could, but wouldn't be surprised if unexpected problems showed up. So watch out this space!
* Round #1 of cleaning up the config(8) mess. This is only the morejoerg1996-12-141-7/+5
| | | | | | | conservative part of the tidyup, like fixing potential buffer overflow conditions. It is believed to be safe to go into 2.2. Pointed out by: lozenko@cc.acnit.ac.ru (Evgeny A. Lozenko)
* Backout yacc changes.phk1996-06-021-1/+1
|
* yacc rule changes.phk1996-05-301-1/+1
|
* Implement support for conf/options and i386/conf/options.i386peter1995-12-111-0/+316
Note that this code is dormant unless the options files exist. Also, parsing of quoted options in the config files is improved. What this allows, is all the options in LINT to be specified to be configured as #defines in a file rather than on the CC command line at kernel build time. This means that 'make depend' will catch dependencies on actual *options*, meaning that you can run 'config' and 'make depend' in complete safety WITHOUT removing the compile directory each time. Unfortunately, this requires a pass over the source to get the individual files to #include the new .h files that would be generated by config. This has a small compile time penalty (appears up to about 2% slower) from a "fresh" build. Of course, you should not be needing to do complete rebuilds very often once this was completed, so it would be an overall win for most people. Since this code is dormant and we've got a lot of other things happening on the kernel tree at the moment (prototypes, devfs, static declarations etc) I am not planning on doing any changes to activate this feature just yet.
OpenPOWER on IntegriCloud