efi_loader: Setup logical_partition media information
authorEmmanuel Vadot <manu@freebsd.org>
Mon, 11 Dec 2017 18:22:33 +0000 (19:22 +0100)
committerTom Rini <trini@konsulko.com>
Tue, 19 Dec 2017 12:57:02 +0000 (07:57 -0500)
When adding a partition, set the logical_partition member in the media
structure as mandated by the UEFI spec.

Signed-off-by: Emmanuel Vadot <manu@freebsd.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
lib/efi_loader/efi_disk.c

index 4e457a841bdbe71cebc0680bc125cfe95912c115..d299fc8dea5b0a0b104207b227ca12591b961659 100644 (file)
@@ -258,6 +258,8 @@ static void efi_disk_add_dev(const char *name,
        diskobj->media.block_size = desc->blksz;
        diskobj->media.io_align = desc->blksz;
        diskobj->media.last_block = desc->lba - offset;
+       if (part != 0)
+               diskobj->media.logical_partition = 1;
        diskobj->ops.media = &diskobj->media;
        return;
 out_of_memory: