diff --git a/Cargo.lock b/Cargo.lock
index c46767309..4ff732ec7 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -265,6 +265,7 @@ dependencies = [
"camino",
"canon-json",
"cap-std-ext",
+ "cfg-if",
"chrono",
"clap",
"clap_mangen",
diff --git a/Cargo.toml b/Cargo.toml
index cd6fc416b..4c3f89f1c 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -36,6 +36,7 @@ anyhow = "1.0.82"
camino = "1.1.6"
canon-json = "0.2.1"
cap-std-ext = "4.0.3"
+cfg-if = "1.0"
chrono = { version = "0.4.38", default-features = false }
clap = "4.5.4"
clap_mangen = { version = "0.2.20" }
diff --git a/crates/blockdev/src/blockdev.rs b/crates/blockdev/src/blockdev.rs
index ceed18d9b..d63c7101a 100644
--- a/crates/blockdev/src/blockdev.rs
+++ b/crates/blockdev/src/blockdev.rs
@@ -161,6 +161,14 @@ impl PartitionTable {
.ok_or_else(|| anyhow::anyhow!("Missing partition for index {partno}"))?;
Ok(r)
}
+
+ /// Find the partition with the given type UUID (case-insensitive).
+ ///
+ /// Partition type UUIDs are compared case-insensitively per the GPT specification,
+ /// as different tools may report them in different cases.
+ pub fn find_partition_of_type(&self, uuid: &str) -> Option<&Partition> {
+ self.partitions.iter().find(|p| p.parttype_matches(uuid))
+ }
}
impl Partition {
@@ -168,6 +176,14 @@ impl Partition {
pub fn path(&self) -> &Utf8Path {
self.node.as_str().into()
}
+
+ /// Check if this partition's type matches the given UUID (case-insensitive).
+ ///
+ /// Partition type UUIDs are compared case-insensitively per the GPT specification,
+ /// as different tools may report them in different cases.
+ pub fn parttype_matches(&self, uuid: &str) -> bool {
+ self.parttype.eq_ignore_ascii_case(uuid)
+ }
}
#[context("Listing partitions of {dev}")]
@@ -505,4 +521,85 @@ mod test {
);
Ok(())
}
+
+ #[test]
+ fn test_parttype_matches() {
+ let partition = Partition {
+ node: "/dev/loop0p1".to_string(),
+ start: 2048,
+ size: 8192,
+ parttype: "c12a7328-f81f-11d2-ba4b-00a0c93ec93b".to_string(), // lowercase ESP UUID
+ uuid: Some("58A4C5F0-BD12-424C-B563-195AC65A25DD".to_string()),
+ name: Some("EFI System".to_string()),
+ };
+
+ // Test exact match (lowercase)
+ assert!(partition.parttype_matches("c12a7328-f81f-11d2-ba4b-00a0c93ec93b"));
+
+ // Test case-insensitive match (uppercase)
+ assert!(partition.parttype_matches("C12A7328-F81F-11D2-BA4B-00A0C93EC93B"));
+
+ // Test case-insensitive match (mixed case)
+ assert!(partition.parttype_matches("C12a7328-F81f-11d2-Ba4b-00a0C93ec93b"));
+
+ // Test non-match
+ assert!(!partition.parttype_matches("0FC63DAF-8483-4772-8E79-3D69D8477DE4"));
+ }
+
+ #[test]
+ fn test_find_partition_of_type() -> Result<()> {
+ let fixture = indoc::indoc! { r#"
+ {
+ "partitiontable": {
+ "label": "gpt",
+ "id": "A67AA901-2C72-4818-B098-7F1CAC127279",
+ "device": "/dev/loop0",
+ "unit": "sectors",
+ "firstlba": 34,
+ "lastlba": 20971486,
+ "sectorsize": 512,
+ "partitions": [
+ {
+ "node": "/dev/loop0p1",
+ "start": 2048,
+ "size": 8192,
+ "type": "C12A7328-F81F-11D2-BA4B-00A0C93EC93B",
+ "uuid": "58A4C5F0-BD12-424C-B563-195AC65A25DD",
+ "name": "EFI System"
+ },{
+ "node": "/dev/loop0p2",
+ "start": 10240,
+ "size": 20961247,
+ "type": "0FC63DAF-8483-4772-8E79-3D69D8477DE4",
+ "uuid": "F51ABB0D-DA16-4A21-83CB-37F4C805AAA0",
+ "name": "root"
+ }
+ ]
+ }
+ }
+ "# };
+ let table: SfDiskOutput = serde_json::from_str(fixture).unwrap();
+
+ // Find ESP partition using lowercase UUID (should match uppercase in fixture)
+ let esp = table
+ .partitiontable
+ .find_partition_of_type("c12a7328-f81f-11d2-ba4b-00a0c93ec93b");
+ assert!(esp.is_some());
+ assert_eq!(esp.unwrap().node, "/dev/loop0p1");
+
+ // Find root partition using uppercase UUID (should match case-insensitively)
+ let root = table
+ .partitiontable
+ .find_partition_of_type("0fc63daf-8483-4772-8e79-3d69d8477de4");
+ assert!(root.is_some());
+ assert_eq!(root.unwrap().node, "/dev/loop0p2");
+
+ // Try to find non-existent partition type
+ let nonexistent = table
+ .partitiontable
+ .find_partition_of_type("00000000-0000-0000-0000-000000000000");
+ assert!(nonexistent.is_none());
+
+ Ok(())
+ }
}
diff --git a/crates/lib/Cargo.toml b/crates/lib/Cargo.toml
index 1a26fd992..4f20372c1 100644
--- a/crates/lib/Cargo.toml
+++ b/crates/lib/Cargo.toml
@@ -30,6 +30,7 @@ anyhow = { workspace = true }
camino = { workspace = true, features = ["serde1"] }
canon-json = { workspace = true }
cap-std-ext = { workspace = true, features = ["fs_utf8"] }
+cfg-if = { workspace = true }
chrono = { workspace = true, features = ["serde"] }
clap = { workspace = true, features = ["derive","cargo"] }
clap_mangen = { workspace = true, optional = true }
diff --git a/crates/lib/src/bootc_composefs/boot.rs b/crates/lib/src/bootc_composefs/boot.rs
index ce1ecd576..316ac77f0 100644
--- a/crates/lib/src/bootc_composefs/boot.rs
+++ b/crates/lib/src/bootc_composefs/boot.rs
@@ -44,7 +44,8 @@ use crate::{
BOOT_LOADER_ENTRIES, COMPOSEFS_CMDLINE, ORIGIN_KEY_BOOT, ORIGIN_KEY_BOOT_DIGEST,
STAGED_BOOT_LOADER_ENTRIES, STATE_DIR_ABS, USER_CFG, USER_CFG_STAGED,
},
- install::{dps_uuid::DPS_UUID, RW_KARG},
+ discoverable_partition_specification::this_arch_root,
+ install::RW_KARG,
spec::{Bootloader, Host},
};
@@ -400,7 +401,7 @@ pub(crate) fn setup_composefs_bls_boot(
Utf8PathBuf::from("/sysroot"),
get_esp_partition(&sysroot_parent)?.0,
[
- format!("root=UUID={DPS_UUID}"),
+ format!("root=UUID={}", this_arch_root()),
RW_KARG.to_string(),
format!("{COMPOSEFS_CMDLINE}={id_hex}"),
]
diff --git a/crates/lib/src/bootloader.rs b/crates/lib/src/bootloader.rs
index 33c8c1a4c..411baec2f 100644
--- a/crates/lib/src/bootloader.rs
+++ b/crates/lib/src/bootloader.rs
@@ -10,13 +10,11 @@ use bootc_mount as mount;
#[cfg(any(feature = "composefs-backend", feature = "install-to-disk"))]
use crate::bootc_composefs::boot::mount_esp;
-use crate::utils;
+use crate::{discoverable_partition_specification, utils};
/// The name of the mountpoint for efi (as a subdirectory of /boot, or at the toplevel)
pub(crate) const EFI_DIR: &str = "efi";
/// The EFI system partition GUID
-#[allow(dead_code)]
-pub(crate) const ESP_GUID: &str = "C12A7328-F81F-11D2-BA4B-00A0C93EC93B";
/// Path to the bootupd update payload
#[allow(dead_code)]
const BOOTUPD_UPDATES: &str = "usr/lib/bootupd/updates";
@@ -24,9 +22,7 @@ const BOOTUPD_UPDATES: &str = "usr/lib/bootupd/updates";
#[allow(dead_code)]
pub(crate) fn esp_in(device: &PartitionTable) -> Result<&Partition> {
device
- .partitions
- .iter()
- .find(|p| p.parttype.as_str() == ESP_GUID)
+ .find_partition_of_type(discoverable_partition_specification::ESP)
.ok_or(anyhow::anyhow!("ESP not found in partition table"))
}
@@ -84,9 +80,7 @@ pub(crate) fn install_systemd_boot(
_deployment_path: Option<&str>,
) -> Result<()> {
let esp_part = device
- .partitions
- .iter()
- .find(|p| p.parttype.as_str() == ESP_GUID)
+ .find_partition_of_type(discoverable_partition_specification::ESP)
.ok_or_else(|| anyhow::anyhow!("ESP partition not found"))?;
let esp_mount = mount_esp(&esp_part.node).context("Mounting ESP")?;
diff --git a/crates/lib/src/discoverable_partition_specification.rs b/crates/lib/src/discoverable_partition_specification.rs
new file mode 100644
index 000000000..d5432e74b
--- /dev/null
+++ b/crates/lib/src/discoverable_partition_specification.rs
@@ -0,0 +1,866 @@
+#![allow(dead_code)]
+
+//! Partition type GUIDs from the Discoverable Partitions Specification (DPS)
+//!
+//! This module contains constants for partition type GUIDs as defined by the
+//! UAPI Group's Discoverable Partitions Specification.
+//!
+//! Reference:
+
+// ============================================================================
+// ROOT PARTITIONS
+// ============================================================================
+
+/// Root partition for Alpha architecture
+pub const ROOT_ALPHA: &str = "6523f8ae-3eb1-4e2a-a05a-18b695ae656f";
+
+/// Root partition for ARC architecture
+pub const ROOT_ARC: &str = "d27f46ed-2919-4cb8-bd25-9531f3c16534";
+
+/// Root partition for 32-bit ARM architecture
+pub const ROOT_ARM: &str = "69dad710-2ce4-4e3c-b16c-21a1d49abed3";
+
+/// Root partition for 64-bit ARM/AArch64 architecture
+pub const ROOT_ARM64: &str = "b921b045-1df0-41c3-af44-4c6f280d3fae";
+
+/// Root partition for Itanium/IA-64 architecture
+pub const ROOT_IA64: &str = "993d8d3d-f80e-4225-855a-9daf8ed7ea97";
+
+/// Root partition for 64-bit LoongArch architecture
+pub const ROOT_LOONGARCH64: &str = "77055800-792c-4f94-b39a-98c91b762bb6";
+
+/// Root partition for 32-bit MIPS Little Endian
+pub const ROOT_MIPS_LE: &str = "37c58c8a-d913-4156-a25f-48b1b64e07f0";
+
+/// Root partition for 64-bit MIPS Little Endian
+pub const ROOT_MIPS64_LE: &str = "700bda43-7a34-4507-b179-eeb93d7a7ca3";
+
+/// Root partition for 32-bit MIPS Big Endian
+pub const ROOT_MIPS: &str = "e9434544-6e2c-47cc-bae2-12d6deafb44c";
+
+/// Root partition for 64-bit MIPS Big Endian
+pub const ROOT_MIPS64: &str = "d113af76-80ef-41b4-bdb6-0cff4d3d4a25";
+
+/// Root partition for PA-RISC/HPPA architecture
+pub const ROOT_PARISC: &str = "1aacdb3b-5444-4138-bd9e-e5c2239b2346";
+
+/// Root partition for 32-bit PowerPC
+pub const ROOT_PPC: &str = "1de3f1ef-fa98-47b5-8dcd-4a860a654d78";
+
+/// Root partition for 64-bit PowerPC Big Endian
+pub const ROOT_PPC64: &str = "912ade1d-a839-4913-8964-a10eee08fbd2";
+
+/// Root partition for 64-bit PowerPC Little Endian
+pub const ROOT_PPC64_LE: &str = "c31c45e6-3f39-412e-80fb-4809c4980599";
+
+/// Root partition for 32-bit RISC-V
+pub const ROOT_RISCV32: &str = "60d5a7fe-8e7d-435c-b714-3dd8162144e1";
+
+/// Root partition for 64-bit RISC-V
+pub const ROOT_RISCV64: &str = "72ec70a6-cf74-40e6-bd49-4bda08e8f224";
+
+/// Root partition for s390 architecture
+pub const ROOT_S390: &str = "08a7acea-624c-4a20-91e8-6e0fa67d23f9";
+
+/// Root partition for s390x architecture
+pub const ROOT_S390X: &str = "5eead9a9-fe09-4a1e-a1d7-520d00531306";
+
+/// Root partition for TILE-Gx architecture
+pub const ROOT_TILEGX: &str = "c50cdd70-3862-4cc3-90e1-809a8c93ee2c";
+
+/// Root partition for 32-bit x86
+pub const ROOT_X86: &str = "44479540-f297-41b2-9af7-d131d5f0458a";
+
+/// Root partition for 64-bit x86/AMD64
+pub const ROOT_X86_64: &str = "4f68bce3-e8cd-4db1-96e7-fbcaf984b709";
+
+// ============================================================================
+// USR PARTITIONS
+// ============================================================================
+
+/// /usr partition for Alpha architecture
+pub const USR_ALPHA: &str = "e18cf08c-33ec-4c0d-8246-c6c6fb3da024";
+
+/// /usr partition for ARC architecture
+pub const USR_ARC: &str = "7978a683-6316-4922-bbee-38bff5a2fecc";
+
+/// /usr partition for 32-bit ARM
+pub const USR_ARM: &str = "7d0359a3-02b3-4f0a-865c-654403e70625";
+
+/// /usr partition for 64-bit ARM/AArch64
+pub const USR_ARM64: &str = "b0e01050-ee5f-4390-949a-9101b17104e9";
+
+/// /usr partition for Itanium/IA-64
+pub const USR_IA64: &str = "4301d2a6-4e3b-4b2a-bb94-9e0b2c4225ea";
+
+/// /usr partition for 64-bit LoongArch
+pub const USR_LOONGARCH64: &str = "e611c702-575c-4cbe-9a46-434fa0bf7e3f";
+
+/// /usr partition for 32-bit MIPS Big Endian
+pub const USR_MIPS: &str = "773b2abc-2a99-4398-8bf5-03baac40d02b";
+
+/// /usr partition for 64-bit MIPS Big Endian
+pub const USR_MIPS64: &str = "57e13958-7331-4365-8e6e-35eeee17c61b";
+
+/// /usr partition for 32-bit MIPS Little Endian
+pub const USR_MIPS_LE: &str = "0f4868e9-9952-4706-979f-3ed3a473e947";
+
+/// /usr partition for 64-bit MIPS Little Endian
+pub const USR_MIPS64_LE: &str = "c97c1f32-ba06-40b4-9f22-236061b08aa8";
+
+/// /usr partition for PA-RISC
+pub const USR_PARISC: &str = "dc4a4480-6917-4262-a4ec-db9384949f25";
+
+/// /usr partition for 32-bit PowerPC
+pub const USR_PPC: &str = "7d14fec5-cc71-415d-9d6c-06bf0b3c3eaf";
+
+/// /usr partition for 64-bit PowerPC Big Endian
+pub const USR_PPC64: &str = "2c9739e2-f068-46b3-9fd0-01c5a9afbcca";
+
+/// /usr partition for 64-bit PowerPC Little Endian
+pub const USR_PPC64_LE: &str = "15bb03af-77e7-4d4a-b12b-c0d084f7491c";
+
+/// /usr partition for 32-bit RISC-V
+pub const USR_RISCV32: &str = "b933fb22-5c3f-4f91-af90-e2bb0fa50702";
+
+/// /usr partition for 64-bit RISC-V
+pub const USR_RISCV64: &str = "beaec34b-8442-439b-a40b-984381ed097d";
+
+/// /usr partition for s390
+pub const USR_S390: &str = "cd0f869b-d0fb-4ca0-b141-9ea87cc78d66";
+
+/// /usr partition for s390x
+pub const USR_S390X: &str = "8a4f5770-50aa-4ed3-874a-99b710db6fea";
+
+/// /usr partition for TILE-Gx
+pub const USR_TILEGX: &str = "55497029-c7c1-44cc-aa39-815ed1558630";
+
+/// /usr partition for 32-bit x86
+pub const USR_X86: &str = "75250d76-8cc6-458e-bd66-bd47cc81a812";
+
+/// /usr partition for 64-bit x86/AMD64
+pub const USR_X86_64: &str = "8484680c-9521-48c6-9c11-b0720656f69e";
+
+// ============================================================================
+// ROOT VERITY PARTITIONS
+// ============================================================================
+
+/// Root verity partition for Alpha
+pub const ROOT_VERITY_ALPHA: &str = "fc56d9e9-e6e5-4c06-be32-e74407ce09a5";
+
+/// Root verity partition for ARC
+pub const ROOT_VERITY_ARC: &str = "24b2d975-0f97-4521-afa1-cd531e421b8d";
+
+/// Root verity partition for 32-bit ARM
+pub const ROOT_VERITY_ARM: &str = "7386cdf2-203c-47a9-a498-f2ecce45a2d6";
+
+/// Root verity partition for 64-bit ARM/AArch64
+pub const ROOT_VERITY_ARM64: &str = "df3300ce-d69f-4c92-978c-9bfb0f38d820";
+
+/// Root verity partition for Itanium/IA-64
+pub const ROOT_VERITY_IA64: &str = "86ed10d5-b607-45bb-8957-d350f23d0571";
+
+/// Root verity partition for 64-bit LoongArch
+pub const ROOT_VERITY_LOONGARCH64: &str = "f3393b22-e9af-4613-a948-9d3bfbd0c535";
+
+/// Root verity partition for 32-bit MIPS Big Endian
+pub const ROOT_VERITY_MIPS: &str = "7a430799-f711-4c7e-8e5b-1d685bd48607";
+
+/// Root verity partition for 64-bit MIPS Big Endian
+pub const ROOT_VERITY_MIPS64: &str = "579536f8-6a33-4055-a95a-df2d5e2c42a8";
+
+/// Root verity partition for 32-bit MIPS Little Endian
+pub const ROOT_VERITY_MIPS_LE: &str = "d7d150d2-2a04-4a33-8f12-16651205ff7b";
+
+/// Root verity partition for 64-bit MIPS Little Endian
+pub const ROOT_VERITY_MIPS64_LE: &str = "16b417f8-3e06-4f57-8dd2-9b5232f41aa6";
+
+/// Root verity partition for PA-RISC
+pub const ROOT_VERITY_PARISC: &str = "d212a430-fbc5-49f9-a983-a7feef2b8d0e";
+
+/// Root verity partition for 32-bit PowerPC
+pub const ROOT_VERITY_PPC: &str = "98cfe649-1588-46dc-b2f0-add147424925";
+
+/// Root verity partition for 64-bit PowerPC Big Endian
+pub const ROOT_VERITY_PPC64: &str = "9225a9a3-3c19-4d89-b4f6-eeff88f17631";
+
+/// Root verity partition for 64-bit PowerPC Little Endian
+pub const ROOT_VERITY_PPC64_LE: &str = "906bd944-4589-4aae-a4e4-dd983917446a";
+
+/// Root verity partition for 32-bit RISC-V
+pub const ROOT_VERITY_RISCV32: &str = "ae0253be-1167-4007-ac68-43926c14c5de";
+
+/// Root verity partition for 64-bit RISC-V
+pub const ROOT_VERITY_RISCV64: &str = "b6ed5582-440b-4209-b8da-5ff7c419ea3d";
+
+/// Root verity partition for s390
+pub const ROOT_VERITY_S390: &str = "7ac63b47-b25c-463b-8df8-b4a94e6c90e1";
+
+/// Root verity partition for s390x
+pub const ROOT_VERITY_S390X: &str = "b325bfbe-c7be-4ab8-8357-139e652d2f6b";
+
+/// Root verity partition for TILE-Gx
+pub const ROOT_VERITY_TILEGX: &str = "966061ec-28e4-4b2e-b4a5-1f0a825a1d84";
+
+/// Root verity partition for 32-bit x86
+pub const ROOT_VERITY_X86: &str = "d13c5d3b-b5d1-422a-b29f-9454fdc89d76";
+
+/// Root verity partition for 64-bit x86/AMD64
+pub const ROOT_VERITY_X86_64: &str = "2c7357ed-ebd2-46d9-aec1-23d437ec2bf5";
+
+// ============================================================================
+// USR VERITY PARTITIONS
+// ============================================================================
+
+/// /usr verity partition for Alpha
+pub const USR_VERITY_ALPHA: &str = "8cce0d25-c0d0-4a44-bd87-46331bf1df67";
+
+/// /usr verity partition for ARC
+pub const USR_VERITY_ARC: &str = "fca0598c-d880-4591-8c16-4eda05c7347c";
+
+/// /usr verity partition for 32-bit ARM
+pub const USR_VERITY_ARM: &str = "c215d751-7bcd-4649-be90-6627490a4c05";
+
+/// /usr verity partition for 64-bit ARM/AArch64
+pub const USR_VERITY_ARM64: &str = "6e11a4e7-fbca-4ded-b9e9-e1a512bb664e";
+
+/// /usr verity partition for Itanium/IA-64
+pub const USR_VERITY_IA64: &str = "6a491e03-3be7-4545-8e38-83320e0ea880";
+
+/// /usr verity partition for 64-bit LoongArch
+pub const USR_VERITY_LOONGARCH64: &str = "f46b2c26-59ae-48f0-9106-c50ed47f673d";
+
+/// /usr verity partition for 32-bit MIPS Big Endian
+pub const USR_VERITY_MIPS: &str = "6e5a1bc8-d223-49b7-bca8-37a5fcceb996";
+
+/// /usr verity partition for 64-bit MIPS Big Endian
+pub const USR_VERITY_MIPS64: &str = "81cf9d90-7458-4df4-8dcf-c8a3a404f09b";
+
+/// /usr verity partition for 32-bit MIPS Little Endian
+pub const USR_VERITY_MIPS_LE: &str = "46b98d8d-b55c-4e8f-aab3-37fca7f80752";
+
+/// /usr verity partition for 64-bit MIPS Little Endian
+pub const USR_VERITY_MIPS64_LE: &str = "3c3d61fe-b5f3-414d-bb71-8739a694a4ef";
+
+/// /usr verity partition for PA-RISC
+pub const USR_VERITY_PARISC: &str = "5843d618-ec37-48d7-9f12-cea8e08768b2";
+
+/// /usr verity partition for 32-bit PowerPC
+pub const USR_VERITY_PPC: &str = "df765d00-270e-49e5-bc75-f47bb2118b09";
+
+/// /usr verity partition for 64-bit PowerPC Big Endian
+pub const USR_VERITY_PPC64: &str = "bdb528a5-a259-475f-a87d-da53fa736a07";
+
+/// /usr verity partition for 64-bit PowerPC Little Endian
+pub const USR_VERITY_PPC64_LE: &str = "ee2b9983-21e8-4153-86d9-b6901a54d1ce";
+
+/// /usr verity partition for 32-bit RISC-V
+pub const USR_VERITY_RISCV32: &str = "cb1ee4e3-8cd0-4136-a0a4-aa61a32e8730";
+
+/// /usr verity partition for 64-bit RISC-V
+pub const USR_VERITY_RISCV64: &str = "8f1056be-9b05-47c4-81d6-be53128e5b54";
+
+/// /usr verity partition for s390
+pub const USR_VERITY_S390: &str = "b663c618-e7bc-4d6d-90aa-11b756bb1797";
+
+/// /usr verity partition for s390x
+pub const USR_VERITY_S390X: &str = "31741cc4-1a2a-4111-a581-e00b447d2d06";
+
+/// /usr verity partition for TILE-Gx
+pub const USR_VERITY_TILEGX: &str = "2fb4bf56-07fa-42da-8132-6b139f2026ae";
+
+/// /usr verity partition for 32-bit x86
+pub const USR_VERITY_X86: &str = "8f461b0d-14ee-4e81-9aa9-049b6fb97abd";
+
+/// /usr verity partition for 64-bit x86/AMD64
+pub const USR_VERITY_X86_64: &str = "77ff5f63-e7b6-4633-acf4-1565b864c0e6";
+
+// ============================================================================
+// ROOT VERITY SIGNATURE PARTITIONS
+// ============================================================================
+
+/// Root verity signature partition for Alpha
+pub const ROOT_VERITY_SIG_ALPHA: &str = "d46495b7-a053-414f-80f7-700c99921ef8";
+
+/// Root verity signature partition for ARC
+pub const ROOT_VERITY_SIG_ARC: &str = "143a70ba-cbd3-4f06-919f-6c05683a78bc";
+
+/// Root verity signature partition for 32-bit ARM
+pub const ROOT_VERITY_SIG_ARM: &str = "42b0455f-eb11-491d-98d3-56145ba9d037";
+
+/// Root verity signature partition for 64-bit ARM/AArch64
+pub const ROOT_VERITY_SIG_ARM64: &str = "6db69de6-29f4-4758-a7a5-962190f00ce3";
+
+/// Root verity signature partition for Itanium/IA-64
+pub const ROOT_VERITY_SIG_IA64: &str = "e98b36ee-32ba-4882-9b12-0ce14655f46a";
+
+/// Root verity signature partition for 64-bit LoongArch
+pub const ROOT_VERITY_SIG_LOONGARCH64: &str = "5afb67eb-ecc8-4f85-ae8e-ac1e7c50e7d0";
+
+/// Root verity signature partition for 32-bit MIPS Big Endian
+pub const ROOT_VERITY_SIG_MIPS: &str = "bba210a2-9c5d-45ee-9e87-ff2ccbd002d0";
+
+/// Root verity signature partition for 64-bit MIPS Big Endian
+pub const ROOT_VERITY_SIG_MIPS64: &str = "43ce94d4-0f3d-4999-8250-b9deafd98e6e";
+
+/// Root verity signature partition for 32-bit MIPS Little Endian
+pub const ROOT_VERITY_SIG_MIPS_LE: &str = "c919cc1f-4456-4eff-918c-f75e94525ca5";
+
+/// Root verity signature partition for 64-bit MIPS Little Endian
+pub const ROOT_VERITY_SIG_MIPS64_LE: &str = "904e58ef-5c65-4a31-9c57-6af5fc7c5de7";
+
+/// Root verity signature partition for PA-RISC
+pub const ROOT_VERITY_SIG_PARISC: &str = "15de6170-65d3-431c-916e-b0dcd8393f25";
+
+/// Root verity signature partition for 32-bit PowerPC
+pub const ROOT_VERITY_SIG_PPC: &str = "1b31b5aa-add9-463a-b2ed-bd467fc857e7";
+
+/// Root verity signature partition for 64-bit PowerPC Big Endian
+pub const ROOT_VERITY_SIG_PPC64: &str = "f5e2c20c-45b2-4ffa-bce9-2a60737e1aaf";
+
+/// Root verity signature partition for 64-bit PowerPC Little Endian
+pub const ROOT_VERITY_SIG_PPC64_LE: &str = "d4a236e7-e873-4c07-bf1d-bf6cf7f1c3c6";
+
+/// Root verity signature partition for 32-bit RISC-V
+pub const ROOT_VERITY_SIG_RISCV32: &str = "3a112a75-8729-4380-b4cf-764d79934448";
+
+/// Root verity signature partition for 64-bit RISC-V
+pub const ROOT_VERITY_SIG_RISCV64: &str = "efe0f087-ea8d-4469-821a-4c2a96a8386a";
+
+/// Root verity signature partition for s390
+pub const ROOT_VERITY_SIG_S390: &str = "3482388e-4254-435a-a241-766a065f9960";
+
+/// Root verity signature partition for s390x
+pub const ROOT_VERITY_SIG_S390X: &str = "c80187a5-73a3-491a-901a-017c3fa953e9";
+
+/// Root verity signature partition for TILE-Gx
+pub const ROOT_VERITY_SIG_TILEGX: &str = "b3671439-97b0-4a53-90f7-2d5a8f3ad47b";
+
+/// Root verity signature partition for 32-bit x86
+pub const ROOT_VERITY_SIG_X86: &str = "5996fc05-109c-48de-808b-23fa0830b676";
+
+/// Root verity signature partition for 64-bit x86/AMD64
+pub const ROOT_VERITY_SIG_X86_64: &str = "41092b05-9fc8-4523-994f-2def0408b176";
+
+// ============================================================================
+// USR VERITY SIGNATURE PARTITIONS
+// ============================================================================
+
+/// /usr verity signature partition for Alpha
+pub const USR_VERITY_SIG_ALPHA: &str = "5c6e1c76-076a-457a-a0fe-f3b4cd21ce6e";
+
+/// /usr verity signature partition for ARC
+pub const USR_VERITY_SIG_ARC: &str = "94f9a9a1-9971-427a-a400-50cb297f0f35";
+
+/// /usr verity signature partition for 32-bit ARM
+pub const USR_VERITY_SIG_ARM: &str = "d7ff812f-37d1-4902-a810-d76ba57b975a";
+
+/// /usr verity signature partition for 64-bit ARM/AArch64
+pub const USR_VERITY_SIG_ARM64: &str = "c23ce4ff-44bd-4b00-b2d4-b41b3419e02a";
+
+/// /usr verity signature partition for Itanium/IA-64
+pub const USR_VERITY_SIG_IA64: &str = "8de58bc2-2a43-460d-b14e-a76e4a17b47f";
+
+/// /usr verity signature partition for 64-bit LoongArch
+pub const USR_VERITY_SIG_LOONGARCH64: &str = "b024f315-d330-444c-8461-44bbde524e99";
+
+/// /usr verity signature partition for 32-bit MIPS Big Endian
+pub const USR_VERITY_SIG_MIPS: &str = "97ae158d-f216-497b-8057-f7f905770f54";
+
+/// /usr verity signature partition for 64-bit MIPS Big Endian
+pub const USR_VERITY_SIG_MIPS64: &str = "05816ce2-dd40-4ac6-a61d-37d32dc1ba7d";
+
+/// /usr verity signature partition for 32-bit MIPS Little Endian
+pub const USR_VERITY_SIG_MIPS_LE: &str = "3e23ca0b-a4bc-4b4e-8087-5ab6a26aa8a9";
+
+/// /usr verity signature partition for 64-bit MIPS Little Endian
+pub const USR_VERITY_SIG_MIPS64_LE: &str = "f2c2c7ee-adcc-4351-b5c6-ee9816b66e16";
+
+/// /usr verity signature partition for PA-RISC
+pub const USR_VERITY_SIG_PARISC: &str = "450dd7d1-3224-45ec-9cf2-a43a346d71ee";
+
+/// /usr verity signature partition for 32-bit PowerPC
+pub const USR_VERITY_SIG_PPC: &str = "7007891d-d371-4a80-86a4-5cb875b9302e";
+
+/// /usr verity signature partition for 64-bit PowerPC Big Endian
+pub const USR_VERITY_SIG_PPC64: &str = "0b888863-d7f8-4d9e-9766-239fce4d58af";
+
+/// /usr verity signature partition for 64-bit PowerPC Little Endian
+pub const USR_VERITY_SIG_PPC64_LE: &str = "c8bfbd1e-268e-4521-8bba-bf314c399557";
+
+/// /usr verity signature partition for 32-bit RISC-V
+pub const USR_VERITY_SIG_RISCV32: &str = "c3836a13-3137-45ba-b583-b16c50fe5eb4";
+
+/// /usr verity signature partition for 64-bit RISC-V
+pub const USR_VERITY_SIG_RISCV64: &str = "d2f9000a-7a18-453f-b5cd-4d32f77a7b32";
+
+/// /usr verity signature partition for s390
+pub const USR_VERITY_SIG_S390: &str = "17440e4f-a8d0-467f-a46e-3912ae6ef2c5";
+
+/// /usr verity signature partition for s390x
+pub const USR_VERITY_SIG_S390X: &str = "3f324816-667b-46ae-86ee-9b0c0c6c11b4";
+
+/// /usr verity signature partition for TILE-Gx
+pub const USR_VERITY_SIG_TILEGX: &str = "4ede75e2-6ccc-4cc8-b9c7-70334b087510";
+
+/// /usr verity signature partition for 32-bit x86
+pub const USR_VERITY_SIG_X86: &str = "974a71c0-de41-43c3-be5d-5c5ccd1ad2c0";
+
+/// /usr verity signature partition for 64-bit x86/AMD64
+pub const USR_VERITY_SIG_X86_64: &str = "e7bb33fb-06cf-4e81-8273-e543b413e2e2";
+
+// ============================================================================
+// OTHER SPECIAL PARTITION TYPES
+// ============================================================================
+
+/// EFI System Partition (ESP) for UEFI boot
+pub const ESP: &str = "c12a7328-f81f-11d2-ba4b-00a0c93ec93b";
+
+/// Extended Boot Loader Partition
+pub const XBOOTLDR: &str = "bc13c2ff-59e6-4262-a352-b275fd6f7172";
+
+/// Swap partition
+pub const SWAP: &str = "0657fd6d-a4ab-43c4-84e5-0933c84b4f4f";
+
+/// Home partition (/home)
+pub const HOME: &str = "933ac7e1-2eb4-4f13-b844-0e14e2aef915";
+
+/// Server data partition (/srv)
+pub const SRV: &str = "3b8f8425-20e0-4f3b-907f-1a25a76f98e8";
+
+/// Variable data partition (/var)
+pub const VAR: &str = "4d21b016-b534-45c2-a9fb-5c16e091fd2d";
+
+/// Temporary data partition (/var/tmp)
+pub const TMP: &str = "7ec6f557-3bc5-4aca-b293-16ef5df639d1";
+
+/// Generic Linux filesystem data partition
+pub const LINUX_DATA: &str = "0fc63daf-8483-4772-8e79-3d69d8477de4";
+
+// ============================================================================
+// ARCHITECTURE-SPECIFIC HELPERS
+// ============================================================================
+
+/// Returns the root partition GUID for the current architecture.
+///
+/// This is a compile-time constant function that selects the appropriate
+/// root partition type GUID based on the target architecture and endianness.
+pub const fn this_arch_root() -> &'static str {
+ cfg_if::cfg_if! {
+ if #[cfg(target_arch = "x86_64")] {
+ ROOT_X86_64
+ } else if #[cfg(target_arch = "aarch64")] {
+ ROOT_ARM64
+ } else if #[cfg(target_arch = "s390x")] {
+ ROOT_S390X
+ } else if #[cfg(all(target_arch = "powerpc64", target_endian = "big"))] {
+ ROOT_PPC64
+ } else if #[cfg(all(target_arch = "powerpc64", target_endian = "little"))] {
+ ROOT_PPC64_LE
+ } else {
+ compile_error!("Unsupported architecture")
+ }
+ }
+}
+
+#[cfg(test)]
+mod test {
+ use super::*;
+
+ #[test]
+ #[ignore = "Only run manually to validate against upstream spec"]
+ fn test_uuids_against_spec() {
+ // This test validates our partition type UUIDs against the upstream
+ // Discoverable Partitions Specification. The spec is committed to the
+ // repo at fixtures/discoverable_partitions_specification.md
+ //
+ // Spec source: https://github.com/uapi-group/specifications/blob/6f3a5dd31009456561eaa9f6fcfe7769ab97eb50/specs/discoverable_partitions_specification.md
+
+ let spec_content = include_str!("fixtures/discoverable_partitions_specification.md");
+
+ // Parse the markdown tables and extract partition name -> UUID mappings
+ let mut spec_uuids: std::collections::HashMap<&str, &str> =
+ std::collections::HashMap::new();
+
+ // Regex to match table rows with partition type UUIDs
+ // Format: | _Name_ | `uuid` ... | ... | ... |
+ let re = regex::Regex::new(
+ r"(?m)^\|\s*_(.+?)_\s*\|\s*`([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})`"
+ )
+ .unwrap();
+
+ for cap in re.captures_iter(&spec_content) {
+ let name = cap.get(1).unwrap().as_str();
+ let uuid = cap.get(2).unwrap().as_str();
+ spec_uuids.insert(name, uuid);
+ }
+
+ // Verify we parsed a reasonable number of entries
+ assert!(
+ spec_uuids.len() > 100,
+ "Expected to parse over 100 UUIDs, got {}",
+ spec_uuids.len()
+ );
+
+ // Now cross-reference our constants against the spec
+ macro_rules! check_uuid {
+ ($name:expr, $const_val:expr) => {
+ if let Some(&spec_uuid) = spec_uuids.get($name) {
+ assert_eq!(
+ $const_val, spec_uuid,
+ "UUID mismatch for {}: our value '{}' != spec value '{}'",
+ $name, $const_val, spec_uuid
+ );
+ } else {
+ panic!("No spec entry found for {}", $name);
+ }
+ };
+ }
+
+ // Root Partitions
+ check_uuid!("Root Partition (Alpha)", ROOT_ALPHA);
+ check_uuid!("Root Partition (ARC)", ROOT_ARC);
+ check_uuid!("Root Partition (32-bit ARM)", ROOT_ARM);
+ check_uuid!("Root Partition (64-bit ARM/AArch64)", ROOT_ARM64);
+ check_uuid!("Root Partition (Itanium/IA-64)", ROOT_IA64);
+ check_uuid!("Root Partition (LoongArch 64-bit)", ROOT_LOONGARCH64);
+ check_uuid!(
+ "Root Partition (32-bit MIPS LittleEndian (mipsel))",
+ ROOT_MIPS_LE
+ );
+ check_uuid!(
+ "Root Partition (64-bit MIPS LittleEndian (mips64el))",
+ ROOT_MIPS64_LE
+ );
+ check_uuid!("Root Partition (32-bit MIPS BigEndian (mips))", ROOT_MIPS);
+ check_uuid!(
+ "Root Partition (64-bit MIPS BigEndian (mips64))",
+ ROOT_MIPS64
+ );
+ check_uuid!("Root Partition (HPPA/PARISC)", ROOT_PARISC);
+ check_uuid!("Root Partition (32-bit PowerPC)", ROOT_PPC);
+ check_uuid!("Root Partition (64-bit PowerPC BigEndian)", ROOT_PPC64);
+ check_uuid!(
+ "Root Partition (64-bit PowerPC LittleEndian)",
+ ROOT_PPC64_LE
+ );
+ check_uuid!("Root Partition (RISC-V 32-bit)", ROOT_RISCV32);
+ check_uuid!("Root Partition (RISC-V 64-bit)", ROOT_RISCV64);
+ check_uuid!("Root Partition (s390)", ROOT_S390);
+ check_uuid!("Root Partition (s390x)", ROOT_S390X);
+ check_uuid!("Root Partition (TILE-Gx)", ROOT_TILEGX);
+ check_uuid!("Root Partition (x86)", ROOT_X86);
+ check_uuid!("Root Partition (amd64/x86_64)", ROOT_X86_64);
+
+ // USR Partitions
+ check_uuid!("`/usr/` Partition (Alpha)", USR_ALPHA);
+ check_uuid!("`/usr/` Partition (ARC)", USR_ARC);
+ check_uuid!("`/usr/` Partition (32-bit ARM)", USR_ARM);
+ check_uuid!("`/usr/` Partition (64-bit ARM/AArch64)", USR_ARM64);
+ check_uuid!("`/usr/` Partition (Itanium/IA-64)", USR_IA64);
+ check_uuid!("`/usr/` Partition (LoongArch 64-bit)", USR_LOONGARCH64);
+ check_uuid!("`/usr/` Partition (32-bit MIPS BigEndian (mips))", USR_MIPS);
+ check_uuid!(
+ "`/usr/` Partition (64-bit MIPS BigEndian (mips64))",
+ USR_MIPS64
+ );
+ check_uuid!(
+ "`/usr/` Partition (32-bit MIPS LittleEndian (mipsel))",
+ USR_MIPS_LE
+ );
+ check_uuid!(
+ "`/usr/` Partition (64-bit MIPS LittleEndian (mips64el))",
+ USR_MIPS64_LE
+ );
+ check_uuid!("`/usr/` Partition (HPPA/PARISC)", USR_PARISC);
+ check_uuid!("`/usr/` Partition (32-bit PowerPC)", USR_PPC);
+ check_uuid!("`/usr/` Partition (64-bit PowerPC BigEndian)", USR_PPC64);
+ check_uuid!(
+ "`/usr/` Partition (64-bit PowerPC LittleEndian)",
+ USR_PPC64_LE
+ );
+ check_uuid!("`/usr/` Partition (RISC-V 32-bit)", USR_RISCV32);
+ check_uuid!("`/usr/` Partition (RISC-V 64-bit)", USR_RISCV64);
+ check_uuid!("`/usr/` Partition (s390)", USR_S390);
+ check_uuid!("`/usr/` Partition (s390x)", USR_S390X);
+ check_uuid!("`/usr/` Partition (TILE-Gx)", USR_TILEGX);
+ check_uuid!("`/usr/` Partition (x86)", USR_X86);
+ check_uuid!("`/usr/` Partition (amd64/x86_64)", USR_X86_64);
+
+ // Root Verity Partitions
+ check_uuid!("Root Verity Partition (Alpha)", ROOT_VERITY_ALPHA);
+ check_uuid!("Root Verity Partition (ARC)", ROOT_VERITY_ARC);
+ check_uuid!("Root Verity Partition (32-bit ARM)", ROOT_VERITY_ARM);
+ check_uuid!(
+ "Root Verity Partition (64-bit ARM/AArch64)",
+ ROOT_VERITY_ARM64
+ );
+ check_uuid!("Root Verity Partition (Itanium/IA-64)", ROOT_VERITY_IA64);
+ check_uuid!(
+ "Root Verity Partition (LoongArch 64-bit)",
+ ROOT_VERITY_LOONGARCH64
+ );
+ check_uuid!(
+ "Root Verity Partition (32-bit MIPS BigEndian (mips))",
+ ROOT_VERITY_MIPS
+ );
+ check_uuid!(
+ "Root Verity Partition (64-bit MIPS BigEndian (mips64))",
+ ROOT_VERITY_MIPS64
+ );
+ check_uuid!(
+ "Root Verity Partition (32-bit MIPS LittleEndian (mipsel))",
+ ROOT_VERITY_MIPS_LE
+ );
+ check_uuid!(
+ "Root Verity Partition (64-bit MIPS LittleEndian (mips64el))",
+ ROOT_VERITY_MIPS64_LE
+ );
+ check_uuid!("Root Verity Partition (HPPA/PARISC)", ROOT_VERITY_PARISC);
+ check_uuid!("Root Verity Partition (32-bit PowerPC)", ROOT_VERITY_PPC);
+ check_uuid!(
+ "Root Verity Partition (64-bit PowerPC BigEndian)",
+ ROOT_VERITY_PPC64
+ );
+ check_uuid!(
+ "Root Verity Partition (64-bit PowerPC LittleEndian)",
+ ROOT_VERITY_PPC64_LE
+ );
+ check_uuid!("Root Verity Partition (RISC-V 32-bit)", ROOT_VERITY_RISCV32);
+ check_uuid!("Root Verity Partition (RISC-V 64-bit)", ROOT_VERITY_RISCV64);
+ check_uuid!("Root Verity Partition (s390)", ROOT_VERITY_S390);
+ check_uuid!("Root Verity Partition (s390x)", ROOT_VERITY_S390X);
+ check_uuid!("Root Verity Partition (TILE-Gx)", ROOT_VERITY_TILEGX);
+ check_uuid!("Root Verity Partition (x86)", ROOT_VERITY_X86);
+ check_uuid!("Root Verity Partition (amd64/x86_64)", ROOT_VERITY_X86_64);
+
+ // USR Verity Partitions
+ check_uuid!("`/usr/` Verity Partition (Alpha)", USR_VERITY_ALPHA);
+ check_uuid!("`/usr/` Verity Partition (ARC)", USR_VERITY_ARC);
+ check_uuid!("`/usr/` Verity Partition (32-bit ARM)", USR_VERITY_ARM);
+ check_uuid!(
+ "`/usr/` Verity Partition (64-bit ARM/AArch64)",
+ USR_VERITY_ARM64
+ );
+ check_uuid!("`/usr/` Verity Partition (Itanium/IA-64)", USR_VERITY_IA64);
+ check_uuid!(
+ "`/usr/` Verity Partition (LoongArch 64-bit)",
+ USR_VERITY_LOONGARCH64
+ );
+ check_uuid!(
+ "`/usr/` Verity Partition (32-bit MIPS BigEndian (mips))",
+ USR_VERITY_MIPS
+ );
+ check_uuid!(
+ "`/usr/` Verity Partition (64-bit MIPS BigEndian (mips64))",
+ USR_VERITY_MIPS64
+ );
+ check_uuid!(
+ "`/usr/` Verity Partition (32-bit MIPS LittleEndian (mipsel))",
+ USR_VERITY_MIPS_LE
+ );
+ check_uuid!(
+ "`/usr/` Verity Partition (64-bit MIPS LittleEndian (mips64el))",
+ USR_VERITY_MIPS64_LE
+ );
+ check_uuid!("`/usr/` Verity Partition (HPPA/PARISC)", USR_VERITY_PARISC);
+ check_uuid!("`/usr/` Verity Partition (32-bit PowerPC)", USR_VERITY_PPC);
+ check_uuid!(
+ "`/usr/` Verity Partition (64-bit PowerPC BigEndian)",
+ USR_VERITY_PPC64
+ );
+ check_uuid!(
+ "`/usr/` Verity Partition (64-bit PowerPC LittleEndian)",
+ USR_VERITY_PPC64_LE
+ );
+ check_uuid!(
+ "`/usr/` Verity Partition (RISC-V 32-bit)",
+ USR_VERITY_RISCV32
+ );
+ check_uuid!(
+ "`/usr/` Verity Partition (RISC-V 64-bit)",
+ USR_VERITY_RISCV64
+ );
+ check_uuid!("`/usr/` Verity Partition (s390)", USR_VERITY_S390);
+ check_uuid!("`/usr/` Verity Partition (s390x)", USR_VERITY_S390X);
+ check_uuid!("`/usr/` Verity Partition (TILE-Gx)", USR_VERITY_TILEGX);
+ check_uuid!("`/usr/` Verity Partition (x86)", USR_VERITY_X86);
+ check_uuid!("`/usr/` Verity Partition (amd64/x86_64)", USR_VERITY_X86_64);
+
+ // Root Verity Signature Partitions
+ check_uuid!(
+ "Root Verity Signature Partition (Alpha)",
+ ROOT_VERITY_SIG_ALPHA
+ );
+ check_uuid!("Root Verity Signature Partition (ARC)", ROOT_VERITY_SIG_ARC);
+ check_uuid!(
+ "Root Verity Signature Partition (32-bit ARM)",
+ ROOT_VERITY_SIG_ARM
+ );
+ check_uuid!(
+ "Root Verity Signature Partition (64-bit ARM/AArch64)",
+ ROOT_VERITY_SIG_ARM64
+ );
+ check_uuid!(
+ "Root Verity Signature Partition (Itanium/IA-64)",
+ ROOT_VERITY_SIG_IA64
+ );
+ check_uuid!(
+ "Root Verity Signature Partition (LoongArch 64-bit)",
+ ROOT_VERITY_SIG_LOONGARCH64
+ );
+ check_uuid!(
+ "Root Verity Signature Partition (32-bit MIPS BigEndian (mips))",
+ ROOT_VERITY_SIG_MIPS
+ );
+ check_uuid!(
+ "Root Verity Signature Partition (64-bit MIPS BigEndian (mips64))",
+ ROOT_VERITY_SIG_MIPS64
+ );
+ check_uuid!(
+ "Root Verity Signature Partition (32-bit MIPS LittleEndian (mipsel))",
+ ROOT_VERITY_SIG_MIPS_LE
+ );
+ check_uuid!(
+ "Root Verity Signature Partition (64-bit MIPS LittleEndian (mips64el))",
+ ROOT_VERITY_SIG_MIPS64_LE
+ );
+ check_uuid!(
+ "Root Verity Signature Partition (HPPA/PARISC)",
+ ROOT_VERITY_SIG_PARISC
+ );
+ check_uuid!(
+ "Root Verity Signature Partition (32-bit PowerPC)",
+ ROOT_VERITY_SIG_PPC
+ );
+ check_uuid!(
+ "Root Verity Signature Partition (64-bit PowerPC BigEndian)",
+ ROOT_VERITY_SIG_PPC64
+ );
+ check_uuid!(
+ "Root Verity Signature Partition (64-bit PowerPC LittleEndian)",
+ ROOT_VERITY_SIG_PPC64_LE
+ );
+ check_uuid!(
+ "Root Verity Signature Partition (RISC-V 32-bit)",
+ ROOT_VERITY_SIG_RISCV32
+ );
+ check_uuid!(
+ "Root Verity Signature Partition (RISC-V 64-bit)",
+ ROOT_VERITY_SIG_RISCV64
+ );
+ check_uuid!(
+ "Root Verity Signature Partition (s390)",
+ ROOT_VERITY_SIG_S390
+ );
+ check_uuid!(
+ "Root Verity Signature Partition (s390x)",
+ ROOT_VERITY_SIG_S390X
+ );
+ check_uuid!(
+ "Root Verity Signature Partition (TILE-Gx)",
+ ROOT_VERITY_SIG_TILEGX
+ );
+ check_uuid!("Root Verity Signature Partition (x86)", ROOT_VERITY_SIG_X86);
+ check_uuid!(
+ "Root Verity Signature Partition (amd64/x86_64)",
+ ROOT_VERITY_SIG_X86_64
+ );
+
+ // USR Verity Signature Partitions
+ check_uuid!(
+ "`/usr/` Verity Signature Partition (Alpha)",
+ USR_VERITY_SIG_ALPHA
+ );
+ check_uuid!(
+ "`/usr/` Verity Signature Partition (ARC)",
+ USR_VERITY_SIG_ARC
+ );
+ check_uuid!(
+ "`/usr/` Verity Signature Partition (32-bit ARM)",
+ USR_VERITY_SIG_ARM
+ );
+ check_uuid!(
+ "`/usr/` Verity Signature Partition (64-bit ARM/AArch64)",
+ USR_VERITY_SIG_ARM64
+ );
+ check_uuid!(
+ "`/usr/` Verity Signature Partition (Itanium/IA-64)",
+ USR_VERITY_SIG_IA64
+ );
+ check_uuid!(
+ "`/usr/` Verity Signature Partition (LoongArch 64-bit)",
+ USR_VERITY_SIG_LOONGARCH64
+ );
+ check_uuid!(
+ "`/usr/` Verity Signature Partition (32-bit MIPS BigEndian (mips))",
+ USR_VERITY_SIG_MIPS
+ );
+ check_uuid!(
+ "`/usr/` Verity Signature Partition (64-bit MIPS BigEndian (mips64))",
+ USR_VERITY_SIG_MIPS64
+ );
+ check_uuid!(
+ "`/usr/` Verity Signature Partition (32-bit MIPS LittleEndian (mipsel))",
+ USR_VERITY_SIG_MIPS_LE
+ );
+ check_uuid!(
+ "`/usr/` Verity Signature Partition (64-bit MIPS LittleEndian (mips64el))",
+ USR_VERITY_SIG_MIPS64_LE
+ );
+ check_uuid!(
+ "`/usr/` Verity Signature Partition (HPPA/PARISC)",
+ USR_VERITY_SIG_PARISC
+ );
+ check_uuid!(
+ "`/usr/` Verity Signature Partition (32-bit PowerPC)",
+ USR_VERITY_SIG_PPC
+ );
+ check_uuid!(
+ "`/usr/` Verity Signature Partition (64-bit PowerPC BigEndian)",
+ USR_VERITY_SIG_PPC64
+ );
+ check_uuid!(
+ "`/usr/` Verity Signature Partition (64-bit PowerPC LittleEndian)",
+ USR_VERITY_SIG_PPC64_LE
+ );
+ check_uuid!(
+ "`/usr/` Verity Signature Partition (RISC-V 32-bit)",
+ USR_VERITY_SIG_RISCV32
+ );
+ check_uuid!(
+ "`/usr/` Verity Signature Partition (RISC-V 64-bit)",
+ USR_VERITY_SIG_RISCV64
+ );
+ check_uuid!(
+ "`/usr/` Verity Signature Partition (s390)",
+ USR_VERITY_SIG_S390
+ );
+ check_uuid!(
+ "`/usr/` Verity Signature Partition (s390x)",
+ USR_VERITY_SIG_S390X
+ );
+ check_uuid!(
+ "`/usr/` Verity Signature Partition (TILE-Gx)",
+ USR_VERITY_SIG_TILEGX
+ );
+ check_uuid!(
+ "`/usr/` Verity Signature Partition (x86)",
+ USR_VERITY_SIG_X86
+ );
+ check_uuid!(
+ "`/usr/` Verity Signature Partition (amd64/x86_64)",
+ USR_VERITY_SIG_X86_64
+ );
+
+ // Other special partition types
+ check_uuid!("EFI System Partition", ESP);
+ check_uuid!("Extended Boot Loader Partition", XBOOTLDR);
+ check_uuid!("Swap", SWAP);
+ check_uuid!("Home Partition", HOME);
+ check_uuid!("Server Data Partition", SRV);
+ check_uuid!("Variable Data Partition", VAR);
+ check_uuid!("Temporary Data Partition", TMP);
+ check_uuid!("Generic Linux Data Partition", LINUX_DATA);
+ }
+}
diff --git a/crates/lib/src/fixtures/discoverable_partitions_specification.md b/crates/lib/src/fixtures/discoverable_partitions_specification.md
new file mode 100644
index 000000000..337b4acb5
--- /dev/null
+++ b/crates/lib/src/fixtures/discoverable_partitions_specification.md
@@ -0,0 +1,439 @@
+---
+title: Discoverable Partitions Specification
+category: Concepts
+layout: default
+version: 1
+SPDX-License-Identifier: CC-BY-4.0
+---
+# The Discoverable Partitions Specification (DPS)
+
+_TL;DR: Let's automatically discover, mount and enable the root partition,
+`/home/`, `/srv/`, `/var/` and `/var/tmp/` and the swap partitions based on
+GUID Partition Tables (GPT)!_
+
+This specification describes the use of GUID Partition Table (GPT) UUIDs to
+enable automatic discovery of partitions and their intended mountpoints.
+Traditionally Linux has made little use of partition types, mostly just
+defining one UUID for file system/data partitions and another one for swap
+partitions. With this specification, we introduce additional partition types
+for specific uses. This has many benefits:
+
+* OS installers can automatically discover and make sense of partitions of
+ existing Linux installations.
+* The OS can discover and mount the necessary file systems with a non-existent
+ or incomplete `/etc/fstab` file and without the `root=` kernel command line
+ option.
+* Container managers (such as nspawn and libvirt-lxc) can introspect and set up
+ file systems contained in GPT disk images automatically and mount them to the
+ right places, thus allowing booting the same, identical images on bare metal
+ and in Linux containers. This enables true, natural portability of disk
+ images between physical machines and Linux containers.
+* As a help to administrators and users partition manager tools can show more
+ descriptive information about partitions tables.
+
+Note that the OS side of this specification is currently implemented in
+[systemd](https://systemd.io/) 211 and newer in the
+[systemd-gpt-auto-generator(8)](https://www.freedesktop.org/software/systemd/man/systemd-gpt-auto-generator.html)
+generator tool. Note that automatic discovery of the root only works if the
+boot loader communicates this information to the OS, by implementing the
+[Boot Loader Interface](https://systemd.io/BOOT_LOADER_INTERFACE).
+
+## Defined Partition Type UUIDs
+
+| Name | Partition Type UUID | Allowed File Systems | Explanation |
+|------|---------------------|----------------------|-------------|
+| _Root Partition (Alpha)_ | `6523f8ae-3eb1-4e2a-a05a-18b695ae656f` `SD_GPT_ROOT_ALPHA` | Any native, optionally in LUKS | On systems with matching architecture, the first partition with this type UUID on the disk containing the active EFI ESP is automatically mounted to the root directory `/`. If the partition is encrypted with LUKS or has dm-verity integrity data (see below), the device mapper file will be named `/dev/mapper/root`. |
+| _Root Partition (ARC)_ | `d27f46ed-2919-4cb8-bd25-9531f3c16534` `SD_GPT_ROOT_ARC` | ditto | ditto |
+| _Root Partition (32-bit ARM)_ | `69dad710-2ce4-4e3c-b16c-21a1d49abed3` `SD_GPT_ROOT_ARM` | ditto | ditto |
+| _Root Partition (64-bit ARM/AArch64)_ | `b921b045-1df0-41c3-af44-4c6f280d3fae` `SD_GPT_ROOT_ARM64` | ditto | ditto |
+| _Root Partition (Itanium/IA-64)_ | `993d8d3d-f80e-4225-855a-9daf8ed7ea97` `SD_GPT_ROOT_IA64` | ditto | ditto |
+| _Root Partition (LoongArch 64-bit)_ | `77055800-792c-4f94-b39a-98c91b762bb6` `SD_GPT_ROOT_LOONGARCH64` | ditto | ditto |
+| _Root Partition (32-bit MIPS BigEndian (mips))_ | `e9434544-6e2c-47cc-bae2-12d6deafb44c` | ditto | ditto |
+| _Root Partition (64-bit MIPS BigEndian (mips64))_ | `d113af76-80ef-41b4-bdb6-0cff4d3d4a25` | ditto | ditto |
+| _Root Partition (32-bit MIPS LittleEndian (mipsel))_ | `37c58c8a-d913-4156-a25f-48b1b64e07f0` `SD_GPT_ROOT_MIPS_LE` | ditto | ditto |
+| _Root Partition (64-bit MIPS LittleEndian (mips64el))_ | `700bda43-7a34-4507-b179-eeb93d7a7ca3` `SD_GPT_ROOT_MIPS64_LE` | ditto | ditto |
+| _Root Partition (HPPA/PARISC)_ | `1aacdb3b-5444-4138-bd9e-e5c2239b2346` `SD_GPT_ROOT_PARISC` | ditto | ditto |
+| _Root Partition (32-bit PowerPC)_ | `1de3f1ef-fa98-47b5-8dcd-4a860a654d78` `SD_GPT_ROOT_PPC` | ditto | ditto |
+| _Root Partition (64-bit PowerPC BigEndian)_ | `912ade1d-a839-4913-8964-a10eee08fbd2` `SD_GPT_ROOT_PPC64` | ditto | ditto |
+| _Root Partition (64-bit PowerPC LittleEndian)_ | `c31c45e6-3f39-412e-80fb-4809c4980599` `SD_GPT_ROOT_PPC64_LE` | ditto | ditto |
+| _Root Partition (RISC-V 32-bit)_ | `60d5a7fe-8e7d-435c-b714-3dd8162144e1` `SD_GPT_ROOT_RISCV32` | ditto | ditto |
+| _Root Partition (RISC-V 64-bit)_ | `72ec70a6-cf74-40e6-bd49-4bda08e8f224` `SD_GPT_ROOT_RISCV64` | ditto | ditto |
+| _Root Partition (s390)_ | `08a7acea-624c-4a20-91e8-6e0fa67d23f9` `SD_GPT_ROOT_S390` | ditto | ditto |
+| _Root Partition (s390x)_ | `5eead9a9-fe09-4a1e-a1d7-520d00531306` `SD_GPT_ROOT_S390X` | ditto | ditto |
+| _Root Partition (TILE-Gx)_ | `c50cdd70-3862-4cc3-90e1-809a8c93ee2c` `SD_GPT_ROOT_TILEGX` | ditto | ditto |
+| _Root Partition (x86)_ | `44479540-f297-41b2-9af7-d131d5f0458a` `SD_GPT_ROOT_X86` | ditto | ditto |
+| _Root Partition (amd64/x86_64)_ | `4f68bce3-e8cd-4db1-96e7-fbcaf984b709` `SD_GPT_ROOT_X86_64` | ditto | ditto |
+| _`/usr/` Partition (Alpha)_ | `e18cf08c-33ec-4c0d-8246-c6c6fb3da024` `SD_GPT_USR_ALPHA` | Any native, optionally in LUKS | Similar semantics to root partition, but just the `/usr/` partition. |
+| _`/usr/` Partition (ARC)_ | `7978a683-6316-4922-bbee-38bff5a2fecc` `SD_GPT_USR_ARC` | ditto | ditto |
+| _`/usr/` Partition (32-bit ARM)_ | `7d0359a3-02b3-4f0a-865c-654403e70625` `SD_GPT_USR_ARM` | ditto | ditto |
+| _`/usr/` Partition (64-bit ARM/AArch64)_ | `b0e01050-ee5f-4390-949a-9101b17104e9` `SD_GPT_USR_ARM64` | ditto | ditto |
+| _`/usr/` Partition (Itanium/IA-64)_ | `4301d2a6-4e3b-4b2a-bb94-9e0b2c4225ea` `SD_GPT_USR_IA64` | ditto | ditto |
+| _`/usr/` Partition (LoongArch 64-bit)_ | `e611c702-575c-4cbe-9a46-434fa0bf7e3f` `SD_GPT_USR_LOONGARCH64` | ditto | ditto |
+| _`/usr/` Partition (32-bit MIPS BigEndian (mips))_ | `773b2abc-2a99-4398-8bf5-03baac40d02b` | ditto | ditto |
+| _`/usr/` Partition (64-bit MIPS BigEndian (mips64))_ | `57e13958-7331-4365-8e6e-35eeee17c61b` | ditto | ditto |
+| _`/usr/` Partition (32-bit MIPS LittleEndian (mipsel))_ | `0f4868e9-9952-4706-979f-3ed3a473e947` `SD_GPT_USR_MIPS_LE` | ditto | ditto |
+| _`/usr/` Partition (64-bit MIPS LittleEndian (mips64el))_ | `c97c1f32-ba06-40b4-9f22-236061b08aa8` `SD_GPT_USR_MIPS64_LE` | ditto | ditto |
+| _`/usr/` Partition (HPPA/PARISC)_ | `dc4a4480-6917-4262-a4ec-db9384949f25` `SD_GPT_USR_PARISC` | ditto | ditto |
+| _`/usr/` Partition (32-bit PowerPC)_ | `7d14fec5-cc71-415d-9d6c-06bf0b3c3eaf` `SD_GPT_USR_PPC` | ditto | ditto |
+| _`/usr/` Partition (64-bit PowerPC BigEndian)_ | `2c9739e2-f068-46b3-9fd0-01c5a9afbcca` `SD_GPT_USR_PPC64` | ditto | ditto |
+| _`/usr/` Partition (64-bit PowerPC LittleEndian)_ | `15bb03af-77e7-4d4a-b12b-c0d084f7491c` `SD_GPT_USR_PPC64_LE` | ditto | ditto |
+| _`/usr/` Partition (RISC-V 32-bit)_ | `b933fb22-5c3f-4f91-af90-e2bb0fa50702` `SD_GPT_USR_RISCV32` | ditto | ditto |
+| _`/usr/` Partition (RISC-V 64-bit)_ | `beaec34b-8442-439b-a40b-984381ed097d` `SD_GPT_USR_RISCV64` | ditto | ditto |
+| _`/usr/` Partition (s390)_ | `cd0f869b-d0fb-4ca0-b141-9ea87cc78d66` `SD_GPT_USR_S390` | ditto | ditto |
+| _`/usr/` Partition (s390x)_ | `8a4f5770-50aa-4ed3-874a-99b710db6fea` `SD_GPT_USR_S390X` | ditto | ditto |
+| _`/usr/` Partition (TILE-Gx)_ | `55497029-c7c1-44cc-aa39-815ed1558630` `SD_GPT_USR_TILEGX` | ditto | ditto |
+| _`/usr/` Partition (x86)_ | `75250d76-8cc6-458e-bd66-bd47cc81a812` `SD_GPT_USR_X86` | ditto | ditto |
+| _`/usr/` Partition (amd64/x86_64)_ | `8484680c-9521-48c6-9c11-b0720656f69e` `SD_GPT_USR_X86_64` | ditto | ditto |
+| _Root Verity Partition (Alpha)_ | `fc56d9e9-e6e5-4c06-be32-e74407ce09a5` `SD_GPT_ROOT_ALPHA_VERITY` | A dm-verity superblock followed by hash data | Contains dm-verity integrity hash data for the matching root partition. If this feature is used the partition UUID of the root partition should be the first 128 bits of the root hash of the dm-verity hash data, and the partition UUID of this dm-verity partition should be the final 128 bits of it, so that the root partition and its Verity partition can be discovered easily, simply by specifying the root hash. |
+| _Root Verity Partition (ARC)_ | `24b2d975-0f97-4521-afa1-cd531e421b8d` `SD_GPT_ROOT_ARC_VERITY` | ditto | ditto |
+| _Root Verity Partition (32-bit ARM)_ | `7386cdf2-203c-47a9-a498-f2ecce45a2d6` `SD_GPT_ROOT_ARM_VERITY` | ditto | ditto |
+| _Root Verity Partition (64-bit ARM/AArch64)_ | `df3300ce-d69f-4c92-978c-9bfb0f38d820` `SD_GPT_ROOT_ARM64_VERITY` | ditto | ditto |
+| _Root Verity Partition (Itanium/IA-64)_ | `86ed10d5-b607-45bb-8957-d350f23d0571` `SD_GPT_ROOT_IA64_VERITY` | ditto | ditto |
+| _Root Verity Partition (LoongArch 64-bit)_ | `f3393b22-e9af-4613-a948-9d3bfbd0c535` `SD_GPT_ROOT_LOONGARCH64_VERITY` | ditto | ditto |
+| _Root Verity Partition (32-bit MIPS BigEndian (mips))_ | `7a430799-f711-4c7e-8e5b-1d685bd48607` | ditto | ditto |
+| _Root Verity Partition (64-bit MIPS BigEndian (mips64))_ | `579536f8-6a33-4055-a95a-df2d5e2c42a8` | ditto | ditto |
+| _Root Verity Partition (32-bit MIPS LittleEndian (mipsel))_ | `d7d150d2-2a04-4a33-8f12-16651205ff7b` `SD_GPT_ROOT_MIPS_LE_VERITY` | ditto | ditto |
+| _Root Verity Partition (64-bit MIPS LittleEndian (mips64el))_ | `16b417f8-3e06-4f57-8dd2-9b5232f41aa6` `SD_GPT_ROOT_MIPS64_LE_VERITY` | ditto | ditto |
+| _Root Verity Partition (HPPA/PARISC)_ | `d212a430-fbc5-49f9-a983-a7feef2b8d0e` `SD_GPT_ROOT_PARISC_VERITY` | ditto | ditto |
+| _Root Verity Partition (64-bit PowerPC LittleEndian)_ | `906bd944-4589-4aae-a4e4-dd983917446a` `SD_GPT_ROOT_PPC64_LE_VERITY` | ditto | ditto |
+| _Root Verity Partition (64-bit PowerPC BigEndian)_ | `9225a9a3-3c19-4d89-b4f6-eeff88f17631` `SD_GPT_ROOT_PPC64_VERITY` | ditto | ditto |
+| _Root Verity Partition (32-bit PowerPC)_ | `98cfe649-1588-46dc-b2f0-add147424925` `SD_GPT_ROOT_PPC_VERITY` | ditto | ditto |
+| _Root Verity Partition (RISC-V 32-bit)_ | `ae0253be-1167-4007-ac68-43926c14c5de` `SD_GPT_ROOT_RISCV32_VERITY` | ditto | ditto |
+| _Root Verity Partition (RISC-V 64-bit)_ | `b6ed5582-440b-4209-b8da-5ff7c419ea3d` `SD_GPT_ROOT_RISCV64_VERITY` | ditto | ditto |
+| _Root Verity Partition (s390)_ | `7ac63b47-b25c-463b-8df8-b4a94e6c90e1` `SD_GPT_ROOT_S390_VERITY` | ditto | ditto |
+| _Root Verity Partition (s390x)_ | `b325bfbe-c7be-4ab8-8357-139e652d2f6b` `SD_GPT_ROOT_S390X_VERITY` | ditto | ditto |
+| _Root Verity Partition (TILE-Gx)_ | `966061ec-28e4-4b2e-b4a5-1f0a825a1d84` `SD_GPT_ROOT_TILEGX_VERITY` | ditto | ditto |
+| _Root Verity Partition (amd64/x86_64)_ | `2c7357ed-ebd2-46d9-aec1-23d437ec2bf5` `SD_GPT_ROOT_X86_64_VERITY` | ditto | ditto |
+| _Root Verity Partition (x86)_ | `d13c5d3b-b5d1-422a-b29f-9454fdc89d76` `SD_GPT_ROOT_X86_VERITY` | ditto | ditto |
+| _`/usr/` Verity Partition (Alpha)_ | `8cce0d25-c0d0-4a44-bd87-46331bf1df67` `SD_GPT_USR_ALPHA_VERITY` | A dm-verity superblock followed by hash data | Similar semantics to root Verity partition, but just for the `/usr/` partition. |
+| _`/usr/` Verity Partition (ARC)_ | `fca0598c-d880-4591-8c16-4eda05c7347c` `SD_GPT_USR_ARC_VERITY` | ditto | ditto |
+| _`/usr/` Verity Partition (32-bit ARM)_ | `c215d751-7bcd-4649-be90-6627490a4c05` `SD_GPT_USR_ARM_VERITY` | ditto | ditto |
+| _`/usr/` Verity Partition (64-bit ARM/AArch64)_ | `6e11a4e7-fbca-4ded-b9e9-e1a512bb664e` `SD_GPT_USR_ARM64_VERITY` | ditto | ditto |
+| _`/usr/` Verity Partition (Itanium/IA-64)_ | `6a491e03-3be7-4545-8e38-83320e0ea880` `SD_GPT_USR_IA64_VERITY` | ditto | ditto |
+| _`/usr/` Verity Partition (LoongArch 64-bit)_ | `f46b2c26-59ae-48f0-9106-c50ed47f673d` `SD_GPT_USR_LOONGARCH64_VERITY` | ditto | ditto |
+| _`/usr/` Verity Partition (32-bit MIPS BigEndian (mips))_ | `6e5a1bc8-d223-49b7-bca8-37a5fcceb996` | ditto | ditto |
+| _`/usr/` Verity Partition (64-bit MIPS BigEndian (mips64))_ | `81cf9d90-7458-4df4-8dcf-c8a3a404f09b` | ditto | ditto |
+| _`/usr/` Verity Partition (32-bit MIPS LittleEndian (mipsel))_ | `46b98d8d-b55c-4e8f-aab3-37fca7f80752` `SD_GPT_USR_MIPS_LE_VERITY` | ditto | ditto |
+| _`/usr/` Verity Partition (64-bit MIPS LittleEndian (mips64el))_ | `3c3d61fe-b5f3-414d-bb71-8739a694a4ef` `SD_GPT_USR_MIPS64_LE_VERITY` | ditto | ditto |
+| _`/usr/` Verity Partition (HPPA/PARISC)_ | `5843d618-ec37-48d7-9f12-cea8e08768b2` `SD_GPT_USR_PARISC_VERITY` | ditto | ditto |
+| _`/usr/` Verity Partition (64-bit PowerPC LittleEndian)_ | `ee2b9983-21e8-4153-86d9-b6901a54d1ce` `SD_GPT_USR_PPC64_LE_VERITY` | ditto | ditto |
+| _`/usr/` Verity Partition (64-bit PowerPC BigEndian)_ | `bdb528a5-a259-475f-a87d-da53fa736a07` `SD_GPT_USR_PPC64_VERITY` | ditto | ditto |
+| _`/usr/` Verity Partition (32-bit PowerPC)_ | `df765d00-270e-49e5-bc75-f47bb2118b09` `SD_GPT_USR_PPC_VERITY` | ditto | ditto |
+| _`/usr/` Verity Partition (RISC-V 32-bit)_ | `cb1ee4e3-8cd0-4136-a0a4-aa61a32e8730` `SD_GPT_USR_RISCV32_VERITY` | ditto | ditto |
+| _`/usr/` Verity Partition (RISC-V 64-bit)_ | `8f1056be-9b05-47c4-81d6-be53128e5b54` `SD_GPT_USR_RISCV64_VERITY` | ditto | ditto |
+| _`/usr/` Verity Partition (s390)_ | `b663c618-e7bc-4d6d-90aa-11b756bb1797` `SD_GPT_USR_S390_VERITY` | ditto | ditto |
+| _`/usr/` Verity Partition (s390x)_ | `31741cc4-1a2a-4111-a581-e00b447d2d06` `SD_GPT_USR_S390X_VERITY` | ditto | ditto |
+| _`/usr/` Verity Partition (TILE-Gx)_ | `2fb4bf56-07fa-42da-8132-6b139f2026ae` `SD_GPT_USR_TILEGX_VERITY` | ditto | ditto |
+| _`/usr/` Verity Partition (amd64/x86_64)_ | `77ff5f63-e7b6-4633-acf4-1565b864c0e6` `SD_GPT_USR_X86_64_VERITY` | ditto | ditto |
+| _`/usr/` Verity Partition (x86)_ | `8f461b0d-14ee-4e81-9aa9-049b6fb97abd` `SD_GPT_USR_X86_VERITY` | ditto | ditto |
+| _Root Verity Signature Partition (Alpha)_ | `d46495b7-a053-414f-80f7-700c99921ef8` `SD_GPT_ROOT_ALPHA_VERITY_SIG` | A serialized JSON object, see below | Contains a root hash and a PKCS#7 signature for it, permitting signed dm-verity GPT images. |
+| _Root Verity Signature Partition (ARC)_ | `143a70ba-cbd3-4f06-919f-6c05683a78bc` `SD_GPT_ROOT_ARC_VERITY_SIG` | ditto | ditto |
+| _Root Verity Signature Partition (32-bit ARM)_ | `42b0455f-eb11-491d-98d3-56145ba9d037` `SD_GPT_ROOT_ARM_VERITY_SIG` | ditto | ditto |
+| _Root Verity Signature Partition (64-bit ARM/AArch64)_ | `6db69de6-29f4-4758-a7a5-962190f00ce3` `SD_GPT_ROOT_ARM64_VERITY_SIG` | ditto | ditto |
+| _Root Verity Signature Partition (Itanium/IA-64)_ | `e98b36ee-32ba-4882-9b12-0ce14655f46a` `SD_GPT_ROOT_IA64_VERITY_SIG` | ditto | ditto |
+| _Root Verity Signature Partition (LoongArch 64-bit)_ | `5afb67eb-ecc8-4f85-ae8e-ac1e7c50e7d0` `SD_GPT_ROOT_LOONGARCH64_VERITY_SIG` | ditto | ditto |
+| _Root Verity Signature Partition (32-bit MIPS BigEndian (mips))_ | `bba210a2-9c5d-45ee-9e87-ff2ccbd002d0` | ditto | ditto |
+| _Root Verity Signature Partition (64-bit MIPS BigEndian (mips64))_ | `43ce94d4-0f3d-4999-8250-b9deafd98e6e` | ditto | ditto |
+| _Root Verity Signature Partition (32-bit MIPS LittleEndian (mipsel))_ | `c919cc1f-4456-4eff-918c-f75e94525ca5` `SD_GPT_ROOT_MIPS_LE_VERITY_SIG` | ditto | ditto |
+| _Root Verity Signature Partition (64-bit MIPS LittleEndian (mips64el))_ | `904e58ef-5c65-4a31-9c57-6af5fc7c5de7` `SD_GPT_ROOT_MIPS64_LE_VERITY_SIG` | ditto | ditto |
+| _Root Verity Signature Partition (HPPA/PARISC)_ | `15de6170-65d3-431c-916e-b0dcd8393f25` `SD_GPT_ROOT_PARISC_VERITY_SIG` | ditto | ditto |
+| _Root Verity Signature Partition (64-bit PowerPC LittleEndian)_ | `d4a236e7-e873-4c07-bf1d-bf6cf7f1c3c6` `SD_GPT_ROOT_PPC64_LE_VERITY_SIG` | ditto | ditto |
+| _Root Verity Signature Partition (64-bit PowerPC BigEndian)_ | `f5e2c20c-45b2-4ffa-bce9-2a60737e1aaf` `SD_GPT_ROOT_PPC64_VERITY_SIG` | ditto | ditto |
+| _Root Verity Signature Partition (32-bit PowerPC)_ | `1b31b5aa-add9-463a-b2ed-bd467fc857e7` `SD_GPT_ROOT_PPC_VERITY_SIG` | ditto | ditto |
+| _Root Verity Signature Partition (RISC-V 32-bit)_ | `3a112a75-8729-4380-b4cf-764d79934448` `SD_GPT_ROOT_RISCV32_VERITY_SIG` | ditto | ditto |
+| _Root Verity Signature Partition (RISC-V 64-bit)_ | `efe0f087-ea8d-4469-821a-4c2a96a8386a` `SD_GPT_ROOT_RISCV64_VERITY_SIG` | ditto | ditto |
+| _Root Verity Signature Partition (s390)_ | `3482388e-4254-435a-a241-766a065f9960` `SD_GPT_ROOT_S390_VERITY_SIG` | ditto | ditto |
+| _Root Verity Signature Partition (s390x)_ | `c80187a5-73a3-491a-901a-017c3fa953e9` `SD_GPT_ROOT_S390X_VERITY_SIG` | ditto | ditto |
+| _Root Verity Signature Partition (TILE-Gx)_ | `b3671439-97b0-4a53-90f7-2d5a8f3ad47b` `SD_GPT_ROOT_TILEGX_VERITY_SIG` | ditto | ditto |
+| _Root Verity Signature Partition (amd64/x86_64)_ | `41092b05-9fc8-4523-994f-2def0408b176` `SD_GPT_ROOT_X86_64_VERITY_SIG` | ditto | ditto |
+| _Root Verity Signature Partition (x86)_ | `5996fc05-109c-48de-808b-23fa0830b676` `SD_GPT_ROOT_X86_VERITY_SIG` | ditto | ditto |
+| _`/usr/` Verity Signature Partition (Alpha)_ | `5c6e1c76-076a-457a-a0fe-f3b4cd21ce6e` `SD_GPT_USR_ALPHA_VERITY_SIG` | A serialized JSON object, see below | Similar semantics to root Verity signature partition, but just for the `/usr/` partition. |
+| _`/usr/` Verity Signature Partition (ARC)_ | `94f9a9a1-9971-427a-a400-50cb297f0f35` `SD_GPT_USR_ARC_VERITY_SIG` | ditto | ditto |
+| _`/usr/` Verity Signature Partition (32-bit ARM)_ | `d7ff812f-37d1-4902-a810-d76ba57b975a` `SD_GPT_USR_ARM_VERITY_SIG` | ditto | ditto |
+| _`/usr/` Verity Signature Partition (64-bit ARM/AArch64)_ | `c23ce4ff-44bd-4b00-b2d4-b41b3419e02a` `SD_GPT_USR_ARM64_VERITY_SIG` | ditto | ditto |
+| _`/usr/` Verity Signature Partition (Itanium/IA-64)_ | `8de58bc2-2a43-460d-b14e-a76e4a17b47f` `SD_GPT_USR_IA64_VERITY_SIG` | ditto | ditto |
+| _`/usr/` Verity Signature Partition (LoongArch 64-bit)_ | `b024f315-d330-444c-8461-44bbde524e99` `SD_GPT_USR_LOONGARCH64_VERITY_SIG` | ditto | ditto |
+| _`/usr/` Verity Signature Partition (32-bit MIPS BigEndian (mips))_ | `97ae158d-f216-497b-8057-f7f905770f54` | ditto | ditto |
+| _`/usr/` Verity Signature Partition (64-bit MIPS BigEndian (mips64))_ | `05816ce2-dd40-4ac6-a61d-37d32dc1ba7d` | ditto | ditto |
+| _`/usr/` Verity Signature Partition (32-bit MIPS LittleEndian (mipsel))_ | `3e23ca0b-a4bc-4b4e-8087-5ab6a26aa8a9` `SD_GPT_USR_MIPS_LE_VERITY_SIG` | ditto | ditto |
+| _`/usr/` Verity Signature Partition (64-bit MIPS LittleEndian (mips64el))_ | `f2c2c7ee-adcc-4351-b5c6-ee9816b66e16` `SD_GPT_USR_MIPS64_LE_VERITY_SIG` | ditto | ditto |
+| _`/usr/` Verity Signature Partition (HPPA/PARISC)_ | `450dd7d1-3224-45ec-9cf2-a43a346d71ee` `SD_GPT_USR_PARISC_VERITY_SIG` | ditto | ditto |
+| _`/usr/` Verity Signature Partition (64-bit PowerPC LittleEndian)_ | `c8bfbd1e-268e-4521-8bba-bf314c399557` `SD_GPT_USR_PPC64_LE_VERITY_SIG` | ditto | ditto |
+| _`/usr/` Verity Signature Partition (64-bit PowerPC BigEndian)_ | `0b888863-d7f8-4d9e-9766-239fce4d58af` `SD_GPT_USR_PPC64_VERITY_SIG` | ditto | ditto |
+| _`/usr/` Verity Signature Partition (32-bit PowerPC)_ | `7007891d-d371-4a80-86a4-5cb875b9302e` `SD_GPT_USR_PPC_VERITY_SIG` | ditto | ditto |
+| _`/usr/` Verity Signature Partition (RISC-V 32-bit)_ | `c3836a13-3137-45ba-b583-b16c50fe5eb4` `SD_GPT_USR_RISCV32_VERITY_SIG` | ditto | ditto |
+| _`/usr/` Verity Signature Partition (RISC-V 64-bit)_ | `d2f9000a-7a18-453f-b5cd-4d32f77a7b32` `SD_GPT_USR_RISCV64_VERITY_SIG` | ditto | ditto |
+| _`/usr/` Verity Signature Partition (s390)_ | `17440e4f-a8d0-467f-a46e-3912ae6ef2c5` `SD_GPT_USR_S390_VERITY_SIG` | ditto | ditto |
+| _`/usr/` Verity Signature Partition (s390x)_ | `3f324816-667b-46ae-86ee-9b0c0c6c11b4` `SD_GPT_USR_S390X_VERITY_SIG` | ditto | ditto |
+| _`/usr/` Verity Signature Partition (TILE-Gx)_ | `4ede75e2-6ccc-4cc8-b9c7-70334b087510` `SD_GPT_USR_TILEGX_VERITY_SIG` | ditto | ditto |
+| _`/usr/` Verity Signature Partition (amd64/x86_64)_ | `e7bb33fb-06cf-4e81-8273-e543b413e2e2` `SD_GPT_USR_X86_64_VERITY_SIG` | ditto | ditto |
+| _`/usr/` Verity Signature Partition (x86)_ | `974a71c0-de41-43c3-be5d-5c5ccd1ad2c0` `SD_GPT_USR_X86_VERITY_SIG` | ditto | ditto |
+| _EFI System Partition_ | `c12a7328-f81f-11d2-ba4b-00a0c93ec93b` `SD_GPT_ESP` | VFAT | The ESP used for the current boot is automatically mounted to `/boot/` or `/efi/`, unless a different partition is mounted there (possibly via `/etc/fstab`) or the mount point directory is non-empty on the root disk. If both ESP and XBOOTLDR exist, the `/efi/` mount point shall be used for ESP. This partition type is defined by the [UEFI Specification](http://www.uefi.org/specifications). |
+| _Extended Boot Loader Partition_ | `bc13c2ff-59e6-4262-a352-b275fd6f7172` `SD_GPT_XBOOTLDR` | Typically VFAT | The Extended Boot Loader Partition (XBOOTLDR) used for the current boot is automatically mounted to `/boot/`, unless a different partition is mounted there (possibly via `/etc/fstab`) or the mount point directory is non-empty on the root disk. This partition type is defined by the [Boot Loader Specification](https://systemd.io/BOOT_LOADER_SPECIFICATION). |
+| _Swap_ | `0657fd6d-a4ab-43c4-84e5-0933c84b4f4f` `SD_GPT_SWAP` | Swap, optionally in LUKS | All swap partitions on the disk containing the root partition are automatically enabled. If the partition is encrypted with LUKS, the device mapper file will be named `/dev/mapper/swap`. This partition type predates the Discoverable Partitions Specification. |
+| _Home Partition_ | `933ac7e1-2eb4-4f13-b844-0e14e2aef915` `SD_GPT_HOME` | Any native, optionally in LUKS | The first partition with this type UUID on the disk containing the root partition is automatically mounted to `/home/`. If the partition is encrypted with LUKS, the device mapper file will be named `/dev/mapper/home`. |
+| _Server Data Partition_ | `3b8f8425-20e0-4f3b-907f-1a25a76f98e8` `SD_GPT_SRV` | Any native, optionally in LUKS | The first partition with this type UUID on the disk containing the root partition is automatically mounted to `/srv/`. If the partition is encrypted with LUKS, the device mapper file will be named `/dev/mapper/srv`. |
+| _Variable Data Partition_ | `4d21b016-b534-45c2-a9fb-5c16e091fd2d` `SD_GPT_VAR` | Any native, optionally in LUKS | The first partition with this type UUID on the disk containing the root partition is automatically mounted to `/var/` — under the condition that its partition UUID matches the first 128 bits of `HMAC-SHA256(machine-id, 0x4d21b016b53445c2a9fb5c16e091fd2d)` (i.e. the SHA256 HMAC hash of the binary type UUID keyed by the machine ID as read from [`/etc/machine-id`](https://www.freedesktop.org/software/systemd/man/machine-id.html). This special requirement is made because `/var/` (unlike the other partition types listed here) is inherently private to a specific installation and cannot possibly be shared between multiple OS installations on the same disk, and thus should be bound to a specific instance of the OS, identified by its machine ID. If the partition is encrypted with LUKS, the device mapper file will be named `/dev/mapper/var`. |
+| _Temporary Data Partition_ | `7ec6f557-3bc5-4aca-b293-16ef5df639d1` `SD_GPT_TMP` | Any native, optionally in LUKS | The first partition with this type UUID on the disk containing the root partition is automatically mounted to `/var/tmp/`. If the partition is encrypted with LUKS, the device mapper file will be named `/dev/mapper/tmp`. Note that the intended mount point is indeed `/var/tmp/`, not `/tmp/`. The latter is typically maintained in memory via `tmpfs` and does not require a partition on disk. In some cases it might be desirable to make `/tmp/` persistent too, in which case it is recommended to make it a symlink or bind mount to `/var/tmp/`, thus not requiring its own partition type UUID. |
+| _Per-user Home Partition_ | `773f91ef-66d4-49b5-bd83-d683bf40ad16` `SD_GPT_USER_HOME` | Any native, optionally in LUKS | A home partition of a user, managed by [`systemd-homed`](https://www.freedesktop.org/software/systemd/man/systemd-homed.html). |
+| _Generic Linux Data Partition_ | `0fc63daf-8483-4772-8e79-3d69d8477de4` `SD_GPT_LINUX_GENERIC` | Any native, optionally in LUKS | No automatic mounting takes place for other Linux data partitions. This partition type should be used for all partitions that carry Linux file systems. The installer needs to mount them explicitly via entries in `/etc/fstab`. Optionally, these partitions may be encrypted with LUKS. This partition type predates the Discoverable Partitions Specification. |
+
+Other GPT type IDs might be used on Linux, for example to mark software RAID or
+LVM partitions. The definitions of those GPT types is outside of the scope of
+this specification.
+
+[systemd-id128(1)](https://www.freedesktop.org/software/systemd/man/systemd-id128.html)'s
+`show` command may be used to list those GPT partition type UUIDs.
+
+## Partition Names
+
+For partitions of the types listed above it is recommended to use
+human-friendly, descriptive partition names in the GPT partition table, for
+example "*Home*", "*Server* *Data*", "*Fedora* *Root*" and similar, possibly
+localized.
+
+For the Root/Verity/Verity signature partitions it might make sense to use a
+versioned naming scheme reflecting the OS name and its version,
+e.g. "fooOS_2021.4" or similar.
+For details about the version format see the
+[Version Format Specification](version_format_specification.md). The underscore
+character (`_`) must be used to separate the version from the name of the image.
+
+## Partition Attribute Flags
+
+This specification defines three GPT partition attribute flags that may be set
+for the partition types defined above:
+
+1. For the root, `/usr/`, Verity, Verity signature, home, server data, variable
+ data, temporary data, swap, and extended boot loader partitions, the
+ partition flag bit 63 ("*no-auto*", *SD_GPT_FLAG_NO_AUTO*) may be used to
+ turn off auto-discovery for the specific partition. If set, the partition
+ will not be automatically mounted or enabled.
+
+2. For the root, `/usr/`, Verity, Verity signature home, server data, variable
+ data, temporary data and extended boot loader partitions, the partition flag
+ bit 60 ("*read-only*", *SD_GPT_FLAG_READ_ONLY*) may be used to mark a
+ partition for read-only mounts only. If set, the partition will be mounted
+ read-only instead of read-write. Note that the variable data partition and
+ the temporary data partition will generally not be able to serve their
+ purpose if marked read-only, since by their very definition they are
+ supposed to be mutable. (The home and server data partitions are generally
+ assumed to be mutable as well, but the requirement for them is not equally
+ strong.) Because of that, while the read-only flag is defined and supported,
+ it's almost never a good idea to actually use it for these partitions. Also
+ note that Verity and signature partitions are by their semantics always
+ read-only. The flag is hence of little effect for them, and it is
+ recommended to set it unconditionally for the Verity and signature partition
+ types.
+
+3. For the root, `/usr/`, home, server data, variable data, temporary data and
+ extended boot loader partitions, the partition flag bit 59
+ ("*grow-file-system*", *SD_GPT_FLAG_GROWFS*) may be used to mark a partition
+ for automatic growing of the contained file system to the size of the
+ partition when mounted. Tools that automatically mount disk image with a GPT
+ partition table are suggested to implicitly grow the contained file system
+ to the partition size they are contained in, if they are found to be
+ smaller. This flag is without effect on partitions marked "*read-only*".
+
+Note that the first two flag definitions happen to correspond nicely to the
+same ones used by Microsoft Basic Data Partitions.
+
+All three of these flags generally affect only auto-discovery and automatic
+mounting of disk images. If partitions marked with these flags are mounted
+using low-level commands like
+[mount(8)](https://man7.org/linux/man-pages/man2/mount.8.html) or directly with
+[mount(2)](https://man7.org/linux/man-pages/man2/mount.2.html), they typically
+have no effect.
+
+## Verity
+
+The Root/`/usr/` partition types and their matching Verity and Verity signature
+partitions enable relatively automatic handling of `dm-verity` protected
+setups. These types are defined with two modes of operation in mind:
+
+1. A trusted Verity root hash is passed in externally, for example is specified
+ on the kernel command line that is signed along with the kernel image using
+ SecureBoot PE signing (which in turn is tested against a set of
+ firmware-provided set of signing keys). If so, discovery and setup of a
+ Verity volume may be fully automatic: if the root partition's UUID is chosen
+ to match the first 128 bit of the root hash, and the matching Verity
+ partition UUIDs is chosen to match the last 128bit of the root hash, then
+ automatic discovery and match-up of the two partitions is possible, as the
+ root hash is enough to both find the partitions and then combine them in a
+ Verity volume. In this mode a Verity signature partition is not used and
+ unnecessary.
+
+2. A Verity signature partition is included on the disk, with a signature to be
+ tested against a system-provided set of signing keys. The signature
+ partition primarily contains two fields: the root hash to use, and a PKCS#7
+ signature of it, using a signature key trusted by the OS. If so, discovery
+ and setup of a Verity volume may be fully automatic. First, the specified
+ root hash is validated with the signature and the OS-provided trusted
+ keys. If the signature checks out the root hash is then used in the same way
+ as in the first mode of operation described above.
+
+Both modes of operation may be combined in a single image. This is particularly
+useful for images that shall be usable in two different contexts: for example
+an image that shall be able to boot directly on UEFI systems (in which
+case it makes sense to include the root hash on the kernel command line that is
+included in the signed kernel image to boot, as per mode of operation #1
+above), but also be able to used as image for a container engine (such as
+`systemd-nspawn`), which can use the signature partition to validate the image,
+without making use of the signed kernel image (and thus following mode of
+operation #2).
+
+The Verity signature partition's contents should be a serialized JSON object in
+text form, padded with NUL bytes to the next multiple of 4096 bytes in
+size. Currently three fields are defined for the JSON object:
+
+1. The (mandatory) `rootHash` field should be a string containing the Verity root hash,
+ formatted as series of (lowercase) hex characters.
+
+2. The (mandatory) `signature` field should be a string containing the PKCS#7
+ signature of the root hash, in Base64-encoded DER format. This should be the
+ same format used by the Linux kernel's dm-verity signature logic, i.e. the
+ signed data should be the exact string representation of the hash, as stored
+ in `rootHash` above.
+
+3. The (optional) `certificateFingerprint` field should be a string containing
+ a SHA256 fingerprint of the X.509 certificate in DER format for the key that
+ signed the root hash, formatted as series of (lowercase) hex characters (no `:`
+ separators or such).
+
+More fields might be added in later revisions of this specification.
+
+## Suggested Mode of Operation
+
+An *installer* that repartitions the hard disk _should_ use the above UUID
+partition types for appropriate partitions it creates.
+
+An *installer* which supports a "manual partitioning" interface _may_ choose to
+pre-populate the interface with swap, `/home/`, `/srv/`, `/var/tmp/` partitions
+of pre-existing Linux installations, identified with the GPT type UUIDs
+above. The installer should not pre-populate such an interface with any
+identified root, `/usr` or `/var/` partition unless the intention is to
+overwrite an existing operating system that might be installed.
+
+An *installer* _may_ omit creating entries in `/etc/fstab` for root, `/home/`,
+`/srv/`, `/var/`, `/var/tmp` and for the swap partitions if they use these UUID
+partition types, and are the first partitions on the disk of each type. If the
+ESP shall be mounted to `/efi/` (or `/boot/`), it may additionally omit
+creating the entry for it in `/etc/fstab`. If the EFI partition shall not be
+mounted to `/efi/` or `/boot/`, it _must_ create `/etc/fstab` entries for them.
+If other partitions are used (for example for `/usr/local/` or
+`/var/lib/mysql/`), the installer _must_ register these in `/etc/fstab`. The
+`root=` parameter passed to the kernel by the boot loader may be omitted if the
+root partition is the first one on the disk of its type. If the root partition
+is not the first one on the disk, the `root=` parameter _must_ be passed to the
+kernel by the boot loader. An installer that mounts a root, `/usr/`, `/home/`,
+`/srv/`, `/var/`, or `/var/tmp/` file system with the partition types defined
+as above which contains a LUKS header _must_ call the device mapper device
+"root", "usr", "home", "srv", "var" or "tmp", respectively. This is necessary
+to ensure that the automatic discovery will never result in different device
+mapper names than any static configuration by the installer, thus eliminating
+possible naming conflicts and ambiguities.
+
+An *operating* *system* _should_ automatically discover and mount the first
+root partition that does not have the no-auto flag set (as described above) by
+scanning the disk containing the currently used EFI ESP. It _should_
+automatically discover and mount the first `/usr/`, `/home/`, `/srv/`, `/var/`,
+`/var/tmp/` and swap partitions that do not have the no-auto flag set by
+scanning the disk containing the discovered root partition. It should
+automatically discover and mount the partition containing the currently used
+EFI ESP to `/efi/` (or `/boot/` as fallback). It should automatically discover
+and mount the partition containing the currently used Extended Boot Loader
+Partition to `/boot/`. It _should not_ discover or automatically mount
+partitions with other UUID partition types, or partitions located on other
+disks, or partitions with the no-auto flag set. User configuration shall
+always override automatic discovery and mounting. If a root, `/usr/`,
+`/home/`, `/srv/`, `/boot/`, `/var/`, `/var/tmp/`, `/efi/`, `/boot/` or swap
+partition is listed in `/etc/fstab` or with `root=` on the kernel command line,
+it _must_ take precedence over automatically discovered partitions. If a
+`/home/`, `/usr/`, `/srv/`, `/boot/`, `/var/`, `/var/tmp/`, `/efi/` or `/boot/`
+directory is found to be populated already in the root partition, the automatic
+discovery _must not_ mount any discovered file system over it. Optionally, in
+case of the root, `/usr/` and their Verity partitions instead of strictly
+mounting the first suitable partition an OS might choose to mount the partition
+whose label compares the highest according to `strverscmp()` or similar logic,
+in order to implement a simple partition-based A/B versioning scheme. The
+precise rules are left for the implementation to decide, but when in doubt
+earlier partitions (by their index) should always win over later partitions if
+the label comparison is inconclusive.
+
+A *container* *manager* should automatically discover and mount the root,
+`/usr/`, `/home/`, `/srv/`, `/var/`, `/var/tmp/` partitions inside a container
+disk image. It may choose to mount any discovered ESP and/or XBOOTLDR
+partition to `/efi/` or `/boot/`. It should ignore any swap should they be
+included in a container disk image.
+
+If a btrfs file system is automatically discovered and mounted by the operating
+system/container manager it will be mounted with its *default* subvolume. The
+installer should make sure to set the default subvolume correctly using "btrfs
+subvolume set-default".
+
+## Sharing of File Systems between Installations
+
+If two Linux-based operating systems are installed on the same disk, the scheme
+above suggests that they may share the swap, `/home/`, `/srv/`, `/var/tmp/`,
+ESP, XBOOTLDR. However, they should each have their own root, `/usr/` and
+`/var/` partition.
+
+## Frequently Asked Questions
+
+### Why are you taking my `/etc/fstab` away?
+
+We are not. `/etc/fstab` always overrides automatic discovery and is indeed
+mentioned in the specifications. We are simply trying to make the boot and
+installation processes of Linux a bit more robust and self-descriptive.
+
+### Why did you only define the root partition for these listed architectures?
+
+Please submit a patch that adds appropriate partition type UUIDs for the
+architecture of your choice should they be missing so far. The only reason they
+aren't defined yet is that nobody submitted them yet.
+
+### Why define distinct root partition UUIDs for the various architectures?
+
+This allows disk images that may be booted on multiple architectures to use
+discovery of the appropriate root partition on each architecture.
+
+### Doesn't this break multi-boot scenarios?
+
+No, it doesn't. The specification says that installers may not stop creating
+`/etc/fstab` or stop including `root=` on the kernel command line, unless the used
+partitions are the first ones of their type on the disk. Additionally,
+`/etc/fstab` and `root=` both override automatic discovery. Multi-boot is hence
+well supported, since it doesn't change anything for anything but the first
+installation.
+
+That all said, it's not expected that generic installers generally stop setting
+`root=` and creating `/etc/fstab` anyway. The option to drop these configuration
+bits is primarily something for appliance-like devices. However, generic
+installers should *still* set the right GPT partition types for the partitions
+they create so that container managers, partition tools and administrators can
+benefit. Phrased differently, this specification introduces A) the
+*recommendation* to use the newly defined partition types to tag things
+properly and B) the *option* to then drop `root=` and `/etc/fstab`. While we
+advertise A) to *all* installers, we only propose B) for simpler,
+appliance-like installations.
+
+### What partitioning tools will create a DPS-compliant partition table?
+
+As of util-linux 2.25.2, the `fdisk` tool provides type codes to create the
+root, home, and swap partitions that the DPS expects. By default, `fdisk` will
+create an old-style MBR, not a GPT, so typing `l` to list partition types will
+not show the choices to let you set the correct UUID. Make sure to first create
+an empty GPT, then type `l` in order for the DPS-compliant type codes to be
+available.
+
+The `gdisk` tool (from version 1.0.5 onward) and its variants (`sgdisk`,
+`cgdisk`) also support creation of partitions with a matching type code.
+
+## Links
+
+[Boot Loader Specification](boot_loader_specification.md)
+[Boot Loader Interface](https://systemd.io/BOOT_LOADER_INTERFACE)
+[Safely Building Images](https://systemd.io/BUILDING_IMAGES)
+[`systemd-boot(7)`](https://www.freedesktop.org/software/systemd/man/systemd-boot.html)
+[`bootctl(1)`](https://www.freedesktop.org/software/systemd/man/bootctl.html)
+[`systemd-gpt-auto-generator(8)`](https://www.freedesktop.org/software/systemd/man/systemd-gpt-auto-generator.html)
diff --git a/crates/lib/src/install.rs b/crates/lib/src/install.rs
index a07cdd6b3..fe11d8e34 100644
--- a/crates/lib/src/install.rs
+++ b/crates/lib/src/install.rs
@@ -88,26 +88,6 @@ const SELINUXFS: &str = "/sys/fs/selinux";
pub(crate) const EFIVARFS: &str = "/sys/firmware/efi/efivars";
pub(crate) const ARCH_USES_EFI: bool = cfg!(any(target_arch = "x86_64", target_arch = "aarch64"));
-#[cfg(any(feature = "composefs-backend", feature = "install-to-disk"))]
-// Architecture-specific DPS UUIDs for install-to-disk flow
-// See: https://uapi-group.org/specifications/specs/discoverable_partitions_specification/#defined-partition-type-uuids
-pub(crate) mod dps_uuid {
- #[cfg(target_arch = "x86_64")]
- pub(crate) const DPS_UUID: &str = "4f68bce3-e8cd-4db1-96e7-fbcaf984b709";
-
- #[cfg(target_arch = "aarch64")]
- pub(crate) const DPS_UUID: &str = "b921b045-1df0-41c3-af44-4c6f280d3fae";
-
- #[cfg(target_arch = "s390x")]
- pub(crate) const DPS_UUID: &str = "5eead9a9-fe09-4a1e-a1d7-520d00531306";
-
- #[cfg(all(target_arch = "powerpc64", target_endian = "big"))]
- pub(crate) const DPS_UUID: &str = "912ade1d-c142-4c63-8823-4435540c14a2";
-
- #[cfg(all(target_arch = "powerpc64", target_endian = "little"))]
- pub(crate) const DPS_UUID: &str = "c31c45e6-3f39-412e-80fb-4809c4980599";
-}
-
const DEFAULT_REPO_CONFIG: &[(&str, &str)] = &[
// Default to avoiding grub2-mkconfig etc.
("sysroot.bootloader", "none"),
diff --git a/crates/lib/src/install/baseline.rs b/crates/lib/src/install/baseline.rs
index 4b6a8eded..7a2e7a148 100644
--- a/crates/lib/src/install/baseline.rs
+++ b/crates/lib/src/install/baseline.rs
@@ -108,7 +108,7 @@ fn mkfs<'a>(
let devinfo = bootc_blockdev::list_dev(dev.into())?;
let size = ostree_ext::glib::format_size(devinfo.size);
- let u = uuid::uuid!(crate::install::dps_uuid::DPS_UUID);
+ let u = uuid::Uuid::parse_str(crate::discoverable_partition_specification::this_arch_root())?;
let mut t = Task::new(
&format!("Creating {label} filesystem ({fs}) on device {dev} (size={size})"),
@@ -275,7 +275,7 @@ pub(crate) fn install_create_rootfs(
}
let esp_partno = if super::ARCH_USES_EFI {
- let esp_guid = crate::bootloader::ESP_GUID;
+ let esp_guid = crate::discoverable_partition_specification::ESP;
partno += 1;
writeln!(
&mut partitioning_buf,
diff --git a/crates/lib/src/lib.rs b/crates/lib/src/lib.rs
index 297eca560..16ccc10ec 100644
--- a/crates/lib/src/lib.rs
+++ b/crates/lib/src/lib.rs
@@ -14,6 +14,7 @@ pub mod cli;
mod composefs_consts;
mod containerenv;
pub(crate) mod deploy;
+mod discoverable_partition_specification;
pub(crate) mod fsck;
pub(crate) mod generator;
mod glyph;