Skip to content

Commit

Permalink
Merge pull request #782 from omertuc/issue781
Browse files Browse the repository at this point in the history
install: `sysroot.init_osname` API instead of CLI
cgwalters authored Sep 11, 2024
2 parents fee30a2 + 79bc580 commit 604cbb6
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/src/install.rs
Original file line number Diff line number Diff line change
@@ -603,13 +603,14 @@ async fn initialize_ostree_root(state: &State, root_setup: &RootSetup) -> Result
.cwd_dir(rootfs_dir.try_clone()?)
.run()?;
}
Task::new("Initializing sysroot", "ostree")
.args(["admin", "os-init", stateroot, "--sysroot", "."])
.cwd(rootfs_dir)?
.run()?;

let sysroot = ostree::Sysroot::new(Some(&gio::File::for_path(rootfs)));
sysroot.load(cancellable)?;

sysroot
.init_osname(stateroot, cancellable)
.context("initializing stateroot")?;

let sysroot_dir = Dir::reopen_dir(&crate::utils::sysroot_fd(&sysroot))?;

state.tempdir.create_dir("temp-run")?;

0 comments on commit 604cbb6

Please sign in to comment.