From patchwork Mon Nov 27 17:41:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jorge Ramirez-Ortiz X-Patchwork-Id: 119763 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp592747qgn; Mon, 27 Nov 2017 09:42:05 -0800 (PST) X-Google-Smtp-Source: AGs4zMbikcW/lu2dRRc/ktqWuP+ycSjW31Y+2O4oyHm/lEaunOJfVRG+9tau/yGdVM0GkBD4xP+t X-Received: by 10.80.179.120 with SMTP id r53mr56006140edd.174.1511804525254; Mon, 27 Nov 2017 09:42:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511804525; cv=none; d=google.com; s=arc-20160816; b=gNwbLeIThOFEsX/Zk4JuYDZlii0TYIRlCUEPQB/AFDcM2ppaCtNbY6KwjOVPoXTZM1 VtPRaTWpr3V393cagP+YCKhBXC5Je5V+6Aub5zp45XXPW5QhOsehryGRDcDE23aZKA9g GS3ChRLuFreDOe8foaDP43G2xMfoJ7OOUTvlj5BjFpmq4y+t7ag4qkL1JgiibuhynxrS Mly16F7kW7wyWOqtjGD6SdyDWCCoyMbGylHPntLrGWub89HYPXpsJ3aIAaYLFp0JOJ0E xhgCih1B0eyi95SfuBaotZIXXu5MJvPSUXi52TA3S86N7hnwTWkQYO8Y9cDC6nhMEvKe Gu4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:dkim-signature :arc-authentication-results; bh=gSmkOrA0+uta0xNY342z7mkY2CGSLRrC6k9fBXUHkVY=; b=xsykhUNU2Noo0QoVmBVVJJ8hEfOcqb6jc0jW/3Wmvk9EHqwaVZrVupLIaro62BSD5+ txjjJ6cST4ZVw1A0FRYL2etNuC/D+vf4JXi2MJ7TrlVxFQADOzf/4J89MBBAjh2Onn4G 0F+jPM+lRssHpnwDN8XBkJusAKuv4WIQFzij3pbWSyNfkqOWaCek84iEkZxxBcfXcF8N 7xkoQtbDdAYrswtzJfEU21mcDqKUPkMuMUAdDlrv9tg6KHRCtJPoPNOyJml2p+cgeIUE GqrjeHSBRM//L0uaT06tqHq4UNM97vYAQneFhQT1j7u0RnrhyDq1ShOKI6QB8qeGxYyX TtzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=ObUsdF6S; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id 34si1720764edk.195.2017.11.27.09.42.04; Mon, 27 Nov 2017 09:42:05 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=ObUsdF6S; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.denx.de (Postfix, from userid 105) id 6FD03C21C29; Mon, 27 Nov 2017 17:42:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id A7BE7C21C4F; Mon, 27 Nov 2017 17:41:59 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 34004C21C29; Mon, 27 Nov 2017 17:41:58 +0000 (UTC) Received: from mail-wr0-f175.google.com (mail-wr0-f175.google.com [209.85.128.175]) by lists.denx.de (Postfix) with ESMTPS id DC8BFC21C4F for ; Mon, 27 Nov 2017 17:41:57 +0000 (UTC) Received: by mail-wr0-f175.google.com with SMTP id z34so3962099wrz.10 for ; Mon, 27 Nov 2017 09:41:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id; bh=mbNcslxsYc4kDtOvZ2ygHRgZANhjw+lKFu57hShq7tY=; b=ObUsdF6SR0E5v5RmcbBOUkEIBLhzoyaFsA8pLCUMTbXg76YN60QH5mSrLAhxNMDK4Z HbbLCqR20r8TA0FERge19pYTfHSHdWmHLqrO9qAqh1yzpmptoeHKu7g2jFxwKDVuov5w fKfvDavz28tHvZoXTdGY1RLpHyJj2FqoeP+P4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=mbNcslxsYc4kDtOvZ2ygHRgZANhjw+lKFu57hShq7tY=; b=N8yayH0BYr+3CSeameuj5S6Ttpzr6nTTS8DaVFln97brh4TXYJqrZtUZhT6d6kuyhc jVFS5gL2YifyPuISRsBC3iJJrGmJ5WrA7fI6xuXuyESdtGRr6I8KPSxtA65YlAlJfi5Z 9M765ZlKH/H8RaMmyY4cbqivM4A0Tp3CKi8rnZkhgJJUi6Nlacn0yPOuQl9ERb17XZww 5ehTXhqVXZdq5+crFWgbl5/8yI3kTQDTR3zMkCG2ncy0Azmet9VDqmlXbqb+yks48n/X UKPrCKzj8NGm1H8b/i+Wk7zAuLFwCoNfiFJUFxB+8k2kgrpw5n4C/jzahd1VhFWBpa3A ySgA== X-Gm-Message-State: AJaThX7a2H4UOYsIoq7PIeSjsOjbAyJCq7JUwNPq/0qjy+rypk3/NZJX zed79KZgFQ2ksYxEu1ztZnpp7Q== X-Received: by 10.223.170.4 with SMTP id p4mr4680955wrd.109.1511804517419; Mon, 27 Nov 2017 09:41:57 -0800 (PST) Received: from igloo.80.58.61.254 (141.pool85-51-114.dynamic.orange.es. [85.51.114.141]) by smtp.gmail.com with ESMTPSA id k5sm19851240wmg.21.2017.11.27.09.41.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 27 Nov 2017 09:41:56 -0800 (PST) From: Jorge Ramirez-Ortiz To: jorge.ramirez-ortiz@linaro.org, u-boot@lists.denx.de, trini@konsulko.com Date: Mon, 27 Nov 2017 18:41:51 +0100 Message-Id: <1511804511-15462-1-git-send-email-jorge.ramirez-ortiz@linaro.org> X-Mailer: git-send-email 2.7.4 Subject: [U-Boot] [PATCHv2] env: enable accessing the environemnt in EXT4 partition X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" the following commit enables accessing the environment in an ext4 partition. In order to do that, some definitions need to be added to include/configs/board_x.h file. For example to store the environment in a file named "uboot.env" in MMC "0", where partition "1" contains the EXT4 filesystem, you should define: EXT4_ENV_DEVICE_AND_PART "0:1" EXT4_ENV_INTERFACE "mmc" EXT4_ENV_FILE "/uboot.env" --- env/Kconfig | 7 +++++++ env/env.c | 2 ++ 2 files changed, 9 insertions(+) diff --git a/env/Kconfig b/env/Kconfig index 2477bf8..09309ab 100644 --- a/env/Kconfig +++ b/env/Kconfig @@ -81,6 +81,13 @@ config ENV_IS_IN_FAT - CONFIG_FAT_WRITE: This must be enabled. Otherwise it cannot save the environment file. +config ENV_IS_IN_EXT4 + bool "Environment is in a EXT4 filesystem" + depends on !CHAIN_OF_TRUST + select EXT4_WRITE + help + Define this if you want to use the EXT4 file system for the environment. + config ENV_IS_IN_FLASH bool "Environment in flash memory" depends on !CHAIN_OF_TRUST diff --git a/env/env.c b/env/env.c index 76a5608..7455632 100644 --- a/env/env.c +++ b/env/env.c @@ -32,6 +32,8 @@ static enum env_location env_get_default_location(void) return ENVL_EEPROM; else if IS_ENABLED(CONFIG_ENV_IS_IN_FAT) return ENVL_FAT; + else if IS_ENABLED(CONFIG_ENV_IS_IN_EXT4) + return ENVL_EXT4; else if IS_ENABLED(CONFIG_ENV_IS_IN_FLASH) return ENVL_FLASH; else if IS_ENABLED(CONFIG_ENV_IS_IN_MMC)