mirror of
https://git.FreeBSD.org/ports.git
synced 2024-11-23 00:43:28 +00:00
Add new port for fusefs-kmod,
Kernel module for fusefs based filesystems. WWW: http://wikitest.freebsd.org/moin.cgi/FuseFilesystem Submitted by: Anish Mistry <amistry@am-productions.biz> (via email) Reviewed by: Csaba Henk <csaba.henk@creo.hu> Ported to FreeBSD by: Csaba Henk <csaba.henk@creo.hu> (as a SoC project)
This commit is contained in:
parent
8eb435d9d1
commit
f5f5f5e5d8
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=145831
@ -169,6 +169,7 @@
|
||||
SUBDIR += freesbie
|
||||
SUBDIR += fsbackup
|
||||
SUBDIR += ftrace
|
||||
SUBDIR += fusefs-kmod
|
||||
SUBDIR += fusefs-libs
|
||||
SUBDIR += fvcool
|
||||
SUBDIR += gag
|
||||
|
62
sysutils/fusefs-kmod/Makefile
Normal file
62
sysutils/fusefs-kmod/Makefile
Normal file
@ -0,0 +1,62 @@
|
||||
# New ports collection makefile for: fusefs-kmod
|
||||
# Date created: 08 October 2005
|
||||
# Whom: Anish Mistry <amistry@am-productions.biz>
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
|
||||
PORTNAME= fusefs
|
||||
PORTVERSION= 0.2.19.6
|
||||
CATEGORIES= sysutils
|
||||
MASTER_SITES= http://fuse4bsd.creo.hu/downloads/ \
|
||||
http://am-productions.biz/docs/
|
||||
PKGNAMESUFFIX= -kmod
|
||||
DISTNAME= fuse4bsd-0.2.20pre6
|
||||
EXTRACT_SUFX= .tar.bz2
|
||||
|
||||
MAINTAINER= amistry@am-productions.biz
|
||||
COMMENT= Kernel module for fuse
|
||||
|
||||
BUILD_DEPENDS= ${LOCALBASE}/include/fuse/fuse_kernel.h:${PORTSDIR}/sysutils/fusefs-libs
|
||||
|
||||
OPTIONS= AUTOSETUP "Automatic global config file setup" off
|
||||
MAKE_ENV+= BINDIR=${PREFIX}/sbin MANDIR=${PREFIX}/man/man
|
||||
MAN8= mount_fusefs.8
|
||||
KMODDIR= ${PREFIX}/modules
|
||||
MAKE_ARGS= KMODDIR=${KMODDIR}
|
||||
SRC_BASE?= /usr/src
|
||||
STARTUP= fuse.sh
|
||||
SETUP= setup.sh
|
||||
MODULE_PATH= `sysctl -n kern.module_path`;${KMODDIR}
|
||||
|
||||
.include <bsd.port.pre.mk>
|
||||
|
||||
.if ( ${OSVERSION} >= 600000 && ${OSVERSION} < 600034 ) || ( ${OSVERSION} >= 700000 && ${OSVERSION} < 700002 )
|
||||
MAKE_ARGS+= -DUSE_OLD_CLONEHANDLER_API
|
||||
.endif
|
||||
|
||||
.if ${OSVERSION} < 600000
|
||||
IGNORE= requires FreeBSD 6 or above. Please consider porting it to 5.x or even 4.x
|
||||
.endif
|
||||
|
||||
.if !exists(${SRC_BASE}/sys/Makefile)
|
||||
IGNORE= requires the Kernel source to be installed. Set SRC_BASE if it is not in /usr/src
|
||||
.endif
|
||||
|
||||
pre-install:
|
||||
${MKDIR} ${KMODDIR}
|
||||
|
||||
post-install:
|
||||
${INSTALL_SCRIPT} ${FILESDIR}/${STARTUP} ${PREFIX}/etc/rc.d/
|
||||
.if (defined(WITH_AUTOSETUP) && !defined(BATCH) && !defined(PACKAGE_BUILDING)) \
|
||||
|| (defined(WITH_AUTOSETUP) && defined(BATCH) && !defined(PACKAGE_BUILDING))
|
||||
@${SED} -e 's|@@PREFIX@@|${PREFIX}|g' \
|
||||
${FILESDIR}/${SETUP} > ${WRKDIR}/${SETUP}
|
||||
@${ECHO} "Modifying global startup config files and loading module...";
|
||||
${SH} ${WRKDIR}/${SETUP}
|
||||
.else
|
||||
@${SED} -e "s|%%PREFIX%%|${PREFIX}|g" \
|
||||
-e "s|%%MODULE_PATH%%|${MODULE_PATH}|g" ${PKGMESSAGE}
|
||||
.endif
|
||||
|
||||
.include <bsd.port.post.mk>
|
2
sysutils/fusefs-kmod/distinfo
Normal file
2
sysutils/fusefs-kmod/distinfo
Normal file
@ -0,0 +1,2 @@
|
||||
MD5 (fuse4bsd-0.2.20pre6.tar.bz2) = e2c48e940b1fdcb669add847e42011c0
|
||||
SIZE (fuse4bsd-0.2.20pre6.tar.bz2) = 71336
|
34
sysutils/fusefs-kmod/files/fuse.sh
Normal file
34
sysutils/fusefs-kmod/files/fuse.sh
Normal file
@ -0,0 +1,34 @@
|
||||
#!/bin/sh
|
||||
# $FreeBSD$
|
||||
|
||||
# PROVIDE: fusefs
|
||||
# REQUIRE: sysctl
|
||||
# KEYWORD: FreeBSD shutdown
|
||||
|
||||
[ -z "${fusefs_enable}" ] && fusefs_enable="NO"
|
||||
|
||||
kmod=fuse.ko
|
||||
name=fusefs
|
||||
|
||||
. /etc/rc.subr
|
||||
|
||||
rcvar=`set_rcvar`
|
||||
|
||||
start_cmd="fusefs_start"
|
||||
stop_cmd="fusefs_stop"
|
||||
|
||||
load_rc_config $name
|
||||
|
||||
fusefs_start()
|
||||
{
|
||||
echo "Loading ${name}"
|
||||
kldload $kmod
|
||||
}
|
||||
|
||||
fusefs_stop()
|
||||
{
|
||||
echo "Unloading ${name}"
|
||||
kldunload $kmod
|
||||
}
|
||||
|
||||
run_rc_command $*
|
18
sysutils/fusefs-kmod/files/patch-fuse_module_Makefile
Normal file
18
sysutils/fusefs-kmod/files/patch-fuse_module_Makefile
Normal file
@ -0,0 +1,18 @@
|
||||
--- fuse_module/Makefile.orig Sun Oct 16 09:01:26 2005
|
||||
+++ fuse_module/Makefile Tue Oct 18 11:58:20 2005
|
||||
@@ -35,12 +35,11 @@
|
||||
|
||||
fuse.ko: fuse_kernel.h vnode_if.h vnode_if_typedef.h vnode_if_newproto.h
|
||||
|
||||
-fuse_kernel.h: fuse_kernel.h.orig
|
||||
- cp fuse_kernel.h.orig fuse_kernel.h
|
||||
- patch fuse_kernel.h < kernel-header.diff
|
||||
+fuse_kernel.h:
|
||||
+ cp ${LOCALBASE}/include/fuse/fuse_kernel.h fuse_kernel.h
|
||||
|
||||
fuse_opnames.c:
|
||||
- awk -f ../tools/genopnames.awk fuse_kernel.h.orig > fuse_opnames.c
|
||||
+ awk -f ../tools/genopnames.awk fuse_kernel.h > fuse_opnames.c
|
||||
|
||||
vnode_if.h:
|
||||
awk -f /sys/tools/vnode_if.awk /sys/kern/vnode_if.src -h
|
52
sysutils/fusefs-kmod/files/setup.sh
Normal file
52
sysutils/fusefs-kmod/files/setup.sh
Normal file
@ -0,0 +1,52 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Automatically setup the loading of the module without polluting /boot/modules
|
||||
SYSCTL_CONFIG=/etc/sysctl.conf
|
||||
LOADER_CONFIG=/etc/rc.conf
|
||||
|
||||
sysctl kern.module_path | grep "[:space:;=]@@PREFIX@@/modules[;]\?\b" > /dev/null 2>&1; RESULT=$?
|
||||
if [ ${RESULT} -eq 1 ]; then
|
||||
MODULE_PATH="`sysctl -n kern.module_path`;@@PREFIX@@/modules"
|
||||
sysctl "kern.module_path=${MODULE_PATH}"
|
||||
else
|
||||
MODULE_PATH=`sysctl -n kern.module_path`
|
||||
fi
|
||||
|
||||
grep "kern\.module_path" ${SYSCTL_CONFIG} > /dev/null 2>&1; RESULT=$?
|
||||
if [ ${RESULT} -eq 0 ]; then
|
||||
# Variable present
|
||||
grep "kern\.module_path" ${SYSCTL_CONFIG} | grep "[:space:;=]@@PREFIX@@/modules[;]\?\b" ${SYSCTL_CONFIG} > /dev/null 2>&1; RESULT=$?
|
||||
if [ ${RESULT} -eq 1 ]; then
|
||||
# Not present in variable, so add
|
||||
ESC_PREFIX=`echo '@@PREFIX@@' | sed -e 's/\//\\\\\//g'`
|
||||
sed -i .orig -e 's/kern\.module_path[:space:]*=[:space:]*["]*\([[:alnum:][:space:]\.,;\/_-]*\)["]*/kern\.module_path="\1;'${ESC_PREFIX}'\/modules"/g' ${SYSCTL_CONFIG}
|
||||
fi
|
||||
else
|
||||
# Not present.
|
||||
echo kern.module_path="${MODULE_PATH}" >> ${SYSCTL_CONFIG}
|
||||
fi
|
||||
|
||||
|
||||
kldstat -n fuse > /dev/null 2>&1; RESULT=$?
|
||||
if [ ${RESULT} -eq 0 ]; then
|
||||
kldunload -n fuse > /dev/null 2>&1; RESULT=$?
|
||||
if [ ${RESULT} -ne 0 ]; then
|
||||
echo 'NOTICE: Failed to unload the Fuse module!'
|
||||
echo 'NOTICE: Is fuse.ko in use?'
|
||||
fi
|
||||
fi
|
||||
|
||||
grep fusefs_enable ${LOADER_CONFIG} > /dev/null 2>&1; RESULT=$?
|
||||
if [ ${RESULT} -eq 0 ]; then
|
||||
# Present, we should leave it alone
|
||||
# sed -e s/fusefs_enable.*/fuse_load=\"YES\"/g -i.orig ${LOADER_CONFIG}
|
||||
else
|
||||
# Not present. First time install, so lets start it up
|
||||
echo 'fusefs_enable="YES"' >> ${LOADER_CONFIG}
|
||||
fi
|
||||
|
||||
@@PREFIX@@/etc/rc.d/fuse.sh start > /dev/null 2>&1 ; RESULT=$?
|
||||
if [ ${RESULT} -ne 0 ]; then
|
||||
echo 'NOTICE: Failed to load the Fuse module!'
|
||||
echo 'NOTICE: Unload and load Fuse module manually, or reboot.'
|
||||
fi
|
3
sysutils/fusefs-kmod/pkg-descr
Normal file
3
sysutils/fusefs-kmod/pkg-descr
Normal file
@ -0,0 +1,3 @@
|
||||
Kernel module for fusefs based filesystems.
|
||||
|
||||
WWW: http://wikitest.freebsd.org/moin.cgi/FuseFilesystem
|
10
sysutils/fusefs-kmod/pkg-message
Normal file
10
sysutils/fusefs-kmod/pkg-message
Normal file
@ -0,0 +1,10 @@
|
||||
In order to automatically load the fuse module on startup, you need to
|
||||
set the following settings:
|
||||
|
||||
- Set the module path in /etc/sysctl.conf:
|
||||
kern.module_path=%%MODULE_PATH%%
|
||||
|
||||
- Add fusefs_enable="YES" to your /etc/rc.conf
|
||||
|
||||
%%PREFIX%%/etc/rc.d/fuse.sh start will load the module for the first time
|
||||
after the installation.
|
6
sysutils/fusefs-kmod/pkg-plist
Normal file
6
sysutils/fusefs-kmod/pkg-plist
Normal file
@ -0,0 +1,6 @@
|
||||
etc/rc.d/fuse.sh
|
||||
modules/fuse.ko
|
||||
sbin/mount_fusefs
|
||||
sbin/mount_fusefs_safe
|
||||
@unexec kldxref %D/modules
|
||||
@unexec rmdir %D/modules 2>/dev/null || true
|
Loading…
Reference in New Issue
Block a user