gpt_component/
config.rs

1// Copyright 2025 The Fuchsia Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5use fidl_fuchsia_fs_startup::StartOptions;
6
7#[derive(Clone, Debug, Default)]
8pub struct Config {
9    /// If 'super' and 'userdata' exist and are contiguous, they will be merged into a single
10    /// overlay partition called 'super_and_userdata'.
11    /// NOTE: We will only attempt to merge the first `super` and `userdata` partitions found in the
12    /// GPT.  In the unlikely event that multiple such partitions exist, matching will *only* occur
13    /// on the first pair found.  All subsequent partitions will simply be bound as regular
14    /// partitions.  This is mainly for simplicity, because it's not something we expect to happen
15    /// anyways.
16    pub merge_super_and_userdata: bool,
17}
18
19impl From<StartOptions> for Config {
20    fn from(options: StartOptions) -> Self {
21        Config { merge_super_and_userdata: options.merge_super_and_userdata.unwrap_or(false) }
22    }
23}