History log of /freebsd-11-stable/usr.sbin/config/mkoptions.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 331722 29-Mar-2018 eadler

Revert r330897:

This was intended to be a non-functional change. It wasn't. The commit
message was thus wrong. In addition it broke arm, and merged crypto
related code.

Revert with prejudice.

This revert skips files touched in r316370 since that commit was since
MFCed. This revert also skips files that require $FreeBSD$ property
changes.

Thank you to those who helped me get out of this mess including but not
limited to gonzo, kevans, rgrimes.

Requested by: gjb (re)


# 330897 14-Mar-2018 eadler

Partial merge of the SPDX changes

These changes are incomplete but are making it difficult
to determine what other changes can/should be merged.

No objections from: pfg


# 302408 07-Jul-2016 gjb

Copy head@r302406 to stable/11 as part of the 11.0-RELEASE cycle.
Prune svn:mergeinfo from the new branch, as nothing has been merged
here.

Additional commits post-branch will follow.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


/freebsd-11-stable/MAINTAINERS
/freebsd-11-stable/cddl
/freebsd-11-stable/cddl/contrib/opensolaris
/freebsd-11-stable/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print
/freebsd-11-stable/cddl/contrib/opensolaris/cmd/zfs
/freebsd-11-stable/cddl/contrib/opensolaris/lib/libzfs
/freebsd-11-stable/contrib/amd
/freebsd-11-stable/contrib/apr
/freebsd-11-stable/contrib/apr-util
/freebsd-11-stable/contrib/atf
/freebsd-11-stable/contrib/binutils
/freebsd-11-stable/contrib/bmake
/freebsd-11-stable/contrib/byacc
/freebsd-11-stable/contrib/bzip2
/freebsd-11-stable/contrib/com_err
/freebsd-11-stable/contrib/compiler-rt
/freebsd-11-stable/contrib/dialog
/freebsd-11-stable/contrib/dma
/freebsd-11-stable/contrib/dtc
/freebsd-11-stable/contrib/ee
/freebsd-11-stable/contrib/elftoolchain
/freebsd-11-stable/contrib/elftoolchain/ar
/freebsd-11-stable/contrib/elftoolchain/brandelf
/freebsd-11-stable/contrib/elftoolchain/elfdump
/freebsd-11-stable/contrib/expat
/freebsd-11-stable/contrib/file
/freebsd-11-stable/contrib/gcc
/freebsd-11-stable/contrib/gcclibs/libgomp
/freebsd-11-stable/contrib/gdb
/freebsd-11-stable/contrib/gdtoa
/freebsd-11-stable/contrib/groff
/freebsd-11-stable/contrib/ipfilter
/freebsd-11-stable/contrib/ldns
/freebsd-11-stable/contrib/ldns-host
/freebsd-11-stable/contrib/less
/freebsd-11-stable/contrib/libarchive
/freebsd-11-stable/contrib/libarchive/cpio
/freebsd-11-stable/contrib/libarchive/libarchive
/freebsd-11-stable/contrib/libarchive/libarchive_fe
/freebsd-11-stable/contrib/libarchive/tar
/freebsd-11-stable/contrib/libc++
/freebsd-11-stable/contrib/libc-vis
/freebsd-11-stable/contrib/libcxxrt
/freebsd-11-stable/contrib/libexecinfo
/freebsd-11-stable/contrib/libpcap
/freebsd-11-stable/contrib/libstdc++
/freebsd-11-stable/contrib/libucl
/freebsd-11-stable/contrib/libxo
/freebsd-11-stable/contrib/llvm
/freebsd-11-stable/contrib/llvm/projects/libunwind
/freebsd-11-stable/contrib/llvm/tools/clang
/freebsd-11-stable/contrib/llvm/tools/lldb
/freebsd-11-stable/contrib/llvm/tools/llvm-dwarfdump
/freebsd-11-stable/contrib/llvm/tools/llvm-lto
/freebsd-11-stable/contrib/mdocml
/freebsd-11-stable/contrib/mtree
/freebsd-11-stable/contrib/ncurses
/freebsd-11-stable/contrib/netcat
/freebsd-11-stable/contrib/ntp
/freebsd-11-stable/contrib/nvi
/freebsd-11-stable/contrib/one-true-awk
/freebsd-11-stable/contrib/openbsm
/freebsd-11-stable/contrib/openpam
/freebsd-11-stable/contrib/openresolv
/freebsd-11-stable/contrib/pf
/freebsd-11-stable/contrib/sendmail
/freebsd-11-stable/contrib/serf
/freebsd-11-stable/contrib/sqlite3
/freebsd-11-stable/contrib/subversion
/freebsd-11-stable/contrib/tcpdump
/freebsd-11-stable/contrib/tcsh
/freebsd-11-stable/contrib/tnftp
/freebsd-11-stable/contrib/top
/freebsd-11-stable/contrib/top/install-sh
/freebsd-11-stable/contrib/tzcode/stdtime
/freebsd-11-stable/contrib/tzcode/zic
/freebsd-11-stable/contrib/tzdata
/freebsd-11-stable/contrib/unbound
/freebsd-11-stable/contrib/vis
/freebsd-11-stable/contrib/wpa
/freebsd-11-stable/contrib/xz
/freebsd-11-stable/crypto/heimdal
/freebsd-11-stable/crypto/openssh
/freebsd-11-stable/crypto/openssl
/freebsd-11-stable/gnu/lib
/freebsd-11-stable/gnu/usr.bin/binutils
/freebsd-11-stable/gnu/usr.bin/cc/cc_tools
/freebsd-11-stable/gnu/usr.bin/gdb
/freebsd-11-stable/lib/libc/locale/ascii.c
/freebsd-11-stable/sys/cddl/contrib/opensolaris
/freebsd-11-stable/sys/contrib/dev/acpica
/freebsd-11-stable/sys/contrib/ipfilter
/freebsd-11-stable/sys/contrib/libfdt
/freebsd-11-stable/sys/contrib/octeon-sdk
/freebsd-11-stable/sys/contrib/x86emu
/freebsd-11-stable/sys/contrib/xz-embedded
/freebsd-11-stable/usr.sbin/bhyve/atkbdc.h
/freebsd-11-stable/usr.sbin/bhyve/bhyvegc.c
/freebsd-11-stable/usr.sbin/bhyve/bhyvegc.h
/freebsd-11-stable/usr.sbin/bhyve/console.c
/freebsd-11-stable/usr.sbin/bhyve/console.h
/freebsd-11-stable/usr.sbin/bhyve/pci_fbuf.c
/freebsd-11-stable/usr.sbin/bhyve/pci_xhci.c
/freebsd-11-stable/usr.sbin/bhyve/pci_xhci.h
/freebsd-11-stable/usr.sbin/bhyve/ps2kbd.c
/freebsd-11-stable/usr.sbin/bhyve/ps2kbd.h
/freebsd-11-stable/usr.sbin/bhyve/ps2mouse.c
/freebsd-11-stable/usr.sbin/bhyve/ps2mouse.h
/freebsd-11-stable/usr.sbin/bhyve/rfb.c
/freebsd-11-stable/usr.sbin/bhyve/rfb.h
/freebsd-11-stable/usr.sbin/bhyve/sockstream.c
/freebsd-11-stable/usr.sbin/bhyve/sockstream.h
/freebsd-11-stable/usr.sbin/bhyve/usb_emul.c
/freebsd-11-stable/usr.sbin/bhyve/usb_emul.h
/freebsd-11-stable/usr.sbin/bhyve/usb_mouse.c
/freebsd-11-stable/usr.sbin/bhyve/vga.c
/freebsd-11-stable/usr.sbin/bhyve/vga.h
# 298687 27-Apr-2016 araujo

