All of lore.kernel.org
 help / color / mirror / Atom feed
* [pull request] Pull request for branch yem/kconfig-for-next
@ 2013-08-15 21:17 Yann E. MORIN
  2013-08-15 21:17 ` [PATCH 1/4] kconfig: switch to "long long" for sanity Yann E. MORIN
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: Yann E. MORIN @ 2013-08-15 21:17 UTC (permalink / raw)
  To: linux-kbuild, Michal Marek; +Cc: linux-kernel, Yann E. MORIN

From: "Yann E. MORIN" <yann.morin.1998@free.fr>

Hello Michal,

Please pull a few more changes queued for 3.12 since your last pull:

  - POSIX compliance when using sed in scripts/config    (CLément)
  - use 'long long' to represent hex and ranges, so their width
    is not dependent on the architecture (32/64 bits)    (Kees)
  - remove the warning when parsing auto.conf, that frigthened
    Linus when he merged the ext4 tree
  - explicit use CONFIG_MODULES to enable tristates

Regards,
Yann E. MORIN.

PS. I've indeed changed the naming scheme of my branches, don't worry. ;-)


The following changes since commit c3286ee337b0586a8ae2b4f13c33e3de5d71139e:

  Merge branch 'yem-kconfig-rc-fixes' of git://gitorious.org/linux-kconfig/linux-kconfig into kbuild/kconfig (2013-07-23 15:57:17 +0200)

are available in the git repository at:


  git://gitorious.org/linux-kconfig/linux-kconfig.git yem/kconfig-for-next

for you to fetch changes up to 11097a0367e48954ecf616f9b0df48d86835dd0d:

  modules: do not depend on kconfig to set 'modules' option to symbol MODULES (2013-08-15 22:56:08 +0200)

----------------------------------------------------------------
Clement Chauplannaz (1):
      scripts/config: use sed's POSIX interface

Kees Cook (1):
      kconfig: switch to "long long" for sanity

Yann E. MORIN (2):
      kconfig: silence warning when parsing auto.conf when a symbol has changed type
      modules: do not depend on kconfig to set 'modules' option to symbol MODULES

 init/Kconfig               |  1 +
 scripts/config             | 44 +++++++++++++++++++++++++++++++++++++++++---
 scripts/kconfig/confdata.c | 11 ++++++++---
 scripts/kconfig/symbol.c   | 19 ++++++++++---------
 4 files changed, 60 insertions(+), 15 deletions(-)

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 1/4] kconfig: switch to "long long" for sanity
  2013-08-15 21:17 [pull request] Pull request for branch yem/kconfig-for-next Yann E. MORIN
@ 2013-08-15 21:17 ` Yann E. MORIN
  2013-08-15 21:17 ` [PATCH 2/4] scripts/config: use sed's POSIX interface Yann E. MORIN
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 14+ messages in thread
From: Yann E. MORIN @ 2013-08-15 21:17 UTC (permalink / raw)
  To: linux-kbuild, Michal Marek; +Cc: linux-kernel, Kees Cook, Yann E. MORIN

From: Kees Cook <keescook@chromium.org>

Instead of using "long" for kconfig "hex" and "range" values, which may
change in size depending on the host architecture, use "long long". This
will allow values greater than INT_MAX on 32-bit hosts when cross
compiling.

Signed-off-by: Kees Cook <keescook@chromium.org>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Tested-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
 scripts/kconfig/symbol.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c
index a76b8fd..c9a6775 100644
--- a/scripts/kconfig/symbol.c
+++ b/scripts/kconfig/symbol.c
@@ -136,7 +136,7 @@ static struct property *sym_get_range_prop(struct symbol *sym)
 	return NULL;
 }
 
-static long sym_get_range_val(struct symbol *sym, int base)
+static long long sym_get_range_val(struct symbol *sym, int base)
 {
 	sym_calc_value(sym);
 	switch (sym->type) {
@@ -149,13 +149,14 @@ static long sym_get_range_val(struct symbol *sym, int base)
 	default:
 		break;
 	}
-	return strtol(sym->curr.val, NULL, base);
+	return strtoll(sym->curr.val, NULL, base);
 }
 
 static void sym_validate_range(struct symbol *sym)
 {
 	struct property *prop;
-	long base, val, val2;
+	int base;
+	long long val, val2;
 	char str[64];
 
 	switch (sym->type) {
@@ -171,7 +172,7 @@ static void sym_validate_range(struct symbol *sym)
 	prop = sym_get_range_prop(sym);
 	if (!prop)
 		return;
-	val = strtol(sym->curr.val, NULL, base);
+	val = strtoll(sym->curr.val, NULL, base);
 	val2 = sym_get_range_val(prop->expr->left.sym, base);
 	if (val >= val2) {
 		val2 = sym_get_range_val(prop->expr->right.sym, base);
@@ -179,9 +180,9 @@ static void sym_validate_range(struct symbol *sym)
 			return;
 	}
 	if (sym->type == S_INT)
-		sprintf(str, "%ld", val2);
+		sprintf(str, "%lld", val2);
 	else
-		sprintf(str, "0x%lx", val2);
+		sprintf(str, "0x%llx", val2);
 	sym->curr.val = strdup(str);
 }
 
@@ -594,7 +595,7 @@ bool sym_string_valid(struct symbol *sym, const char *str)
 bool sym_string_within_range(struct symbol *sym, const char *str)
 {
 	struct property *prop;
-	long val;
+	long long val;
 
 	switch (sym->type) {
 	case S_STRING:
@@ -605,7 +606,7 @@ bool sym_string_within_range(struct symbol *sym, const char *str)
 		prop = sym_get_range_prop(sym);
 		if (!prop)
 			return true;
-		val = strtol(str, NULL, 10);
+		val = strtoll(str, NULL, 10);
 		return val >= sym_get_range_val(prop->expr->left.sym, 10) &&
 		       val <= sym_get_range_val(prop->expr->right.sym, 10);
 	case S_HEX:
@@ -614,7 +615,7 @@ bool sym_string_within_range(struct symbol *sym, const char *str)
 		prop = sym_get_range_prop(sym);
 		if (!prop)
 			return true;
-		val = strtol(str, NULL, 16);
+		val = strtoll(str, NULL, 16);
 		return val >= sym_get_range_val(prop->expr->left.sym, 16) &&
 		       val <= sym_get_range_val(prop->expr->right.sym, 16);
 	case S_BOOLEAN:
-- 
1.8.1.2


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 2/4] scripts/config: use sed's POSIX interface
  2013-08-15 21:17 [pull request] Pull request for branch yem/kconfig-for-next Yann E. MORIN
  2013-08-15 21:17 ` [PATCH 1/4] kconfig: switch to "long long" for sanity Yann E. MORIN
@ 2013-08-15 21:17 ` Yann E. MORIN
  2013-09-12 16:40   ` Linus Walleij
  2013-08-15 21:17 ` [PATCH 3/4] kconfig: silence warning when parsing auto.conf when a symbol has changed type Yann E. MORIN
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 14+ messages in thread
From: Yann E. MORIN @ 2013-08-15 21:17 UTC (permalink / raw)
  To: linux-kbuild, Michal Marek
  Cc: linux-kernel, Clement Chauplannaz, Yann E. MORIN

From: Clement Chauplannaz <chauplac@gmail.com>

Script `config' relies on extensions of `GNU sed', and is thus not
working on all Unixes:
  - in-place edition of files (-i), which can be replaced with
    a temporary file;
  - extended-regexps (-r), which can be split into basic regexps;
  - single-line calls to `a' command, while some implementations
    require a leading newline before the parameter.

Rewrite calls to `sed' to comply with POSIX interface, and move them
to helper functions.

Signed-off-by: Clement Chauplannaz <chauplac@gmail.com>
Tested-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
---
 scripts/config | 44 +++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 41 insertions(+), 3 deletions(-)

diff --git a/scripts/config b/scripts/config
index 567120a..2283be2 100755
--- a/scripts/config
+++ b/scripts/config
@@ -62,15 +62,52 @@ checkarg() {
 	fi
 }
 
