Re: reduce directories in sys/modules ?

From: Luigi Rizzo <rizzo_at_iet.unipi.it>
Date: Thu, 8 Jan 2009 23:22:50 +0100
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
Received on Thu Jan 08 2009 - 21:17:49 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:40 UTC