Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6C690C54EE9 for ; Sat, 17 Sep 2022 15:01:32 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0447484A7E; Sat, 17 Sep 2022 17:01:30 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="Ql6fN/NC"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 64E6084A7E; Sat, 17 Sep 2022 17:01:28 +0200 (CEST) Received: from mail-oi1-x236.google.com (mail-oi1-x236.google.com [IPv6:2607:f8b0:4864:20::236]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 7F27B849AA for ; Sat, 17 Sep 2022 17:01:25 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-oi1-x236.google.com with SMTP id j188so7194901oih.0 for ; Sat, 17 Sep 2022 08:01:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date; bh=bM5MIK2OyEiC8SIEY4/G4HlP0dP0dzMvu3nxEGmzUmo=; b=Ql6fN/NCu4KIHcrFXgPFKWmgnW3vWRC+11jU38P/PwHLZVYwfzFI8Q1vZJdO0Qfhqt MxsTPFZ7CShEMV1X7oyHX5e8VREx7c4PODl0yh7k0Lm39oOietp6jF72C+wHvFPrd+od Xnd85nLZ4KMiRZFoUorB6dFYbSEVktjyQYb5o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=bM5MIK2OyEiC8SIEY4/G4HlP0dP0dzMvu3nxEGmzUmo=; b=GO28qU4KQIIIg+KkgcFftduoe2ho9FZCKxOKtGJ9EjodgyBbhVB08e3VRoefR79YnS pPP6aSyPeFcJKG+U2n+hFTj7FXkolVoB9V8rdRinU7srgUZeAL3LW6iBVGM9Oi8gfcWy 3ahcQobHs7zYvT3446k631E/dQW/nhspV+LMhPTPJ99EW6ty6/e2MV6X4dva++ggQ/ls WyFJ3qdKvOdSaICZY2HNzhurulsS+a0G5Hybp/83gyWjbAyNvbj/LSDUG8f+fUBUfiGR IkJqOlHRSJNxaMRvKfUsDSLVI45bYmQHey06kxbR3YfUr66NQXNLAkyzrqgAIV6FX5u2 sfpA== X-Gm-Message-State: ACrzQf0uFQR/l9xD63I6nnngc/B8NYDqb/3AmRSCVYaLF+4cn42tKlAG CPHgBT5TgKgDSIvLtz07bQg1oT0Mvt33AQ== X-Google-Smtp-Source: AMsMyM6+ke3gkI/42HWvfo4u2JXsaA9At6fkVeDQUhul8N4MMiTf9VC72ciwd8SMUt2/yCySiIB45g== X-Received: by 2002:aca:2b09:0:b0:34f:f6c3:da6f with SMTP id i9-20020aca2b09000000b0034ff6c3da6fmr4500510oik.49.1663426882873; Sat, 17 Sep 2022 08:01:22 -0700 (PDT) Received: from sjg1.roam.corp.google.com (c-67-190-102-125.hsd1.co.comcast.net. [67.190.102.125]) by smtp.gmail.com with ESMTPSA id t190-20020acaaac7000000b003458d346a60sm10464035oie.25.2022.09.17.08.01.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Sep 2022 08:01:22 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Alper Nebi Yasak , Quentin Schulz , Stefan Herbrechtsmeier , Simon Glass Subject: [PATCH v3] binman: Get futility by building it Date: Sat, 17 Sep 2022 09:01:19 -0600 Message-Id: <20220917150119.91961-1-sjg@chromium.org> X-Mailer: git-send-email 2.37.3.968.ga6b4b080e4-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean A binary download is not great, since it depends on libraries being present in the system. Build futility from source instead. Signed-off-by: Simon Glass --- Changes in v3: - Drop the branch, just use master instead - Explain why we are using a mirror - Drop mention of upstream patches as they are applied Changes in v2: - Pull from github instead, to avoid needing to login / gitcookies tools/binman/bintool.py | 10 +++++++--- tools/binman/btool/futility.py | 17 +++++++++++++---- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/tools/binman/bintool.py b/tools/binman/bintool.py index 032179a99de..a582d9d3446 100644 --- a/tools/binman/bintool.py +++ b/tools/binman/bintool.py @@ -319,7 +319,7 @@ class Bintool: return result.stdout @classmethod - def build_from_git(cls, git_repo, make_target, bintool_path): + def build_from_git(cls, git_repo, make_target, bintool_path, flags=None): """Build a bintool from a git repo This clones the repo in a temporary directory, builds it with 'make', @@ -330,6 +330,7 @@ class Bintool: make_target (str): Target to pass to 'make' to build the tool bintool_path (str): Relative path of the tool in the repo, after build is complete + flags (list of str): Flags or variables to pass to make, or None Returns: tuple: @@ -341,8 +342,11 @@ class Bintool: print(f"- clone git repo '{git_repo}' to '{tmpdir}'") tools.run('git', 'clone', '--depth', '1', git_repo, tmpdir) print(f"- build target '{make_target}'") - tools.run('make', '-C', tmpdir, '-j', f'{multiprocessing.cpu_count()}', - make_target) + cmd = ['make', '-C', tmpdir, '-j', f'{multiprocessing.cpu_count()}', + make_target] + if flags: + cmd += flags + tools.run(*cmd) fname = os.path.join(tmpdir, bintool_path) if not os.path.exists(fname): print(f"- File '{fname}' was not produced") diff --git a/tools/binman/btool/futility.py b/tools/binman/btool/futility.py index 75a05c2ac66..04c9aefe9b4 100644 --- a/tools/binman/btool/futility.py +++ b/tools/binman/btool/futility.py @@ -160,8 +160,17 @@ class Bintoolfutility(bintool.Bintool): Raises: Valuerror: Fetching could not be completed """ - if method != bintool.FETCH_BIN: + if method != bintool.FETCH_BUILD: return None - fname, tmpdir = self.fetch_from_drive( - '1hdsInzsE4aJbmBeJ663kYgjOQyW1I-E0') - return fname, tmpdir + + # The Chromium OS repo is here: + # https://chromium.googlesource.com/chromiumos/platform/vboot_reference/ + # + # Unfortunately this requires logging in and obtaining a line for the + # .gitcookies file. So use a mirror instead. + result = self.build_from_git( + 'https://github.com/sjg20/vboot_reference.git', + 'all', + 'build/futility/futility', + flags=['USE_FLASHROM=0']) + return result -- 2.37.3.968.ga6b4b080e4-goog