Browse Source

nfs-kernel-server: add support for NFSv4

Signed-off-by: W. Michael Petullo <mike@flyn.org>
lilik-openwrt-22.03
W. Michael Petullo 6 years ago
committed by tripolar
parent
commit
95db98bd7d
3 changed files with 58 additions and 9 deletions
  1. +8
    -0
      net/nfs-kernel-server/Config.in
  2. +48
    -9
      net/nfs-kernel-server/Makefile
  3. +2
    -0
      net/nfs-kernel-server/files/nfsd.init

+ 8
- 0
net/nfs-kernel-server/Config.in View File

@ -0,0 +1,8 @@
menu "Select nfs-kernel-server configuration options"
depends on PACKAGE_nfs-kernel-server
config NFS_KERNEL_SERVER_V4
bool "Include support for NFSv4"
default y
endmenu

+ 48
- 9
net/nfs-kernel-server/Makefile View File

@ -20,7 +20,10 @@ PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1 PKG_BUILD_PARALLEL:=1
PKG_BUILD_DEPENDS:=$(PKG_NAME)/host PKG_BUILD_DEPENDS:=$(PKG_NAME)/host
HOST_BUILD_DEPENDS:=libtirpc/host HOST_BUILD_DEPENDS:=libtirpc/host
PKG_CONFIG_DEPENDS:= CONFIG_IPV6
PKG_CONFIG_DEPENDS:= \
CONFIG_IPV6 \
CONFIG_NFS_KERNEL_SERVER_V4
include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk
@ -37,13 +40,17 @@ endef
define Package/nfs-kernel-server define Package/nfs-kernel-server
$(call Package/nfs-kernel-server/Default) $(call Package/nfs-kernel-server/Default)
TITLE:=Kernel NFS server support TITLE:=Kernel NFS server support
DEPENDS+= +kmod-fs-nfsd +kmod-fs-nfs +rpcbind
DEPENDS+= +kmod-fs-nfsd +kmod-fs-nfs +NFS_KERNEL_SERVER_V4:kmod-fs-nfs-v4 +rpcbind +NFS_KERNEL_SERVER_V4:nfs-utils-libs +NFS_KERNEL_SERVER_V4:libkeyutils +NFS_KERNEL_SERVER_V4:libdevmapper
endef endef
define Package/nfs-kernel-server/description define Package/nfs-kernel-server/description
Kernel NFS server support Kernel NFS server support
endef endef
define Package/nfs-kernel-server/config
source "$(SOURCE)/Config.in"
endef
define Package/nfs-kernel-server-utils define Package/nfs-kernel-server-utils
$(call Package/nfs-kernel-server/Default) $(call Package/nfs-kernel-server/Default)
TITLE:=NFS server utils TITLE:=NFS server utils
@ -58,11 +65,17 @@ define Package/nfs-kernel-server/conffiles
/etc/exports /etc/exports
endef endef
define Package/nfs-utils
define Package/nfs-utils/Default
$(call Package/nfs-kernel-server/Default) $(call Package/nfs-kernel-server/Default)
SECTION:=utils SECTION:=utils
CATEGORY:=Utilities CATEGORY:=Utilities
DEPENDS+= +libevent2
DEPENDS+= +libevent2 +NFS_KERNEL_SERVER_V4:libkeyutils +NFS_KERNEL_SERVER_V4:libdevmapper
URL:=http://nfs.sourceforge.net/
MAINTAINER:=Peter Wagner <tripolar@gmx.at>
endef
define Package/nfs-utils
$(call Package/nfs-utils/Default)
TITLE:=updated mount utility (includes nfs4) TITLE:=updated mount utility (includes nfs4)
endef endef
@ -70,6 +83,15 @@ define Package/nfs-utils/description
Updated mount.nfs command - allows mounting nfs4 volumes Updated mount.nfs command - allows mounting nfs4 volumes
endef endef
define Package/nfs-utils-libs
$(call Package/nfs-utils/Default)
TITLE:=libraries provided by nfs-utils
endef
define Package/nfs-utils-libs/description
Libraries provided by nfs-utils
endef
TARGET_CFLAGS += -Wno-error=implicit-function-declaration \ TARGET_CFLAGS += -Wno-error=implicit-function-declaration \
-Wno-error=strict-prototypes \ -Wno-error=strict-prototypes \
-Wno-error=incompatible-pointer-types \ -Wno-error=incompatible-pointer-types \
@ -81,12 +103,14 @@ TARGET_LDFLAGS += -Wl,-rpath-link=$(STAGING_DIR)/usr/lib \
-L$(STAGING_DIR)/usr/lib/libevent -L$(STAGING_DIR)/usr/lib/libevent
CONFIGURE_ARGS += \ CONFIGURE_ARGS += \
--disable-caps \
--disable-gss \ --disable-gss \
--disable-nfsv4 \
--disable-nfsv41 \
--enable-static \
--disable-nfsdcld \
--disable-nfsdcltrack \
--enable-shared \ --enable-shared \
--disable-caps
--enable-static \
$(if $(CONFIG_NFS_KERNEL_SERVER_V4),--enable,--disable)-nfsv4 \
$(if $(CONFIG_NFS_KERNEL_SERVER_V4),--enable,--disable)-nfsv41
ifeq ($(CONFIG_IPV6),n) ifeq ($(CONFIG_IPV6),n)
CONFIGURE_ARGS += --disable-ipv6 CONFIGURE_ARGS += --disable-ipv6
@ -156,13 +180,28 @@ define Package/nfs-kernel-server-utils/install
$(INSTALL_BIN) $(PKG_BUILD_DIR)/utils/nfsstat/nfsstat $(1)/usr/sbin $(INSTALL_BIN) $(PKG_BUILD_DIR)/utils/nfsstat/nfsstat $(1)/usr/sbin
endef endef
define Package/nfs-utils/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_INSTALL_DIR)/usr/include/nfsidmap.h $(1)/usr/include/
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libnfsidmap.{a,la,so*} $(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libnfsidmap.pc $(1)/usr/lib/pkgconfig/
endef
define Package/nfs-utils/install define Package/nfs-utils/install
$(INSTALL_DIR) $(1)/sbin $(INSTALL_DIR) $(1)/sbin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/mount.nfs $(1)/sbin/ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/mount.nfs $(1)/sbin/
(cd $(1)/sbin; ln -sf mount.nfs mount.nfs4; ln -sf mount.nfs umount.nfs; ln -sf mount.nfs umount.nfs4) (cd $(1)/sbin; ln -sf mount.nfs mount.nfs4; ln -sf mount.nfs umount.nfs; ln -sf mount.nfs umount.nfs4)
endef endef
define Package/nfs-utils-libs/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libnfsidmap.so* $(1)/usr/lib/
endef
$(eval $(call HostBuild)) $(eval $(call HostBuild))
$(eval $(call BuildPackage,nfs-utils))
$(eval $(call BuildPackage,nfs-utils-libs))
$(eval $(call BuildPackage,nfs-kernel-server)) $(eval $(call BuildPackage,nfs-kernel-server))
$(eval $(call BuildPackage,nfs-kernel-server-utils)) $(eval $(call BuildPackage,nfs-kernel-server-utils))
$(eval $(call BuildPackage,nfs-utils))

+ 2
- 0
net/nfs-kernel-server/files/nfsd.init View File

@ -7,12 +7,14 @@ STOP=60
USE_PROCD=1 USE_PROCD=1
NFS_D=/var/lib/nfs NFS_D=/var/lib/nfs
RECOVERY_D=$NFS_D/v4recovery
LOCK_D=/var/lib/nfs/sm LOCK_D=/var/lib/nfs/sm
start_service() { start_service() {
grep -q /proc/fs/nfsd /proc/mounts || \ grep -q /proc/fs/nfsd /proc/mounts || \
mount -t nfsd nfsd /proc/fs/nfsd mount -t nfsd nfsd /proc/fs/nfsd
mkdir -p $NFS_D mkdir -p $NFS_D
mkdir -p $RECOVERY_D
mkdir -p $LOCK_D mkdir -p $LOCK_D
touch $NFS_D/rmtab touch $NFS_D/rmtab


Loading…
Cancel
Save