1
0
Fork 0

kconfig: require the argument of --defconfig

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 f3e20ad67b ("s390: move arch/s390/defconfig to
  arch/s390/configs/defconfig")

- Commit 986a13769c ("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>
alistair/sunxi64-5.4-dsi
Masahiro Yamada 2019-05-27 23:37:22 +09:00
parent e0a2668665
commit b6f7e9f705
3 changed files with 1 additions and 21 deletions

View File

@ -451,7 +451,7 @@ static struct option long_opts[] = {
{"oldaskconfig", no_argument, NULL, oldaskconfig}, {"oldaskconfig", no_argument, NULL, oldaskconfig},
{"oldconfig", no_argument, NULL, oldconfig}, {"oldconfig", no_argument, NULL, oldconfig},
{"syncconfig", no_argument, NULL, syncconfig}, {"syncconfig", no_argument, NULL, syncconfig},
{"defconfig", optional_argument, NULL, defconfig}, {"defconfig", required_argument, NULL, defconfig},
{"savedefconfig", required_argument, NULL, savedefconfig}, {"savedefconfig", required_argument, NULL, savedefconfig},
{"allnoconfig", no_argument, NULL, allnoconfig}, {"allnoconfig", no_argument, NULL, allnoconfig},
{"allyesconfig", no_argument, NULL, allyesconfig}, {"allyesconfig", no_argument, NULL, allyesconfig},
@ -562,8 +562,6 @@ int main(int ac, char **av)
switch (input_mode) { switch (input_mode) {
case defconfig: case defconfig:
if (!defconfig_file)
defconfig_file = conf_get_default_confname();
if (conf_read(defconfig_file)) { if (conf_read(defconfig_file)) {
fprintf(stderr, fprintf(stderr,
"***\n" "***\n"

View File

@ -177,8 +177,6 @@ static void conf_message(const char *fmt, ...)
static const char *conf_filename; static const char *conf_filename;
static int conf_lineno, conf_warnings; static int conf_lineno, conf_warnings;
const char conf_defname[] = "arch/$(ARCH)/defconfig";
static void conf_warning(const char *fmt, ...) static void conf_warning(const char *fmt, ...)
{ {
va_list ap; va_list ap;
@ -233,21 +231,6 @@ static const char *conf_get_autoconfig_name(void)
return name ? name : "include/config/auto.conf"; return name ? name : "include/config/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) static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p)
{ {
char *p2; char *p2;

View File

@ -49,7 +49,6 @@ const char *zconf_curname(void);
/* confdata.c */ /* confdata.c */
const char *conf_get_configname(void); const char *conf_get_configname(void);
char *conf_get_default_confname(void);
void sym_set_change_count(int count); void sym_set_change_count(int count);
void sym_add_change_count(int count); void sym_add_change_count(int count);
bool conf_set_all_new_symbols(enum conf_def_mode mode); bool conf_set_all_new_symbols(enum conf_def_mode mode);