Commit f8e5d51d authored by Sam Ravnborg's avatar Sam Ravnborg

kconfig: Allow architectures to select board specific configs

This patch introduces the framework required for architectures to supply
several independent configurations. Three architectures does this today:
ppc, ppc64 and arm.
The infrastructure provided here requires the files to be located in
the following directory:
arch/$(ARCH)/configs
The file shall be named <board>_defconfig

To select the configuration for ppc/gemini simply issue the following command:
make gemini_defconfig
This will generate a valid configuration.

ppc and ppc64 already comply to the above requirements, arm needs some
trivial updates.
parent f4c16cfc
...@@ -40,6 +40,9 @@ allmodconfig: $(obj)/conf ...@@ -40,6 +40,9 @@ allmodconfig: $(obj)/conf
defconfig: $(obj)/conf defconfig: $(obj)/conf
$< -d arch/$(ARCH)/Kconfig $< -d arch/$(ARCH)/Kconfig
%_defconfig: $(obj)/conf
$(Q)$< -D arch/$(ARCH)/configs/$@ arch/$(ARCH)/Kconfig
# Help text used by make help # Help text used by make help
help: help:
@echo ' oldconfig - Update current config utilising a line-oriented program' @echo ' oldconfig - Update current config utilising a line-oriented program'
......
...@@ -26,6 +26,7 @@ enum { ...@@ -26,6 +26,7 @@ enum {
set_no, set_no,
set_random set_random
} input_mode = ask_all; } input_mode = ask_all;
char *defconfig_file;
static int indent = 1; static int indent = 1;
static int valid_stdin = 1; static int valid_stdin = 1;
...@@ -483,11 +484,12 @@ static void check_conf(struct menu *menu) ...@@ -483,11 +484,12 @@ static void check_conf(struct menu *menu)
int main(int ac, char **av) int main(int ac, char **av)
{ {
int i = 1;
const char *name; const char *name;
struct stat tmpstat; struct stat tmpstat;
if (ac > 1 && av[1][0] == '-') { if (ac > i && av[i][0] == '-') {
switch (av[1][1]) { switch (av[i++][1]) {
case 'o': case 'o':
input_mode = ask_new; input_mode = ask_new;
break; break;
...@@ -498,6 +500,15 @@ int main(int ac, char **av) ...@@ -498,6 +500,15 @@ int main(int ac, char **av)
case 'd': case 'd':
input_mode = set_default; input_mode = set_default;
break; break;
case 'D':
input_mode = set_default;
defconfig_file = av[i++];
if (!defconfig_file) {
printf("%s: No default config file specified\n",
av[0]);
exit(1);
}
break;
case 'n': case 'n':
input_mode = set_no; input_mode = set_no;
break; break;
...@@ -516,18 +527,21 @@ int main(int ac, char **av) ...@@ -516,18 +527,21 @@ int main(int ac, char **av)
printf("%s [-o|-s] config\n", av[0]); printf("%s [-o|-s] config\n", av[0]);
exit(0); exit(0);
} }
name = av[2]; }
} else name = av[i];
name = av[1]; if (!name) {
printf("%s: Kconfig file missing\n", av[0]);
}
conf_parse(name); conf_parse(name);
//zconfdump(stdout); //zconfdump(stdout);
switch (input_mode) { switch (input_mode) {
case set_default: case set_default:
name = conf_get_default_confname(); if (!defconfig_file)
if (conf_read(name)) { defconfig_file = conf_get_default_confname();
if (conf_read(defconfig_file)) {
printf("***\n" printf("***\n"
"*** Can't find default configuration \"%s\"!\n" "*** Can't find default configuration \"%s\"!\n"
"***\n", name); "***\n", defconfig_file);
exit(1); exit(1);
} }
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment