[PATCH 01/19] init: add DPS root partition type UUID capability

Vincent Mailhol <[email protected]> Mon, 15 Jun 2026 18:08:57 +0200
Newsgroups org.kernel.vger.linux-efi,org.kernel.vger.linux-block,org.kernel.vger.linux-fsdevel,org.kernel.vger.linux-kernel
Message-ID <20260615-discoverable-root_partitions-v1-1-39c78fac42e2@kernel.org>
DPS [1] assigns native root partition type UUIDs per architecture.

Add the ARCH_HAS_DPS_ROOT_PARTITION_TYPE_UUID config option so that
architectures can opt in.

Architectures that support this feature should define
DPS_ROOT_PARTITION_TYPE_UUID in asm/dps_root.h as a string
representation of the architecture's DPS root partition type UUID.

Add the hidden DPS_ROOT_AUTO_DISCOVERY symbol for the combination of
BLOCK, EFI and ARCH_HAS_DPS_ROOT_PARTITION_TYPE_UUID, and use it to
expose DPS_ROOT_PARTITION_TYPE_UUID from the common linux/root_dev.h
header only when all prerequisites are met.

[1] The Discoverable Partitions Specification (DPS)
Link: https://uapi-group.org/specifications/specs/discoverable_partitions_specification/

Signed-off-by: Vincent Mailhol <[email protected]>
---
 include/linux/root_dev.h | 6 ++++++
 init/Kconfig             | 6 ++++++
 2 files changed, 12 insertions(+)

diff --git a/include/linux/root_dev.h b/include/linux/root_dev.h
index 847c9a06101b..6b52a10b0bca 100644
--- a/include/linux/root_dev.h
+++ b/include/linux/root_dev.h
@@ -5,6 +5,12 @@
 #include <linux/major.h>
 #include <linux/types.h>
 #include <linux/kdev_t.h>
+#include <linux/uuid.h>
+
+#ifdef CONFIG_DPS_ROOT_AUTO_DISCOVERY
+#include <asm/dps_root.h>
+static_assert(sizeof(DPS_ROOT_PARTITION_TYPE_UUID) == UUID_STRING_LEN + 1);
+#endif
 
 enum {
 	Root_NFS = MKDEV(UNNAMED_MAJOR, 255),
diff --git a/init/Kconfig b/init/Kconfig
index 147da6370bf0..982c6ad9da4d 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -2287,6 +2287,12 @@ config ARCH_HAS_PREPARE_SYNC_CORE_CMD
 config ARCH_HAS_SYNC_CORE_BEFORE_USERMODE
 	bool
 
+config ARCH_HAS_DPS_ROOT_PARTITION_TYPE_UUID
+	bool
+
+config DPS_ROOT_AUTO_DISCOVERY
+	def_bool BLOCK && EFI && ARCH_HAS_DPS_ROOT_PARTITION_TYPE_UUID
+
 # It may be useful for an architecture to override the definitions of the
 # SYSCALL_DEFINE() and __SYSCALL_DEFINEx() macros in <linux/syscalls.h>
 # and the COMPAT_ variants in <linux/compat.h>, in particular to use a

-- 
2.53.0