diff mbox series

[1/4] nfs-utils: add host package

Message ID 4b1f3623de3a8a4386f76d0f3cdd36b7c9b230dd.1526643119.git.baruch@tkos.co.il
State Superseded
Headers show
Series [1/4] nfs-utils: add host package | expand

Commit Message

Baruch Siach May 18, 2018, 11:31 a.m. UTC
We only need the host package for the rpcgen utility. glibc deprecated
this utility in version 2.26. Fedora has recently removed rpcgen from
its glibc package. So we need to build the rpcgen from the nfs-utils
package.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
 package/nfs-utils/nfs-utils.mk | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

Comments

Thomas Petazzoni May 18, 2018, 12:32 p.m. UTC | #1
Hello,

On Fri, 18 May 2018 14:31:56 +0300, Baruch Siach wrote:
> We only need the host package for the rpcgen utility. glibc deprecated
> this utility in version 2.26. Fedora has recently removed rpcgen from
> its glibc package. So we need to build the rpcgen from the nfs-utils
> package.
> 
> Signed-off-by: Baruch Siach <baruch@tkos.co.il>

Ah, I was looking for a solution to this rpcgen problem.

It is worth mentioning that we have a big patch in the libtirpc package
to add the source code for rpcgen. So perhaps this should be removed,
and libtirpc should depend on host-nfs-utils.

Best regards,

Thomas
Thomas Petazzoni May 18, 2018, 12:33 p.m. UTC | #2
Hello,

On Fri, 18 May 2018 14:32:17 +0200, Thomas Petazzoni wrote:

> Ah, I was looking for a solution to this rpcgen problem.
> 
> It is worth mentioning that we have a big patch in the libtirpc package
> to add the source code for rpcgen. So perhaps this should be removed,
> and libtirpc should depend on host-nfs-utils.

Forget that: I saw your patch that does *exactly* this.

I should read *all* the patches in the queue before replying to the
first ones :-)

Best regards,

Thomas
Thomas Petazzoni May 19, 2018, 10:44 a.m. UTC | #3
Hello Baruch,

On Fri, 18 May 2018 14:31:56 +0300, Baruch Siach wrote:
> We only need the host package for the rpcgen utility. glibc deprecated
> this utility in version 2.26. Fedora has recently removed rpcgen from
> its glibc package. So we need to build the rpcgen from the nfs-utils
> package.
> 
> Signed-off-by: Baruch Siach <baruch@tkos.co.il>

I've done some testing. First, this package needs host-pkgconf in
HOST_NFS_UTILS_DEPENDENCIES, because the configure.ac script uses
autoconf macros from pkgconfig.m4. With this fixed, host-nfs-utils
builds fine on my system (Fedora 27).

However, it doesn't build on Fedora 28, because the <rpc/types.h>
header is not available. If this one gets fixed by using a local copy
of <rpc/types.h>, then the build fails for <rpc/rpc.h>, etc.

So in fact on Fedora 28, not only rpcgen is not provided, but also the
RPC headers are not provided.

Do you have an idea on how to address this ? Do we need to build
host-libtirpc ?

If you don't have a Fedora 28 system at hand, you can easily create a
Docker container with Fedora 28 installed.

Thanks,

Thomas
Baruch Siach May 21, 2018, 6:07 a.m. UTC | #4
Hi Thomas,

On Sat, May 19, 2018 at 12:44:12PM +0200, Thomas Petazzoni wrote:
> On Fri, 18 May 2018 14:31:56 +0300, Baruch Siach wrote:
> > We only need the host package for the rpcgen utility. glibc deprecated
> > this utility in version 2.26. Fedora has recently removed rpcgen from
> > its glibc package. So we need to build the rpcgen from the nfs-utils
> > package.
> > 
> > Signed-off-by: Baruch Siach <baruch@tkos.co.il>
> 
> I've done some testing. First, this package needs host-pkgconf in
> HOST_NFS_UTILS_DEPENDENCIES, because the configure.ac script uses
> autoconf macros from pkgconfig.m4. With this fixed, host-nfs-utils
> builds fine on my system (Fedora 27).
> 
> However, it doesn't build on Fedora 28, because the <rpc/types.h>
> header is not available. If this one gets fixed by using a local copy
> of <rpc/types.h>, then the build fails for <rpc/rpc.h>, etc.
> 
> So in fact on Fedora 28, not only rpcgen is not provided, but also the
> RPC headers are not provided.
> 
> Do you have an idea on how to address this ? Do we need to build
> host-libtirpc ?

I'll take a look.

If we need host-libtirpc we would not be able to remove the rpcgen patch since 
that would create a circular dependency.

Why do we actually need rpcgen in libtirpc?

> If you don't have a Fedora 28 system at hand, you can easily create a
> Docker container with Fedora 28 installed.

Thanks for the tip.

baruch
Thomas Petazzoni May 21, 2018, 8:19 a.m. UTC | #5
Hello,

On Mon, 21 May 2018 09:07:56 +0300, Baruch Siach wrote:

> > Do you have an idea on how to address this ? Do we need to build
> > host-libtirpc ?  
> 
> I'll take a look.

Thanks!

> If we need host-libtirpc we would not be able to remove the rpcgen patch since 
> that would create a circular dependency.

Except if we manage to convince host-libtirpc that it should just
install the RPC headers, and not do anything that needs rpcgen.

> Why do we actually need rpcgen in libtirpc?

If I remember correctly, it's because it needs to generate the C code
matching those RPC descriptions:

./tirpc/rpc/rpcb_prot.x
./tirpc/rpcsvc/crypt.x
./tirpc/rpcsvc/key_prot.x

But it's been a very long time I did this, and libtirpc has been
updated multiple times since then.

