diff mbox series

[1/1] nfs-utils: 2.6.4 -> 2.7.1

Message ID 0243382bd24ba48a951be696dd88ac93c808a9b2.1725802219.git.liezhi.yang@windriver.com
State New
Headers show
Series [1/1] nfs-utils: 2.6.4 -> 2.7.1 | expand

Commit Message

Robert Yang Sept. 8, 2024, 1:31 p.m. UTC
From: Robert Yang <liezhi.yang@windriver.com>

* Remove 0001-tools-locktest-Use-intmax_t-to-print-off_t.patch, upstream has
  fixed it with %lld.

* Remove 0001-reexport.h-Include-unistd.h-to-compile-with-musl.patch, it builds well
  with musl without this patch.

* Add libxml2 to DEPENDS to fix:
  configure: error: libxml2 not found.

* Add the following 2 patches to fix build errors with musl:
  0001-support-include-junction.h-Define-macros-for-musl.patch
  0001-support-junction-path.c-Fix-buld-for-musl.patch

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
 ...nclude-unistd.h-to-compile-with-musl.patch | 34 ------------
 ...de-junction.h-Define-macros-for-musl.patch | 46 ++++++++++++++++
 ...t-junction-path.c-Fix-build-for-musl.patch | 35 ++++++++++++
 ...locktest-Use-intmax_t-to-print-off_t.patch | 53 -------------------
 ...{nfs-utils_2.6.4.bb => nfs-utils_2.7.1.bb} |  8 +--
 5 files changed, 85 insertions(+), 91 deletions(-)
 delete mode 100644 meta/recipes-connectivity/nfs-utils/nfs-utils/0001-reexport.h-Include-unistd.h-to-compile-with-musl.patch
 create mode 100644 meta/recipes-connectivity/nfs-utils/nfs-utils/0001-support-include-junction.h-Define-macros-for-musl.patch
 create mode 100644 meta/recipes-connectivity/nfs-utils/nfs-utils/0001-support-junction-path.c-Fix-build-for-musl.patch
 delete mode 100644 meta/recipes-connectivity/nfs-utils/nfs-utils/0001-tools-locktest-Use-intmax_t-to-print-off_t.patch
 rename meta/recipes-connectivity/nfs-utils/{nfs-utils_2.6.4.bb => nfs-utils_2.7.1.bb} (94%)
diff mbox series

Patch

diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-reexport.h-Include-unistd.h-to-compile-with-musl.patch b/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-reexport.h-Include-unistd.h-to-compile-with-musl.patch
deleted file mode 100644
index 57d4660571..0000000000
--- a/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-reexport.h-Include-unistd.h-to-compile-with-musl.patch
+++ /dev/null
@@ -1,34 +0,0 @@ 
-From 45597a58e98f351b18db8444292b1cf6dd0cd810 Mon Sep 17 00:00:00 2001
-From: Robert Yang <liezhi.yang@windriver.com>
-Date: Sat, 9 Dec 2023 23:34:08 -0800
-Subject: [PATCH] reexport.h: Include unistd.h to compile with musl
-
-Fixed error when compile with musl
-reexport.c: In function 'reexpdb_init':
-reexport.c:62:17: error: implicit declaration of function 'sleep' [-Werror=implicit-function-declaration]
-   62 |                 sleep(1);
-
-
-Upstream-Status: Submitted [https://marc.info/?l=linux-nfs&m=170254661824522&w=2]
-
-Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
----
- support/reexport/reexport.h | 1 +
- 1 files changed, 1 insertions(+)
-
-diff --git a/support/reexport/reexport.h b/support/reexport/reexport.h
-index 85fd59c..02f8684 100644
---- a/support/reexport/reexport.h
-+++ b/support/reexport/reexport.h
-@@ -1,6 +1,8 @@
- #ifndef REEXPORT_H
- #define REEXPORT_H
- 
-+#include <unistd.h>
-+
- #include "nfslib.h"
- 
- enum {
--- 
-2.42.0
-
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-support-include-junction.h-Define-macros-for-musl.patch b/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-support-include-junction.h-Define-macros-for-musl.patch
new file mode 100644
index 0000000000..c94990b969
--- /dev/null
+++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-support-include-junction.h-Define-macros-for-musl.patch
@@ -0,0 +1,46 @@ 
+From 6f82ffa0e01e88e4e73972cb0125fcb6e78e27cf Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Sun, 8 Sep 2024 09:45:41 +0000
+Subject: [PATCH] support/include/junction.h: Define macros for musl
+
+Fixed 1:
+In file included from cache.c:1217:
+../../support/include/junction.h:128:21: error: expected ';' before 'char'
+  128 | __attribute_malloc__
+      |                     ^
+      |                     ;
+  129 | char            **nfs_dup_string_array(char **array);
+
+Fixed 2:
+junction.c: In function 'junction_set_sticky_bit':
+junction.c:164:39: error: 'ALLPERMS' undeclared (first use in this function)
+  164 |         stb.st_mode &= (unsigned int)~ALLPERMS;
+
+Upstream-Status: Submitted [https://marc.info/?l=linux-nfs&m=172579572428765&w=2]
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ support/include/junction.h | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/support/include/junction.h b/support/include/junction.h
+index 7257d80..d127dd5 100644
+--- a/support/include/junction.h
++++ b/support/include/junction.h
+@@ -26,6 +26,16 @@
+ #ifndef _NFS_JUNCTION_H_
+ #define _NFS_JUNCTION_H_
+ 
++/* For musl, refered to glibc's sys/cdefs.h */
++#ifndef __attribute_malloc__
++#define __attribute_malloc__ __attribute__((__malloc__))
++#endif
++
++/* For musl, refered to glibc's sys/stat.h */
++#ifndef ALLPERMS
++#define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO)/* 07777 */
++#endif
++
+ #include <stdint.h>
+ 
+ /*
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-support-junction-path.c-Fix-build-for-musl.patch b/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-support-junction-path.c-Fix-build-for-musl.patch
new file mode 100644
index 0000000000..ae2b0c566c
--- /dev/null
+++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-support-junction-path.c-Fix-build-for-musl.patch
@@ -0,0 +1,35 @@ 
+From ad4ec0c40aaea37b8e7ec3e73d7b35cbda2d3841 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Sun, 8 Sep 2024 08:34:28 +0000
+Subject: [PATCH] support/junction/path.c: Fix build for musl
+
+Fixed:
+path.c:164:24: error: implicit declaration of function 'strchrnul'; did you mean 'strchr'? [-Wimplicit-function-declaration]
+[snip]
+
+path.c:239:27: error: 'NAME_MAX' undeclared (first use in this function); did you mean 'AF_MAX'?
+
+Upstream-Status: Submitted [https://marc.info/?l=linux-nfs&m=172579572228762&w=2]
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ support/junction/path.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/support/junction/path.c b/support/junction/path.c
+index c25cc52..6e28df3 100644
+--- a/support/junction/path.c
++++ b/support/junction/path.c
+@@ -23,6 +23,12 @@
+  *	http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
+  */
+ 
++/* For musl */
++#ifndef _GNU_SOURCE
++#define _GNU_SOURCE
++#endif
++#include <limits.h>
++
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ 
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-tools-locktest-Use-intmax_t-to-print-off_t.patch b/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-tools-locktest-Use-intmax_t-to-print-off_t.patch
deleted file mode 100644
index 7d903e04bc..0000000000
--- a/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-tools-locktest-Use-intmax_t-to-print-off_t.patch
+++ /dev/null
@@ -1,53 +0,0 @@ 
-From e2e9251dbeb452f5382179023d8ae18b511167a1 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Tue, 25 Jul 2023 23:47:08 -0700
-Subject: [PATCH] tools/locktest: Use intmax_t to print off_t
-
-off_t could be 64bit on 32bit architectures which means using %z printf
-modifier is not enough to print it and compiler will complain about
-format mismatch
-
-Fixes
-| testlk.c:84:66: error: format '%zd' expects argument of type 'signed size_t', but argument 4 has type '__off64_t' {aka 'long long int'} [-Werror=format=]
-|    84 |                         printf("%s: conflicting lock by %d on (%zd;%zd)\n",
-|       |                                                                ~~^
-|       |                                                                  |
-|       |                                                                  int
-|       |                                                                %lld
-|    85 |                                 fname, fl.l_pid, fl.l_start, fl.l_len);
-|       |                                                  ~~~~~~~~~~
-|       |                                                    |
-|       |                                                    __off64_t {aka long long int}
-
-Upstream-Status: Submitted [https://marc.info/?l=linux-nfs&m=169035457128067&w=2]
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
- tools/locktest/testlk.c | 5 +++--
- 1 file changed, 3 insertions(+), 2 deletions(-)
-
-diff --git a/tools/locktest/testlk.c b/tools/locktest/testlk.c
-index ea51f788..9d4c88c4 100644
---- a/tools/locktest/testlk.c
-+++ b/tools/locktest/testlk.c
-@@ -2,6 +2,7 @@
- #include <config.h>
- #endif
- 
-+#include <stdint.h>
- #include <stdlib.h>
- #include <stdio.h>
- #include <unistd.h>
-@@ -81,8 +82,8 @@ main(int argc, char **argv)
- 		if (fl.l_type == F_UNLCK) {
- 			printf("%s: no conflicting lock\n", fname);
- 		} else {
--			printf("%s: conflicting lock by %d on (%zd;%zd)\n",
--				fname, fl.l_pid, fl.l_start, fl.l_len);
-+			printf("%s: conflicting lock by %d on (%jd;%jd)\n",
-+				fname, fl.l_pid, (intmax_t)fl.l_start, (intmax_t)fl.l_len);
- 		}
- 		return 0;
- 	}
--- 
-2.41.0
-
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils_2.6.4.bb b/meta/recipes-connectivity/nfs-utils/nfs-utils_2.7.1.bb
similarity index 94%
rename from meta/recipes-connectivity/nfs-utils/nfs-utils_2.6.4.bb
rename to meta/recipes-connectivity/nfs-utils/nfs-utils_2.7.1.bb
index 9aa8bc4eab..849ea0e43b 100644
--- a/meta/recipes-connectivity/nfs-utils/nfs-utils_2.6.4.bb
+++ b/meta/recipes-connectivity/nfs-utils/nfs-utils_2.7.1.bb
@@ -8,7 +8,7 @@  LICENSE = "MIT & GPL-2.0-or-later & BSD-3-Clause"
 LIC_FILES_CHKSUM = "file://COPYING;md5=95f3a93a5c3c7888de623b46ea085a84"
 
 # util-linux for libblkid
-DEPENDS = "libcap libevent util-linux sqlite3 libtirpc"
+DEPENDS = "libcap libevent util-linux sqlite3 libtirpc libxml2"
 RDEPENDS:${PN} = "${PN}-client"
 RRECOMMENDS:${PN} = "kernel-module-nfsd"
 
@@ -31,10 +31,10 @@  SRC_URI = "${KERNELORG_MIRROR}/linux/utils/nfs-utils/${PV}/nfs-utils-${PV}.tar.x
            file://0001-Makefile.am-fix-undefined-function-for-libnsm.a.patch \
            file://clang-warnings.patch \
            file://0001-locktest-Makefile.am-Do-not-use-build-flags.patch \
-           file://0001-tools-locktest-Use-intmax_t-to-print-off_t.patch \
-           file://0001-reexport.h-Include-unistd.h-to-compile-with-musl.patch \
+           file://0001-support-include-junction.h-Define-macros-for-musl.patch \
+           file://0001-support-junction-path.c-Fix-build-for-musl.patch \
            "
-SRC_URI[sha256sum] = "01b3b0fb9c7d0bbabf5114c736542030748c788ec2fd9734744201e9b0a1119d"
+SRC_URI[sha256sum] = "885c948a84a58bca4148f459588f9a7369dbb40dcc466f04e455c6b10fd0aa48"
 
 # Only kernel-module-nfsd is required here (but can be built-in)  - the nfsd module will
 # pull in the remainder of the dependencies.