Skip to content

Commit 79bc580

Browse files
committed
install: sysroot.init_osname API instead of CLI
Solves #781 This commit replaces the `ostree admin os-init` CLI invocation with the `sysroot.init_osname` API call. This is a more direct way to initialize the stateroot. Signed-off-by: Omer Tuchfeld <[email protected]>
1 parent 1fd6c69 commit 79bc580

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/src/install.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -600,13 +600,14 @@ async fn initialize_ostree_root(state: &State, root_setup: &RootSetup) -> Result
600600
.cwd_dir(rootfs_dir.try_clone()?)
601601
.run()?;
602602
}
603-
Task::new("Initializing sysroot", "ostree")
604-
.args(["admin", "os-init", stateroot, "--sysroot", "."])
605-
.cwd(rootfs_dir)?
606-
.run()?;
607603

608604
let sysroot = ostree::Sysroot::new(Some(&gio::File::for_path(rootfs)));
609605
sysroot.load(cancellable)?;
606+
607+
sysroot
608+
.init_osname(stateroot, cancellable)
609+
.context("initializing stateroot")?;
610+
610611
let sysroot_dir = Dir::reopen_dir(&crate::utils::sysroot_fd(&sysroot))?;
611612

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

0 commit comments

Comments
 (0)