Skip to content

Commit

Permalink
disk: add swap partition ID constants
Browse files Browse the repository at this point in the history
  • Loading branch information
achilleas-k committed Nov 27, 2024
1 parent fe92863 commit 22ef622
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/disk/disk.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ const (

RootPartitionUUID = "6264D520-3FB9-423F-8AB8-7A0A8E3D3562"

SwapPartitionGUID = "0657FD6D-A4AB-43C4-84E5-0933C84B4F4F"

// Extended Boot Loader Partition
XBootLDRPartitionGUID = "BC13C2FF-59E6-4262-A352-B275FD6F7172"

Expand All @@ -70,6 +72,9 @@ const (

// Partition type ID for ESP on dos
DosESPID = "ef00"

// Partition type ID for swap
DosSwapID = "82"
)

// pt type -> type -> ID mapping for convenience
Expand All @@ -80,13 +85,15 @@ var idMap = map[PartitionTableType]map[string]string{
"data": DosLinuxTypeID,
"esp": DosESPID,
"lvm": DosLinuxTypeID,
"swap": DosSwapID,
},
PT_GPT: {
"bios": BIOSBootPartitionGUID,
"boot": XBootLDRPartitionGUID,
"data": FilesystemDataGUID,
"esp": EFISystemPartitionGUID,
"lvm": LVMPartitionGUID,
"swap": SwapPartitionGUID,
},
}

Expand Down

0 comments on commit 22ef622

Please sign in to comment.