For pointers use NULL instead of 0.

Reviewed by: rpaulo
MFC after: 2 weeks.
Differential Revision: https://reviews.freebsd.org/D5946


# 211325 15-Aug-2010 imp

Turns out that it is a bad idea to have a missing compat option be a
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


# 210144 15-Jul-2010 imp

Put warnings out to stderr rather than stdout.

MFC after: 3 days


# 209969 13-Jul-2010 nwhitehorn

Enhance config to handle MACHINEs with multiple architectures:

- 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


# 207265 27-Apr-2010 imp

Require the option that's mapped be listed in the options file. This
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


# 207263 27-Apr-2010 imp

Redo how we add compat options so as to be compatible with old
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


# 206664 15-Apr-2010 imp

Allow option aliasing. Lines of the form:

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


# 205880 30-Mar-2010 ru

- Handle calloc() allocation failures.
- Fixed a comment.
- 2 -> EXIT_FAILURE in some places.
- errx() -> err() where appropriate.

PR: 144644
Submitted by: Garrett Cooper


# 159362 06-Jun-2006 delphij

Use calloc() instead of zeroing the memory our own.


# 153888 30-Dec-2005 ru

Clean up most of the "XXX"-tagged items:

- 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>


# 133248 07-Aug-2004 imp

Per letter dated July 22, 1999, delete clause 3 from code directly
from Berkeley.