+txt_append() {
+	local anchor="$1"
+	local insert="$2"
+	local infile="$3"
+	local tmpfile="$infile.swp"
+
+	# sed append cmd: 'a\' + newline + text + newline
+	cmd="$(printf "a\\%b$insert" "\n")"
+
+	sed -e "/$anchor/$cmd" "$infile" >"$tmpfile"
+	# replace original file with the edited one
+	mv "$tmpfile" "$infile"
+}
+
+txt_subst() {
+	local before="$1"
+	local after="$2"
+	local infile="$3"
+	local tmpfile="$infile.swp"
+
+	sed -e "s/$before/$after/" "$infile" >"$tmpfile"
+	# replace original file with the edited one
+	mv "$tmpfile" "$infile"
+}
+
+txt_delete() {
+	local text="$1"
+	local infile="$2"
+	local tmpfile="$infile.swp"
+
+	sed -e "/$text/d" "$infile" >"$tmpfile"
+	# replace original file with the edited one
+	mv "$tmpfile" "$infile"
+}
+
 set_var() {
 	local name=$1 new=$2 before=$3
 
 	name_re="^($name=|# $name is not set)"
 	before_re="^($before=|# $before is not set)"
 	if test -n "$before" && grep -Eq "$before_re" "$FN"; then
-		sed -ri "/$before_re/a $new" "$FN"
+		txt_append "^$before=" "$new" "$FN"
+		txt_append "^# $before is not set" "$new" "$FN"
 	elif grep -Eq "$name_re" "$FN"; then
-		sed -ri "s:$name_re.*:$new:" "$FN"
+		txt_subst "^$name=.*" "$new" "$FN"
+		txt_subst "^# $name is not set" "$new" "$FN"
 	else
 		echo "$new" >>"$FN"
 	fi
@@ -79,7 +116,8 @@ set_var() {
 undef_var() {
 	local name=$1
 
-	sed -ri "/^($name=|# $name is not set)/d" "$FN"
+	txt_delete "^$name=" "$FN"
+	txt_delete "^# $name is not set" "$FN"
 }
 
 if [ "$1" = "--file" ]; then
-- 
1.8.1.2


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 3/4] kconfig: silence warning when parsing auto.conf when a symbol has changed type
  2013-08-15 21:17 [pull request] Pull request for branch yem/kconfig-for-next Yann E. MORIN
  2013-08-15 21:17 ` [PATCH 1/4] kconfig: switch to "long long" for sanity Yann E. MORIN
  2013-08-15 21:17 ` [PATCH 2/4] scripts/config: use sed's POSIX interface Yann E. MORIN
@ 2013-08-15 21:17 ` Yann E. MORIN
  2013-08-15 21:17 ` [PATCH 4/4] modules: do not depend on kconfig to set 'modules' option to symbol MODULES Yann E. MORIN
  2013-08-16 12:48 ` [pull request] Pull request for branch yem/kconfig-for-next Michal Marek
  4 siblings, 0 replies; 14+ messages in thread
From: Yann E. MORIN @ 2013-08-15 21:17 UTC (permalink / raw)
  To: linux-kbuild, Michal Marek
  Cc: linux-kernel, Yann E. MORIN, Linus Torvalds, Thomas Petazzoni,
	Bjorn Helgaas, Yinghai Lu, Benjamin Herrenschmidt

From: "Yann E. MORIN" <yann.morin.1998@free.fr>

When a symbol changes type from tristate to bool, and was previously set to
'm', a subsequent silentoldconfig would warn about inconsistency, such as:

    include/config/auto.conf:3014:warning: symbol value 'm' invalid for
    HOTPLUG_PCI_PCIE

Seen by Linus with the merge in aa8032b (sequence to reproduce by Michal):
    git checkout 1fe0135
    make mrproper
    make allmodconfig
    make silentoldconfig
    git checkout aa8032b
    make allmodconfig
    make silentoldconfig

Since HOTPLUG_PCI_PCIE changed from tristate to bool in aa8032b, it was
previously set to 'm' in auto.conf by the first allmodconfig+silentoldconfig,
but then was set to 'y' by the second allmodconfig. Then the second
silentoldconfig prints the warning.

The warning in this case is a spurious warning, which happens at the time
kconfig tries to detect symbols that have changed, to touch the empty
header files in include/config used for dependency-tracking by make.

Silence the warning when we read the old auto.conf file, since it is
perfectly legit that a symbol changed type since the previous call.

Thread in:
    http://marc.info/?l=linux-pci&m=137569198904000&w=2

Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Michal Marek <mmarek@suse.cz>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
 scripts/kconfig/confdata.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
index c55c227..87f7238 100644
--- a/scripts/kconfig/confdata.c
+++ b/scripts/kconfig/confdata.c
@@ -140,7 +140,9 @@ static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p)
 			sym->flags |= def_flags;
 			break;
 		}
-		conf_warning("symbol value '%s' invalid for %s", p, sym->name);
+		if (def != S_DEF_AUTO)
+			conf_warning("symbol value '%s' invalid for %s",
+				     p, sym->name);
 		return 1;
 	case S_OTHER:
 		if (*p != '"') {
@@ -161,7 +163,8 @@ static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p)
 			memmove(p2, p2 + 1, strlen(p2));
 		}
 		if (!p2) {
-			conf_warning("invalid string found");
+			if (def != S_DEF_AUTO)
+				conf_warning("invalid string found");
 			return 1;
 		}
 		/* fall through */
@@ -172,7 +175,9 @@ static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p)
 			sym->def[def].val = strdup(p);
 			sym->flags |= def_flags;
 		} else {
-			conf_warning("symbol value '%s' invalid for %s", p, sym->name);
+			if (def != S_DEF_AUTO)
+				conf_warning("symbol value '%s' invalid for %s",
+					     p, sym->name);
 			return 1;
 		}
 		break;
-- 
1.8.1.2


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 4/4] modules: do not depend on kconfig to set 'modules' option to symbol MODULES
  2013-08-15 21:17 [pull request] Pull request for branch yem/kconfig-for-next Yann E. MORIN
                   ` (2 preceding siblings ...)
  2013-08-15 21:17 ` [PATCH 3/4] kconfig: silence warning when parsing auto.conf when a symbol has changed type Yann E. MORIN
@ 2013-08-15 21:17 ` Yann E. MORIN
  2013-08-16 12:48 ` [pull request] Pull request for branch yem/kconfig-for-next Michal Marek
  4 siblings, 0 replies; 14+ messages in thread
From: Yann E. MORIN @ 2013-08-15 21:17 UTC (permalink / raw)
  To: linux-kbuild, Michal Marek
  Cc: linux-kernel, Yann E. MORIN, Stephen Rothwell, Sam Ravnborg,
	Kevin Hilman, sedat.dilek, Theodore Ts'o

From: "Yann E. MORIN" <yann.morin.1998@free.fr>

Currently, the MODULES symbol is special-cased in different places in the
kconfig language. For example, if no symbol is defined to enable tristates,
then kconfig looks up for a symbol named 'MODULES', and forces the 'modules'
option onto that symbol.

This causes problems as such:
  - since MODULES is special-cased, reading the configuration with
    KCONFIG_ALLCONFIG set will forcibly set MODULES to be 'valid' (ie.
    it has a valid value), when no such value was previously set. So
    MODULES defaults to 'n' unless it is present in KCONFIG_ALLCONFIG
  - other third-party projects may decide that 'MODULES' plays a different
    role for them

This has been exposed by cset #cfa98f2e:
    kconfig: do not override symbols already set
and reported by Stephen in:
    http://marc.info/?l=linux-next&m=137592137915234&w=2

As suggested by Sam, we explicitly define the MODULES symbol to be the
tristate-enabler. This will allow us to drop special-casing of MODULES
in the kconfig language, later.

(Note: this patch is not a fix to Stephen's issue, just a first step).

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: yann.morin.1998@free.fr
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Michal Marek <mmarek@suse.cz>
Cc: Kevin Hilman <khilman@linaro.org>
Cc: sedat.dilek@gmail.com
Cc: Theodore Ts'o <tytso@mit.edu>
---
 init/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/init/Kconfig b/init/Kconfig
index 247084b..4d55e81 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -1666,6 +1666,7 @@ config BASE_SMALL
 
 menuconfig MODULES
 	bool "Enable loadable module support"
+	option modules
 	help
 	  Kernel modules are small pieces of compiled code which can
 	  be inserted in the running kernel, rather than being
-- 
1.8.1.2


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [pull request] Pull request for branch yem/kconfig-for-next
  2013-08-15 21:17 [pull request] Pull request for branch yem/kconfig-for-next Yann E. MORIN
                   ` (3 preceding siblings ...)
  2013-08-15 21:17 ` [PATCH 4/4] modules: do not depend on kconfig to set 'modules' option to symbol MODULES Yann E. MORIN
@ 2013-08-16 12:48 ` Michal Marek
  2013-08-16 13:02   ` Yann E. MORIN
  4 siblings, 1 reply; 14+ messages in thread
From: Michal Marek @ 2013-08-16 12:48 UTC (permalink / raw)
  To: Yann E. MORIN; +Cc: linux-kbuild, linux-kernel

On 15.8.2013 23:17, Yann E. MORIN wrote:
> From: "Yann E. MORIN" <yann.morin.1998@free.fr>
> 
> Hello Michal,
> 
> Please pull a few more changes queued for 3.12 since your last pull:
> 
>   - POSIX compliance when using sed in scripts/config    (CLément)
>   - use 'long long' to represent hex and ranges, so their width
>     is not dependent on the architecture (32/64 bits)    (Kees)
>   - remove the warning when parsing auto.conf, that frigthened
>     Linus when he merged the ext4 tree
>   - explicit use CONFIG_MODULES to enable tristates

Pulled, thanks! Now you can remove the CONFIG_MODULES special handling
from kconfig.

Michal

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [pull request] Pull request for branch yem/kconfig-for-next
  2013-08-16 12:48 ` [pull request] Pull request for branch yem/kconfig-for-next Michal Marek
@ 2013-08-16 13:02   ` Yann E. MORIN
  0 siblings, 0 replies; 14+ messages in thread
From: Yann E. MORIN @ 2013-08-16 13:02 UTC (permalink / raw)
  To: Michal Marek; +Cc: linux-kbuild, linux-kernel

Michal, All,

On Friday 16 August 2013 14:48:47 Michal Marek wrote:
> On 15.8.2013 23:17, Yann E. MORIN wrote:
> > From: "Yann E. MORIN" <yann.morin.1998@free.fr>
> > 
> > Hello Michal,
> > 
> > Please pull a few more changes queued for 3.12 since your last pull:
> > 
> >   - POSIX compliance when using sed in scripts/config    (CLément)
> >   - use 'long long' to represent hex and ranges, so their width
> >     is not dependent on the architecture (32/64 bits)    (Kees)
> >   - remove the warning when parsing auto.conf, that frigthened
> >     Linus when he merged the ext4 tree
> >   - explicit use CONFIG_MODULES to enable tristates
> 
> Pulled, thanks! Now you can remove the CONFIG_MODULES special handling
> from kconfig.

Eh! Easier said than done! ;-)

Thanks!

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +0/33 662376056 | Software  Designer | \ / CAMPAIGN     |   ^                |
| --==< O_o >==-- '------------.-------:  X  AGAINST      |  /e\  There is no  |
| http://ymorin.is-a-geek.org/ | (*_*) | / \ HTML MAIL    |  """  conspiracy.  |
'------------------------------'-------'------------------'--------------------'

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 2/4] scripts/config: use sed's POSIX interface
  2013-08-15 21:17 ` [PATCH 2/4] scripts/config: use sed's POSIX interface Yann E. MORIN
@ 2013-09-12 16:40   ` Linus Walleij
  2013-09-13  8:38     ` Clément Chauplannaz
  0 siblings, 1 reply; 14+ messages in thread
From: Linus Walleij @ 2013-09-12 16:40 UTC (permalink / raw)
  To: Yann E. MORIN
  Cc: linux-kbuild, Michal Marek, linux-kernel, Clement Chauplannaz

On Thu, Aug 15, 2013 at 11:17 PM, Yann E. MORIN <yann.morin.1998@free.fr> wrote:

> From: Clement Chauplannaz <chauplac@gmail.com>
>
> Script `config' relies on extensions of `GNU sed', and is thus not
> working on all Unixes:
>   - in-place edition of files (-i), which can be replaced with
>     a temporary file;
>   - extended-regexps (-r), which can be split into basic regexps;
>   - single-line calls to `a' command, while some implementations
>     require a leading newline before the parameter.
>
> Rewrite calls to `sed' to comply with POSIX interface, and move them
> to helper functions.
>
> Signed-off-by: Clement Chauplannaz <chauplac@gmail.com>
> Tested-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>

This patch totally breaks my usage of the --set-str
argument to "config".

Reverting this patch solves the problem.

Reproduce:
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-
KBUILD_OUTPUT=build-nomadik nhk8815_defconfig
scripts/config --file build-nomadik/.config --set-str CMDLINE
"root=/dev/ram0 console=ttyAMA1,115200n8 earlyprintk"
sed: -e uttryck #1, tecken 44: flaggan okänd för "s"
sed: -e uttryck #1, tecken 54: flaggan okänd för "s"

Swedish messages meaning "unknown flag for "s""

After reverting the patch these messages no longer appear.

At failure my config file is scratched :-O

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 2/4] scripts/config: use sed's POSIX interface
  2013-09-12 16:40   ` Linus Walleij
@ 2013-09-13  8:38     ` Clément Chauplannaz
  2013-09-13  8:45       ` [PATCH] scripts/config: fix variable substitution command Clement Chauplannaz
  2013-09-13  9:32       ` [PATCH 2/4] scripts/config: use sed's POSIX interface Linus Walleij
  0 siblings, 2 replies; 14+ messages in thread
From: Clément Chauplannaz @ 2013-09-13  8:38 UTC (permalink / raw)
  To: Linus Walleij; +Cc: Yann E. MORIN, linux-kbuild, Michal Marek, linux-kernel

2013/9/12 Linus Walleij <linus.walleij@linaro.org>:
> On Thu, Aug 15, 2013 at 11:17 PM, Yann E. MORIN <yann.morin.1998@free.fr> wrote:
>
>> From: Clement Chauplannaz <chauplac@gmail.com>
>>
>> Script `config' relies on extensions of `GNU sed', and is thus not
>> working on all Unixes:
>>   - in-place edition of files (-i), which can be replaced with
>>     a temporary file;
>>   - extended-regexps (-r), which can be split into basic regexps;
>>   - single-line calls to `a' command, while some implementations
>>     require a leading newline before the parameter.
>>
>> Rewrite calls to `sed' to comply with POSIX interface, and move them
>> to helper functions.
>>
>> Signed-off-by: Clement Chauplannaz <chauplac@gmail.com>
>> Tested-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
>> Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
>> Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
>
> This patch totally breaks my usage of the --set-str
> argument to "config".
>
> Reverting this patch solves the problem.
>
> Reproduce:
> make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-
> KBUILD_OUTPUT=build-nomadik nhk8815_defconfig
> scripts/config --file build-nomadik/.config --set-str CMDLINE
> "root=/dev/ram0 console=ttyAMA1,115200n8 earlyprintk"
> sed: -e uttryck #1, tecken 44: flaggan okänd för "s"
> sed: -e uttryck #1, tecken 54: flaggan okänd för "s"
>
> Swedish messages meaning "unknown flag for "s""
>
> After reverting the patch these messages no longer appear.
>
> At failure my config file is scratched :-O
>
> Yours,
> Linus Walleij

Hello Linus,

Thank you for this report. I was able to reproduce this bug and fix it.

My previous commit changed the separator between sed's substitute
command and its parameters, from ':' to '/'. The latter conflicted
with the slashes found in the value of variable CMDLINE, as provided
in your email.

I'm sending a patch right now to revert to previous behavior.

Best regards,
Clement Chauplannaz

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH] scripts/config: fix variable substitution command
  2013-09-13  8:38     ` Clément Chauplannaz
@ 2013-09-13  8:45       ` Clement Chauplannaz
  2013-09-13  9:29         ` Linus Walleij
  2013-09-13  9:32       ` [PATCH 2/4] scripts/config: use sed's POSIX interface Linus Walleij
  1 sibling, 1 reply; 14+ messages in thread
From: Clement Chauplannaz @ 2013-09-13  8:45 UTC (permalink / raw)
  To: linus.walleij, mmarek, yann.morin.1998; +Cc: linux-kbuild, linux-kernel

Commit 229455bc02b87f7128f190c4491b4ceffff38648 accidentally changed the
separator between sed `s' command and its parameters from ':' to '/'.

Revert this change.

Signed-off-by: Clement Chauplannaz <chauplac@gmail.com>
---
 scripts/config | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/config b/scripts/config
index 58383e2..ae85564 100755
--- a/scripts/config
+++ b/scripts/config
@@ -80,7 +80,7 @@ txt_subst() {
 	local infile="$3"
 	local tmpfile="$infile.swp"
 
-	sed -e "s/$before/$after/" "$infile" >"$tmpfile"
+	sed -e "s:$before:$after:" "$infile" >"$tmpfile"
 	# replace original file with the edited one
 	mv "$tmpfile" "$infile"
 }
-- 
1.8.3.2.dirty


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH] scripts/config: fix variable substitution command
  2013-09-13  8:45       ` [PATCH] scripts/config: fix variable substitution command Clement Chauplannaz
