# hotplug blacklist doesn't work with pcspkr

## blurp

I used to disable the annonying system beeper by having a line

```
pcspkr
```

 in /etc/hotplug/blacklist.

After upgrading to gentoo-sources-2.6.19-r5 with initrd, that annonying module keeps getting loaded for no reason. There is no dependency on that module at all as I can always

```
rmmod pcspkr
```

immediately after login appears. However, doing this after every laptop boot is as annoying as the beeper itself. Help!

I'm using hotplug-20040923-r2 and hotplug-base-20040401.

----------

## Bones McCracker

Can't you just mute the pc speaker using your mixer app, or alsamixer, or alsaconf, or manually in /etc/asound.state?  Or if you are using a desktop environment (ie. gnome or kde) don't they have the ability to configure the "system bell", to include turning it off?

----------

## blurp

No, the pcspkr is not related to the ALSA modules, so the mixer stuff have no effect.

Currently my "automatic" solution is to append

```
rmmod pcspkr
```

 to /etc/conf.d/local.start. It is a solution, but not neat. The module gets loaded and unloaded again - so there's a beep during bootup.

Ultimately, being true to the opensource spirit, i would like to find out what is wrong (with kernel or hotplug, hence the title) and if this is a known bug or something. But i don't have the know-how to find out if this is a bug --- i don't even know how to start...

edit: location of local.start.Last edited by blurp on Fri Feb 02, 2007 6:18 am; edited 1 time in total

----------

## yabbadabbadont

I think recent versions of udev have been ignoring all attempts to blacklist stuff...   :Sad: 

Rebuild your kernel and configure it manually.  Leave out support for the standard pc speaker.  (or do what I did, don't connect the speaker to the motherboard   :Very Happy: )

----------

## blurp

 *yabbadabbadont wrote:*   

> I think recent versions of udev have been ignoring all attempts to blacklist stuff...  
> 
> Rebuild your kernel and configure it manually.  Leave out support for the standard pc speaker.  (or do what I did, don't connect the speaker to the motherboard  )

 

its unlikely to be udev because my last emerge on udev according to emerge.log is more than 90 days old and the pcspkr thing came only with the new kernel upgrade a few days ago...

i don't know where the stupid module gets loaded --- can't find it in dmesg.

well, recompiling the kernel would be a last resort... and... i wish i could plug out the speaker from my laptop. but then again, sometimes (in very rare circumstances) the speaker is actually useful...

----------

## desultory

 *blurp wrote:*   

> its unlikely to be udev because my last emerge on udev according to emerge.log is more than 90 days old and the pcspkr thing came only with the new kernel upgrade a few days ago...

 Is "Automatic kernel module loading" under "Loadable module support  --->", listed as CONFIG_KMOD=y in the file .config in the root of the source tree, set in the configuration of the kernel which is displaying this behavior? If so, try building a kernel with it unset.

----------

## Bones McCracker

I assume you're not talking about POST beeps.  (Because I don't think I have any beeping going on during boot-up.)

----------

## blurp

 *BoneKracker wrote:*   

> I assume you're not talking about POST beeps.  (Because I don't think I have any beeping going on during boot-up.)

 

I'm not talking about POST beeps. There is a beep once the module loads automagically moments after initrd (I have RC_PARALLEL_STARTUP = "true"). A second beep occurs once after the login screen in gdm appeared. The module is indeed loaded, as verified with lsmod, but the pcspkr line is still intact in /etc/hotplug/blacklist.

I'm currently trying out desultory's suggestion because I'm curious whether the bootup process would be broken if that option is not enabled.  :Razz:  yes, i'm recompiling the kernel...

----------

## blurp

 *desultory wrote:*   

> Is "Automatic kernel module loading" under "Loadable module support  --->", listed as CONFIG_KMOD=y in the file .config in the root of the source tree, set in the configuration of the kernel which is displaying this behavior? If so, try building a kernel with it unset.

 

ok, i removed that option and the pcspkr module still gets loaded automatically. A check:

```
 ~ # gunzip -c /proc/config.gz | grep KMOD

# CONFIG_KMOD is not set

CONFIG_X86_P4_CLOCKMOD=m

 ~ # lsmod | grep pcspkr

pcspkr                  1408  0
```

But I observed this: during the first reboot into the new kernel, there was no beep (I think pcspkr wasn't loaded). I couldn't verify because I forgot to remove that rmmod line in local.start. Also, ipw2100 was not loaded as well. But after i removed that rmmod line and did a reboot, the annoying beep came back and somehow ipw2100 returned as well. I could see ipw2100 being initiated at boot (before INIT: Entering runlevel: 5) when the lines "net.eth2" appeared. This was absent in the first boot.

IIRC, the same thing happened during the first boot of the new kernel upgrade (with CONFIG_KMOD set): ipw2100 wasn't there.

Here is my rc-update -s:

```
               acpid |      default graphical nonetwork        

           alsasound |      default graphical                  

            bootmisc | boot                                    

             checkfs | boot                                    

           checkroot | boot                                    

               clock | boot                                    

         consolefont | boot                                    

        cpufrequtils | boot                                    

               cupsd |      default graphical                  

                dbus |              graphical                  

               fcron |      default graphical                  

               fnfxd |              graphical                  

                fuse |      default graphical                  

                 gpm |      default graphical                  

                hald |              graphical                  

              hdparm | boot                                    

            hostname | boot                                    

             hotplug |      default graphical                  

             keymaps | boot                                    

         laptop_mode | boot                                    

               local |      default graphical nonetwork        

          localmount | boot                                    

             modules | boot                                    

              net.lo | boot                                    

              pcmcia | boot                                    

           rmnologin | boot                                    

              smartd |      default graphical                  

           syslog-ng |      default graphical                  

             urandom | boot                                    

                 xdm |              graphical                  
```

desultory: may i know what does unsetting CONFIG_KMOD do? It doesn't seem that there is any difference in my case.

----------

## desultory

 *blurp wrote:*   

> ok, i removed that option and the pcspkr module still gets loaded automatically. A check:
> 
> ```
>  ~ # gunzip -c /proc/config.gz | grep KMOD
> 
> ...

 Is pcspkr still blacklisted in your hotplug configuration?

 *blurp wrote:*   

> But I observed this: during the first reboot into the new kernel, there was no beep (I think pcspkr wasn't loaded). I couldn't verify because I forgot to remove that rmmod line in local.start. Also, ipw2100 was not loaded as well. But after i removed that rmmod line and did a reboot, the annoying beep came back and somehow ipw2100 returned as well. I could see ipw2100 being initiated at boot (before INIT: Entering runlevel: 5) when the lines "net.eth2" appeared. This was absent in the first boot.
> 
> IIRC, the same thing happened during the first boot of the new kernel upgrade (with CONFIG_KMOD set): ipw2100 wasn't there.

 Is depmod run after the modules autoload? It is the closest thing to a logical connection which has thusfar come to mind.

 *blurp wrote:*   

> desultory: may i know what does unsetting CONFIG_KMOD do? It doesn't seem that there is any difference in my case.

 When set, CONFIG_KMOD allows the kernel to load modules when the kernel determines that they are needed, unset would logically be the inverse condition. My reasoning was that perhaps, for whatever reason, the kernel had determine that the speaker module was needed and loaded it.

 *blurp wrote:*   

> i don't know where the stupid module gets loaded --- can't find it in dmesg.

 Try something like: grep -ir2 speaker /var/log/, there should be mention of it somewhere in /var/log/kernel/.

----------

## bunder

why not recompile and remove the speaker from there?  its under input devices > miscellaneous.

cheers

----------

## blurp

 *desultory wrote:*   

> Is pcspkr still blacklisted in your hotplug configuration?

 

yes, it is.

 *desultory wrote:*   

> Is depmod run after the modules autoload? It is the closest thing to a logical connection which has thusfar come to mind.

 

I don't know - I used genkernel and enabled initramfs. I suppose it does because genkernel is supposed to automate everything?

 *desultory wrote:*   

>  *blurp wrote:*   i don't know where the stupid module gets loaded --- can't find it in dmesg. Try something like: grep -ir2 speaker /var/log/, there should be mention of it somewhere in /var/log/kernel/.

 

yeah, now i see something in the logs that is related to PC speaker; but I can't make head of why it is loaded.

 *desultory wrote:*   

>  *blurp wrote:*   desultory: may i know what does unsetting CONFIG_KMOD do? It doesn't seem that there is any difference in my case. When set, CONFIG_KMOD allows the kernel to load modules when the kernel determines that they are needed, unset would logically be the inverse condition. My reasoning was that perhaps, for whatever reason, the kernel had determine that the speaker module was needed and loaded it.

 

OK, I experimented a little since I realised ipw2100 is also somewhat mysteriously loaded even when blacklisted in hotplug. This is what I have found - I have been enabling RC_COLDPLUG for the longest time and it is the one that is causing pcspkr and ipw2100 and other dunno what modules to be loaded. Once I set RC_COLDPLUG to "no", pcspkr, ipw2100, etc are not loaded.

This may sound oxymoron, but

Q: Is COLDPLUG supposed to ignore the hotplug blacklist?

I found two more things:

1. CONFIG_KMOD. If I unset it, Gnome will be unable to mount an external USB flash drive even though usb_storage is automatically loaded.

2. RC_COLDPLUG. If I set to "no", then no automounting occurs at all. usb_storage is not in lsmod.

Can someone point me to the relevant docs to /etc/conf.d/rc? Think I can learn a lot about the gentoo system bootup process.

----------

## blurp

 *bunder wrote:*   

> why not recompile and remove the speaker from there?  its under input devices > miscellaneous.
> 
> cheers

 

I suppose I can do that for the last 3 kernel recompilation, but... I think I can learn more about gentoo linux through this dig.  :Smile: 

----------

