efi_loader: correctly render CD-ROM device path nodes
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Wed, 4 Sep 2019 11:56:01 +0000 (13:56 +0200)
committerHeinrich Schuchardt <xypron.glpk@gmx.de>
Thu, 5 Sep 2019 21:18:51 +0000 (23:18 +0200)
Correct the name of the partition size component in struct
efi_device_path_cdrom_path.

Render entry, start, and size when converting a CD-ROM device path node to
text.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
include/efi_api.h
lib/efi_loader/efi_device_path.c
lib/efi_loader/efi_device_path_to_text.c

index 7f7b67fa00f29f620ffca8bf1944a9663f4bbcff..cb895f31e5eb1f1502eb7b757a54b46659aae66d 100644 (file)
@@ -483,7 +483,7 @@ struct efi_device_path_cdrom_path {
        struct efi_device_path dp;
        u32 boot_entry;
        u64 partition_start;
-       u64 partition_end;
+       u64 partition_size;
 } __packed;
 
 struct efi_device_path_file_path {
index eeeb80683607117a34ab9b7313ebdc306e7fb53d..ea39f13b735cc52828c06fd2bfaf8300c3714a0d 100644 (file)
@@ -665,7 +665,7 @@ static void *dp_part_node(void *buf, struct blk_desc *desc, int part)
                cddp->dp.sub_type = DEVICE_PATH_SUB_TYPE_CDROM_PATH;
                cddp->dp.length = sizeof(*cddp);
                cddp->partition_start = info.start;
-               cddp->partition_end = info.size;
+               cddp->partition_size = info.size;
 
                buf = &cddp[1];
        } else {
index 892f5c4d33d4aa86b482913efc73605ff3524568..6e27508fba4ef9167923a2bef8f4e33b93124d1d 100644 (file)
@@ -214,7 +214,8 @@ static char *dp_media(char *s, struct efi_device_path *dp)
        case DEVICE_PATH_SUB_TYPE_CDROM_PATH: {
                struct efi_device_path_cdrom_path *cddp =
                        (struct efi_device_path_cdrom_path *)dp;
-               s += sprintf(s, "CDROM(0x%x)", cddp->boot_entry);
+               s += sprintf(s, "CDROM(%u,0x%llx,0x%llx)", cddp->boot_entry,
+                            cddp->partition_start, cddp->partition_size);
                break;
        }
        case DEVICE_PATH_SUB_TYPE_FILE_PATH: {