Compare commits
2 Commits
ea75e1d744
...
32e15b1106
| Author | SHA1 | Date | |
|---|---|---|---|
|
32e15b1106
|
|||
|
7640952bdc
|
@@ -352,6 +352,18 @@ impl Drop for EphemeralContextGuard {
|
||||
// Check if we're running as root to avoid unnecessary sudo
|
||||
let is_root = crate::utils::root::is_root().unwrap_or(false);
|
||||
|
||||
// Unmount /proc from chroot before removing (ignore errors)
|
||||
let proc_path = self.chroot_path.join("proc");
|
||||
let _ = if is_root {
|
||||
self.base_ctx.command("umount").arg(&proc_path).status()
|
||||
} else {
|
||||
self.base_ctx
|
||||
.command("sudo")
|
||||
.arg("umount")
|
||||
.arg(&proc_path)
|
||||
.status()
|
||||
};
|
||||
|
||||
let result = if is_root {
|
||||
self.base_ctx
|
||||
.command("rm")
|
||||
|
||||
@@ -344,6 +344,10 @@ mod tests {
|
||||
/// It is important to ensure that pkh can cross-compile linux-riscv, as
|
||||
/// for risc-v hardware is still rare and cross-compilation is necessary
|
||||
/// to debug and test
|
||||
/// NOTE: Ideally, we want to run this in CI, but it takes more than 1h
|
||||
/// to fully build the linux-riscv package on an amd64 builder, which is too
|
||||
/// much time
|
||||
#[ignore]
|
||||
#[tokio::test]
|
||||
#[test_log::test]
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
|
||||
Reference in New Issue
Block a user