public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] rfc: /etc/init.d/modules loading modules defined in files
@ 2016-08-16 23:20 William Hubbs
  2016-08-16 23:49 ` Matthias Maier
  2016-08-18 14:02 ` NP-Hardass
  0 siblings, 2 replies; 10+ messages in thread
From: William Hubbs @ 2016-08-16 23:20 UTC (permalink / raw)
  To: gentoo development

[-- Attachment #1: Type: text/plain, Size: 584 bytes --]

All,

I have received a request to implement a feature in OpenRC to allow
multiple software packages to drop files in a directory, /etc/modules.d
for example, which would define modules the /etc/init.d/modules script
would load.

The design I'm thinking of would not change the use of
/etc/conf.d/modules, but the entries from the files would be added to
the appropriate module lists after the ones listed there.

I'll write more about the design as I get closer to formulating the
details, but at this point I just want to know what others thinkabout
this feature.

Thanks,

William

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-dev] rfc: /etc/init.d/modules loading modules defined in files
  2016-08-16 23:20 [gentoo-dev] rfc: /etc/init.d/modules loading modules defined in files William Hubbs
@ 2016-08-16 23:49 ` Matthias Maier
  2016-08-16 23:59   ` Matthias Maier
  2016-08-19 11:19   ` [gentoo-dev] " Thomas Deutschmann
  2016-08-18 14:02 ` NP-Hardass
  1 sibling, 2 replies; 10+ messages in thread
From: Matthias Maier @ 2016-08-16 23:49 UTC (permalink / raw)
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 1565 bytes --]


On Tue, Aug 16, 2016, at 18:20 CDT, William Hubbs <williamh@gentoo.org> wrote:

> All,
>
> I have received a request to implement a feature in OpenRC to allow
> multiple software packages to drop files in a directory, /etc/modules.d
> for example, which would define modules the /etc/init.d/modules script
> would load.

What about /etc/modules-load.d containing various files that list one
module to load per line? With this, OpenRC's behavior would be
compatible with systemd-modules-load [1].

Best,
Matthias



[1] To quote systemd's manpage:

NAME
       modules-load.d - Configure kernel modules to load at boot

