All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-networking][PATCH] net-snmp: improve reproducibility
@ 2021-01-29  9:39 Yu, Mingli
  2021-02-02 16:13 ` [oe] " Martin Jansa
  0 siblings, 1 reply; 3+ messages in thread
From: Yu, Mingli @ 2021-01-29  9:39 UTC (permalink / raw)
  To: openembedded-devel

From: Mingli Yu <mingli.yu@windriver.com>

Add a patch to fix the gap between 32bit and 64bit system when
the configure option "--with-openssl=${STAGING_EXECPREFIXDIR}"
passed in.

Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
---
 ...ath.m4-keep-consistent-between-32bit.patch | 39 +++++++++++++++++++
 .../net-snmp/net-snmp_5.9.bb                  |  7 +++-
 2 files changed, 44 insertions(+), 2 deletions(-)
 create mode 100644 meta-networking/recipes-protocols/net-snmp/net-snmp/0001-ac_add_search_path.m4-keep-consistent-between-32bit.patch

diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-ac_add_search_path.m4-keep-consistent-between-32bit.patch b/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-ac_add_search_path.m4-keep-consistent-between-32bit.patch
new file mode 100644
index 000000000..4cd729044
--- /dev/null
+++ b/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-ac_add_search_path.m4-keep-consistent-between-32bit.patch
@@ -0,0 +1,39 @@
+From 6f8ea2e841ad45eed193310b599d3f3b410ae91d Mon Sep 17 00:00:00 2001
+From: Mingli Yu <mingli.yu@windriver.com>
+Date: Fri, 29 Jan 2021 08:49:15 +0000
+Subject: [PATCH] ac_add_search_path.m4: keep consistent between 32bit and 64bit
+
+With configure option "--with-openssl=${STAGING_EXECPREFIXDIR}", it behaves
+differently between 32bit and 64bit system as the openssl lib resides under
+/build/tmp/work/corei7-64-wrs-linux/net-snmp/5.9-r0/recipe-sysroot/usr/lib64
+for 64bit system, but resides under [1] for 32bit system.
+
+So add the patch to fix the gap between 32bit and 64bit system.
+
+[1] /build/tmp/work/corei7-64-wrs-linux/net-snmp/5.9-r0/recipe-sysroot/usr/lib
+
+Upstream-Status: Inappropriate [configuration specific]
+
+Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
+---
+ m4/ac_add_search_path.m4 | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/m4/ac_add_search_path.m4 b/m4/ac_add_search_path.m4
+index 8e0a819..961f587 100644
+--- a/m4/ac_add_search_path.m4
++++ b/m4/ac_add_search_path.m4
+@@ -3,8 +3,8 @@ dnl Add a search path to the LIBS and CPPFLAGS variables
+ dnl
+ AC_DEFUN([AC_ADD_SEARCH_PATH],[
+   if test "x$1" != x -a -d $1; then
+-     if test -d $1/lib; then
+-       LDFLAGS="-L$1/lib $LDFLAGS"
++     if test -d $1/${libdir:5}; then
++       LDFLAGS="-L$1/${libdir:5} $LDFLAGS"
+      fi
+      if test -d $1/include; then
+ 	CPPFLAGS="-I$1/include $CPPFLAGS"
+-- 
+2.29.2
+
diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.bb b/meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.bb
index bee83c4d1..ac78ed2d5 100644
--- a/meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.bb
+++ b/meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.bb
@@ -25,6 +25,7 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/net-snmp/net-snmp-${PV}.tar.gz \
            file://net-snmp-5.7.2-fix-engineBoots-value-on-SIGHUP.patch \
            file://net-snmp-fix-for-disable-des.patch \
            file://reproducibility-have-printcap.patch \
+           file://0001-ac_add_search_path.m4-keep-consistent-between-32bit.patch \
            "
 SRC_URI[sha256sum] = "04303a66f85d6d8b16d3cc53bde50428877c82ab524e17591dfceaeb94df6071"
 
@@ -128,10 +129,12 @@ do_install_append() {
         -e 's@[^ ]*--with-install-prefix=[^ "]*@@g' \
         -e 's@[^ ]*PKG_CONFIG_PATH=[^ "]*@@g' \
         -e 's@[^ ]*PKG_CONFIG_LIBDIR=[^ "]*@@g' \
-        -e 's@-L${STAGING_DIR_HOST}${libdir}@@g' \
-        -e 's@-I${STAGING_DIR_HOST}${includedir}@@g' \
+        -e 's@${STAGING_DIR_HOST}@@g' \
         -i ${D}${bindir}/net-snmp-config
 
+    sed -e 's@${STAGING_DIR_HOST}@@g' \
+        -i ${D}${libdir}/pkgconfig/{netsnmp-agent.pc,netsnmp.pc}
+
     if [ "${HAS_PERL}" = "1" ]; then
         sed -e "s@^NSC_INCLUDEDIR=.*@NSC_INCLUDEDIR=\$\{includedir\}@g" \
             -e "s@^NSC_LIBDIR=-L.*@NSC_LIBDIR=-L\$\{libdir\}@g" \
-- 
2.17.1


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

* Re: [oe] [meta-networking][PATCH] net-snmp: improve reproducibility
  2021-01-29  9:39 [meta-networking][PATCH] net-snmp: improve reproducibility Yu, Mingli
@ 2021-02-02 16:13 ` Martin Jansa
  0 siblings, 0 replies; 3+ messages in thread
