From owner-freebsd-ports-bugs@FreeBSD.ORG Fri Feb 8 21:40:01 2008 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74D3116A468 for ; Fri, 8 Feb 2008 21:40:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 16CF413C467 for ; Fri, 8 Feb 2008 21:40:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m18Le0LR023425 for ; Fri, 8 Feb 2008 21:40:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m18Le0Ij023424; Fri, 8 Feb 2008 21:40:00 GMT (envelope-from gnats) Resent-Date: Fri, 8 Feb 2008 21:40:00 GMT Resent-Message-Id: <200802082140.m18Le0Ij023424@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, "Alejandro Pulver" Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 626D816A417 for ; Fri, 8 Feb 2008 21:33:10 +0000 (UTC) (envelope-from alepulver@FreeBSD.org) Received: from relay00.pair.com (relay00.pair.com [209.68.5.9]) by mx1.freebsd.org (Postfix) with SMTP id D771C13C45E for ; Fri, 8 Feb 2008 21:33:09 +0000 (UTC) (envelope-from alepulver@FreeBSD.org) Received: (qmail 68296 invoked from network); 8 Feb 2008 21:06:27 -0000 Received: from unknown (HELO deimos.mars.bsd) (unknown) by unknown with SMTP; 8 Feb 2008 21:06:27 -0000 Message-Id: <1202508392.18405@deimos.mars.bsd> Date: Fri, 8 Feb 2008 19:06:32 -0300 From: "Alejandro Pulver" To: "FreeBSD gnats submit" X-Send-Pr-Version: gtk-send-pr 0.4.9 Cc: Subject: ports/120420: [UPDATE] sysutils/fusefs-kmod: update to version 0.3.9.20080208 X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2008 21:40:01 -0000 >Number: 120420 >Category: ports >Synopsis: [UPDATE] sysutils/fusefs-kmod: update to version 0.3.9.20080208 >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Fri Feb 08 21:40:00 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Alejandro Pulver >Release: FreeBSD 6.2-RELEASE i386 >Organization: >Environment: System: FreeBSD 6.2-RELEASE #0: Fri Jan 12 11:05:30 UTC 2007 root@dessler.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP >Description: - Update to version 0.3.9.20080208. - Download directly from the Mercurial reposirory (as tarball), to ease maintainence. - Remove all local patches as they were integrated. - Convert setup.sh into setup.sh.in, and use SUB_FILES instead of manual replacement. - Use kldload instead of rc.d script in setup.sh.in because the latter gives an error. - Remove "sleep 1" from rc.d script as now the FUSE daemon makes umount wait until disks are synced. - Update pkg-message. >How-To-Repeat: >Fix: --- fusefs-kmod.diff begins here --- Index: fusefs-kmod/Makefile =================================================================== RCS file: /home/pcvs/ports/sysutils/fusefs-kmod/Makefile,v retrieving revision 1.18 diff -u -r1.18 Makefile --- fusefs-kmod/Makefile 8 Feb 2008 19:44:43 -0000 1.18 +++ fusefs-kmod/Makefile 8 Feb 2008 20:51:12 -0000 @@ -6,13 +6,12 @@ # PORTNAME= fusefs -DISTVERSION= 0.3.9-pre1 -PORTREVISION= 3 +PORTVERSION= 0.3.9.20080208 CATEGORIES= sysutils kld -MASTER_SITES= http://fuse4bsd.creo.hu/downloads/ \ - http://am-productions.biz/docs/ +MASTER_SITES= http://mercurial.creo.hu/repos/fuse4bsd-hg/index.cgi/archive/ PKGNAMESUFFIX= -kmod -DISTNAME= fuse4bsd-${DISTVERSION} +DISTNAME= ${HG_SHORTREV} +DIST_SUBDIR= fuse4bsd MAINTAINER= amistry@am-productions.biz COMMENT= Kernel module for fuse @@ -23,15 +22,16 @@ BUILD_DEPENDS+= deplate:${PORTSDIR}/textproc/ruby-deplate .endif -USE_BZIP2= yes -MAKE_ENV= BINDIR="${PREFIX}/sbin" MANDIR="${PREFIX}/man/man" +USE_RC_SUBR= fusefs +MAKE_ENV= BINDIR="${PREFIX}/sbin" MANDIR="${MANPREFIX}/man/man" \ + KMODDIR="${KMODDIR}" SRC_BASE="${SRC_BASE}" +WRKSRC= ${WRKDIR}/fuse4bsd-${HG_SHORTREV} +DISABLE_SIZE= yes SRC_BASE?= /usr/src KMODDIR= ${PREFIX}/modules -MAKE_ARGS= KMODDIR=${KMODDIR} -MODULE_PATH= `/sbin/sysctl -n kern.module_path`;${KMODDIR} -USE_RC_SUBR= fusefs SETUP= setup.sh +HG_SHORTREV= 498acaef33b0 MAN8= mount_fusefs.8 TXT_DOCS= doc.text @@ -66,8 +66,10 @@ IGNORE= requires the userland sources to be installed. Set SRC_BASE if it is not in /usr/src .endif -.if !defined(WITH_AUTOSETUP) -SUB_FILES= pkg-message +.if defined(WITH_AUTOSETUP) +SUB_FILES+= ${SETUP} +.else +SUB_FILES+= pkg-message .endif post-patch: @@ -88,10 +90,8 @@ post-install: @${LN} -fs ${PREFIX}/sbin/mount_fusefs /usr/sbin .if defined(WITH_AUTOSETUP) && !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} + @${ECHO} "Modifying global startup config files and loading module..." + @${SH} ${WRKDIR}/${SETUP} .else @${ECHO_CMD}; ${CAT} ${PKGMESSAGE}; ${ECHO_CMD} .endif Index: fusefs-kmod/distinfo =================================================================== RCS file: /home/pcvs/ports/sysutils/fusefs-kmod/distinfo,v retrieving revision 1.5 diff -u -r1.5 distinfo --- fusefs-kmod/distinfo 13 Aug 2007 10:48:41 -0000 1.5 +++ fusefs-kmod/distinfo 8 Feb 2008 20:51:12 -0000 @@ -1,3 +1,3 @@ -MD5 (fuse4bsd-0.3.9-pre1.tar.bz2) = d427d6c831794f6d62ce1aef9f254f9e -SHA256 (fuse4bsd-0.3.9-pre1.tar.bz2) = e339fce188b3667ca267f8d672d3f9657d61e384d54997a93d64ddd178fd55d7 -SIZE (fuse4bsd-0.3.9-pre1.tar.bz2) = 112627 +MD5 (fuse4bsd/498acaef33b0.tar.gz) = 9fd12d284be9450dae0ec5e718a5bc8e +SHA256 (fuse4bsd/498acaef33b0.tar.gz) = 70ec94c6700f6395316c68d60ba0307236b20cddd6aeeedd4597870e7670ff2a +SIZE (fuse4bsd/498acaef33b0.tar.gz) = 116037 Index: fusefs-kmod/files/fusefs.in =================================================================== RCS file: /home/pcvs/ports/sysutils/fusefs-kmod/files/fusefs.in,v retrieving revision 1.5 diff -u -r1.5 fusefs.in --- fusefs-kmod/files/fusefs.in 17 Dec 2007 17:22:09 -0000 1.5 +++ fusefs-kmod/files/fusefs.in 8 Feb 2008 20:51:12 -0000 @@ -40,13 +40,13 @@ return 1 fi echo "Stopping ${name}." -# Unmount FUSE filesystems in reverse order (in case they are nested) with -# a delay of one second after, to allow 'umount' finish. +# Unmount FUSE filesystems in reverse order (in case they are nested) to +# allow recent FUSE implementation to synchronize disks before shutdown. mount | sed -e '1!G;h;$!d' | while read dev d1 mountpoint d2; do case "$dev" in /dev/fuse[0-9]*) echo "fusefs: unmounting ${mountpoint}." - umount $mountpoint ; sleep 1 + umount $mountpoint ;; esac done Index: fusefs-kmod/files/patch-fuse_io.c =================================================================== RCS file: fusefs-kmod/files/patch-fuse_io.c diff -N fusefs-kmod/files/patch-fuse_io.c --- fusefs-kmod/files/patch-fuse_io.c 17 Dec 2007 17:22:09 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,11 +0,0 @@ ---- fuse_module/fuse_io.c.orig Tue Jun 19 09:35:22 2007 -+++ fuse_module/fuse_io.c Thu Dec 13 02:46:05 2007 -@@ -148,7 +148,7 @@ - } - - if (uio->uio_resid == 0) -- return (0); -+ goto out; - - if (uio->uio_rw == UIO_WRITE && fp->f_flag & O_APPEND) { - if ((err = VOP_GETATTR(vp, &va, cred, td))) Index: fusefs-kmod/files/patch-fuse_module_Makefile =================================================================== RCS file: fusefs-kmod/files/patch-fuse_module_Makefile diff -N fusefs-kmod/files/patch-fuse_module_Makefile --- fusefs-kmod/files/patch-fuse_module_Makefile 1 Jan 2008 10:52:38 -0000 1.4 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,18 +0,0 @@ ---- fuse_module/Makefile.orig 2007-06-19 14:35:22.000000000 +0200 -+++ fuse_module/Makefile 2007-08-16 18:31:50.000000000 +0200 -@@ -21,7 +21,14 @@ - .endif - - .if defined(KERNCONF) --KERNCONFDIR= /usr/obj/usr/src/sys/${KERNCONF} -+.if !defined(MAKEOBJDIRPREFIX) -+MAKEOBJDIRPREFIX=/usr/obj -+.endif -+.if !defined(SRC_BASE) -+SRC_BASE=/usr/src -+.endif -+KERNCONF1!= echo ${KERNCONF} | sed -e 's/ .*//g' -+KERNCONFDIR= ${MAKEOBJDIRPREFIX}${SRC_BASE}/sys/${KERNCONF1} - .endif - - .if defined(KERNCONFDIR) Index: fusefs-kmod/files/patch-fuse_module_fuse.h =================================================================== RCS file: fusefs-kmod/files/patch-fuse_module_fuse.h diff -N fusefs-kmod/files/patch-fuse_module_fuse.h --- fusefs-kmod/files/patch-fuse_module_fuse.h 13 Aug 2007 10:48:41 -0000 1.3 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,36 +0,0 @@ ---- fuse_module/fuse.h.orig Tue Jun 19 14:35:22 2007 -+++ fuse_module/fuse.h Sat Jul 14 13:23:37 2007 -@@ -33,6 +33,24 @@ - #endif - #endif - -+#ifndef USE_PRIVILEGE_API -+/* -+ * __FreeBSD_version bump was omitted for introduction of -+ * the privilege API (both when it's been added and when the -+ * legacy API has been removed), so here we just use the first -+ * value of __FreeBSD_version after adding the priv stuff. -+ */ -+#if __FreeBSD_version >= 700025 -+#define USE_PRIVILEGE_API 1 -+#else -+#define USE_PRIVILEGE_API 0 -+#endif -+#endif -+#if ! USE_PRIVILEGE_API -+#define priv_check(td, priv) suser(td) -+#define priv_check_cred(cred, priv, flag) suser_cred(cred, SUSER_ALLOWJAIL) -+#endif -+ - /* - * Appearance of new FUSE operations is not always in par with version - * numbering... At least, 7.3 is a sufficient condition for having -@@ -210,7 +228,7 @@ - void fprettyprint(struct fuse_iov *fiov, size_t dlen); - #endif - --#if _DEBUG || _DEBUG2G || _DEBUG3G || defined(INVARIANTS) -+#if _DEBUG || _DEBUG2G || _DEBUG3G || defined(INVARIANTS) || FUSELIB_CONFORM_BIOREAD - int isbzero(void *buf, size_t len); - #endif - Index: fusefs-kmod/files/patch-fuse_vfsops.c =================================================================== RCS file: fusefs-kmod/files/patch-fuse_vfsops.c diff -N fusefs-kmod/files/patch-fuse_vfsops.c --- fusefs-kmod/files/patch-fuse_vfsops.c 13 Aug 2007 10:48:41 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,63 +0,0 @@ ---- fuse_module/fuse_vfsops.c Sat Jul 14 13:13:55 2007 -+++ fuse_module/fuse_vfsops.c Sat Jul 14 13:13:55 2007 -@@ -23,6 +23,20 @@ - #include "fuse_session.h" - #include "fuse_vnode.h" - -+#if USE_PRIVILEGE_API -+#include -+#endif -+ -+ -+/* This will do for privilege types for now */ -+#ifndef PRIV_VFS_FUSE_ALLOWOTHER -+#define PRIV_VFS_FUSE_ALLOWOTHER PRIV_VFS_MOUNT_NONUSER -+#endif -+#ifndef PRIV_VFS_FUSE_MOUNT_NONUSER -+#define PRIV_VFS_FUSE_MOUNT_NONUSER PRIV_VFS_MOUNT_NONUSER -+#endif -+ -+ - static int fuse_init_handler(struct fuse_ticket *tick, struct uio *uio); - static void fuse_send_init(struct fuse_data *data, struct thread *td); - static vfs_hash_cmp_t fuse_vnode_bgdrop_cmp; -@@ -207,10 +221,8 @@ fuse_mount(struct mount *mp, struct thre - KASSERT(fuse_useco >= 0, - ("negative fuse usecount despite Giant")); - -- if (mp->mnt_flag & MNT_UPDATE) { -- uprintf("fuse: updating mounts is not supported\n"); -+ if (mp->mnt_flag & MNT_UPDATE) - return (EOPNOTSUPP); -- } - - mp->mnt_flag |= MNT_SYNCHRONOUS; - /* Get the new options passed to mount */ -@@ -293,10 +305,8 @@ fuse_mount(struct mount *mp, struct thre - - if (fdata_kick_get(data)) - err = ENOTCONN; -- if (mntopts & FSESS_DAEMON_CAN_SPY && suser(td)) { -- uprintf("only root can use \"allow_other\"\n"); -- err = EPERM; -- } -+ if (mntopts & FSESS_DAEMON_CAN_SPY) -+ err = priv_check(td, PRIV_VFS_FUSE_ALLOWOTHER); - - slock = &data->mhierlock; - /* Note that sx_try_xlock returns 0 on _failure_ */ -@@ -334,10 +344,9 @@ fuse_mount(struct mount *mp, struct thre - */ - err = EINVAL; - } else { -- if (suser(td) && -- td->td_ucred->cr_uid != data->daemoncred->cr_uid) -- /* we are not allowed to do the first mount */ -- err = EPERM; -+ if (td->td_ucred->cr_uid != data->daemoncred->cr_uid) -+ /* are we allowed to do the first mount? */ -+ err = priv_check(td, PRIV_VFS_FUSE_MOUNT_NONUSER); - } - - if (err) { - Index: fusefs-kmod/files/patch-fuse_vnops.c =================================================================== RCS file: fusefs-kmod/files/patch-fuse_vnops.c diff -N fusefs-kmod/files/patch-fuse_vnops.c --- fusefs-kmod/files/patch-fuse_vnops.c 13 Aug 2007 10:48:41 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,106 +0,0 @@ ---- fuse_module/fuse_vnops.c Sat Jul 14 13:14:27 2007 -+++ fuse_module/fuse_vnops.c Sat Jul 14 13:14:27 2007 -@@ -42,6 +42,10 @@ - #include "fuse_vnode.h" - #include "fuse_io.h" - -+#if USE_PRIVILEGE_API -+#include -+#endif -+ - /* function prototype for iterators over filehandles (of a vp) */ - typedef int fuse_metrics_t(struct vnode *vp, struct thread *td, - struct ucred *cred, struct fuse_filehandle *fufh, -@@ -63,7 +67,9 @@ struct fuse_access_param { - #define FACCESS_CHOWN 0x08 /* do permission check for owner changing */ - #define FACCESS_NOCHECKSPY 0x10 /* don't check if daemon is allowed to spy on - user */ --#define FACCESS_XQUERIES FACCESS_STICKY | FACCESS_CHOWN -+#define FACCESS_SETGID 0x12 /* do permission check for setting setgid flag */ -+ -+#define FACCESS_XQUERIES FACCESS_STICKY | FACCESS_CHOWN | FACCESS_SETGID - - #define FVP_ACCESS_NOOP 0x01 /* vnode based control flag for doing access check */ - -@@ -855,6 +861,7 @@ fuse_access(ap) - - /* - * Attribute caching hasn't yet been implemented. -+ * [... Update: it _has been_ implemented.] - * However, within one function we don't wanna query attributes - * several times. Now it's enough pull the attributes once, and throw - * it into the following routine with various modes. -@@ -929,12 +936,16 @@ fuse_access_i(struct vnode *vp, mode_t m - mode == VWRITE) { - if (cred->cr_uid != facp->xuid && - cred->cr_uid != VTOVA(vp)->va_uid) -- err = suser_cred(cred, SUSER_ALLOWJAIL); -+ err = priv_check_cred(cred, -+ PRIV_VFS_ADMIN, -+ 0); - } - /* - * We return here because this flags is exlusive - * with the others - */ -+ KASSERT(facp->facc_flags == FACCESS_STICKY, -+ ("sticky access check comes in mixed")); - return (err); - } - -@@ -947,10 +958,21 @@ fuse_access_i(struct vnode *vp, mode_t m - (cred->cr_gid != facp->xgid && - facp->xgid != (gid_t)VNOVAL && - ! groupmember(facp->xgid, cred))) -- err = suser_cred(cred, SUSER_ALLOWJAIL); -- return (err); -+ err = priv_check_cred(cred, PRIV_VFS_CHOWN, 0); -+ if (err) -+ return (err); - } - -+ if (facp->facc_flags & FACCESS_SETGID) { -+ gid_t sgid = facp->xgid; -+ -+ if (sgid == (gid_t)VNOVAL) -+ sgid = VTOVA(vp)->va_gid; -+ -+ if (! groupmember(sgid, cred)) -+ err = priv_check_cred(cred, PRIV_VFS_SETGID, 0); -+ return (err); -+ } - - } else { - #if FUSE_HAS_ACCESS -@@ -1234,7 +1256,13 @@ fuse_lookup(ap) - */ - if (nameiop == RENAME && wantparent && islastcn) { - DEBUG("something to rename...\n"); -- if ((err = fuse_access_i(dvp, VWRITE, cred, td, &facp))) -+ -+ facp.xuid = fattr->uid; -+ facp.facc_flags |= FACCESS_STICKY; -+ err = fuse_access_i(dvp, VWRITE, cred, td, &facp); -+ facp.facc_flags &= ~FACCESS_XQUERIES; -+ -+ if (err) - goto out; - - /* -@@ -2948,8 +2976,14 @@ fuse_setattr(ap) - } - - if (vap->va_mode != (mode_t)VNOVAL) { -+#if _DEBUG - if (vap->va_mode & S_IFMT) -- DEBUG("fuse_setattr -- weird: format bits in mode field, 0%o\n", vap->va_mode); -+ DEBUG("fuse_setattr -- weird: " -+ "format bits in mode field, 0%o\n", -+ vap->va_mode); -+#endif -+ if (vap->va_mode & S_ISGID) -+ facp.facc_flags |= FACCESS_SETGID; - fsai->FUSEATTR(mode) = vap->va_mode & ALLPERMS; - fsai->valid |= FATTR_MODE; - } - Index: fusefs-kmod/files/patch-mount_fusefs-mount_fusefs.c =================================================================== RCS file: fusefs-kmod/files/patch-mount_fusefs-mount_fusefs.c diff -N fusefs-kmod/files/patch-mount_fusefs-mount_fusefs.c --- fusefs-kmod/files/patch-mount_fusefs-mount_fusefs.c 17 Dec 2007 17:22:09 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,21 +0,0 @@ ---- mount_fusefs/mount_fusefs.c.orig Tue Jun 19 09:35:22 2007 -+++ mount_fusefs/mount_fusefs.c Thu Dec 13 02:44:12 2007 -@@ -70,6 +70,8 @@ - { "user_id=", 0, 0x00, 1 }, - { "group_id=", 0, 0x00, 1 }, - { "large_read", 0, 0x00, 1 }, -+ /* "nonempty", just the first two chars are stripped off during parsing */ -+ { "nempty", 0, 0x00, 1 }, - MOPT_STDOPTS, - MOPT_END - }; -@@ -469,7 +471,8 @@ - int - init_backgrounded(void) - { -- int ibg, len; -+ int ibg; -+ size_t len; - - len = sizeof(ibg); - Index: fusefs-kmod/files/pkg-message.in =================================================================== RCS file: /home/pcvs/ports/sysutils/fusefs-kmod/files/pkg-message.in,v retrieving revision 1.2 diff -u -r1.2 pkg-message.in --- fusefs-kmod/files/pkg-message.in 17 Dec 2007 17:22:09 -0000 1.2 +++ fusefs-kmod/files/pkg-message.in 8 Feb 2008 20:51:12 -0000 @@ -13,8 +13,7 @@ named "mount_", which is not created by all the fusefs ports. Note that the rc.d script will unmount all fuse filesystems when called with -"stop", so it can unload the kernel module, and as a temporary workaround to -flush cache in drivers like NTFS-3G (sysutils/fusefs-ntfs) at shutdown (until -a proper solution is implemented). +"stop" (in reverse order in case of nested mounts), so it can unload the +kernel module. ============================================================================== Index: fusefs-kmod/files/setup.sh =================================================================== RCS file: fusefs-kmod/files/setup.sh diff -N fusefs-kmod/files/setup.sh --- fusefs-kmod/files/setup.sh 5 Apr 2006 02:53:39 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,52 +0,0 @@ -#!/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/fusefs 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 Index: fusefs-kmod/files/setup.sh.in =================================================================== RCS file: fusefs-kmod/files/setup.sh.in diff -N fusefs-kmod/files/setup.sh.in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ fusefs-kmod/files/setup.sh.in 8 Feb 2008 20:51:12 -0000 @@ -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 + +kldload fuse > /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 --- fusefs-kmod.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted: