diff --git a/src/boot/disk.zig b/src/boot/disk.zig index 301aaca..7869d5d 100644 --- a/src/boot/disk.zig +++ b/src/boot/disk.zig @@ -101,13 +101,16 @@ pub fn probe( for (mbr.partitions(), 1..) |part, mbr_partn| { const part_type = MbrPartitionType.fromValue(part.partType()) orelse continue; - if (part.isBootable() and + if ((part.isBootable() and // BootLoaderSpec uses this partition type for MBR, see // https://uapi-group.org/specifications/specs/boot_loader_specification/#the-partitionsl. (part_type == .LinuxExtendedBoot or // QEMU uses this partition type when using a FAT // emulated drive with `-drive file=fat:rw:some/directory`. - part_type == .Fat16)) + part_type == .Fat16)) or + // Many ISOs have this MBR table setup where the partition type + // is ESP and it is marked as non-bootable. + part_type == .EfiSystemPartition) { break :b mbr_partn; } diff --git a/src/disk/partition_table.zig b/src/disk/partition_table.zig index 73399a1..89d83bb 100644 --- a/src/disk/partition_table.zig +++ b/src/disk/partition_table.zig @@ -959,12 +959,14 @@ pub const MbrPartitionType = enum { Fat16, ProtectedMbr, LinuxExtendedBoot, + EfiSystemPartition, pub fn fromValue(val: u8) ?@This() { return switch (val) { 0x06 => .Fat16, 0xea => .LinuxExtendedBoot, 0xee => .ProtectedMbr, + 0xef => .EfiSystemPartition, else => return null, }; }