Skip to content

Commit

Permalink
fix: revert mark the EFI partition in PMBR as bootable
Browse files Browse the repository at this point in the history
This reverts commit bec914f.

Signed-off-by: Andrey Smirnov <[email protected]>
  • Loading branch information
smira authored and talos-bot committed Apr 7, 2021
1 parent bec914f commit 1d830a2
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions blockdevice/partition/gpt/gpt.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,6 @@ func (g *GPT) Repair() error {
// - https://en.wikipedia.org/wiki/GUID_Partition_Table#Protective_MBR_(LBA_0)
// - https://www.syslinux.org/wiki/index.php?title=Doc/gpt
// - https://en.wikipedia.org/wiki/Master_boot_record
// - http://www.rodsbooks.com/gdisk/bios.html
func (g *GPT) newPMBR(h *Header) ([]byte, error) {
p, err := g.l.ReadAt(0, 0, 512)
if err != nil {
Expand All @@ -356,10 +355,7 @@ func (g *GPT) newPMBR(h *Header) ([]byte, error) {

// PMBR protective entry.
b := p[446 : 446+16]

// Some BIOSes in legacy mode won't boot from a disk unless there is at least one
// partition in the MBR marked bootable. Mark this partition as bootable.
b[0] = 0x80
b[0] = 0x00

// Partition type: EFI data partition.
b[4] = 0xee
Expand Down

0 comments on commit 1d830a2

Please sign in to comment.