bump deps, rust, alpine, and add the real iproute2
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
use eyre::{format_err, Result};
|
||||
use log::{error, info, warn};
|
||||
use std::collections::BTreeSet as Set;
|
||||
use std::convert::Infallible;
|
||||
use std::os::unix::fs::symlink;
|
||||
use tokio::sync::Mutex;
|
||||
use tokio::{fs, process::Command};
|
||||
@ -323,13 +324,7 @@ async fn child_reaper() {
|
||||
}
|
||||
}
|
||||
|
||||
macro_rules! cstr {
|
||||
($s:expr) => {
|
||||
std::ffi::CString::new($s)?.as_c_str()
|
||||
};
|
||||
}
|
||||
|
||||
async fn switch_root(root: &str) -> Result<()> {
|
||||
async fn switch_root(root: &str) -> Result<Infallible> {
|
||||
info!("killing all processes and switching root");
|
||||
dklog::LOG.close().await;
|
||||
|
||||
@ -340,7 +335,13 @@ async fn switch_root(root: &str) -> Result<()> {
|
||||
eprintln!("failed to kill processes: {e}");
|
||||
}
|
||||
|
||||
nix::unistd::execv(
|
||||
macro_rules! cstr {
|
||||
($s:expr) => {
|
||||
std::ffi::CString::new($s)?.as_c_str()
|
||||
};
|
||||
}
|
||||
|
||||
Ok(nix::unistd::execv(
|
||||
cstr!("/sbin/switch_root"),
|
||||
&[
|
||||
cstr!("switch_root"),
|
||||
@ -349,8 +350,5 @@ async fn switch_root(root: &str) -> Result<()> {
|
||||
cstr!(root),
|
||||
cstr!("/sbin/init"),
|
||||
],
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
unreachable!();
|
||||
)?)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user