@ 2013-09-13  9:29         ` Linus Walleij
  0 siblings, 0 replies; 14+ messages in thread
From: Linus Walleij @ 2013-09-13  9:29 UTC (permalink / raw)
  To: Clement Chauplannaz
  Cc: Michal Marek, Yann E. MORIN, linux-kbuild, linux-kernel

On Fri, Sep 13, 2013 at 10:45 AM, Clement Chauplannaz
<chauplac@gmail.com> wrote:

> Commit 229455bc02b87f7128f190c4491b4ceffff38648 accidentally changed the
> separator between sed `s' command and its parameters from ':' to '/'.
>
> Revert this change.
>
> Signed-off-by: Clement Chauplannaz <chauplac@gmail.com>

This patch fixes my issue with --set-str, thanks!

Tested-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 2/4] scripts/config: use sed's POSIX interface
  2013-09-13  8:38     ` Clément Chauplannaz
  2013-09-13  8:45       ` [PATCH] scripts/config: fix variable substitution command Clement Chauplannaz
@ 2013-09-13  9:32       ` Linus Walleij
  2013-09-13  9:54         ` Clément Chauplannaz
  1 sibling, 1 reply; 14+ messages in thread
From: Linus Walleij @ 2013-09-13  9:32 UTC (permalink / raw)
  To: Clément Chauplannaz
  Cc: Yann E. MORIN, linux-kbuild, Michal Marek, linux-kernel

