From 62af0af196f364171231193f0faac3de33758290 Mon Sep 17 00:00:00 2001 From: Claudiu Belu Date: Tue, 24 Sep 2024 10:48:59 +0300 Subject: [PATCH] Fixes longhorn nfs-ganesha reference (#35) The original Dockerfiles reference a rancher fork of the nfs-ganesha repository, not the original repository. This fork contains various longhorn-related patches, so we should use it as well. --- .../correct-include-assert.patch | 96 ------------------- v1.6.2/longhorn-share-manager/rockcraft.yaml | 23 ++--- v1.7.0/longhorn-share-manager/rockcraft.yaml | 7 +- 3 files changed, 13 insertions(+), 113 deletions(-) delete mode 100644 v1.6.2/longhorn-share-manager/correct-include-assert.patch diff --git a/v1.6.2/longhorn-share-manager/correct-include-assert.patch b/v1.6.2/longhorn-share-manager/correct-include-assert.patch deleted file mode 100644 index d14781e..0000000 --- a/v1.6.2/longhorn-share-manager/correct-include-assert.patch +++ /dev/null @@ -1,96 +0,0 @@ -diff --git a/src/clnt_raw.c b/src/clnt_raw.c -index 781cfa62..0b768c01 100644 ---- a/src/clnt_raw.c -+++ b/src/clnt_raw.c -@@ -40,7 +40,6 @@ - #include "config.h" - #include - #include --#include - #include - #include - #include -diff --git a/src/clnt_vc.c b/src/clnt_vc.c -index 57d48af7..9c185858 100644 ---- a/src/clnt_vc.c -+++ b/src/clnt_vc.c -@@ -55,7 +55,6 @@ - #include - #include - #include --#include - #include - #include - #include -diff --git a/src/rbtree_x.c b/src/rbtree_x.c -index 585af809..5bb05822 100644 ---- a/src/rbtree_x.c -+++ b/src/rbtree_x.c -@@ -31,7 +31,6 @@ - #include - #endif - #include --#include - #include - #include - #include -diff --git a/src/svc_ioq.c b/src/svc_ioq.c -index 1ebcfb06..2d7e18af 100644 ---- a/src/svc_ioq.c -+++ b/src/svc_ioq.c -@@ -37,7 +37,6 @@ - #include - #include - --#include - #include - #include - #include -diff --git a/src/svc_rqst.c b/src/svc_rqst.c -index fe8443c9..86bb4d86 100644 ---- a/src/svc_rqst.c -+++ b/src/svc_rqst.c -@@ -28,7 +28,6 @@ - #include - #include - #include --#include - #include - #include - #include -diff --git a/src/svc_xprt.c b/src/svc_xprt.c -index 4ea9ca02..762d3eb4 100644 ---- a/src/svc_xprt.c -+++ b/src/svc_xprt.c -@@ -29,7 +29,6 @@ - #include - #include - #include --#include - #include - #include - #include -diff --git a/src/work_pool.c b/src/work_pool.c -index 5d69f557..0ff85008 100644 ---- a/src/work_pool.c -+++ b/src/work_pool.c -@@ -50,6 +50,7 @@ - #include - #include - #include -+#include - #include - #include - #include -diff --git a/src/xdr_rdma.c b/src/xdr_rdma.c -index e7f4dfe5..e32dde01 100644 ---- a/src/xdr_rdma.c -+++ b/src/xdr_rdma.c -@@ -35,7 +35,6 @@ - - #include - --#include - #include - #include - #include diff --git a/v1.6.2/longhorn-share-manager/rockcraft.yaml b/v1.6.2/longhorn-share-manager/rockcraft.yaml index cc3cf65..43a101b 100644 --- a/v1.6.2/longhorn-share-manager/rockcraft.yaml +++ b/v1.6.2/longhorn-share-manager/rockcraft.yaml @@ -72,8 +72,8 @@ parts: build-ganesha: plugin: nil source-type: git - source: https://github.com/nfs-ganesha/nfs-ganesha - source-tag: V5.7 + source: https://github.com/longhorn/nfs-ganesha + source-tag: v5_20240430 source-depth: 1 # https://github.com/longhorn/longhorn-share-manager/blob/v1.6.2/package/Dockerfile#L12-L14 build-packages: @@ -114,24 +114,17 @@ parts: - nfs4-acl-tools - xfsprogs - e2fsprogs + # Required by the rancher fork of nfs-ganesha, otherwise we get the error: + # ganesha.nfsd: error while loading shared libraries: libcurl-gnutls.so.4: cannot open shared object file: No such file or directory + # ganesha.nfsd: error while loading shared libraries: libjson-c.so.5: cannot open shared object file: No such file or directory + - libcurl3-gnutls + - libjson-c5 override-build: | # https://github.com/longhorn/longhorn-share-manager/blob/v1.6.2/package/Dockerfile#L17-L22 curl -L https://github.com/nfs-ganesha/ntirpc/archive/refs/tags/v5.0.tar.gz | tar zx - - # Currently, ntirpc v5.0 fails to build with the following error: - # /usr/bin/ld: libntirpc/src/libntirpc.so.5.0: undefined reference to `assert' - # This issue has been fixed in v5.8 and newer. - # We're applying that bug fix patch: https://github.com/nfs-ganesha/ntirpc/pull/279 - # Moving to /tmp, so we can apply the patch. - mv ntirpc-5.0 /tmp/ - pushd /tmp/ntirpc-5.0 - cp $CRAFT_PROJECT_DIR/correct-include-assert.patch ./ - git apply -v correct-include-assert.patch - popd - rm -r src/libntirpc - mv /tmp/ntirpc-5.0 src/libntirpc + mv ntirpc-5.0 src/libntirpc # build ganesha only supporting nfsv4 and vfs. # set NFS_V4_RECOV_ROOT to /tmp we don't support recovery in this release. diff --git a/v1.7.0/longhorn-share-manager/rockcraft.yaml b/v1.7.0/longhorn-share-manager/rockcraft.yaml index a896f29..72184fc 100644 --- a/v1.7.0/longhorn-share-manager/rockcraft.yaml +++ b/v1.7.0/longhorn-share-manager/rockcraft.yaml @@ -72,8 +72,8 @@ parts: build-ganesha: plugin: nil source-type: git - source: https://github.com/nfs-ganesha/nfs-ganesha - source-tag: V5.9 + source: https://github.com/rancher/nfs-ganesha + source-tag: v5_20240716 source-depth: 1 build-packages: - autoconf @@ -112,6 +112,9 @@ parts: - nfs4-acl-tools - xfsprogs - e2fsprogs + # Required by the rancher fork of nfs-ganesha, otherwise we get the error: + # ganesha.nfsd: error while loading shared libraries: libcurl-gnutls.so.4: cannot open shared object file: No such file or directory + - libcurl3-gnutls override-build: | # https://github.com/longhorn/longhorn-share-manager/blob/v1.7.0/package/Dockerfile#L20-L25