From howardjp@byzantine.student.umd.edu Fri Oct  8 15:57:10 1999
Return-Path: <howardjp@byzantine.student.umd.edu>
Received: from byzantine.student.umd.edu (byzantine.student.umd.edu [129.2.244.158])
	by hub.freebsd.org (Postfix) with ESMTP id F08CB15956
	for <FreeBSD-gnats-submit@freebsd.org>; Fri,  8 Oct 1999 15:57:05 -0700 (PDT)
	(envelope-from howardjp@byzantine.student.umd.edu)
Received: (from howardjp@localhost)
	by byzantine.student.umd.edu (8.9.3/8.9.3) id SAA03761;
	Fri, 8 Oct 1999 18:57:57 -0400 (EDT)
	(envelope-from howardjp)
Message-Id: <199910082257.SAA03761@byzantine.student.umd.edu>
Date: Fri, 8 Oct 1999 18:57:57 -0400 (EDT)
From: howardjp@wam.umd.edu
Sender: howardjp@byzantine.student.umd.edu
Reply-To: howardjp@wam.umd.edu
To: FreeBSD-gnats-submit@freebsd.org
Subject: [PATCH] EXT2FS as a KLD
X-Send-Pr-Version: 3.2

>Number:         14217
>Category:       kern
>Synopsis:       [PATCH] EXT2FS as a KLD
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bde
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Oct  8 16:00:00 PDT 1999
>Closed-Date:    Tue Aug 06 07:49:45 PDT 2002
>Last-Modified:  Tue Aug 06 07:49:45 PDT 2002
>Originator:     James Howard
>Release:        FreeBSD 4.0-CURRENT i386
>Organization:
University of Maryland
>Environment:

FreeBSD byzantine.student.umd.edu 4.0-CURRENT FreeBSD 4.0-CURRENT #40: Wed Oct  6 18:17:44 EDT 1999     howardjp@byzantine.student.umd.edu:/usr/src/sys/compile/BYZANTINE  i386

>Description:

I wanted to learn how KLDs work, and in the process, I KLD-ified
EXT2FS support.  Below is a patch to sys/modules.  I am not entirely
certain I have done this correctly, but with it loaded, I have been
able to read and write to a file formatted using mke2fs from Linux.

While I was at it, I "fixed" modules/Makefile so that each sub-
directory lies on a seperate line, as in most of the other Makefiles.

>How-To-Repeat:

N/A

>Fix:

diff -Nur modules.old/Makefile modules/Makefile
--- modules.old/Makefile	Fri Oct  8 18:48:05 1999
+++ modules/Makefile	Fri Oct  8 18:49:45 1999
@@ -2,15 +2,72 @@
 
 # XXX present but broken: atapi ip_mroute_mod joy pcic
 
-SUBDIR=	aha al ax ccd cd9660 coda dm fdesc fxp if_disc if_ppp if_sl if_tun \
-	ipfw kernfs md mfs mii msdos mx nfs ntfs nullfs pn portal procfs rl \
-	sf sis sk ste ti tl umapfs union vn vr wb xl
+SUBDIR=	aha \
+	al \
+	ax \
+	ccd \
+	cd9660 \
+	coda \
+	dm \
+	ext2fs \
+	fdesc \
+	fxp \
+	if_disc \
+	if_ppp \
+	if_sl \
+	if_tun \
+	ipfw \
+	kernfs \
+	md \
+	mfs \
+	mii \
+	msdos \
+	mx \
+	nfs \
+	ntfs \
+	nullfs \
+	pn \
+	portal \
+	procfs \
+	rl \
+	sf \
+	sis \
+	sk \
+	ste \
+	ti \
+	tl \
+	umapfs \
+	union \
+	vn \
+	vr \
+	wb \
+	xl
 
 # XXX some of these can move to the general case when de-i386'ed
 .if ${MACHINE_ARCH} == "i386"
-SUBDIR+=amr bktr coff fpu gnufpu ibcs2 linux mlx ncp nwfs splash streams \
-	svr4 syscons vesa vinum
-SUBDIR+=ugen uhid ukbd ulpt ums umodem umass
+SUBDIR+=amr \
+	bktr \
+	coff \
+	fpu \
+	gnufpu \
+	ibcs2 \
+	linux \
+	mlx \
+	ncp \
+	nwfs \
+	splash \
+	streams \
+	svr4 \
+	syscons \
+	vesa \
+	vinum
+SUBDIR+=ugen \
+	uhid \
+	ukbd \
+	ulpt \
+	ums \
+	umodem \
+	umass
 .endif
 
 .include <bsd.subdir.mk>
diff -Nur modules.old/ext2fs/Makefile modules/ext2fs/Makefile
--- modules.old/ext2fs/Makefile	Wed Dec 31 19:00:00 1969
+++ modules/ext2fs/Makefile	Fri Oct  8 18:48:40 1999
@@ -0,0 +1,23 @@
+# $FreeBSD: src/sys/modules/nfs/Makefile,v 1.12 1999/08/28 00:47:29 peter Exp $
+
+.PATH: ${.CURDIR}/../../gnu/ext2fs
+KMOD=	ext2fs
+SRCS=	ext2_alloc.c ext2_balloc.c ext2_inode.c ext2_inode_cnv.c \
+	ext2_linux_balloc.c ext2_linux_ialloc.c ext2_lookup.c \
+	ext2_subr.c ext2_vfsops.c ext2_vnops.c \
+	opt_ddb.h opt_suiddir.h opt_quota.h
+NOMAN=
+VFS_KLD=
+CFLAGS+= -DEXT2FS
+CLEANFILES= opt_ddb.h opt_suiddir.h opt_quota.h 
+
+opt_ddb.h:
+	touch ${.TARGET}
+
+opt_suiddir.h:
+	touch ${.TARGET}
+
+opt_quota.h:
+	touch ${.TARGET}
+
+.include <bsd.kmod.mk>



>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->bde 
Responsible-Changed-By: phantom 
Responsible-Changed-When: Sun Oct 22 07:40:56 PDT 2000 
Responsible-Changed-Why:  
Over to ext2fs code owner 

http://www.freebsd.org/cgi/query-pr.cgi?pr=14217 
State-Changed-From-To: open->closed 
State-Changed-By: bde 
State-Changed-When: Tue Aug 6 07:43:58 PDT 2002 
State-Changed-Why:  
sys/modules/ext2fs/Makefile was created on 2001/09/13 in -current using 
a different patch (to attempt to comply witht the GPL, the module is not 
built by default).  This was MFC'ed on 2002/08/06 in rev.1.4.2.1. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=14217 
>Unformatted:
