summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2015-05-31 19:30:38 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2015-05-31 19:30:38 +0200
commit42484b6ef276f6c69b58712a19ffdfa3d64d1a21 (patch)
tree4bdd2e4b88b80c206070e3032b57ad5057a4c662
parent52c6b751c07b8de53479a311bd372eabe763052d (diff)
downloadplan9front-42484b6ef276f6c69b58712a19ffdfa3d64d1a21.tar.xz
disk/fdisk: learn about EFI system partition (type 0xEF), honor protective mbr (type 0xEE)
efi systems may use traditional dos partition table with an esp (efi system partition). otherwise, honor the protective mbr partition (0xEE) and exit when we encounter it.
-rw-r--r--sys/src/cmd/disk/prep/fdisk.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/src/cmd/disk/prep/fdisk.c b/sys/src/cmd/disk/prep/fdisk.c
index da1d93913..c06b6fffc 100644
--- a/sys/src/cmd/disk/prep/fdisk.c
+++ b/sys/src/cmd/disk/prep/fdisk.c
@@ -239,6 +239,10 @@ enum {
TypeDellRecovery= 0xDE,
TypeSPEEDSTOR12 = 0xE1,
TypeSPEEDSTOR16 = 0xE4,
+
+ TypeGPT = 0xEE, /* protective MBR */
+ TypeESP = 0xEF, /* EFI system partition */
+
TypeLANSTEP = 0xFE,
Type9 = 0x39,
@@ -319,6 +323,10 @@ static Type types[256] = {
[TypeDellRecovery] { "DELLRECOVERY", "dell" },
[TypeSPEEDSTOR12] { "SPEEDSTOR12", "speedstor" },
[TypeSPEEDSTOR16] { "SPEEDSTOR16", "speedstor" },
+
+ [TypeGPT] { "GPT", "" },
+ [TypeESP] { "ESP", "esp" },
+
[TypeLANSTEP] { "LANSTEP", "lanstep" },
[Type9] { "PLAN9", "plan9" },
@@ -515,6 +523,9 @@ rdpart(Edit *edit, uvlong xbase, uvlong ebrstart, int ebrtype)
case TypeLINUXEXT:
rdpart(edit, xbase, xbase+getle32(tp->xlba), tp->type);
break;
+ case TypeGPT:
+ fprint(2, "disk uses GPT partition format, use disk/edisk\n");
+ exits("gptformat");
default:
p = mkpart(nil, ebrstart+getle32(tp->xlba), getle32(tp->xsize), tp, ebrstart, ebrtype);
if(err = addpart(edit, p))