Red Hat Bugzilla – Bug 123927
[patch] add /etc/sysconfig/modules to load things like pcspkr at boot
Last modified: 2014-03-16 22:45:25 EDT
As probably everyone knows by now, the PC speaker beep module isn't
something that you just _have_. You need to manually insert the pcspkr
Which is annoying, if you want to have it. And, this is a general
problem -- there's several other things (some laptop special-feature
modules, webcam support, etc) which don't get loaded automatically
even though it'd be nice for them to.
As someone pointed out on one of the fedora lists, rc.sysinit calls
/etc/rc.modules if it exists, which it doesn't, by default. My first
cut of this added that file, but then I decided it'd probably be
better to leave that alone and just insert the code into rc.sysinit,
both for backwards-compatibility (who knows what various installations
have done) and because in general the current rc.sysinit isn't broken
out like that elsewhere.
Created attachment 100432 [details]
add /etc/sysconfig/modules support to rc.sysinit
Also, I suggest adding something like this to the %post script:
if [ ! -e /etc/sysconfig/modules ]; then
echo "# These modules will be automatically loaded at boot" > \
echo "LOADMODULES=\"pcspkr\"" >> /etc/sysconfig/modules
Well, we could build in pcspkr. :)
:) Yeah, but that's not the only module which works like that. And,
it's actually handy to have pcspkr not built in -- I know several
people (like, a computer lab in a library) that prefers to have it
It would be nice if system-config-soundcard had a checkbox (default
on) whether to enable the pc speaker. Behind the scenes it manage
whether the /etc/sysconfig/modules entry was enabled or commented out.
For whoever is trying to come up with a good solution to the pcspkr
problem, I thought I'd add my thoughts. By default, my laptop's PC
speaker is loud enough to make me jump out of my chair, so I have it
turned way down in alsamixer. However, the volume settings are loaded
with the soundcard module, which is *after* the earsplitting beep from
the login screen.
My current hack is to do both modprobe pcspkr and alsactl restore at
startup (in /etc/rc.modules). Although this works, it's bad because
alsactl restore is executed twice, so any volume changes in between
I just noticed that alsactl restore actually loads the soundcard
anyway. So a better hack is changing modprobe.conf to have pcspkr load
the soundcard: "install pcspkr /sbin/modprobe snd-card-0;
/sbin/modprobe --ignore-install pcspkr".
*** Bug 126956 has been marked as a duplicate of this bug. ***
*** Bug 123698 has been marked as a duplicate of this bug. ***
*** Bug 124339 has been marked as a duplicate of this bug. ***
Has there been a concensous as to where the proper location to load
pcspkr actually will get loaded in rc.sysinit as of kudzu-1.1.91-1.
Oops, disregard the last comment. I was mistaken.
*** Bug 139024 has been marked as a duplicate of this bug. ***
It's been almost a year, and now FC4 is almost done and the bug is
still not fixed. :-(
This workaround works for me:
echo \#\!/bin/sh > /etc/rc.modules
echo "/sbin/modprobe pcspkr" >> /etc/rc.modules
chmod +x /etc/rc.modules
Don't fix it!
I hate those stupud beeps. But I didn't really notice it's absence in
Fedora Core 3, probably because I cut the wire to the PC speaker about
four or five operating systems ago.
DO fix it!!
These beeps are a critical part of the notification mechanisms of a
lot of applications (text based e-mail readers, talk, ...). I am
quite often sshed into several different machines, and the only
audible feedback over an ssh is through the ctrl-G, system beep. It
is really necessary to have this able to be enabled quite easily.
If you don't want these beeps, you can always mute them in the mixer.
You can always disable the PC speaker module, assuming it's working
properly and it would be loaded automatically, with:
echo "install pcspkr /bin/true" >> /etc/modprobe.conf
alsamixer should also be able to mute it.
Cutting wires is somewhat... excessive, IMO. :-)
BTW, this bug has been mentioned on fedora-list here:
Subject: "did you notice that the PC speaker does not work on Fedora?"
A recommended solution from the discussion on fedora-devel:
o Add /etc/rc.modules to initscripts with the following contents
# Don't modify this file, instead create a module loading script
# under /etc/rc.modules.d
for i in /etc/rc.modules.d/*.modules; do
o Add ownership of empty /etc/rc.modules.d to initscripts
kernel modules that are not dealt with in other ways can now drop a sniplet into
I'm fine with that.
Hm. Looking at this, the /etc/sysconfig/modules approach has some advantages:
- having it as a list makes ordering issues obvious
- using it just to load modules makes sure packagers use udev and friends
correctly as opposed to having hacks in thier rc.modules.d scripts. :)
Proper ordering should still be done via modprobe.conf and install/remove commands.
The advantages of giving more power to the scripts is that they can do
intelligent things like auto-detecting the need for loading the module (other
than hardware detection).
Also some hardware setup (like ivtv on newer Hauppauge hardware) really requires
sleeping for a second in between loading the modules, which can easily be added
in a script, but not in a list of modules. One can argue that the bug is in the
driver or the hardware, but the need to be more flexible exists.
... in between loading *which* modules? Certainly sounds like driver bugs.
I agree (although in defence of the ivtv developers, one must say that this
depends on your hardware model), and all developers are hunting this issue for
months now w/o any success.
It may take another year to find the issue, or the hardware is EOLed before
that, and ivtv certainly isn't the only kernel module out there that needs
special handling. So why not have a mechanism to enable such projects to blend
into FC nicely, too? The alternative is to force them find their own mechanisms,
aka wildering scripts in rc.d or patching rc.sysinit (has all been done in the
All I say is don't restrict too much the custom module loading mechanism, you
may need it at some other time and changing it will be harder than investing in
off topic: since you asked on ivtv's modules:
The modules that are loaded are (in this order): tveeprom, videodev, cx25840,
tuner, wm8775, ivtv
I fully agree with Axel.
This is like BSD vs SysV initialization scripts debate. SysV was chosen for a
reason (well, more than one) and most of those reasons should apply in this case
A version of this added in 8.08-1. Changes from what's above:
- the dir is /etc/sysconfig/modules (as it's RH/Fedora specific, and not
really part of the 'init' process/namespace)
- scripts are checked for [ -x ] before running