You are not logged in.

#1 2010-02-01 21:52:14

orschiro
Member
Registered: 2009-06-04
Posts: 2,136
Website

load/unload modules automatically

Hello guys,

to be able to eject a disk after pressing the eject-button of my cd/dvd drive I have to unload/load the modules manually with the following commands:

rmmod sr_mod
rmmod cdrom
modprobe cdrom lockdoor=0
modprobe sr_mod

After that I can eject it without any problems. I thought I can automatise this by adding options cdrom lockdoor=0 to /etc/modprobe.d/modprobe.conf and finally load the modules in my /etc/rc.conf like the following:

MODULES=([...] "cdrom lockdoor=0" sr_mod)

But it still doesn't work. What's wrong?

Thank you in advance. smile

Offline

#2 2010-02-02 02:46:46

DeeCodeUh
Member
From: Michigan, USA
Registered: 2007-11-27
Posts: 176

Re: load/unload modules automatically

Wow, that's really an advanced way to do something that should be so simple.
What makes it so you have to do all of that?

Offline

#3 2010-02-02 05:34:43

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: load/unload modules automatically

Is "cdrom" compiled into your kernel, or a module in /lib/modules/ ?

If it's compiled into your kernel, then you need to specify lockdoor a different way:

In /boot/grub/menu.lst, add this to the kernel line:
cdrom.lockdoor=0

The reason that this is done in a different way is that it confuses the heck out of us. There's no other reason sad

Offline

#4 2010-02-02 07:05:49

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: load/unload modules automatically

Don't put the option in the MODULES array - use /etc/modprobe.d/* only.

Offline

#5 2010-02-02 08:10:32

orschiro
Member
Registered: 2009-06-04
Posts: 2,136
Website

Re: load/unload modules automatically

Hello guys,

thank you for your answers.

In /boot/grub/menu.lst, add this to the kernel line:
cdrom.lockdoor=0

This seems to be enough to get it working. I checked it. But why is this done via kernel parameter and not with modprobe.d? It's even not necessary to have an entry in modprobe.conf.

Offline

#6 2010-02-02 17:54:40

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: load/unload modules automatically

orschiro wrote:

why is this done

Linux isn't designed to be user/newbie friendly. That's the reason, in a nutshell hmm

Offline

#7 2010-02-02 18:47:42

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: load/unload modules automatically

Possible explanation: if you're loading the cdrom module in your initramfs image, that would happen before /etc/modprobe.d/* is available, so the option would not be applied. The fix is to include the modprobe.d files in the FILES section of your mkinitcpio.conf.

Offline

#8 2010-02-02 19:07:56

orschiro
Member
Registered: 2009-06-04
Posts: 2,136
Website

Re: load/unload modules automatically

The fix is to include the modprobe.d files in the FILES section of your mkinitcpio.conf.

But that's the strange thing, it is already included.

Offline

#9 2010-02-02 19:22:00

Misfit138
Misfit Emeritus
From: USA
Registered: 2006-11-27
Posts: 4,189

Re: load/unload modules automatically

brebs wrote:
orschiro wrote:

why is this done

Linux isn't designed to be user/newbie friendly. That's the reason, in a nutshell hmm

I see you are going through a phase of discovery. I too fall prey to such revelations of clarity, which often manifest themselves in the most forthright and cynical reality imaginable.
hmm
I think I might like being a dreamer better.

Offline

#10 2010-02-02 21:07:09

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: load/unload modules automatically

orschiro wrote:

The fix is to include the modprobe.d files in the FILES section of your mkinitcpio.conf.

But that's the strange thing, it is already included.

OK... you didn't say anything about your initramfs up to this, hence my suggestion.

Offline

Board footer

Powered by FluxBB