forked from containers/bootc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Colin Walters <[email protected]>
- Loading branch information
Showing
10 changed files
with
185 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Enable fsverity at install time | ||
FROM localhost/bootc | ||
RUN <<EORUN | ||
set -xeuo pipefail | ||
mkdir -p /usr/lib/bootc/install | ||
cat > /usr/lib/bootc/install/30-fsverity.toml <<EOF | ||
[install] | ||
fsverity = "enabled" | ||
EOF | ||
EORUN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
//! # Write deployments merging image with configmap | ||
//! | ||
//! Create a merged filesystem tree with the image and mounted configmaps. | ||
use std::collections::HashSet; | ||
use std::io::{BufRead, Write}; | ||
use std::os::fd::AsFd; | ||
|
||
use anyhow::Ok; | ||
use anyhow::{anyhow, Context, Result}; | ||
use camino::Utf8Path; | ||
use cap_std::fs::{Dir, MetadataExt}; | ||
use cap_std_ext::cap_std; | ||
use cap_std_ext::dirext::CapStdExtDirExt; | ||
use fn_error_context::context; | ||
use ostree::{gio, glib}; | ||
use ostree_container::OstreeImageReference; | ||
use ostree_ext::container as ostree_container; | ||
use ostree_ext::container::store::{ImportProgress, PrepareResult}; | ||
use ostree_ext::oci_spec::image::{Descriptor, Digest}; | ||
use ostree_ext::ostree::Deployment; | ||
use ostree_ext::ostree::{self, Sysroot}; | ||
use ostree_ext::sysroot::SysrootLock; | ||
use ostree_ext::tokio_util::spawn_blocking_cancellable_flatten; | ||
|
||
use crate::spec::ImageReference; | ||
use crate::spec::{BootOrder, HostSpec}; | ||
use crate::status::labels_of_config; | ||
use crate::store::Storage; | ||
use crate::utils::async_task_with_spinner; | ||
|
||
#[derive(Serialize, Deserialize, Debug)] | ||
#[serde(rename_all = "kebab-case")] | ||
pub(crate) enum VerityState { | ||
Enabled, | ||
Disabled, | ||
Inconsistent | ||
} | ||
|
||
pub(crate) struct FsckResult { | ||
pub(crate) errors: bool, | ||
pub(crate) verity: VerityState, | ||
} | ||
|
||
#[context("Computing verity state")] | ||
fn verity_state_of_objects(d: &Dir) -> Result<VerityState> { | ||
for ent in d.entries()? { | ||
let ent = ent?; | ||
let name = ent.file_name(); | ||
let Some(name) = name.to_str() else { | ||
continue; | ||
}; | ||
let name = Utf8Path::new(name); | ||
let Some("file") = name.extension() else { | ||
continue | ||
}; | ||
let f = d.open(name).context(name)?; | ||
let r = crate::fsverity::ioctl::fs_ioc_measure_verity(f.as_fd()); | ||
} | ||
} | ||
|
||
pub(crate) async fn fsck(storage: &Storage) -> Result<FsckResult> { | ||
let repo = &storage.repo(); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters