linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Roman Zippel <zippel@linux-m68k.org>
To: linux-kernel@vger.kernel.org
Subject: [PATCH] new kconfig goodies
Date: Mon, 12 May 2003 15:39:11 +0200 (CEST)	[thread overview]
Message-ID: <Pine.LNX.4.44.0305111838300.14274-100000@serv> (raw)

Hi,

There is a new kconfig patch at 
http://www.xs4all.nl/~zippel/lc/patches/kconfig-2.5.69.diff.gz
It adds a few new features, which were requested a few times:
- ability to force the value of a config symbol
- defaults accept now an expression
- easier way to define derived symbols
- support for ranges

BTW this clears my todo list of important features for the kconfig syntax 
itself, if you think there is something missing, please tell me now, 
otherwise it might have to wait for 2.7. After this I work a bit more on 
xconfig and the library interface.

The changes in detail:

1. Working with derived symbols becomes simpler, e.g. this:

config FS_MBCACHE
	tristate
	depends on EXT2_FS_XATTR || EXT3_FS_XATTR
	default y if EXT2_FS=y || EXT3_FS=y
	default m if EXT2_FS=m || EXT3_FS=m

can now also be written as:

config FS_MBCACHE     
	def_tristate EXT2_FS || EXT3_FS
	depends on EXT2_FS_XATTR || EXT3_FS_XATTR

There are two new keywords "def_bool" and "def_tristate", which behave 
like "default", except that they also set the type of the config symbol.
Defaults also accept expressions now, the result of it will be used as 
default (this works of course only with boolean and tristate symbols).

2. There is a new keyword "enable", which can be used to force the value 
of another config value, e.g.

config NLS
	bool
	depends on JOLIET || FAT_FS || NTFS_FS || NCPFS_NLS || SMB_NLS || JFS_FS || CIFS || BEFS_FS
	default y

this could be written as:

config NLS
	def_bool JOLIET || FAT_FS || NTFS_FS || NCPFS_NLS || SMB_NLS || JFS_FS || CIFS || BEFS_FS

but this is now possible as well:

config NLS
	bool

config JOLIET
	bool "Microsoft Joliet CDROM extensions"
	enable NLS

config FAT_FS
	tristate "DOS FAT fs support"
	enable NLS

...

This means the information that a file system needs NLS is now specified 
with the file system itself and if the file system is selected, so is NLS.

Another example:

config AGP
	tristate "/dev/agpgart (AGP Support)" if !GART_IOMMU
	default y if GART_IOMMU

this can be changed into:

config AGP
	tristate "/dev/agpgart (AGP Support)"

config GART_IOMMU
	bool "IOMMU support"
	enable AGP

This will cause AGP to be selected if GART_IOMMU is selected.

To better understand how this new feature works, it might help to describe 
how a config value is calculated:

	config value = (user input && visibility) || reverse dependency

Visibility are the normal dependencies and limit the maximum value a user 
can select. Reverse dependencies on the other hand limit the minimum value 
a user can select. In above example this means there is a reverse 
dependency of GART_IOMMU added to AGP, so that value of AGP cannot be less 
than GART_IOMMU anymore.
This feature can be easily abused, so please use it with care, don't use 
it to take the choice away from user, e.g. only enable another subsystem 
if it would result in compile errors otherwise. If you're not sure, just 
ask. To avoid bigger mistakes I finally added the code to check for 
recursive dependencies.

3. Finally I added support for ranges, so that this becomes possible:

config LOG_BUF_SHIFT
	int "Kernel log buffer size" if DEBUG_KERNEL
	range 10 20
	...

Right now this is only used to check the direct user input, this means 
directly editing .config will ignore the range (please don't rely on this
feature :) ).

bye, Roman


             reply	other threads:[~2003-05-12 13:26 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-12 13:39 Roman Zippel [this message]
2003-05-12 14:16 ` [PATCH] new kconfig goodies Adrian Bunk
2003-05-12 15:37   ` Roman Zippel
2003-05-12 14:32 ` Dave Jones
2003-05-12 15:39   ` Roman Zippel
2003-05-12 16:08     ` Dave Jones
2003-05-12 16:00   ` Tomas Szepe
2003-05-12 22:36     ` Roman Zippel
2003-05-12 15:13 ` Geert Uytterhoeven
2003-05-12 15:43   ` Roman Zippel
2003-05-13  1:38 ` Miles Bader
2003-05-13  1:44 ` Miles Bader
2003-05-13 15:27   ` Roman Zippel
2003-05-13 21:17     ` Miles Bader
2003-05-14 19:51       ` Roman Zippel
2003-05-14 20:56         ` Andreas Schwab
2003-05-14 22:11           ` Roman Zippel
2003-05-15  0:21             ` Michael Alan Dorman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.44.0305111838300.14274-100000@serv \
    --to=zippel@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).