From patchwork Tue Nov 6 12:23:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martyn Welch X-Patchwork-Id: 993659 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; dmarc=fail (p=none dis=none) header.from=collabora.co.uk Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 42q850033bz9s8r for ; Tue, 6 Nov 2018 23:29:55 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 8F114C2275F; Tue, 6 Nov 2018 12:29:24 +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=SPF_HELO_PASS 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 AC51BC22365; Tue, 6 Nov 2018 12:29:04 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id C7EAAC22373; Tue, 6 Nov 2018 12:23:58 +0000 (UTC) Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by lists.denx.de (Postfix) with ESMTPS id 63B2BC22365 for ; Tue, 6 Nov 2018 12:23:58 +0000 (UTC) Received: from hermes (unknown [IPv6:2a00:23c5:58d:db00:31a7:36ef:edb4:a15d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: martyn) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 124A726104F; Tue, 6 Nov 2018 12:23:58 +0000 (GMT) Received: from martyn by hermes with local (Exim 4.89) (envelope-from ) id 1gK0Oh-0002O9-Eu; Tue, 06 Nov 2018 12:23:55 +0000 From: Martyn Welch To: Tom Rini Date: Tue, 6 Nov 2018 12:23:53 +0000 Message-Id: <20181106122353.9136-1-martyn.welch@collabora.co.uk> X-Mailer: git-send-email 2.11.0 X-Mailman-Approved-At: Tue, 06 Nov 2018 12:29:03 +0000 Cc: Martyn Welch , Heinrich Schuchardt , Alexander Graf , u-boot@lists.denx.de Subject: [U-Boot] [PATCH v3] Ability to modify distro boot filename 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" Add in the ability to modify the distro boot filename. Whilst not immediately useful in normal usage, it allows an alternative configuration to be provided when other u-boot functionality is used, such as bootcount limit, to fallback to an alternative boot configuration. In this case we can follow the same boot path as for normal boot, just using an alternatively named configuration file. For example, by providing the following `altbootcmd` when bootcount is in use: altbootcmd=setenv boot_extlinx_conf extlinux-rollback.conf; \ run distro_bootcmd Signed-off-by: Martyn Welch Reviewed-by: Heinrich Schuchardt --- Changes in v3: - Moving path to config variable, rename `boot_syslinux_conf` Changes in v2: - Moving config variable from `boot_config` to `boot_extlinux_conf` include/config_distro_bootcmd.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h index 373fee78a9..5838eb3477 100644 --- a/include/config_distro_bootcmd.h +++ b/include/config_distro_bootcmd.h @@ -355,15 +355,16 @@ "boot_script_dhcp=boot.scr.uimg\0" \ BOOTENV_BOOT_TARGETS \ \ + "boot_syslinux_conf=extlinux/extlinux.conf\0" \ "boot_extlinux=" \ "sysboot ${devtype} ${devnum}:${distro_bootpart} any " \ - "${scriptaddr} ${prefix}extlinux/extlinux.conf\0" \ + "${scriptaddr} ${prefix}${boot_syslinux_conf}\0" \ \ "scan_dev_for_extlinux=" \ "if test -e ${devtype} " \ "${devnum}:${distro_bootpart} " \ - "${prefix}extlinux/extlinux.conf; then " \ - "echo Found ${prefix}extlinux/extlinux.conf; " \ + "${prefix}${boot_syslinux_conf}; then " \ + "echo Found ${prefix}${boot_syslinux_conf}; " \ "run boot_extlinux; " \ "echo SCRIPT FAILED: continuing...; " \ "fi\0" \