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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9E5F3C6FD1D for ; Mon, 20 Mar 2023 05:50:07 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3622585B66; Mon, 20 Mar 2023 06:49:41 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="OWeohOss"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A4C6085B3F; Mon, 20 Mar 2023 06:49:38 +0100 (CET) Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id BB47D85B05 for ; Mon, 20 Mar 2023 06:49:34 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-pj1-x102b.google.com with SMTP id y2so11021004pjg.3 for ; Sun, 19 Mar 2023 22:49:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1679291373; 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; bh=fCBSXovhB8xgFmpHTmEonnA8/Gbm/VStjKjUu9gHswY=; b=OWeohOssacLgy8boj1DpWY1VFknFBmfphZiSr1lYkLfJYRAL2sr4NVpM7o7ZIAeBUL ByimytUFodaWptYEUDPqG4K/89FnJOt+nAws5WcwfbyVbNGXYMliFfeXJ4lhgVIbBgUH nY1/oroyTLD5ZJhqM7nUgi8A3v3owzMqCSUDE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679291373; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fCBSXovhB8xgFmpHTmEonnA8/Gbm/VStjKjUu9gHswY=; b=vBYlBLAokuDmb6QD105f5lcrQEo/i9znTTzKe82StRWoD3R7ibljLjHMEJsalzhUUh 2LtYhzbbaVEYbAKsIAUGr1GR14Tcrk8lw5p278bqR47NzXQB2uGefFfEHFDK7Os70Wa+ frJDb/6P0iGIrsT6U9j7iQi1ruf6d0ab9GrmG7zx63ZxgxDcu+SXgomsUQyIKYct4EmX xousWSQtHX2izL756X4tUB6qvzURyDfJer9MbRReynOGvfWxOULGUnWWaedS02p/vUZX 6BV2bSmCrGWsq7XBdV+WaKlrJ4G+mpNA0Xp/DorB8Laimj1Bu9U/2UyEbn2Epo0DhbiY FZpQ== X-Gm-Message-State: AO0yUKXXjimXRrqN33QCrNuBurIBD8L2Eqhy6toQLMA314b0EVCy19TZ fds3ZoGF5CP415RHdnCodSttqqDzc72v8IqoThM= X-Google-Smtp-Source: AK7set+r5mfgUM0gP4BDC67941LzDvospnR+DQJBYgSaX6s2YoFDL/h9ROltaMXoMFt36m06+BihwQ== X-Received: by 2002:a05:6a20:c87:b0:d9:ec4b:82c8 with SMTP id dt7-20020a056a200c8700b000d9ec4b82c8mr707241pzb.48.1679291372739; Sun, 19 Mar 2023 22:49:32 -0700 (PDT) Received: from localhost.localdomain ([27.110.126.54]) by smtp.gmail.com with ESMTPSA id c27-20020a634e1b000000b0050be57d7ec0sm5172786pgb.67.2023.03.19.22.49.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Mar 2023 22:49:32 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , huang lin , Jeffy Chen , Simon Glass , Kever Yang , Philipp Tomsich , Vagrant Cascadian Subject: [PATCH v3 9/9] bootstd: Relax the argument requirements for bootflow scan Date: Mon, 20 Mar 2023 18:48:01 +1300 Message-Id: <20230320054801.1273267-9-sjg@chromium.org> X-Mailer: git-send-email 2.40.0.rc1.284.g88254d51c5-goog In-Reply-To: <20230320054801.1273267-1-sjg@chromium.org> References: <20230320054801.1273267-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Currently this does not allow the -lb flags unless CMD_BOOTFLOW_FULL is enabled, which means that we need two separate boot commands. Relax this to make things easier. It is only a small amount of extra code. Signed-off-by: Simon Glass --- (no changes since v1) boot/Kconfig | 3 +-- cmd/bootflow.c | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/boot/Kconfig b/boot/Kconfig index 3bda7b5a793d..b8c1ebc4b345 100644 --- a/boot/Kconfig +++ b/boot/Kconfig @@ -1563,8 +1563,7 @@ config USE_BOOTCOMMAND config BOOTCOMMAND string "bootcmd value" depends on USE_BOOTCOMMAND && !USE_DEFAULT_ENV_FILE - default "bootflow scan -lb" if BOOTSTD_BOOTCOMMAND && CMD_BOOTFLOW_FULL - default "bootflow scan" if BOOTSTD_BOOTCOMMAND && !CMD_BOOTFLOW_FULL + default "bootflow scan -lb" if BOOTSTD_BOOTCOMMAND default "run distro_bootcmd" if !BOOTSTD_BOOTCOMMAND && DISTRO_DEFAULTS help This is the string of commands that will be used as bootcmd and if diff --git a/cmd/bootflow.c b/cmd/bootflow.c index 42f6e14a4370..c345b020070f 100644 --- a/cmd/bootflow.c +++ b/cmd/bootflow.c @@ -124,9 +124,19 @@ static int do_bootflow_scan(struct cmd_tbl *cmdtp, int flag, int argc, if (!label) dev = std->cur_bootdev; } else { + /* + * allow -b and -l (which is ignored) but complain about + * anything else + */ if (has_args) { - printf("Flags not supported: enable CONFIG_BOOTFLOW_FULL\n"); - return CMD_RET_USAGE; + char *p; + + for (p = argv[1] + 1; *p; p++) { + if (*p != 'b' && *p != 'l') { + printf("Flags not supported: enable CONFIG_BOOTFLOW_FULL\n"); + return CMD_RET_USAGE; + } + } } boot = true; } -- 2.40.0.rc1.284.g88254d51c5-goog