From patchwork Mon Dec 4 07:10:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 844144 X-Patchwork-Delegate: agraf@suse.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3yqx1Y5cjgz9s7g for ; Mon, 4 Dec 2017 18:13:37 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 6DBE2C22047; Mon, 4 Dec 2017 07:12:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_MSPIKE_H2 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 94E6CC2206D; Mon, 4 Dec 2017 07:11:54 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 5F72BC22050; Mon, 4 Dec 2017 07:11:23 +0000 (UTC) Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) by lists.denx.de (Postfix) with ESMTPS id 9A3AAC22073 for ; Mon, 4 Dec 2017 07:11:19 +0000 (UTC) Received: from LT01.fritz.box ([94.114.42.150]) by mail.gmx.com (mrgmx002 [212.227.17.184]) with ESMTPSA (Nemesis) id 0MKZLb-1eLTep1okZ-001yFC; Mon, 04 Dec 2017 08:11:04 +0100 From: Heinrich Schuchardt To: Alexander Graf Date: Mon, 4 Dec 2017 08:10:56 +0100 Message-Id: <20171204071057.9520-3-xypron.glpk@gmx.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171204071057.9520-1-xypron.glpk@gmx.de> References: <20171204071057.9520-1-xypron.glpk@gmx.de> X-Provags-ID: V03:K0:/Ul+EpAOIWy6olm9kFaugkTVE3hgA9/QxyWBxK63DxSRn9c6J0Y 72G8mHmM+iooLIU2ptUpSqClceQC8prWi0Z9DRb4eY+0t+VBwAiUUxAl4mDiSZ8qEHQQT+n SVzgEH+NvWe2DKkPlN0A0/KFMtvwvJI56siTOicswNEkyAK/ESkF0elY6ukptLMpTc34Gwk 06N8uvLudwTXe/R0a6fQw== X-UI-Out-Filterresults: notjunk:1; V01:K0:sYmia54l++E=:ExzSh299aYyoDmRcgLmmPK L1F7s/WKIeqpIU/IipcXTi8xTuBMzQvBvekdA3IYE0GJLzUCc3v9JiwjScHT0oz0NAbFp039m BphEpyG/gkCF7JFJgVzbk4zZhnqQ2+QpRLhf//qEZHIc7oJ+li90U6yvA4HuVZXlSJLlCjWnR oMiBvkvuEfmGNgiFZNjOhXJUrXokQJVLZOwoj3ZwTrS3TxUeyqIfNgxPB50KAk92kbNNaiQbx 1xz1ybFBXG/PfnSTgLP5yq5vQkCWO8cC38+Sr/rlag9JOjZU4Jwp9uKBRqxzJUmDbriaTK+SO 6JIbNhebYkJ+XI8R70+eEhul924uo9GVX2L7vI72ZApM/DekzQnnXwT44eWqTvf/rU137R/f5 Trph8lAwS9w842rxfEurXNMvNruWXKs2fFxiloAyp5HwHhFySwbc2Ee/VEQe6iBOtQTJdY0tR TbR9JfGiaazlUaaYZ0xX1GVxKisF2rIhOovYeY3hwb0eSxiCqkrwz0pQ++E0Hts7iJPGFjyLF e/wyBZSuuGaGrof7mFNjJL6SiuxczHyRYHId+KH+EolqNS+DXLfrqxBkOibS//gFi5nntLWQs se2cBWbpIwoYu6msseix3ERCH6lYke/P4Avt9JiTyMMHqqWycUyFCVudiOQu1p9AUckBJg5Ox bonZ2oQTVpk4N0ORG8l3ZPm3FBSbsIHFYSD7wsrv+dwknEyoti5NgtErReNT6ObnjV0WE+SOG scg8MW2uTjfJPCc+IAsVuAFTYC4Pf45QnoG6PEfCbMTcWerKZwuGBuj+Hb8N3OUfospWV/xV7 JUN27hTGhcxFTOMGBpXMLKwZWAhVw== Cc: u-boot@lists.denx.de, Heinrich Schuchardt Subject: [U-Boot] [PATCH v2 2/3] efi_loader: correctly setup device paths for block devices X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" According to the UEFI spec the numbering of partitions has to start with 1. Partion number 0 is reserved for the optional device path for the complete block device. Signed-off-by: Heinrich Schuchardt --- v2 Do not generate optional device path with partion number 0. --- lib/efi_loader/efi_device_path.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/efi_loader/efi_device_path.c b/lib/efi_loader/efi_device_path.c index 42fe6e1185..6461ea9abc 100644 --- a/lib/efi_loader/efi_device_path.c +++ b/lib/efi_loader/efi_device_path.c @@ -420,7 +420,7 @@ static void *dp_part_fill(void *buf, struct blk_desc *desc, int part) if (desc->part_type == PART_TYPE_ISO) { struct efi_device_path_cdrom_path *cddp = buf; - cddp->boot_entry = part - 1; + cddp->boot_entry = part; cddp->dp.type = DEVICE_PATH_TYPE_MEDIA_DEVICE; cddp->dp.sub_type = DEVICE_PATH_SUB_TYPE_CDROM_PATH; cddp->dp.length = sizeof(*cddp); @@ -434,7 +434,7 @@ static void *dp_part_fill(void *buf, struct blk_desc *desc, int part) hddp->dp.type = DEVICE_PATH_TYPE_MEDIA_DEVICE; hddp->dp.sub_type = DEVICE_PATH_SUB_TYPE_HARD_DRIVE_PATH; hddp->dp.length = sizeof(*hddp); - hddp->partition_number = part - 1; + hddp->partition_number = part; hddp->partition_start = info.start; hddp->partition_end = info.size; if (desc->part_type == PART_TYPE_EFI)