* [Buildroot] [PATCH v2 0/4] Fix compiler warnings in support/kconfig
@ 2025-07-16 18:15 Edgar Bonet via buildroot
2025-07-16 18:17 ` [Buildroot] [PATCH v2 1/4] support/kconfig/patches: make all patches quilt-friendly Edgar Bonet via buildroot
` (3 more replies)
0 siblings, 4 replies; 9+ messages in thread
From: Edgar Bonet via buildroot @ 2025-07-16 18:15 UTC (permalink / raw)
To: Buildroot development; +Cc: Petr Vorel, Julien Olivain
This a respin and an extension of a previous patch,[1] which has been
marked as “Changes Requested” because it failed to update the
support/kconfig/patches directory.
The first two patches in this series are meant to ensure the contents of
support/kconfig/patches is in sync with the current sources in
support/kconfig. The second patch creates a missing file in patches/. It
could have instead updated patch 14, but that would force the fourth
patch in this series to create an inconsistency.
The third patch is a respin of the previous version of this series. It
now updates the relevant entry in patches/.
The fourth patch fixes a warning in “make nconfig” very similar to the
warning fixed by the third patch.
Changes v1 -> v2:
- patches 1, 2 and 4 are new
- patch 3 now updates patches/24-fix--Wformat-warnings.patch, and its
log message is slightly reworded.
[1] https://lore.kernel.org/buildroot/4a4473d3-56d6-4576-9a8f-5b708a1569df@grenoble.cnrs.fr/
Edgar Bonet (4):
support/kconfig/patches: make all patches quilt-friendly
support/kconfig/patches: add missing patch
support/kconfig: fix compiler warning in util.c
support/kconfig: fix compiler warning in nconf.c
support/kconfig/nconf.c | 2 +-
...config-lxdialog-fix-check-with-GCC14.patch | 11 ++--
...onfig-mn-conf-handle-backspace-H-key.patch | 31 ++++++------
.../patches/24-fix--Wformat-warnings.patch | 50 +++++++++++++++++++
support/kconfig/patches/series | 1 +
support/kconfig/util.c | 2 +-
6 files changed, 71 insertions(+), 26 deletions(-)
create mode 100644 support/kconfig/patches/24-fix--Wformat-warnings.patch
--
2.43.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH v2 1/4] support/kconfig/patches: make all patches quilt-friendly
2025-07-16 18:15 [Buildroot] [PATCH v2 0/4] Fix compiler warnings in support/kconfig Edgar Bonet via buildroot
@ 2025-07-16 18:17 ` Edgar Bonet via buildroot
2025-07-16 20:39 ` Petr Vorel
2025-07-16 18:18 ` [Buildroot] [PATCH v2 2/4] support/kconfig/patches: add missing patch Edgar Bonet via buildroot
` (2 subsequent siblings)
3 siblings, 1 reply; 9+ messages in thread
From: Edgar Bonet via buildroot @ 2025-07-16 18:17 UTC (permalink / raw)
To: Buildroot development; +Cc: Petr Vorel, Julien Olivain
According to support/kconfig/README.buildroot, the patches in
support/kconfig/patches/ are meant to be applied by quilt. However, two
of those patches are in git format, which makes quilt error out with:
Applying patch patches/22-kconfig-lxdialog-fix-check-with-GCC14.patch
can't find file to patch at input line 32
[...]
No file to patch. Skipping patch.
Fix the format to make quilt happy.
Signed-off-by: Edgar Bonet <bonet@grenoble.cnrs.fr>
---
...config-lxdialog-fix-check-with-GCC14.patch | 11 +++----
...onfig-mn-conf-handle-backspace-H-key.patch | 31 +++++++++----------
2 files changed, 18 insertions(+), 24 deletions(-)
diff --git a/support/kconfig/patches/22-kconfig-lxdialog-fix-check-with-GCC14.patch b/support/kconfig/patches/22-kconfig-lxdialog-fix-check-with-GCC14.patch
index 41081bb45d..edcc857190 100644
--- a/support/kconfig/patches/22-kconfig-lxdialog-fix-check-with-GCC14.patch
+++ b/support/kconfig/patches/22-kconfig-lxdialog-fix-check-with-GCC14.patch
@@ -25,10 +25,10 @@ Tested-by: Petr Vorel <petr.vorel@gmail.com>
kconfig/lxdialog/check-lxdialog.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
-diff --git a/kconfig/lxdialog/check-lxdialog.sh b/kconfig/lxdialog/check-lxdialog.sh
-index 16cd9a3186..27d6c30a57 100755
---- a/kconfig/lxdialog/check-lxdialog.sh
-+++ b/kconfig/lxdialog/check-lxdialog.sh
+Index: kconfig.new/lxdialog/check-lxdialog.sh
+===================================================================
+--- kconfig.orig/lxdialog/check-lxdialog.sh
++++ kconfig/lxdialog/check-lxdialog.sh
@@ -48,7 +48,7 @@ trap "rm -f $tmp" 0 1 2 3 15
check() {
$cc -x c - -o $tmp 2>/dev/null <<'EOF'
@@ -38,6 +38,3 @@ index 16cd9a3186..27d6c30a57 100755
EOF
if [ $? != 0 ]; then
echo " *** Unable to find the ncurses libraries or the" 1>&2
---
-2.44.0
-
diff --git a/support/kconfig/patches/23-kconfig-mn-conf-handle-backspace-H-key.patch b/support/kconfig/patches/23-kconfig-mn-conf-handle-backspace-H-key.patch
index 6e32115f70..f72f9f339b 100644
--- a/support/kconfig/patches/23-kconfig-mn-conf-handle-backspace-H-key.patch
+++ b/support/kconfig/patches/23-kconfig-mn-conf-handle-backspace-H-key.patch
@@ -16,11 +16,11 @@ Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
kconfig/nconf.gui.c | 3 ++-
3 files changed, 5 insertions(+), 3 deletions(-)
-diff --git a/kconfig/lxdialog/inputbox.c b/kconfig/lxdialog/inputbox.c
-index 611945611bf8..1dcfb288ee63 100644
---- a/kconfig/lxdialog/inputbox.c
-+++ b/kconfig/lxdialog/inputbox.c
-@@ -113,7 +113,8 @@ int dialog_inputbox(const char *title, const char *prompt, int height, int width
+Index: kconfig/lxdialog/inputbox.c
+===================================================================
+--- kconfig.orig/lxdialog/inputbox.c
++++ kconfig/lxdialog/inputbox.c
+@@ -126,7 +126,8 @@ int dialog_inputbox(const char *title, const char *prompt, int height, int width
case KEY_DOWN:
break;
case KEY_BACKSPACE:
@@ -30,10 +30,10 @@ index 611945611bf8..1dcfb288ee63 100644
if (pos) {
wattrset(dialog, dlg.inputbox.atr);
if (input_x == 0) {
-diff --git a/kconfig/nconf.c b/kconfig/nconf.c
-index a4670f4e825a..ac92c0ded6c5 100644
---- a/kconfig/nconf.c
-+++ b/kconfig/nconf.c
+Index: kconfig/nconf.c
+===================================================================
+--- kconfig.orig/nconf.c
++++ kconfig/nconf.c
@@ -1048,7 +1048,7 @@ static int do_match(int key, struct match_state *state, int *ans)
state->match_direction = FIND_NEXT_MATCH_UP;
*ans = get_mext_match(state->pattern,
@@ -43,11 +43,11 @@ index a4670f4e825a..ac92c0ded6c5 100644
state->pattern[strlen(state->pattern)-1] = '\0';
adj_match_dir(&state->match_direction);
} else
-diff --git a/kconfig/nconf.gui.c b/kconfig/nconf.gui.c
-index 7be620a1fcdb..77f525a8617c 100644
---- a/kconfig/nconf.gui.c
-+++ b/kconfig/nconf.gui.c
-@@ -439,7 +439,8 @@ int dialog_inputbox(WINDOW *main_window,
+Index: kconfig/nconf.gui.c
+===================================================================
+--- kconfig.orig/nconf.gui.c
++++ kconfig/nconf.gui.c
+@@ -440,7 +440,8 @@ int dialog_inputbox(WINDOW *main_window,
case KEY_F(F_EXIT):
case KEY_F(F_BACK):
break;
@@ -57,6 +57,3 @@ index 7be620a1fcdb..77f525a8617c 100644
case KEY_BACKSPACE:
if (cursor_position > 0) {
memmove(&result[cursor_position-1],
---
-2.48.1
-
--
2.43.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH v2 2/4] support/kconfig/patches: add missing patch
2025-07-16 18:15 [Buildroot] [PATCH v2 0/4] Fix compiler warnings in support/kconfig Edgar Bonet via buildroot
2025-07-16 18:17 ` [Buildroot] [PATCH v2 1/4] support/kconfig/patches: make all patches quilt-friendly Edgar Bonet via buildroot
@ 2025-07-16 18:18 ` Edgar Bonet via buildroot
2025-07-16 18:19 ` [Buildroot] [PATCH v2 3/4] support/kconfig: fix compiler warning in util.c Edgar Bonet via buildroot
2025-07-16 18:20 ` [Buildroot] [PATCH v2 4/4] support/kconfig: fix compiler warning in nconf.c Edgar Bonet via buildroot
3 siblings, 0 replies; 9+ messages in thread
From: Edgar Bonet via buildroot @ 2025-07-16 18:18 UTC (permalink / raw)
To: Buildroot development; +Cc: Petr Vorel, Julien Olivain
Commit 324612d68e09 ("support/kconfig: fix compiler warnings") updated
two source files in support/kconfig but failed to add a corresponding
patch in the patches/ subdirectory. Let's add it now, for the sake of
maintaining consistency.
Signed-off-by: Edgar Bonet <bonet@grenoble.cnrs.fr>
---
.../patches/24-fix--Wformat-warnings.patch | 37 +++++++++++++++++++
support/kconfig/patches/series | 1 +
2 files changed, 38 insertions(+)
create mode 100644 support/kconfig/patches/24-fix--Wformat-warnings.patch
diff --git a/support/kconfig/patches/24-fix--Wformat-warnings.patch b/support/kconfig/patches/24-fix--Wformat-warnings.patch
new file mode 100644
index 0000000000..4b631e554f
--- /dev/null
+++ b/support/kconfig/patches/24-fix--Wformat-warnings.patch
@@ -0,0 +1,37 @@
+Fix -Wformat-overflow compiler warnings.
+
+Index: kconfig/confdata.c
+===================================================================
+--- kconfig.orig/confdata.c
++++ kconfig/confdata.c
+@@ -744,7 +744,7 @@ int conf_write(const char *name)
+ struct menu *menu;
+ const char *basename;
+ const char *str;
+- char dirname[PATH_MAX+1], tmpname[PATH_MAX+1], newname[PATH_MAX+1];
++ char dirname[PATH_MAX+1], tmpname[PATH_MAX+20], newname[PATH_MAX+1];
+ char *env;
+
+ if (!name)
+@@ -974,7 +974,7 @@ int conf_write_autoconf(void)
+ const char *name;
+ FILE *out, *tristate, *out_h;
+ int i;
+- char dir[PATH_MAX+1], buf[PATH_MAX+1];
++ char dir[PATH_MAX+1], buf[PATH_MAX+20];
+ char *s;
+
+ strcpy(dir, conf_get_configname());
+Index: kconfig/util.c
+===================================================================
+--- kconfig.orig/util.c
++++ kconfig/util.c
+@@ -35,7 +35,7 @@ struct file *file_lookup(const char *nam
+ int file_write_dep(const char *name)
+ {
+ char *str;
+- char buf[PATH_MAX+1], buf2[PATH_MAX+1], dir[PATH_MAX+1];
++ char buf[PATH_MAX+20], buf2[PATH_MAX+1], dir[PATH_MAX+1];
+ struct symbol *sym, *env_sym;
+ struct expr *e;
+ struct file *file;
diff --git a/support/kconfig/patches/series b/support/kconfig/patches/series
index cc176035be..763b679900 100644
--- a/support/kconfig/patches/series
+++ b/support/kconfig/patches/series
@@ -12,3 +12,4 @@
21-Avoid-false-positive-matches-from-comment-lines.patch
22-kconfig-lxdialog-fix-check-with-GCC14.patch
23-kconfig-mn-conf-handle-backspace-H-key.patch
+24-fix--Wformat-warnings.patch
--
2.43.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH v2 3/4] support/kconfig: fix compiler warning in util.c
2025-07-16 18:15 [Buildroot] [PATCH v2 0/4] Fix compiler warnings in support/kconfig Edgar Bonet via buildroot
2025-07-16 18:17 ` [Buildroot] [PATCH v2 1/4] support/kconfig/patches: make all patches quilt-friendly Edgar Bonet via buildroot
2025-07-16 18:18 ` [Buildroot] [PATCH v2 2/4] support/kconfig/patches: add missing patch Edgar Bonet via buildroot
@ 2025-07-16 18:19 ` Edgar Bonet via buildroot
2025-07-16 18:20 ` [Buildroot] [PATCH v2 4/4] support/kconfig: fix compiler warning in nconf.c Edgar Bonet via buildroot
3 siblings, 0 replies; 9+ messages in thread
From: Edgar Bonet via buildroot @ 2025-07-16 18:19 UTC (permalink / raw)
To: Buildroot development; +Cc: Petr Vorel, Julien Olivain
Some make targets such as menuconfig or *_defconfig build code from
support/kconfig. If this is done with host GCC 13, we get the following
compiler warning:
./util.c: In function ‘file_write_dep’:
./util.c:86:26: warning: ‘%s’ directive writing 10 or more bytes into a region of size between 1 and 4097 [-Wformat-overflow=]
86 | sprintf(buf2, "%s%s", dir, name);
| ^~
./util.c:86:9: note: ‘sprintf’ output 11 or more bytes (assuming 4107) into a destination of size 4097
86 | sprintf(buf2, "%s%s", dir, name);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This is similar to the warnings generated by GCC 9.4 and fixed in
324612d68e09 ("support/kconfig: fix compiler warnings").
Avoid the warning by enlarging the destination buffer of fprintf().
Also, update patches/24-fix--Wformat-warnings.patch to stay in sync with
the code.
Signed-off-by: Edgar Bonet <bonet@grenoble.cnrs.fr>
---
support/kconfig/patches/24-fix--Wformat-warnings.patch | 2 +-
support/kconfig/util.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/support/kconfig/patches/24-fix--Wformat-warnings.patch b/support/kconfig/patches/24-fix--Wformat-warnings.patch
index 4b631e554f..0e8a883edf 100644
--- a/support/kconfig/patches/24-fix--Wformat-warnings.patch
+++ b/support/kconfig/patches/24-fix--Wformat-warnings.patch
@@ -31,7 +31,7 @@ Index: kconfig/util.c
{
char *str;
- char buf[PATH_MAX+1], buf2[PATH_MAX+1], dir[PATH_MAX+1];
-+ char buf[PATH_MAX+20], buf2[PATH_MAX+1], dir[PATH_MAX+1];
++ char buf[PATH_MAX+20], buf2[PATH_MAX+11], dir[PATH_MAX+1];
struct symbol *sym, *env_sym;
struct expr *e;
struct file *file;
diff --git a/support/kconfig/util.c b/support/kconfig/util.c
index 8665f5bb89..86ce994367 100644
--- a/support/kconfig/util.c
+++ b/support/kconfig/util.c
@@ -35,7 +35,7 @@ struct file *file_lookup(const char *name)
int file_write_dep(const char *name)
{
char *str;
- char buf[PATH_MAX+20], buf2[PATH_MAX+1], dir[PATH_MAX+1];
+ char buf[PATH_MAX+20], buf2[PATH_MAX+11], dir[PATH_MAX+1];
struct symbol *sym, *env_sym;
struct expr *e;
struct file *file;
--
2.43.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH v2 4/4] support/kconfig: fix compiler warning in nconf.c
2025-07-16 18:15 [Buildroot] [PATCH v2 0/4] Fix compiler warnings in support/kconfig Edgar Bonet via buildroot
` (2 preceding siblings ...)
2025-07-16 18:19 ` [Buildroot] [PATCH v2 3/4] support/kconfig: fix compiler warning in util.c Edgar Bonet via buildroot
@ 2025-07-16 18:20 ` Edgar Bonet via buildroot
3 siblings, 0 replies; 9+ messages in thread
From: Edgar Bonet via buildroot @ 2025-07-16 18:20 UTC (permalink / raw)
To: Buildroot development; +Cc: Petr Vorel, Julien Olivain
Running “make nconfig” with host GCC 13 gives this warning:
nconf.c: In function ‘item_add_str’:
nconf.c:578:47: warning: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size between 1 and 256 [-Wformat-truncation=]
578 | snprintf(tmp_str, sizeof(tmp_str), "%s%s",
| ^~
579 | k_menu_items[index].str, new_str);
| ~~~~~~~
nconf.c:578:9: note: ‘snprintf’ output between 1 and 511 bytes into a destination of size 256
578 | snprintf(tmp_str, sizeof(tmp_str), "%s%s",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
579 | k_menu_items[index].str, new_str);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Fix it by enlarging the destination buffer of snprintf(). Also, update
patches/24-fix--Wformat-warnings.patch accordingly.
Signed-off-by: Edgar Bonet <bonet@grenoble.cnrs.fr>
---
support/kconfig/nconf.c | 2 +-
.../patches/24-fix--Wformat-warnings.patch | 15 ++++++++++++++-
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/support/kconfig/nconf.c b/support/kconfig/nconf.c
index e8e1944fa0..e15c1ff425 100644
--- a/support/kconfig/nconf.c
+++ b/support/kconfig/nconf.c
@@ -567,7 +567,7 @@ static void item_add_str(const char *fmt, ...)
va_list ap;
int index = items_num-1;
char new_str[256];
- char tmp_str[256];
+ char tmp_str[512];
if (index < 0)
return;
diff --git a/support/kconfig/patches/24-fix--Wformat-warnings.patch b/support/kconfig/patches/24-fix--Wformat-warnings.patch
index 0e8a883edf..54a66c6970 100644
--- a/support/kconfig/patches/24-fix--Wformat-warnings.patch
+++ b/support/kconfig/patches/24-fix--Wformat-warnings.patch
@@ -1,4 +1,4 @@
-Fix -Wformat-overflow compiler warnings.
+Fix -Wformat-overflow and -Wformat-truncation compiler warnings.
Index: kconfig/confdata.c
===================================================================
@@ -35,3 +35,16 @@ Index: kconfig/util.c
struct symbol *sym, *env_sym;
struct expr *e;
struct file *file;
+Index: kconfig/nconf.c
+===================================================================
+--- kconfig.orig/nconf.c
++++ kconfig/nconf.c
+@@ -567,7 +567,7 @@ static void item_add_str(const char *fmt
+ va_list ap;
+ int index = items_num-1;
+ char new_str[256];
+- char tmp_str[256];
++ char tmp_str[512];
+
+ if (index < 0)
+ return;
--
2.43.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [Buildroot] [PATCH v2 1/4] support/kconfig/patches: make all patches quilt-friendly
2025-07-16 18:17 ` [Buildroot] [PATCH v2 1/4] support/kconfig/patches: make all patches quilt-friendly Edgar Bonet via buildroot
@ 2025-07-16 20:39 ` Petr Vorel
2025-07-16 21:08 ` Edgar Bonet via buildroot
0 siblings, 1 reply; 9+ messages in thread
From: Petr Vorel @ 2025-07-16 20:39 UTC (permalink / raw)
To: Edgar Bonet; +Cc: Buildroot development, Julien Olivain, Yann E. MORIN
Hi Edgar,
> According to support/kconfig/README.buildroot, the patches in
> support/kconfig/patches/ are meant to be applied by quilt. However, two
> of those patches are in git format, which makes quilt error out with:
> Applying patch patches/22-kconfig-lxdialog-fix-check-with-GCC14.patch
> can't find file to patch at input line 32
> [...]
> No file to patch. Skipping patch.
> Fix the format to make quilt happy.
How about using 'git quiltimport' instead?
Kind regards,
Petr
> Signed-off-by: Edgar Bonet <bonet@grenoble.cnrs.fr>
> ---
> ...config-lxdialog-fix-check-with-GCC14.patch | 11 +++----
> ...onfig-mn-conf-handle-backspace-H-key.patch | 31 +++++++++----------
> 2 files changed, 18 insertions(+), 24 deletions(-)
> diff --git a/support/kconfig/patches/22-kconfig-lxdialog-fix-check-with-GCC14.patch b/support/kconfig/patches/22-kconfig-lxdialog-fix-check-with-GCC14.patch
> index 41081bb45d..edcc857190 100644
> --- a/support/kconfig/patches/22-kconfig-lxdialog-fix-check-with-GCC14.patch
> +++ b/support/kconfig/patches/22-kconfig-lxdialog-fix-check-with-GCC14.patch
> @@ -25,10 +25,10 @@ Tested-by: Petr Vorel <petr.vorel@gmail.com>
> kconfig/lxdialog/check-lxdialog.sh | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> -diff --git a/kconfig/lxdialog/check-lxdialog.sh b/kconfig/lxdialog/check-lxdialog.sh
> -index 16cd9a3186..27d6c30a57 100755
> ---- a/kconfig/lxdialog/check-lxdialog.sh
> -+++ b/kconfig/lxdialog/check-lxdialog.sh
> +Index: kconfig.new/lxdialog/check-lxdialog.sh
> +===================================================================
> +--- kconfig.orig/lxdialog/check-lxdialog.sh
> ++++ kconfig/lxdialog/check-lxdialog.sh
> @@ -48,7 +48,7 @@ trap "rm -f $tmp" 0 1 2 3 15
> check() {
> $cc -x c - -o $tmp 2>/dev/null <<'EOF'
> @@ -38,6 +38,3 @@ index 16cd9a3186..27d6c30a57 100755
> EOF
> if [ $? != 0 ]; then
> echo " *** Unable to find the ncurses libraries or the" 1>&2
> ---
> -2.44.0
> -
> diff --git a/support/kconfig/patches/23-kconfig-mn-conf-handle-backspace-H-key.patch b/support/kconfig/patches/23-kconfig-mn-conf-handle-backspace-H-key.patch
> index 6e32115f70..f72f9f339b 100644
> --- a/support/kconfig/patches/23-kconfig-mn-conf-handle-backspace-H-key.patch
> +++ b/support/kconfig/patches/23-kconfig-mn-conf-handle-backspace-H-key.patch
> @@ -16,11 +16,11 @@ Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> kconfig/nconf.gui.c | 3 ++-
> 3 files changed, 5 insertions(+), 3 deletions(-)
> -diff --git a/kconfig/lxdialog/inputbox.c b/kconfig/lxdialog/inputbox.c
> -index 611945611bf8..1dcfb288ee63 100644
> ---- a/kconfig/lxdialog/inputbox.c
> -+++ b/kconfig/lxdialog/inputbox.c
> -@@ -113,7 +113,8 @@ int dialog_inputbox(const char *title, const char *prompt, int height, int width
> +Index: kconfig/lxdialog/inputbox.c
> +===================================================================
> +--- kconfig.orig/lxdialog/inputbox.c
> ++++ kconfig/lxdialog/inputbox.c
> +@@ -126,7 +126,8 @@ int dialog_inputbox(const char *title, const char *prompt, int height, int width
> case KEY_DOWN:
> break;
> case KEY_BACKSPACE:
> @@ -30,10 +30,10 @@ index 611945611bf8..1dcfb288ee63 100644
> if (pos) {
> wattrset(dialog, dlg.inputbox.atr);
> if (input_x == 0) {
> -diff --git a/kconfig/nconf.c b/kconfig/nconf.c
> -index a4670f4e825a..ac92c0ded6c5 100644
> ---- a/kconfig/nconf.c
> -+++ b/kconfig/nconf.c
> +Index: kconfig/nconf.c
> +===================================================================
> +--- kconfig.orig/nconf.c
> ++++ kconfig/nconf.c
> @@ -1048,7 +1048,7 @@ static int do_match(int key, struct match_state *state, int *ans)
> state->match_direction = FIND_NEXT_MATCH_UP;
> *ans = get_mext_match(state->pattern,
> @@ -43,11 +43,11 @@ index a4670f4e825a..ac92c0ded6c5 100644
> state->pattern[strlen(state->pattern)-1] = '\0';
> adj_match_dir(&state->match_direction);
> } else
> -diff --git a/kconfig/nconf.gui.c b/kconfig/nconf.gui.c
> -index 7be620a1fcdb..77f525a8617c 100644
> ---- a/kconfig/nconf.gui.c
> -+++ b/kconfig/nconf.gui.c
> -@@ -439,7 +439,8 @@ int dialog_inputbox(WINDOW *main_window,
> +Index: kconfig/nconf.gui.c
> +===================================================================
> +--- kconfig.orig/nconf.gui.c
> ++++ kconfig/nconf.gui.c
> +@@ -440,7 +440,8 @@ int dialog_inputbox(WINDOW *main_window,
> case KEY_F(F_EXIT):
> case KEY_F(F_BACK):
> break;
> @@ -57,6 +57,3 @@ index 7be620a1fcdb..77f525a8617c 100644
> case KEY_BACKSPACE:
> if (cursor_position > 0) {
> memmove(&result[cursor_position-1],
> ---
> -2.48.1
> -
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Buildroot] [PATCH v2 1/4] support/kconfig/patches: make all patches quilt-friendly
2025-07-16 20:39 ` Petr Vorel
@ 2025-07-16 21:08 ` Edgar Bonet via buildroot
2025-07-16 22:01 ` Petr Vorel
0 siblings, 1 reply; 9+ messages in thread
From: Edgar Bonet via buildroot @ 2025-07-16 21:08 UTC (permalink / raw)
To: Petr Vorel; +Cc: Buildroot development, Julien Olivain, Yann E. MORIN
On 16/07/2025 22:39, Petr Vorel wrote:
> Hi Edgar,
>
>> According to support/kconfig/README.buildroot, the patches in
>> support/kconfig/patches/ are meant to be applied by quilt. However, two
>> of those patches are in git format, which makes quilt error out with:
>
>> Applying patch patches/22-kconfig-lxdialog-fix-check-with-GCC14.patch
>> can't find file to patch at input line 32
>> [...]
>> No file to patch. Skipping patch.
>
>> Fix the format to make quilt happy.
>
> How about using 'git quiltimport' instead?
I didn't know about “git quiltimport”. I guess
support/kconfig/README.buildroot could be rewritten to use it, although
the fact that “git quiltimport” creates commits may somewhat complicate
the procedure described there.
Regards,
Edgar.
> Kind regards,
> Petr
>
>> Signed-off-by: Edgar Bonet <bonet@grenoble.cnrs.fr>
>> ---
>> ...config-lxdialog-fix-check-with-GCC14.patch | 11 +++----
>> ...onfig-mn-conf-handle-backspace-H-key.patch | 31 +++++++++----------
>> 2 files changed, 18 insertions(+), 24 deletions(-)
>
>> diff --git a/support/kconfig/patches/22-kconfig-lxdialog-fix-check-with-GCC14.patch b/support/kconfig/patches/22-kconfig-lxdialog-fix-check-with-GCC14.patch
>> index 41081bb45d..edcc857190 100644
>> --- a/support/kconfig/patches/22-kconfig-lxdialog-fix-check-with-GCC14.patch
>> +++ b/support/kconfig/patches/22-kconfig-lxdialog-fix-check-with-GCC14.patch
>> @@ -25,10 +25,10 @@ Tested-by: Petr Vorel <petr.vorel@gmail.com>
>> kconfig/lxdialog/check-lxdialog.sh | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>> -diff --git a/kconfig/lxdialog/check-lxdialog.sh b/kconfig/lxdialog/check-lxdialog.sh
>> -index 16cd9a3186..27d6c30a57 100755
>> ---- a/kconfig/lxdialog/check-lxdialog.sh
>> -+++ b/kconfig/lxdialog/check-lxdialog.sh
>> +Index: kconfig.new/lxdialog/check-lxdialog.sh
>> +===================================================================
>> +--- kconfig.orig/lxdialog/check-lxdialog.sh
>> ++++ kconfig/lxdialog/check-lxdialog.sh
>> @@ -48,7 +48,7 @@ trap "rm -f $tmp" 0 1 2 3 15
>> check() {
>> $cc -x c - -o $tmp 2>/dev/null <<'EOF'
>> @@ -38,6 +38,3 @@ index 16cd9a3186..27d6c30a57 100755
>> EOF
>> if [ $? != 0 ]; then
>> echo " *** Unable to find the ncurses libraries or the" 1>&2
>> ---
>> -2.44.0
>> -
>> diff --git a/support/kconfig/patches/23-kconfig-mn-conf-handle-backspace-H-key.patch b/support/kconfig/patches/23-kconfig-mn-conf-handle-backspace-H-key.patch
>> index 6e32115f70..f72f9f339b 100644
>> --- a/support/kconfig/patches/23-kconfig-mn-conf-handle-backspace-H-key.patch
>> +++ b/support/kconfig/patches/23-kconfig-mn-conf-handle-backspace-H-key.patch
>> @@ -16,11 +16,11 @@ Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
>> kconfig/nconf.gui.c | 3 ++-
>> 3 files changed, 5 insertions(+), 3 deletions(-)
>
>> -diff --git a/kconfig/lxdialog/inputbox.c b/kconfig/lxdialog/inputbox.c
>> -index 611945611bf8..1dcfb288ee63 100644
>> ---- a/kconfig/lxdialog/inputbox.c
>> -+++ b/kconfig/lxdialog/inputbox.c
>> -@@ -113,7 +113,8 @@ int dialog_inputbox(const char *title, const char *prompt, int height, int width
>> +Index: kconfig/lxdialog/inputbox.c
>> +===================================================================
>> +--- kconfig.orig/lxdialog/inputbox.c
>> ++++ kconfig/lxdialog/inputbox.c
>> +@@ -126,7 +126,8 @@ int dialog_inputbox(const char *title, const char *prompt, int height, int width
>> case KEY_DOWN:
>> break;
>> case KEY_BACKSPACE:
>> @@ -30,10 +30,10 @@ index 611945611bf8..1dcfb288ee63 100644
>> if (pos) {
>> wattrset(dialog, dlg.inputbox.atr);
>> if (input_x == 0) {
>> -diff --git a/kconfig/nconf.c b/kconfig/nconf.c
>> -index a4670f4e825a..ac92c0ded6c5 100644
>> ---- a/kconfig/nconf.c
>> -+++ b/kconfig/nconf.c
>> +Index: kconfig/nconf.c
>> +===================================================================
>> +--- kconfig.orig/nconf.c
>> ++++ kconfig/nconf.c
>> @@ -1048,7 +1048,7 @@ static int do_match(int key, struct match_state *state, int *ans)
>> state->match_direction = FIND_NEXT_MATCH_UP;
>> *ans = get_mext_match(state->pattern,
>> @@ -43,11 +43,11 @@ index a4670f4e825a..ac92c0ded6c5 100644
>> state->pattern[strlen(state->pattern)-1] = '\0';
>> adj_match_dir(&state->match_direction);
>> } else
>> -diff --git a/kconfig/nconf.gui.c b/kconfig/nconf.gui.c
>> -index 7be620a1fcdb..77f525a8617c 100644
>> ---- a/kconfig/nconf.gui.c
>> -+++ b/kconfig/nconf.gui.c
>> -@@ -439,7 +439,8 @@ int dialog_inputbox(WINDOW *main_window,
>> +Index: kconfig/nconf.gui.c
>> +===================================================================
>> +--- kconfig.orig/nconf.gui.c
>> ++++ kconfig/nconf.gui.c
>> +@@ -440,7 +440,8 @@ int dialog_inputbox(WINDOW *main_window,
>> case KEY_F(F_EXIT):
>> case KEY_F(F_BACK):
>> break;
>> @@ -57,6 +57,3 @@ index 7be620a1fcdb..77f525a8617c 100644
>> case KEY_BACKSPACE:
>> if (cursor_position > 0) {
>> memmove(&result[cursor_position-1],
>> ---
>> -2.48.1
>> -
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Buildroot] [PATCH v2 1/4] support/kconfig/patches: make all patches quilt-friendly
2025-07-16 21:08 ` Edgar Bonet via buildroot
@ 2025-07-16 22:01 ` Petr Vorel
2025-07-17 10:53 ` Edgar Bonet via buildroot
0 siblings, 1 reply; 9+ messages in thread
From: Petr Vorel @ 2025-07-16 22:01 UTC (permalink / raw)
To: Edgar Bonet; +Cc: Buildroot development, Julien Olivain, Yann E. MORIN
> On 16/07/2025 22:39, Petr Vorel wrote:
> > Hi Edgar,
> >> According to support/kconfig/README.buildroot, the patches in
> >> support/kconfig/patches/ are meant to be applied by quilt. However, two
> >> of those patches are in git format, which makes quilt error out with:
> >> Applying patch patches/22-kconfig-lxdialog-fix-check-with-GCC14.patch
> >> can't find file to patch at input line 32
> >> [...]
> >> No file to patch. Skipping patch.
> >> Fix the format to make quilt happy.
> > How about using 'git quiltimport' instead?
> I didn't know about “git quiltimport”. I guess
> support/kconfig/README.buildroot could be rewritten to use it, although
> the fact that “git quiltimport” creates commits may somewhat complicate
> the procedure described there.
OK, although I regret loosing metadata, I'm not against using quilt format.
I have never used quilt to update, therefore I haven't experienced problems with
a patch format. If support/kconfig/README.buildroot is still up to date and this
patch is updated it'd be good to update support/kconfig/README.buildroot to
mention how to create quilt compatible patches. I suppose it's something like:
git format-patch --no-signature --no-stat --subject-prefix="" ...
Kind regards,
Petr
> Regards,
> Edgar.
> > Kind regards,
> > Petr
> >> Signed-off-by: Edgar Bonet <bonet@grenoble.cnrs.fr>
> >> ---
> >> ...config-lxdialog-fix-check-with-GCC14.patch | 11 +++----
> >> ...onfig-mn-conf-handle-backspace-H-key.patch | 31 +++++++++----------
> >> 2 files changed, 18 insertions(+), 24 deletions(-)
> >> diff --git a/support/kconfig/patches/22-kconfig-lxdialog-fix-check-with-GCC14.patch b/support/kconfig/patches/22-kconfig-lxdialog-fix-check-with-GCC14.patch
> >> index 41081bb45d..edcc857190 100644
> >> --- a/support/kconfig/patches/22-kconfig-lxdialog-fix-check-with-GCC14.patch
> >> +++ b/support/kconfig/patches/22-kconfig-lxdialog-fix-check-with-GCC14.patch
> >> @@ -25,10 +25,10 @@ Tested-by: Petr Vorel <petr.vorel@gmail.com>
> >> kconfig/lxdialog/check-lxdialog.sh | 2 +-
> >> 1 file changed, 1 insertion(+), 1 deletion(-)
> >> -diff --git a/kconfig/lxdialog/check-lxdialog.sh b/kconfig/lxdialog/check-lxdialog.sh
> >> -index 16cd9a3186..27d6c30a57 100755
> >> ---- a/kconfig/lxdialog/check-lxdialog.sh
> >> -+++ b/kconfig/lxdialog/check-lxdialog.sh
> >> +Index: kconfig.new/lxdialog/check-lxdialog.sh
> >> +===================================================================
> >> +--- kconfig.orig/lxdialog/check-lxdialog.sh
> >> ++++ kconfig/lxdialog/check-lxdialog.sh
> >> @@ -48,7 +48,7 @@ trap "rm -f $tmp" 0 1 2 3 15
> >> check() {
> >> $cc -x c - -o $tmp 2>/dev/null <<'EOF'
> >> @@ -38,6 +38,3 @@ index 16cd9a3186..27d6c30a57 100755
> >> EOF
> >> if [ $? != 0 ]; then
> >> echo " *** Unable to find the ncurses libraries or the" 1>&2
> >> ---
> >> -2.44.0
> >> -
> >> diff --git a/support/kconfig/patches/23-kconfig-mn-conf-handle-backspace-H-key.patch b/support/kconfig/patches/23-kconfig-mn-conf-handle-backspace-H-key.patch
> >> index 6e32115f70..f72f9f339b 100644
> >> --- a/support/kconfig/patches/23-kconfig-mn-conf-handle-backspace-H-key.patch
> >> +++ b/support/kconfig/patches/23-kconfig-mn-conf-handle-backspace-H-key.patch
> >> @@ -16,11 +16,11 @@ Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> >> kconfig/nconf.gui.c | 3 ++-
> >> 3 files changed, 5 insertions(+), 3 deletions(-)
> >> -diff --git a/kconfig/lxdialog/inputbox.c b/kconfig/lxdialog/inputbox.c
> >> -index 611945611bf8..1dcfb288ee63 100644
> >> ---- a/kconfig/lxdialog/inputbox.c
> >> -+++ b/kconfig/lxdialog/inputbox.c
> >> -@@ -113,7 +113,8 @@ int dialog_inputbox(const char *title, const char *prompt, int height, int width
> >> +Index: kconfig/lxdialog/inputbox.c
> >> +===================================================================
> >> +--- kconfig.orig/lxdialog/inputbox.c
> >> ++++ kconfig/lxdialog/inputbox.c
> >> +@@ -126,7 +126,8 @@ int dialog_inputbox(const char *title, const char *prompt, int height, int width
> >> case KEY_DOWN:
> >> break;
> >> case KEY_BACKSPACE:
> >> @@ -30,10 +30,10 @@ index 611945611bf8..1dcfb288ee63 100644
> >> if (pos) {
> >> wattrset(dialog, dlg.inputbox.atr);
> >> if (input_x == 0) {
> >> -diff --git a/kconfig/nconf.c b/kconfig/nconf.c
> >> -index a4670f4e825a..ac92c0ded6c5 100644
> >> ---- a/kconfig/nconf.c
> >> -+++ b/kconfig/nconf.c
> >> +Index: kconfig/nconf.c
> >> +===================================================================
> >> +--- kconfig.orig/nconf.c
> >> ++++ kconfig/nconf.c
> >> @@ -1048,7 +1048,7 @@ static int do_match(int key, struct match_state *state, int *ans)
> >> state->match_direction = FIND_NEXT_MATCH_UP;
> >> *ans = get_mext_match(state->pattern,
> >> @@ -43,11 +43,11 @@ index a4670f4e825a..ac92c0ded6c5 100644
> >> state->pattern[strlen(state->pattern)-1] = '\0';
> >> adj_match_dir(&state->match_direction);
> >> } else
> >> -diff --git a/kconfig/nconf.gui.c b/kconfig/nconf.gui.c
> >> -index 7be620a1fcdb..77f525a8617c 100644
> >> ---- a/kconfig/nconf.gui.c
> >> -+++ b/kconfig/nconf.gui.c
> >> -@@ -439,7 +439,8 @@ int dialog_inputbox(WINDOW *main_window,
> >> +Index: kconfig/nconf.gui.c
> >> +===================================================================
> >> +--- kconfig.orig/nconf.gui.c
> >> ++++ kconfig/nconf.gui.c
> >> +@@ -440,7 +440,8 @@ int dialog_inputbox(WINDOW *main_window,
> >> case KEY_F(F_EXIT):
> >> case KEY_F(F_BACK):
> >> break;
> >> @@ -57,6 +57,3 @@ index 7be620a1fcdb..77f525a8617c 100644
> >> case KEY_BACKSPACE:
> >> if (cursor_position > 0) {
> >> memmove(&result[cursor_position-1],
> >> ---
> >> -2.48.1
> >> -
> > _______________________________________________
> > buildroot mailing list
> > buildroot@buildroot.org
> > https://lists.buildroot.org/mailman/listinfo/buildroot
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Buildroot] [PATCH v2 1/4] support/kconfig/patches: make all patches quilt-friendly
2025-07-16 22:01 ` Petr Vorel
@ 2025-07-17 10:53 ` Edgar Bonet via buildroot
0 siblings, 0 replies; 9+ messages in thread
From: Edgar Bonet via buildroot @ 2025-07-17 10:53 UTC (permalink / raw)
To: Petr Vorel; +Cc: Buildroot development, Julien Olivain, Yann E. MORIN
Hello!
Petr Vorel wrote:
> OK, although I regret loosing metadata, I'm not against using quilt
> format.
Loosing metadata? What metadata? AFAIU, quilt ignores everything in the
patch file that comes before the actual patch data. You can add whatever
information you want as a patch header. If you look at my patch 1/4, all
it does is:
1. Replace groups of lines like this:
diff --git a/kconfig/lxdialog/check-lxdialog.sh b/kconfig/lxdialog/check-lxdialog.sh
index 16cd9a3186..27d6c30a57 100755
--- a/kconfig/lxdialog/check-lxdialog.sh
+++ b/kconfig/lxdialog/check-lxdialog.sh
with:
Index: kconfig.new/lxdialog/check-lxdialog.sh
===================================================================
--- kconfig.orig/lxdialog/check-lxdialog.sh
+++ kconfig/lxdialog/check-lxdialog.sh
2. Remove git version signatures like
--
2.44.0
Is it the blob ids (16cd9a3186, 27d6c30a57) that you regret loosing?
> I have never used quilt to update,
I am not a quilt user either, and just discovered the tool while
authoring this patch series.
> therefore I haven't experienced problems with a patch format.
> If support/kconfig/README.buildroot is still up to date and this patch
> is updated it'd be good to update support/kconfig/README.buildroot to
> mention how to create quilt compatible patches.
That would have helped me for sure...
> I suppose it's something like:
>
> git format-patch --no-signature --no-stat --subject-prefix="" ...
No. This command still uses the format
diff --git a/$file b/$file
index $blob1_sha1..$blob2_sha1 $perms
--- a/$file
+++ b/$file
which quilt chokes on. I would rather do something like this:
# Hack something inside support/kconfig, commit, then:
changed_files="foo.h" # the files that we changed
patch_file=25-hack-something.patch # pick the next available number
linux_repo=$HOME/src/linux # local linux git clone
linux_rev=v4.17-rc2 # current base for support/kconfig
# Prepare a quilt-aware copy of support/kconfig.
git -C $linux_repo archive --prefix=support/kconfig.quilt/ \
$linux_rev:scripts/kconfig | tar -xf -
cd support/kconfig
cp -a *_shipped patches ../kconfig.quilt
cd ../kconfig.quilt
sed -i 's/Buildroot/Linux Kernel/' zconf.tab.c_shipped
quilt push -a
# Prepare the new patch.
quilt new patches/$patch_file
quilt add $changed_files
(cd ../kconfig && cp -a $changed_files ../kconfig.quilt)
quilt refresh
sed -i 's/\.quilt//' patches/$patch_file
$EDITOR patches/$patch_file # add a comment as the patch header
# Add the patch to the commit.
rsync -a patches ../kconfig/
git add ../kconfig/patches
git commit --amend ../kconfig/patches
It is a bit contrived. A seasoned quilt user would probably come up with
something much simpler.
Regards,
Edgar.
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2025-07-17 10:54 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-16 18:15 [Buildroot] [PATCH v2 0/4] Fix compiler warnings in support/kconfig Edgar Bonet via buildroot
2025-07-16 18:17 ` [Buildroot] [PATCH v2 1/4] support/kconfig/patches: make all patches quilt-friendly Edgar Bonet via buildroot
2025-07-16 20:39 ` Petr Vorel
2025-07-16 21:08 ` Edgar Bonet via buildroot
2025-07-16 22:01 ` Petr Vorel
2025-07-17 10:53 ` Edgar Bonet via buildroot
2025-07-16 18:18 ` [Buildroot] [PATCH v2 2/4] support/kconfig/patches: add missing patch Edgar Bonet via buildroot
2025-07-16 18:19 ` [Buildroot] [PATCH v2 3/4] support/kconfig: fix compiler warning in util.c Edgar Bonet via buildroot
2025-07-16 18:20 ` [Buildroot] [PATCH v2 4/4] support/kconfig: fix compiler warning in nconf.c Edgar Bonet via buildroot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox