Bug 123927 - [patch] add /etc/sysconfig/modules to load things like pcspkr at boot
[patch] add /etc/sysconfig/modules to load things like pcspkr at boot
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: initscripts (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
: FutureFeature, Patch
: 123698 124339 126956 139024 (view as bug list)
Depends On:
Blocks: FC4Target
  Show dependency treegraph
 
Reported: 2004-05-21 15:12 EDT by Matthew Miller
Modified: 2014-03-16 22:45 EDT (History)
17 users (show)

See Also:
Fixed In Version: 8.08-1
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-04-15 16:19:02 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
add /etc/sysconfig/modules support to rc.sysinit (823 bytes, text/plain)
2004-05-21 15:16 EDT, Matthew Miller
no flags Details

  None (edit)
Description Matthew Miller 2004-05-21 15:12:44 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
module.

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.
Comment 1 Matthew Miller 2004-05-21 15:16:25 EDT
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" > \
      /etc/sysconfig/modules
  echo "LOADMODULES=\"pcspkr\"" >> /etc/sysconfig/modules
fi
Comment 2 Bill Nottingham 2004-05-25 12:09:11 EDT
Well, we could build in pcspkr. :)
Comment 3 Matthew Miller 2004-05-26 15:20:25 EDT
:) 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
disabled.
Comment 4 Christopher Johnson 2004-05-27 16:38:17 EDT
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.
Comment 5 Anders Kaseorg 2004-06-12 17:02:00 EDT
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
are lost.
Comment 6 Anders Kaseorg 2004-06-12 17:47:41 EDT
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".
Comment 7 David Juran 2004-07-14 13:58:44 EDT
*** Bug 126956 has been marked as a duplicate of this bug. ***
Comment 8 Matthew Miller 2004-07-24 15:06:38 EDT
*** Bug 123698 has been marked as a duplicate of this bug. ***
Comment 9 Matthew Miller 2004-07-24 15:07:01 EDT
*** Bug 124339 has been marked as a duplicate of this bug. ***
Comment 10 Orion Poplawski 2004-10-01 17:18:41 EDT
Has there been a concensous as to where the proper location to load
pcspkr is?
Comment 11 Bill Nottingham 2004-10-01 17:58:05 EDT
pcspkr actually will get loaded in rc.sysinit as of kudzu-1.1.91-1.
Comment 12 Bill Nottingham 2004-10-11 09:52:17 EDT
Oops, disregard the last comment. I was mistaken.
Comment 13 Andy Shevchenko 2004-11-12 12:42:27 EST
*** Bug 139024 has been marked as a duplicate of this bug. ***
Comment 14 Florin Andrei 2005-03-02 20:08:30 EST
Any news?
It's been almost a year, and now FC4 is almost done and the bug is
still not fixed. :-(
Comment 15 Florin Andrei 2005-03-09 15:05:25 EST
This workaround works for me:

echo \#\!/bin/sh > /etc/rc.modules
echo "/sbin/modprobe pcspkr" >> /etc/rc.modules
chmod +x /etc/rc.modules
Comment 16 Dotan Cohen 2005-03-09 16:49:19 EST
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.

Dotan Cohen
Comment 17 Michael Zingale 2005-03-09 16:54:46 EST
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.
Comment 18 Florin Andrei 2005-03-09 17:17:39 EST
Dotan Cohen:

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:

https://www.redhat.com/archives/fedora-list/2005-March/thread.html#02203

Subject: "did you notice that the PC speaker does not work on Fedora?"
Comment 19 Axel Thimm 2005-04-07 12:48:26 EDT
A recommended solution from the discussion on fedora-devel:

o Add /etc/rc.modules to initscripts with the following contents
  #! /bin/sh

  # 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
    $i
  done
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
/etc/rc.modules.d/.
Comment 20 Matthew Miller 2005-04-07 13:10:48 EDT
I'm fine with that.
Comment 21 Bill Nottingham 2005-04-15 14:38:30 EDT
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. :)
Comment 22 Axel Thimm 2005-04-15 14:53:44 EDT
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.
Comment 23 Bill Nottingham 2005-04-15 14:57:21 EDT
... in between loading *which* modules? Certainly sounds like driver bugs.
Comment 24 Axel Thimm 2005-04-15 15:19:45 EDT
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
past!).

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
flexibility today.

off topic: since you asked on ivtv's modules:
http://www.google.com/search?q=ivtv+%22sleep+1%22 
The modules that are loaded are (in this order): tveeprom, videodev, cx25840,
tuner, wm8775, ivtv
Comment 25 Florin Andrei 2005-04-15 15:58:38 EDT
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
as well.
Comment 26 Bill Nottingham 2005-04-15 16:19:02 EDT
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

Note You need to log in before you can comment on or make changes to this bug.