git: 9front

Download patch

ref: 842be978ca01496c28115752a1f0c487bf21ab3d
parent: f09e3684912a86d31ea1687e99f82b4d7de25bb5
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sun May 31 15:30:38 EDT 2015

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.

--- a/sys/src/cmd/disk/prep/fdisk.c
+++ b/sys/src/cmd/disk/prep/fdisk.c
@@ -239,6 +239,10 @@
 	TypeDellRecovery= 0xDE,
 	TypeSPEEDSTOR12	= 0xE1,
 	TypeSPEEDSTOR16	= 0xE4,
+
+	TypeGPT		= 0xEE,		/* protective MBR */
+	TypeESP		= 0xEF,		/* EFI system partition */
+
 	TypeLANSTEP	= 0xFE,
 
 	Type9		= 0x39,
@@ -319,6 +323,10 @@
 	[TypeDellRecovery]	{ "DELLRECOVERY", "dell" },
 	[TypeSPEEDSTOR12]	{ "SPEEDSTOR12", "speedstor" },
 	[TypeSPEEDSTOR16]	{ "SPEEDSTOR16", "speedstor" },
+
+	[TypeGPT]		{ "GPT", "" },
+	[TypeESP]		{ "ESP", "esp" },
+
 	[TypeLANSTEP]		{ "LANSTEP", "lanstep" },
 
 	[Type9]			{ "PLAN9", "plan9" },
@@ -515,6 +523,9 @@
 		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))
--