Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3e73b02a authored by Jing Leng's avatar Jing Leng Committed by Greg Kroah-Hartman
Browse files

kconfig: fix failing to generate auto.conf



[ Upstream commit 1b9e740a81f91ae338b29ed70455719804957b80 ]

When the KCONFIG_AUTOCONFIG is specified (e.g. export \
KCONFIG_AUTOCONFIG=output/config/auto.conf), the directory of
include/config/ will not be created, so kconfig can't create deps
files in it and auto.conf can't be generated.

Signed-off-by: default avatarJing Leng <jleng@ambarella.com>
Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 90c0d3cc
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -987,14 +987,19 @@ static int conf_write_dep(const char *name)

static int conf_touch_deps(void)
{
	const char *name;
	const char *name, *tmp;
	struct symbol *sym;
	int res, i;

	strcpy(depfile_path, "include/config/");
	depfile_prefix_len = strlen(depfile_path);

	name = conf_get_autoconfig_name();
	tmp = strrchr(name, '/');
	depfile_prefix_len = tmp ? tmp - name + 1 : 0;
	if (depfile_prefix_len + 1 > sizeof(depfile_path))
		return -1;

	strncpy(depfile_path, name, depfile_prefix_len);
	depfile_path[depfile_prefix_len] = 0;

	conf_read_simple(name, S_DEF_AUTO);
	sym_calc_value(modules_sym);