Alternatively, one approach would be to bundle a pre-generated version
of those C files instead of having to run rpcgen. Not the nicest
solution, but that's one solution.

Thomas
Baruch Siach May 21, 2018, 8:28 a.m. UTC | #6
Hi Thomas,

On Mon, May 21, 2018 at 10:19:28AM +0200, Thomas Petazzoni wrote:
> On Mon, 21 May 2018 09:07:56 +0300, Baruch Siach wrote:
> 
> > > Do you have an idea on how to address this ? Do we need to build
> > > host-libtirpc ?  
> > 
> > I'll take a look.
> 
> Thanks!
> 
> > If we need host-libtirpc we would not be able to remove the rpcgen patch since 
> > that would create a circular dependency.
> 
> Except if we manage to convince host-libtirpc that it should just
> install the RPC headers, and not do anything that needs rpcgen.
> 
> > Why do we actually need rpcgen in libtirpc?
> 
> If I remember correctly, it's because it needs to generate the C code
> matching those RPC descriptions:
> 
> ./tirpc/rpc/rpcb_prot.x
> ./tirpc/rpcsvc/crypt.x
> ./tirpc/rpcsvc/key_prot.x

The libtirpc tarball bundles these generated files. But for some reason we 
regenerate them from C.

> But it's been a very long time I did this, and libtirpc has been
> updated multiple times since then.
> 
> Alternatively, one approach would be to bundle a pre-generated version
> of those C files instead of having to run rpcgen. Not the nicest
> solution, but that's one solution.

If we can use the bundled files, we can get rid of rpcgen in libtirpc.

baruch
Thomas Petazzoni May 21, 2018, 8:32 a.m. UTC | #7
Hello,

On Mon, 21 May 2018 11:28:18 +0300, Baruch Siach wrote:

> > ./tirpc/rpc/rpcb_prot.x
> > ./tirpc/rpcsvc/crypt.x
> > ./tirpc/rpcsvc/key_prot.x  
> 
> The libtirpc tarball bundles these generated files. But for some reason we 
> regenerate them from C.

Hu ? Those .x files are not the generated files. Those are the source
files. rpcgen reads .x files and generates C code. You seem to have
understood it backwards.

Thomas
Baruch Siach May 21, 2018, 8:58 a.m. UTC | #8
Hi Thomas,

On Mon, May 21, 2018 at 10:32:59AM +0200, Thomas Petazzoni wrote:
> On Mon, 21 May 2018 11:28:18 +0300, Baruch Siach wrote:
> 
> > > ./tirpc/rpc/rpcb_prot.x
> > > ./tirpc/rpcsvc/crypt.x
> > > ./tirpc/rpcsvc/key_prot.x  
> > 
> > The libtirpc tarball bundles these generated files. But for some reason we 
> > regenerate them from C.
> 
> Hu ? Those .x files are not the generated files. Those are the source
> files. rpcgen reads .x files and generates C code. You seem to have
> understood it backwards.

Right. But still the .h and .c file that are generated from these .x files are 
bundled with libtirpc. As far as I can see these are the files:

  src/key_prot_xdr.c
  src/rpcb_st_xdr.c
  tirpc/rpcsvc/crypt.h
  tirpc/rpc/rpcb_prot.h
  tirpc/rpc/key_prot.h

baruch
Peter Korsgaard June 17, 2018, 2:55 p.m. UTC | #9
>>>>> "Baruch" == Baruch Siach <baruch@tkos.co.il> writes:

 > We only need the host package for the rpcgen utility. glibc deprecated
 > this utility in version 2.26. Fedora has recently removed rpcgen from
 > its glibc package. So we need to build the rpcgen from the nfs-utils
 > package.

 > Signed-off-by: Baruch Siach <baruch@tkos.co.il>

Committed to 2018.02.x, thanks.
diff mbox series

Patch

diff --git a/package/nfs-utils/nfs-utils.mk b/package/nfs-utils/nfs-utils.mk
index 26112d69f230..8100706c1505 100644
--- a/package/nfs-utils/nfs-utils.mk
+++ b/package/nfs-utils/nfs-utils.mk
@@ -24,6 +24,19 @@  NFS_UTILS_CONF_OPTS = \
 	--with-statedir=/run/nfs \
 	--with-rpcgen=internal
 
+HOST_NFS_UTILS_CONF_OPTS = \
+	--disable-nfsv4 \
+	--disable-nfsv41 \
+	--disable-gss \
+	--disable-uuid \
+	--disable-ipv6 \
+	--without-tcp-wrappers \
+	--with-statedir=/run/nfs \
+	--disable-caps \
+	--disable-tirpc \
+	--without-systemd \
+	--with-rpcgen=internal
+
 NFS_UTILS_TARGETS_$(BR2_PACKAGE_NFS_UTILS_RPCDEBUG) += usr/sbin/rpcdebug
 NFS_UTILS_TARGETS_$(BR2_PACKAGE_NFS_UTILS_RPC_LOCKD) += usr/sbin/rpc.lockd
 NFS_UTILS_TARGETS_$(BR2_PACKAGE_NFS_UTILS_RPC_RQUOTAD) += usr/sbin/rpc.rquotad
@@ -89,4 +102,9 @@  endef
 # nfsiostat is interpreted python, so remove it unless it's in the target
 NFS_UTILS_POST_INSTALL_TARGET_HOOKS += $(if $(BR2_PACKAGE_PYTHON),,NFS_UTILS_REMOVE_NFSIOSTAT)
 
+define HOST_NFS_UTILS_INSTALL_CMDS
+	$(INSTALL) -D -m 0755 $(@D)/tools/rpcgen/rpcgen $(HOST_DIR)/bin/rpcgen
+endef
+
 $(eval $(autotools-package))
+$(eval $(host-autotools-package))