Bug 108788 - [patch] sysutils/fusefs-kmod: Add BASE option
Summary: [patch] sysutils/fusefs-kmod: Add BASE option
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Martin Matuska
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-05 08:50 UTC by Alex Kozlov
Modified: 2008-06-16 04:40 UTC (History)
0 users

See Also:


Attachments
file.diff (123 bytes, patch)
2007-02-05 08:50 UTC, Alex Kozlov
no flags Details | Diff
file.diff (286 bytes, patch)
2007-02-05 08:50 UTC, Alex Kozlov
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Kozlov 2007-02-05 08:50:19 UTC
Add option BASE which allows to install kld in /boot/modules. That will permit load fuse-kmod from loader.conf if /usr on a separate partition.

Fix: 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
@@ -46,7 +45,8 @@
        serif.css \
        tabbar-right.css

-OPTIONS=   AUTOSETUP "Automatic global config file setup" off
+OPTIONS=   AUTOSETUP "Automatic global config file setup" off\
+           BASE "Install to the base system" off

 .include <bsd.port.pre.mk>

@@ -58,11 +58,31 @@
 IGNORE=        requires the Kernel source to be installed. Set SRC_BASE if it is not in /usr/src
 .endif

+.if defined(WITH_BASE)
+.if defined(WITH_AUTOSETUP)
+IGNORE=    cannot install: the WITH_BASE and WITH_AUTOSETUP are not compatible
+.endif
+KMODDIR=   /boot/modules
+PLIST_FILES+=  "@cwd /"
+.endif
+
+MAKE_ENV+= KMODDIR="${KMODDIR}"
+
+.if defined(WITH_BASE)
+PLIST_FILES+=   ${KMODDIR:C,^/,,}/fuse.ko
+.else
+PLIST_FILES+=  "modules/fuse.ko"
+.endif
+PLIST_FILES+=   "@unexec kldxref ${KMODDIR}"
+PLIST_FILES+=  "@cwd ${PREFIX}"
+
 post-configure:
    @${CP} ${LOCALBASE}/include/fuse/fuse_kernel.h ${WRKSRC}/fuse_module

 pre-install:
+.if !defined(WITH_BASE)
    @${MKDIR} ${KMODDIR}
+.endif

 post-install:
 .if (defined(WITH_AUTOSETUP) && !defined(BATCH) && !defined(PACKAGE_BUILDING)) \
@@ -71,7 +91,7 @@
        ${FILESDIR}/${SETUP} > ${WRKDIR}/${SETUP}
    @${ECHO} "Modifying global startup config files and loading module...";
    ${SH} ${WRKDIR}/${SETUP}
-.else
+.elif !defined(WITH_BASE)
    @${SED} -e "s|%%PREFIX%%|${PREFIX}|g" \
        -e "s|%%MODULE_PATH%%|${MODULE_PATH}|g" ${PKGMESSAGE}
 .endif
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2007-02-05 08:51:01 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback
Comment 2 Alex Kozlov 2007-08-25 17:06:15 UTC
Hi

Maintainer timeout?


--
Adios
Comment 3 Martin Matuska freebsd_committer freebsd_triage 2007-09-05 14:58:55 UTC
Responsible Changed
From-To: freebsd-ports-bugs->mm

I'll take it.
Comment 4 Martin Matuska freebsd_committer freebsd_triage 2007-09-05 15:20:28 UTC
The port has been updated to a more recent version in the meantime
(0.3.9.p1).

- submitter please re-check and/or re-work your patch.
- maintainer please give an opition on this.

Thank you very much for your effort.
Comment 5 Alex Kozlov 2007-09-09 09:09:09 UTC
On Wed, Sep 05, 2007 at 04:20:28PM +0200, Martin Matuska wrote:
> The port has been updated to a more recent version in the meantime
> (0.3.9.p1).
> 
> - submitter please re-check and/or re-work your patch.
> - maintainer please give an opition on this.
> 
> Thank you very much for your effort.
Btw, if in /etc/make.conf set KERNCONFDIR variable, port won't build:

In file included from fuse_main.c:5:
./config.h:2:24: opt_global.h: No such file or directory
*** Error code 1
Stop in /usr/obj/var/ports/sysutils/fusefs-kmod/work/fuse4bsd-0.3.9-pre1/fuse_module.
*** Error code 1

Quick fix is remove
#ifdef KERNCONFDIR
#include <opt_global.h>
#endif
from fuse4bsd-0.3.9-pre1/fuse_module/config.h

Updated patch:

Index: sysutils/fusefs-kmod/Makefile
@@ -27,7 +27,6 @@
 
 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
@@ -50,7 +49,8 @@
 		serif.css \
 		tabbar-right.css
 
-OPTIONS=	AUTOSETUP "Automatic global config file setup" off
+OPTIONS=	AUTOSETUP "Automatic global config file setup" off \
+			BASE "Install to the base system" off
 
 .include <bsd.port.pre.mk>
 
@@ -62,6 +62,24 @@
 IGNORE=		requires the Kernel source to be installed. Set SRC_BASE if it is not in /usr/src
 .endif
 
+.if defined(WITH_BASE)
+.if defined(WITH_AUTOSETUP)
+IGNORE=	cannot install: the WITH_BASE and WITH_AUTOSETUP are not compatible
+.endif
+KMODDIR=	/boot/modules
+PLIST_FILES+=	"@cwd /"
+.endif
+
+MAKE_ENV+=	KMODDIR="${KMODDIR}"
+
+.if defined(WITH_BASE)
+PLIST_FILES+=   ${KMODDIR:C,^/,,}/fuse.ko
+.else
+PLIST_FILES+=	"modules/fuse.ko"
+.endif
+PLIST_FILES+=   "@unexec kldxref ${KMODDIR}"
+PLIST_FILES+=	"@cwd ${PREFIX}"
+
 post-patch:
 	@${REINPLACE_CMD} -e 's/deplate.rb/deplate/g' \
 		${WRKSRC}/doc/Makefile
@@ -75,7 +93,9 @@
 .endif
 
 pre-install:
+.if !defined(WITH_BASE)
 	@${MKDIR} ${KMODDIR}
+.endif
 
 post-install:
 .if (defined(WITH_AUTOSETUP) && !defined(BATCH) && !defined(PACKAGE_BUILDING)) \
@@ -84,7 +104,7 @@
 		${FILESDIR}/${SETUP} > ${WRKDIR}/${SETUP}
 	@${ECHO} "Modifying global startup config files and loading module...";
 	${SH} ${WRKDIR}/${SETUP}
-.else
+.elif !defined(WITH_BASE)
 	@${SED} -e "s|%%PREFIX%%|${PREFIX}|g" \
 		-e "s|%%MODULE_PATH%%|${MODULE_PATH}|g" ${PKGMESSAGE}
 .endif
Index: sysutils/fusefs-kmod/pkg-plist
@@ -1,6 +1,4 @@
-modules/fuse.ko
 sbin/mount_fusefs
-@unexec kldxref %D/modules
 @dirrmtry modules
 %%PORTDOCS%%%%DOCSDIR%%/kmod/doc.text
 %%PORTDOCS%%%%DOCSDIR%%/kmod/html/Faq.html


--
Adios
Comment 6 amistry 2007-11-24 17:39:24 UTC
Recent changes to the port allow for mounting from fstab.  Was there 
another reason for this change?

-- 
Anish Mistry
amistry@am-productions.biz
AM Productions http://am-productions.biz/
Comment 7 Martin Matuska freebsd_committer freebsd_triage 2008-01-01 10:35:55 UTC
State Changed
From-To: feedback->closed

Submitter feedback timeout.
Comment 8 Alex Kozlov 2008-06-15 18:43:44 UTC
Hi                                                                                                  
                                                                                                    
Sorry for delay. I don't get last email(s) from You.                                                
                                                                                                    
How about this patch? After it everyone can choose where install                                    
kmod just by setting KMODDIR in /etc/make.conf:                                                     
                                                                                                    
Index: sysutils/fusefs-kmod/Makefile                                                                
@@ -24,6 +24,8 @@                                                                                   
 .endif                                                                                             
                                                                                                    
 USE_RC_SUBR=   fusefs                                                                              
+KMODDIR?=      ${PREFIX}/modules                                                                   
+PLIST_SUB=     KMODDIR=${KMODDIR}                                                                  
 MAKE_ENV=      BINDIR="${PREFIX}/sbin" MANDIR="${MANPREFIX}/man/man" \                             
                KMODDIR="${KMODDIR}" SYSDIR="${SRC_BASE}/sys" \                                     
                MOUNT="${SRC_BASE}/sbin/mount"                                                      
@@ -31,7 +33,6 @@                                                                                   
 DISABLE_SIZE=  yes                                                                                 
                                                                                                    
 SRC_BASE?=     /usr/src                                                                            
-KMODDIR=       ${PREFIX}/modules                                                                   
 SETUP=         setup.sh                                                                            
 HG_SHORTREV=   498acaef33b0                                                                        
                                                                                                    
Index: sysutils/fusefs-kmod/pkg-plist                                                               
@@ -1,9 +1,11 @@                                                                                    
-modules/fuse.ko                                                                                    
 sbin/mount_fusefs                                                                                  
 @exec ln -fs %D/%F /usr/sbin                                                                       
-@unexec rm -f /usr/sbin/mount_fusefs 2>&1 >/dev/null || true                                       
-@unexec kldxref %D/modules                                                                         
-@dirrmtry modules                                                                                  
+@cwd %%KMODDIR%%                                                                                   
+fuse.ko                                                                                            
+@unexec kldxref %%KMODDIR%%                                                                        
+@dirrmtry %%KMODDIR%%                                                                              
+@cwd %%PREFIX%%                                                                                    
+@rmtry /usr/sbin/mount_fusefs                                                                      
 %%PORTDOCS%%%%DOCSDIR%%/kmod/doc.text                                                              
 %%PORTDOCS%%%%DOCSDIR%%/kmod/html/Faq.html                                                        
 %%PORTDOCS%%%%DOCSDIR%%/kmod/html/Implementation.html
Comment 9 Alex Kozlov 2008-06-15 20:15:25 UTC
Hi

I don't have tinderbox on notebook, sorry. 
Corrected version:

Index: sysutils/fusefs-kmod/Makefile
@@ -24,6 +24,8 @@
 .endif
 
 USE_RC_SUBR=	fusefs
+KMODDIR?=	${PREFIX}/modules
+PLIST_SUB=	KMODDIR=${KMODDIR}
 MAKE_ENV=	BINDIR="${PREFIX}/sbin" MANDIR="${MANPREFIX}/man/man" \
 		KMODDIR="${KMODDIR}" SYSDIR="${SRC_BASE}/sys" \
 		MOUNT="${SRC_BASE}/sbin/mount"
@@ -31,7 +33,6 @@
 DISABLE_SIZE=	yes
 
 SRC_BASE?=	/usr/src
-KMODDIR=	${PREFIX}/modules
 SETUP=		setup.sh
 HG_SHORTREV=	498acaef33b0
 
Index: sysutils/fusefs-kmod/pkg-plist
@@ -1,9 +1,6 @@
-modules/fuse.ko
 sbin/mount_fusefs
 @exec ln -fs %D/%F /usr/sbin
 @unexec rm -f /usr/sbin/mount_fusefs 2>&1 >/dev/null || true
-@unexec kldxref %D/modules
-@dirrmtry modules
 %%PORTDOCS%%%%DOCSDIR%%/kmod/doc.text
 %%PORTDOCS%%%%DOCSDIR%%/kmod/html/Faq.html
 %%PORTDOCS%%%%DOCSDIR%%/kmod/html/Implementation.html
@@ -23,3 +20,7 @@
 %%PORTDOCS%%@dirrm %%DOCSDIR%%/kmod/html
 %%PORTDOCS%%@dirrm %%DOCSDIR%%/kmod
 @dirrmtry %%DOCSDIR%%
+@cwd %%KMODDIR%%
+fuse.ko
+@unexec kldxref %%KMODDIR%%
+@unexec rmdir %%KMODDIR%% 2>/dev/null || true
Comment 10 amistry 2008-06-16 04:05:40 UTC
On Sunday 15 June 2008, Alex Kozlov wrote:
> Hi
>
> I don't have tinderbox on notebook, sorry.
> Corrected version:
>
> Index: sysutils/fusefs-kmod/Makefile
> @@ -24,6 +24,8 @@
>  .endif
>
>  USE_RC_SUBR=	fusefs
> +KMODDIR?=	${PREFIX}/modules
> +PLIST_SUB=	KMODDIR=${KMODDIR}
>  MAKE_ENV=	BINDIR="${PREFIX}/sbin" MANDIR="${MANPREFIX}/man/man" \
>  		KMODDIR="${KMODDIR}" SYSDIR="${SRC_BASE}/sys" \
>  		MOUNT="${SRC_BASE}/sbin/mount"
> @@ -31,7 +33,6 @@
>  DISABLE_SIZE=	yes
>
>  SRC_BASE?=	/usr/src
> -KMODDIR=	${PREFIX}/modules
>  SETUP=		setup.sh
>  HG_SHORTREV=	498acaef33b0
>
> Index: sysutils/fusefs-kmod/pkg-plist
> @@ -1,9 +1,6 @@
> -modules/fuse.ko
>  sbin/mount_fusefs
>  @exec ln -fs %D/%F /usr/sbin
>  @unexec rm -f /usr/sbin/mount_fusefs 2>&1 >/dev/null || true
> -@unexec kldxref %D/modules
> -@dirrmtry modules
>  %%PORTDOCS%%%%DOCSDIR%%/kmod/doc.text
>  %%PORTDOCS%%%%DOCSDIR%%/kmod/html/Faq.html
>  %%PORTDOCS%%%%DOCSDIR%%/kmod/html/Implementation.html
> @@ -23,3 +20,7 @@
>  %%PORTDOCS%%@dirrm %%DOCSDIR%%/kmod/html
>  %%PORTDOCS%%@dirrm %%DOCSDIR%%/kmod
>  @dirrmtry %%DOCSDIR%%
> +@cwd %%KMODDIR%%
> +fuse.ko
> +@unexec kldxref %%KMODDIR%%
> +@unexec rmdir %%KMODDIR%% 2>/dev/null || true

Looks good.


-- 
Anish Mistry
amistry@am-productions.biz
AM Productions http://am-productions.biz/