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 860C3C678D4 for ; Thu, 2 Mar 2023 03:41:06 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2DCD185C2F; Thu, 2 Mar 2023 04:40:11 +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="QekLsAQp"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6A77085C5D; Thu, 2 Mar 2023 04:40:07 +0100 (CET) Received: from mail-io1-xd31.google.com (mail-io1-xd31.google.com [IPv6:2607:f8b0:4864:20::d31]) (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 C354885C56 for ; Thu, 2 Mar 2023 04:40:03 +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-io1-xd31.google.com with SMTP id g6so6242572iov.13 for ; Wed, 01 Mar 2023 19:40:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1677728400; 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=KCFhvCPxfEC9qtSHC3KeI7JUBRgvgiTIZ179vH0J4I8=; b=QekLsAQpNKz5AcHdA/HV90KXafNS0TBjl69k4fvqFB2ZDZdytOiOKUdkANsII3b/sF H57R1B71JxBR3PXaxbWU5mS5rp95fNOh1jtM2o7W7VMWE8R2T5yUYomyasfVusbupf68 vOJbAFBLq8f8GpXID23CpHHp4rb7Ekl16fJWk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677728400; 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=KCFhvCPxfEC9qtSHC3KeI7JUBRgvgiTIZ179vH0J4I8=; b=N/ifu4T8543y/VUw3TiIg1Jl6fpaSQZx2TQGaryitlRJLkl+PJ1nzIya4lg35OG8g3 EzUvGyWgAdmHCEUZNcRsYGE61NrKr6frBKyJsdjj/yRCjJXAJhIExmwDjFcSjB58n4Db x6fI99xmnwokIRVA09ugiWgdDOCAPcrup7BK6qVwi1GPmqUC4szM4KAdkiTNK0TsZNNo oMQ2B5gqCXttSGtgP7Q57vuGmjogQOJbiiO2MS19KpYeqvXJSVMO2rwUw/+ecxnnmjZL fF8W4uxsLAADGGZcmSii1qfpOJSd3WFgJvjLfI4GhXut+jBS8UaUrpc0a7NnCdIwUxFy jBRg== X-Gm-Message-State: AO0yUKU3tLVEOGfHLaztDAXSeqyavL0bUblYj5X5M9DazorSqyjpXkOY 8xsokInniWgcTbwxP89v1wp7qXc3IeUwYWjj X-Google-Smtp-Source: AK7set/yBG246VHMyfDFSqcQUDZSSOviL8RcHwBwt08BXfF1SCpT8QicM5SWWykChaMoeNaY1ZqXbQ== X-Received: by 2002:a05:6602:42cb:b0:74c:924e:3091 with SMTP id ce11-20020a05660242cb00b0074c924e3091mr5607574iob.15.1677728400613; Wed, 01 Mar 2023 19:40:00 -0800 (PST) Received: from sjg1.lan (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id f4-20020a5ec704000000b0073fd8ca79c6sm4358169iop.9.2023.03.01.19.40.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Mar 2023 19:40:00 -0800 (PST) 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 v2 8/8] bootstd: Relax the argument requirements for bootflow scan Date: Wed, 1 Mar 2023 20:39:29 -0700 Message-Id: <20230302033930.2546548-8-sjg@chromium.org> X-Mailer: git-send-email 2.40.0.rc0.216.gc4246ad0f0-goog In-Reply-To: <20230302033930.2546548-1-sjg@chromium.org> References: <20230302033930.2546548-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.6 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 7f7ec208a54..24116e6f7cd 100644 --- a/boot/Kconfig +++ b/boot/Kconfig @@ -1541,8 +1541,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 3548bbb6830..6455f403791 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.rc0.216.gc4246ad0f0-goog