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 4D20FC19F28 for ; Sat, 30 Jul 2022 21:59:07 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 76D41845B0; Sat, 30 Jul 2022 23:54:29 +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="nyidY+Ok"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E11BE84564; Sat, 30 Jul 2022 23:54:04 +0200 (CEST) Received: from mail-oi1-x22d.google.com (mail-oi1-x22d.google.com [IPv6:2607:f8b0:4864:20::22d]) (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 0373784539 for ; Sat, 30 Jul 2022 23:54:02 +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-oi1-x22d.google.com with SMTP id j70so9256177oih.10 for ; Sat, 30 Jul 2022 14:54:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=0TyFptRRfQA79XIqj0IK07CfowaPE5sIK7sd9BUEQXk=; b=nyidY+OkG2X3pBMW/BMyGDktB5ihtIDQFrprX894wO6jXZTcscxvxQduY+djU9NIFy 1CfKirHcZBgOu7iXgw2vN4b3CfvIPk9wf1ysou4YSa5N6wGFJvNY+ZPxt2lrz5Cafv1h +wB7M6druEgr8CVRLmYyF07Y8hTANM9/ZZwVk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=0TyFptRRfQA79XIqj0IK07CfowaPE5sIK7sd9BUEQXk=; b=7+o39xlSvzZXZKYIasOp+I2aM2xachRoOgue4QbuIvBqsullP0OFY6lXYOYM5YmPag TdRODLNWFmX9tvsUAZOe/ZzG5J3Vj2CAVNxiB3Ayvawc1b03xN0a7+XGu4QRQQHFPTr/ BroXn1rlO/eYSsItepYT6aFQtDy73v6uJo8eJQggIEFLFDm1nRM4xn2DygyzfwFI5FQy +w4t7RGvnoQnB0VkwmG4HKAnu+JrICTxIxDDCE9SEHYm9NLvUavqfiXtZYDD8nt1g0A4 RQK2P9LdsBCHc94+/k7ctwzpxKvfAicSxD9Do8+VqYhZ9wldIQF9WhImbKpJZYNYiRwc ywuA== X-Gm-Message-State: AJIora9RuFwY4GsILST4rHvCl27k1lnmWr53Vx/9Y5Z3P1gi3puX0Lqy 2VUWRXQtwsc8YqnnVJiXdJKqQNStxNhq28h8 X-Google-Smtp-Source: AGRyM1vrvyUi3uj7ov56XhY0RGu6Nz/TFTkxphFa1OswwGYvsZ1H/gkCj58Ak5BsYFCPFl9QRuunMg== X-Received: by 2002:a05:6808:170f:b0:33b:182:ce4f with SMTP id bc15-20020a056808170f00b0033b0182ce4fmr4075959oib.24.1659218023685; Sat, 30 Jul 2022 14:53:43 -0700 (PDT) Received: from sjg1.lan (c-67-190-102-125.hsd1.co.comcast.net. [67.190.102.125]) by smtp.gmail.com with ESMTPSA id 19-20020a544193000000b0032f75714af1sm1699656oiy.18.2022.07.30.14.53.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Jul 2022 14:53:43 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Bin Meng , Simon Glass Subject: [PATCH v2 34/35] bootstd: Check building without global bootmeths Date: Sat, 30 Jul 2022 15:52:36 -0600 Message-Id: <20220730215237.818368-29-sjg@chromium.org> X-Mailer: git-send-email 2.37.1.455.g008518b4e5-goog In-Reply-To: <20220730215237.818368-1-sjg@chromium.org> References: <20220730215237.818368-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 Use the sandbox_flattree build to check that everything works correctly with BOOTMETH_GLOBAL disabled. Update the tests as needed. Signed-off-by: Simon Glass --- (no changes since v1) configs/sandbox_flattree_defconfig | 2 ++ test/boot/bootflow.c | 7 +++++++ test/boot/bootmeth.c | 24 +++++++++++++++++------- 3 files changed, 26 insertions(+), 7 deletions(-) diff --git a/configs/sandbox_flattree_defconfig b/configs/sandbox_flattree_defconfig index a71ce77c403..6d62feeb08a 100644 --- a/configs/sandbox_flattree_defconfig +++ b/configs/sandbox_flattree_defconfig @@ -11,6 +11,7 @@ CONFIG_DISTRO_DEFAULTS=y CONFIG_FIT=y CONFIG_FIT_SIGNATURE=y CONFIG_FIT_VERBOSE=y +# CONFIG_BOOTMETH_VBE is not set CONFIG_BOOTSTAGE=y CONFIG_BOOTSTAGE_REPORT=y CONFIG_BOOTSTAGE_FDT=y @@ -206,6 +207,7 @@ CONFIG_RSA_VERIFY_WITH_PKEY=y CONFIG_TPM=y CONFIG_LZ4=y CONFIG_ERRNO_STR=y +# CONFIG_CMD_BOOTEFI_BOOTMGR is not set CONFIG_EFI_RUNTIME_UPDATE_CAPSULE=y CONFIG_EFI_CAPSULE_ON_DISK=y CONFIG_EFI_CAPSULE_FIRMWARE_FIT=y diff --git a/test/boot/bootflow.c b/test/boot/bootflow.c index d2c42e8b060..85305234e01 100644 --- a/test/boot/bootflow.c +++ b/test/boot/bootflow.c @@ -12,7 +12,9 @@ #include #include #include +#ifdef CONFIG_SANDBOX #include +#endif #include #include #include @@ -321,6 +323,7 @@ static int bootflow_iter(struct unit_test_state *uts) } BOOTSTD_TEST(bootflow_iter, UT_TESTF_DM | UT_TESTF_SCAN_FDT); +#if defined(CONFIG_SANDBOX) && defined(CONFIG_BOOTMETH_GLOBAL) /* Check using the system bootdev */ static int bootflow_system(struct unit_test_state *uts) { @@ -344,6 +347,7 @@ static int bootflow_system(struct unit_test_state *uts) } BOOTSTD_TEST(bootflow_system, UT_TESTF_DM | UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +#endif /* Check disabling a bootmethod if it requests it */ static int bootflow_iter_disable(struct unit_test_state *uts) @@ -388,6 +392,9 @@ BOOTSTD_TEST(bootflow_iter_disable, UT_TESTF_DM | UT_TESTF_SCAN_FDT); /* Check 'bootflow scan' with a bootmeth ordering including a global bootmeth */ static int bootflow_scan_glob_bootmeth(struct unit_test_state *uts) { + if (!IS_ENABLED(CONFIG_BOOTMETH_GLOBAL)) + return 0; + ut_assertok(bootstd_test_drop_bootdev_order(uts)); /* diff --git a/test/boot/bootmeth.c b/test/boot/bootmeth.c index ae216293d64..fb627313396 100644 --- a/test/boot/bootmeth.c +++ b/test/boot/bootmeth.c @@ -23,9 +23,11 @@ static int bootmeth_cmd_list(struct unit_test_state *uts) ut_assert_nextlinen("---"); ut_assert_nextline(" 0 0 syslinux Syslinux boot from a block device"); ut_assert_nextline(" 1 1 efi EFI boot from an .efi file"); - ut_assert_nextline(" glob 2 firmware0 VBE simple"); + if (IS_ENABLED(CONFIG_BOOTMETH_GLOBAL)) + ut_assert_nextline(" glob 2 firmware0 VBE simple"); ut_assert_nextlinen("---"); - ut_assert_nextline("(3 bootmeths)"); + ut_assert_nextline(IS_ENABLED(CONFIG_BOOTMETH_GLOBAL) ? + "(3 bootmeths)" : "(2 bootmeths)"); ut_assert_console_end(); return 0; @@ -57,9 +59,11 @@ static int bootmeth_cmd_order(struct unit_test_state *uts) ut_assert_nextlinen("---"); ut_assert_nextline(" 0 0 syslinux Syslinux boot from a block device"); ut_assert_nextline(" - 1 efi EFI boot from an .efi file"); - ut_assert_nextline(" glob 2 firmware0 VBE simple"); + if (IS_ENABLED(CONFIG_BOOTMETH_GLOBAL)) + ut_assert_nextline(" glob 2 firmware0 VBE simple"); ut_assert_nextlinen("---"); - ut_assert_nextline("(3 bootmeths)"); + ut_assert_nextline(IS_ENABLED(CONFIG_BOOTMETH_GLOBAL) ? + "(3 bootmeths)" : "(2 bootmeths)"); ut_assert_console_end(); /* Check the -a flag with the reverse order */ @@ -70,9 +74,11 @@ static int bootmeth_cmd_order(struct unit_test_state *uts) ut_assert_nextlinen("---"); ut_assert_nextline(" 1 0 syslinux Syslinux boot from a block device"); ut_assert_nextline(" 0 1 efi EFI boot from an .efi file"); - ut_assert_nextline(" glob 2 firmware0 VBE simple"); + if (IS_ENABLED(CONFIG_BOOTMETH_GLOBAL)) + ut_assert_nextline(" glob 2 firmware0 VBE simple"); ut_assert_nextlinen("---"); - ut_assert_nextline("(3 bootmeths)"); + ut_assert_nextline(IS_ENABLED(CONFIG_BOOTMETH_GLOBAL) ? + "(3 bootmeths)" : "(2 bootmeths)"); ut_assert_console_end(); /* Now reset the order to empty, which should show all of them again */ @@ -80,7 +86,8 @@ static int bootmeth_cmd_order(struct unit_test_state *uts) ut_assert_console_end(); ut_assertnull(env_get("bootmeths")); ut_assertok(run_command("bootmeth list", 0)); - ut_assert_skip_to_line("(3 bootmeths)"); + ut_assert_skip_to_line(IS_ENABLED(CONFIG_BOOTMETH_GLOBAL) ? + "(3 bootmeths)" : "(2 bootmeths)"); /* Try reverse order */ ut_assertok(run_command("bootmeth order \"efi syslinux\"", 0)); @@ -97,6 +104,9 @@ static int bootmeth_cmd_order(struct unit_test_state *uts) ut_assert_console_end(); /* Try with global bootmeths */ + if (!IS_ENABLED(CONFIG_BOOTMETH_GLOBAL)) + return 0; + ut_assertok(run_command("bootmeth order \"efi firmware0\"", 0)); ut_assert_console_end(); ut_assertok(run_command("bootmeth list", 0)); -- 2.37.1.455.g008518b4e5-goog