Re: [PATCH 12/19] x86: define DPS root partition type UUIDs
From: Dave Hansen
Date: Mon Jun 15 2026 - 12:46:51 EST
On 6/15/26 09:09, Vincent Mailhol wrote:
> +#ifdef CONFIG_X86_64
> +#define DPS_ROOT_PARTITION_TYPE_UUID "4f68bce3-e8cd-4db1-96e7-fbcaf984b709"
> +#else
> +#define DPS_ROOT_PARTITION_TYPE_UUID "44479540-f297-41b2-9af7-d131d5f0458a"
> +#endif
This doesn't make a whole lot of sense to me. 64-bit kernels can run
32-bit userspace just fine.
But this #ifdef as proposed means that only a 32-bit *OR* 64-bit kernel
can auto-discover a given partition.
I kinda think you should just have an array of strings for these things,
maybe glued together with some preprocessor magic. Logically something
like this:
const char* const uuids[] = {
#ifdef CONFIG_ARM64
"b921b045-1df0-41c3-af44-4c6f280d3fae"
#endif
#ifdef CONFIG_X86_64
"4f68bce3-e8cd-4db1-96e7-fbcaf984b709",
#endif
#if defined(CONFIG_X86) && defined(CONFIG_COMPAT32)
"44479540-f297-41b2-9af7-d131d5f0458a",
#endif
...
};
... and then search the array. I honestly don't think you need to
sprinkle UUIDs all over the architectures.
It could probably also be done almost entirely in Kconfig. This could be
in, say block/partitions/Kconfig, or arch/*/Kconfig:
config DPS_ROOT_PARTITION_TYPE_UUID_1
string
default "4f68bce3-e8cd-4db1-96e7-fbcaf984b709" if X86_64
default "b921b045-1df0-41c3-af44-4c6f280d3fae" if ARM64
...
config DPS_ROOT_PARTITION_TYPE_UUID_2
string
default "44479540-f297-41b2-9af7-..." if X86 && COMPAT_32
const char* const uuids[] = {
#ifdef CONFIG_DPS_ROOT_PARTITION_TYPE_UUID_1
CONFIG_DPS_ROOT_PARTITION_TYPE_UUID_1
#endif
#ifdef CONFIG_DPS_ROOT_PARTITION_TYPE_UUID_2
CONFIG_DPS_ROOT_PARTITION_TYPE_UUID_2
#endif
...
};
There are a lot of ways to do this. I'm just not a super big fan of the
current proposal.
So, boiling it down:
1. Should more than one UUID be supported per kernel build?
2. Should the UUIDs be defined in arch code or generic code?
3. Kconfig or #ifdefs?