kconfig: require the argument of --defconfig
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Mon, 27 May 2019 14:37:22 +0000 (23:37 +0900)
committerChristian Lamparter <chunkeey@gmail.com>
Fri, 27 Sep 2019 20:36:05 +0000 (22:36 +0200)
Currently, the argument for --defconfig is optional. If the argument
is not passed, the hard-coded default arch/$(ARCH)/defconfig is used.

It no longer happens in Linux since the last users of the default are
gone by the following commits:

- Commit f3e20ad67b4c ("s390: move arch/s390/defconfig to
  arch/s390/configs/defconfig")

- Commit 986a13769c4b ("alpha: move arch/alpha/defconfig to
  arch/alpha/configs/defconfig")

I want to kill the Linux-specific directory path embedded in the
Kconfig binary.

The --savedefconfig (reverse operation of --defconfig) requires an
argument, so it should not hurt to do likewise for --defconfig.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
config/conf.c
config/confdata.c
config/lkc.h

index 9cb55bfbd46061eb0f86e6982a737690366eec2e..567f3b7410098a49d96e67186eb51ea5b195332a 100644 (file)
@@ -451,7 +451,7 @@ static struct option long_opts[] = {
        {"oldaskconfig",    no_argument,       NULL, oldaskconfig},
        {"oldconfig",       no_argument,       NULL, oldconfig},
        {"syncconfig",      no_argument,       NULL, syncconfig},
        {"oldaskconfig",    no_argument,       NULL, oldaskconfig},
        {"oldconfig",       no_argument,       NULL, oldconfig},
        {"syncconfig",      no_argument,       NULL, syncconfig},
-       {"defconfig",       optional_argument, NULL, defconfig},
+       {"defconfig",       required_argument, NULL, defconfig},
        {"savedefconfig",   required_argument, NULL, savedefconfig},
        {"allnoconfig",     no_argument,       NULL, allnoconfig},
        {"allyesconfig",    no_argument,       NULL, allyesconfig},
        {"savedefconfig",   required_argument, NULL, savedefconfig},
        {"allnoconfig",     no_argument,       NULL, allnoconfig},
        {"allyesconfig",    no_argument,       NULL, allyesconfig},
@@ -562,8 +562,6 @@ int main(int ac, char **av)
 
        switch (input_mode) {
        case defconfig:
 
        switch (input_mode) {
        case defconfig:
-               if (!defconfig_file)
-                       defconfig_file = conf_get_default_confname();
                if (conf_read(defconfig_file)) {
                        fprintf(stderr,
                                "***\n"
                if (conf_read(defconfig_file)) {
                        fprintf(stderr,
                                "***\n"
index 695253e055cefc96b98f461fbf0ab1b4fc69860b..d18626d1497d6610d7f69e5987cbf75f9e663ec7 100644 (file)
@@ -177,8 +177,6 @@ static void conf_message(const char *fmt, ...)
 static const char *conf_filename;
 static int conf_lineno, conf_warnings;
 
 static const char *conf_filename;
 static int conf_lineno, conf_warnings;
 
-const char conf_defname[] = "include/generated/defconfig";
-
 static void conf_warning(const char *fmt, ...)
 {
        va_list ap;
 static void conf_warning(const char *fmt, ...)
 {
        va_list ap;
@@ -233,21 +231,6 @@ static const char *conf_get_autoconfig_name(void)
        return name ? name : "include/generated/auto.conf";
 }
 
        return name ? name : "include/generated/auto.conf";
 }
 
-char *conf_get_default_confname(void)
-{
-       static char fullname[PATH_MAX+1];
-       char *env, *name;
-
-       name = expand_string(conf_defname);
-       env = getenv(SRCTREE);
-       if (env) {
-               snprintf(fullname, sizeof(fullname), "%s/%s", env, name);
-               if (is_present(fullname))
-                       return fullname;
-       }
-       return name;
-}
-
 static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p)
 {
        char *p2;
 static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p)
 {
        char *p2;
index cbc7658ee27d5d279ea1d17230071c47505ba8eb..4fb16f3166268fd5686b303797561374f58470cf 100644 (file)
@@ -49,7 +49,6 @@ const char *zconf_curname(void);
 
 /* confdata.c */
 const char *conf_get_configname(void);
 
 /* confdata.c */
 const char *conf_get_configname(void);
-char *conf_get_default_confname(void);
 void sym_set_change_count(int count);
 void sym_add_change_count(int count);
 bool conf_set_all_new_symbols(enum conf_def_mode mode);
 void sym_set_change_count(int count);
 void sym_add_change_count(int count);
 bool conf_set_all_new_symbols(enum conf_def_mode mode);