From 42484b6ef276f6c69b58712a19ffdfa3d64d1a21 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Sun, 31 May 2015 19:30:38 +0200 Subject: 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. --- sys/src/cmd/disk/prep/fdisk.c | 11 +++++++++++ 1 file changed, 11 insertions(+) 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)) -- cgit v1.2.3