Skip to contentSkip to conversation

nfs-utils: add PACKAGECONFIG for gssapi

PATCH Yi Zhao 2 participants 2 messages Feb 4, 2025 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Yi Zhao

author
#1 lore raw

Ping ...

//Yi

Quoted 106 lines · Yi Zhao via lists.openembedded.org

Add PACKAGECONFIG[gssapi] to support build with gss and svcgss.

---
  ...nd-krb5-config-for-cross-compilation.patch | 53 +++++++++++++++++++
  .../nfs-utils/nfs-utils_2.8.2.bb              |  4 +-
  2 files changed, 56 insertions(+), 1 deletion(-)

create mode 100644 meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Find-krb5-config-for-cross-compilation.patch

meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Find-krb5-config-for-cross-compilation.patch new file +53 -0
new file mode 100644
index 0000000000..019660c12f
@@ -0,0 +1,53 @@
+From 74d01a9e6d19eb963bbf081e3ea7c692759a8fe3 Mon Sep 17 00:00:00 2001
+From: Stefan Ghinea <[email protected]>
+Date: Mon, 18 Dec 2023 01:20:21 +0000
+Subject: [PATCH] Find krb5-config for cross-compilation
+
+With $dir being used as base search for both libgssapi and krb5-config,
+in OE krb5-config is found in $dir/bin/crossscripts instead of $dir/bin
+so add this to the search posibillities relative to $dir.
+Remove check for needing to set -rpath in KRBLDFLAGS.
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Stefan Ghinea <[email protected]>
+Signed-off-by: Haitao Liu <[email protected]>
+Signed-off-by: Yi Zhao <[email protected]>
+---
+ aclocal/kerberos5.m4 | 13 ++-----------
+ 1 file changed, 2 insertions(+), 11 deletions(-)
+
+diff --git a/aclocal/kerberos5.m4 b/aclocal/kerberos5.m4
+index f96f0fd..61bc81e 100644
+--- a/aclocal/kerberos5.m4
++++ b/aclocal/kerberos5.m4
+@@ -26,6 +26,8 @@ AC_DEFUN([AC_KERBEROS_V5],[
+       K5CONFIG=$dir/bin/krb5-config
+     elif test -f "/usr/kerberos/bin/krb5-config"; then
+       K5CONFIG="/usr/kerberos/bin/krb5-config"
++    elif test -f $dir/bin/crossscripts/krb5-config; then
++      K5CONFIG=$dir/bin/crossscripts/krb5-config
+     elif test -f "/usr/lib/mit/bin/krb5-config"; then
+       K5CONFIG="/usr/lib/mit/bin/krb5-config"
+     fi
+@@ -71,17 +73,6 @@ AC_DEFUN([AC_KERBEROS_V5],[
+   fi
+   AC_MSG_RESULT($KRBDIR)
+
+-  dnl Check if -rpath=$(KRBDIR)/lib is needed
+-  echo "The current KRBDIR is $KRBDIR"
+-  if test "$KRBDIR/lib" = "/lib" -o "$KRBDIR/lib" = "/usr/lib" \
+-       -o "$KRBDIR/lib" = "//lib" -o "$KRBDIR/lib" = "/usr//lib" ; then
+-    KRBLDFLAGS="";
+-  elif /sbin/ldconfig -p | grep > /dev/null "=> $KRBDIR/lib/"; then
+-    KRBLDFLAGS="";
+-  else
+-    KRBLDFLAGS="-Wl,-rpath=$KRBDIR/lib"
+-  fi
+-
+   dnl Now check for functions within gssapi library
+   AC_CHECK_LIB($gssapi_lib, gss_krb5_export_lucid_sec_context,
+     AC_DEFINE(HAVE_LUCID_CONTEXT_SUPPORT, 1, [Define this if the Kerberos GSS library supports gss_krb5_export_lucid_sec_context]), ,$KRBLIBS)
+--
+2.25.1
+
meta/recipes-connectivity/nfs-utils/nfs-utils_2.8.2.bb +3 -2
index 18c4a249b3..4cc698f62b 100644
@@ -32,6 +32,7 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/nfs-utils/${PV}/nfs-utils-${PV}.tar.x
             file://clang-warnings.patch \
             file://0001-locktest-Makefile.am-Do-not-use-build-flags.patch \
             file://0001-Fix-typecast-warning-with-clang.patch \
+           file://0001-Find-krb5-config-for-cross-compilation.patch \
             "
 
  SRC_URI[sha256sum] = "a39bbea76ac0ab9e6e8699caf3c308b6b310c20d458e8fa8606196d358e7fb15"
@@ -56,7 +57,6 @@ EXTRA_OECONF = "--with-statduser=rpcuser \
                  --enable-mountconfig \
                  --enable-libmount-mount \
                  --enable-uuid \
-                --disable-gss \
                  --disable-nfsdcltrack \
                  --with-statdpath=/var/lib/nfs/statd \
                  --with-rpcgen=${HOSTTOOLS_DIR}/rpcgen \
@@ -75,6 +75,8 @@ PACKAGECONFIG[nfsv41] = "--enable-nfsv41,--disable-nfsv41,libdevmapper,libdevmap
  # keyutils is available in meta-oe
  PACKAGECONFIG[nfsv4] = "--enable-nfsv4,--disable-nfsv4,keyutils,python3-core"
  PACKAGECONFIG[nfsdctl] = "--enable-nfsdctl,--disable-nfsdctl,libnl readline,"
+#krb5 is available in meta-oe
+PACKAGECONFIG[gssapi] = "--enable-gss --enable-svcgss --with-krb5=${STAGING_EXECPREFIXDIR},--disable-gss --disable-svcgss,krb5"
 
  PACKAGES =+ "${PN}-client ${PN}-mount ${PN}-stats ${PN}-rpcctl"
 
 
-=-=-=-=-=-=-=-=-=-=-=-

Links: You receive all messages sent to this group.
View/Reply Online (#210002): https://lists.openembedded.org/g/openembedded-core/message/210002
Mute This Topic: https://lists.openembedded.org/mt/110696372/7283133
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#2 lore raw

Using those custom thingy-config scripts is problematic as they're never written with cross-compilation in mind. Can the code be adjusted to find the needed items with pkg-config instead? Then it can be offered upstream.

Alex

Quoted 117 lines · Yi Zhao via lists.openembedded.org

Ping ...

//Yi

Quoted 92 lines · Yi Zhao via lists.openembedded.org

Add PACKAGECONFIG[gssapi] to support build with gss and svcgss.

---
  ...nd-krb5-config-for-cross-compilation.patch | 53 +++++++++++++++++++
  .../nfs-utils/nfs-utils_2.8.2.bb              |  4 +-
  2 files changed, 56 insertions(+), 1 deletion(-)

create mode 100644 meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Find-krb5-config-for-cross-compilation.patch

meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Find-krb5-config-for-cross-compilation.patch new file +53 -0
new file mode 100644
index 0000000000..019660c12f
@@ -0,0 +1,53 @@
+From 74d01a9e6d19eb963bbf081e3ea7c692759a8fe3 Mon Sep 17 00:00:00 2001
+From: Stefan Ghinea <[email protected]>
+Date: Mon, 18 Dec 2023 01:20:21 +0000
+Subject: [PATCH] Find krb5-config for cross-compilation
+
+With $dir being used as base search for both libgssapi and krb5-config,
+in OE krb5-config is found in $dir/bin/crossscripts instead of $dir/bin
+so add this to the search posibillities relative to $dir.
+Remove check for needing to set -rpath in KRBLDFLAGS.
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Stefan Ghinea <[email protected]>
+Signed-off-by: Haitao Liu <[email protected]>
+Signed-off-by: Yi Zhao <[email protected]>
+---
+ aclocal/kerberos5.m4 | 13 ++-----------
+ 1 file changed, 2 insertions(+), 11 deletions(-)
+
+diff --git a/aclocal/kerberos5.m4 b/aclocal/kerberos5.m4
+index f96f0fd..61bc81e 100644
+--- a/aclocal/kerberos5.m4
++++ b/aclocal/kerberos5.m4
+@@ -26,6 +26,8 @@ AC_DEFUN([AC_KERBEROS_V5],[
+       K5CONFIG=$dir/bin/krb5-config
+     elif test -f "/usr/kerberos/bin/krb5-config"; then
+       K5CONFIG="/usr/kerberos/bin/krb5-config"
++    elif test -f $dir/bin/crossscripts/krb5-config; then
++      K5CONFIG=$dir/bin/crossscripts/krb5-config
+     elif test -f "/usr/lib/mit/bin/krb5-config"; then
+       K5CONFIG="/usr/lib/mit/bin/krb5-config"
+     fi
+@@ -71,17 +73,6 @@ AC_DEFUN([AC_KERBEROS_V5],[
+   fi
+   AC_MSG_RESULT($KRBDIR)
+
+-  dnl Check if -rpath=$(KRBDIR)/lib is needed
+-  echo "The current KRBDIR is $KRBDIR"
+-  if test "$KRBDIR/lib" = "/lib" -o "$KRBDIR/lib" = "/usr/lib" \
+-       -o "$KRBDIR/lib" = "//lib" -o "$KRBDIR/lib" = "/usr//lib" ; then
+-    KRBLDFLAGS="";
+-  elif /sbin/ldconfig -p | grep > /dev/null "=> $KRBDIR/lib/"; then
+-    KRBLDFLAGS="";
+-  else
+-    KRBLDFLAGS="-Wl,-rpath=$KRBDIR/lib"
+-  fi
+-
+   dnl Now check for functions within gssapi library
+   AC_CHECK_LIB($gssapi_lib, gss_krb5_export_lucid_sec_context,
+     AC_DEFINE(HAVE_LUCID_CONTEXT_SUPPORT, 1, [Define this if the Kerberos GSS library supports gss_krb5_export_lucid_sec_context]), ,$KRBLIBS)
+--
+2.25.1
+
meta/recipes-connectivity/nfs-utils/nfs-utils_2.8.2.bb +1 -1
index 18c4a249b3..4cc698f62b 100644
@@ -32,6 +32,7 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/nfs-utils/${PV}/nfs-utils-${PV}.tar.x
             file://clang-warnings.patch \
             file://0001-locktest-Makefile.am-Do-not-use-build-flags.patch \
             file://0001-Fix-typecast-warning-with-clang.patch \
+           file://0001-Find-krb5-config-for-cross-compilation.patch \
             "
 
  SRC_URI[sha256sum] = "a39bbea76ac0ab9e6e8699caf3c308b6b310c20d458e8fa8606196d358e7fb15"
@@ -56,7 +57,6 @@ EXTRA_OECONF = "--with-statduser=rpcuser \
                  --enable-mountconfig \
                  --enable-libmount-mount \
                  --enable-uuid \
-                --disable-gss \
                  --disable-nfsdcltrack \
                  --with-statdpath=/var/lib/nfs/statd \
                  --with-rpcgen=${HOSTTOOLS_DIR}/rpcgen \

meta/recipes-connectivity/nfs-utils/nfs-utils_2.8.2.bb PACKAGECONFIG[nfsv41] = "--enable-nfsv41,--disable-nfsv41,libdevmapper,libdevmap · line 82

Quoted 8 lines
meta/recipes-connectivity/nfs-utils/nfs-utils_2.8.2.bb +2 -0
@@ -75,6 +75,8 @@ PACKAGECONFIG[nfsv41] = "--enable-nfsv41,--disable-nfsv41,libdevmapper,libdevmap
  # keyutils is available in meta-oe
  PACKAGECONFIG[nfsv4] = "--enable-nfsv4,--disable-nfsv4,keyutils,python3-core"
  PACKAGECONFIG[nfsdctl] = "--enable-nfsdctl,--disable-nfsdctl,libnl readline,"
+#krb5 is available in meta-oe
+PACKAGECONFIG[gssapi] = "--enable-gss --enable-svcgss --with-krb5=${STAGING_EXECPREFIXDIR},--disable-gss --disable-svcgss,krb5"
 
  PACKAGES =+ "${PN}-client ${PN}-mount ${PN}-stats ${PN}-rpcctl"
 

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#210773): https://lists.openembedded.org/g/openembedded-core/message/210773
Mute This Topic: https://lists.openembedded.org/mt/110696372/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-