diff mbox series

[v2,1/3] inetutils: don't guess target paths

Message ID 20230830102039.166372-1-ross.burton@arm.com
State New
Headers show
Series [v2,1/3] inetutils: don't guess target paths | expand

Commit Message

Ross Burton Aug. 30, 2023, 10:20 a.m. UTC
From: Ross Burton <ross.burton@arm.com>

inetutils guesses a lot of target paths in cross builds, and warns that
some of them are known to be wrong (for example, whether /proc/net/dev
exists is guessed as 'no').

Add a post-configure function to check for these warnings, and pass
--with-path-* as appropriate to set the paths explicitly.

This means we can remove the patch which was setting PATH_PROCNET_DEV,
and the autoconf cache value inetutils_cv_path_login.

The downside is that these --with-path-* options are not real autoconf
options, so the "unknown options" warning is emitted.  Losing those is
an acceptable compromise, so disable it.

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 .../inetutils-1.9-PATH_PROCNET_DEV.patch      | 37 -------------------
 .../inetutils/inetutils_2.4.bb                | 19 ++++++++--
 2 files changed, 16 insertions(+), 40 deletions(-)
 delete mode 100644 meta/recipes-connectivity/inetutils/inetutils/inetutils-1.9-PATH_PROCNET_DEV.patch

Comments

Alexandre Belloni Aug. 31, 2023, 7:22 a.m. UTC | #1
Hello Ross,

I think this causes failures with musl:
ERROR: inetutils-2.4-r0 do_configure: Default path values used, these must be set explicitly

https://autobuilder.yoctoproject.org/typhoon/#/builders/64/builds/7684/steps/11/logs/stdio
https://autobuilder.yoctoproject.org/typhoon/#/builders/45/builds/7706/steps/12/logs/stdio

On 30/08/2023 11:20:37+0100, Ross Burton wrote:
> From: Ross Burton <ross.burton@arm.com>
> 
> inetutils guesses a lot of target paths in cross builds, and warns that
> some of them are known to be wrong (for example, whether /proc/net/dev
> exists is guessed as 'no').
> 
> Add a post-configure function to check for these warnings, and pass
> --with-path-* as appropriate to set the paths explicitly.
> 
> This means we can remove the patch which was setting PATH_PROCNET_DEV,
> and the autoconf cache value inetutils_cv_path_login.
> 
> The downside is that these --with-path-* options are not real autoconf
> options, so the "unknown options" warning is emitted.  Losing those is
> an acceptable compromise, so disable it.
> 
> Signed-off-by: Ross Burton <ross.burton@arm.com>
> ---
>  .../inetutils-1.9-PATH_PROCNET_DEV.patch      | 37 -------------------
>  .../inetutils/inetutils_2.4.bb                | 19 ++++++++--
>  2 files changed, 16 insertions(+), 40 deletions(-)
>  delete mode 100644 meta/recipes-connectivity/inetutils/inetutils/inetutils-1.9-PATH_PROCNET_DEV.patch
> 
> diff --git a/meta/recipes-connectivity/inetutils/inetutils/inetutils-1.9-PATH_PROCNET_DEV.patch b/meta/recipes-connectivity/inetutils/inetutils/inetutils-1.9-PATH_PROCNET_DEV.patch
> deleted file mode 100644
> index 460ddf98300..00000000000
> --- a/meta/recipes-connectivity/inetutils/inetutils/inetutils-1.9-PATH_PROCNET_DEV.patch
> +++ /dev/null
> @@ -1,37 +0,0 @@
> -From 101130f422dd5c01a1459645d7b2a5b8d19720ab Mon Sep 17 00:00:00 2001
> -From: Martin Jansa <martin.jansa@gmail.com>
> -Date: Wed, 6 Mar 2019 09:36:11 -0500
> -Subject: [PATCH] inetutils: define PATH_PROCNET_DEV if not already defined
> -MIME-Version: 1.0
> -Content-Type: text/plain; charset=UTF-8
> -Content-Transfer-Encoding: 8bit
> -
> -this prevents the following compilation error :
> -system/linux.c:401:15: error: 'PATH_PROCNET_DEV' undeclared (first use in this function)
> -
> -this patch comes from :
> - http://repository.timesys.com/buildsources/i/inetutils/inetutils-1.9/
> -
> -Upstream-Status: Inappropriate [not author]
> -
> -Signed-of-by: Eric B�nard <eric@eukrea.com>
> -
> ----
> - ifconfig/system/linux.c | 4 ++++
> - 1 file changed, 4 insertions(+)
> -
> -diff --git a/ifconfig/system/linux.c b/ifconfig/system/linux.c
> -index e453b46..4268ca9 100644
> ---- a/ifconfig/system/linux.c
> -+++ b/ifconfig/system/linux.c
> -@@ -53,6 +53,10 @@
> - #include "../ifconfig.h"
> - 
> - 
> -+#ifndef PATH_PROCNET_DEV
> -+  #define PATH_PROCNET_DEV "/proc/net/dev"
> -+#endif
> -+
> - /* ARPHRD stuff.  */
> - 
> - static void
> diff --git a/meta/recipes-connectivity/inetutils/inetutils_2.4.bb b/meta/recipes-connectivity/inetutils/inetutils_2.4.bb
> index 85e9f642b30..fdbcbb53369 100644
> --- a/meta/recipes-connectivity/inetutils/inetutils_2.4.bb
> +++ b/meta/recipes-connectivity/inetutils/inetutils_2.4.bb
> @@ -20,7 +20,6 @@ SRC_URI = "${GNU_MIRROR}/inetutils/inetutils-${PV}.tar.xz \
>             file://rsh.xinetd.inetutils \
>             file://telnet.xinetd.inetutils \
>             file://tftpd.xinetd.inetutils \
> -           file://inetutils-1.9-PATH_PROCNET_DEV.patch \
>             file://inetutils-only-check-pam_appl.h-when-pam-enabled.patch \
>             file://0001-CVE-2023-40303-ftpd-rcp-rlogin-rsh-rshd-uucpd-fix-ch.patch \
>             file://0002-CVE-2023-40303-Indent-changes-in-previous-commit.patch \
> @@ -42,15 +41,29 @@ PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6 gl_cv_socket_ipv6=no,"
>  PACKAGECONFIG[ping6] = "--enable-ping6,--disable-ping6,"
>  
>  EXTRA_OECONF = "--with-ncurses-include-dir=${STAGING_INCDIR} \
> -        inetutils_cv_path_login=${base_bindir}/login \
>          --with-libreadline-prefix=${STAGING_LIBDIR} \
>          --enable-rpath=no \
> -"
> +        --with-path-login=${base_bindir}/login \
> +        --with-path-cp=${base_bindir}/cp \
> +        --with-path-uucico=${libexecdir}/uuico \
> +        --with-path-procnet-dev=/proc/net/dev \
> +        "
>  
>  # These are horrible for security, disable them
>  EXTRA_OECONF:append = " --disable-rsh --disable-rshd --disable-rcp \
>          --disable-rlogin --disable-rlogind --disable-rexec --disable-rexecd"
>  
> +# The configure script guesses many paths in cross builds, check for this happening
> +do_configure_cross_check() {
> +    if grep "may be incorrect because of cross-compilation" ${B}/config.log; then
> +        bberror Default path values used, these must be set explicitly
> +    fi
> +}
> +do_configure[postfuncs] += "do_configure_cross_check"
> +
> +# The --with-path options are not actually options, so this check needs to be silenced
> +ERROR_QA:remove = "unknown-configure-option"
> +
>  do_configure:prepend () {
>      export HELP2MAN='true'
>      cp ${STAGING_DATADIR_NATIVE}/gettext/config.rpath ${S}/build-aux/config.rpath
> -- 
> 2.34.1
> 

> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#186880): https://lists.openembedded.org/g/openembedded-core/message/186880
> Mute This Topic: https://lists.openembedded.org/mt/101049210/3617179
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alexandre.belloni@bootlin.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Ross Burton Aug. 31, 2023, 11:23 a.m. UTC | #2
On 31 Aug 2023, at 08:22, Alexandre Belloni <alexandre.belloni@bootlin.com> wrote:
> 
> Hello Ross,
> 
> I think this causes failures with musl:
> ERROR: inetutils-2.4-r0 do_configure: Default path values used, these must be set explicitly
> 
> https://autobuilder.yoctoproject.org/typhoon/#/builders/64/builds/7684/steps/11/logs/stdio
> https://autobuilder.yoctoproject.org/typhoon/#/builders/45/builds/7706/steps/12/logs/stdio

Yes, thanks, v2 sent.

Ross
diff mbox series

Patch

diff --git a/meta/recipes-connectivity/inetutils/inetutils/inetutils-1.9-PATH_PROCNET_DEV.patch b/meta/recipes-connectivity/inetutils/inetutils/inetutils-1.9-PATH_PROCNET_DEV.patch
deleted file mode 100644
index 460ddf98300..00000000000
--- a/meta/recipes-connectivity/inetutils/inetutils/inetutils-1.9-PATH_PROCNET_DEV.patch
+++ /dev/null
@@ -1,37 +0,0 @@ 
-From 101130f422dd5c01a1459645d7b2a5b8d19720ab Mon Sep 17 00:00:00 2001
-From: Martin Jansa <martin.jansa@gmail.com>
-Date: Wed, 6 Mar 2019 09:36:11 -0500
-Subject: [PATCH] inetutils: define PATH_PROCNET_DEV if not already defined
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-this prevents the following compilation error :
-system/linux.c:401:15: error: 'PATH_PROCNET_DEV' undeclared (first use in this function)
-
-this patch comes from :
- http://repository.timesys.com/buildsources/i/inetutils/inetutils-1.9/
-
-Upstream-Status: Inappropriate [not author]
-
-Signed-of-by: Eric Bénard <eric@eukrea.com>
-
----
- ifconfig/system/linux.c | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/ifconfig/system/linux.c b/ifconfig/system/linux.c
-index e453b46..4268ca9 100644
---- a/ifconfig/system/linux.c
-+++ b/ifconfig/system/linux.c
-@@ -53,6 +53,10 @@
- #include "../ifconfig.h"
- 
- 
-+#ifndef PATH_PROCNET_DEV
-+  #define PATH_PROCNET_DEV "/proc/net/dev"
-+#endif
-+
- /* ARPHRD stuff.  */
- 
- static void
diff --git a/meta/recipes-connectivity/inetutils/inetutils_2.4.bb b/meta/recipes-connectivity/inetutils/inetutils_2.4.bb
index 85e9f642b30..fdbcbb53369 100644
--- a/meta/recipes-connectivity/inetutils/inetutils_2.4.bb
+++ b/meta/recipes-connectivity/inetutils/inetutils_2.4.bb
@@ -20,7 +20,6 @@  SRC_URI = "${GNU_MIRROR}/inetutils/inetutils-${PV}.tar.xz \
            file://rsh.xinetd.inetutils \
            file://telnet.xinetd.inetutils \
            file://tftpd.xinetd.inetutils \
-           file://inetutils-1.9-PATH_PROCNET_DEV.patch \
            file://inetutils-only-check-pam_appl.h-when-pam-enabled.patch \
            file://0001-CVE-2023-40303-ftpd-rcp-rlogin-rsh-rshd-uucpd-fix-ch.patch \
            file://0002-CVE-2023-40303-Indent-changes-in-previous-commit.patch \
@@ -42,15 +41,29 @@  PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6 gl_cv_socket_ipv6=no,"
 PACKAGECONFIG[ping6] = "--enable-ping6,--disable-ping6,"
 
 EXTRA_OECONF = "--with-ncurses-include-dir=${STAGING_INCDIR} \
-        inetutils_cv_path_login=${base_bindir}/login \
         --with-libreadline-prefix=${STAGING_LIBDIR} \
         --enable-rpath=no \
-"
+        --with-path-login=${base_bindir}/login \
+        --with-path-cp=${base_bindir}/cp \
+        --with-path-uucico=${libexecdir}/uuico \
+        --with-path-procnet-dev=/proc/net/dev \
+        "
 
 # These are horrible for security, disable them
 EXTRA_OECONF:append = " --disable-rsh --disable-rshd --disable-rcp \
         --disable-rlogin --disable-rlogind --disable-rexec --disable-rexecd"
 
+# The configure script guesses many paths in cross builds, check for this happening
+do_configure_cross_check() {
+    if grep "may be incorrect because of cross-compilation" ${B}/config.log; then
+        bberror Default path values used, these must be set explicitly
+    fi
+}
+do_configure[postfuncs] += "do_configure_cross_check"
+
+# The --with-path options are not actually options, so this check needs to be silenced
+ERROR_QA:remove = "unknown-configure-option"
+
 do_configure:prepend () {
     export HELP2MAN='true'
     cp ${STAGING_DATADIR_NATIVE}/gettext/config.rpath ${S}/build-aux/config.rpath