From owner-freebsd-current@FreeBSD.ORG Thu Jan 8 22:17:49 2009 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D9561065748 for ; Thu, 8 Jan 2009 22:17:49 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.9.129]) by mx1.freebsd.org (Postfix) with ESMTP id 099FF8FC08 for ; Thu, 8 Jan 2009 22:17:48 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id 58F0673098; Thu, 8 Jan 2009 23:22:50 +0100 (CET) Date: Thu, 8 Jan 2009 23:22:50 +0100 From: Luigi Rizzo To: Julian Elischer Message-ID: <20090108222250.GA90051@onelab2.iet.unipi.it> References: <20090108210221.GA87253@onelab2.iet.unipi.it> <4966756E.7050102@elischer.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4966756E.7050102@elischer.org> User-Agent: Mutt/1.4.2.3i Cc: current@freebsd.org Subject: Re: reduce directories in sys/modules ? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jan 2009 22:17:49 -0000 On Thu, Jan 08, 2009 at 01:51:42PM -0800, Julian Elischer wrote: > Luigi Rizzo wrote: > >Is there a way to reduce the number of directories in sys/modules ? > > > >There seems to be one directory per module, even though many of > >those are related and the source resides in one place > >(e.g. sys/modules/iwifw/ has three children but the source > >is in sys/contrib/dev/iwi ; and the same goes for many other > >entries e.g. > >sys/modules/digi* <-> /sys/dev/digi, > >sys/modules/drm <-> sys/dev/drm > >sys/modules/ata > > > >and many more. > >Ideas ? > > I have many under netgraph. > maybe we could cluster them by type. > ethernet > protocols > or does that not help what you want? yes, i wanted something like that: one directory per cluster (of course where it makes sense to pack stuff). Take e.g. /sys/dev/ata (but there are many similar cases) which has 24 files and generates 15 different directories, each one with only one Makefile containing the same thing # $FreeBSD: ... $ .PATH: ${.CURDIR}/../../../dev/ata KMOD= atasomething SRCS= ata-some-thing.c SRCS+= opt_ata.h ata_if.h device_if.h bus_if.h pci_if.h .include It would be a lot simpler to have one dir and one Makefile in /sys/modules/ata/Makefile with this content # $FreeBSD: ... $ common_headers= opt_ata.h ata_if.h device_if.h bus_if.h KMOD_LIST= atafoo atabar atabaz atadisc ataata atapci... SRCS_atafoo= ata-some-foo.c ${common_headers} SRCS_atabar= ata-bar-src.c ${common_headers} ... .include This would be backward compatible with the existing structure, provided that the bsd.kmod.mk expands the entries in KMOD_LIST creating the individual targets etc. cheers luigi