Yann E. MORIN | 8 Jun 2012 01:48
Picon
Favicon

[PATCH 0/3 v2] config/scripts: further enhancements

Hello All!

This series adds a few more enhancements to the script scripts/config to
make it more usable, both for the Linux kernel (patches 1&3) and third
party projects that use Kconfig (patches 1, 2, 3).

Changes since v1:
 - use option to keep symbols' case, not variable (Andi)
 - a few doc fixes

Regards,
Yann E. MORIN.
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Yann E. MORIN | 8 Jun 2012 01:48
Picon
Favicon

[PATCH 3/3] scripts/config: add option to undef a symbol

It is currently possible to enable, disable or modularise
a symbol. Also, an undefined symbol is reported as such.

Add a new command to undefine a symbol, by removing the
corresponding line from the .config file.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998 <at> free.fr>
---
 scripts/config |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/scripts/config b/scripts/config
index 9723c7d..f65a44a 100755
--- a/scripts/config
+++ b/scripts/config
 <at>  <at>  -17,6 +17,7  <at>  <at>  commands:
 	                     Set option to "string"
 	--set-val option value
 	                     Set option to value
+	--undefine|-u option Undefine option
 	--state|-s option    Print state of option (n,y,m,undef)

 	--enable-after|-E beforeopt option
 <at>  <at>  -73,6 +74,12  <at>  <at>  set_var() {
 	fi
 }

+undef_var() {
+	local name=$1
+
(Continue reading)

Yann E. MORIN | 8 Jun 2012 01:48
Picon
Favicon

[PATCH 1/3] scripts/config: add option to not upper-case symbols

Currently, scripts/config mangles the config option symbols to always
be upper-case.

While the Linux kernel almost exclusively uses upper-case symbols, there
are still a few symbols with lower-case which this script can not handle:

  $ grep -r -E '^[[:space:]]*config[[:space:]]+[^[:space:]]*[[:lower:]][^[:space:]=.]*$' . |wc -l
  173
(that's roughly 1.3% of the symbols in 3.5-rc1)

Eg.:
  ./arch/arm/Kconfig:config VFPv3
  ./arch/powerpc/platforms/Kconfig.cputype:config 40x
  ./arch/x86/Kconfig:config SCx200HR_TIMER
  ./drivers/video/console/Kconfig:config FONT_8x8
  ./drivers/video/Kconfig:config NTSC_640x480

Also, other projects that use kconfig may allow for lower- or mixed-case
symbols, and may find easier to reuse this script than implement each
their own (potentially flawed) logic. For such a use-case, see:
    http://marc.info/?l=linux-kbuild&m=133409932115848&w=2

This patch adds a new option to keep the given case, and keep the current
default to upper-case the symbols.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998 <at> free.fr>
---
 scripts/config |   18 +++++++++++++++---
 1 files changed, 15 insertions(+), 3 deletions(-)

(Continue reading)

Yann E. MORIN | 8 Jun 2012 01:48
Picon
Favicon

[PATCH 2/3] scripts/config: allow alternate prefix to config option symbol

While the Linux kernel uses 'CONFIG_' as a prefix to the config options
symbols, many projects that use kconfig may use different prefixes, or
even none at all.

If the CONFIG_ environment variable is set, use it as the prefix (empty
is a valid prefix). Otherwise, use the default prefix 'CONFIG_'.

This matches the support for alternate prefixes in scripts/kconfig/lkc.h,
which uses the same logic (albeit with a C define instead of an environment
variable).

Signed-off-by: "Yann E. MORIN" <yann.morin.1998 <at> free.fr>
---
 scripts/config |   32 +++++++++++++++++++-------------
 1 files changed, 19 insertions(+), 13 deletions(-)

diff --git a/scripts/config b/scripts/config
index c5639fe..9723c7d 100755
--- a/scripts/config
+++ b/scripts/config
 <at>  <at>  -1,6 +1,9  <at>  <at> 
 #!/bin/bash
 # Manipulate options in a .config file from the command line

+# If no prefix forced, use the default CONFIG_
+CONFIG_="${CONFIG_-CONFIG_}"
+
 usage() {
 	cat >&2 <<EOL
 Manipulate options in a .config file from the command line.
(Continue reading)

Andi Kleen | 8 Jun 2012 05:36

Re: [PATCH 0/3 v2] config/scripts: further enhancements

On Fri, Jun 08, 2012 at 01:48:54AM +0200, Yann E. MORIN wrote:
> Hello All!
> 
> This series adds a few more enhancements to the script scripts/config to
> make it more usable, both for the Linux kernel (patches 1&3) and third
> party projects that use Kconfig (patches 1, 2, 3).
> 
> Changes since v1:
>  - use option to keep symbols' case, not variable (Andi)
>  - a few doc fixes
> 

Patchkit is fine for me now.
Thanks,
-Andi

--

-- 
ak <at> linux.intel.com -- Speaking for myself only.
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Gmane