X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=disk%2Fpart_efi.c;h=15627f29e8bd4ad33ba1688ad846d131e9c0cb8c;hb=f4c92582137a645ffc42346d7176ddd1462c2be0;hp=338010e148e24c5f2eecc1c0097529e5bd9d878b;hpb=a74a4a86a53726ba17de8ab863bec1cd60cf545e;p=oweals%2Fu-boot.git diff --git a/disk/part_efi.c b/disk/part_efi.c index 338010e148..15627f29e8 100644 --- a/disk/part_efi.c +++ b/disk/part_efi.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include @@ -342,7 +343,7 @@ static int set_protective_mbr(block_dev_desc_t *dev_desc) p_mbr->signature = MSDOS_MBR_SIGNATURE; p_mbr->partition_record[0].sys_ind = EFI_PMBR_OSTYPE_EFI_GPT; p_mbr->partition_record[0].start_sect = 1; - p_mbr->partition_record[0].nr_sects = (u32) dev_desc->lba; + p_mbr->partition_record[0].nr_sects = (u32) dev_desc->lba - 1; /* Write MBR sector to the MMC device */ if (dev_desc->block_write(dev_desc->dev, 0, 1, p_mbr) != 1) {