From mboxrd@z Thu Jan 1 00:00:00 1970 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 54F1FC6FD18 for ; Wed, 29 Mar 2023 07:18:27 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7E60885CF3; Wed, 29 Mar 2023 09:17:56 +0200 (CEST) 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="NtuyThA4"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8C18685D03; Wed, 29 Mar 2023 09:17:34 +0200 (CEST) Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) (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 E2CD185CB5 for ; Wed, 29 Mar 2023 09:17:10 +0200 (CEST) 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-x1033.google.com with SMTP id j13so13252017pjd.1 for ; Wed, 29 Mar 2023 00:17:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1680074228; 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=HcWswEg2gkhpuuWrOuXVT8MAZ8/PyzUZMJtntXdDrS0=; b=NtuyThA4Lb2SB2O2k3qRS1vHNBA4M+fIIbw5BEleinglSUa2D/d5LdbyoHetx45dQ6 dkCSNaNg7g9ON2WE+Q8g4bJt+6Jk0yeRI8DL0w0i4yjx30AfupadWtVAVU4a3vX/urKv TesoEQbB5xWHW92fvFjkF3pdYfAwM8Ew335Ao= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680074228; 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=HcWswEg2gkhpuuWrOuXVT8MAZ8/PyzUZMJtntXdDrS0=; b=lyKrxGJxDSc+6SrFkxQwXwqrMmFw2C+cyYtaPoBkfzXDaS6FO7CKF4lc3jYZlYTZ7b DIigZJOYC1JrFTn026l1CSmqMOHEDBfmmRKHD7XNeMALcOGcZtPuIkAEu9aZAqcV1d/w GPdcR65HGzo1r6/vcZnNvSBJItXcpraO7Xt/q4bmZZbXRF7o0wbM4WbDNQBJMD1RoQZU JSzn1fNAiXGoza4zYHyzcjFw98rD1hsiicVowLq5sYD1w7X0kd0A8p5NJSKYZLKN0HwA NteEh1BTqHzYwkjINFv+kfpYgJW8xdHa1cE5JecJF5WO7jc1QzeF+bxeXRW1+fygWguK RUuQ== X-Gm-Message-State: AAQBX9eW4wmlJaYyKYO+2X6aVsy1kUMSZ1tWgOSqTZRGURPDD/iPNQzT ppGhGFN8C78b/cOWZSXf15NpO7RZPQ3vUNWJlrM= X-Google-Smtp-Source: AKy350YqKY0/Wy930ao1xn9gYToXcGSOGWLihndpHdFeBbbmwMI3EHM0y3kQmeSIj+RjRB/12MNFjg== X-Received: by 2002:a17:902:da8e:b0:1a1:d096:7152 with SMTP id j14-20020a170902da8e00b001a1d0967152mr21108669plx.39.1680074227925; Wed, 29 Mar 2023 00:17:07 -0700 (PDT) Received: from localhost.localdomain ([27.110.126.54]) by smtp.gmail.com with ESMTPSA id r11-20020a170902be0b00b0019edc1b9eb2sm22287973pls.238.2023.03.29.00.17.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Mar 2023 00:17:07 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: huang lin , Jeffy Chen , Simon Glass , Kever Yang , Philipp Tomsich , Vagrant Cascadian , Tom Rini , Philippe Reynes Subject: [PATCH v4 3/4] bootstd: Relax the argument requirements for bootflow scan Date: Wed, 29 Mar 2023 20:16:38 +1300 Message-Id: <20230329071655.1959513-2-sjg@chromium.org> X-Mailer: git-send-email 2.40.0.348.gf938b09366-goog In-Reply-To: <20230329201631.v4.1.I41a5e66644a895a311889b009116245245c741a5@changeid> References: <20230329201631.v4.1.I41a5e66644a895a311889b009116245245c741a5@changeid> 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 61ebc2750154..ae0e7b738c0c 100644 --- a/boot/Kconfig +++ b/boot/Kconfig @@ -1554,8 +1554,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.348.gf938b09366-goog