Bug 123927 - [patch] add /etc/sysconfig/modules to load things like pcspkr at boot
Summary: [patch] add /etc/sysconfig/modules to load things like pcspkr at boot
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: initscripts
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact:
URL:
Whiteboard:
: 123698 124339 126956 139024 (view as bug list)
Depends On:
Blocks: FC4Target
TreeView+ depends on / blocked
 
Reported: 2004-05-21 19:12 UTC by Matthew Miller
Modified: 2014-03-17 02:45 UTC (History)
17 users (show)

Fixed In Version: 8.08-1
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-04-15 20:19:02 UTC
Type: ---
Embargoed:


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

Description Matthew Miller 2004-05-21 19:12:44 UTC
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 19:16:25 UTC
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 16:09:11 UTC
Well, we could build in pcspkr. :)

Comment 3 Matthew Miller 2004-05-26 19:20:25 UTC
:) 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 20:38:17 UTC
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 21:02:00 UTC
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 21:47:41 UTC
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 17:58:44 UTC
*** Bug 126956 has been marked as a duplicate of this bug. ***

Comment 8 Matthew Miller 2004-07-24 19:06:38 UTC
*** Bug 123698 has been marked as a duplicate of this bug. ***

Comment 9 Matthew Miller 2004-07-24 19:07:01 UTC
*** Bug 124339 has been marked as a duplicate of this bug. ***

Comment 10 Orion Poplawski 2004-10-01 21:18:41 UTC
Has there been a concensous as to where the proper location to load
pcspkr is?

Comment 11 Bill Nottingham 2004-10-01 21:58:05 UTC
pcspkr actually will get loaded in rc.sysinit as of kudzu-1.1.91-1.

Comment 12 Bill Nottingham 2004-10-11 13:52:17 UTC
Oops, disregard the last comment. I was mistaken.

Comment 13 Andy Shevchenko 2004-11-12 17:42:27 UTC
*** Bug 139024 has been marked as a duplicate of this bug. ***

Comment 14 Florin Andrei 2005-03-03 01:08:30 UTC
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 20:05:25 UTC
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 21:49:19 UTC
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 21:54:46 UTC
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 22:17:39 UTC
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 16:48:26 UTC
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 17:10:48 UTC
I'm fine with that.

Comment 21 Bill Nottingham 2005-04-15 18:38:30 UTC
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 18:53:44 UTC
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 18:57:21 UTC
... in between loading *which* modules? Certainly sounds like driver bugs.

Comment 24 Axel Thimm 2005-04-15 19:19:45 UTC
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 19:58:38 UTC
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 20:19:02 UTC
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.