diff --git a/src/shared/dissect-image.c b/src/shared/dissect-image.c index d67bdd501b..53682b2542 100644 --- a/src/shared/dissect-image.c +++ b/src/shared/dissect-image.c @@ -811,7 +811,8 @@ static int dissect_image( if (pflags & SD_GPT_FLAG_NO_AUTO) continue; - } else if (type.designator == PARTITION_LINUX_GENERIC) { + /* We don't have a designator for SD_GPT_LINUX_GENERIC so check the UUID instead. */ + } else if (sd_id128_equal(type.uuid, SD_GPT_LINUX_GENERIC)) { check_partition_flags(node, pflags, SD_GPT_FLAG_NO_AUTO | SD_GPT_FLAG_READ_ONLY | SD_GPT_FLAG_GROWFS); diff --git a/src/shared/gpt.c b/src/shared/gpt.c index ce73d7f781..99795530bd 100644 --- a/src/shared/gpt.c +++ b/src/shared/gpt.c @@ -59,7 +59,7 @@ PartitionDesignator partition_verity_sig_of(PartitionDesignator p) { } -static const char *const partition_designator_table[] = { +static const char *const partition_designator_table[_PARTITION_DESIGNATOR_MAX] = { [PARTITION_ROOT] = "root", [PARTITION_USR] = "usr", [PARTITION_HOME] = "home", @@ -73,13 +73,11 @@ static const char *const partition_designator_table[] = { [PARTITION_USR_VERITY_SIG] = "usr-verity-sig", [PARTITION_TMP] = "tmp", [PARTITION_VAR] = "var", - [PARTITION_USER_HOME] = "user-home", - [PARTITION_LINUX_GENERIC] = "linux-generic", }; DEFINE_STRING_TABLE_LOOKUP(partition_designator, PartitionDesignator); -static const char *const partition_mountpoint_table[] = { +static const char *const partition_mountpoint_table[_PARTITION_DESIGNATOR_MAX] = { [PARTITION_ROOT] = "/\0", [PARTITION_USR] = "/usr\0", [PARTITION_HOME] = "/home\0", @@ -144,8 +142,8 @@ const GptPartitionType gpt_partition_type_table[] = { { SD_GPT_SRV, "srv", _ARCHITECTURE_INVALID, .designator = PARTITION_SRV }, { SD_GPT_VAR, "var", _ARCHITECTURE_INVALID, .designator = PARTITION_VAR }, { SD_GPT_TMP, "tmp", _ARCHITECTURE_INVALID, .designator = PARTITION_TMP }, - { SD_GPT_USER_HOME, "user-home", _ARCHITECTURE_INVALID, .designator = PARTITION_USER_HOME }, - { SD_GPT_LINUX_GENERIC, "linux-generic", _ARCHITECTURE_INVALID, .designator = PARTITION_LINUX_GENERIC }, + { SD_GPT_USER_HOME, "user-home", _ARCHITECTURE_INVALID, .designator = _PARTITION_DESIGNATOR_INVALID }, + { SD_GPT_LINUX_GENERIC, "linux-generic", _ARCHITECTURE_INVALID, .designator = _PARTITION_DESIGNATOR_INVALID }, {} }; diff --git a/src/shared/gpt.h b/src/shared/gpt.h index 967e20e0af..03af12c9e3 100644 --- a/src/shared/gpt.h +++ b/src/shared/gpt.h @@ -24,8 +24,6 @@ typedef enum PartitionDesignator { PARTITION_USR_VERITY_SIG, PARTITION_TMP, PARTITION_VAR, - PARTITION_USER_HOME, - PARTITION_LINUX_GENERIC, _PARTITION_DESIGNATOR_MAX, _PARTITION_DESIGNATOR_INVALID = -EINVAL, } PartitionDesignator;