From 88b54fdacdf5f24c965ad71574b526c7d9cbca07 Mon Sep 17 00:00:00 2001 From: chyyuu Date: Fri, 26 Apr 2019 14:13:07 +0800 Subject: [PATCH] fix unknow bug: change busybox from docker, maintain the PATH env vars --- kernel/src/shell.rs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/kernel/src/shell.rs b/kernel/src/shell.rs index e40911b..f604729 100644 --- a/kernel/src/shell.rs +++ b/kernel/src/shell.rs @@ -9,11 +9,17 @@ use alloc::vec::Vec; #[cfg(not(feature = "run_cmdline"))] pub fn run_user_shell() { - #[cfg(target_arch = "x86_64")] - let init_shell="/bin/busybox"; - - #[cfg(not(target_arch = "x86_64"))] - let init_shell="/busybox"; +/// the busybox of alpine linux can not transfer env vars into child process +/// Now we use busybox from +/// https://raw.githubusercontent.com/docker-library/busybox/82bc0333a9ae148fbb4246bcbff1487b3fc0c510/musl/busybox.tar.xz -O busybox.tar.xz +/// This one can transfer env vars! +/// Why??? + +// #[cfg(target_arch = "x86_64")] +// let init_shell="/bin/busybox"; // from alpine linux +// +// #[cfg(not(target_arch = "x86_64"))] + let init_shell="/busybox"; //from docker-library #[cfg(target_arch = "x86_64")] let init_envs=vec!["PATH=/usr/sbin:/usr/bin:/sbin:/bin:/usr/x86_64-alpine-linux-musl/bin".into()];