summaryrefslogtreecommitdiff
path: root/package/config/patches/03-change-config-option-prefix.patch
diff options
context:
space:
mode:
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>2010-08-21 15:59:10 +0200
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2010-09-01 12:26:41 +0200
commit7c524dd0b683e1e8fac4e4084ac7678576bfbe07 (patch)
tree557327667ec2d0bf0bdb94894a4452c4ad8908c5 /package/config/patches/03-change-config-option-prefix.patch
parent6f38119cbb2cf5dd9c64109ff331a3d3868460ff (diff)
Clean up our patches against kconfig
Our kconfig-to-buildroot2.patch hasn't been kept up to date with all the changes made into package/config, and a single patch wasn't very practical to maintain all our changes. Therefore, this commit adds a package/config/patches directory, which contains a Quilt series of patches that correspond to our modifications to the kconfig mechanism. The huge kconfig-to-buildroot2.patch has been split into 16 smaller patches. The purpose of some of the modifications has been clearly identified, while some others were not identified. The 16 patches together do match exactly the old kconfig-to-buildroot2.patch. We have been very careful in making sure that we wouldn't loose any of our modifications. The only modifications made are : * Instead of renaming the kernel Makefile to Makefile.kconfig and naming the Buildroot Makefile just 'Makefile', we instead keep the original package/config/Makefile from the kernel scripts/kconfig/Makefile and name the Buildroot Makefile package/config/Makefile.br. The main Buildroot Makefile is modified accordingly. * The documentation README.buildroot2 is updated to explain how to upgrade to a newer version of scripts/kconfig. * The kconfig-language.txt documentation is removed, as anybody can easily find it in the kernel sources so there's no need to duplicate it here. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'package/config/patches/03-change-config-option-prefix.patch')
-rw-r--r--package/config/patches/03-change-config-option-prefix.patch176
1 files changed, 176 insertions, 0 deletions
diff --git a/package/config/patches/03-change-config-option-prefix.patch b/package/config/patches/03-change-config-option-prefix.patch
new file mode 100644
index 000000000..a786078c6
--- /dev/null
+++ b/package/config/patches/03-change-config-option-prefix.patch
@@ -0,0 +1,176 @@
+---
+ confdata.c | 57 +++++++++++++++++++++++++++------------------------------
+ 1 file changed, 27 insertions(+), 30 deletions(-)
+
+Index: config.clean/confdata.c
+===================================================================
+--- config.clean.orig/confdata.c
++++ config.clean/confdata.c
+@@ -11,6 +11,7 @@
+ #include <string.h>
+ #include <time.h>
+ #include <unistd.h>
++#include <libgen.h>
+
+ #define LKC_DIRECT_LINK
+ #include "lkc.h"
+@@ -21,7 +22,7 @@
+ static const char *conf_filename;
+ static int conf_lineno, conf_warnings, conf_unsaved;
+
+-const char conf_defname[] = "arch/$ARCH/defconfig";
++const char conf_defname[] = ".defconfig";
+
+ static void conf_warning(const char *fmt, ...)
+ {
+@@ -36,7 +37,7 @@
+
+ const char *conf_get_configname(void)
+ {
+- char *name = getenv("KCONFIG_CONFIG");
++ char *name = getenv("BUILDROOT_CONFIG");
+
+ return name ? name : ".config";
+ }
+@@ -212,22 +213,22 @@
+ sym = NULL;
+ switch (line[0]) {
+ case '#':
+- if (memcmp(line + 2, "CONFIG_", 7))
++ if (line[1]!=' ')
+ continue;
+- p = strchr(line + 9, ' ');
++ p = strchr(line + 2, ' ');
+ if (!p)
+ continue;
+ *p++ = 0;
+ if (strncmp(p, "is not set", 10))
+ continue;
+ if (def == S_DEF_USER) {
+- sym = sym_find(line + 9);
++ sym = sym_find(line + 2);
+ if (!sym) {
+ sym_add_change_count(1);
+ break;
+ }
+ } else {
+- sym = sym_lookup(line + 9, 0);
++ sym = sym_lookup(line + 2, 0);
+ if (sym->type == S_UNKNOWN)
+ sym->type = S_BOOLEAN;
+ }
+@@ -244,12 +245,8 @@
+ ;
+ }
+ break;
+- case 'C':
+- if (memcmp(line, "CONFIG_", 7)) {
+- conf_warning("unexpected data");
+- continue;
+- }
+- p = strchr(line + 7, '=');
++ case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': case 'H': case 'I': case 'J': case 'K': case 'L': case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R': case 'S': case 'T': case 'U': case 'V': case 'W': case 'X': case 'Y': case 'Z':
++ p = strchr(line, '=');
+ if (!p)
+ continue;
+ *p++ = 0;
+@@ -260,13 +257,13 @@
+ *p2 = 0;
+ }
+ if (def == S_DEF_USER) {
+- sym = sym_find(line + 7);
++ sym = sym_find(line);
+ if (!sym) {
+ sym_add_change_count(1);
+ break;
+ }
+ } else {
+- sym = sym_lookup(line + 7, 0);
++ sym = sym_lookup(line, 0);
+ if (sym->type == S_UNKNOWN)
+ sym->type = S_OTHER;
+ }
+@@ -480,19 +477,19 @@
+ case S_TRISTATE:
+ switch (sym_get_tristate_value(sym)) {
+ case no:
+- fprintf(out, "# CONFIG_%s is not set\n", sym->name);
++ fprintf(out, "# %s is not set\n", sym->name);
+ break;
+ case mod:
+- fprintf(out, "CONFIG_%s=m\n", sym->name);
++ fprintf(out, "%s=m\n", sym->name);
+ break;
+ case yes:
+- fprintf(out, "CONFIG_%s=y\n", sym->name);
++ fprintf(out, "%s=y\n", sym->name);
+ break;
+ }
+ break;
+ case S_STRING:
+ str = sym_get_string_value(sym);
+- fprintf(out, "CONFIG_%s=\"", sym->name);
++ fprintf(out, "%s=\"", sym->name);
+ while (1) {
+ l = strcspn(str, "\"\\");
+ if (l) {
+@@ -508,12 +505,12 @@
+ case S_HEX:
+ str = sym_get_string_value(sym);
+ if (str[0] != '0' || (str[1] != 'x' && str[1] != 'X')) {
+- fprintf(out, "CONFIG_%s=%s\n", sym->name, str);
++ fprintf(out, "%s=%s\n", sym->name, str);
+ break;
+ }
+ case S_INT:
+ str = sym_get_string_value(sym);
+- fprintf(out, "CONFIG_%s=%s\n", sym->name, str);
++ fprintf(out, "%s=%s\n", sym->name, str);
+ break;
+ }
+ }
+@@ -716,19 +713,19 @@
+ case no:
+ break;
+ case mod:
+- fprintf(out, "CONFIG_%s=m\n", sym->name);
+- fprintf(out_h, "#define CONFIG_%s_MODULE 1\n", sym->name);
++ fprintf(out, "%s=m\n", sym->name);
++ fprintf(out_h, "#define %s_MODULE 1\n", sym->name);
+ break;
+ case yes:
+- fprintf(out, "CONFIG_%s=y\n", sym->name);
+- fprintf(out_h, "#define CONFIG_%s 1\n", sym->name);
++ fprintf(out, "%s=y\n", sym->name);
++ fprintf(out_h, "#define %s 1\n", sym->name);
+ break;
+ }
+ break;
+ case S_STRING:
+ str = sym_get_string_value(sym);
+- fprintf(out, "CONFIG_%s=\"", sym->name);
+- fprintf(out_h, "#define CONFIG_%s \"", sym->name);
++ fprintf(out, "%s=\"", sym->name);
++ fprintf(out_h, "#define %s \"", sym->name);
+ while (1) {
+ l = strcspn(str, "\"\\");
+ if (l) {
+@@ -748,14 +745,14 @@
+ case S_HEX:
+ str = sym_get_string_value(sym);
+ if (str[0] != '0' || (str[1] != 'x' && str[1] != 'X')) {
+- fprintf(out, "CONFIG_%s=%s\n", sym->name, str);
+- fprintf(out_h, "#define CONFIG_%s 0x%s\n", sym->name, str);
++ fprintf(out, "%s=%s\n", sym->name, str);
++ fprintf(out_h, "#define %s 0x%s\n", sym->name, str);
+ break;
+ }
+ case S_INT:
+ str = sym_get_string_value(sym);
+- fprintf(out, "CONFIG_%s=%s\n", sym->name, str);
+- fprintf(out_h, "#define CONFIG_%s %s\n", sym->name, str);
++ fprintf(out, "%s=%s\n", sym->name, str);
++ fprintf(out_h, "#define %s %s\n", sym->name, str);
+ break;
+ default:
+ break;