[LEDE-DEV] [PATCH] procd: update modprobe path

Yousong Zhou yszhou4tech at gmail.com
Mon Feb 20 17:50:12 PST 2017


On 21 February 2017 at 04:39, Nathan Hintz <nlhintz at hotmail.com> wrote:
> Commit 81aeba9b7f619ee1af1a64f355ae8001fa147d03 in LEDE source.git moved
> modprobe to the "/sbin" directory.  Update procd with the new path.
>
> Signed-off-by: Nathan Hintz <nlhintz at hotmail.com>
> ---
>  initd/zram.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/initd/zram.c b/initd/zram.c
> index 9fab794..0e78195 100644
> --- a/initd/zram.c
> +++ b/initd/zram.c
> @@ -53,9 +53,9 @@ static int
>  early_insmod(char *module)
>  {
>         pid_t pid = fork();
> +       char *modprobe[] = { "/sbin/modprobe", NULL, NULL };
>
>         if (!pid) {
> -               char *modprobe[] = { "/usr/sbin/modprobe", NULL, NULL };
>                 char *path;
>                 struct utsname ver;
>
> @@ -64,12 +64,12 @@ early_insmod(char *module)
>                 sprintf(path, module, ver.release);
>                 modprobe[1] = path;
>                 execvp(modprobe[0], modprobe);
> -               ERROR("Can't exec /usr/sbin/modprobe\n");
> +               ERROR("Can't exec %s\n", modprobe[0]);
>                 exit(-1);
>         }
>
>         if (pid <= 0) {
> -               ERROR("Can't exec /usr/sbin/modprobe\n");
> +               ERROR("Can't exec %s\n", modprobe[0]);

Though it happens rarely, it would be better if we can distinguish
from log the error between fork and exec call.

>                 return -1;
>         } else {
>                 waitpid(pid, NULL, 0);
> @@ -107,10 +107,10 @@ mount_zram_on_tmp(void)
>         pid = fork();
>         if (!pid) {
>                 execvp(mkfs[0], mkfs);
> -               ERROR("Can't exec /sbin/mkfs.ext4\n");
> +               ERROR("Can't exec %s\n", mkfs[0]);
>                 exit(-1);
>         } else if (pid <= 0) {
> -               ERROR("Can't exec /sbin/mkfs.ext4\n");
> +               ERROR("Can't exec %s\n", mkfs[0]);

Same here.

Other than that, ACK from me.  Thanks

                yousong

>                 return -1;
>         } else {
>                 waitpid(pid, NULL, 0);
> --
> 2.9.3
>
>
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev



More information about the Lede-dev mailing list