From f06e6159c398f30143c0f0a0af94a27ccc573467 Mon Sep 17 00:00:00 2001 From: "Andrey V. Elsukov" Date: Mon, 22 Oct 2012 11:01:43 +0000 Subject: [PATCH] When loader tries to open GPT partition, but partition table is not GPT, then try automatically detect an appropriate partition type. PR: kern/172550 Tested by: Ralf Wenk --- sys/boot/common/disk.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/boot/common/disk.c b/sys/boot/common/disk.c index 81d133297af3..a62f6fd45e98 100644 --- a/sys/boot/common/disk.c +++ b/sys/boot/common/disk.c @@ -310,6 +310,13 @@ opened: if (ptable_gettype(od->table) == PTABLE_GPT) { partition = 255; goto out; /* Nothing more to do */ + } else if (partition == 255) { + /* + * When we try to open GPT partition, but partition + * table isn't GPT, reset d_partition value to -1 + * and try to autodetect appropriate value. + */ + partition = -1; } /* * If d_partition < 0 and we are looking at a BSD slice,