aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/kconfig/Makefile7
-rw-r--r--scripts/kconfig/conf.c34
2 files changed, 14 insertions, 27 deletions
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index 2142afb0a13b..01bad1bd2550 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -90,9 +90,9 @@ PHONY += allnoconfig allyesconfig allmodconfig randconfig
90allnoconfig allyesconfig allmodconfig randconfig: $(obj)/conf 90allnoconfig allyesconfig allmodconfig randconfig: $(obj)/conf
91 $< --$@ $(Kconfig) 91 $< --$@ $(Kconfig)
92 92
93PHONY += nonint_oldconfig oldnoconfig defconfig 93PHONY += listnewconfig oldnoconfig defconfig
94 94
95nonint_oldconfig oldnoconfig: $(obj)/conf 95listnewconfig oldnoconfig: $(obj)/conf
96 $< --$@ $(Kconfig) 96 $< --$@ $(Kconfig)
97 97
98defconfig: $(obj)/conf 98defconfig: $(obj)/conf
@@ -122,8 +122,7 @@ help:
122 @echo ' allmodconfig - New config selecting modules when possible' 122 @echo ' allmodconfig - New config selecting modules when possible'
123 @echo ' allyesconfig - New config where all options are accepted with yes' 123 @echo ' allyesconfig - New config where all options are accepted with yes'
124 @echo ' allnoconfig - New config where all options are answered with no' 124 @echo ' allnoconfig - New config where all options are answered with no'
125 @echo ' nonint_oldconfig - Checks the current configuration and fails if an option is ' 125 @echo ' listnewconfig - List new options'
126 @echo ' not set'
127 @echo ' oldnoconfig - Same as silentoldconfig but set new symbols to n (unset)' 126 @echo ' oldnoconfig - Same as silentoldconfig but set new symbols to n (unset)'
128 127
129# lxdialog stuff 128# lxdialog stuff
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
index 1f86fca6b07f..ff5c914c0e5c 100644
--- a/scripts/kconfig/conf.c
+++ b/scripts/kconfig/conf.c
@@ -17,10 +17,6 @@
17#define LKC_DIRECT_LINK 17#define LKC_DIRECT_LINK
18#include "lkc.h" 18#include "lkc.h"
19 19
20/* Return codes */
21#define EUNSETOPT 2 /* if -B and -b are used and unset config
22 * options were found */
23
24static void conf(struct menu *menu); 20static void conf(struct menu *menu);
25static void check_conf(struct menu *menu); 21static void check_conf(struct menu *menu);
26 22
@@ -33,7 +29,7 @@ enum input_mode {
33 allmodconfig, 29 allmodconfig,
34 randconfig, 30 randconfig,
35 defconfig, 31 defconfig,
36 nonint_oldconfig, 32 listnewconfig,
37 oldnoconfig, 33 oldnoconfig,
38} input_mode = oldaskconfig; 34} input_mode = oldaskconfig;
39 35
@@ -45,7 +41,6 @@ static int sync_kconfig;
45static int conf_cnt; 41static int conf_cnt;
46static char line[128]; 42static char line[128];
47static struct menu *rootEntry; 43static struct menu *rootEntry;
48static int unset_variables;
49 44
50static void print_help(struct menu *menu) 45static void print_help(struct menu *menu)
51{ 46{
@@ -366,7 +361,7 @@ static void conf(struct menu *menu)
366 switch (prop->type) { 361 switch (prop->type) {
367 case P_MENU: 362 case P_MENU:
368 if ((input_mode == silentoldconfig || 363 if ((input_mode == silentoldconfig ||
369 input_mode == nonint_oldconfig || 364 input_mode == listnewconfig ||
370 input_mode == oldnoconfig) && 365 input_mode == oldnoconfig) &&
371 rootEntry != menu) { 366 rootEntry != menu) {
372 check_conf(menu); 367 check_conf(menu);
@@ -426,16 +421,9 @@ static void check_conf(struct menu *menu)
426 if (sym && !sym_has_value(sym)) { 421 if (sym && !sym_has_value(sym)) {
427 if (sym_is_changable(sym) || 422 if (sym_is_changable(sym) ||
428 (sym_is_choice(sym) && sym_get_tristate_value(sym) == yes)) { 423 (sym_is_choice(sym) && sym_get_tristate_value(sym) == yes)) {
429 if (input_mode == nonint_oldconfig || 424 if (input_mode == listnewconfig) {
430 input_mode == oldnoconfig) { 425 if (sym->name && !sym_is_choice_value(sym)) {
431 if (input_mode == nonint_oldconfig && 426 printf("CONFIG_%s\n", sym->name);
432 sym->name && !sym_is_choice_value(sym)) {
433 if (!unset_variables)
434 fprintf(stderr, "The following"
435 " variables are not set:\n");
436 fprintf(stderr, "CONFIG_%s\n",
437 sym->name);
438 unset_variables++;
439 } 427 }
440 } else { 428 } else {
441 if (!conf_cnt++) 429 if (!conf_cnt++)
@@ -459,7 +447,7 @@ static struct option long_opts[] = {
459 {"allyesconfig", no_argument, NULL, allyesconfig}, 447 {"allyesconfig", no_argument, NULL, allyesconfig},
460 {"allmodconfig", no_argument, NULL, allmodconfig}, 448 {"allmodconfig", no_argument, NULL, allmodconfig},
461 {"randconfig", no_argument, NULL, randconfig}, 449 {"randconfig", no_argument, NULL, randconfig},
462 {"nonint_oldconfig", no_argument, NULL, nonint_oldconfig}, 450 {"listnewconfig", no_argument, NULL, listnewconfig},
463 {"oldnoconfig", no_argument, NULL, oldnoconfig}, 451 {"oldnoconfig", no_argument, NULL, oldnoconfig},
464 {NULL, 0, NULL, 0} 452 {NULL, 0, NULL, 0}
465}; 453};
@@ -539,7 +527,7 @@ int main(int ac, char **av)
539 case silentoldconfig: 527 case silentoldconfig:
540 case oldaskconfig: 528 case oldaskconfig:
541 case oldconfig: 529 case oldconfig:
542 case nonint_oldconfig: 530 case listnewconfig:
543 case oldnoconfig: 531 case oldnoconfig:
544 conf_read(NULL); 532 conf_read(NULL);
545 break; 533 break;
@@ -602,7 +590,7 @@ int main(int ac, char **av)
602 conf(&rootmenu); 590 conf(&rootmenu);
603 input_mode = silentoldconfig; 591 input_mode = silentoldconfig;
604 /* fall through */ 592 /* fall through */
605 case nonint_oldconfig: 593 case listnewconfig:
606 case oldnoconfig: 594 case oldnoconfig:
607 case silentoldconfig: 595 case silentoldconfig:
608 /* Update until a loop caused no more changes */ 596 /* Update until a loop caused no more changes */
@@ -610,7 +598,7 @@ int main(int ac, char **av)
610 conf_cnt = 0; 598 conf_cnt = 0;
611 check_conf(&rootmenu); 599 check_conf(&rootmenu);
612 } while (conf_cnt && 600 } while (conf_cnt &&
613 (input_mode != nonint_oldconfig && 601 (input_mode != listnewconfig &&
614 input_mode != oldnoconfig)); 602 input_mode != oldnoconfig));
615 break; 603 break;
616 } 604 }
@@ -627,11 +615,11 @@ int main(int ac, char **av)
627 fprintf(stderr, _("\n*** Error during update of the kernel configuration.\n\n")); 615 fprintf(stderr, _("\n*** Error during update of the kernel configuration.\n\n"));
628 return 1; 616 return 1;
629 } 617 }
630 } else if (!unset_variables || input_mode != nonint_oldconfig) { 618 } else if (input_mode != listnewconfig) {
631 if (conf_write(NULL)) { 619 if (conf_write(NULL)) {
632 fprintf(stderr, _("\n*** Error during writing of the kernel configuration.\n\n")); 620 fprintf(stderr, _("\n*** Error during writing of the kernel configuration.\n\n"));
633 exit(1); 621 exit(1);
634 } 622 }
635 } 623 }
636 return unset_variables ? EUNSETOPT : 0; 624 return 0;
637} 625}