summaryrefslogtreecommitdiffstats
path: root/scripts/ptx-modifications/kconfig.diff
blob: b0c83271f9c6d46635ef26b41a20a20d518c49b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
kconfig patch
-------------

This patch changes the official kconfig (see $LINUXSRC/scripts/kconfig for
details) to work with ptxdist. The sources included in this tree already have
this patch applied.

[Robert Schwebel]

------------------------------------------------------------------------------


diff -ru linux-2.6.10/scripts/kconfig/confdata.c ptxdist-0.7-trunk/scripts/kconfig/confdata.c
--- linux-2.6.10/scripts/kconfig/confdata.c	2004-12-24 22:35:39.000000000 +0100
+++ ptxdist-0.7-trunk/scripts/kconfig/confdata.c	2005-01-19 17:31:57.824914304 +0100
@@ -16,13 +16,10 @@
 
 const char conf_def_filename[] = ".config";
 
-const char conf_defname[] = "arch/$ARCH/defconfig";
+const char conf_defname[] = "defconfig";
 
 const char *conf_confnames[] = {
 	".config",
-	"/lib/modules/$UNAME_RELEASE/.config",
-	"/etc/kernel-config",
-	"/boot/config-$UNAME_RELEASE",
 	conf_defname,
 	NULL,
 };
@@ -119,17 +116,17 @@
 		sym = NULL;
 		switch (line[0]) {
 		case '#':
-			if (memcmp(line + 2, "CONFIG_", 7))
+			if (memcmp(line + 2, CFGSYM, CFGSYMLEN))
 				continue;
-			p = strchr(line + 9, ' ');
+			p = strchr(line + CFGSYMLEN+3, ' ');
 			if (!p)
 				continue;
 			*p++ = 0;
-			if (strncmp(p, "is not set", 10))
+			if (strncmp(p, "is not set", CFGSYMLEN+3))
 				continue;
-			sym = sym_find(line + 9);
+			sym = sym_find(line + CFGSYMLEN+3);
 			if (!sym) {
-				fprintf(stderr, "%s:%d: trying to assign nonexistent symbol %s\n", name, lineno, line + 9);
+				fprintf(stderr, "%s:%d: trying to assign nonexistent symbol %s\n", name, lineno, line + CFGSYMLEN+2);
 				break;
 			}
 			switch (sym->type) {
@@ -142,19 +139,19 @@
 				;
 			}
 			break;
-		case 'C':
-			if (memcmp(line, "CONFIG_", 7))
+		case CFGSYMFC:
+			if (memcmp(line, CFGSYM, CFGSYMLEN))
 				continue;
-			p = strchr(line + 7, '=');
+			p = strchr(line + CFGSYMLEN, '=');
 			if (!p)
 				continue;
 			*p++ = 0;
 			p2 = strchr(p, '\n');
 			if (p2)
 				*p2 = 0;
-			sym = sym_find(line + 7);
+			sym = sym_find(line + CFGSYMLEN);
 			if (!sym) {
-				fprintf(stderr, "%s:%d: trying to assign nonexistent symbol %s\n", name, lineno, line + 7);
+				fprintf(stderr, "%s:%d: trying to assign nonexistent symbol %s\n", name, lineno, line + CFGSYMLEN);
 				break;
 			}
 			switch (sym->type) {
@@ -305,8 +302,6 @@
 		if (!out_h)
 			return 1;
 	}
-	sym = sym_lookup("KERNELRELEASE", 0);
-	sym_calc_value(sym);
 	time(&now);
 	env = getenv("KCONFIG_NOTIMESTAMP");
 	if (env && *env)
@@ -314,20 +309,20 @@
 
 	fprintf(out, "#\n"
 		     "# Automatically generated make config: don't edit\n"
-		     "# Linux kernel version: %s\n"
+		     "# %s version: %s\n"
 		     "%s%s"
 		     "#\n",
-		     sym_get_string_value(sym),
+		     getenv("PROJECT"), getenv("FULLVERSION"),
 		     use_timestamp ? "# " : "",
 		     use_timestamp ? ctime(&now) : "");
 	if (out_h)
 		fprintf(out_h, "/*\n"
 			       " * Automatically generated C config: don't edit\n"
-			       " * Linux kernel version: %s\n"
+			       " * %s version: %s\n"
 			       "%s%s"
 			       " */\n"
 			       "#define AUTOCONF_INCLUDED\n",
-			       sym_get_string_value(sym),
+			       getenv("PROJECT"), getenv("FULLVERSION"),
 			       use_timestamp ? " * " : "",
 			       use_timestamp ? ctime(&now) : "");
 
@@ -366,28 +361,28 @@
 			case S_TRISTATE:
 				switch (sym_get_tristate_value(sym)) {
 				case no:
-					fprintf(out, "# CONFIG_%s is not set\n", sym->name);
+					fprintf(out, "# " CFGSYM "%s is not set\n", sym->name);
 					if (out_h)
-						fprintf(out_h, "#undef CONFIG_%s\n", sym->name);
+						fprintf(out_h, "#undef " CFGSYM "%s\n", sym->name);
 					break;
 				case mod:
-					fprintf(out, "CONFIG_%s=m\n", sym->name);
+					fprintf(out, CFGSYM "%s=m\n", sym->name);
 					if (out_h)
-						fprintf(out_h, "#define CONFIG_%s_MODULE 1\n", sym->name);
+						fprintf(out_h, "#define " CFGSYM "%s_MODULE 1\n", sym->name);
 					break;
 				case yes:
-					fprintf(out, "CONFIG_%s=y\n", sym->name);
+					fprintf(out, CFGSYM "%s=y\n", sym->name);
 					if (out_h)
-						fprintf(out_h, "#define CONFIG_%s 1\n", sym->name);
+						fprintf(out_h, "#define " CFGSYM "%s 1\n", sym->name);
 					break;
 				}
 				break;
 			case S_STRING:
 				// fix me
 				str = sym_get_string_value(sym);
-				fprintf(out, "CONFIG_%s=\"", sym->name);
+				fprintf(out, CFGSYM "%s=\"", sym->name);
 				if (out_h)
-					fprintf(out_h, "#define CONFIG_%s \"", sym->name);
+					fprintf(out_h, "#define " CFGSYM "%s \"", sym->name);
 				do {
 					l = strcspn(str, "\"\\");
 					if (l) {
@@ -410,16 +405,16 @@
 			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, CFGSYM "%s=%s\n", sym->name, str);
 					if (out_h)
-						fprintf(out_h, "#define CONFIG_%s 0x%s\n", sym->name, str);
+						fprintf(out_h, "#define " CFGSYM "%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, CFGSYM "%s=%s\n", sym->name, str);
 				if (out_h)
-					fprintf(out_h, "#define CONFIG_%s %s\n", sym->name, str);
+					fprintf(out_h, "#define " CFGSYM "%s %s\n", sym->name, str);
 				break;
 			}
 		}
diff -ru linux-2.6.10/scripts/kconfig/gconf.c ptxdist-0.7-trunk/scripts/kconfig/gconf.c
--- linux-2.6.10/scripts/kconfig/gconf.c	2004-12-24 22:35:29.000000000 +0100
+++ ptxdist-0.7-trunk/scripts/kconfig/gconf.c	2005-01-19 17:02:41.900855336 +0100
@@ -275,8 +275,8 @@
 					  /*"style", PANGO_STYLE_OBLIQUE, */
 					  NULL);
 
-	sprintf(title, "Linux Kernel v%s Configuration",
-		getenv("KERNELRELEASE"));
+	sprintf(title, "%s v%s Configuration",
+		getenv("PROJECT"), getenv("FULLVERSION"));
 	gtk_window_set_title(GTK_WINDOW(main_wnd), title);
 
 	gtk_widget_show(main_wnd);
diff -ru linux-2.6.10/scripts/kconfig/lkc.h ptxdist-0.7-trunk/scripts/kconfig/lkc.h
--- linux-2.6.10/scripts/kconfig/lkc.h	2004-12-24 22:33:49.000000000 +0100
+++ ptxdist-0.7-trunk/scripts/kconfig/lkc.h	2005-01-19 16:52:27.620240184 +0100
@@ -22,6 +22,12 @@
 #undef P
 
 #define SRCTREE "srctree"
