Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/netsnmp: fix script net-snmp-create-v3-user's usage of 'ps'.
@ 2021-03-31  8:14 Nicolas Cavallari
  2021-03-31 19:49 ` Yann E. MORIN
  2021-04-04  9:25 ` Peter Korsgaard
  0 siblings, 2 replies; 3+ messages in thread
From: Nicolas Cavallari @ 2021-03-31  8:14 UTC (permalink / raw)
  To: buildroot

net-snmp-create-v3-user uses ps to check if snmpd is running.  To know
how to invoke 'ps', the build system use 'which ps' and does other
checks for the output format of 'ps', therefore inspecting 'ps' on the
build machine instead of the target.

If the build machine runs a OS like Debian, that uses a merged-usr and a
PATH of '/usr/bin:/bin', then 'which ps' returns /usr/bin/ps, which will
not work on the target if it does not also use a merged-usr.

Hardcode 'ps' to be /bin/ps to fix this issue and to improve build
reproducibility.

Signed-off-by: Nicolas Cavallari <nicolas.cavallari@green-communications.fr>
---
 package/netsnmp/netsnmp.mk | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/package/netsnmp/netsnmp.mk b/package/netsnmp/netsnmp.mk
index 5b22d1a063..1a9a776033 100644
--- a/package/netsnmp/netsnmp.mk
+++ b/package/netsnmp/netsnmp.mk
@@ -12,7 +12,9 @@ NETSNMP_LICENSE_FILES = COPYING
 NETSNMP_CPE_ID_VENDOR = net-snmp
 NETSNMP_CPE_ID_PRODUCT = $(NETSNMP_CPE_ID_VENDOR)
 NETSNMP_INSTALL_STAGING = YES
-NETSNMP_CONF_ENV = ac_cv_NETSNMP_CAN_USE_SYSCTL=no
+NETSNMP_CONF_ENV = \
+	ac_cv_NETSNMP_CAN_USE_SYSCTL=no \
+	ac_cv_path_PSPROG=/bin/ps
 NETSNMP_CONF_OPTS = \
 	--with-persistent-directory=/var/lib/snmp \
 	--with-defaults \
-- 
2.31.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH 1/1] package/netsnmp: fix script net-snmp-create-v3-user's usage of 'ps'.
  2021-03-31  8:14 [Buildroot] [PATCH 1/1] package/netsnmp: fix script net-snmp-create-v3-user's usage of 'ps' Nicolas Cavallari
@ 2021-03-31 19:49 ` Yann E. MORIN
  2021-04-04  9:25 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Yann E. MORIN @ 2021-03-31 19:49 UTC (permalink / raw)
  To: buildroot

Nicolas, All,

On 2021-03-31 10:14 +0200, Nicolas Cavallari spake thusly:
> net-snmp-create-v3-user uses ps to check if snmpd is running.  To know
> how to invoke 'ps', the build system use 'which ps' and does other
> checks for the output format of 'ps', therefore inspecting 'ps' on the
> build machine instead of the target.
> 
> If the build machine runs a OS like Debian, that uses a merged-usr and a
> PATH of '/usr/bin:/bin', then 'which ps' returns /usr/bin/ps, which will
> not work on the target if it does not also use a merged-usr.
> 
> Hardcode 'ps' to be /bin/ps to fix this issue and to improve build
> reproducibility.
> 
> Signed-off-by: Nicolas Cavallari <nicolas.cavallari@green-communications.fr>

Applied to master, thanks.

Regards,
Yann E. MORIN.

> ---
>  package/netsnmp/netsnmp.mk | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/package/netsnmp/netsnmp.mk b/package/netsnmp/netsnmp.mk
> index 5b22d1a063..1a9a776033 100644
> --- a/package/netsnmp/netsnmp.mk
> +++ b/package/netsnmp/netsnmp.mk
> @@ -12,7 +12,9 @@ NETSNMP_LICENSE_FILES = COPYING
>  NETSNMP_CPE_ID_VENDOR = net-snmp
>  NETSNMP_CPE_ID_PRODUCT = $(NETSNMP_CPE_ID_VENDOR)
>  NETSNMP_INSTALL_STAGING = YES
> -NETSNMP_CONF_ENV = ac_cv_NETSNMP_CAN_USE_SYSCTL=no
> +NETSNMP_CONF_ENV = \
> +	ac_cv_NETSNMP_CAN_USE_SYSCTL=no \
> +	ac_cv_path_PSPROG=/bin/ps
>  NETSNMP_CONF_OPTS = \
>  	--with-persistent-directory=/var/lib/snmp \
>  	--with-defaults \
> -- 
> 2.31.0
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/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.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH 1/1] package/netsnmp: fix script net-snmp-create-v3-user's usage of 'ps'.
  2021-03-31  8:14 [Buildroot] [PATCH 1/1] package/netsnmp: fix script net-snmp-create-v3-user's usage of 'ps' Nicolas Cavallari
  2021-03-31 19:49 ` Yann E. MORIN
@ 2021-04-04  9:25 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2021-04-04  9:25 UTC (permalink / raw)
  To: buildroot

>>>>> "Nicolas" == Nicolas Cavallari <nicolas.cavallari@green-communications.fr> writes:

 > net-snmp-create-v3-user uses ps to check if snmpd is running.  To know
 > how to invoke 'ps', the build system use 'which ps' and does other
 > checks for the output format of 'ps', therefore inspecting 'ps' on the
 > build machine instead of the target.

 > If the build machine runs a OS like Debian, that uses a merged-usr and a
 > PATH of '/usr/bin:/bin', then 'which ps' returns /usr/bin/ps, which will
 > not work on the target if it does not also use a merged-usr.

 > Hardcode 'ps' to be /bin/ps to fix this issue and to improve build
 > reproducibility.

 > Signed-off-by: Nicolas Cavallari <nicolas.cavallari@green-communications.fr>

Committed to 2020.02.x, 2020.11.x and 2021.02.x, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-04-04  9:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-31  8:14 [Buildroot] [PATCH 1/1] package/netsnmp: fix script net-snmp-create-v3-user's usage of 'ps' Nicolas Cavallari
2021-03-31 19:49 ` Yann E. MORIN
2021-04-04  9:25 ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox