summaryrefslogtreecommitdiffstats
path: root/usr.sbin/config/main.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix a bug introduced by DEFAULTS feature. When the config fileimp2008-04-101-0/+2
| | | | | | | doesn't exist, we make a directory and then say "oops, that file isn't there" leaving the directory behind. Add a stat for the config file so that we detect this before making the directory. This is semi-lame, but less lame than having this bug.
* Honour the logical current working directory ($PWD) when using config'semaste2008-01-081-0/+18
| | | | | | | | -d destdir option. For an automounted src tree using the logical cwd in the Makefile keeps amd(8)'s mount timeout refreshed. Code to check $PWD's validity cribbed from pwd(1). Discussed on hackers@.
* Fix some problems that affect multiple file inclusion. Bruce foundimp2007-05-171-9/+8
| | | | | | | | | | | | | | 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@
* This is loser's commit message:wkoszek2007-05-121-1/+12
| | | | | | | | | | | Remember about tricky cases, where options contain unfriendly characters, from the ANSI-C string point of view ('"' in this case). The x09 build breakage was caused by SC_CUT_SEPCHARS options. I did test this patch number of times; each time unprofessionally and inappropriately. OKed by: cognet (mentor)
* Improve INCLUDE_CONFIG_FILE support.wkoszek2007-05-121-46/+203
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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@
* End my resistance to jmg's multiple hints files and bring in supportimp2006-10-241-0/+1
| | | | | for having multiple hints files generate a correct hints.c (eg, with all the specified ones catenated together).
* Use calloc() instead of zeroing the memory our own.delphij2006-06-071-2/+1
|
* - Change the exit message from "make cleandepend; make depend" toflz2006-01-141-1/+1
| | | | | | | | | "make cleandepend && make depend". PR: bin/91765 Submitted by: Soeren Straarup <xride@x12.dk> Approved by: cpercival MFC after: 3 days
* Clean up most of the "XXX"-tagged items:ru2005-12-301-0/+15
| | | | | | | | | | | - 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>
* Style: use S_ISDIR() (submitted by bde@) and eq() where appropriate.ru2005-11-301-4/+3
|
* The DEFAULTS changes caused the user specified config file to be openedpeter2005-11-291-0/+5
| | | | | | | | | | | | | | | much later than before, and it is now after we do a mkdir ../compile/FILE. As a result, if you do 'config DOESNOTEXIST', it now creates the directory ../config/DOESNOTEXIST. It did not do that before. If DEFAULTS does not exist, it still fails early before any permanent changes. This shameless hack restores the old behavior of ensuring the config file actually exists before mkdiring its counterpart directory. Now I can rmdir ../compile/D and it will stay dead, after my fingers keep sabotaging me with 'config D<tab><enter>'. (Some of my kernel names started with D, which used to be 1-character unique and my fingers knew this very well...)
* Optionally include a DEFAULTS config file if it is present in the currentjhb2005-10-271-3/+10
| | | | | | | | | | | | | 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
* Put rev. 1.65 into usage().obrien2005-08-111-1/+1
|
* Add an option to tell what version of config(8) this is.obrien2005-08-101-1/+5
|
* Ask that "make cleandepend" be run before "make depend", now thatru2005-04-221-1/+1
| | | | | | we don't do this automatically. Suggested by: bde
* Allow one to specify a second parameter to the machine line. Thisimp2005-04-011-0/+14
| | | | | | | | | | | 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@
* style(9) nitsimp2005-03-301-2/+3
|
* Unstaticize config. It was being optimized away.des2005-03-271-1/+1
| | | | MFC after: 3 days
* Per letter dated July 22, 1999, delete clause 3 from code directlyimp2004-08-071-4/+0
| | | | from Berkeley.
* Add a new "files" directive, which allows to include a files.foo file directlycognet2004-05-091-0/+2
| | | | | from a kernel config file. Bump config version to reflect this change.
* Check the return values of opendir() and unlink() in cleanheaders().tmm2003-06-121-2/+4
| | | | If unlink() fails, just print a warning for now.
* Convert to using <sys/queue.h> macros.ru2003-02-151-2/+3
|
* We don't need to hit the user over the head so strong now that we'veobrien2002-07-061-1/+0
| | | | | | fixed all the known warnings suffiently to not require NO_WERROR. Ok'ed by: peter
* Add a hint about -DNO_WERRORpeter2002-02-251-0/+1
|
* Remove the old machine symlink first.peter2001-07-141-3/+2
|
* Introduce an "include" directive. It takes one argument, a filenamedd2001-07-121-0/+1
| | | | | | | | | | | | | | to be included into this one. This works the same way as #include does in C; as far as the user is concerned, the included file is inlined into the current one. Since config(8) is no longer limited to working on one user-supplied file, printing just a line number in an error message is not sufficient. The new global variable yyfile represents the file currently being parsed, and must be printed as well. Reviewed by: imp Obtained from: OpenBSD
* Move kernel compile directory from sys/compile/FOO toimp2001-06-301-3/+2
| | | | | | sys/compile/${MACHINE}/FOO. Reviewed by: obrien, peter and the USENIX terminal room secret kernel cabal
* Move the 'dont forget "make depend"' to be the last thing that people see,peter2001-02-231-0/+1
| | | | after the warnings.
* ${BDECFLAGS} work. And fix a real error in the process. A "MAXUSERS"peter2001-02-191-5/+4
| | | | | 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-10/+1
| | | | take your word for the 'machine' switch.
* Redo the stray header file cleanup code to not depend on timestampspeter2001-01-311-27/+44
| | | | | or access times or anything. Just bite the bullet and keep a list of header files that we know about.
* AARGH! This does not mix too well with the -o noatime mount option.peter2001-01-291-1/+6
| | | | :-(
* I confess. This is a truely nasty hack. I am so ashamed!peter2001-01-291-0/+57
| | | | | | | | (I think config(8) source does bad things to your brain :-) Clean up likely stray *.h files in the build directory. Eg: if isa.h ceases being generated, zap it. The heuristics to figure out a 'likely' file are pretty revolting.
* Add support for configuring PowerPC kernels.benno2001-01-221-0/+1
| | | | Reviewed by: peter
* Clean up some obsolete stuff. config -r has not been needed since aroundpeter2001-01-221-27/+3
| | | | | | FreeBSD 3.x or so when the 'make depend' picked up the opt_foo.h files. Convert warnings into actual errors in the hope that buildkernel users will pay more attention. :-(
* Try and stop config(8) from freaking out due to unnecessary paranoiapeter2001-01-041-13/+2
| | | | | | | when using -d. Use realpath(3) to locate the top of the tree rather than trying to manually trim back the results of a getcwd(). Requested by: alfred
* Fix buffer overflows in filenames. If you had a path > 80 charactersimp2000-11-211-11/+9
| | | | | | | | | | 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-22/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-3/+0
| | | | | | | | 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.
* Add option "-d destdir" which instructs config to use another outputmarcel1999-10-301-11/+59
| | | | | | | | | | | | | | | | directory than the default one. If the option is not given, then the output of config is exactly as before. Only when an alternate output directory has been specified will config modify its behavior. Additional changed: o Remove the now conflicting and unused NODEV define. It conflicts with NODEV in sys/param.h. o Rename the now conflicting MACHINE token to ARCH. It conflicts with MACHINE in sys/param.h. o Fix some easy style bugs. o Fix some easy grammar bugs in the manpage. Approved by: peter, archie
* Further cleanup. Also remove the following unused or defunct tokens:peter1999-10-101-27/+18
| | | | and, bio, cam, master, minor, net, priority, sequential, size, slave, trace
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Put on my viking helmet from the closet, and get out the war axe andpeter1999-05-091-26/+1
| | | | "retire" some more stuff.
* config(8) lobotomy, please see commit msg in sys.phk1999-05-091-4/+24
| | | | (I have no idea why cvs didn't take these changes before.)
* 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-8/+7
| | | | | 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-31/+8
| | | | | | 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.
* Back out default debug kernel. The flags revert to historical behaviour.grog1999-04-111-18/+4
| | | | | | | | | | | | | | | Requested-by: ache bde dg Modify targets for debug kernels: when -g was specified, make will now build a debug kernel called kernel.debug, and create a stripped version called kernel at the same time. The two targets install and install.debug are otherwise unchanged. Requested-by: dillon Update man page accordingly.
* add -s to usageache1999-04-101-2/+2
| | | | | PR: 11056 Submitted by: Nickolay N. Dudorov <nnd@mail.nsk.ru>
OpenPOWER on IntegriCloud