From a3c33d626420712bfb45bd78eaacbeacffabade1 Mon Sep 17 00:00:00 2001 From: Alberto Escolar Piedras Date: Wed, 6 Nov 2019 11:09:42 +0100 Subject: [PATCH] Revert "sanitycheck: remove import of dt kconfig symbols" PR #20204 broke master for boards without DTS PR #20365 tried to partially fix it, but the filtering in sanitycheck remained broken Let's quickly revert it to allow other PRs to come in, and then resubmit them in a separate PR. This reverts commit 9b5720d76c142f0b491c60d650b57e9a2c6d6bc1. Signed-off-by: Alberto Escolar Piedras --- scripts/sanitycheck | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/scripts/sanitycheck b/scripts/sanitycheck index 73b87f7d368644..f953146dc9b6f0 100755 --- a/scripts/sanitycheck +++ b/scripts/sanitycheck @@ -1720,6 +1720,7 @@ class CMake(): self.defconfig = {} self.cmake_cache = {} + self.devicetree = {} self.instance = None self.testcase = testcase @@ -1862,7 +1863,10 @@ class FilterBuilder(CMake): if self.platform.name == "unit_testing": return {} + _generated_dt_confg = "include/generated/generated_dts_board.conf" + cmake_cache_path = os.path.join(self.build_dir, "CMakeCache.txt") + dt_config_path = os.path.join(self.build_dir, "zephyr", _generated_dt_confg) defconfig_path = os.path.join(self.build_dir, "zephyr", ".config") with open(defconfig_path, "r") as fp: @@ -1888,6 +1892,18 @@ class FilterBuilder(CMake): self.cmake_cache = cmake_conf + dt_conf = {} + if os.path.exists(dt_config_path): + with open(dt_config_path, "r") as fp: + for line in fp.readlines(): + m = self.dt_re.match(line) + if not m: + if line.strip() and not line.startswith("#"): + sys.stderr.write("Unrecognized line %s\n" % line) + continue + dt_conf[m.group(1)] = m.group(2).strip() + self.devicetree = dt_conf + filter_data = { "ARCH": self.platform.arch, "PLATFORM": self.platform.name @@ -1895,6 +1911,7 @@ class FilterBuilder(CMake): filter_data.update(os.environ) filter_data.update(self.defconfig) filter_data.update(self.cmake_cache) + filter_data.update(self.devicetree) if self.testcase and self.testcase.tc_filter: try: