blob: 5ccfa5a991fbd22f06fd1c70a4ee1406039b3a5c [file] [log] [blame]
// Copyright 2023 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
use assembly_file_relative_path::{FileRelativePathBuf, SupportsFileRelativePaths};
use assembly_images_config::ProductFilesystemConfig;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
/// Platform configuration options for storage support.
#[derive(
Debug, Default, Deserialize, Serialize, PartialEq, JsonSchema, SupportsFileRelativePaths,
)]
#[serde(deny_unknown_fields)]
pub struct StorageConfig {
#[serde(default)]
pub live_usb_enabled: bool,
#[serde(default)]
#[file_relative_paths]
pub component_id_index: ComponentIdIndexConfig,
#[serde(default)]
pub factory_data: FactoryDataConfig,
#[serde(default)]
pub filesystems: ProductFilesystemConfig,
}
/// Platform configuration options for the component id index which describes
/// consistent storage IDs to use for component monikers. If the monikers
/// change, the IDs can stay consistent, ensuring that the storage does not
/// need to be migrated to a new location.
#[derive(
Debug, Default, Deserialize, Serialize, PartialEq, JsonSchema, SupportsFileRelativePaths,
)]
pub struct ComponentIdIndexConfig {
/// An optional index to use for product-provided components.
#[serde(default)]
#[file_relative_paths]
#[schemars(schema_with = "crate::option_path_schema")]
pub product_index: Option<FileRelativePathBuf>,
}
/// Platform configuration options for the factory data store.
#[derive(Debug, Default, Deserialize, Serialize, PartialEq, JsonSchema)]
pub struct FactoryDataConfig {
#[serde(default)]
pub enabled: bool,
}