From patchwork Tue Apr 19 01:01:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 563289 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:6886:0:0:0:0 with SMTP id m6csp2858610map; Mon, 18 Apr 2022 18:03:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyEhrNo4WCJey4GDR184S4RMJECgd9udsP4xzo9DJCrM8v0IACdd82UntjX2WVxAbhVzE39 X-Received: by 2002:a17:907:9485:b0:6da:aa54:a88 with SMTP id dm5-20020a170907948500b006daaa540a88mr11513736ejc.427.1650330195954; Mon, 18 Apr 2022 18:03:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650330195; cv=none; d=google.com; s=arc-20160816; b=ORt13cxp/YVS8n0yDqo+I1tOYugOvlNimj96oFt6EZPiqwA8g4oVAeAa0HI6V2dUye 3nKp/EwEExNQPySO9cYIllIcKOYCSYT2OCwvBb/EcDQ1RxiIIsePwnhpyTHeVJMyJ7f/ WoxEKHFJFAJo7WByt9iZjTB7g6HOXUZK6djRRRMRg6cMUEAq64ythaj3CeGDAzm+h/Sv NmXPqGSurOJB3mp5SOzdlgTO1Pm5zXUb6QksAI6CAc9Z+aUdstixJsjV0kpvSw5zNLQB 752cmoYV/VN5FrTh3p2CNOFXjH0xyp+PGqZHZt1/EQAb30hrjArvGBJSL/95JyM6/O0s ssMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=clfrkGVVViQoR+83SxwJLOzT000o3+NLo8Ph+hcdHrU=; b=Z0OGlfoRBAUoP8P/9tWluu/6k6rZ1fc4WDm+QZM2/I59PJMzXYd3r+wOx9gOS/zdul 6RuEj2jpyD37QXUoShl0nukTFIf9FOwZSPiwn/aA1KQ9XDuEfT58HAZZtJyn/8QqStvS uMHwDIDcPWHfIkOrczEpPkbAtNpx4mftnXIkQUYDkB5Ip++ACX/u1a1NdwUE/a6dKglH wWk8rBFCY/kB7XCOE7NN4n+bNjzYV2mjNioMr7GUbh1BuOw8pOpFSQXjl42+0MePR56C WieXARAXacihkeBiT1I5RoqzgHn9Nn+54NKNtRfL/G50N5XLltZgD36XKdd6pBUeqZGl RPSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EmO+UdST; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id m11-20020a056402510b00b0041d9c8d2547si7538729edd.331.2022.04.18.18.03.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Apr 2022 18:03:15 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EmO+UdST; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 00C7683B4D; Tue, 19 Apr 2022 03:03:01 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="EmO+UdST"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id F210D83B2F; Tue, 19 Apr 2022 03:02:41 +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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) (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 8828A83B0E for ; Tue, 19 Apr 2022 03:02:36 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=takahiro.akashi@linaro.org Received: by mail-pl1-x629.google.com with SMTP id c12so13727076plr.6 for ; Mon, 18 Apr 2022 18:02:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=clfrkGVVViQoR+83SxwJLOzT000o3+NLo8Ph+hcdHrU=; b=EmO+UdSTDSkCNGCYplKCAHe+itw968BmzpbzyelvQZa2vYK8MWhbZe04v07cdCsXYu UiJoMonjcQyao764ADVxdb3BXTAI9xzSywj1f4SkF9jofTX2QRzlQZPgO8lf7eypDo+6 lJfIY352SM53ERlVe7rPC+N4wRHczWUcttp+Axbt4s5fXmkASnhYkHfmLRq2npwhRtm/ i9aGoZ8BNuq5SygrBHA676U6vtWf3XsZJh5dZGq27LspspGQgJEwaEip9qsoOuSZWX0J VdcCCnAYUHfzJ1clIFFEYwrZOm0xwY+uZOM63wtC0h8zXMEvsuioD8DFp6HdquJWhTkB KdHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=clfrkGVVViQoR+83SxwJLOzT000o3+NLo8Ph+hcdHrU=; b=j1cgmkqsjOuBJmdi6LzwykhLwkH8mseqbYsk9KtvuNTXC4nqwXJp+fzc5DfbQmz3/0 MSXbx5S9NECk/vzosiPkH4aMkiWurYm8E93wKeXHCBHO+LH1CqiJrmDuYiDVD0wh8zar XkEeAbpP/AozevqFyi9S/s+7wPye2DyVezS09xovR34BVCbJ0iIcA4aKPo5o1pBvBcx1 CmyDgr7CeSYguhpSjvI6Cxk9ymTQ/rx2gIOTHHGz8fCjmmy8Lfpx7KpZKmcBsYKDZe56 S4ncQbtRTsQM/g54jJCKww9BITO8GaWdkTMvcwnfz05nmi/AHyg16XZKFkBOIX780c+c DUrg== X-Gm-Message-State: AOAM533WmyRL8rSZgC6gkzPTYEQsKqE4F1ljgtD9PqTxQp2oE/UECDOR C/utLq5uNNKYEGq1/RHn/AzJbw== X-Received: by 2002:a17:90b:100d:b0:1d2:d49a:c341 with SMTP id gm13-20020a17090b100d00b001d2d49ac341mr629533pjb.130.1650330155005; Mon, 18 Apr 2022 18:02:35 -0700 (PDT) Received: from localhost.localdomain ([2400:4050:c3e1:100:5858:d3a6:5cad:ceeb]) by smtp.gmail.com with ESMTPSA id l2-20020a056a0016c200b004f7e3181a41sm14791729pfc.98.2022.04.18.18.02.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Apr 2022 18:02:34 -0700 (PDT) From: AKASHI Takahiro To: trini@konsulko.com, sjg@chromium.org, xypron.glpk@gmx.de Cc: u-boot@lists.denx.de, AKASHI Takahiro Subject: [PATCH 5/7] efi_loader: PARTITION_UUIDS should be optional Date: Tue, 19 Apr 2022 10:01:56 +0900 Message-Id: <20220419010158.47034-6-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20220419010158.47034-1-takahiro.akashi@linaro.org> References: <20220419010158.47034-1-takahiro.akashi@linaro.org> MIME-Version: 1.0 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.5 at phobos.denx.de X-Virus-Status: Clean In the current implementation, partition table support (either GPT or DOS) is not mandatory. So CONFIG_PARTITION_UUIDS should not be enabled (selected) unconditionally. Fixes: commit 17f8cda505e3 ("efi_loader: set partition GUID in device path for SIG_TYPE_GUID") Signed-off-by: AKASHI Takahiro --- lib/efi_loader/Kconfig | 2 +- lib/efi_loader/efi_device_path.c | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig index d50cd2563d3d..bc518d7a413b 100644 --- a/lib/efi_loader/Kconfig +++ b/lib/efi_loader/Kconfig @@ -15,7 +15,7 @@ config EFI_LOADER depends on !EFI_APP default y if !ARM || SYS_CPU = armv7 || SYS_CPU = armv8 select LIB_UUID - select PARTITION_UUIDS + imply PARTITION_UUIDS select HAVE_BLOCK_DEVICE select REGEX imply FAT diff --git a/lib/efi_loader/efi_device_path.c b/lib/efi_loader/efi_device_path.c index 0542aaae16c7..01fb53ae8c40 100644 --- a/lib/efi_loader/efi_device_path.c +++ b/lib/efi_loader/efi_device_path.c @@ -864,11 +864,20 @@ static void *dp_part_node(void *buf, struct blk_desc *desc, int part) break; case SIG_TYPE_GUID: hddp->signature_type = 2; +#if CONFIG_IS_ENABLED(PARTITION_UUIDS) + /* info.uuid exists only with PARTITION_UUIDS */ if (uuid_str_to_bin(info.uuid, - hddp->partition_signature, 1)) + hddp->partition_signature, 1)) { log_warning( "Partition no. %d: invalid guid: %s\n", part, info.uuid); + memset(hddp->partition_signature, 0, + sizeof(hddp->partition_signature)); + } +#else + memset(hddp->partition_signature, 0, + sizeof(hddp->partition_signature)); +#endif break; }