From 22ef62281313356c09714d582ae6db2ecf17d8bb Mon Sep 17 00:00:00 2001 From: Achilleas Koutsou Date: Wed, 27 Nov 2024 12:21:14 +0100 Subject: [PATCH] disk: add swap partition ID constants Add the SwapPartitionGUID for GPT and DosSwapID for DOS. Register both in the idMap. Refs: - https://www.freedesktop.org/wiki/Specifications/DiscoverablePartitionsSpec/ - https://tldp.org/HOWTO/Partition-Mass-Storage-Definitions-Naming-HOWTO/x190.html --- pkg/disk/disk.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkg/disk/disk.go b/pkg/disk/disk.go index 31c586f309..576687f06a 100644 --- a/pkg/disk/disk.go +++ b/pkg/disk/disk.go @@ -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" @@ -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 @@ -80,6 +85,7 @@ var idMap = map[PartitionTableType]map[string]string{ "data": DosLinuxTypeID, "esp": DosESPID, "lvm": DosLinuxTypeID, + "swap": DosSwapID, }, PT_GPT: { "bios": BIOSBootPartitionGUID, @@ -87,6 +93,7 @@ var idMap = map[PartitionTableType]map[string]string{ "data": FilesystemDataGUID, "esp": EFISystemPartitionGUID, "lvm": LVMPartitionGUID, + "swap": SwapPartitionGUID, }, }