On Fri, Sep 13, 2013 at 10:38 AM, Clément Chauplannaz
<chauplac@gmail.com> wrote:

> Thank you for this report. I was able to reproduce this bug and fix it.

Thanks! Tested and works fine.

> My previous commit changed the separator between sed's substitute
> command and its parameters, from ':' to '/'. The latter conflicted
> with the slashes found in the value of variable CMDLINE, as provided
> in your email.

Hm it could actually be useful to be able to have colons in a CMDLINE,
I wonder if we can think about some better separator ... oh well that
is another issue, all old scripts work now anyway.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 2/4] scripts/config: use sed's POSIX interface
  2013-09-13  9:32       ` [PATCH 2/4] scripts/config: use sed's POSIX interface Linus Walleij
@ 2013-09-13  9:54         ` Clément Chauplannaz
  2013-09-13 11:00           ` Michal Marek
  0 siblings, 1 reply; 14+ messages in thread
From: Clément Chauplannaz @ 2013-09-13  9:54 UTC (permalink / raw)
  To: Linus Walleij; +Cc: Yann E. MORIN, linux-kbuild, Michal Marek, linux-kernel

On Sep 13, 2013, at 11:32 AM, Linus Walleij <linus.walleij@linaro.org> wrote:

> On Fri, Sep 13, 2013 at 10:38 AM, Clément Chauplannaz
> <chauplac@gmail.com> wrote:
> 
>> Thank you for this report. I was able to reproduce this bug and fix it.
> 
> Thanks! Tested and works fine.
Glad to read the patch solves your issue. Thanks for the quick feedback!
> 
>> My previous commit changed the separator between sed's substitute
>> command and its parameters, from ':' to '/'. The latter conflicted
>> with the slashes found in the value of variable CMDLINE, as provided
>> in your email.
> 
> Hm it could actually be useful to be able to have colons in a CMDLINE,
> I wonder if we can think about some better separator ... oh well that
> is another issue, all old scripts work now anyway.
Indeed config script may not work with all possible string values. My first concern for now was to fallback to previous interface. We may look into hardening the script later on.

Best regards,
Clement Chauplannaz

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 2/4] scripts/config: use sed's POSIX interface
  2013-09-13  9:54         ` Clément Chauplannaz
@ 2013-09-13 11:00           ` Michal Marek
  0 siblings, 0 replies; 14+ messages in thread
From: Michal Marek @ 2013-09-13 11:00 UTC (permalink / raw)
  To: Clément Chauplannaz
  Cc: Linus Walleij, Yann E. MORIN, linux-kbuild, linux-kernel

Dne 13.9.2013 11:54, Clément Chauplannaz napsal(a):
> On Sep 13, 2013, at 11:32 AM, Linus Walleij <linus.walleij@linaro.org> wrote:
> 
>> On Fri, Sep 13, 2013 at 10:38 AM, Clément Chauplannaz
>> <chauplac@gmail.com> wrote:
>>
>>> Thank you for this report. I was able to reproduce this bug and fix it.
>>
>> Thanks! Tested and works fine.
> Glad to read the patch solves your issue. Thanks for the quick feedback!
>>
>>> My previous commit changed the separator between sed's substitute
>>> command and its parameters, from ':' to '/'. The latter conflicted
>>> with the slashes found in the value of variable CMDLINE, as provided
>>> in your email.
>>
>> Hm it could actually be useful to be able to have colons in a CMDLINE,
>> I wonder if we can think about some better separator ... oh well that
>> is another issue, all old scripts work now anyway.
> Indeed config script may not work with all possible string values.
> My
> first concern for now was to fallback to previous interface. We may look
> into hardening the script later on.

Right. I will merge the patch because it reverts a regression. But feel
free to submit another patch that escapes the colons in $after. The
script already uses #!/bin/bash, so a "${after//:/\:}" should work.

Michal

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2013-09-13 11:00 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-15 21:17 [pull request] Pull request for branch yem/kconfig-for-next Yann E. MORIN
2013-08-15 21:17 ` [PATCH 1/4] kconfig: switch to "long long" for sanity Yann E. MORIN
2013-08-15 21:17 ` [PATCH 2/4] scripts/config: use sed's POSIX interface Yann E. MORIN
2013-09-12 16:40   ` Linus Walleij
2013-09-13  8:38     ` Clément Chauplannaz
2013-09-13  8:45       ` [PATCH] scripts/config: fix variable substitution command Clement Chauplannaz
2013-09-13  9:29         ` Linus Walleij
2013-09-13  9:32       ` [PATCH 2/4] scripts/config: use sed's POSIX interface Linus Walleij
2013-09-13  9:54         ` Clément Chauplannaz
2013-09-13 11:00           ` Michal Marek
2013-08-15 21:17 ` [PATCH 3/4] kconfig: silence warning when parsing auto.conf when a symbol has changed type Yann E. MORIN
2013-08-15 21:17 ` [PATCH 4/4] modules: do not depend on kconfig to set 'modules' option to symbol MODULES Yann E. MORIN
2013-08-16 12:48 ` [pull request] Pull request for branch yem/kconfig-for-next Michal Marek
2013-08-16 13:02   ` Yann E. MORIN

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.