[Buildroot] [PATCH] network-manager: support a defaults file in the init script

Thomas Petazzoni thomas.petazzoni at bootlin.com
Sun Apr 15 19:59:05 UTC 2018


Hello,

On Fri, 13 Apr 2018 13:00:27 -0300, Carlos Santos wrote:
> Sometimes it is useful to pass some parameters to NetworkManager when it
> starts (e.g. --log-level) instead of editting NetworkManager.conf. Allow
> the user add a file with a NETWORKMANAGER_ARGS variable containing such
> flags. This is simpler than overriding the whole startup script (e.g. by
> means of a rootfs overlay).
> 
> Signed-off-by: Carlos Santos <casantos at datacom.ind.br>

I've applied to master. However, a few comments below.

> ---
>  package/network-manager/S45network-manager | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/package/network-manager/S45network-manager b/package/network-manager/S45network-manager
> index f39e20d73b..bb4bf164a5 100755
> --- a/package/network-manager/S45network-manager
> +++ b/package/network-manager/S45network-manager
> @@ -1,5 +1,8 @@
>  #!/bin/sh
>  
> +# Allow a few customizations from a config file
> +test -r /etc/default/NetworkManager && . /etc/default/NetworkManager
> +
>  prefix=/usr
>  exec_prefix=/usr
>  sbindir=${exec_prefix}/sbin

Same as the modem-manager discussion: I don't think the
NETWORKMANAGER_BIN variable, and testing that the binary file is
executable really makes sense.

> @@ -14,7 +17,7 @@ case "$1" in
>  		printf "Starting NetworkManager ... "
>  		[ ! -d /var/run/NetworkManager ] && install -d /var/run/NetworkManager
>  		if [ -z "$PID" ]; then
> -			$NETWORKMANAGER_BIN
> +			$NETWORKMANAGER_BIN $NETWORKMANAGER_ARGS

Any idea why start-stop-daemon is not used ?

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com


More information about the buildroot mailing list