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 53CFEC001DE for ; Sun, 13 Aug 2023 14:30:24 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 06F4A869B4; Sun, 13 Aug 2023 16:27:45 +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="CeyOzJo+"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id ED1DF8609B; Sun, 13 Aug 2023 16:27:42 +0200 (CEST) Received: from mail-il1-x136.google.com (mail-il1-x136.google.com [IPv6:2607:f8b0:4864:20::136]) (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 4526186967 for ; Sun, 13 Aug 2023 16:27:40 +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-il1-x136.google.com with SMTP id e9e14a558f8ab-34977c72c4aso12161775ab.2 for ; Sun, 13 Aug 2023 07:27:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1691936859; x=1692541659; 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=HnrLDmQiaCABUH6GR3KMNE99mDwBjYW6K2LpXZwrB8k=; b=CeyOzJo+zP4AXEBLj3IAmZ2vn7eYNE3oeT8z7/eBOcn8WG4G073FwLuBEIFHE/gSga CsiHrxEt7uQapvvckUPpiCmE4MfBLTHmLjgQYTsSJ2ouk98sK+NbDLCgwZe5r9cFCcoV KzIY3CmAngOItSLwmPXqHnDlKnIuYMVFpY1E8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691936859; x=1692541659; 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=HnrLDmQiaCABUH6GR3KMNE99mDwBjYW6K2LpXZwrB8k=; b=Jmqa1sNEl8qjKdfyPbX8LoOidq1Acg9pHzTstDY/Mq8CLaZDNPhb8o3Jjmkdil2ph8 mrR+Al+1iNU90/GnJ+MCyoczry88k4+GJmSAn2809VfXbHYM9nZqBvOMNSgjaKDx/M/3 hhW2/xcEmi3cPjLOOU2YR5txfdhuucFq492q6zlSWgPMNaGxvIrW3GRc33zD+07AV1ZS ev/DWt/do+PUKlpSEEb04Hh2OUPHxKtW/i6dBae3B4WTe5aJimVDLE3eIgcAkBAtXOq6 nhrjQCmWeHo5eFTB8Di/FU0D6YZcvuwofjVA7rNsYO2q/IvRzhu6cvmf/KuEQVfHnEyN A0Vg== X-Gm-Message-State: AOJu0Yxwjz+zcpbzy/fdI0LvbOE4pkszqBvEf6b22vdk6V+a2yD2xIhW +szZBKe5Nrd1Za4KjUeiaGnSquds8zjnjrlOGvU= X-Google-Smtp-Source: AGHT+IEi+iGtg9HZqnjxki8Ce3fckPDk2VXd2PRea7KbxPknpdJukiaVDlMW/8WoH96Ajqwsos4+LA== X-Received: by 2002:a05:6e02:1bee:b0:349:2d1d:e463 with SMTP id y14-20020a056e021bee00b003492d1de463mr11327412ilv.13.1691936858832; Sun, 13 Aug 2023 07:27:38 -0700 (PDT) Received: from sjg1.lan (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id w7-20020a02cf87000000b00430cf006d9bsm2280952jar.30.2023.08.13.07.27.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Aug 2023 07:27:38 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass Subject: [PATCH 17/24] bootflow: Show an empty filename when there is none Date: Sun, 13 Aug 2023 08:26:45 -0600 Message-ID: <20230813142708.361456-18-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.640.ga95def55d0-goog In-Reply-To: <20230813142708.361456-1-sjg@chromium.org> References: <20230813142708.361456-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 At present 'bootflow list' shows for the filename when it is not present. Show an empty string instead, since that is more user-friendly. Signed-off-by: Simon Glass --- cmd/bootflow.c | 2 +- test/boot/bootflow.c | 22 ++++++++++++---------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/cmd/bootflow.c b/cmd/bootflow.c index 3c3abaf8a3b2..300ad3aaa760 100644 --- a/cmd/bootflow.c +++ b/cmd/bootflow.c @@ -71,7 +71,7 @@ static void show_bootflow(int index, struct bootflow *bflow, bool errors) printf("%3x %-11s %-6s %-9.9s %4x %-25.25s %s\n", index, bflow->method->name, bootflow_state_get_name(bflow->state), bflow->dev ? dev_get_uclass_name(dev_get_parent(bflow->dev)) : - "(none)", bflow->part, bflow->name, bflow->fname); + "(none)", bflow->part, bflow->name, bflow->fname ?: ""); if (errors) report_bootflow_err(bflow, bflow->err); } diff --git a/test/boot/bootflow.c b/test/boot/bootflow.c index 8a4e090e9bcf..649237a9e229 100644 --- a/test/boot/bootflow.c +++ b/test/boot/bootflow.c @@ -167,21 +167,22 @@ static int bootflow_cmd_scan_e(struct unit_test_state *uts) ut_assert_nextline("Seq Method State Uclass Part Name Filename"); ut_assert_nextlinen("---"); ut_assert_nextline("Scanning bootdev 'mmc2.bootdev':"); - ut_assert_nextline(" 0 extlinux media mmc 0 mmc2.bootdev.whole "); + ut_assert_nextline(" 0 extlinux media mmc 0 mmc2.bootdev.whole "); ut_assert_nextline(" ** No partition found, err=-93: Protocol not supported"); - ut_assert_nextline(" 1 efi media mmc 0 mmc2.bootdev.whole "); + ut_assert_nextline(" 1 efi media mmc 0 mmc2.bootdev.whole "); ut_assert_nextline(" ** No partition found, err=-93: Protocol not supported"); ut_assert_nextline("Scanning bootdev 'mmc1.bootdev':"); - ut_assert_nextline(" 2 extlinux media mmc 0 mmc1.bootdev.whole "); + ut_assert_nextline(" 2 extlinux media mmc 0 mmc1.bootdev.whole "); ut_assert_nextline(" ** No partition found, err=-2: No such file or directory"); - ut_assert_nextline(" 3 efi media mmc 0 mmc1.bootdev.whole "); + ut_assert_nextline(" 3 efi media mmc 0 mmc1.bootdev.whole "); ut_assert_nextline(" ** No partition found, err=-2: No such file or directory"); ut_assert_nextline(" 4 extlinux ready mmc 1 mmc1.bootdev.part_1 /extlinux/extlinux.conf"); ut_assert_nextline(" 5 efi fs mmc 1 mmc1.bootdev.part_1 efi/boot/bootsbox.efi"); ut_assert_skip_to_line("Scanning bootdev 'mmc0.bootdev':"); - ut_assert_skip_to_line(" 3f efi media mmc 0 mmc0.bootdev.whole "); + ut_assert_skip_to_line( + " 3f efi media mmc 0 mmc0.bootdev.whole "); ut_assert_nextline(" ** No partition found, err=-93: Protocol not supported"); ut_assert_nextline("No more bootdevs"); ut_assert_nextlinen("---"); @@ -192,10 +193,11 @@ static int bootflow_cmd_scan_e(struct unit_test_state *uts) ut_assert_nextline("Showing all bootflows"); ut_assert_nextline("Seq Method State Uclass Part Name Filename"); ut_assert_nextlinen("---"); - ut_assert_nextline(" 0 extlinux media mmc 0 mmc2.bootdev.whole "); - ut_assert_nextline(" 1 efi media mmc 0 mmc2.bootdev.whole "); - ut_assert_skip_to_line(" 4 extlinux ready mmc 1 mmc1.bootdev.part_1 /extlinux/extlinux.conf"); - ut_assert_skip_to_line(" 3f efi media mmc 0 mmc0.bootdev.whole "); + ut_assert_nextline(" 0 extlinux media mmc 0 mmc2.bootdev.whole "); + ut_assert_nextline(" 1 efi media mmc 0 mmc2.bootdev.whole "); + ut_assert_skip_to_line( + " 4 extlinux ready mmc 1 mmc1.bootdev.part_1 /extlinux/extlinux.conf"); + ut_assert_skip_to_line(" 3f efi media mmc 0 mmc0.bootdev.whole "); ut_assert_nextlinen("---"); ut_assert_nextline("(64 bootflows, 1 valid)"); ut_assert_console_end(); @@ -384,7 +386,7 @@ static int bootflow_system(struct unit_test_state *uts) console_record_reset_enable(); ut_assertok(run_command("bootflow scan -lH", 0)); ut_assert_skip_to_line( - " 0 efi_mgr ready (none) 0 "); + " 0 efi_mgr ready (none) 0 "); ut_assert_skip_to_line("No more bootdevs"); ut_assert_skip_to_line("(2 bootflows, 2 valid)"); ut_assert_console_end(); -- 2.41.0.640.ga95def55d0-goog