Add new NFS utilities package with working init script.
This commit is contained in:
parent
0d7b08da13
commit
72f3ebce22
33
package/nfs-utils/Config.in
Normal file
33
package/nfs-utils/Config.in
Normal file
@ -0,0 +1,33 @@
|
||||
config BR2_PACKAGE_NFS_UTILS
|
||||
bool "nfs-utils"
|
||||
default n
|
||||
help
|
||||
The NFS Linux kernel server.
|
||||
|
||||
http://sourceforge.net/projects/nfs
|
||||
|
||||
menu "NFS utilities selection"
|
||||
depends BR2_PACKAGE_NFS_UTILS
|
||||
|
||||
config BR2_PACKAGE_NFS_UTILS_RPCDEBUG
|
||||
bool "rpcdebug"
|
||||
default n
|
||||
depends on BR2_PACKAGE_NFS_UTILS
|
||||
help
|
||||
The RPC debugging utility
|
||||
|
||||
config BR2_PACKAGE_NFS_UTILS_RPC_LOCKD
|
||||
bool "rpc.lockd"
|
||||
default n
|
||||
depends on BR2_PACKAGE_NFS_UTILS
|
||||
help
|
||||
NFS lock manager for Linux kernels older than 2.4
|
||||
|
||||
config BR2_PACKAGE_NFS_UTILS_RPC_RQUOTAD
|
||||
bool "rpc.rquotad"
|
||||
default n
|
||||
depends on BR2_PACKAGE_NFS_UTILS
|
||||
help
|
||||
NFS remote quota server
|
||||
|
||||
endmenu
|
81
package/nfs-utils/init-nfs
Executable file
81
package/nfs-utils/init-nfs
Executable file
@ -0,0 +1,81 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# nfs This shell script takes care of starting and stopping
|
||||
# the NFS services. Stolen from RedHat FC5.
|
||||
|
||||
[ -x /usr/sbin/rpc.statd ] || exit 0
|
||||
[ -x /usr/sbin/rpc.nfsd ] || exit 0
|
||||
[ -x /usr/sbin/rpc.mountd ] || exit 0
|
||||
[ -x /usr/sbin/exportfs ] || exit 0
|
||||
|
||||
# Don't fail if /etc/exports doesn't exist; create a bare-bones version and continue.
|
||||
[ -r /etc/exports ] || \
|
||||
{ touch /etc/exports && chmod u+rw,g+r,o+r /etc/exports ; } || \
|
||||
{ echo "/etc/exports does not exist" ; exit 0 ; }
|
||||
|
||||
# The /var/lib/nfs directory is actually on a tmpfs filesystem.
|
||||
mkdir -p /var/lib/nfs/sm
|
||||
mkdir -p /var/lib/nfs/sm.bak
|
||||
touch /var/lib/nfs/etab
|
||||
touch /var/lib/nfs/rmtab
|
||||
touch /var/lib/nfs/state
|
||||
touch /var/lib/nfs/xtab
|
||||
|
||||
# See how we were called.
|
||||
case "$1" in
|
||||
start)
|
||||
# Start daemons.
|
||||
echo -n "Starting NFS statd: "
|
||||
rpc.statd
|
||||
touch /var/lock/subsys/nfslock
|
||||
echo "done"
|
||||
|
||||
echo -n "Starting NFS services: "
|
||||
/usr/sbin/exportfs -r
|
||||
rpc.statd
|
||||
echo "done"
|
||||
|
||||
echo -n "Starting NFS daemon: "
|
||||
rpc.nfsd 2
|
||||
echo "done"
|
||||
|
||||
echo -n "Starting NFS mountd: "
|
||||
rpc.mountd
|
||||
echo "done"
|
||||
touch /var/lock/subsys/nfs
|
||||
;;
|
||||
stop)
|
||||
# Stop daemons.
|
||||
echo -n "Shutting down NFS mountd: "
|
||||
killall -q rpc.mountd
|
||||
echo "done"
|
||||
|
||||
echo "Shutting down NFS daemon: "
|
||||
kill -9 `pidof nfsd` 2>/dev/null
|
||||
echo "done"
|
||||
|
||||
echo -n "Shutting down NFS services: "
|
||||
/usr/sbin/exportfs -au
|
||||
rm -f /var/lock/subsys/nfs
|
||||
killall -q rpc.statd
|
||||
echo "done"
|
||||
|
||||
echo -n "Stopping NFS statd: "
|
||||
killall -q rpc.statd
|
||||
echo "done"
|
||||
rm -f /var/lock/subsys/nfslock
|
||||
;;
|
||||
restart)
|
||||
stop
|
||||
start
|
||||
;;
|
||||
reload)
|
||||
/usr/sbin/exportfs -r
|
||||
touch /var/lock/subsys/nfs
|
||||
;;
|
||||
*)
|
||||
echo "Usage: nfs {start|stop|reload}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
exit 0
|
2675
package/nfs-utils/nfs-utils-1.0.10-debian.patch
Normal file
2675
package/nfs-utils/nfs-utils-1.0.10-debian.patch
Normal file
File diff suppressed because it is too large
Load Diff
86
package/nfs-utils/nfs-utils.mk
Normal file
86
package/nfs-utils/nfs-utils.mk
Normal file
@ -0,0 +1,86 @@
|
||||
#############################################################
|
||||
#
|
||||
# nfs-utils
|
||||
#
|
||||
#############################################################
|
||||
NFS_UTILS_VER:=1.0.10
|
||||
NFS_UTILS_SOURCE:=nfs-utils-$(NFS_UTILS_VER).tar.gz
|
||||
NFS_UTILS_SITE:=http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/nfs/
|
||||
NFS_UTILS_CAT:=$(ZCAT)
|
||||
NFS_UTILS_DIR:=$(BUILD_DIR)/nfs-utils-$(NFS_UTILS_VER)
|
||||
NFS_UTILS_BINARY:=utils/nfsd/nfsd
|
||||
NFS_UTILS_TARGET_BINARY:=usr/sbin/rpc.nfsd
|
||||
|
||||
$(DL_DIR)/$(NFS_UTILS_SOURCE):
|
||||
$(WGET) -P $(DL_DIR) $(NFS_UTILS_SITE)/$(NFS_UTILS_SOURCE)
|
||||
|
||||
$(NFS_UTILS_DIR)/.unpacked: $(DL_DIR)/$(NFS_UTILS_SOURCE)
|
||||
$(NFS_UTILS_CAT) $(DL_DIR)/$(NFS_UTILS_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
|
||||
toolchain/patch-kernel.sh $(NFS_UTILS_DIR) package/nfs-utils/ nfs-utils*.patch
|
||||
toolchain/patch-kernel.sh $(NFS_UTILS_DIR) $(NFS_UTILS_DIR)/debian/ *.patch
|
||||
touch $(NFS_UTILS_DIR)/.unpacked
|
||||
|
||||
$(NFS_UTILS_DIR)/.configured: $(NFS_UTILS_DIR)/.unpacked
|
||||
(cd $(NFS_UTILS_DIR); rm -rf config.cache; \
|
||||
$(TARGET_CONFIGURE_OPTS) CC_FOR_BUILD="$(HOSTCC)" \
|
||||
CFLAGS="$(TARGET_CFLAGS)" \
|
||||
LDFLAGS="$(TARGET_LDFLAGS)" \
|
||||
knfsd_cv_bsd_signals=no \
|
||||
./configure \
|
||||
--target=$(GNU_TARGET_NAME) \
|
||||
--host=$(GNU_TARGET_NAME) \
|
||||
--build=$(GNU_HOST_NAME) \
|
||||
--prefix=/usr \
|
||||
--disable-nfsv4 \
|
||||
--disable-gss \
|
||||
);
|
||||
touch $(NFS_UTILS_DIR)/.configured
|
||||
|
||||
$(NFS_UTILS_DIR)/$(NFS_UTILS_BINARY): $(NFS_UTILS_DIR)/.configured
|
||||
$(MAKE) CC=$(TARGET_CC) CC_FOR_BUILD="$(HOSTCC)" \
|
||||
RPCGEN=/usr/bin/rpcgen -C $(NFS_UTILS_DIR)
|
||||
touch -c $(NFS_UTILS_DIR)/$(NFS_UTILS_BINARY)
|
||||
|
||||
NFS_UTILS_TARGETS_ :=
|
||||
NFS_UTILS_TARGETS_y := usr/sbin/exportfs usr/sbin/rpc.mountd \
|
||||
usr/sbin/rpc.nfsd usr/sbin/rpc.statd
|
||||
|
||||
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
|
||||
|
||||
$(STAGING_DIR)/.fakeroot.nfs-utils: $(NFS_UTILS_DIR)/$(NFS_UTILS_BINARY)
|
||||
# Use fakeroot to pretend to do 'make install' as root
|
||||
echo "$(MAKE) prefix=$(TARGET_DIR)/usr statedir=$(TARGET_DIR)/var/lib/nfs CC=$(TARGET_CC) -C $(NFS_UTILS_DIR) install" > $@
|
||||
echo "rm -f $(TARGET_DIR)/usr/bin/event_rpcgen.py $(TARGET_DIR)/usr/sbin/nhfs* $(TARGET_DIR)/usr/sbin/nfsstat $(TARGET_DIR)/usr/sbin/showmount" >> $@
|
||||
echo "rm -rf $(TARGET_DIR)/usr/share/man" >> $@
|
||||
echo "$(INSTALL) -m 0755 -D package/nfs-utils/init-nfs $(TARGET_DIR)/etc/init.d/S60nfs" >> $@
|
||||
echo -n "for file in $(NFS_UTILS_TARGETS_) ; do rm -f $(TARGET_DIR)/" >> $@
|
||||
echo -n "\$$" >> $@
|
||||
echo "file; done" >> $@
|
||||
echo "rm -rf $(TARGET_DIR)/var/lib/nfs" >> $@
|
||||
|
||||
$(TARGET_DIR)/$(NFS_UTILS_TARGET_BINARY): $(STAGING_DIR)/.fakeroot.nfs-utils
|
||||
touch -c $(TARGET_DIR)/$(NFS_UTILS_TARGET_BINARY)
|
||||
|
||||
nfs-utils: uclibc $(TARGET_DIR)/$(NFS_UTILS_TARGET_BINARY)
|
||||
|
||||
nfs-utils-clean:
|
||||
rm -f $(TARGET_DIR)/etc/init.d/S60nfs
|
||||
for file in $(NFS_UTILS_TARGETS_y) ; do \
|
||||
rm -f $(TARGET_DIR)/$$file; \
|
||||
done
|
||||
-$(MAKE) -C $(NFS_UTILS_DIR) clean
|
||||
rm -f $(STAGING_DIR)/.fakeroot.nfs-utils
|
||||
|
||||
nfs-utils-dirclean:
|
||||
rm -rf $(NFS_UTILS_DIR)
|
||||
|
||||
#############################################################
|
||||
#
|
||||
# Toplevel Makefile options
|
||||
#
|
||||
#############################################################
|
||||
ifeq ($(strip $(BR2_PACKAGE_NFS_UTILS)),y)
|
||||
TARGETS+=nfs-utils
|
||||
endif
|
Loading…
Reference in New Issue
Block a user