Skip to content

Commit

Permalink
remove flag hermit_env
Browse files Browse the repository at this point in the history
The environment is included in the container image. Consequently,
the flag isn't longer required.
  • Loading branch information
stlankes committed Oct 8, 2024
1 parent 1a801fe commit 0ca084f
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 32 deletions.
3 changes: 0 additions & 3 deletions src/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ pub fn create_container(
bundle: PathBuf,
pidfile: Option<PathBuf>,
console_socket: Option<PathBuf>,
hermit_env: Option<PathBuf>,
debug_config: bool,
child_log_level: LogLevel,
) {
Expand Down Expand Up @@ -108,8 +107,6 @@ pub fn create_container(
};
if is_hermit_container {
info!("Detected RustyHermit executable. Creating container in hermit mode!");
//Setup hermit environment
hermit::prepare_environment(&project_dir, &hermit_env);
}

//Setup exec fifo
Expand Down
25 changes: 1 addition & 24 deletions src/hermit.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::network;
use goblin::elf;
use goblin::elf64::header::EI_OSABI;
use std::{fs, path::Path, path::PathBuf};
use std::{fs, path::Path};

pub fn is_hermit_app(path: &Path) -> bool {
let buffer = fs::read(path)
Expand All @@ -14,29 +14,6 @@ pub fn is_hermit_app(path: &Path) -> bool {
}
}

pub fn create_environment(_path: &Path) {
//TODO
}

pub fn get_environment_path(project_dir: &Path, hermit_env_path: &Option<PathBuf>) -> PathBuf {
match hermit_env_path {
Some(s) => s.clone(),
None => project_dir.join("hermit"),
}
}

pub fn prepare_environment(project_dir: &Path, hermit_env_path: &Option<PathBuf>) {
let environment_path = get_environment_path(project_dir, hermit_env_path);
if !environment_path.exists() {
create_environment(&environment_path);
} else if !environment_path.is_dir() {
panic!(
"Environment path at {:?} exists but is not a directory!",
&environment_path
);
}
}

pub enum NetworkConfig {
TapNetwork(network::VirtioNetworkConfig),
UserNetwork(u16),
Expand Down
5 changes: 0 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ fn parse_matches(cli: &Cli) {
bundle.clone(),
pid_file.clone(),
console_socket.clone(),
cli.hermit_env.clone(),
cli.debug_config,
cli.log_level,
),
Expand Down Expand Up @@ -213,10 +212,6 @@ struct Cli {
#[arg(long, default_value_t, value_enum)]
log_format: LogFormat,

/// Path to the hermit-environment. Defaults to <runh-root-dir>/hermit
#[arg(long, value_name = "HERMIT_ENV_PATH")]
hermit_env: Option<PathBuf>,

/// Write out any logs to the runh root directory in addition to the specified log path.
#[arg(long, default_value_t)]
debug_log: bool,
Expand Down

0 comments on commit 0ca084f

Please sign in to comment.