Skip to content

Commit 7ddb361

Browse files
committed
install: Access sysroot via /proc/$pid instead of /proc/self
/proc/self doesn't resolve correctly for subprocesses that may be spawned. In particular, if ostree spawns aboot-deploy to update the aboot symlinks that will fail.
1 parent 147f16c commit 7ddb361

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

crates/lib/src/install.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ use std::io::Write;
1919
use std::os::fd::{AsFd, AsRawFd};
2020
use std::os::unix::process::CommandExt;
2121
use std::path::Path;
22+
use std::process;
2223
use std::process::Command;
2324
use std::str::FromStr;
2425
use std::sync::Arc;
@@ -624,7 +625,7 @@ async fn initialize_ostree_root(state: &State, root_setup: &RootSetup) -> Result
624625
}
625626

626627
let sysroot = {
627-
let path = format!("/proc/self/fd/{}", rootfs_dir.as_fd().as_raw_fd());
628+
let path = format!("/proc/{}/fd/{}", process::id(), rootfs_dir.as_fd().as_raw_fd());
628629
ostree::Sysroot::new(Some(&gio::File::for_path(path)))
629630
};
630631
sysroot.load(cancellable)?;

0 commit comments

Comments
 (0)