TAKE_FD(pp->fsmount_fd);
+ const char *m = partition_mountpoint_to_string(d);
+ _cleanup_strv_free_ char **l = NULL;
+ if (!isempty(m)) {
+ l = strv_split_nulstr(m);
+ if (!l)
+ return log_oom_debug();
+ }
+
r = sd_json_variant_append_arraybo(
&aj,
SD_JSON_BUILD_PAIR("designator", SD_JSON_BUILD_STRING(partition_designator_to_string(d))),
SD_JSON_BUILD_PAIR_CONDITION(!!pp->label, "partitionLabel", SD_JSON_BUILD_STRING(pp->label)),
SD_JSON_BUILD_PAIR("size", SD_JSON_BUILD_INTEGER(pp->size)),
SD_JSON_BUILD_PAIR("offset", SD_JSON_BUILD_INTEGER(pp->offset)),
- SD_JSON_BUILD_PAIR("mountFileDescriptor", SD_JSON_BUILD_INTEGER(fd_idx)));
+ SD_JSON_BUILD_PAIR("mountFileDescriptor", SD_JSON_BUILD_INTEGER(fd_idx)),
+ JSON_BUILD_PAIR_STRV_NON_EMPTY("mountPoint", l));
if (r < 0)
return r;
}
[PARTITION_VAR] = "/var\0",
};
-DEFINE_PRIVATE_STRING_TABLE_LOOKUP_TO_STRING(partition_mountpoint, PartitionDesignator);
+DEFINE_STRING_TABLE_LOOKUP_TO_STRING(partition_mountpoint, PartitionDesignator);
#define _GPT_ARCH_SEXTET(arch, name) \
{ SD_GPT_ROOT_##arch, "root-" name, ARCHITECTURE_##arch, .designator = PARTITION_ROOT }, \
const char* partition_designator_to_string(PartitionDesignator d) _const_;
PartitionDesignator partition_designator_from_string(const char *name) _pure_;
+const char* partition_mountpoint_to_string(PartitionDesignator d) _const_;
+
const char* gpt_partition_type_uuid_to_string(sd_id128_t id);
const char* gpt_partition_type_uuid_to_string_harder(
sd_id128_t id,
SD_VARLINK_FIELD_COMMENT("The start offset of the partition in bytes."),
SD_VARLINK_DEFINE_FIELD(offset, SD_VARLINK_INT, 0),
SD_VARLINK_FIELD_COMMENT("A mount file descriptor to assign to a location."),
- SD_VARLINK_DEFINE_FIELD(mountFileDescriptor, SD_VARLINK_INT, 0));
+ SD_VARLINK_DEFINE_FIELD(mountFileDescriptor, SD_VARLINK_INT, 0),
+ SD_VARLINK_FIELD_COMMENT("A relative path indicating the intended mount point for this file system, if applicable. May contain multiple paths, for certain partitions that can be mounted to multiple distinct places."),
+ SD_VARLINK_DEFINE_FIELD(mountPoint, SD_VARLINK_STRING, SD_VARLINK_NULLABLE|SD_VARLINK_ARRAY));
static SD_VARLINK_DEFINE_METHOD(
MountImage,