# 125935 17-Feb-2004 des

Whitespace nit.


# 110895 15-Feb-2003 ru

Convert to using <sys/queue.h> macros.


# 87546 08-Dec-2001 dillon

Allow maxusers to be specified as 0 in the kernel config, which will
cause the system to auto-size to between 32 and 512 depending on the
amount of memory.

MFC after: 1 week


# 73198 28-Feb-2001 peter

Untangle some special magic that happened for conflicting defintions for
local files.* and options.* files on the third pass.


# 72841 22-Feb-2001 peter

Collect together a handful of copies of the option generator code into a
single newopt(char *name, char *value) function. Change newdev() to
do the same thing rather than depending on the evil 'cur' device hack.


# 72684 19-Feb-2001 peter

${BDECFLAGS} work. And fix a real error in the process. A "MAXUSERS"
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.


# 72000 04-Feb-2001 peter

Remove the need to list each and every cpu platform. Config will now
take your word for the 'machine' switch.


# 71866 31-Jan-2001 peter

Redo the stray header file cleanup code to not depend on timestamps
or access times or anything. Just bite the bullet and keep a list of
header files that we know about.


# 71374 22-Jan-2001 benno

Add support for configuring PowerPC kernels.

Reviewed by: peter


# 71251 19-Jan-2001 peter

Implement option strings that we can use in #ifdefs (where unavoidable)
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.


# 69004 21-Nov-2000 imp

Fix buffer overflows in filenames. If you had a path > 80 characters
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.


# 66457 29-Sep-2000 dfr

Add ia64 support.


# 61640 13-Jun-2000 peter

Borrow phk's axe and apply the next stage of config(8)'s evolution.

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


# 61523 10-Jun-2000 peter

A checkpoint of a part of a work-in-progress. Some more cleanups for
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.


# 55659 09-Jan-2000 bde

Remove even known options if they are in the wrong options header. This
fixes movement of options. Stale copies were left behind.


# 55614 08-Jan-2000 peter

Support getting *.$MACHINE from sys/conf as well as sys/$MACHINE/conf.
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.


# 55603 08-Jan-2000 bde

Fixed removal of unknown options. For options files with only a single
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.


# 52098 10-Oct-1999 peter

Further cleanup. Also remove the following unused or defunct tokens:
and, bio, cam, master, minor, net, priority, sequential, size, slave, trace


# 50479 27-Aug-1999 peter

$Id$ -> $FreeBSD$


# 48401 01-Jul-1999 peter

Detect and remove defunct or unknown options from opt_*.h files. This
can happen when options are removed from the options files.


# 46021 24-Apr-1999 peter

More cleanups, tweaks and features.
- 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)


# 45775 18-Apr-1999 peter

Further cleanups. i386_ioconf.c and alpha_ioconf.c were essentially the
same and were merged into a single newbus_ioconf.c. CG'd some more unused
code.


# 45744 17-Apr-1999 peter

Get out the blow torch and hack away all the unused stuff. Note that
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.


# 37578 12-Jul-1998 bde

Convert the maxusers directive to a normal MAXUSERS option (normally
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.


# 37577 12-Jul-1998 bde

Warn about redefined options. Keep using the last value processed.
Options are processed reverse file order, so the first definition in
the config file wins (except for directives that are converted to
option).


# 29451 15-Sep-1997 charnier

Use err(3), add usage(). -Wall clean.


# 20458 14-Dec-1996 joerg

Part #2 of the config cleanup. More aggressive, replaced an NIH
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!


# 20457 14-Dec-1996 joerg

Round #1 of cleaning up the config(8) mess. This is only the more
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)


# 16073 02-Jun-1996 phk

Backout yacc changes.


# 16023 30-May-1996 phk

yacc rule changes.


# 12772 11-Dec-1995 peter

Implement support for conf/options and i386/conf/options.i386
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.