From patchwork Tue Oct 2 05:38:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Osterland-Heim X-Patchwork-Id: 977640 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=diehl.com Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42PSct4CNwz9sCq for ; Tue, 2 Oct 2018 15:38:53 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id F0EA6885C1; Tue, 2 Oct 2018 05:38:50 +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 etspwARhoKCY; Tue, 2 Oct 2018 05:38:50 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 241378855C; Tue, 2 Oct 2018 05:38:50 +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 7DF911BF421 for ; Tue, 2 Oct 2018 05:38:49 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 7AFEE85BBA for ; Tue, 2 Oct 2018 05:38:49 +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 yWwXw6fAbH6i for ; Tue, 2 Oct 2018 05:38:48 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from enterprise02.smtp.diehl.com (enterprise02.smtp.diehl.com [193.201.238.220]) by whitealder.osuosl.org (Postfix) with ESMTPS id 8110A85057 for ; Tue, 2 Oct 2018 05:38:47 +0000 (UTC) X-$ESA-Groupmapping: true X-IronPort-AV: E=Sophos;i="5.54,330,1534802400"; d="scan'208";a="36720702" From: Denis OSTERLAND To: "buildroot@buildroot.org" Thread-Topic: [PATCH] u-boot: add option to generate env image from default env Thread-Index: AQHUWhIgFG6aJiWt1EOnvtbKUvhoyw== Date: Tue, 2 Oct 2018 05:38:19 +0000 Message-ID: <20181002053526.11374-1-Denis.Osterland@diehl.com> Accept-Language: de-DE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: Evolution 3.18.5.2-0ubuntu3.2 MIME-Version: 1.0 X-TrailerSkip: 1 X-GBS-PROC: 415AWy8o668fDtCxszluz0dPvuPq2fzGUIFQ+amZrk1CoFtnRVwhH2KSnlBH3SNz Subject: [Buildroot] [PATCH] u-boot: add option to generate env image from default env X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Denis OSTERLAND Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Denis Osterland This patch adds support to extract compiled in default env via u-boots get_default_envs script and generate env image from it. Signed-off-by: Denis Osterland --- boot/uboot/Config.in | 15 +++++++++++++++ boot/uboot/uboot.mk | 6 +++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in index 9e40c11fa1..a2e9c3866a 100644 --- a/boot/uboot/Config.in +++ b/boot/uboot/Config.in @@ -468,8 +468,23 @@ menuconfig BR2_TARGET_UBOOT_ENVIMAGE if BR2_TARGET_UBOOT_ENVIMAGE +choice + prompt "source" + +config BR2_TARGET_UBOOT_ENVIMAGE_TEXTFILE + bool "text file" + +config BR2_TARGET_UBOOT_ENVIMAGE_BUIILTIN + bool "compiled in" + help + Use the default env from u-boot image. + requires >= v2018.03 + +endchoice # source + config BR2_TARGET_UBOOT_ENVIMAGE_SOURCE string "Source files for environment" + depends on BR2_TARGET_UBOOT_ENVIMAGE_TEXTFILE help Text files describing the environment. Files should have lines of the form var=value, one per line. Blank lines and diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk index c5abc125f3..ae9e38c8c2 100644 --- a/boot/uboot/uboot.mk +++ b/boot/uboot/uboot.mk @@ -263,7 +263,9 @@ endef ifneq ($(BR2_TARGET_UBOOT_ENVIMAGE),) define UBOOT_GENERATE_ENV_IMAGE - cat $(call qstrip,$(BR2_TARGET_UBOOT_ENVIMAGE_SOURCE)) \ + $(if $(BR2_TARGET_UBOOT_ENVIMAGE_BUIILTIN), \ + CROSS_COMPILE="$(TARGET_CROSS)" $(@D)/scripts/get_default_envs.sh $(@D), \ + cat $(call qstrip,$(BR2_TARGET_UBOOT_ENVIMAGE_SOURCE))) \ >$(@D)/buildroot-env.txt $(HOST_DIR)/bin/mkenvimage -s $(BR2_TARGET_UBOOT_ENVIMAGE_SIZE) \ $(if $(BR2_TARGET_UBOOT_ENVIMAGE_REDUNDANT),-r) \ @@ -376,9 +378,11 @@ endef ifeq ($(BR2_TARGET_UBOOT_ENVIMAGE),y) ifeq ($(BR_BUILDING),y) +ifeq ($(BR2_TARGET_UBOOT_ENVIMAGE_TEXTFILE),y) ifeq ($(call qstrip,$(BR2_TARGET_UBOOT_ENVIMAGE_SOURCE)),) $(error Please define a source file for Uboot environment (BR2_TARGET_UBOOT_ENVIMAGE_SOURCE setting)) endif +endif ifeq ($(call qstrip,$(BR2_TARGET_UBOOT_ENVIMAGE_SIZE)),) $(error Please provide Uboot environment size (BR2_TARGET_UBOOT_ENVIMAGE_SIZE setting)) endif