From patchwork Thu Sep 24 19:29:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Weber X-Patchwork-Id: 1370844 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.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=rockwellcollins.com 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=LygH8/W+; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4By4qv1q0Hz9sSn for ; Fri, 25 Sep 2020 05:29:47 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id C18262E0FE; Thu, 24 Sep 2020 19:29:44 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id npy80zhRZCcP; Thu, 24 Sep 2020 19:29:24 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 0BBAD22882; Thu, 24 Sep 2020 19:29:20 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 8DBB41BF3C6 for ; Thu, 24 Sep 2020 19:29:16 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 8911C86B47 for ; Thu, 24 Sep 2020 19:29:16 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id apXxHD7zv5Lp for ; Thu, 24 Sep 2020 19:29:15 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from ch3vs04.rockwellcollins.com (ch3vs04.rockwellcollins.com [205.175.226.52]) by whitealder.osuosl.org (Postfix) with ESMTPS id 2A9A585BCE for ; Thu, 24 Sep 2020 19:29:15 +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:in-reply-to: references; bh=WXytf1Ox4F+FTb5BnTUSb8100VXb6lrEHeJeHLjP1fg=; b=LygH8/W+i0otluaNDUzwZhyKW3Pc8tI4cjdpoSb9cCvV8ZKeFxOTKab+ GlO6B21kLpWXwlPcDAciD2XEo6YauxGT8s2fTnu4+droyM4vHEq0RjEnb mAvVbS0c+JyMh9xZKk6AXzlHPsjLReHsLIfMN/LAaIcnb6t/9L/ALYPJn 3Mhj9OhYvRsds1gxO4kKDhC6PLV8mbfnkS7nW4EGt1XOLtqkNb4njx9ON jt36subwHgAQ/UjH6tBGHJW3Tcoh0U6hn91HmNeGI/6ump0N9QHJN/L1G ai2FytZtTMxTAWy6P2icu/KNRE+WL7EFpRZFLW++EcTNRr/0QBFdiEVvS w==; IronPort-SDR: p8wRtwrociP+6Gdwk/xHtQ4/JwklzWI2lJvWnA0qmESY+pmiBpEtG20GFpn+Pz84vytKVhP7Ms m1nsxSQ988VJrHayPvvl1cOt4zjTvyTShybV0yu3ydl/THoqHSfnqlMAMPJEXv/R+cM6G+nSez UrPL10Hye112ja3l08uvFjrij/+9O8dULtnDCMSHo1x2g7pW9ETOvkSdlpBTwcwetJmfObyZY1 SJh90YoPhj5EWpYdFB8w8VWT3cXtoteYGJ75BAlQ36ZXEKEmFm/KPtzzabVgzO58X4g0/eF4x3 +oM= Received: from ofwch3n02.rockwellcollins.com (HELO ciulimr01.rockwellcollins.com) ([205.175.226.14]) by ch3vs04.rockwellcollins.com with ESMTP; 24 Sep 2020 14:29:14 -0500 X-Received: from biscuits.rockwellcollins.com (biscuits.rockwellcollins.lab [10.148.119.137]) by ciulimr01.rockwellcollins.com (Postfix) with ESMTP id 16B966029D; Thu, 24 Sep 2020 14:29:14 -0500 (CDT) From: Matt Weber To: buildroot@buildroot.org Date: Thu, 24 Sep 2020 14:29:10 -0500 Message-Id: <20200924192912.51913-2-matthew.weber@rockwellcollins.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200924192912.51913-1-matthew.weber@rockwellcollins.com> References: <20200924192912.51913-1-matthew.weber@rockwellcollins.com> Subject: [Buildroot] [PATCH v2 1/3] package/uboot-tools: migrate BR2_TARGET_UBOOT_ENVIMAGE from U-Boot pkg 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 MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Migrating the support for this feature to uboot-tools to gain the ability to build env files when BR2_TARGET_UBOOT isn't selected. Note: This patch creates a circular dependency with uboot until the similar migration patch is merged for uboot scripts Cc: Arnout Vandecappelle Signed-off-by: Matthew Weber --- Changes 1 -> 2 [Arnout - Config legacy entries for strings and cleaned up bool entries to have all the selects required - Did some renaming in the makefile - Used env files directly - Added build check that env file existed when !uboot but env img creation is enabled - Added Note in this commit message about the circular dependency - Fixed dependency on uboot to be a host dependency --- Config.in.legacy | 42 ++++++++++++++++++++++ boot/uboot/Config.in | 43 ----------------------- boot/uboot/uboot.mk | 25 ------------- package/uboot-tools/Config.in.host | 56 ++++++++++++++++++++++++++++-- package/uboot-tools/uboot-tools.mk | 36 +++++++++++++++++++ 5 files changed, 132 insertions(+), 70 deletions(-) diff --git a/Config.in.legacy b/Config.in.legacy index ae583b912f..213984ac9c 100644 --- a/Config.in.legacy +++ b/Config.in.legacy @@ -146,6 +146,48 @@ endif comment "Legacy options removed in 2020.11" +config BR2_TARGET_UBOOT_ENVIMAGE + bool "u-boot env generation was moved" + select BR2_LEGACY + select BR2_PACKAGE_HOST_UBOOT_TOOLS + select BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE + help + Migrated U-Boot env generation to uboot-tools + +config BR2_TARGET_UBOOT_ENVIMAGE_SOURCE + string "The uboot env image source string has been renamed" + help + Migrated U-Boot env generation to uboot-tools. + New option is named BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE_SOURCE + +config BR2_TARGET_UBOOT_ENVIMAGE_SOURCE_WRAP + bool + default y if BR2_TARGET_UBOOT_ENVIMAGE_SOURCE != "" + select BR2_LEGACY + +# Note: BR2_TARGET_UBOOT_ENVIMAGE_SOURCE is still referenced from package/uboot-tools/Config.in + +config BR2_TARGET_UBOOT_ENVIMAGE_SIZE + string "The uboot env image size string has been renamed" + help + Migrated U-Boot env generation to uboot-tools. + New option is named BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE_SIZE + +config BR2_TARGET_UBOOT_ENVIMAGE_SIZE_WRAP + bool + default y if BR2_TARGET_UBOOT_ENVIMAGE_SIZE != "" + select BR2_LEGACY + +# Note: BR2_TARGET_UBOOT_ENVIMAGE_SIZE is still referenced from package/uboot-tools/Config.in + +config BR2_TARGET_UBOOT_ENVIMAGE_REDUNDANT + bool "u-boot env generation was moved" + select BR2_LEGACY + select BR2_PACKAGE_HOST_UBOOT_TOOLS + select BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE_REDUNDANT + help + Migrated U-Boot env generation to uboot-tools + config BR2_PACKAGE_GQVIEW bool "gqview package was removed" select BR2_LEGACY diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in index a87a642581..668806dc50 100644 --- a/boot/uboot/Config.in +++ b/boot/uboot/Config.in @@ -533,49 +533,6 @@ config BR2_TARGET_UBOOT_ALTERA_SOCFPGA_IMAGE_CRC In either case the resulting file will be given a .crc extension. -menuconfig BR2_TARGET_UBOOT_ENVIMAGE - bool "Environment image" - help - Generate a valid binary environment image from a text file - describing the key=value pairs of the environment. - - The environment image will be called uboot-env.bin. - -if BR2_TARGET_UBOOT_ENVIMAGE - -config BR2_TARGET_UBOOT_ENVIMAGE_SOURCE - string "Source files for environment" - help - Text files describing the environment. Files should have - lines of the form var=value, one per line. Blank lines and - lines starting with a # are ignored. - - Multiple source files are concatenated in the order listed. - - Leave empty to generate image from compiled-in env. - -config BR2_TARGET_UBOOT_ENVIMAGE_SIZE - string "Size of environment" - help - Size of envronment, can be prefixed with 0x for hexadecimal - values. - -config BR2_TARGET_UBOOT_ENVIMAGE_REDUNDANT - bool "Environment has two copies" - help - Some platforms define in their U-Boot configuration that the - U-Boot environment should be duplicated in two locations (for - extra safety). Check your U-Boot configuration for the - CONFIG_ENV_ADDR_REDUND and CONFIG_ENV_SIZE_REDUND settings to - see if this is the case for your platform. - - If it is the case, then you should enable this option to - ensure that the U-Boot environment image generated by - Buildroot is compatible with the "redundant environment" - mechanism of U-Boot. - -endif # BR2_TARGET_UBOOT_ENVIMAGE - config BR2_TARGET_UBOOT_BOOT_SCRIPT bool "Generate a U-Boot boot script" help diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk index 1831466780..9dbd06b64b 100644 --- a/boot/uboot/uboot.mk +++ b/boot/uboot/uboot.mk @@ -312,21 +312,6 @@ define UBOOT_BUILD_OMAP_IFT -c $(call qstrip,$(BR2_TARGET_UBOOT_OMAP_IFT_CONFIG)) endef -ifneq ($(BR2_TARGET_UBOOT_ENVIMAGE),) -UBOOT_GENERATE_ENV_FILE = $(call qstrip,$(BR2_TARGET_UBOOT_ENVIMAGE_SOURCE)) -define UBOOT_GENERATE_ENV_IMAGE - $(if $(UBOOT_GENERATE_ENV_FILE), \ - cat $(UBOOT_GENERATE_ENV_FILE), \ - CROSS_COMPILE="$(TARGET_CROSS)" $(@D)/scripts/get_default_envs.sh $(@D)) \ - >$(@D)/buildroot-env.txt - $(HOST_DIR)/bin/mkenvimage -s $(BR2_TARGET_UBOOT_ENVIMAGE_SIZE) \ - $(if $(BR2_TARGET_UBOOT_ENVIMAGE_REDUNDANT),-r) \ - $(if $(filter "BIG",$(BR2_ENDIAN)),-b) \ - -o $(BINARIES_DIR)/uboot-env.bin \ - $(@D)/buildroot-env.txt -endef -endif - define UBOOT_INSTALL_IMAGES_CMDS $(foreach f,$(UBOOT_BINS), \ cp -dpf $(@D)/$(f) $(BINARIES_DIR)/ @@ -338,7 +323,6 @@ define UBOOT_INSTALL_IMAGES_CMDS cp -dpf $(@D)/$(f) $(BINARIES_DIR)/ ) ) - $(UBOOT_GENERATE_ENV_IMAGE) $(if $(BR2_TARGET_UBOOT_BOOT_SCRIPT), $(MKIMAGE) -C none -A $(MKIMAGE_ARCH) -T script \ -d $(call qstrip,$(BR2_TARGET_UBOOT_BOOT_SCRIPT_SOURCE)) \ @@ -443,15 +427,6 @@ define UBOOT_KCONFIG_FIXUP_CMDS $(UBOOT_ZYNQMP_KCONFIG_PSU_INIT) endef -ifeq ($(BR2_TARGET_UBOOT_ENVIMAGE),y) -ifeq ($(BR_BUILDING),y) -ifeq ($(call qstrip,$(BR2_TARGET_UBOOT_ENVIMAGE_SIZE)),) -$(error Please provide U-Boot environment size (BR2_TARGET_UBOOT_ENVIMAGE_SIZE setting)) -endif -endif -UBOOT_DEPENDENCIES += host-uboot-tools -endif - ifeq ($(BR2_TARGET_UBOOT_BOOT_SCRIPT),y) ifeq ($(BR_BUILDING),y) ifeq ($(call qstrip,$(BR2_TARGET_UBOOT_BOOT_SCRIPT_SOURCE)),) diff --git a/package/uboot-tools/Config.in.host b/package/uboot-tools/Config.in.host index 52a4c2ec30..a10835c589 100644 --- a/package/uboot-tools/Config.in.host +++ b/package/uboot-tools/Config.in.host @@ -37,6 +37,58 @@ config BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT public key is stored in a non-volatile place, any image can be verified in this way. -endif +endif # BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT -endif +config BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE + bool "Environment image" + help + Generate a valid binary environment image from a text file + describing the key=value pairs of the environment. + + This option can be useful to build enviornment configurations + as part of a Linux / rootfs only defconfig instead of using + post scripts. This supports a hardware use case of a single + bootloader only defconfig but multiple Linux / rootfs + defconfigs with different boot environments. + + The environment image will be called uboot-env.bin. + +if BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE + +config BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE_SOURCE + string "Source files for environment" + default BR2_TARGET_UBOOT_ENVIMAGE_SOURCE if BR2_TARGET_UBOOT_ENVIMAGE_SOURCE != "" # legacy + help + Text files describing the environment. Files should have + lines of the form var=value, one per line. Blank lines and + lines starting with a # are ignored. + + Multiple source files are concatenated in the order listed. + + Leave empty to generate image from compiled-in env if a U-boot + target build is configured (BR2_TARGET_UBOOT) + +config BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE_SIZE + string "Size of environment" + default BR2_TARGET_UBOOT_ENVIMAGE_SIZE if BR2_TARGET_UBOOT_ENVIMAGE_SIZE != "" # legacy + help + Size of envronment, can be prefixed with 0x for hexadecimal + values. + +config BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE_REDUNDANT + bool "Environment has two copies" + help + Some platforms define in their U-Boot configuration that the + U-Boot environment should be duplicated in two locations (for + extra safety). Check your U-Boot configuration for the + CONFIG_ENV_ADDR_REDUND and CONFIG_ENV_SIZE_REDUND settings to + see if this is the case for your platform. + + If it is the case, then you should enable this option to + ensure that the U-Boot environment image generated by + Buildroot is compatible with the "redundant environment" + mechanism of U-Boot. + +endif # BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE + +endif # BR2_PACKAGE_HOST_UBOOT_TOOLS diff --git a/package/uboot-tools/uboot-tools.mk b/package/uboot-tools/uboot-tools.mk index a06c25998f..0cb58ef70b 100644 --- a/package/uboot-tools/uboot-tools.mk +++ b/package/uboot-tools/uboot-tools.mk @@ -110,10 +110,46 @@ define HOST_UBOOT_TOOLS_BUILD_CMDS $(BR2_MAKE1) -C $(@D) $(HOST_UBOOT_TOOLS_MAKE_OPTS) tools-only endef +ifeq ($(BR2_TARGET_UBOOT),y) +define HOST_UBOOT_TOOLS_GENERATE_ENV_DEFAULTS + CROSS_COMPILE="$(TARGET_CROSS)" \ + $(UBOOT_SRCDIR)/scripts/get_default_envs.sh \ + $(UBOOT_SRCDIR) \ + >$(@D)/boot-env-defaults.txt +endef +HOST_UBOOT_TOOLS_DEPENDENCIES += uboot +endif + +ifneq ($(BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE),) +UBOOT_TOOLS_GENERATE_ENV_FILE = $(call qstrip,$(BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE_SOURCE)) +define HOST_UBOOT_TOOLS_GENERATE_ENV_IMAGE + $(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 \ + $(if $(UBOOT_TOOLS_GENERATE_ENV_FILE), \ + $(UBOOT_TOOLS_GENERATE_ENV_FILE), \ + $(@D)/boot-env-defaults.txt) +endef + +ifeq ($(BR_BUILDING),y) +ifeq ($(call qstrip,$(BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE_SIZE)),) +$(error Please provide U-Boot environment size (BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE_SIZE setting)) +endif +ifeq ($(BR2_TARGET_UBOOT),) +ifeq ($(call qstrip,$(BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE_SOURCE),) +$(error Please provide U-Boot environment file BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE_SOURCE setting)) +endif +endif #BR2_TARGET_UBOOT +endif #BR_BUILDING +endif #BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE + 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_DEFAULTS) + $(HOST_UBOOT_TOOLS_GENERATE_ENV_IMAGE) endef $(eval $(generic-package)) From patchwork Thu Sep 24 19:29:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Weber X-Patchwork-Id: 1370842 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.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=rockwellcollins.com 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=B6YPYsIn; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4By4qS1MCvz9sSn for ; Fri, 25 Sep 2020 05:29:24 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 33E6F86B79; Thu, 24 Sep 2020 19:29:21 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Dh4xCwd-wAEK; Thu, 24 Sep 2020 19:29:19 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 0B7E686B47; Thu, 24 Sep 2020 19:29:19 +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 35EB41BF9B5 for ; Thu, 24 Sep 2020 19:29:16 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 3262D8739B for ; Thu, 24 Sep 2020 19:29:16 +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 Oig7iEXvgAc7 for ; Thu, 24 Sep 2020 19:29:15 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from ch3vs03.rockwellcollins.com (ch3vs03.rockwellcollins.com [205.175.226.47]) by hemlock.osuosl.org (Postfix) with ESMTPS id 18DB0873A7 for ; Thu, 24 Sep 2020 19:29:15 +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:in-reply-to: references; bh=hxXry2yTSz0SbvMmmTJrr+bLqMTLq5IRCu9q9h2VjQM=; b=B6YPYsInn9eWpviTkTFrPvv2MFvkJOdTiBUwdHVtwQEE4ps8PjHFjO9h TrRpvARy566JuUlo12b2VGOE90qsIQzpri2J1PN03EWdahYL+JDoVuOqg LRVOL4VsP/c1htu0d0EcdTyNmDr6bwoiTZcmLxC/OrAHjMWka04bk1nso SMGbx93jG6/GylyYmIzhdfYgShgknBYUv4ZIJXRES63+/yzum4N3E7ZiU jwHdqCHVR9K1WAQ0jhRUmFPVaFCqMWXpGTEJDS6qfjXsb5Fe9/lQmq+5i zi3cDf05LgnMtkv+eSS2e/cC/E5dP9W2dhCLjoTAhs0tR8MW28m97iwbZ w==; IronPort-SDR: lrqSH8NG8PB55QdBcwIeF8E5UwYBMtjJ+60jL+3CGHVGfT/JWX3ux52YN1PvOpAfwVv2RdbyNA iLHriT0NeiN6oDcDCj/Qm4wQC32GtEM0Vx5jMpXxHd0A/Ngnppl+q2HWda7VAV37tIOZiGKvDK ZA16qTcrdUtv2X7sVN5UsX29QpBi1hMZgmWOHKI3SyBUVJHke07Yxc3EdJxuPLzBPubZ5/ELVD bfsloi7D2sQtp9eiRsbUPIBu/bFB3JbRaVxPIJqa1WEFURZ6dZsGFeFCyAZ2jU07vu65rgpNNt xn0= Received: from ofwch3n02.rockwellcollins.com (HELO ciulimr01.rockwellcollins.com) ([205.175.226.14]) by ch3vs03.rockwellcollins.com with ESMTP; 24 Sep 2020 14:29:15 -0500 X-Received: from biscuits.rockwellcollins.com (biscuits.rockwellcollins.lab [10.148.119.137]) by ciulimr01.rockwellcollins.com (Postfix) with ESMTP id 277CB60347; Thu, 24 Sep 2020 14:29:14 -0500 (CDT) From: Matt Weber To: buildroot@buildroot.org Date: Thu, 24 Sep 2020 14:29:11 -0500 Message-Id: <20200924192912.51913-3-matthew.weber@rockwellcollins.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200924192912.51913-1-matthew.weber@rockwellcollins.com> References: <20200924192912.51913-1-matthew.weber@rockwellcollins.com> Subject: [Buildroot] [PATCH v2 2/3] package/uboot-tools: migrate BR2_TARGET_UBOOT_BOOT_SCRIPT from U-Boot pkg 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 MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" For consistancy and dependencies between uboot and uboot-tools, this patch migrates the script creation over in a similar way as the env image creation. Cc: Arnout Vandecappelle Signed-off-by: Matthew Weber --- Changes 1 -> 2 [Arnout - Config legacy entries for strings and cleaned up bool entries to have all the selects required --- Config.in.legacy | 21 +++++++++++++++++++++ boot/uboot/Config.in | 16 ---------------- boot/uboot/uboot.mk | 13 ------------- package/uboot-tools/Config.in.host | 17 +++++++++++++++++ package/uboot-tools/uboot-tools.mk | 12 ++++++++++++ 5 files changed, 50 insertions(+), 29 deletions(-) diff --git a/Config.in.legacy b/Config.in.legacy index 213984ac9c..840e1c5ef8 100644 --- a/Config.in.legacy +++ b/Config.in.legacy @@ -146,6 +146,27 @@ endif comment "Legacy options removed in 2020.11" +config BR2_TARGET_UBOOT_BOOT_SCRIPT + bool "u-boot script generation was moved" + select BR2_LEGACY + select BR2_PACKAGE_HOST_UBOOT_TOOLS + select BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT + help + Migrated U-Boot script generation to uboot-tools + +config BR2_TARGET_UBOOT_BOOT_SCRIPT_SOURCE + string "The uboot script source string has been renamed" + help + Migrated U-Boot script generation to uboot-tools. + New option is named BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT_SOURCE + +config BR2_TARGET_UBOOT_BOOT_SCRIPT_SOURCE_WRAP + bool + default y if BR2_TARGET_UBOOT_BOOT_SCRIPT_SOURCE != "" + select BR2_LEGACY + +# Note: BR2_TARGET_UBOOT_BOOT_SCRIPT_SOURCE is still referenced from package/uboot-tools/Config.in + config BR2_TARGET_UBOOT_ENVIMAGE bool "u-boot env generation was moved" select BR2_LEGACY diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in index 668806dc50..ae501a05d6 100644 --- a/boot/uboot/Config.in +++ b/boot/uboot/Config.in @@ -533,22 +533,6 @@ config BR2_TARGET_UBOOT_ALTERA_SOCFPGA_IMAGE_CRC In either case the resulting file will be given a .crc extension. -config BR2_TARGET_UBOOT_BOOT_SCRIPT - bool "Generate a U-Boot boot script" - help - Generate a U-Boot boot script, given a file listing U-Boot - commands to be executed at boot time. The generated boot - script will be called 'boot.scr'. - -if BR2_TARGET_UBOOT_BOOT_SCRIPT - -config BR2_TARGET_UBOOT_BOOT_SCRIPT_SOURCE - string "U-Boot boot script source" - help - Source file to generate the U-Boot boot script. - -endif - if BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG config BR2_TARGET_UBOOT_CUSTOM_DTS_PATH diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk index 9dbd06b64b..f27abbd5ba 100644 --- a/boot/uboot/uboot.mk +++ b/boot/uboot/uboot.mk @@ -323,10 +323,6 @@ define UBOOT_INSTALL_IMAGES_CMDS cp -dpf $(@D)/$(f) $(BINARIES_DIR)/ ) ) - $(if $(BR2_TARGET_UBOOT_BOOT_SCRIPT), - $(MKIMAGE) -C none -A $(MKIMAGE_ARCH) -T script \ - -d $(call qstrip,$(BR2_TARGET_UBOOT_BOOT_SCRIPT_SOURCE)) \ - $(BINARIES_DIR)/boot.scr) endef ifeq ($(BR2_TARGET_UBOOT_ZYNQMP),y) @@ -427,15 +423,6 @@ define UBOOT_KCONFIG_FIXUP_CMDS $(UBOOT_ZYNQMP_KCONFIG_PSU_INIT) endef -ifeq ($(BR2_TARGET_UBOOT_BOOT_SCRIPT),y) -ifeq ($(BR_BUILDING),y) -ifeq ($(call qstrip,$(BR2_TARGET_UBOOT_BOOT_SCRIPT_SOURCE)),) -$(error Please define a source file for U-Boot boot script (BR2_TARGET_UBOOT_BOOT_SCRIPT_SOURCE setting)) -endif -endif -UBOOT_DEPENDENCIES += host-uboot-tools -endif - ifeq ($(BR2_TARGET_UBOOT)$(BR_BUILDING),yy) # diff --git a/package/uboot-tools/Config.in.host b/package/uboot-tools/Config.in.host index a10835c589..431cc8631d 100644 --- a/package/uboot-tools/Config.in.host +++ b/package/uboot-tools/Config.in.host @@ -91,4 +91,21 @@ config BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE_REDUNDANT endif # BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE +config BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT + bool "Generate a U-Boot boot script" + help + Generate a U-Boot boot script, given a file listing U-Boot + commands to be executed at boot time. The generated boot + script will be called 'boot.scr'. + +if BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT + +config BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT_SOURCE + string "U-Boot boot script source" + default BR2_TARGET_UBOOT_BOOT_SCRIPT_SOURCE if BR2_TARGET_UBOOT_BOOT_SCRIPT_SOURCE != "" # legacy + help + Source file to generate the U-Boot boot script. + +endif # BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT + endif # BR2_PACKAGE_HOST_UBOOT_TOOLS diff --git a/package/uboot-tools/uboot-tools.mk b/package/uboot-tools/uboot-tools.mk index 0cb58ef70b..65d915b6eb 100644 --- a/package/uboot-tools/uboot-tools.mk +++ b/package/uboot-tools/uboot-tools.mk @@ -144,12 +144,24 @@ endif #BR2_TARGET_UBOOT endif #BR_BUILDING endif #BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE +ifeq ($(BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT),y) +ifeq ($(BR_BUILDING),y) +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 +endif #BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT + 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_DEFAULTS) $(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) endef $(eval $(generic-package)) From patchwork Thu Sep 24 19:29:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Weber X-Patchwork-Id: 1370843 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.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=rockwellcollins.com 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=UX8rnoXU; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4By4qV5gx9z9sSn for ; Fri, 25 Sep 2020 05:29:26 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 22A7686BB0; Thu, 24 Sep 2020 19:29:25 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id F4mD3QxBkmiI; Thu, 24 Sep 2020 19:29:23 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id ED00386B5C; Thu, 24 Sep 2020 19:29:22 +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 CB8181BF3C6 for ; Thu, 24 Sep 2020 19:29:16 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id C8A298739B for ; Thu, 24 Sep 2020 19:29:16 +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 f28HUAONK4XV for ; Thu, 24 Sep 2020 19:29:15 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from secvs05.rockwellcollins.com (secvs05.rockwellcollins.com [205.175.225.131]) by hemlock.osuosl.org (Postfix) with ESMTPS id 2EA0B873C2 for ; Thu, 24 Sep 2020 19:29:15 +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:in-reply-to: references; bh=07gi1yGbFGGs5PB332J2JzSHddM43I9K2JoNYbGfAJE=; b=UX8rnoXUmvN2GstNf63p5ZZrQr9KUB8754mG1BKbiO+fgiPuqaZ1Z5R2 pvDJdz5lTCqTS+bxilX7cjnXeS43vQBdjfWy/Aacrs67ap+nXxYo9Jngj FghAbQvZqEx2VEI59mhMEY1YJ3wGmMg3xEmv+c9tF7UERM41bUJmUUabu bm9LqF6dLs4xYfDjzJ826WDolVCnLfot65SYwGzQjlgGk9R0LsNC5VWvC QQbUL6r5kQ0zvxvGFGRUyFLMmqnToXXJyPjbTh21tXfqP6xaQKhtjYO8E J21DbfG0BIT8wHK+4GH2GUSLD3gEQ6gz7XWrlIBRC14gy2EEwwjTEPOPU w==; IronPort-SDR: PP+YflP13f8/T4hHi5eCFIxWnvp6eUCu/X04TteC1RyUSPNqTYSRqu5yMZXy7HOCu07sp2wdsx TkDciYyofF6C1wv9y8Zh3XxYiS8ZSkDrxNXNNA5BP8WMqYEToukQTF9xorXFu57w4ihI6uqUfg gDU/WxD6GvrZhxt0dUqSBBkVS9c2+SoV6FA/kwXxFTPMsvSMsisAR7wMt/75AonvFX2vloDptf Wpxjf/D/7CqcJ5PRtN1PgjvXGPhFOS22rw0w7AxGuw7eRR40nrgfrpQfb2SNqCWUyhnpNtuouf JBI= Received: from ofwgwc03.rockwellcollins.com (HELO ciulimr01.rockwellcollins.com) ([205.175.225.12]) by secvs05.rockwellcollins.com with ESMTP; 24 Sep 2020 14:29:14 -0500 X-Received: from biscuits.rockwellcollins.com (biscuits.rockwellcollins.lab [10.148.119.137]) by ciulimr01.rockwellcollins.com (Postfix) with ESMTP id 38FB060349; Thu, 24 Sep 2020 14:29:14 -0500 (CDT) From: Matt Weber To: buildroot@buildroot.org Date: Thu, 24 Sep 2020 14:29:12 -0500 Message-Id: <20200924192912.51913-4-matthew.weber@rockwellcollins.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200924192912.51913-1-matthew.weber@rockwellcollins.com> References: <20200924192912.51913-1-matthew.weber@rockwellcollins.com> Subject: [Buildroot] [PATCH v2 3/3] genrandconfig: uboot-tools env/scr creation test files 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 MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Normally the kconfig stings would end up empty and cause a build error. This patch provides test files to allow testing the creation of uboot environment and script bin files from user provided txt files. Cc: Arnout Vandecappelle Signed-off-by: Matthew Weber --- utils/genrandconfig | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/utils/genrandconfig b/utils/genrandconfig index 63ff32cbfb..93dc6d898b 100755 --- a/utils/genrandconfig +++ b/utils/genrandconfig @@ -301,6 +301,22 @@ def fixup_config(sysinfo, configfile): 'BR2_PACKAGE_FLANN=y\n' in configlines: return False + if 'BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE=y\n' in configlines: + bootenv = os.path.join(args.outputdir, "boot_env.txt") + with open(bootenv, "w+") as bootenvf: + bootenvf.write("prop=value") + configlines.remove('BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE_SOURCE=""\n') + configlines.append('BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE_SOURCE="%s"\n' % bootenv) + configlines.remove('BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE_SIZE=""\n') + configlines.append('BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE_SIZE="0x1000"\n') + + if 'BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT=y\n' in configlines: + bootscr = os.path.join(args.outputdir, "boot_script.txt") + with open(bootscr, "w+") as bootscrf: + bootscrf.write("prop=value") + configlines.remove('BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT_SOURCE=""\n') + configlines.append('BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT_SOURCE="%s"\n' % bootscr) + with open(configfile, "w+") as configf: configf.writelines(configlines)