Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A908DC5AC7A for ; Thu, 6 Aug 2026 13:37:35 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 442D540558; Thu, 6 Aug 2026 13:37:35 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 6jCKLX8ssqrm; Thu, 6 Aug 2026 13:37:34 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=u-boot-bounces@lists.u-boot-project.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 574FE404C9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lists.u-boot-project.org ; s=default; t=1786023454; bh=W62VQ5O5YwMkjbfoBoHjj7E5Odd2rLqnCmyUCANdwOI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=02uFeovS/6cOWnbuQFZYrKMMawNCf4ik4adDWNLAlHbf7jfqzlC6wIJHlGC5bds8g RQJSsVo89SCLnvhtM1A5Y/7QCdLM5B2hUKoUiHVWNJBtkubJVeTPjpNcaIs0KTm12W sRo8zS/O/5hByaF0AIULibtcE5vEQnhbPi0cOufiuI2VzxJqaFGcsYmyQt07thoZR5 q42omVua/4MFDC+cOWUqdUf/bS1M8nbH1rnnLQA2twBekWoTIPH5ibYX6dQTD4XWRC m5dixNbF7HAbqfRxuDYH+spMGGkUX4Ym+3yOuUdNFMuCLMVYXbupU8UTKje2tvypHp +l+ASJASuA/RQ== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp4.osuosl.org (Postfix) with ESMTP id 574FE404C9; Thu, 6 Aug 2026 13:37:34 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists1.osuosl.org (Postfix) with ESMTP id EB59B28C for ; Thu, 6 Aug 2026 13:37:32 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id DD3FD60784 for ; Thu, 6 Aug 2026 13:37:32 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id h8M6fi8VMRi7 for ; Thu, 6 Aug 2026 13:37:32 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2a00:1450:4864:20::32f; helo=mail-wm1-x32f.google.com; envelope-from=mehmet.fide@gmail.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp3.osuosl.org E951C60763 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org E951C60763 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by smtp3.osuosl.org (Postfix) with ESMTPS id E951C60763 for ; Thu, 6 Aug 2026 13:37:31 +0000 (UTC) Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-493b966dd74so13599735e9.3 for ; Thu, 06 Aug 2026 06:37:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786023450; x=1786628250; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=W62VQ5O5YwMkjbfoBoHjj7E5Odd2rLqnCmyU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4994e7e6e99mr137448045e9.17.1786023449611; Thu, 06 Aug 2026 06:37:29 -0700 (PDT) Received: from deb05.proceq.com ([213.160.61.66]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4994e52d819sm91691585e9.1.2026.08.06.06.37.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Aug 2026 06:37:28 -0700 (PDT) From: Mehmet Fide To: u-boot@lists.u-boot-project.org Cc: Tom Rini , Simon Glass , Mehmet Fide Subject: [PATCH v2 1/2] cmd: allow bootd without bootm Date: Thu, 6 Aug 2026 15:37:23 +0200 Message-ID: <20260806133724.336755-2-mehmet.fide@gmail.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260806133724.336755-1-mehmet.fide@gmail.com> References: <20260806133724.336755-1-mehmet.fide@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786023450; x=1786628250; darn=lists.u-boot-project.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=W62VQ5O5YwMkjbfoBoHjj7E5Odd2rLqnCmyUCANdwOI=; b=N+E2Sp9r1+KRkx7JO5+ldfX6TzaxJp27gNj091XwPxYSfygZJgupsbsVeOOq5nYUNp XM7qFzh2BDWbEt4vDNCagSWHJqjU4btRmRn7R3EypdkX1VeZlMnnjaIIKl5b9dH5duDF C/8gx0/jM7KPlp+QmPRJlS1QDuKbTq8lyezxlElQscPRdmJHndH6xGQV/HGjKR3j15yi EShGvkH67tyPX1POXW1Xg8bHs7enyhMTW3abI2LMoHKW0awvG3bHEurZXmjPmJubrpgz m1FLcyUBK5s02cgMB28aPAdjJfsvvMI5AHxxc5AIFDyLvGqy+iFazOqCQS8oTbKEVCVT gj1g== X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dmarc=pass (p=none dis=none) header.from=gmail.com X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=N+E2Sp9r X-BeenThere: u-boot@lists.u-boot-project.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.u-boot-project.org Sender: "U-Boot" From: Mehmet Fide do_bootd() runs the "bootcmd" environment variable through run_command() and does nothing else. It uses no bootm functionality, and neither does the "bootd" recursion guard in cmd_process(). doc/usage/cmd/bootd.rst documents it that way, with an example that sets bootcmd to "echo Hello World". Commit 1fd04cf46baf ("cmd: Correct dependencies for CMD_BOOTD") made CMD_BOOTD depend on CMD_BOOTM because the build fails otherwise: common/command.c is compiled unconditionally and references do_bootd(), whose definition sits in cmd/bootm.c, which is only compiled when CMD_BOOTM=y. The dependency therefore describes where the code lives rather than what it needs, and the boards that disable CMD_BOOTM (colibri_vf, iot_devkit, mx6memcal and r8a78000_ironhide_cm33) cannot offer "boot" or "bootd" at all, although the implementation would work there. Move do_bootd() and its two command registrations into cmd/bootd.c, compiled from CMD_BOOTD, and drop the artificial dependency. To leave every board in tree unchanged, CMD_BOOTD now defaults to y only when CMD_BOOTM is enabled, which is precisely the set of boards that have it today. Boards without bootm can enable it deliberately. Tested on sandbox: bootd, the "boot" alias, the return value taken from a failing bootcmd and the recursion guard all behave as before. Also tested on a Colibri VF50 (vf610) board built with CMD_BOOTM=n and CMD_BOOTD=y, a combination that could not be selected before: "boot" and "bootd" run bootcmd and bring up the OS, and a bootcmd of "false" returns 1. A colibri_vf_defconfig build with CMD_BOOTD left off is byte identical to the previous one apart from the version string; enabling CMD_BOOTD costs 272 bytes. Signed-off-by: Mehmet Fide Reviewed-by: Tom Rini --- cmd/Kconfig | 3 +-- cmd/Makefile | 1 + cmd/bootd.c | 30 ++++++++++++++++++++++++++++++ cmd/bootm.c | 24 ------------------------ 4 files changed, 32 insertions(+), 26 deletions(-) create mode 100644 cmd/bootd.c diff --git a/cmd/Kconfig b/cmd/Kconfig index 35ce42f8397..f8eed5a5bdf 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -300,8 +300,7 @@ menu "Boot commands" config CMD_BOOTD bool "bootd" - depends on CMD_BOOTM - default y + default y if CMD_BOOTM help Run the command stored in the environment "bootcmd", i.e. "bootd" does the same thing as "run bootcmd". diff --git a/cmd/Makefile b/cmd/Makefile index ce772e5555b..7c3db81e524 100644 --- a/cmd/Makefile +++ b/cmd/Makefile @@ -6,6 +6,7 @@ ifndef CONFIG_XPL_BUILD # core command obj-y += boot.o +obj-$(CONFIG_CMD_BOOTD) += bootd.o obj-$(CONFIG_CMD_BOOTM) += bootm.o obj-$(CONFIG_CMD_HELP) += help.o obj-y += panic.o diff --git a/cmd/bootd.c b/cmd/bootd.c new file mode 100644 index 00000000000..d39b1bfe888 --- /dev/null +++ b/cmd/bootd.c @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * (C) Copyright 2000-2009 + * Wolfgang Denk, DENX Software Engineering, wd@denx.de. + */ + +/* + * bootd - boot default, i.e. run the command in the "bootcmd" environment + * variable + */ +#include +#include + +int do_bootd(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) +{ + return run_command(env_get("bootcmd"), flag); +} + +U_BOOT_CMD( + boot, 1, 1, do_bootd, + "boot default, i.e., run 'bootcmd'", + "" +); + +/* keep old command name "bootd" for backward compatibility */ +U_BOOT_CMD( + bootd, 1, 1, do_bootd, + "boot default, i.e., run 'bootcmd'", + "" +); diff --git a/cmd/bootm.c b/cmd/bootm.c index ca7cec91fad..07fd995ebed 100644 --- a/cmd/bootm.c +++ b/cmd/bootm.c @@ -229,30 +229,6 @@ U_BOOT_CMD( "boot application image from memory", bootm_help_text ); -/*******************************************************************/ -/* bootd - boot default image */ -/*******************************************************************/ -#if defined(CONFIG_CMD_BOOTD) -int do_bootd(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) -{ - return run_command(env_get("bootcmd"), flag); -} - -U_BOOT_CMD( - boot, 1, 1, do_bootd, - "boot default, i.e., run 'bootcmd'", - "" -); - -/* keep old command name "bootd" for backward compatibility */ -U_BOOT_CMD( - bootd, 1, 1, do_bootd, - "boot default, i.e., run 'bootcmd'", - "" -); - -#endif - /*******************************************************************/ /* iminfo - print header info for a requested image */ /*******************************************************************/ -- 2.54.0