From patchwork Thu Jul 15 13:31:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alfonso_S=C3=A1nchez-Beato?= X-Patchwork-Id: 1505990 X-Patchwork-Delegate: xypron.glpk@gmx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: 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=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=vMMbPM/n; 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 RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GQy1r07lVz9sWc for ; Fri, 16 Jul 2021 13:50:22 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6359A80F27; Fri, 16 Jul 2021 05:50:08 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=canonical.com 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=canonical.com header.i=@canonical.com header.b="vMMbPM/n"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6645482916; Thu, 15 Jul 2021 15:32:12 +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.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from smtp-relay-canonical-1.canonical.com (smtp-relay-canonical-1.canonical.com [185.125.188.121]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 6015982051 for ; Thu, 15 Jul 2021 15:32:09 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=canonical.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=alfonso.sanchez-beato@canonical.com Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-1.canonical.com (Postfix) with ESMTPS id B401440610 for ; Thu, 15 Jul 2021 13:32:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1626355923; bh=K7KGg/kVF0dYiC7ZjLueGQhfW6so5GMRoV72WSUSkqg=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Content-Type; b=vMMbPM/nj4+xe2vGugk8XwgCoSjRBD3YVxeeoAVjFdZdeKuEVr33a2G5wOVlh5ngA ba3R9+5QiQK34H4gMMCRaW9fu1OjBI1Kx1JD+CBrszNItTrLxXWMqHA4id1KwkmWdx h8laR9wmo1tdC/1ggNeyP0ugN3FzMteMVie9qvAQ0AvuIPjNoGO8Ml6J4Daga004HE 8ZCDKOqMt79x+HZtup9aHA0k13jzKP5Tp0oKGGN/IfRwUCK5s4JdzCg+EkFhF2ylwk 26GcH+W2Oi1xZfA08LgYx7dgDO1yGq+WDI7uo/955qxN1vo6Z1bHeXwsz2he/RwXuS nyNESxVtHX2cQ== Received: by mail-wr1-f71.google.com with SMTP id t8-20020a05600001c8b029013e2027cf9aso3319756wrx.9 for ; Thu, 15 Jul 2021 06:32:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=K7KGg/kVF0dYiC7ZjLueGQhfW6so5GMRoV72WSUSkqg=; b=kwEJXEpD1Bn1AvxR3KFNv7681mFe4LX7c88R2mMTUEKY4/HGGNFsR8ScBEwdBdU98D WVNBhlWFhU7thvOiZ1raxzw+ISurzcnDSuVAKGQrKpkrtrRLG/EPMCM97MU7hw2PjN72 fzZI4xQNwdZ5gZKpto9cZaIdYR6itdd1S/mBYh5xcXXii6T9bC1kHw4LZdhOv1lJyy5s uHznekbA0jThnQxX9A2sx388u4Cv2ph+EQk+xUS1pdEqHBb1TdmqEn+qfg0L6bLZaz/Z iZ2X+xaPCQVrlruOGZ6RD9HeN8c9ceB6LAzCC8251De2Gw++9/hcJzH0Jq/VbJ18N4bZ SZCA== X-Gm-Message-State: AOAM533BdBjQjCzYb2MPnOxPJIhE8KN3vQIVVBn5xsnxBa1eIBLRSTLz dgV/LBO/PW1Tb+n5ag3dGjX55augBHAHbYA+Y6FSlcxTWj5hMc8Gsz45nLAQj4nznR3fp0xo0Oq hccMWD+32Puaqw21fjsoJX2sA3ieVykg= X-Received: by 2002:a1c:1c7:: with SMTP id 190mr4617768wmb.170.1626355923065; Thu, 15 Jul 2021 06:32:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJziWgRhmylFJb9UFn+JPylvBJBDf/yA++zOwh7yxETdjA7bgdI63evyspRFaYuAS9tcgS1x/Q== X-Received: by 2002:a1c:1c7:: with SMTP id 190mr4617742wmb.170.1626355922885; Thu, 15 Jul 2021 06:32:02 -0700 (PDT) Received: from localhost.localdomain (141.red-83-43-11.dynamicip.rima-tde.net. [83.43.11.141]) by smtp.gmail.com with ESMTPSA id x17sm6582344wru.6.2021.07.15.06.31.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Jul 2021 06:32:02 -0700 (PDT) From: =?utf-8?q?Alfonso_S=C3=A1nchez-Beato?= To: u-boot@lists.denx.de Cc: xypron.glpk@gmx.de, agraf@csgraf.de, =?utf-8?q?Alfonso_S=C3=A1nchez-Beat?= =?utf-8?q?o?= , Heinrich Schuchardt Subject: [PATCH] efi_loader: set partition GUID in device path for SIG_TYPE_GUID Date: Thu, 15 Jul 2021 15:31:42 +0200 Message-Id: <20210715133142.69248-1-alfonso.sanchez-beato@canonical.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Mailman-Approved-At: Fri, 16 Jul 2021 05:50:06 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.2 at phobos.denx.de X-Virus-Status: Clean Previously, the GPT device GUID was being used instead of the partition, which was incorrect. Signed-off-by: Alfonso Sánchez-Beato Reviewed-by: Heinrich Schuchardt --- lib/efi_loader/efi_device_path.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/efi_loader/efi_device_path.c b/lib/efi_loader/efi_device_path.c index 76c2f82fe6..a2c19538ad 100644 --- a/lib/efi_loader/efi_device_path.c +++ b/lib/efi_loader/efi_device_path.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include /* U16_MAX */ @@ -851,8 +852,10 @@ static void *dp_part_node(void *buf, struct blk_desc *desc, int part) break; case SIG_TYPE_GUID: hddp->signature_type = 2; - memcpy(hddp->partition_signature, &desc->guid_sig, - sizeof(hddp->partition_signature)); + if (uuid_str_to_bin(info.uuid, + hddp->partition_signature, 1)) + printf("Partition no. %d: invalid guid: %s\n", + part, info.uuid); break; }