From patchwork Mon Jul 8 19:18:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1129279 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="V2grdQEp"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45jFrk0THhz9sDB for ; Tue, 9 Jul 2019 05:29:41 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id A6106C21DEC; Mon, 8 Jul 2019 19:25:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id BBEA9C21E13; Mon, 8 Jul 2019 19:21:20 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 8F901C21D74; Mon, 8 Jul 2019 19:21:10 +0000 (UTC) Received: from mail-io1-f68.google.com (mail-io1-f68.google.com [209.85.166.68]) by lists.denx.de (Postfix) with ESMTPS id D9017C21D9A for ; Mon, 8 Jul 2019 19:21:06 +0000 (UTC) Received: by mail-io1-f68.google.com with SMTP id u19so37799027ior.9 for ; Mon, 08 Jul 2019 12:21:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=l6T/z22h0Ghd14pPWpVHp4NvxI8qEKEzUQHsAjmgIbo=; b=V2grdQEpV4sKC7YO8WId86S/zuWmrhE2UnL3u7M+TQzd5dAb1gTMNCiD+otYEE+HJA f9T7q3aM9Vpj9ZhySwkzKW7TWRhs6+ZjE3lOnzx+zp4+twWW1Uu5aOp8Jqj83Ct5Y7LA kJx1gZh2gwQy5JgmoCF2CMhmDxo5Q5n56XOEY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=l6T/z22h0Ghd14pPWpVHp4NvxI8qEKEzUQHsAjmgIbo=; b=pPeph4IwbhUid0OLAvXRdMT7m8SYZJ9+boQHsjtxqJO/4d3VQTkz3ejU6QNptJv7Pn s3OV7Drvog8XYjKKKEYd2lA22KrZUDhpvgeQZF66b9Fbvk7eIQ1M1DJLwuOcG+Kk1ooi h+uNV/XBvn9sWj9K1yejwBndVZPSy+MN8fnK/V3vWfUKVEAwYh4m2OF5bAnDRcH3Gp+t s47SL9X4R9CAw3tm+2iI6Uug/fDO42Z0fjCh0Pz6ctt0FM0g7tsCsck6JdLUVlAdx3QJ ug9Jkm5vu1F4CWhtiEp0lcF9I+g1KzPdWc/B40LOUcUpzYbFgsyXF+q+qThafU895xy6 OM/Q== X-Gm-Message-State: APjAAAUKepZ4/f4MgNRb6KN0DIWW7LwTjYX/t9QS7pHCxyI1Pm8r4CWv 5GZOSXTh87CRhuSvu5bdEPGPTRa4IXs= X-Google-Smtp-Source: APXvYqyzaCiCbikoCIr49RKRaBebitdj+SRTm2+yh0YZCQDFAjf+6jk9boxcD/OMRRp8M6/Ne7XzLg== X-Received: by 2002:a02:ad15:: with SMTP id s21mr24068087jan.47.1562613665762; Mon, 08 Jul 2019 12:21:05 -0700 (PDT) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id j1sm15545094iop.14.2019.07.08.12.21.05 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 08 Jul 2019 12:21:05 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Mon, 8 Jul 2019 13:18:28 -0600 Message-Id: <20190708191856.138863-10-sjg@chromium.org> X-Mailer: git-send-email 2.22.0.410.gd8fdbe21b5-goog In-Reply-To: <20190708191856.138863-1-sjg@chromium.org> References: <20190708191856.138863-1-sjg@chromium.org> MIME-Version: 1.0 Subject: [U-Boot] [PATCH v2 09/37] binman: Add a --toolpath option to set the tool search path X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Sometimes tools used by binman may not be in the normal PATH search path, such as when the tool is built by the U-Boot build itself (e.g. mkimage). Provide a way to specify an additional search path for tools. The flag can be used multiple times. Update the help to describe this option. Signed-off-by: Simon Glass --- Changes in v2: None tools/binman/README | 10 ++++++++++ tools/binman/cmdline.py | 2 ++ tools/binman/control.py | 1 + 3 files changed, 13 insertions(+) diff --git a/tools/binman/README b/tools/binman/README index decca47bbf3..28624fadb33 100644 --- a/tools/binman/README +++ b/tools/binman/README @@ -691,6 +691,16 @@ Not all properties can be provided this way. Only some entries support it, typically for filenames. +External tools +-------------- + +Binman can make use of external command-line tools to handle processing of +entry contents or to generate entry contents. These tools are executed using +the 'tools' module's Run() method. The tools generally must exist on the PATH, +but the --toolpath option can be used to specify additional search paths to +use. This option can be specified multiple times to add more than one path. + + Code coverage ------------- diff --git a/tools/binman/cmdline.py b/tools/binman/cmdline.py index 3886d52b3a0..ee19c5e33fe 100644 --- a/tools/binman/cmdline.py +++ b/tools/binman/cmdline.py @@ -52,6 +52,8 @@ def ParseArgs(argv): default=False, help='run tests') parser.add_option('-T', '--test-coverage', action='store_true', default=False, help='run tests and check for 100% coverage') + parser.add_option('--toolpath', type='string', action='append', + help='Add a path to the directories containing tools') parser.add_option('-u', '--update-fdt', action='store_true', default=False, help='Update the binman node with offset/size info') parser.add_option('-v', '--verbosity', default=1, diff --git a/tools/binman/control.py b/tools/binman/control.py index 20186ee1980..df78848e13d 100644 --- a/tools/binman/control.py +++ b/tools/binman/control.py @@ -112,6 +112,7 @@ def Binman(options, args): try: tools.SetInputDirs(options.indir) tools.PrepareOutputDir(options.outdir, options.preserve) + tools.SetToolPaths(options.toolpath) state.SetEntryArgs(options.entry_arg) # Get the device tree ready by compiling it and copying the compiled