From patchwork Mon Nov 27 17:45:35 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: 119764 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp597211qgn; Mon, 27 Nov 2017 09:45:45 -0800 (PST) X-Google-Smtp-Source: AGs4zMaq+OIxRycjzp2usuXhwjt+OQ5o/byXgogc1BQd0QUIUuu8w05MRb572mYDWnPFDUHbf/w9 X-Received: by 10.80.164.209 with SMTP id x17mr25117355edb.158.1511804745482; Mon, 27 Nov 2017 09:45:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511804745; cv=none; d=google.com; s=arc-20160816; b=Wfj6CXIuEy4Vfc14CHzLXyBFeA7hFwcTUaprIjJUFEZUSOEwFspJLLBmPl8nIeOZDC rHil53UhxR1X2fzWVki7QacOgZmYfNO6vCUASLwcXCaPoKsrGiiW5wB9xvDTMesUrVqK iV5gpjqy1Za0uqKZxNtJOo+3GvjnJfuk10hMeUHvQ+DqTZ57NWfYKh2cCePG0ozPsRU/ MRk6bmme9RRNX/n+i/sQtXquD4pUJLEOYf59rPWBfwTydQrAo+xcvHaHH9u1CYYxWer3 UbOJ3aRL/iU8/Wsu5IB4pYLL9yyOuN//8u4zZBw1CemCGP2FP1DLcpq0XoPzNB4kbCmd CgGw== 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=32kN3QxCKtRkctPgQv1YPWDMN7lFN1Ox9VgVH2oTEO8=; b=vcivyDUE7J39QgOKSFpjJ5l1CpKXTva01KNiONqbDc7b9ks4qrxHaVEfDZHnVyTw/Y MbA4cnVO2XAmxyZI0pU6/DVAebmNFaGk7V59r3gIKxQEcgkApfhySva4nuzVbeQGFTWt ruJBxe1I/0WAt1+jUlb6j1HPJEDPenX8kAkA5CMzZ+bmzwFZ2Jo8M2kcTemEIsXFvXg9 eo92PNdjif24AyygPEOuFKYqUTOjnq/1umMo0Fb1w1Gy+fLu6AYI+sPG4ox6exuDsXZO +3D5wMIMyXwCV9i0XOmBI9d5N63gfkj3Rz4ztXsHDOedwohI5Q3h6ujnzYMRs5JUmEf/ SRBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=RA3+fnEl; 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 x47si378778edd.77.2017.11.27.09.45.45; Mon, 27 Nov 2017 09:45:45 -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=RA3+fnEl; 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 0275CC21DB1; Mon, 27 Nov 2017 17:45:43 +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_H3, RCVD_IN_MSPIKE_WL, 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 E5039C21C4C; Mon, 27 Nov 2017 17:45:41 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id E69A2C21C4C; Mon, 27 Nov 2017 17:45:40 +0000 (UTC) Received: from mail-wm0-f54.google.com (mail-wm0-f54.google.com [74.125.82.54]) by lists.denx.de (Postfix) with ESMTPS id 8B335C21C29 for ; Mon, 27 Nov 2017 17:45:40 +0000 (UTC) Received: by mail-wm0-f54.google.com with SMTP id x63so35795775wmf.2 for ; Mon, 27 Nov 2017 09:45:40 -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=WlDovKziRbkCrTHIJcntrBVnSXIBy8tJEOqFjEF6NH8=; b=RA3+fnEl2RztBlVorKeUEq8hAlRq3k/MMI5EBXaJy8Eh1JI1zSYJLJyKc7lxlTV7En VpXkFHSiK9a660xRhyIBSORTJSrz4l48z1JSq7ckWiTN9zcDW5xYh46M/EQC/O+ND6ko auh2+3+p+Pff3cU1IrGbnBcoPTqIOo3CxA+Mo= 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=WlDovKziRbkCrTHIJcntrBVnSXIBy8tJEOqFjEF6NH8=; b=HdjmJYFd8tDSbOqFxlHylkbZhY3q30hq7KuNQdfAbIo/88bhGdWqnha9kVEHPFURKQ OLzssE8V5bjTeunRDSqrtkWIDGiULTYuUcoDTneu6K1hsdbiaBry05YUQbJnbUItdKrE o4bYFefqU7xpKilh9K4en+v44DeMusuTcjUVfYHb/tlYk0xyR8klbx06zDaa0nMiMIlt asx2p4nKfEIsm+b9p14SFAvL9BgikzOf+vaJBtZ0RA+FUDXxp22obmN1WOgbWtM8ChKH +B0+LRqsmyZmVVETBQ3QyZTplbv6zs/GsGyxrmTt4boAemdhKugOREfzALXpq4tO0dsy V/wA== X-Gm-Message-State: AJaThX79j304R3iPKfhSfX2+wRIi2K6EAHLjhuUgfW9seBekyc3FmU8m H8PsLVDFYyQ2JsxcIXg5tKi0tA== X-Received: by 10.28.135.204 with SMTP id j195mr17139846wmd.119.1511804740111; Mon, 27 Nov 2017 09:45:40 -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 h7sm18636407wrb.35.2017.11.27.09.45.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 27 Nov 2017 09:45:39 -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:45:35 +0100 Message-Id: <1511804735-16238-1-git-send-email-jorge.ramirez-ortiz@linaro.org> X-Mailer: git-send-email 2.7.4 Subject: [U-Boot] [PATCHv3] env: enable accessing the environment in an 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)