+#define CFGSYM "PTXCONF_"
+#define CFGSYMFC 'P'
+#define CFGSYMLEN 8
+#define RELEASESYM "FULLVERSION"
+#define RELEASENAME "PTXDist"
+	
 
 int zconfparse(void);
 void zconfdump(FILE *out);
diff -ru linux-2.6.10/scripts/kconfig/mconf.c ptxdist-0.7-trunk/scripts/kconfig/mconf.c
--- linux-2.6.10/scripts/kconfig/mconf.c	2004-12-24 22:34:26.000000000 +0100
+++ ptxdist-0.7-trunk/scripts/kconfig/mconf.c	2005-01-19 17:24:20.589424664 +0100
@@ -50,18 +50,18 @@
 	"This feature depends on another which has been configured as a module.\n"
 	"As a result, this feature will be built as a module.",
 nohelp_text[] =
-	"There is no help available for this kernel option.\n",
+	"There is no help available for this option.\n",
 load_config_text[] =
 	"Enter the name of the configuration file you wish to load.  "
 	"Accept the name shown to restore the configuration you "
 	"last retrieved.  Leave blank to abort.",
 load_config_help[] =
 	"\n"
-	"For various reasons, one may wish to keep several different kernel\n"
+	"For various reasons, one may wish to keep several different\n"
 	"configurations available on a single machine.\n"
 	"\n"
 	"If you have saved a previous configuration in a file other than the\n"
-	"kernel's default, entering the name of the file here will allow you\n"
+	"default, entering the name of the file here will allow you\n"
 	"to modify that configuration.\n"
 	"\n"
 	"If you are uncertain, then you have probably never used alternate\n"
@@ -71,7 +71,7 @@
 	"as an alternate.  Leave blank to abort.",
 save_config_help[] =
 	"\n"
-	"For various reasons, one may wish to keep different kernel\n"
+	"For various reasons, one may wish to keep different\n"
 	"configurations available on a single machine.\n"
 	"\n"
 	"Entering a file name here will allow you to later retrieve, modify\n"
@@ -700,7 +700,7 @@
 		help = nohelp_text;
 	if (sym->name) {
 		helptext = malloc(strlen(sym->name) + strlen(help) + 16);
-		sprintf(helptext, "CONFIG_%s:\n\n%s", sym->name, help);
+		sprintf(helptext, CFGSYM "%s:\n\n%s", sym->name, help);
 		show_helptext(menu_get_prompt(menu), helptext);
 		free(helptext);
 	} else
@@ -888,17 +888,14 @@
 
 int main(int ac, char **av)
 {
-	struct symbol *sym;
 	char *mode;
 	int stat;
 
 	conf_parse(av[1]);
 	conf_read(NULL);
 
-	sym = sym_lookup("KERNELRELEASE", 0);
-	sym_calc_value(sym);
-	sprintf(menu_backtitle, "Linux Kernel v%s Configuration",
-		sym_get_string_value(sym));
+	sprintf(menu_backtitle, "%s v%s Configuration",
+		getenv("PROJECT"), getenv("FULLVERSION"));
 
 	mode = getenv("MENUCONFIG_MODE");
 	if (mode) {
@@ -914,7 +911,7 @@
 	do {
 		cprint_init();
 		cprint("--yesno");
-		cprint("Do you wish to save your new kernel configuration?");
+		cprint("Do you wish to save your new configuration?");
 		cprint("5");
 		cprint("60");
 		stat = exec_conf();
@@ -923,18 +920,18 @@
 	if (stat == 0) {
 		if (conf_write(NULL)) {
 			fprintf(stderr, "\n\n"
-				"Error during writing of the kernel configuration.\n"
-				"Your kernel configuration changes were NOT saved."
+				"Error during writing of the configuration.\n"
+				"Your configuration changes were NOT saved."
 				"\n\n");
 			return 1;
 		}
 		printf("\n\n"
-			"*** End of Linux kernel configuration.\n"
-			"*** Execute 'make' to build the kernel or try 'make help'."
+			"*** End of configuration.\n"
+			"*** Execute 'make' to build or try 'make help'."
 			"\n\n");
 	} else {
 		fprintf(stderr, "\n\n"
-			"Your kernel configuration changes were NOT saved."
+			"Your configuration changes were NOT saved."
 			"\n\n");
 	}