EFI GPT partition (0xEE) in the protective MBR to be smaller that the
actual size of the media.
This allows GPT disk images dd'ed onto larger physical media to be
recognized by fdisk(8) and the kernel.
Feedback from kettenis@ on various earlier versions.
-/* $OpenBSD: mbr.c,v 1.71 2021/05/21 19:09:46 krw Exp $ */
+/* $OpenBSD: mbr.c,v 1.72 2021/05/27 14:27:41 krw Exp $ */
/*
* Copyright (c) 1997 Tobias Weingartner
if (letoh32(dp2->dp_start) != GPTSECTOR)
continue;
psize = letoh32(dp2->dp_size);
- if (psize == (dsize - 1) || psize == UINT32_MAX) {
+ if (psize <= (dsize - 1) || psize == UINT32_MAX) {
efi = i;
eficnt++;
}
-/* $OpenBSD: subr_disk.c,v 1.241 2021/05/14 21:11:15 krw Exp $ */
+/* $OpenBSD: subr_disk.c,v 1.242 2021/05/27 14:27:41 krw Exp $ */
/* $NetBSD: subr_disk.c,v 1.17 1996/03/16 23:17:08 christos Exp $ */
/*
if (letoh32(dp2->dp_start) != GPTSECTOR)
continue;
psize = letoh32(dp2->dp_size);
- if (psize == (dsize - 1) || psize == UINT32_MAX) {
+ if (psize <= (dsize - 1) || psize == UINT32_MAX) {
efi = i;
eficnt++;
}