Skip to content

Commit ff75e70

Browse files
authored
Merge pull request #124 from cgwalters/bump-ostree-ext
lib: Bump to ostree-ext 0.12, rustix 0.38
2 parents d7309b6 + 2b548e7 commit ff75e70

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

lib/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ rust-version = "1.64.0"
1111
[dependencies]
1212
anyhow = "1.0"
1313
camino = { version = "1.0.4", features = ["serde1"] }
14-
ostree-ext = "0.11.5"
14+
ostree-ext = "0.12"
1515
clap = { version= "4.2", features = ["derive"] }
1616
clap_mangen = { version = "0.2", optional = true }
17-
cap-std-ext = "2"
17+
cap-std-ext = "3"
1818
hex = "^0.4"
1919
fn-error-context = "0.2.0"
2020
gvariant = "0.4.0"
@@ -27,7 +27,7 @@ once_cell = "1.9"
2727
openssl = "^0.10"
2828
nix = ">= 0.24, < 0.26"
2929
regex = "1.7.1"
30-
rustix = { "version" = "0.37", features = ["thread", "process"] }
30+
rustix = { "version" = "0.38", features = ["thread", "fs", "system", "process"] }
3131
schemars = "0.8.6"
3232
serde = { features = ["derive"], version = "1.0.125" }
3333
serde_json = "1.0.64"

lib/src/install.rs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ mod baseline;
1010

1111
use std::io::BufWriter;
1212
use std::io::Write;
13+
use std::os::fd::AsFd;
1314
use std::str::FromStr;
1415
use std::sync::Arc;
1516

@@ -311,7 +312,7 @@ impl SourceInfo {
311312
.quiet()
312313
.read()?;
313314
let root = cap_std::fs::Dir::open_ambient_dir("/", cap_std::ambient_authority())?;
314-
let repo = ostree::Repo::open_at_dir(&root, "ostree/repo")?;
315+
let repo = ostree::Repo::open_at_dir(root.as_fd(), "ostree/repo")?;
315316
let root = repo
316317
.read_commit(commit.trim(), cancellable)
317318
.context("Reading commit")?
@@ -492,13 +493,10 @@ async fn initialize_ostree_root_from_self(
492493
.iter()
493494
.map(|v| v.as_str())
494495
.collect::<Vec<_>>();
495-
#[allow(clippy::needless_update)]
496-
let options = ostree_container::deploy::DeployOpts {
497-
kargs: Some(kargs.as_slice()),
498-
target_imgref: Some(&target_imgref),
499-
proxy_cfg: Some(proxy_cfg),
500-
..Default::default()
501-
};
496+
let mut options = ostree_container::deploy::DeployOpts::default();
497+
options.kargs = Some(kargs.as_slice());
498+
options.target_imgref = Some(&target_imgref);
499+
options.proxy_cfg = Some(proxy_cfg);
502500
println!("Creating initial deployment");
503501
let state =
504502
ostree_container::deploy::deploy(&sysroot, stateroot, &src_imageref, Some(options)).await?;
@@ -531,7 +529,7 @@ async fn initialize_ostree_root_from_self(
531529
writeln!(f, "{}", root_setup.boot.to_fstab())?;
532530
f.flush()?;
533531

534-
let uname = rustix::process::uname();
532+
let uname = rustix::system::uname();
535533

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

0 commit comments

Comments
 (0)