summaryrefslogtreecommitdiffstats
path: root/sys/boot/common
diff options
context:
space:
mode:
authorae <ae@FreeBSD.org>2012-10-22 11:01:43 +0000
committerae <ae@FreeBSD.org>2012-10-22 11:01:43 +0000
commit351e7472a68654ffa22257cfc933fac0c8e468b9 (patch)
tree840233abbfdba213749eff60928cc790404e4c57 /sys/boot/common
parent32a504ec11e64d663b16c14c757c8b44bce46f46 (diff)
downloadFreeBSD-src-351e7472a68654ffa22257cfc933fac0c8e468b9.zip
FreeBSD-src-351e7472a68654ffa22257cfc933fac0c8e468b9.tar.gz
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
Diffstat (limited to 'sys/boot/common')
-rw-r--r--sys/boot/common/disk.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/boot/common/disk.c b/sys/boot/common/disk.c
index 81d1332..a62f6fd 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,
OpenPOWER on IntegriCloud