From patchwork Tue Jan 26 13:14:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Weber X-Patchwork-Id: 1431686 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=rockwellcollins.com header.i=@rockwellcollins.com header.a=rsa-sha256 header.s=hrcrc2020 header.b=hCxFX6lY; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DQ6pB48gtz9sRR for ; Wed, 27 Jan 2021 00:21:52 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 12F55855DF; Tue, 26 Jan 2021 13:21:50 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lgSG-oPVWtII; Tue, 26 Jan 2021 13:21:49 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 58384855BE; Tue, 26 Jan 2021 13:21:49 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id CEEAC1BF2F0 for ; Tue, 26 Jan 2021 13:21:48 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id CB75D870A1 for ; Tue, 26 Jan 2021 13:21:48 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WT3Yqd+EUvEF for ; Tue, 26 Jan 2021 13:21:46 +0000 (UTC) X-Greylist: delayed 00:07:06 by SQLgrey-1.7.6 Received: from da1vs02.rockwellcollins.com (da1vs02.rockwellcollins.com [205.175.227.29]) by hemlock.osuosl.org (Postfix) with ESMTPS id C0EF187097 for ; Tue, 26 Jan 2021 13:21:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rockwellcollins.com; s=hrcrc2020; h=from:to:cc:subject:date:message-id; bh=Mo+IruG+Zy7s3a3B57v3rp5ZDbiet6OqKwJ82l6t0SQ=; b=hCxFX6lY7AeR2aVX2oyuO4tHlbREYoXW+DUSpycrvLSjUmPrK0df98Lw gudBOu/quh5MZ4+v9PrAuQycbTUBk8ghp9lUmdYBnA4K3iC2nbrSB1I/4 7t2xM9ZMsLGTDMlTfBSpObNroX7YA970V0Jq4aKUE1TGqq0JwrYH0VutI nv6hgumYM55tx/AULn0BWwBORZ6SYBS4198SiPUJHEF04qDEmk1SWyXxs V7YhrQqE7/ixjs+c0wdg3Qo2pVx7RKjXQKOwM/a4bh0oWS3KM+zQfrE6D +y4o4UXm7nhAdQvn88AfD/enH3pBqaFs8ddr5o01e+JyRYNzUJcYQWNLc Q==; IronPort-SDR: q+h9s0l5nsN2yJXqZP/zJWiLO3UPtoVuA8nnkt9K5TheqtYplD8Hi7cM3LeneJdQXjrrQhmrpb HqsQEBCjj9UtuWUeC1JsBcQsv6FmGe8BWmbmLIicaBASCqYDOBDwmQmodDhzltgFtsAY4KxkPU vtaVdYu59ljMD5PzAROy4V67rgLM/m1u8b7dnFri4InsX5eifhGOpTNSsFGdznjArWX4ROmZM5 8TNwdhTpqnRuBIwgPplrP5Te4Z1xc/V7cRmSneIS34fSQ8DPbvQHYIbIQGIr9xBFIKG4P6Hr3R syw= Received: from ofwda1n02.rockwellcollins.com (HELO dtulimr01.rockwellcollins.com) ([205.175.227.14]) by da1vs02.rockwellcollins.com with ESMTP; 26 Jan 2021 07:14:39 -0600 X-Received: from biscuits.rockwellcollins.com (biscuits.rockwellcollins.lab [10.148.119.137]) by dtulimr01.rockwellcollins.com (Postfix) with ESMTP id DD5E06043D; Tue, 26 Jan 2021 07:14:38 -0600 (CST) From: Matt Weber To: buildroot@buildroot.org Date: Tue, 26 Jan 2021 07:14:37 -0600 Message-Id: <20210126131437.9633-1-matthew.weber@rockwellcollins.com> X-Mailer: git-send-email 2.17.1 Subject: [Buildroot] [PATCH v2] package/uboot-tools: resolve host uboot env/script error X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Matt Weber , Kalpesh Panchal MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Kalpesh Panchal The host build of uboot-tools can occur early in the build process and may require the creation of BINARIES_DIR before generation of an enabled envimage and/or boot script binary. So to resolve this in proper way, separated the build and installation part of uboot env/script in their respective commands. Signed-off-by: Kalpesh Panchal Signed-off-by: Matt Weber --- Changes v1 -> v2 [Thomas P - Split build and install operations out for script and env features. (Allows the install step to take care of the mkdir naturally) --- package/uboot-tools/uboot-tools.mk | 50 ++++++++++++++++++------------ 1 file changed, 31 insertions(+), 19 deletions(-) diff --git a/package/uboot-tools/uboot-tools.mk b/package/uboot-tools/uboot-tools.mk index 10cbd1cdd9..f2bd627e92 100644 --- a/package/uboot-tools/uboot-tools.mk +++ b/package/uboot-tools/uboot-tools.mk @@ -89,6 +89,8 @@ define UBOOT_TOOLS_INSTALL_TARGET_CMDS $(UBOOT_TOOLS_INSTALL_FIT_CHECK_SIGN) endef +# host-uboot-tools + define HOST_UBOOT_TOOLS_CONFIGURE_CMDS mkdir -p $(@D)/include/config touch $(@D)/include/config/auto.conf @@ -108,10 +110,6 @@ HOST_UBOOT_TOOLS_MAKE_OPTS += CONFIG_FIT_SIGNATURE=y CONFIG_FIT_SIGNATURE_MAX_SI HOST_UBOOT_TOOLS_DEPENDENCIES += host-openssl endif -define HOST_UBOOT_TOOLS_BUILD_CMDS - $(BR2_MAKE1) -C $(@D) $(HOST_UBOOT_TOOLS_MAKE_OPTS) tools-only -endef - ifeq ($(BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE),y) UBOOT_TOOLS_GENERATE_ENV_FILE = $(call qstrip,$(BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE_SOURCE)) @@ -124,16 +122,7 @@ define HOST_UBOOT_TOOLS_GENERATE_ENV_DEFAULTS > $(UBOOT_TOOLS_GENERATE_ENV_FILE) endef HOST_UBOOT_TOOLS_DEPENDENCIES += uboot -endif - -define HOST_UBOOT_TOOLS_GENERATE_ENV_IMAGE - $(HOST_UBOOT_TOOLS_GENERATE_ENV_DEFAULTS) - $(HOST_DIR)/bin/mkenvimage -s $(BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE_SIZE) \ - $(if $(BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE_REDUNDANT),-r) \ - $(if $(filter "BIG",$(BR2_ENDIAN)),-b) \ - -o $(BINARIES_DIR)/uboot-env.bin \ - $(UBOOT_TOOLS_GENERATE_ENV_FILE) -endef +endif #UBOOT_TOOLS_GENERATE_ENV_FILE:BR2_TARGET_UBOOT ifeq ($(BR_BUILDING),y) ifeq ($(call qstrip,$(BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE_SIZE)),) @@ -148,6 +137,17 @@ endif endif #BR2_TARGET_UBOOT endif #BR_BUILDING +define HOST_UBOOT_TOOLS_GENERATE_ENVIMAGE + $(HOST_UBOOT_TOOLS_GENERATE_ENV_DEFAULTS) + $(@D)/tools/mkenvimage -s $(BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE_SIZE) \ + $(if $(BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE_REDUNDANT),-r) \ + $(if $(filter "BIG",$(BR2_ENDIAN)),-b) \ + -o $(@D)/tools/uboot-env.bin \ + $(UBOOT_TOOLS_GENERATE_ENV_FILE) +endef +define HOST_UBOOT_TOOLS_INSTALL_ENVIMAGE + $(INSTALL) -m 0755 -D $(@D)/tools/uboot-env.bin $(BINARIES_DIR)/uboot-env.bin +endef endif #BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE ifeq ($(BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT),y) @@ -156,17 +156,29 @@ ifeq ($(call qstrip,$(BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT_SOURCE)),) $(error Please define a source file for U-Boot boot script (BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT_SOURCE setting)) endif endif #BR_BUILDING + +define HOST_UBOOT_TOOLS_GENERATE_BOOT_SCRIPT + $(@D)/tools/mkimage -C none -A $(MKIMAGE_ARCH) -T script \ + -d $(call qstrip,$(BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT_SOURCE)) \ + $(@D)/tools/boot.scr) +endef +define HOST_UBOOT_TOOLS_INSTALL_BOOT_SCRIPT + $(INSTALL) -m 0755 -D $(@D)/tools/boot.scr $(BINARIES_DIR)/boot.scr +endef endif #BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT +define HOST_UBOOT_TOOLS_BUILD_CMDS + $(BR2_MAKE1) -C $(@D) $(HOST_UBOOT_TOOLS_MAKE_OPTS) tools-only + $(HOST_UBOOT_TOOLS_GENERATE_ENVIMAGE) + $(HOST_UBOOT_TOOLS_GENERATE_BOOT_SCRIPT) +endef + define HOST_UBOOT_TOOLS_INSTALL_CMDS $(INSTALL) -m 0755 -D $(@D)/tools/mkimage $(HOST_DIR)/bin/mkimage $(INSTALL) -m 0755 -D $(@D)/tools/mkenvimage $(HOST_DIR)/bin/mkenvimage $(INSTALL) -m 0755 -D $(@D)/tools/dumpimage $(HOST_DIR)/bin/dumpimage - $(HOST_UBOOT_TOOLS_GENERATE_ENV_IMAGE) - $(if $(BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT), - $(MKIMAGE) -C none -A $(MKIMAGE_ARCH) -T script \ - -d $(call qstrip,$(BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT_SOURCE)) \ - $(BINARIES_DIR)/boot.scr) + $(HOST_UBOOT_TOOLS_INSTALL_ENVIMAGE) + $(HOST_UBOOT_TOOLS_INSTALL_BOOT_SCRIPT) endef $(eval $(generic-package))