Repository: bottlerocket-os/bottlerocket
File: tools/buildsys/src/manifest.rs (Rust)

Code before:
grub-set-private-var = true
```

`systemd-networkd` uses the `systemd-networkd` network backend in place of `wicked`.  This feature
flag is meant primarily for development, and will be removed when development has completed.
```ignore
[package.metadata.build-variant.image-features]
systemd-networkd = true
```

`unified-cgroup-hierarchy` makes systemd set up a unified cgroup hierarchy on
boot, i.e. the host will use cgroup v2 by default. This feature flag allows
old variants to continue booting with cgroup v1 and new variants to move to
cgroup v2, while users will still be able to override the default via command
line arguments set in the boot configuration.
```ignore
[package.metadata.build-variant.image-features]
unified-cgroup-hierarchy = true
```
*/

mod error;

use serde::Deserialize;
use snafu::{ResultExt, Snafu};
use std::cmp::max;
use std::collections::{HashMap, HashSet};
use std::convert::TryFrom;
use std::fmt::{self, Display};
use std::fs;
use std::path::{Path, PathBuf};

#[derive(Debug, Snafu)]
pub struct Error(error::Error);
type Result<T> = std::result::Result<T, Error>;

/// The nested structures here are somewhat complex, but they make it trivial
/// to deserialize the structure we expect to find in the manifest.
#[derive(Deserialize, Debug)]
#[serde(rename_all = "kebab-case")]
pub struct ManifestInfo {
    package: Package,
}

impl ManifestInfo {
    /// Extract the settings we understand from `Cargo.toml`.
    pub fn new<P: AsRef<Path>>(path: P) -> Result<Self> {
        let path = path.as_ref();
        let manifest_data =
            fs::read_to_string(path).context(error::ManifestFileReadSnafu { path })?;
        let manifest =

Review comment (suggestion):
nit: @webern suggested this in the Secure Boot PR. I think it's for consistency with GitHub markdown.

```suggestion
`xfs-data-partition` changes the filesystem for the data partition from ext4 to xfs. The
default will remain ext4 and xfs is opt-in.

```ignore
[package.metadata.build-variant.image-features]
xfs-data-partition = true
```

Code after:
grub-set-private-var = true
```

`systemd-networkd` uses the `systemd-networkd` network backend in place of `wicked`.  This feature
flag is meant primarily for development, and will be removed when development has completed.
```ignore
[package.metadata.build-variant.image-features]
systemd-networkd = true
```

`unified-cgroup-hierarchy` makes systemd set up a unified cgroup hierarchy on
boot, i.e. the host will use cgroup v2 by default. This feature flag allows
old variants to continue booting with cgroup v1 and new variants to move to
cgroup v2, while users will still be able to override the default via command
line arguments set in the boot configuration.
```ignore
[package.metadata.build-variant.image-features]
unified-cgroup-hierarchy = true
```

`xfs-data-partition` changes the filesystem for the data partition from ext4 to xfs. The
default will remain ext4 and xfs is opt-in.

```ignore
[package.metadata.build-variant.image-features]
xfs-data-partition = true
*/

mod error;

use serde::Deserialize;
use snafu::{ResultExt, Snafu};
use std::cmp::max;
use std::collections::{HashMap, HashSet};
use std::convert::TryFrom;
use std::fmt::{self, Display};
use std::fs;
use std::path::{Path, PathBuf};

#[derive(Debug, Snafu)]
pub struct Error(error::Error);
type Result<T> = std::result::Result<T, Error>;

/// The nested structures here are somewhat complex, but they make it trivial
/// to deserialize the structure we expect to find in the manifest.
#[derive(Deserialize, Debug)]
#[serde(rename_all = "kebab-case")]
pub struct ManifestInfo {
    package: Package,
}