diff options
Diffstat (limited to 'scripts/kconfig/conf.c')
-rw-r--r-- | scripts/kconfig/conf.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c index c8bd33cb3bf7..010600ef58c0 100644 --- a/scripts/kconfig/conf.c +++ b/scripts/kconfig/conf.c | |||
@@ -30,6 +30,7 @@ enum input_mode { | |||
30 | alldefconfig, | 30 | alldefconfig, |
31 | randconfig, | 31 | randconfig, |
32 | defconfig, | 32 | defconfig, |
33 | savedefconfig, | ||
33 | listnewconfig, | 34 | listnewconfig, |
34 | oldnoconfig, | 35 | oldnoconfig, |
35 | } input_mode = oldaskconfig; | 36 | } input_mode = oldaskconfig; |
@@ -444,6 +445,7 @@ static struct option long_opts[] = { | |||
444 | {"oldconfig", no_argument, NULL, oldconfig}, | 445 | {"oldconfig", no_argument, NULL, oldconfig}, |
445 | {"silentoldconfig", no_argument, NULL, silentoldconfig}, | 446 | {"silentoldconfig", no_argument, NULL, silentoldconfig}, |
446 | {"defconfig", optional_argument, NULL, defconfig}, | 447 | {"defconfig", optional_argument, NULL, defconfig}, |
448 | {"savedefconfig", required_argument, NULL, savedefconfig}, | ||
447 | {"allnoconfig", no_argument, NULL, allnoconfig}, | 449 | {"allnoconfig", no_argument, NULL, allnoconfig}, |
448 | {"allyesconfig", no_argument, NULL, allyesconfig}, | 450 | {"allyesconfig", no_argument, NULL, allyesconfig}, |
449 | {"allmodconfig", no_argument, NULL, allmodconfig}, | 451 | {"allmodconfig", no_argument, NULL, allmodconfig}, |
@@ -471,6 +473,7 @@ int main(int ac, char **av) | |||
471 | sync_kconfig = 1; | 473 | sync_kconfig = 1; |
472 | break; | 474 | break; |
473 | case defconfig: | 475 | case defconfig: |
476 | case savedefconfig: | ||
474 | defconfig_file = optarg; | 477 | defconfig_file = optarg; |
475 | break; | 478 | break; |
476 | case randconfig: | 479 | case randconfig: |
@@ -526,6 +529,9 @@ int main(int ac, char **av) | |||
526 | exit(1); | 529 | exit(1); |
527 | } | 530 | } |
528 | break; | 531 | break; |
532 | case savedefconfig: | ||
533 | conf_read(NULL); | ||
534 | break; | ||
529 | case silentoldconfig: | 535 | case silentoldconfig: |
530 | case oldaskconfig: | 536 | case oldaskconfig: |
531 | case oldconfig: | 537 | case oldconfig: |
@@ -591,6 +597,8 @@ int main(int ac, char **av) | |||
591 | case defconfig: | 597 | case defconfig: |
592 | conf_set_all_new_symbols(def_default); | 598 | conf_set_all_new_symbols(def_default); |
593 | break; | 599 | break; |
600 | case savedefconfig: | ||
601 | break; | ||
594 | case oldconfig: | 602 | case oldconfig: |
595 | case oldaskconfig: | 603 | case oldaskconfig: |
596 | rootEntry = &rootmenu; | 604 | rootEntry = &rootmenu; |
@@ -622,6 +630,12 @@ int main(int ac, char **av) | |||
622 | fprintf(stderr, _("\n*** Error during update of the kernel configuration.\n\n")); | 630 | fprintf(stderr, _("\n*** Error during update of the kernel configuration.\n\n")); |
623 | return 1; | 631 | return 1; |
624 | } | 632 | } |
633 | } else if (input_mode == savedefconfig) { | ||
634 | if (conf_write_defconfig(defconfig_file)) { | ||
635 | fprintf(stderr, _("n*** Error while saving defconfig to: %s\n\n"), | ||
636 | defconfig_file); | ||
637 | return 1; | ||
638 | } | ||
625 | } else if (input_mode != listnewconfig) { | 639 | } else if (input_mode != listnewconfig) { |
626 | if (conf_write(NULL)) { | 640 | if (conf_write(NULL)) { |
627 | fprintf(stderr, _("\n*** Error during writing of the kernel configuration.\n\n")); | 641 | fprintf(stderr, _("\n*** Error during writing of the kernel configuration.\n\n")); |