From patchwork Sun Jan 21 03:16:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Derald D. Woods" X-Patchwork-Id: 864001 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="i/rIG6Do"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3zPKWN4RCWz9s74 for ; Sun, 21 Jan 2018 14:17:52 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 411E9C22023; Sun, 21 Jan 2018 03:16:52 +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=FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED, 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 A1A2CC2201C; Sun, 21 Jan 2018 03:16:47 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id AE558C21FE6; Sun, 21 Jan 2018 03:16:40 +0000 (UTC) Received: from mail-it0-f66.google.com (mail-it0-f66.google.com [209.85.214.66]) by lists.denx.de (Postfix) with ESMTPS id 9FFDAC22001 for ; Sun, 21 Jan 2018 03:16:36 +0000 (UTC) Received: by mail-it0-f66.google.com with SMTP id c102so8656072itd.0 for ; Sat, 20 Jan 2018 19:16:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=2DHnThR0e88NUSvPX+6MNGU1S39hM+NDrMISEiBPR+4=; b=i/rIG6DoDMDHY1zpmzH/PLDWeXMQrKr2iSyLNMw62Q3fD1MzbTqD4yl67wbQZOyE0j bxI/F4v3rM9wJyFtJfUK9l5glYUfsjzXLV6SxxW5kH5G1bpzBRY4Zxz2CFAoddICrnro 1OH1wYyXipITcRZVHA0eXaTW8lXd9oVWUz/wJt55nCGJpgq/8GD6nGVf1i6gKcrHuyAe PvI2A1dRnohF5wjeUtMMalIYvepbm+AJ8teN7XLE7gT4Bz0WrkkNbHWaRgKKZvDhEGfl 4EBO/DpshSLyHYW3oEqIwI0J5qy2xKIwx5hksAP20KMyMqeH5mWYX4+SepVIuk127rCQ WO6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=2DHnThR0e88NUSvPX+6MNGU1S39hM+NDrMISEiBPR+4=; b=spZgYEtWI9vOj1cVBEvk/c06pNlOusXcdxZVuO43IcP6u7cIPY2a1gSmPVJWjZo8np HXiQzkdcpb+2KUXc1xejwepLRWFW2us5Q6LxbPb9Q1tpODtYi4zfFokN5J2Nv1MvxYha D+T8WNalsa/q4FNNFwZwTURAdViCCC19HCzfekaiX8FUkhzT9IyoL5gTOh7ZGmJM1TDh mT/CRvLweeshBT1Yzd3QIQbpWnpjWOAQrzDmRBhZFCKr0S+zZLfI8B0THE768anbCA1j mdwKnH67TtMRT0hE2HCL5JWvYA56wpJlLbfHLbeXzKFtPYOMbHNwDfFAwpkJ5SahKasD /9NA== X-Gm-Message-State: AKwxytc8ik/zksVyoDi2X8xF5eGTizw6Y6GGrjgos/DVVuaPbyQfj8Cl pYYhqFDnjDlW/sRtejFx5rlHUA== X-Google-Smtp-Source: AH8x227brKXRfcuDOOEZ0ayDzGDio0GK7BMrW1iSxxzHiW+TFzFa4q36+oo+UZ+neHddnqC7PlyhCg== X-Received: by 10.36.61.205 with SMTP id n196mr3700199itn.95.1516504595325; Sat, 20 Jan 2018 19:16:35 -0800 (PST) Received: from ethiopia.woodsts.org (c-73-74-196-48.hsd1.il.comcast.net. [73.74.196.48]) by smtp.gmail.com with ESMTPSA id e7sm2457470ita.17.2018.01.20.19.16.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 20 Jan 2018 19:16:34 -0800 (PST) From: "Derald D. Woods" To: u-boot@lists.denx.de Date: Sat, 20 Jan 2018 21:16:13 -0600 Message-Id: <20180121031614.29091-2-woods.technical@gmail.com> X-Mailer: git-send-email 2.16.0 In-Reply-To: <20180121031614.29091-1-woods.technical@gmail.com> References: <20180121031614.29091-1-woods.technical@gmail.com> Cc: trini@konsulko.com Subject: [U-Boot] [PATCH 1/2] distro bootcmd: Allow board defined UBI partition and volume names 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" This commit allows overriding the default assumption that the boot UBI MTD partition is named 'UBI' and the UBI volume is 'boot'. A board desiring to use a legacy or alternative NAND layout can now define the following two extra environment variables: bootubipart= bootubivol= EXAMPLE: [include/configs/some_board.h] ---8<------------------------------------------------------------------- [...] #include #define MEM_LAYOUT_ENV_SETTINGS \ DEFAULT_LINUX_BOOT_ENV #define BOOT_TARGET_DEVICES(func) \ func(UBIFS, ubifs, 0) #include [...] #define CONFIG_EXTRA_ENV_SETTINGS \ MEM_LAYOUT_ENV_SETTINGS \ "bootubivol=rootfs\0" \ "bootubipart=rootfs\0" \ BOOTENV [...] ---8<------------------------------------------------------------------- Signed-off-by: Derald D. Woods --- include/config_distro_bootcmd.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h index 5c469a23fa..f567cebd38 100644 --- a/include/config_distro_bootcmd.h +++ b/include/config_distro_bootcmd.h @@ -71,10 +71,15 @@ #ifdef CONFIG_CMD_UBIFS #define BOOTENV_SHARED_UBIFS \ "ubifs_boot=" \ - "if ubi part UBI && ubifsmount ubi${devnum}:boot; then " \ - "setenv devtype ubi; " \ - "setenv bootpart 0; " \ - "run scan_dev_for_boot; " \ + "env exists bootubipart || " \ + "env set bootubipart UBI; " \ + "env exists bootubivol || " \ + "env set bootubivol boot; " \ + "if ubi part ${bootubipart} && " \ + "ubifsmount ubi${devnum}:${bootubivol}; " \ + "then " \ + "setenv devtype ubi; " \ + "run scan_dev_for_boot; " \ "fi\0" #define BOOTENV_DEV_UBIFS BOOTENV_DEV_BLKDEV #define BOOTENV_DEV_NAME_UBIFS BOOTENV_DEV_NAME_BLKDEV @@ -125,7 +130,7 @@ "${kernel_addr_r} efi/boot/"BOOTEFI_NAME"; " \ "if fdt addr ${fdt_addr_r}; then " \ "bootefi ${kernel_addr_r} ${fdt_addr_r};" \ - "else " \ + "else " \ "bootefi ${kernel_addr_r} ${fdtcontroladdr};" \ "fi\0" \ \