Message ID | 20221021002320.1169603-36-sjg@chromium.org |
---|---|
State | Accepted |
Delegated to: | Tom Rini |
Headers | show
Return-Path: <u-boot-bounces@lists.denx.de> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=<UNKNOWN>) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=LJV1rFRH; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MtlhC5X8bz23jk for <incoming@patchwork.ozlabs.org>; Fri, 21 Oct 2022 11:28:59 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 32DF38502E; Fri, 21 Oct 2022 02:26:07 +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="LJV1rFRH"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6556C84FC2; Fri, 21 Oct 2022 02:24:37 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x132.google.com (mail-il1-x132.google.com [IPv6:2607:f8b0:4864:20::132]) (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 C7CE584FED for <u-boot@lists.denx.de>; Fri, 21 Oct 2022 02:24:25 +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-x132.google.com with SMTP id l6so834300ilq.3 for <u-boot@lists.denx.de>; Thu, 20 Oct 2022 17:24:25 -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:subject:date :message-id:reply-to; bh=9OvzVWVBgGL1eBV4cmu2cV1DI4NEC6XNumoiYo7CffM=; b=LJV1rFRHCg7mcz/izTW1mnV4+zkYsjYCEnDR5sYbskwTqqvqI8FI38j1DERkIJLX9q EE3pclY0QOLECoqB4t2D1GOVDORnZYd/964E9Tb/+RknJOjGEcSaAz7V/H0pcdrnULnQ R0ma7tyaw/+fjxd3wAhLhZK7Q48CUfTxofLRI= 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 :subject:date:message-id:reply-to; bh=9OvzVWVBgGL1eBV4cmu2cV1DI4NEC6XNumoiYo7CffM=; b=oQwb7C8t11dJMgTe9yvGr60afPwRaOBeKs9mhYuD9KyHczOSTqJjWrFzMk83JGFyeQ iWb4rLJ68ZgId98QYFbWnCY6JG0u0PQkIM12GcSGUD4jp9GwgVQd0LDUITZqSJMSPNL5 +OlqMD7XtSHUiHRP52ydkd6EjyL57e2YOjU6iWUB3TUyXJJRRe8pp/EfbMj9o9EoQ260 UMge/BxxHoI8M+u16XQ7GomSoUalykQ73R99MK7PHsx2ybRDvNvQIs7quISENgQJlFg5 MW2+b/mvfaFqwRF/ZoxadWGjHPUCb6soquhJ2Pu+/Fr5m1OFYJprV+jsLl217Y/SSGGH 3OQg== X-Gm-Message-State: ACrzQf3ffbTpGHD7EobyWbMIAKzNo6rqfgE6GTylrywN/e+resxJuzHX /SxBnkdeTvTFPzIy22Cf8wrLcdESCO/wQg== X-Google-Smtp-Source: AMsMyM6gdcwG0oSk3BfvHHCu2WJ/XvSx1VVkTemXmA1WD+zzcdaOY9G4tEb8wVFe82AYzjvpwfiR3g== X-Received: by 2002:a05:6e02:2161:b0:2fa:7451:6cfd with SMTP id s1-20020a056e02216100b002fa74516cfdmr11602482ilv.7.1666311844204; Thu, 20 Oct 2022 17:24:04 -0700 (PDT) Received: from sjg1.roam.corp.google.com (c-67-190-102-125.hsd1.co.comcast.net. [67.190.102.125]) by smtp.gmail.com with ESMTPSA id f8-20020a02a108000000b00356738a2aa2sm3646131jag.55.2022.10.20.17.24.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Oct 2022 17:24:04 -0700 (PDT) From: Simon Glass <sjg@chromium.org> To: U-Boot Mailing List <u-boot@lists.denx.de> Cc: Tom Rini <trini@konsulko.com>, Simon Glass <sjg@chromium.org> Subject: [PATCH v3 35/43] vbe: Drop the U-Boot prefix from the version Date: Thu, 20 Oct 2022 18:23:12 -0600 Message-Id: <20221021002320.1169603-36-sjg@chromium.org> X-Mailer: git-send-email 2.38.0.135.g90850a2211-goog In-Reply-To: <20221021002320.1169603-1-sjg@chromium.org> References: <20221021002320.1169603-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 <u-boot.lists.denx.de> List-Unsubscribe: <https://lists.denx.de/options/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=unsubscribe> List-Archive: <https://lists.denx.de/pipermail/u-boot/> List-Post: <mailto:u-boot@lists.denx.de> List-Help: <mailto:u-boot-request@lists.denx.de?subject=help> List-Subscribe: <https://lists.denx.de/listinfo/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=subscribe> Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" <u-boot-bounces@lists.denx.de> X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean |
Series |
vbe: Implement the full firmware flow
|
expand
|
diff --git a/boot/vbe_simple_os.c b/boot/vbe_simple_os.c index 7761b9ef656..058db6154b0 100644 --- a/boot/vbe_simple_os.c +++ b/boot/vbe_simple_os.c @@ -18,7 +18,7 @@ int vbe_simple_fixup_node(ofnode node, struct simple_state *state) { - char *version; + const char *version, *str; int ret; version = strdup(state->fw_version); @@ -31,7 +31,12 @@ int vbe_simple_fixup_node(ofnode node, struct simple_state *state) ret = ofnode_write_u32(node, "cur-vernum", state->fw_vernum); if (ret) return log_msg_ret("num", ret); - ret = ofnode_write_string(node, "bootloader-version", version_string); + + /* Drop the 'U-Boot ' at the start */ + str = version_string; + if (!strncmp("U-Boot ", str, 7)) + str += 7; + ret = ofnode_write_string(node, "bootloader-version", str); if (ret) return log_msg_ret("bl", ret); diff --git a/test/boot/vbe_simple.c b/test/boot/vbe_simple.c index faba9e8f90b..a50785dbbf6 100644 --- a/test/boot/vbe_simple.c +++ b/test/boot/vbe_simple.c @@ -77,7 +77,7 @@ static int vbe_simple_test_base(struct unit_test_state *uts) bl_version = ofnode_read_string(node, "bootloader-version"); ut_assertnonnull(bl_version); - ut_asserteq_str(version_string, bl_version); + ut_asserteq_str(version_string + 7, bl_version); return 0; }
We don't need the U-Boot prefix on the version and in fact it is harmful since pytest gets confused seeing the U-Boot banner bring displayed when the version is printed. Drop the prefix from the string. We could produce an entirely new string from the component parts, but this adds to the rodata size and would break the use of version_string as the only thing which holds this information. Signed-off-by: Simon Glass <sjg@chromium.org> --- (no changes since v1) boot/vbe_simple_os.c | 9 +++++++-- test/boot/vbe_simple.c | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-)