Merged to master at 94b62e58e8c8..a90eeb66da0a (from, to]

You can see the entire diff with 'git diff' or at
https://github.com/brho/akaros/compare/94b62e58e8c8...a90eeb66da0a



On 2016-07-12 at 17:29 Dan Cross <[email protected]> wrote:
> Don't use the 'busybox' binary as a trampoline to start a shell.
> Instead, invoke the shell directly using a filesystem name for
> the the shell binary: /bin/bash.  Also, rename the monitor function
> to invoke a shell from, "mon_bb" to "mon_shell".  Add monitor
> commands 'bash' and 'sh' to invoke the shell as, '/bin/bash'.
> 
> Tested: Built and ran Akaros.
> 
> Change-Id: I56be992292b28762c9925b9b40f2d765ca1e1313
> Signed-off-by: Dan Cross <[email protected]>
> ---
>  kern/include/monitor.h |  2 +-
>  kern/src/init.c        |  7 +++----
>  kern/src/manager.c     |  2 +-
>  kern/src/monitor.c     | 10 ++++++----
>  4 files changed, 11 insertions(+), 10 deletions(-)
> 
> diff --git a/kern/include/monitor.h b/kern/include/monitor.h
> index 92a1f28..887058b 100644
> --- a/kern/include/monitor.h
> +++ b/kern/include/monitor.h
> @@ -31,7 +31,7 @@ int mon_measure(int argc, char **argv, struct hw_trapframe 
> *hw_tf);
>  int mon_trace(int argc, char **argv, struct hw_trapframe *hw_tf);
>  int mon_monitor(int argc, char **argv, struct hw_trapframe *hw_tf);
>  int mon_fs(int argc, char **argv, struct hw_trapframe *hw_tf);
> -int mon_bb(int argc, char **argv, struct hw_trapframe *hw_tf);
> +int mon_shell(int argc, char **argv, struct hw_trapframe *hw_tf);
>  int mon_alarm(int argc, char **argv, struct hw_trapframe *hw_tf);
>  int mon_msr(int argc, char **argv, struct hw_trapframe *hw_tf);
>  int mon_db(int argc, char **argv, struct hw_trapframe *hw_tf);
> diff --git a/kern/src/init.c b/kern/src/init.c
> index 6f21ec6..9ab93fc 100644
> --- a/kern/src/init.c
> +++ b/kern/src/init.c
> @@ -208,12 +208,11 @@ static int run_init_script(void)
>  
>               /* Initialize l_argv with its first three arguments, but 
> allocate space
>                * for all arguments as calculated above */
> -             int static_args = 3;
> +             int static_args = 2;
>               int total_args = vargs + static_args;
>               char *l_argv[total_args];
> -             l_argv[0] = "";
> -             l_argv[1] = "busybox";
> -             l_argv[2] = "ash";
> +             l_argv[0] = "/bin/bash";
> +             l_argv[1] = "bash";
>  
>               /* Initialize l_argv with the rest of the arguments */
>               int i = static_args;
> diff --git a/kern/src/manager.c b/kern/src/manager.c
> index fe442ad..677e5ef 100644
> --- a/kern/src/manager.c
> +++ b/kern/src/manager.c
> @@ -272,7 +272,7 @@ void manager_waterman()
>  {
>       static bool first = true;
>       if (first)
> -             mon_bb(0, 0, 0);
> +             mon_shell(0, 0, 0);
>       smp_idle();
>       assert(0);
>  }
> diff --git a/kern/src/monitor.c b/kern/src/monitor.c
> index 7749f89..f24c87b 100644
> --- a/kern/src/monitor.c
> +++ b/kern/src/monitor.c
> @@ -62,7 +62,9 @@ static command_t commands[] = {
>       { "trace", "Run some tracing functions", mon_trace},
>       { "monitor", "Run the monitor on another core", mon_monitor},
>       { "fs", "Filesystem Diagnostics", mon_fs},
> -     { "bb", "Try to run busybox (ash)", mon_bb},
> +     { "sh", "Try to run a shell (bash)", mon_shell},
> +     { "bash", "Try to run a shell (bash)", mon_shell},
> +     { "bb", "Try to run a shell (bash)", mon_shell},
>       { "alarm", "Alarm Diagnostics", mon_alarm},
>       { "msr", "read/write msr: msr msr [value]", mon_msr},
>       { "db", "Misc debugging", mon_db},
> @@ -990,10 +992,10 @@ int mon_fs(int argc, char **argv, struct hw_trapframe 
> *hw_tf)
>       return 0;
>  }
>  
> -int mon_bb(int argc, char **argv, struct hw_trapframe *hw_tf)
> +int mon_shell(int argc, char **argv, struct hw_trapframe *hw_tf)
>  {
> -     char *l_argv[3] = {"", "busybox", "ash"};
> -     return mon_bin_run(3, l_argv, hw_tf);
> +     char *l_argv[2] = {"/bin/bash", "bash"};
> +     return mon_bin_run(2, l_argv, hw_tf);
>  }
>  
>  int mon_alarm(int argc, char **argv, struct hw_trapframe *hw_tf)

-- 
You received this message because you are subscribed to the Google Groups 
"Akaros" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to