Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: Peter Korsgaard <peter@korsgaard.com>
Cc: buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH] package/procps-ng/S02sysctl: pass SYSCTL_ARGS before -p argument for busybox
Date: Fri, 17 May 2024 16:40:18 +0200	[thread overview]
Message-ID: <ZkdsUlPt6FN6LizI@landeda> (raw)
In-Reply-To: <20240517141413.1716448-1-peter@korsgaard.com>

Peter, All,

On 2024-05-17 16:14 +0200, Peter Korsgaard spake thusly:
> The busybox sysctl applet expects all arguments after -p to be filenames to
> read:
> 
> sysctl -p file -h
> sysctl: -h: No such file or directory
> 
> VS:
> 
> sysctl -h -p file
> sysctl: invalid option -- 'h'
> BusyBox v1.36.1 (2024-05-17 15:27:21 CEST) multi-call binary.
> 
> Usage: sysctl [-enq] { -a | -p [FILE]... | [-w] [KEY[=VALUE]]... }
> 
> Show/set kernel parameters
> 
>         -e      Don't warn about unknown keys
>         -n      Don't show key names
>         -q      Quiet
>         -a      Show all values
>         -p      Set values from FILEs (default /etc/sysctl.conf)
>         -w      Set values
> 
> This seems to be the intented behaviour:
> https://git.busybox.net/busybox/tree/procps/sysctl.c#n317
> 
> Notice: The procps-ng variant is happy with both:
> 
> sysctl -p file -h
> 
> Usage:
>  sysctl [options] [variable[=value] ...]
> 
> VS:
> 
> sysctl -h -p file
> 
> Usage:
>  sysctl [options] [variable[=value] ...]
> 
> So pass SYSCTL_ARGS before the -p args so custom sysctl arguments can be
> passed.
> 
> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>

Applied to master, thanks.

Regards,
Yann E. MORIN.

> ---
>  package/procps-ng/S02sysctl | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/package/procps-ng/S02sysctl b/package/procps-ng/S02sysctl
> index 85d9ed50d0..c202833ab8 100644
> --- a/package/procps-ng/S02sysctl
> +++ b/package/procps-ng/S02sysctl
> @@ -43,7 +43,7 @@ run_logger() {
>  				break
>  			}
>  			echo "* Applying $file ..."
> -			/sbin/sysctl -p "$file" $SYSCTL_ARGS || prog_status="FAIL"
> +			/sbin/sysctl $SYSCTL_ARGS -p "$file" || prog_status="FAIL"
>  		done 2>&1 >&3 | /usr/bin/logger -t sysctl -p kern.err
>  	} 3>&1 | /usr/bin/logger -t sysctl -p kern.info
>  }
> @@ -60,7 +60,7 @@ run_std() {
>  				break
>  			}
>  			echo "* Applying $file ..."
> -			/sbin/sysctl -p "$file" $SYSCTL_ARGS || prog_status="FAIL"
> +			/sbin/sysctl $SYSCTL_ARGS -p "$file" || prog_status="FAIL"
>  		done
>  	}
>  }
> -- 
> 2.39.2
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

      reply	other threads:[~2024-05-17 14:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-17 14:14 [Buildroot] [PATCH] package/procps-ng/S02sysctl: pass SYSCTL_ARGS before -p argument for busybox Peter Korsgaard
2024-05-17 14:40 ` Yann E. MORIN [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZkdsUlPt6FN6LizI@landeda \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@buildroot.org \
    --cc=peter@korsgaard.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox