Skip to content
Snippets Groups Projects
Commit 7b982f00 authored by Heinrich Schuchardt's avatar Heinrich Schuchardt Committed by Alexander Graf
Browse files

efi_loader: correctly setup device paths for block devices


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: default avatarHeinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
parent 66b051d5
No related branches found
No related tags found
No related merge requests found
...@@ -435,7 +435,7 @@ static void *dp_part_fill(void *buf, struct blk_desc *desc, int part) ...@@ -435,7 +435,7 @@ static void *dp_part_fill(void *buf, struct blk_desc *desc, int part)
if (desc->part_type == PART_TYPE_ISO) { if (desc->part_type == PART_TYPE_ISO) {
struct efi_device_path_cdrom_path *cddp = buf; 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.type = DEVICE_PATH_TYPE_MEDIA_DEVICE;
cddp->dp.sub_type = DEVICE_PATH_SUB_TYPE_CDROM_PATH; cddp->dp.sub_type = DEVICE_PATH_SUB_TYPE_CDROM_PATH;
cddp->dp.length = sizeof(*cddp); cddp->dp.length = sizeof(*cddp);
...@@ -449,7 +449,7 @@ static void *dp_part_fill(void *buf, struct blk_desc *desc, int part) ...@@ -449,7 +449,7 @@ static void *dp_part_fill(void *buf, struct blk_desc *desc, int part)
hddp->dp.type = DEVICE_PATH_TYPE_MEDIA_DEVICE; hddp->dp.type = DEVICE_PATH_TYPE_MEDIA_DEVICE;
hddp->dp.sub_type = DEVICE_PATH_SUB_TYPE_HARD_DRIVE_PATH; hddp->dp.sub_type = DEVICE_PATH_SUB_TYPE_HARD_DRIVE_PATH;
hddp->dp.length = sizeof(*hddp); hddp->dp.length = sizeof(*hddp);
hddp->partition_number = part - 1; hddp->partition_number = part;
hddp->partition_start = info.start; hddp->partition_start = info.start;
hddp->partition_end = info.size; hddp->partition_end = info.size;
if (desc->part_type == PART_TYPE_EFI) if (desc->part_type == PART_TYPE_EFI)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment