aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/config/config.y
Commit message (Collapse)AuthorAgeFilesLines
* Allow additional "options" files to be specified in kernel configStephen J. Kiernan2024-09-181-0/+22
| | | | | | | | | | | | | | | The "includeoptions" directive can be used to specify an additional options file to be used. This is useful in conjunction with the "files" directive for build environments to be able to add custom files and options. Add "-v" flag to enable verbose mode. Added some additional error messages when in verbose mode. Obtained from: Juniper Networks, Inc. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D39540
* config: Remove redundant codeWarner Losh2024-06-061-2/+0
| | | | | | | since errx is marked dead2, we don't need this. Noticed by: jrtc27 Sponsored by: Netflix
* Use correct function declaration for yyerrorDapeng Gao2024-06-031-2/+4
| | | | | | | | | According to the POSIX standard at https://pubs.opengroup.org/onlinepubs/9699919799/utilities/yacc.html `yyerror` should return `int`. Add unreachable since errx never returns. Reviewed by: imp, kib Differential Revision: https://reviews.freebsd.org/D45447
* usr.sbin: Remove ancient SCCS tags.Warner Losh2023-11-271-2/+0
| | | | | | | | Remove ancient SCCS tags from the tree, automated scripting, with two minor fixup to keep things compiling. All the common forms in the tree were removed with a perl script. Sponsored by: Netflix
* Remove $FreeBSD$: one-line .h patternWarner Losh2023-08-161-1/+0
| | | | Remove /^\s*\*+\s*\$FreeBSD\$.*$\n/
* config: drop reference to removed System_specKyle Evans2023-02-241-2/+0
| | | | | | | | | | Fixes the following warning: yacc: w - the symbol System_spec is undefined yacc: 3 rules never reduced Reported by: otis Fixes: 6a836ea741c7 ("config(8): Remove obsolete 'config' directive.")
* config(8): Remove obsolete 'config' directive.Warner Losh2021-06-171-9/+0
| | | | | | | | | The "config" line in config files has been obsolete since FreeBSD 4.x when we moved to having the boot loader pass in the root device. Remove it. MFC After: 1 week Sponsored by: Netflix
* config(8): remove support for -pKonstantin Belousov2021-04-021-2/+0
| | | | | | | | | and other equivalent ways to request mcount-based profiling, like 'profile N' in kernel config. Reviewed by: jhb Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D29529
* Relax machine directives a little.Warner Losh2020-02-231-2/+5
| | | | | | | | | Currently, you can have multiple machine directives if they are otherwise identical. Relax this so that only the machinename part is the same. This allows one to change the machine arch in a different config file you've included easily. Notes: svn path=/head/; revision=358265
* config: Only warn if duplicate option/device comes from the same fileEmmanuel Vadot2019-04-161-6/+13
| | | | | | | | | | | | | | | | | | | | | | This is useful for arm (possibly other arches too) where we want to have a GENERIC kernel that only include files for the different SoC. Since multiple SoCs/Board needs the same device we would need to do either : Include the device in a generic file Include the device in each file that really needs it Option 1 works but if someone wants to create a specific kernel config (which isn't uncommon for embedded system), he will need to add a lots of nodevice to it. Option 2 also works but produce a lots of warnings. Reviewed by: kevans MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D19424 Notes: svn path=/head/; revision=346298
* config(8): Remove all instances of an option when opting outKyle Evans2018-12-221-2/+1
| | | | | | | | | | | | Quick follow-up to r342362: options can appear multiple times now, so clean up all of them as needed. For non-OPTIONS options, this has no effect since they're already de-duplicated. MFC after: 1 week X-MFC-With: r342362 Notes: svn path=/head/; revision=342363
* config(8): Allow duplicate options to be specifiedKyle Evans2018-12-221-14/+20
| | | | | | | | | | | | | | | | | | | | | | | | | config(8)'s option handling has been written to allow duplicate options; if the value changes, then the latest value is used and an informative message is printed to stderr like so: /usr/src/sys/amd64/conf/TEST: option "VERBOSE_SYSINIT" redefined from 0 to 1 Currently, this is only a possibility for cpu types, MAXUSERS, and MACHINE_ARCH. Anything else duplicated in a config file will use the first value set and error about duplicated options on subsequent appearances, which is arguably unfriendly since one could specify: include GENERIC nooptions VERBOSE_SYSINIT options VERBOSE_SYSINIT to redefine the value later anyways. Reported by: mmacy MFC after: 1 week Notes: svn path=/head/; revision=342362
* kern_environment: use any provided environments, evict hintmode/envmodeKyle Evans2018-07-051-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At the moment, hintmode and envmode are used to indicate whether static hints or static env have been provided in the kernel config(5) and the static versions are mutually exclusive with loader(8)-provided environment. hintmode *can* be reconfigured later to pull from the dynamic environment, thus taking advantage of the loader(8) or post-kmem environment setting. This changeset fixes both problems at once to move us from a semi-confusing state to a consistent state: if an environment file, hints file, or loader(8) environment are provided, we use them in a well-known order of precedence: - loader(8) environment - static environment - static hints file Once the dynamic environment is setup this becomes a moot point. The loader(8) and static environments are merged (respecting the above order of precedence), and the static hints are merged in on an as-needed basis after the dynamic environment has been setup. Hints lookup are changed to respect all of the above. Before the dynamic environment is setup, lookups use the above-mentioned order and fallback to the next environment if a matching hint is not found. Once the dynamic environment is setup, that is used on its own since it captures all of the above information plus any dynamic kenv settings that came up later in boot. The following tangentially related changes were made to res_find: - A hintp cookie is now passed in so that related searches continue using the chain of environments (or dynamic environment) without relying on global state - All three environments will be searched if they actually have valid hints to use, rather than just choosing the first environment that actually had a hint and rolling with that only The hintmode sysctl has been ripped out. static_{env,hints}.disabled are still honored and will disable their respective environments from being used for hint lookups and from being merged into the dynamic environment, as expected. MFC after: 1 month (maybe) Differential Revision: https://reviews.freebsd.org/D15953 Notes: svn path=/head/; revision=335998
* Revert r335995 due to accidental changes snuck inKyle Evans2018-07-051-1/+4
| | | | Notes: svn path=/head/; revision=335997
* kern_environment: use any provided environments, evict hintmode/envmodeKyle Evans2018-07-051-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At the moment, hintmode and envmode are used to indicate whether static hints or static env have been provided in the kernel config(5) and the static versions are mutually exclusive with loader(8)-provided environment. hintmode *can* be reconfigured later to pull from the dynamic environment, thus taking advantage of the loader(8) or post-kmem environment setting. This changeset fixes both problems at once to move us from a semi-confusing state to a consistent state: if an environment file, hints file, or loader(8) environment are provided, we use them in a well-known order of precedence: - loader(8) environment - static environment - static hints file Once the dynamic environment is setup this becomes a moot point. The loader(8) and static environments are merged (respecting the above order of precedence), and the static hints are merged in on an as-needed basis after the dynamic environment has been setup. Hints lookup are changed to respect all of the above. Before the dynamic environment is setup, lookups use the above-mentioned order and fallback to the next environment if a matching hint is not found. Once the dynamic environment is setup, that is used on its own since it captures all of the above information plus any dynamic kenv settings that came up later in boot. The following tangentially related changes were made to res_find: - A hintp cookie is now passed in so that related searches continue using the chain of environments (or dynamic environment) without relying on global state - All three environments will be searched if they actually have valid hints to use, rather than just choosing the first environment that actually had a hint and rolling with that only The hintmode sysctl has been ripped out. static_{env,hints}.disabled are still honored and will disable their respective environments from being used for hint lookups and from being merged into the dynamic environment, as expected. MFC after: 1 month (maybe) Differential Revision: https://reviews.freebsd.org/D15953 Notes: svn path=/head/; revision=335995
* config(8): Flip the order of concatenation for `hints` and `env`Kyle Evans2018-06-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | As previously noted, kernel's processing of these means that the first appearance of a hint/variable wins. Flipping the order of concatenation means that later variables override earlier variables, as expected when one does: hints x hints y Where perhaps x is: hint.aw_sid.0.disable=1 and y is: hint.aw_sid.0.disable=0 The expectation would be that a later appearing variable would override an earlier appearing variable, such as with `device`/`nodevice`, device.hints, and other similarly structured data files. Notes: svn path=/head/; revision=335653
* config(8): Make 'env' files consistent with other file-accepting optionsKyle Evans2018-06-261-16/+18
| | | | | | | | | | | | | | | | | | | | | | | | | Previously, only one 'env' file could be specified. Later 'env' directives would overwrite earlier 'env' directives. This is inconsistent with every other file-accepting directives which process files in order, including hints. A caveat applies to both hints and env that isn't mentioned: they're concatenated in the order of appearance, so they're not actually applied in the way one might think by supplying: hints x hints y Hints in x will take precedence over same-name hints in y due to how the kernel processes them, stopping at the first line that matches the hint we're searching for. Future work will flip the order of concatenation so that later files may still properly override earlier files. In practice, this likely doesn't matter at all due to the nature of the beast. Notes: svn path=/head/; revision=335652
* config(8): Set envmode if we accept an envvarKyle Evans2018-06-261-0/+1
| | | | | | | X-MFC-With: r335642 Notes: svn path=/head/; revision=335651
* config(8): Add `envvar` supportKyle Evans2018-06-251-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | envvar allows adding individual environment variables to the kernel's static environment without the overhead of pulling in a full file. envvar in a config looks like: envvar some_var=5 All envvar-provided variables will be added after the env file is processed, so envvar keys that exist in the previous env will be overwritten by whatever value is set here in the kernel configuration directly. As an aside, envvar lines are intentionally tokenized differently from basically every other line. We used a named state when ENVVAR is encountered to gobble up the rest of the line, which will later be cleaned and validated in post-processing by sanitize_envline. This turns out to be the simplest and cleanest way to allow the flexibility that kenv does while not compromising on silly hacks. Reviewed by: ian (also contributor of sanitize_envline rewrite) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D15962 Notes: svn path=/head/; revision=335642
* General further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-201-1/+3
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 3-Clause license. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326025
* Renumber copyright clause 4Warner Losh2017-02-281-1/+1
| | | | | | | | | | | | Renumber cluase 4 to 3, per what everybody else did when BSD granted them permission to remove clause 3. My insistance on keeping the same numbering for legal reasons is too pedantic, so give up on that point. Submitted by: Jan Schaumann <jschauma@stevens.edu> Pull Request: https://github.com/freebsd/freebsd/pull/96 Notes: svn path=/head/; revision=314436
* Allow lists for "nooption" and "nooptions" keywords.Will Andrews2015-01-231-1/+11
| | | | | | | | | | | | | | | | | | | usr.sbin/config/config.y According to config(5), the "device", "devices", "nodevice", "nodevices", "option", "options", "nooption", and "nooptions" keywords can all take a comma-separated list of values. However, the yacc code did not allow lists for "nooption" and "nooptions", only single values. This commit fixes the yacc code to allow comma separated values for all the above keywords. Submitted by: asomers MFC after: 1 week Sponsored by: Spectra Logic MFSpectraBSD: 1095296 on 2014/10/07 Notes: svn path=/head/; revision=277567
* Remove the advertising clause from UCB copyrighted files in usr.sbin. ThisJoel Dahl2010-12-111-4/+0
| | | | | | | | is in accordance with the information provided at ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change Notes: svn path=/head/; revision=216372
* Allow a kernel config to specify a set but empty value viaEd Maste2010-09-131-0/+1
| | | | | | | | | | | 'makeoptions OPTION=' for consistency with the make commandline. Previously 'makeoptions WERROR=' would result in a syntax error; now it produces the same effect as 'makeoptions WERROR'. Both forms now result in 'WERROR=' in the generated Makefile. Notes: svn path=/head/; revision=212570
* Put warnings out to stderr rather than stdout.Warner Losh2010-07-151-2/+4
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=210144
* - Handle calloc() allocation failures.Ruslan Ermilov2010-03-301-0/+10
| | | | | | | | | | | | - Fixed a comment. - 2 -> EXIT_FAILURE in some places. - errx() -> err() where appropriate. PR: 144644 Submitted by: Garrett Cooper Notes: svn path=/head/; revision=205880
* Allow multiple makeoption lines to be used with the += operator, this permitsAndrew Thompson2008-11-221-11/+19
| | | | | | | | | | | | | the following syntax in the kernel config. makeoptions MODULES_OVERRIDE=foo makeoptions MODULES_OVERRIDE+=bar makeoptions MODULES_OVERRIDE+=baz Bump config minor version to 600007. Notes: svn path=/head/; revision=185186
* Allow kernel config files to include files other than those in the CWD,David E. O'Brien2008-07-281-0/+6
| | | | | | | using unquoted paths. Notes: svn path=/head/; revision=180922
* Spring forward into the late 1970's by following item 5 in the yaccWarner Losh2007-12-251-51/+34
| | | | | | | | | | | | | | | | manual's Appendix D ("Old Features Supported but not Encouraged") in the Seventh Edition Unix Programmer's Manual (January, 1979) by retiring the " = {" method of of action specification in favor of a plain "{". It is no longer necessary for this bootstrap program to be compatible with 6th Edition systems. Some yaccs in the wild do not support this old syntax any more, and compatibility with those systems is more important these days (as there are easily 7 orders of magnitude more of them than real v6 systems today). Reviewed by: jhb@ and dds@ (the latter gave the reference). Notes: svn path=/head/; revision=174892
* Fix some problems that affect multiple file inclusion. Bruce foundWarner Losh2007-05-171-63/+17
| | | | | | | | | | | | | | | | | this bug and submitted these patches to dunstan@. He sent them to me to test, and I discovered they were needed for the atmel kernel config files. Since we were playing with them in the terminal room after the developer's summit today, I thought I'd go ahead and commit them to allow those folks that now have atmel hardware (thanks Andre) a chance to try it out w/o my help. Since dunstan@ is asleep right now, risk stepping on his toes a little by going ahead and committing this change. Submitted by: dunstan@, bde@ Tested by: bde@ Notes: svn path=/head/; revision=169647
* Improve INCLUDE_CONFIG_FILE support.Wojciech A. Koszek2007-05-121-27/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change will let us to have full configuration of a running kernel available in sysctl: sysctl -b kern.conftxt The same configuration is also contained within the kernel image. It can be obtained with: config -x <kernelfile> Current functionality lets you to quickly recover kernel configuration, by simply redirecting output from commands presented above and starting kernel build procedure. "include" statements are also honored, which means options and devices from included files are also included. Please note that comments from configuration files are not preserved by default. In order to preserve them, you can use -C flag for config(8). This will bring configuration file and included files literally; however, redirection to a file no longer works directly. This commit was followed by discussion, that took place on freebsd-current@. For more details, look here: http://lists.freebsd.org/pipermail/freebsd-current/2007-March/069994.html http://lists.freebsd.org/pipermail/freebsd-current/2007-May/071844.html Development of this patch took place in Perforce, hierarchy: //depot/user/wkoszek/wkoszek_kconftxt/ Support from: freebsd-current@ (links above) Reviewed by: imp@ Approved by: imp@ Notes: svn path=/head/; revision=169507
* End my resistance to jmg's multiple hints files and bring in supportWarner Losh2006-10-241-5/+5
| | | | | | | | for having multiple hints files generate a correct hints.c (eg, with all the specified ones catenated together). Notes: svn path=/head/; revision=163638
* style(9) pedantryWarner Losh2006-10-241-7/+7
| | | | Notes: svn path=/head/; revision=163637
* Since multiple hints lines do not work, make doing that a fatal error.Warner Losh2006-10-241-0/+3
| | | | Notes: svn path=/head/; revision=163636
* Remove unused variables.Stefan Farfeleder2006-07-201-3/+1
| | | | Notes: svn path=/head/; revision=160522
* Use calloc() instead of zeroing the memory our own.Xin LI2006-06-071-8/+4
| | | | Notes: svn path=/head/; revision=159362
* - Avoid adding devices multiple times to the device list.Ruslan Ermilov2005-12-301-26/+62
| | | | | | | | | - Avoid adding options multiple times to the option list. Based on a patch by: Matt Emmerton <matt@gsicomp.on.ca> Notes: svn path=/head/; revision=153889
* - Allow duplicate "machine" directives with the same arguments.Ruslan Ermilov2005-11-271-2/+3
| | | | | | | - Move existing "machine" directives to DEFAULTS. Notes: svn path=/head/; revision=152865
* Use the eq() macro for comparing strings (style), and remove a "break"Ruslan Ermilov2005-11-031-5/+4
| | | | | | | statement to null the effect of several identical "cpu" directives. Notes: svn path=/head/; revision=152024
* Implement the "nocpu" directive.Ruslan Ermilov2005-11-031-0/+12
| | | | | | | Requested by: rwatson Notes: svn path=/head/; revision=152018
* Optionally include a DEFAULTS config file if it is present in the currentJohn Baldwin2005-10-271-0/+16
| | | | | | | | | | | | | | | | directory before the specified config file. This is implemented by opening DEFAULTS as stdin if it exists, and if so resetting stdin to the actual config file when DEFAULTS is fully parsed via yywrap(). In short, this lets us create DEFAULTS kernel configs in /sys/<arch>/conf that can enable certain options or devices by default and allow users to disable them via 'nooptions' or 'nodevice' rather than having to create kludge NO_FOO options. Requested by: scottl Reviewed by: scottl Notes: svn path=/head/; revision=151744
* Allow one to specify a second parameter to the machine line. ThisWarner Losh2005-04-011-0/+9
| | | | | | | | | | | | | | allows us to specify the machine_arch as well as machine. If specified then a second link will be made, similar to machine, from $MACHINE_ARCH to $S/$MACHINE_ARCH/include. This is for ports where MACHINE != MACHINE_ARCH (pc98 today, others in the future?). Reviewed by: arch@, nyan@ Notes: svn path=/head/; revision=144509
* Allow multiple devices to be specified on one device / nodevice line.Dag-Erling Smørgrav2004-10-241-7/+27
| | | | | | | | | Also allow "device" / "nodevice" to be spelled "devices" / "nodevices". MFC after: 2 weeks Notes: svn path=/head/; revision=136880
* Kill count device support from config. I've changed the last fewPeter Wemm2004-08-301-12/+2
| | | | | | | | | | | | | | | | | | | | remaining consumers to have the count passed as an option. This is i4b, pc98/wdc, and coda. Bump configvers.h from 500013 to 600000. Remove heuristics that tried to parse "device ed5" as 5 units of the ed device. This broke things like the snd_emu10k1 device, which required quotes to make it parse right. The no-longer-needed quotes have been removed from NOTES, GENERIC etc. eg, I've removed the quotes from: device snd_maestro device "snd_maestro3" device snd_mss I believe everything will still compile and work after this. Notes: svn path=/head/; revision=134542
* Add a new "files" directive, which allows to include a files.foo file directlyOlivier Houchard2004-05-091-0/+19
| | | | | | | | from a kernel config file. Bump config version to reflect this change. Notes: svn path=/head/; revision=129073
* Fixed spurious syntax errors for including files that don't begin withBruce Evans2003-11-141-3/+4
| | | | | | | | | | | | | a SEMICOLON token (a newline or semicolon, or one of these preceded by a comment and/or whitespace). The input stream was switched too early and the parser was expecting a SEMICOLON in the included file instead of after the filename in the include directive. Submitted by: Stefan Farfeleder <stefan@fafoe.narf.at> Kept alive by: Adam C. Migus <adam@migus.org> Notes: svn path=/head/; revision=122656
* Disallow multiple 'machine' directives in a kernel configurationJoseph Koshy2003-07-061-0/+3
| | | | | | | | | file. Reviewed by: ru, bde Notes: svn path=/head/; revision=117269
* Implemented "nooption" and "nomakeoption" config(8) tokens.Ruslan Ermilov2003-02-261-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed memory leak in the "nodevice" option implementation. Use these instead of sed(1) in MD NOTES. Use a single makefile (sys/conf/makeLINT.mk) to generate LINT for all architectures. (Previous versions missed the LINT dependency on Makefile, and i386 version also missed the dependency on ${NOTES}.) Fixed bugs in the previous NOTES conversion using the "nodevice" token and sed(1): - i386 LINT lost "device pst". - pc98 LINT lost SC_*, MAXCONS and KBD_DISABLE_KEYMAP_LOAD options, and got needless DPT_* options. - Added nooptions PPC_DEBUG, PPC_PROBE_CHIPSET, KBD_INSTALL_CDEV to sparc64 LINT so that it has a chance to config(8). This basically returns us to where we were before. Notes: svn path=/head/; revision=111582
* Allow for boolean make options (``makeoptions NO_MODULES'').Ruslan Ermilov2003-02-211-1/+4
| | | | | | | Fixed the potential bug in rmopt(). Notes: svn path=/head/; revision=111230
* Implemented a simple "nodevice" config(8) command that cancelsRuslan Ermilov2003-02-151-0/+47
| | | | | | | | | | the effect of the "device" command, and use it to generate the OLDCARD from GENERIC. Suggested by: bde Notes: svn path=/head/; revision=110897