SYNOPSIS
       /etc/modules-load.d/*.conf

       /run/modules-load.d/*.conf

       /usr/lib/modules-load.d/*.conf

DESCRIPTION
       systemd-modules-load.service(8) reads files from the above
       directories which contain kernel modules to load during boot in a
       static list. Each configuration file is named in the style of
       /etc/modules-load.d/program.conf. Note that it is usually a
       better idea to rely on the automatic module loading by PCI IDs,
       USB IDs, DMI IDs or similar triggers encoded in the kernel
       modules themselves instead of static configuration like this. In
       fact, most modern kernel modules are prepared for automatic
       loading already.

CONFIGURATION FORMAT
       The configuration files should simply contain a list of kernel
       module names to load, separated by newlines. Empty lines and
       lines whose first non-whitespace character is # or ; are
       ignored.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 820 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-dev] rfc: /etc/init.d/modules loading modules defined in files
  2016-08-16 23:49 ` Matthias Maier
@ 2016-08-16 23:59   ` Matthias Maier
  2016-08-17  0:16     ` William Hubbs
  2016-08-19 11:19   ` [gentoo-dev] " Thomas Deutschmann
  1 sibling, 1 reply; 10+ messages in thread
From: Matthias Maier @ 2016-08-16 23:59 UTC (permalink / raw)
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 667 bytes --]


On Tue, Aug 16, 2016, at 18:49 CDT, Matthias Maier <tamiko@gentoo.org> wrote:

> On Tue, Aug 16, 2016, at 18:20 CDT, William Hubbs <williamh@gentoo.org> wrote:
>
>> All,
>>
>> I have received a request to implement a feature in OpenRC to allow
>> multiple software packages to drop files in a directory, /etc/modules.d
>> for example, which would define modules the /etc/init.d/modules script
>> would load.

One more point, /etc/modules.d was used back in the old update-modules
times. So, maybe we should avoid the directory due to historic reasons
[1].

Best,
Matthias

[1] I had /etc/modules.d and /etc/modules.conf lingering around now for
more than 3 years...

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 820 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-dev] rfc: /etc/init.d/modules loading modules defined in files
  2016-08-16 23:59   ` Matthias Maier
@ 2016-08-17  0:16     ` William Hubbs
  2016-08-17  6:59       ` [gentoo-dev] " Martin Vaeth
  0 siblings, 1 reply; 10+ messages in thread
From: William Hubbs @ 2016-08-17  0:16 UTC (permalink / raw)
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 1026 bytes --]

On Tue, Aug 16, 2016 at 06:59:32PM -0500, Matthias Maier wrote:
> 
> On Tue, Aug 16, 2016, at 18:49 CDT, Matthias Maier <tamiko@gentoo.org> wrote:
> 
> > On Tue, Aug 16, 2016, at 18:20 CDT, William Hubbs <williamh@gentoo.org> wrote:
> >
> >> All,
> >>
> >> I have received a request to implement a feature in OpenRC to allow
> >> multiple software packages to drop files in a directory, /etc/modules.d
> >> for example, which would define modules the /etc/init.d/modules script
> >> would load.
> 
> One more point, /etc/modules.d was used back in the old update-modules
> times. So, maybe we should avoid the directory due to historic reasons
> [1].

Sure, the directory name was just an example.

I was thinking of doing something a little more elaborate so that I
could support all of the module/version/etc combinations documented in
/etc/conf.d/modules, but I'm open to making the behaviour compatible
with what systemd does; that would be a good case probably for doing it
that way.

William


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [gentoo-dev] Re: rfc: /etc/init.d/modules loading modules defined in files
  2016-08-17  0:16     ` William Hubbs
@ 2016-08-17  6:59       ` Martin Vaeth
  2016-08-17 12:33         ` Mike Gilbert
  0 siblings, 1 reply; 10+ messages in thread
From: Martin Vaeth @ 2016-08-17  6:59 UTC (permalink / raw)
  To: gentoo-dev

William Hubbs <williamh@gentoo.org> wrote:
>
> but I'm open to making the behaviour compatible
> with what systemd does

Since openrc already supports tmpfiles.d,
support for modules-load.d would be natural.
In fact, this is already done for quite a while in

https://github.com/vaeth/firewall-mv/blob/master/openrc/conf.d/modules

The last line supports modules-load.d:

modules=$(sed -n -e '/^[^;#]/p' /etc/modules-load.d/*.conf \
	/usr/lib/modules-load.d/*.conf 2>/dev/null || : )

For compatibility with other init systems one should perhaps not
extend the format of modules-load.d: If one also wants to e.g.
support args for modules, this should perhaps be done in
a separate directory. /etc/modprobe.d already exists for this,
but one might still source another directory which contains
only files added to /etc/conf.d/modules



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-dev] Re: rfc: /etc/init.d/modules loading modules defined in files
  2016-08-17  6:59       ` [gentoo-dev] " Martin Vaeth
@ 2016-08-17 12:33         ` Mike Gilbert
  2016-08-17 13:04           ` Martin Vaeth
  0 siblings, 1 reply; 10+ messages in thread
From: Mike Gilbert @ 2016-08-17 12:33 UTC (permalink / raw)
  To: Gentoo Dev

On Wed, Aug 17, 2016 at 2:59 AM, Martin Vaeth <martin@mvath.de> wrote:
> William Hubbs <williamh@gentoo.org> wrote:
>>
>> but I'm open to making the behaviour compatible
>> with what systemd does
>
> Since openrc already supports tmpfiles.d,
> support for modules-load.d would be natural.
> In fact, this is already done for quite a while in
>
> https://github.com/vaeth/firewall-mv/blob/master/openrc/conf.d/modules
>
> The last line supports modules-load.d:
>
> modules=$(sed -n -e '/^[^;#]/p' /etc/modules-load.d/*.conf \
>         /usr/lib/modules-load.d/*.conf 2>/dev/null || : )

This simple implementation does not follow the precedence rules
documented in modules-load.d(5).


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [gentoo-dev] Re: rfc: /etc/init.d/modules loading modules defined in files
  2016-08-17 12:33         ` Mike Gilbert
@ 2016-08-17 13:04           ` Martin Vaeth
  0 siblings, 0 replies; 10+ messages in thread
From: Martin Vaeth @ 2016-08-17 13:04 UTC (permalink / raw)
  To: gentoo-dev

Mike Gilbert <floppym@gentoo.org> wrote:
>>
>> modules=$(sed -n -e '/^[^;#]/p' /etc/modules-load.d/*.conf \
>>         /usr/lib/modules-load.d/*.conf 2>/dev/null || : )
>
> This simple implementation does not follow the precedence rules
> documented in modules-load.d(5).

I didn't mean it as the recommended implementation for openrc,
but just wanted to illustrate that such pre-implementation are
already in use. (Currently, this implementation is sufficient,
because currently practically nothing installs into
/usr/lib/modules-load.d, so masking is currently unneeded).

_Of course_ I would suggest that a proper implementation in
openrc should follow the standard completely.



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-dev] rfc: /etc/init.d/modules loading modules defined in files
  2016-08-16 23:20 [gentoo-dev] rfc: /etc/init.d/modules loading modules defined in files William Hubbs
  2016-08-16 23:49 ` Matthias Maier
@ 2016-08-18 14:02 ` NP-Hardass
  2016-08-18 17:58   ` William Hubbs
  1 sibling, 1 reply; 10+ messages in thread
From: NP-Hardass @ 2016-08-18 14:02 UTC (permalink / raw)
  To: gentoo development


[-- Attachment #1.1: Type: text/plain, Size: 1492 bytes --]

On 08/16/2016 07:20 PM, William Hubbs wrote:
> All,
> 
> I have received a request to implement a feature in OpenRC to allow
> multiple software packages to drop files in a directory, /etc/modules.d
> for example, which would define modules the /etc/init.d/modules script
> would load.
> 
> The design I'm thinking of would not change the use of
> /etc/conf.d/modules, but the entries from the files would be added to
> the appropriate module lists after the ones listed there.
> 
> I'll write more about the design as I get closer to formulating the
> details, but at this point I just want to know what others thinkabout
> this feature.
> 
> Thanks,
> 
> William
> 

Just a side note on how I currently take advantage of the modules
initscript:

I have several symlinks, one for each set of modules that I want to
control.  Then I create a corresponding conf.d based off of the modules
conf.d.  So, for example, /etc/init.d/vbox-modules->/etc/init.d/modules
just controls the vbox modules.  This gives me fine control over module
sets without having to worry about all of them at once.  I can have
certain sets of modules start in different runlevels, and I can
independently load and unload sets of modules when necessary.

If you do end up switching to some system that reads a directory, I'd
like to see something that if the name of the initscript isn't modules,
it sources just the corresponding file, rather than the whole dir.

-- 
NP-Hardass


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-dev] rfc: /etc/init.d/modules loading modules defined in files
  2016-08-18 14:02 ` NP-Hardass
@ 2016-08-18 17:58   ` William Hubbs
  0 siblings, 0 replies; 10+ messages in thread
From: William Hubbs @ 2016-08-18 17:58 UTC (permalink / raw)
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 1153 bytes --]

On Thu, Aug 18, 2016 at 10:02:35AM -0400, NP-Hardass wrote:
> Just a side note on how I currently take advantage of the modules
> initscript:
> 
> I have several symlinks, one for each set of modules that I want to
> control.  Then I create a corresponding conf.d based off of the modules
> conf.d.  So, for example, /etc/init.d/vbox-modules->/etc/init.d/modules
> just controls the vbox modules.  This gives me fine control over module
> sets without having to worry about all of them at once.  I can have
> certain sets of modules start in different runlevels, and I can
> independently load and unload sets of modules when necessary.
> 
> If you do end up switching to some system that reads a directory, I'd
> like to see something that if the name of the initscript isn't modules,
> it sources just the corresponding file, rather than the whole dir.

I'm not planning to kill the current system, just extend it, so what you
are doing should still work.

That gives me an idea to consider writing a separate service to handle
this, modules-load-d or something similar.

Thanks,

William

> 
> -- 
> NP-Hardass
> 




[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-dev] rfc: /etc/init.d/modules loading modules defined in files
  2016-08-16 23:49 ` Matthias Maier
  2016-08-16 23:59   ` Matthias Maier
@ 2016-08-19 11:19   ` Thomas Deutschmann
  1 sibling, 0 replies; 10+ messages in thread
From: Thomas Deutschmann @ 2016-08-19 11:19 UTC (permalink / raw)
  To: gentoo-dev


[-- Attachment #1.1: Type: text/plain, Size: 622 bytes --]

On 2016-08-17 01:49, Matthias Maier wrote:
>> I have received a request to implement a feature in OpenRC to allow
>> multiple software packages to drop files in a directory, /etc/modules.d
>> for example, which would define modules the /etc/init.d/modules script
>> would load.
>
> What about /etc/modules-load.d containing various files that list one
> module to load per line? With this, OpenRC's behavior would be
> compatible with systemd-modules-load [1].

+1

I wanted to ask the same after working on bug 480018 [1].



[1] https://bugs.gentoo.org/480018


-- 
Regards,
Thomas
aka Whissi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 951 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-08-19 11:20 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-16 23:20 [gentoo-dev] rfc: /etc/init.d/modules loading modules defined in files William Hubbs
2016-08-16 23:49 ` Matthias Maier
2016-08-16 23:59   ` Matthias Maier
2016-08-17  0:16     ` William Hubbs
2016-08-17  6:59       ` [gentoo-dev] " Martin Vaeth
2016-08-17 12:33         ` Mike Gilbert
2016-08-17 13:04           ` Martin Vaeth
2016-08-19 11:19   ` [gentoo-dev] " Thomas Deutschmann
2016-08-18 14:02 ` NP-Hardass
2016-08-18 17:58   ` William Hubbs

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox