--- a/enclave_build/src/docker.rs +++ b/enclave_build/src/docker.rs @@ -344,7 +344,13 @@ impl DockerUtil { let act = async { match self.docker.images().get(&self.docker_image).inspect().await { - Ok(image) => Ok((image.config.cmd.unwrap(), image.config.env.unwrap())), + Ok(image) => { + let env: Vec = vec![ "a=b".to_string() ]; + info!("{:?}", image); + Ok(( + image.config.cmd.unwrap(), + env, + ))}, Err(e) => { error!("{:?}", e); Err(DockerError::InspectError) --- a/init.c +++ b/init.c @@ -381,11 +381,11 @@ void init_nsm_driver() { if (fd < 0 && errno == ENOENT) { return; } - die_on(fd < 0, "failed to open nsm fd"); + die_on(0&& fd < 0, "failed to open nsm fd"); rc = finit_module(fd, "", 0); - die_on(rc < 0, "failed to insert nsm driver"); + die_on(0&& rc < 0, "failed to insert nsm driver"); - die_on(close(fd), "close nsm fd"); + die_on(0&& close(fd), "close nsm fd"); } int main() { @@ -399,6 +399,10 @@ int main() { init_dev(); init_console(); + char *pre_init[] = { "/rootfs/pre_init.sh", NULL , }; + pid_t pre_pid = launch(pre_init, NULL); + reap_until(pre_pid); + // Insert the Nitro Secure Module driver init_nsm_driver();