From: Martin Jansa @ 2021-02-02 16:13 UTC (permalink / raw)
  To: Yu, Mingli; +Cc: openembedded-devel

[-- Attachment #1: Type: text/plain, Size: 4444 bytes --]

dash doesn't like this:
sed: can't read
net-snmp/5.9-r0/image/usr/lib/pkgconfig/{netsnmp-agent.pc,netsnmp.pc}: No
such file or directory

will send a fix shortly

On Fri, Jan 29, 2021 at 10:39 AM Yu, Mingli <mingli.yu@windriver.com> wrote:

> From: Mingli Yu <mingli.yu@windriver.com>
>
> Add a patch to fix the gap between 32bit and 64bit system when
> the configure option "--with-openssl=${STAGING_EXECPREFIXDIR}"
> passed in.
>
> Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
> ---
>  ...ath.m4-keep-consistent-between-32bit.patch | 39 +++++++++++++++++++
>  .../net-snmp/net-snmp_5.9.bb                  |  7 +++-
>  2 files changed, 44 insertions(+), 2 deletions(-)
>  create mode 100644
> meta-networking/recipes-protocols/net-snmp/net-snmp/0001-ac_add_search_path.m4-keep-consistent-between-32bit.patch
>
> diff --git
> a/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-ac_add_search_path.m4-keep-consistent-between-32bit.patch
> b/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-ac_add_search_path.m4-keep-consistent-between-32bit.patch
> new file mode 100644
> index 000000000..4cd729044
> --- /dev/null
> +++
> b/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-ac_add_search_path.m4-keep-consistent-between-32bit.patch
> @@ -0,0 +1,39 @@
> +From 6f8ea2e841ad45eed193310b599d3f3b410ae91d Mon Sep 17 00:00:00 2001
> +From: Mingli Yu <mingli.yu@windriver.com>
> +Date: Fri, 29 Jan 2021 08:49:15 +0000
> +Subject: [PATCH] ac_add_search_path.m4: keep consistent between 32bit and
> 64bit
> +
> +With configure option "--with-openssl=${STAGING_EXECPREFIXDIR}", it
> behaves
> +differently between 32bit and 64bit system as the openssl lib resides
> under
>
> +/build/tmp/work/corei7-64-wrs-linux/net-snmp/5.9-r0/recipe-sysroot/usr/lib64
> +for 64bit system, but resides under [1] for 32bit system.
> +
> +So add the patch to fix the gap between 32bit and 64bit system.
> +
> +[1]
> /build/tmp/work/corei7-64-wrs-linux/net-snmp/5.9-r0/recipe-sysroot/usr/lib
> +
> +Upstream-Status: Inappropriate [configuration specific]
> +
> +Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
> +---
> + m4/ac_add_search_path.m4 | 4 ++--
> + 1 file changed, 2 insertions(+), 2 deletions(-)
> +
> +diff --git a/m4/ac_add_search_path.m4 b/m4/ac_add_search_path.m4
> +index 8e0a819..961f587 100644
> +--- a/m4/ac_add_search_path.m4
> ++++ b/m4/ac_add_search_path.m4
> +@@ -3,8 +3,8 @@ dnl Add a search path to the LIBS and CPPFLAGS variables
> + dnl
> + AC_DEFUN([AC_ADD_SEARCH_PATH],[
> +   if test "x$1" != x -a -d $1; then
> +-     if test -d $1/lib; then
> +-       LDFLAGS="-L$1/lib $LDFLAGS"
> ++     if test -d $1/${libdir:5}; then
> ++       LDFLAGS="-L$1/${libdir:5} $LDFLAGS"
> +      fi
> +      if test -d $1/include; then
> +       CPPFLAGS="-I$1/include $CPPFLAGS"
> +--
> +2.29.2
> +
> diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.bb
> b/meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.bb
> index bee83c4d1..ac78ed2d5 100644
> --- a/meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.bb
> +++ b/meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.bb
> @@ -25,6 +25,7 @@ SRC_URI =
> "${SOURCEFORGE_MIRROR}/net-snmp/net-snmp-${PV}.tar.gz \
>             file://net-snmp-5.7.2-fix-engineBoots-value-on-SIGHUP.patch \
>             file://net-snmp-fix-for-disable-des.patch \
>             file://reproducibility-have-printcap.patch \
> +
>  file://0001-ac_add_search_path.m4-keep-consistent-between-32bit.patch \
>             "
>  SRC_URI[sha256sum] =
> "04303a66f85d6d8b16d3cc53bde50428877c82ab524e17591dfceaeb94df6071"
>
> @@ -128,10 +129,12 @@ do_install_append() {
>          -e 's@[^ ]*--with-install-prefix=[^ "]*@@g' \
>          -e 's@[^ ]*PKG_CONFIG_PATH=[^ "]*@@g' \
>          -e 's@[^ ]*PKG_CONFIG_LIBDIR=[^ "]*@@g' \
> -        -e 's@-L${STAGING_DIR_HOST}${libdir}@@g' \
> -        -e 's@-I${STAGING_DIR_HOST}${includedir}@@g' \
> +        -e 's@${STAGING_DIR_HOST}@@g' \
>          -i ${D}${bindir}/net-snmp-config
>
> +    sed -e 's@${STAGING_DIR_HOST}@@g' \
> +        -i ${D}${libdir}/pkgconfig/{netsnmp-agent.pc,netsnmp.pc}
> +
>      if [ "${HAS_PERL}" = "1" ]; then
>          sed -e "s@^NSC_INCLUDEDIR=.*@NSC_INCLUDEDIR=\$\{includedir\}@g" \
>              -e "s@^NSC_LIBDIR=-L.*@NSC_LIBDIR=-L\$\{libdir\}@g" \
> --
> 2.17.1
>
>
> 
>
>

[-- Attachment #2: Type: text/html, Size: 5856 bytes --]

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

* [meta-networking][PATCH] net-snmp: improve reproducibility
@ 2018-09-28 15:24 Hongxu Jia
  0 siblings, 0 replies; 3+ messages in thread
From: Hongxu Jia @ 2018-09-28 15:24 UTC (permalink / raw)
  To: raj.khem; +Cc: openembedded-devel

- Remoe prefix ${RECIPE_SYSROOT} from net-snmp-config

- Remove configure options from versioninfo

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 ...remove-configure-options-from-versioninfo.patch | 42 ++++++++++++++++++++++
 .../recipes-protocols/net-snmp/net-snmp_5.8.bb     |  7 ++++
 2 files changed, 49 insertions(+)
 create mode 100644 meta-networking/recipes-protocols/net-snmp/net-snmp/0001-remove-configure-options-from-versioninfo.patch

diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-remove-configure-options-from-versioninfo.patch b/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-remove-configure-options-from-versioninfo.patch
new file mode 100644
index 0000000..2d54096
--- /dev/null
+++ b/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-remove-configure-options-from-versioninfo.patch
@@ -0,0 +1,42 @@
+From f592398b1c659f84168f5c84f63af3b71454b8f5 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Fri, 28 Sep 2018 22:59:23 +0800
+Subject: [PATCH] remove configure options from versioninfo
+
+Configure options contains host build paths which breaks
+binary reproducibility.
+
+It is no harm to remove it from version info.
+
+Upstream-Status: Inappropriate [cross compile specific]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ agent/mibgroup/ucd-snmp/versioninfo.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/agent/mibgroup/ucd-snmp/versioninfo.c b/agent/mibgroup/ucd-snmp/versioninfo.c
+index a5151c1..1160382 100644
+--- a/agent/mibgroup/ucd-snmp/versioninfo.c
++++ b/agent/mibgroup/ucd-snmp/versioninfo.c
+@@ -92,7 +92,7 @@ var_extensible_version(struct variable *vp,
+     static char     errmsg[300];
+     char           *cptr;
+     time_t          curtime;
+-#ifdef NETSNMP_CONFIGURE_OPTIONS
++#if 0
+     static char     config_opts[] = NETSNMP_CONFIGURE_OPTIONS;
+ #endif
+ 
+@@ -126,7 +126,7 @@ var_extensible_version(struct variable *vp,
+         *var_len = strlen(errmsg);
+         return ((u_char *) errmsg);
+     case VERCONFIG:
+-#ifdef NETSNMP_CONFIGURE_OPTIONS
++#if 0
+         *var_len = strlen(config_opts);
+         if (*var_len > 1024)
+             *var_len = 1024;    /* mib imposed restriction */
+-- 
+2.7.4
+
diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp_5.8.bb b/meta-networking/recipes-protocols/net-snmp/net-snmp_5.8.bb
index a32d09d..d47f9e4 100644
--- a/meta-networking/recipes-protocols/net-snmp/net-snmp_5.8.bb
+++ b/meta-networking/recipes-protocols/net-snmp/net-snmp_5.8.bb
@@ -24,6 +24,7 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/net-snmp/net-snmp-${PV}.zip \
            file://0004-configure-fix-incorrect-variable.patch \
            file://net-snmp-5.7.2-fix-engineBoots-value-on-SIGHUP.patch \
            file://net-snmp-fix-for-disable-des.patch \
+           file://0001-remove-configure-options-from-versioninfo.patch \
            "
 SRC_URI[md5sum] = "6aae5948df7efde626613d6a4b3cd9d4"
 SRC_URI[sha256sum] = "c6291385b8ed84f05890fe4197005daf7e7ee7b082c2e390fa114a9477a56042"
@@ -168,6 +169,12 @@ net_snmp_sysroot_preprocess () {
     fi
 }
 
+PACKAGE_PREPROCESS_FUNCS += "net_snmp_package_preprocess"
+net_snmp_package_preprocess () {
+    sed -e 's@${RECIPE_SYSROOT}@@g' \
+       -i ${PKGD}${bindir}/net-snmp-config
+}
+
 PACKAGES += "${PN}-libs ${PN}-mibs ${PN}-server ${PN}-client \
              ${PN}-server-snmpd ${PN}-server-snmptrapd \
              ${PN}-lib-netsnmp ${PN}-lib-agent ${PN}-lib-helpers \
-- 
2.7.4



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

end of thread, other threads:[~2021-02-02 16:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-29  9:39 [meta-networking][PATCH] net-snmp: improve reproducibility Yu, Mingli
2021-02-02 16:13 ` [oe] " Martin Jansa
  -- strict thread matches above, loose matches on Subject: below --
2018-09-28 15:24 Hongxu Jia

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.