Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Jan 2009 23:22:50 +0100
From:      Luigi Rizzo <rizzo@iet.unipi.it>
To:        Julian Elischer <julian@elischer.org>
Cc:        current@freebsd.org
Subject:   Re: reduce directories in sys/modules ?
Message-ID:  <20090108222250.GA90051@onelab2.iet.unipi.it>
In-Reply-To: <4966756E.7050102@elischer.org>
References:  <20090108210221.GA87253@onelab2.iet.unipi.it> <4966756E.7050102@elischer.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <bsd.kmod.mk>

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 <bsd.kmod.mk>

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090108222250.GA90051>