Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Kernel & Hardware
  • Search

[SOLVED]How to pass parameters to an auto-loaded module?

Kernel not recognizing your hardware? Problems with power management or PCMCIA? What hardware is compatible with Gentoo? See here. (Only for kernels supported by Gentoo.)
Post Reply
Advanced search
6 posts • Page 1 of 1
Author
Message
DooBeDooBeDo
Apprentice
Apprentice
User avatar
Posts: 220
Joined: Wed Aug 21, 2002 9:50 pm
Location: UK

[SOLVED]How to pass parameters to an auto-loaded module?

  • Quote

Post by DooBeDooBeDo » Tue Feb 04, 2014 8:29 pm

I've just got a new DVB card (Tevii S464). At boot it auto-loads a bunch of modules:
$ modprobe --show-depends cx8802
insmod /lib/modules/3.10.17-gentoo/kernel/drivers/media/v4l2-core/videobuf-core.ko
insmod /lib/modules/3.10.17-gentoo/kernel/drivers/media/v4l2-core/videobuf-dma-sg.ko
insmod /lib/modules/3.10.17-gentoo/kernel/drivers/media/common/btcx-risc.ko
insmod /lib/modules/3.10.17-gentoo/kernel/drivers/media/common/tveeprom.ko
insmod /lib/modules/3.10.17-gentoo/kernel/drivers/media/pci/cx88/cx88xx.ko <-- I need to pass an argument to this one
insmod /lib/modules/3.10.17-gentoo/kernel/drivers/media/pci/cx88/cx8802.ko
Can anyone tell me how to do this in the sanest way?
Last edited by DooBeDooBeDo on Wed Feb 05, 2014 4:34 pm, edited 1 time in total.
Top
albright
Advocate
Advocate
User avatar
Posts: 2588
Joined: Sun Nov 16, 2003 6:36 pm
Location: Near Toronto

  • Quote

Post by albright » Tue Feb 04, 2014 8:54 pm

adding the module (or a set of them) to /etc/modprobe.d/blacklist.conf

and then loading it (or them) via /etc/conf.d/modules might work


for example (taken from my own files)

Code: Select all

/etc/modprobe.d $ cat blacklist.conf 
#blacklist e1000e
blacklist thinkpad_acpi
and

Code: Select all

/etc/conf.d $ cat modules
modules="thinkpad_acpi snd_hda_intel snd_hda_codec_realtek"
module_thinkpad_acpi_args="fan_control=1"
module_snd_hda_intel_args="index=2"
.... there is nothing - absolutely nothing - half so much worth
doing as simply messing about with Linux ...
(apologies to Kenneth Graeme)
Top
DooBeDooBeDo
Apprentice
Apprentice
User avatar
Posts: 220
Joined: Wed Aug 21, 2002 9:50 pm
Location: UK

  • Quote

Post by DooBeDooBeDo » Tue Feb 04, 2014 11:11 pm

Despite the modules being blacklisted they were loaded anyway. I've created a /etc/local.d/tevii_s464.start

Code: Select all

/sbin/modprobe -r cx8800 cx8802 cx88xx btcx_risc videobuf_dma_sg videobuf_core tveeprom

/sbin/modprobe cx88xx card=86
/sbin/modprobe cx8800
/sbin/modprobe cx8802
Not ideal but it works :/. I'd like to know how to do this properly though. It's been quite a while since I had to mess around like this...
Top
BitJam
Advocate
Advocate
Posts: 2513
Joined: Tue Aug 12, 2003 4:15 pm
Location: Silver City, NM

  • Quote

Post by BitJam » Wed Feb 05, 2014 9:19 am

This is explained in "man modprobe.d":

Code: Select all

       Because the modprobe command can add or remove more than one module, due to
       modules having dependencies, we need a method of specifying what options are to
       be used with those modules. All files underneath the /etc/modprobe.d directory
       which end with the .conf extension specify those options as required. [...]

options modulename option...
	   This command allows you to add options to the module modulename (which might
	   be an alias) every time it is inserted into the kernel: whether directly
	   (using modprobemodulename or because the module being inserted depends on
	   this module.
This man page also explains how to blacklist modules.
Top
xaviermiller
Bodhisattva
Bodhisattva
User avatar
Posts: 8738
Joined: Fri Jul 23, 2004 6:49 pm
Location: ~Brussels - Belgique
Contact:
Contact xaviermiller
Website

  • Quote

Post by xaviermiller » Wed Feb 05, 2014 9:33 am

You can pass module parameters in /etc/modprobe.d

take a look at alsa.conf for example ;)
Kind regards,
Xavier Miller
Top
DooBeDooBeDo
Apprentice
Apprentice
User avatar
Posts: 220
Joined: Wed Aug 21, 2002 9:50 pm
Location: UK

  • Quote

Post by DooBeDooBeDo » Wed Feb 05, 2014 3:08 pm

Cool, that's much better :). I didn't like my nasty hack even though it worked.
Top
Post Reply

6 posts • Page 1 of 1

Return to “Kernel & Hardware”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic