From patchwork Mon Aug 22 13:18:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 74421 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp1564620qga; Mon, 22 Aug 2016 06:17:30 -0700 (PDT) X-Received: by 10.194.77.174 with SMTP id t14mr19401577wjw.146.1471871850483; Mon, 22 Aug 2016 06:17:30 -0700 (PDT) Return-Path: Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id e5si18424624wjd.232.2016.08.22.06.17.30; Mon, 22 Aug 2016 06:17:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) client-ip=85.214.87.163; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7A9DAA7532; Mon, 22 Aug 2016 15:17:13 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AuJJfh68btGW; Mon, 22 Aug 2016 15:17:13 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E2CBCA7534; Mon, 22 Aug 2016 15:17:00 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B78124B62B for ; Mon, 22 Aug 2016 15:16:50 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PRExzPLfh6cQ for ; Mon, 22 Aug 2016 15:16:50 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from conuserg-12.nifty.com (conuserg-12.nifty.com [210.131.2.79]) by theia.denx.de (Postfix) with ESMTPS id 1F19F4B6B3 for ; Mon, 22 Aug 2016 15:16:45 +0200 (CEST) Received: from beagle.diag.org (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-12.nifty.com with ESMTP id u7MDGIdw031211; Mon, 22 Aug 2016 22:16:21 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-12.nifty.com u7MDGIdw031211 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1471871781; bh=csFk0LOudrcCC/o7yabwf91EzwAIZLxaUjKcVnNW5hA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=H/Rk8b9wmJhjKTjayJW7WVGrXuN9x38/7cYImNjVs770o/yr/crEp2o0pTjMkmzsW BGHRo6Sw5slYvXSSDw3f8vSgieOPVZx+8essbOvdVkib/487eqbnreGFRicluAH85U xeR6O3lbD4iyscap0nAhC/cbjQho/JYRC39F9JHUid9jd5nr5K3sr2wepqiWcVyoUr oSguBheEm37pYcck1qrGoz4307toocdRPP1uYjIyimNOoyDrhFEmd+HiujmLNnrC0h Gi41b0yau4BSQpbFmUEIhTQ+zxZdLkbB0kOVvF2JQX9GrTwp1aDkbFgjB4wvHNBFHn CMyadiW6GjWaw== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Mon, 22 Aug 2016 22:18:22 +0900 Message-Id: <1471871902-5361-5-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1471871902-5361-1-git-send-email-yamada.masahiro@socionext.com> References: <1471871902-5361-1-git-send-email-yamada.masahiro@socionext.com> Cc: Tom Rini , Joe Hershberger Subject: [U-Boot] [PATCH 4/4] tools: moveconfig: add --spl option to move options for SPL build X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Prior to this commit, the tool could not move options guarded by CONFIG_SPL_BUILD ifdef conditionals because they do not show up in include/autoconf.mk. This new option, if given, makes the tool parse spl/include/autoconf.mk instead of include/autoconf.mk, which is probably preferred behavior when moving options for SPL. Signed-off-by: Masahiro Yamada --- tools/moveconfig.py | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) -- 1.9.1 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot diff --git a/tools/moveconfig.py b/tools/moveconfig.py index 98e8608..5576b57 100755 --- a/tools/moveconfig.py +++ b/tools/moveconfig.py @@ -138,6 +138,12 @@ Available options If not specified, "make savedefconfig" only occurs for cases where at least one CONFIG was moved. + -S, --spl + Look for moved config options in spl/include/autoconf.mk instead of + include/autoconf.mk. This is useful for moving options for SPL build + because SPL related options (mostly prefixed with CONFIG_SPL_) are + sometimes blocked by CONFIG_SPL_BUILD ifdef conditionals. + -H, --headers-only Only cleanup the headers; skip the defconfig processing @@ -614,6 +620,8 @@ class KconfigParser: self.options = options self.dotconfig = os.path.join(build_dir, '.config') self.autoconf = os.path.join(build_dir, 'include', 'autoconf.mk') + self.spl_autoconf = os.path.join(build_dir, 'spl', 'include', + 'autoconf.mk') self.config_autoconf = os.path.join(build_dir, 'include', 'config', 'auto.conf') self.defconfig = os.path.join(build_dir, 'defconfig') @@ -715,11 +723,25 @@ class KconfigParser: results = [] updated = False suspicious = False + rm_files = [self.config_autoconf, self.autoconf] + + if self.options.spl: + if os.path.exists(self.spl_autoconf): + autoconf_path = self.spl_autoconf + rm_files.append(self.spl_autoconf) + else: + for f in rm_files: + os.remove(f) + return (updated, suspicious, + color_text(self.options.color, COLOR_BROWN, + "SPL is not enabled. Skipped.") + '\n') + else: + autoconf_path = self.autoconf with open(self.dotconfig) as f: dotconfig_lines = f.readlines() - with open(self.autoconf) as f: + with open(autoconf_path) as f: autoconf_lines = f.readlines() for config in self.configs: @@ -744,6 +766,9 @@ class KconfigParser: actlog = "'%s' is the same as the define in Kconfig. Do nothing." \ % value log_color = COLOR_LIGHT_PURPLE + elif action == ACTION_SPL_NOT_EXIST: + actlog = "SPL is not enabled for this defconfig. Skip." + log_color = COLOR_PURPLE else: sys.exit("Internal Error. This should not happen.") @@ -756,8 +781,8 @@ class KconfigParser: updated = True self.results = results - os.remove(self.config_autoconf) - os.remove(self.autoconf) + for f in rm_files: + os.remove(f) return (updated, suspicious, log) @@ -1217,6 +1242,8 @@ def main(): help='exit immediately on any error') parser.add_option('-s', '--force-sync', action='store_true', default=False, help='force sync by savedefconfig') + parser.add_option('-S', '--spl', action='store_true', default=False, + help='parse config options defined for SPL build') parser.add_option('-H', '--headers-only', dest='cleanup_headers_only', action='store_true', default=False, help='only cleanup the headers')