Skip to contentSkip to conversation

disk: dos: Add all options for EFI System Partitions

PATCH RESEND In review Peter Robinson 3 participants 4 messages Oct 8, 2025 – Oct 23, 2025

lore
Share & tools
lore
#0 lore raw

PATCH RESEND v4 1/1 disk: dos: Add all options for EFI System Partitions

The EFI spec states that the ESP can be any of FAT12/16/32 but for compatibility doesn't necssarily require the partition to be the EFI partition table ID of 0xef. A number of arm devices will not find their firmware on a FAT partition with an ID of 0xef so also allow the original FAT12/16/32 partition IDs as they are also permissable for an ESP.

---

v2:
- Add 0x0c option
- Make hex constants consistent
- Move from if to switch statement
v3:
- Fix switch brain fart
v4:
- Drop boot_ind out of switch

This is just a resend, it fell off my radar, and there was a CI failure.

 disk/part_dos.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
disk/part_dos.c +12 -1
index 18dd35c9b98..92d6fa6e028 100644
@@ -39,10 +39,21 @@ static int get_bootable(dos_partition_t *p)
 {
 	int ret = 0;
 
-	if (p->sys_ind == 0xef)
+	switch (p->sys_ind) {
+	case 0x01:
+	case 0x06:
+	case 0x0b:
+	case 0x0c:
+	case 0xef:
 		ret |= PART_EFI_SYSTEM_PARTITION;
+		break;
+	default:
+		break;
+	}
+
 	if (p->boot_ind == 0x80)
 		ret |= PART_BOOTABLE;
+
 	return ret;
 }
 
Signature · 1 line
2.51.0
#1 lore raw
Quoted 10 lines · Peter Robinson

The EFI spec states that the ESP can be any of FAT12/16/32 but for compatibility doesn't necssarily require the partition to be the EFI partition table ID of 0xef. A number of arm devices will not find their firmware on a FAT partition with an ID of 0xef so also allow the original FAT12/16/32 partition IDs as they are also permissable for an ESP.

So the CI failure is in EFI self test:
https://source.denx.de/u-boot/u-boot/-/jobs/1267541#L268
and I'm not sure where to dig in to that part.

Signature · 1 line
Tom
#2 lore raw
In reply to Peter Robinson
Quoted 10 lines · Peter Robinson

The EFI spec states that the ESP can be any of FAT12/16/32 but for compatibility doesn't necssarily require the partition to be the EFI partition table ID of 0xef. A number of arm devices will not find their firmware on a FAT partition with an ID of 0xef so also allow the original FAT12/16/32 partition IDs as they are also permissable for an ESP.

Hello Peter,

Please, read the Microsoft documentation:

"The Extensible Firmware Interface System Partitions on an MBR disk is identified by partition type 0xEF." [1]

The other partition types like 0x06 have non-ESP use and should never be taken for an ESP.

Updating partition tables is trivial. Just fix the buggy partition table entry on your ARM devices instead of this cumbersome patch.

Best regards

Heinrich

[1]
https://learn.microsoft.com/en-us/troubleshoot/windows-server/backup-and-storage/guid-partitioning-table-disk-faq

Quoted 44 lines

---

v2:
- Add 0x0c option
- Make hex constants consistent
- Move from if to switch statement
v3:
- Fix switch brain fart
v4:
- Drop boot_ind out of switch

This is just a resend, it fell off my radar, and there was a CI failure.

  disk/part_dos.c | 13 ++++++++++++-
  1 file changed, 12 insertions(+), 1 deletion(-)
disk/part_dos.c +12 -1
index 18dd35c9b98..92d6fa6e028 100644
@@ -39,10 +39,21 @@ static int get_bootable(dos_partition_t *p)
  {
  	int ret = 0;
 
-	if (p->sys_ind == 0xef)
+	switch (p->sys_ind) {
+	case 0x01:
+	case 0x06:
+	case 0x0b:
+	case 0x0c:
+	case 0xef:
  		ret |= PART_EFI_SYSTEM_PARTITION;
+		break;
+	default:
+		break;
+	}
+
  	if (p->boot_ind == 0x80)
  		ret |= PART_BOOTABLE;
+
  	return ret;
  }
 
#3 lore raw
Quoted 7 lines · Heinrich Schuchardt
Quoted 6 lines · Peter Robinson

The EFI spec states that the ESP can be any of FAT12/16/32 but for compatibility doesn't necssarily require the partition to be the EFI partition table ID of 0xef. A number of arm devices will not find their firmware on a FAT partition with an ID of 0xef so also allow the original FAT12/16/32 partition IDs as they are also permissable for an ESP.

Hello Peter,

It is U-Boot that reads the ESP. The EFI boot loader is the only thing that needs to be there.

You provide no clue why you want to place any firmware on the same partition as the EFI binary.

Best regards

Heinrich

Quoted 66 lines
Quoted 4 lines

Hello Peter,

Please, read the Microsoft documentation:

"The Extensible Firmware Interface System Partitions on an MBR disk is identified by partition type 0xEF." [1]

The other partition types like 0x06 have non-ESP use and should never be taken for an ESP.

Updating partition tables is trivial. Just fix the buggy partition table entry on your ARM devices instead of this cumbersome patch.

Best regards

Heinrich

[1]
https://learn.microsoft.com/en-us/troubleshoot/windows-server/backup- and-storage/guid-partitioning-table-disk-faq

Quoted 42 lines

---

v2:
- Add 0x0c option
- Make hex constants consistent
- Move from if to switch statement
v3:
- Fix switch brain fart
v4:
- Drop boot_ind out of switch

This is just a resend, it fell off my radar, and there was a CI failure.

  disk/part_dos.c | 13 ++++++++++++-

  1 file changed, 12 insertions(+), 1 deletion(-)
disk/part_dos.c +12 -1
index 18dd35c9b98..92d6fa6e028 100644
@@ -39,10 +39,21 @@ static int get_bootable(dos_partition_t *p)
   {
       int ret = 0;
-    if (p->sys_ind == 0xef)
+    switch (p->sys_ind) {
+    case 0x01:
+    case 0x06:
+    case 0x0b:
+    case 0x0c:
+    case 0xef:
           ret |= PART_EFI_SYSTEM_PARTITION;
+        break;
+    default:
+        break;
+    }
+
       if (p->boot_ind == 0x80)
           ret |= PART_BOOTABLE;
+
       return ret;
   }