[LEDE-DEV] [PATCH] ubox: kmodloader: support '-q' quiet option
Felix Fietkau
nbd at nbd.name
Fri Jan 27 01:17:28 PST 2017
On 2017-01-27 10:12, Kevin Darbyshire-Bryant wrote:
> The kernel opportunistically attempts to load modules in advanced with
> 'predicted' module names. Often these modules don't exist and hence
> kmodloader produces lots of logfile noise. The kernel commandline to
> modprobe from kworker proceses is '-q -- modulename' where '-q' means
> quiet.
>
> Add very basic support for any option beginning 'q' as meaning quiet.
>
> Signed-off-by: Kevin Darbyshire-Bryant <kevin at darbyshire-bryant.me.uk>
> ---
> kmodloader.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/kmodloader.c b/kmodloader.c
> index 729027a..54ae961 100644
> --- a/kmodloader.c
> +++ b/kmodloader.c
> @@ -825,12 +825,15 @@ static int main_modprobe(int argc, char **argv)
> char *name;
> char *mod = NULL;
> int i;
> + bool quiet = false;
>
> for (i = 1; i < argc; i++)
> if (argv[i][0] != '-') {
> mod = argv[i];
> break;
> }
> + else if (argv[i][1] == 'q') quiet = true;
Please use getopt instead of custom hacked up option parsing.
- Felix
More information about the Lede-dev
mailing list