Skip to content

Commit

Permalink
Merge pull request #124 from cgwalters/bump-ostree-ext
Browse files Browse the repository at this point in the history
lib: Bump to ostree-ext 0.12, rustix 0.38
  • Loading branch information
jmarrero authored Sep 12, 2023
2 parents d7309b6 + 2b548e7 commit ff75e70
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
6 changes: 3 additions & 3 deletions lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ rust-version = "1.64.0"
[dependencies]
anyhow = "1.0"
camino = { version = "1.0.4", features = ["serde1"] }
ostree-ext = "0.11.5"
ostree-ext = "0.12"
clap = { version= "4.2", features = ["derive"] }
clap_mangen = { version = "0.2", optional = true }
cap-std-ext = "2"
cap-std-ext = "3"
hex = "^0.4"
fn-error-context = "0.2.0"
gvariant = "0.4.0"
Expand All @@ -27,7 +27,7 @@ once_cell = "1.9"
openssl = "^0.10"
nix = ">= 0.24, < 0.26"
regex = "1.7.1"
rustix = { "version" = "0.37", features = ["thread", "process"] }
rustix = { "version" = "0.38", features = ["thread", "fs", "system", "process"] }
schemars = "0.8.6"
serde = { features = ["derive"], version = "1.0.125" }
serde_json = "1.0.64"
Expand Down
18 changes: 8 additions & 10 deletions lib/src/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ mod baseline;

use std::io::BufWriter;
use std::io::Write;
use std::os::fd::AsFd;
use std::str::FromStr;
use std::sync::Arc;

Expand Down Expand Up @@ -311,7 +312,7 @@ impl SourceInfo {
.quiet()
.read()?;
let root = cap_std::fs::Dir::open_ambient_dir("/", cap_std::ambient_authority())?;
let repo = ostree::Repo::open_at_dir(&root, "ostree/repo")?;
let repo = ostree::Repo::open_at_dir(root.as_fd(), "ostree/repo")?;
let root = repo
.read_commit(commit.trim(), cancellable)
.context("Reading commit")?
Expand Down Expand Up @@ -492,13 +493,10 @@ async fn initialize_ostree_root_from_self(
.iter()
.map(|v| v.as_str())
.collect::<Vec<_>>();
#[allow(clippy::needless_update)]
let options = ostree_container::deploy::DeployOpts {
kargs: Some(kargs.as_slice()),
target_imgref: Some(&target_imgref),
proxy_cfg: Some(proxy_cfg),
..Default::default()
};
let mut options = ostree_container::deploy::DeployOpts::default();
options.kargs = Some(kargs.as_slice());
options.target_imgref = Some(&target_imgref);
options.proxy_cfg = Some(proxy_cfg);
println!("Creating initial deployment");
let state =
ostree_container::deploy::deploy(&sysroot, stateroot, &src_imageref, Some(options)).await?;
Expand Down Expand Up @@ -531,7 +529,7 @@ async fn initialize_ostree_root_from_self(
writeln!(f, "{}", root_setup.boot.to_fstab())?;
f.flush()?;

let uname = rustix::process::uname();
let uname = rustix::system::uname();

let aleph = InstallAleph {
image: src_imageref.imgref.name.clone(),
Expand Down Expand Up @@ -717,7 +715,7 @@ pub(crate) fn propagate_tmp_mounts_to_host() -> Result<()> {
if path.try_exists()? {
std::os::unix::fs::symlink(&target, &tmp)
.with_context(|| format!("Symlinking {target} to {tmp}"))?;
let cwd = rustix::fs::cwd();
let cwd = rustix::fs::CWD;
rustix::fs::renameat_with(
cwd,
path.as_os_str(),
Expand Down

0 comments on commit ff75e70

Please sign in to comment.