From patchwork Thu Sep 12 23:41:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Barnett X-Patchwork-Id: 274620 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id 1569E2C0368 for ; Fri, 13 Sep 2013 09:42:04 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id D67258C255; Thu, 12 Sep 2013 23:42:02 +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 tL-qkSZRMzRR; Thu, 12 Sep 2013 23:42:01 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id A6C918C212; Thu, 12 Sep 2013 23:42:01 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 6048E1C26D4 for ; Thu, 12 Sep 2013 23:42:00 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 593928C22A for ; Thu, 12 Sep 2013 23:42:00 +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 hP1p4GSky0hf for ; Thu, 12 Sep 2013 23:41:59 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from secvs02.rockwellcollins.com (secvs02.rockwellcollins.com [205.175.225.241]) by whitealder.osuosl.org (Postfix) with ESMTPS id 590E68C212 for ; Thu, 12 Sep 2013 23:41:59 +0000 (UTC) Received: from nosuchhost.198.131.in-addr.arpa (HELO collinscrsmtp01.rockwellcollins.com) ([131.198.63.132]) by mail-virt.rockwellcollins.com with ESMTP; 12 Sep 2013 18:41:58 -0500 Received: from ares ([131.198.63.11]) by collinscrsmtp01.rockwellcollins.com (Lotus Domino Release 8.5.2FP2 HF162) with ESMTP id 2013091218415820-2735121 ; Thu, 12 Sep 2013 18:41:58 -0500 From: Ryan Barnett To: buildroot@busybox.net Date: Thu, 12 Sep 2013 18:41:43 -0500 Message-Id: <1379029303-17804-1-git-send-email-rjbarnet@rockwellcollins.com> X-Mailer: git-send-email 1.7.1 X-MIMETrack: Itemize by SMTP Server on CollinsCRSMTP01/CedarRapids/Collins/Rockwell(Release 8.5.2FP2 HF162|May 16, 2011) at 09/12/2013 06:41:58 PM, Serialize by Router on CollinsCRSMTP01/CedarRapids/Collins/Rockwell(Release 8.5.2FP2 HF162|May 16, 2011) at 09/12/2013 06:41:58 PM, Serialize complete at 09/12/2013 06:41:58 PM X-TNEFEvaluated: 1 Subject: [Buildroot] [PATCH 1/1] uboot: add support for a uEnv.txt file X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net Some boards in u-boot support the ability to modify the environment by placing a plain text file as uEnv.txt in the root of the partition of an SD card. For the extact placement of where the uEnv.txt should be, consult your u-boot environment. Your board supports this overwriting of environment variables if "loadbootenv" and "importbootenv" are defined in the board's environment. Add support for specifying a plain text file under Bootloaders > U-Boot > uEnv.txt that will be copied to the the BINARIES_DIR as uEnv.txt. Signed-off-by: Ryan Barnett --- boot/uboot/Config.in | 11 +++++++++++ boot/uboot/uboot.mk | 8 ++++++++ 2 files changed, 19 insertions(+), 0 deletions(-) diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in index 1b98339..d9d788c 100644 --- a/boot/uboot/Config.in +++ b/boot/uboot/Config.in @@ -241,4 +241,15 @@ config BR2_TARGET_UBOOT_ENVIMAGE_SIZE endif # BR2_TARGET_UBOOT_ENVIMAGE +config BR2_TARGET_UBOOT_ENV_TXT_FILE + string "uEnv.txt file" + help + If your board supports the ability to modify the environment + with a plain text file named uEnv.txt, specify a plain text + file that will be copied to the BINARIES_DIR as uEnv.txt. + Information about the format for this text file can be found + on TI's wiki under + "Setting U-Boot environment using uEnv.txt": + http://processors.wiki.ti.com/index.php/AM335x_U-Boot_User's_Guide + endif # BR2_TARGET_UBOOT diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk index 631da6b..68c055b 100644 --- a/boot/uboot/uboot.mk +++ b/boot/uboot/uboot.mk @@ -150,6 +150,14 @@ endif UBOOT_DEPENDENCIES += host-uboot-tools endif +UBOOT_ENV_TXT_FILE=$(call qstrip,$(BR2_TARGET_UBOOT_ENV_TXT_FILE)) +ifneq ($(UBOOT_ENV_TXT_FILE),) +define UBOOT_INSTALL_UENV_TXT_FILE + cp -dpf $(UBOOT_ENV_TXT_FILE) $(BINARIES_DIR)/uEnv.txt +endef +UBOOT_POST_INSTALL_IMAGES_HOOKS += UBOOT_INSTALL_UENV_TXT_FILE +endif + $(eval $(generic-package)) ifeq ($(BR2_TARGET_UBOOT),y)