[Toybox] pull: fix modprobe, login, switch_root, improve init, reboot

Rob Landley rob at landley.net
Thu Oct 1 02:42:34 PDT 2015


Still going through old posts, I'm up to:

On 08/09/2015 12:24 AM, Isaac Dunham wrote:
>>> > > If hard-coding "modprobe -bq $MODALIAS" int mdev is desireable, I can send
>>> > > that; but I suspect it's not quite fit for inclusion.
>> > 
>> > I'd be interested in seeing the patch.
> Attached!
> 
> Thanks,
> Isaac Dunham
> 
>>From 0acde7ff07603e7b485bc19ec4a49b3010c49966 Mon Sep 17 00:00:00 2001
> From: Isaac Dunham <ibid.ag at gmail.com>
> Date: Mon, 3 Aug 2015 13:28:36 -0700
> Subject: [PATCH] mdev: autoload modules on hotplug.
> 
> ---
>  toys/pending/mdev.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/toys/pending/mdev.c b/toys/pending/mdev.c
> index a13a53d..b273d4a 100644
> --- a/toys/pending/mdev.c
> +++ b/toys/pending/mdev.c
> @@ -58,6 +58,8 @@ static void make_device(char *path)
>    } else {
>      // if (!path), do hotplug
>  
> +    if ((temp = getenv("MODALIAS")))
> +      xexec((char *[]){"modprobe", temp, 0});
>      if (!(temp = getenv("SUBSYSTEM")))
>        return;
>      type = strcmp(temp, "block") ? S_IFCHR : S_IFBLK;

The problem here is that does xexec, which is an exec so it replaces the
current process, meaning the rest of processing doesn't happen.

Do you mean xrun() maybe? (Spawns child process and waits for it to
return, reporting exit code.) Or is modalias really the only thing this
call is expected to do?

(I note that I have a todo item to implement demon mode doing the
netlink thing, in which case xexec() would again be the wrong thing...)

Rob

 1443692554.0


More information about the Toybox mailing list