Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Debian Development (http://www.linux-archive.org/debian-development/)
-   -   Handling /etc/modprobe.d and module load order (http://www.linux-archive.org/debian-development/703602-handling-etc-modprobe-d-module-load-order.html)

Amit 09-13-2012 07:19 PM

Handling /etc/modprobe.d and module load order
 
Hello,

I am using debhelper 9.20120115 and would like some advice on bundling
/etc/modprobe.d/package.modprobe and /etc/modules.

1. I am currently using dh_installmodules to install package.modprobe.
However, I noticed that the automated debhelper commands in
postins/postrm don't run update-initramfs. Is updating initramfs not
necessary?

2. I also need to specify module load order so I am bundling
/etc/modules. However, there doesn't seem to be a debhelper script
to handle /etc/modules.

I searched the list archives and found conflicting arguments regarding
the use of update-initramfs after updating /etc/modules or
/etc/modprobe.d/.

Thanks for any help,
Amit


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: loom.20120913T211146-667@post.gmane.org">http://lists.debian.org/loom.20120913T211146-667@post.gmane.org

Ben Hutchings 09-13-2012 08:53 PM

Handling /etc/modprobe.d and module load order
 
On Thu, 2012-09-13 at 19:19 +0000, Amit wrote:
> Hello,
>
> I am using debhelper 9.20120115 and would like some advice on bundling
> /etc/modprobe.d/package.modprobe and /etc/modules.
>
> 1. I am currently using dh_installmodules to install package.modprobe.
> However, I noticed that the automated debhelper commands in
> postins/postrm don't run update-initramfs. Is updating initramfs not
> necessary?

That depends on what are you trying to do.

> 2. I also need to specify module load order so I am bundling
> /etc/modules. However, there doesn't seem to be a debhelper script
> to handle /etc/modules.

Don't ever touch /etc/modules, that's for the user/administrator. You
can load modules from an init script if there is really no better way.

> I searched the list archives and found conflicting arguments regarding
> the use of update-initramfs after updating /etc/modules or
> /etc/modprobe.d/.

/etc/modules is used by the init scripts, not the initramfs.
/etc/modprobe.d *does* get copied to the initramfs and I think you're
right that update-initramfs should generally be called after it's
updated. Perhaps initramfs-tools should have a file trigger for it,
though.

Ben.

--
Ben Hutchings
Make three consecutive correct guesses and you will be considered an expert.

Ben Hutchings 09-13-2012 08:53 PM

Handling /etc/modprobe.d and module load order
 
On Thu, 2012-09-13 at 19:19 +0000, Amit wrote:
> Hello,
>
> I am using debhelper 9.20120115 and would like some advice on bundling
> /etc/modprobe.d/package.modprobe and /etc/modules.
>
> 1. I am currently using dh_installmodules to install package.modprobe.
> However, I noticed that the automated debhelper commands in
> postins/postrm don't run update-initramfs. Is updating initramfs not
> necessary?

That depends on what are you trying to do.

> 2. I also need to specify module load order so I am bundling
> /etc/modules. However, there doesn't seem to be a debhelper script
> to handle /etc/modules.

Don't ever touch /etc/modules, that's for the user/administrator. You
can load modules from an init script if there is really no better way.

> I searched the list archives and found conflicting arguments regarding
> the use of update-initramfs after updating /etc/modules or
> /etc/modprobe.d/.

/etc/modules is used by the init scripts, not the initramfs.
/etc/modprobe.d *does* get copied to the initramfs and I think you're
right that update-initramfs should generally be called after it's
updated. Perhaps initramfs-tools should have a file trigger for it,
though.

Ben.

--
Ben Hutchings
Make three consecutive correct guesses and you will be considered an expert.

Michael Biebl 09-13-2012 09:18 PM

Handling /etc/modprobe.d and module load order
 
Am 13.09.2012 22:53, schrieb Ben Hutchings:
> On Thu, 2012-09-13 at 19:19 +0000, Amit wrote:

>> 2. I also need to specify module load order so I am bundling
>> /etc/modules. However, there doesn't seem to be a debhelper script
>> to handle /etc/modules.
>
> Don't ever touch /etc/modules, that's for the user/administrator. You
> can load modules from an init script if there is really no better way.

You can use a modules-load.d file [1]. While the idea originally comes
from systemd, it has also been implemented in the kmod (f.n.a.
module-init-tools) package.

Cheers,
Michael

[1] http://0pointer.de/public/systemd-man/modules-load.d.html

Michael Biebl 09-13-2012 09:18 PM

Handling /etc/modprobe.d and module load order
 
Am 13.09.2012 22:53, schrieb Ben Hutchings:
> On Thu, 2012-09-13 at 19:19 +0000, Amit wrote:

>> 2. I also need to specify module load order so I am bundling
>> /etc/modules. However, there doesn't seem to be a debhelper script
>> to handle /etc/modules.
>
> Don't ever touch /etc/modules, that's for the user/administrator. You
> can load modules from an init script if there is really no better way.

You can use a modules-load.d file [1]. While the idea originally comes
from systemd, it has also been implemented in the kmod (f.n.a.
module-init-tools) package.

Cheers,
Michael

[1] http://0pointer.de/public/systemd-man/modules-load.d.html

Amit 09-13-2012 09:47 PM

Handling /etc/modprobe.d and module load order
 
Ben Hutchings <ben <at> decadent.org.uk> writes:

[snip]

> > 1. I am currently using dh_installmodules to install package.modprobe.
> > However, I noticed that the automated debhelper commands in
> > postins/postrm don't run update-initramfs. Is updating initramfs not
> > necessary?
>
> That depends on what are you trying to do.

Trying to load usbhid and passing a quirks parameter so that it ignores
a specific device. Then, I have my own kernel module to control that
device.

>
> > 2. I also need to specify module load order so I am bundling
> > /etc/modules. However, there doesn't seem to be a debhelper script
> > to handle /etc/modules.
>
> Don't ever touch /etc/modules, that's for the user/administrator. You
> can load modules from an init script if there is really no better way.
>

OK. So I blacklist the modules in package.modprobe. And then load them
in the order I want in package.init by just calling modprobe?

> > I searched the list archives and found conflicting arguments regarding
> > the use of update-initramfs after updating /etc/modules or
> > /etc/modprobe.d/.
>
> /etc/modules is used by the init scripts, not the initramfs.
> /etc/modprobe.d *does* get copied to the initramfs and I think you're
> right that update-initramfs should generally be called after it's
> updated. Perhaps initramfs-tools should have a file trigger for it,
> though.
>

I ran some tests, and we definitely do need to update initramfs after
any changes under /etc/modprobe.d.

Thanks for reply.


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: loom.20120913T230818-749@post.gmane.org">http://lists.debian.org/loom.20120913T230818-749@post.gmane.org

Amit 09-13-2012 09:55 PM

Handling /etc/modprobe.d and module load order
 
Michael Biebl <email <at> michaelbiebl.de> writes:

>
> Am 13.09.2012 22:53, schrieb Ben Hutchings:

[snip]

> > Don't ever touch /etc/modules, that's for the user/administrator. You
> > can load modules from an init script if there is really no better way.
>
> You can use a modules-load.d file [1]. While the idea originally comes
> from systemd, it has also been implemented in the kmod (f.n.a.
> module-init-tools) package.
>

Thanks. Looks like this is only implemented in the newer debian systems
correct?

Couldn't find it in squeeze.

> Cheers,
> Michael
>
> [1] http://0pointer.de/public/systemd-man/modules-load.d.html
>
>


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: loom.20120913T235133-467@post.gmane.org">http://lists.debian.org/loom.20120913T235133-467@post.gmane.org

Ben Hutchings 09-13-2012 11:16 PM

Handling /etc/modprobe.d and module load order
 
On Thu, 2012-09-13 at 21:47 +0000, Amit wrote:
> Ben Hutchings <ben <at> decadent.org.uk> writes:
>
> [snip]
>
> > > 1. I am currently using dh_installmodules to install package.modprobe.
> > > However, I noticed that the automated debhelper commands in
> > > postins/postrm don't run update-initramfs. Is updating initramfs not
> > > necessary?
> >
> > That depends on what are you trying to do.
>
> Trying to load usbhid and passing a quirks parameter so that it ignores
> a specific device. Then, I have my own kernel module to control that
> device.

What is this driver?

> > > 2. I also need to specify module load order so I am bundling
> > > /etc/modules. However, there doesn't seem to be a debhelper script
> > > to handle /etc/modules.
> >
> > Don't ever touch /etc/modules, that's for the user/administrator. You
> > can load modules from an init script if there is really no better way.
> >
>
> OK. So I blacklist the modules in package.modprobe. And then load them
> in the order I want in package.init by just calling modprobe?

Unless you're doing something very unusual, you let udev load the module
automatically based on its device ID table.

> > > I searched the list archives and found conflicting arguments regarding
> > > the use of update-initramfs after updating /etc/modules or
> > > /etc/modprobe.d/.
> >
> > /etc/modules is used by the init scripts, not the initramfs.
> > /etc/modprobe.d *does* get copied to the initramfs and I think you're
> > right that update-initramfs should generally be called after it's
> > updated. Perhaps initramfs-tools should have a file trigger for it,
> > though.
> >
>
> I ran some tests, and we definitely do need to update initramfs after
> any changes under /etc/modprobe.d.

Yes, usbhid is included in the initramfs so any options need to be in
there too.

Ben.

--
Ben Hutchings
Logic doesn't apply to the real world. - Marvin Minsky

Amit 09-17-2012 04:46 PM

Handling /etc/modprobe.d and module load order
 
Ben Hutchings <ben <at> decadent.org.uk> writes:

> >
> > Trying to load usbhid and passing a quirks parameter so that it ignores
> > a specific device. Then, I have my own kernel module to control that
> > device.
>
> What is this driver?

It is a driver for a PIC microcontroller board. I was using usbhid but
there was a bug that I couldn't work around. So I am bundling a custom
kernel module. I need to blacklist that device from usbhid otherwise it
tries to control the device.

> >
> > OK. So I blacklist the modules in package.modprobe. And then load them
> > in the order I want in package.init by just calling modprobe?
>
> Unless you're doing something very unusual, you let udev load the module
> automatically based on its device ID table.
>

I haven't thought of this. How does this work in the case when usbhid
already has the device in its device ID table.

Thanks for your help.

Amit


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: loom.20120917T184208-518@post.gmane.org">http://lists.debian.org/loom.20120917T184208-518@post.gmane.org

Ben Hutchings 09-18-2012 03:29 AM

Handling /etc/modprobe.d and module load order
 
On Mon, 2012-09-17 at 16:46 +0000, Amit wrote:
> Ben Hutchings <ben <at> decadent.org.uk> writes:
>
> > >
> > > Trying to load usbhid and passing a quirks parameter so that it ignores
> > > a specific device. Then, I have my own kernel module to control that
> > > device.
> >
> > What is this driver?
>
> It is a driver for a PIC microcontroller board. I was using usbhid but
> there was a bug that I couldn't work around.

A bug in which?

> So I am bundling a custom
> kernel module. I need to blacklist that device from usbhid otherwise it
> tries to control the device.
>
> > >
> > > OK. So I blacklist the modules in package.modprobe. And then load them
> > > in the order I want in package.init by just calling modprobe?
> >
> > Unless you're doing something very unusual, you let udev load the module
> > automatically based on its device ID table.
> >
>
> I haven't thought of this. How does this work in the case when usbhid
> already has the device in its device ID table.

They both get loaded.

Ben.

> Thanks for your help.
>
> Amit
>
>

--
Ben Hutchings
The world is coming to an end. Please log off.


All times are GMT. The time now is 04:42 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.