You are not logged in.

#1 2010-02-22 09:27:10

mbender
Member
Registered: 2008-07-13
Posts: 19

[solved] Blacklisting of modules in rc.conf not working

Hi folks,

the blacklisting of modules in rc.conf (putting an '!' in front of the modules name in the MODULES-array) seems to be broken. As I was a bit sloppy with my system I cannot pin down a certain date from which on this behaviour occured. It's happened in the last two weeks, and I assume, that it was caused by the update of rc.sysinit.

Here the importants part of rc.conf

MOD_AUTOLOAD="yes"
#MOD_BLACKLIST=() #deprecated
MODULES=(acpi-cpufreq cpufreq-ondemand !snd_seq_dummy !snd_seq_oss !snd_pcm_oss !8139cp !ipw2100 !yenta_socket !firewire_ohci)

and the output of lsmod right after I the login

[10:11 ~]$ lsmod
Module                  Size  Used by
radeon                523682  2
ttm                    31045  1 radeon
drm_kms_helper         21971  1 radeon
drm                   126556  5 radeon,ttm,drm_kms_helper
i2c_algo_bit            4219  1 radeon
snd_seq_dummy           1099  0
usbhid                 33451  0
snd_intel8x0           21848  3
snd_seq_oss            25304  0
hid                    61117  1 usbhid
snd_seq_midi_event      4452  1 snd_seq_oss
snd_intel8x0m           9195  1
snd_ac97_codec         85937  2 snd_intel8x0,snd_intel8x0m
snd_seq                42628  5 snd_seq_dummy,snd_seq_oss,snd_seq_midi_event
snd_seq_device          4313  3 snd_seq_dummy,snd_seq_oss,snd_seq
ipw2100                62412  0
ac97_bus                 750  1 snd_ac97_codec
joydev                  7768  0
8139too                17116  0
snd_pcm_oss            33693  0
snd_mixer_oss          14810  1 snd_pcm_oss
libipw                 22851  1 ipw2100
snd_pcm                57479  5 snd_intel8x0,snd_intel8x0m,snd_ac97_codec,snd_pcm_oss
yenta_socket           19039  0
iTCO_wdt                7577  0
snd_timer              16117  3 snd_seq,snd_pcm
uhci_hcd               19124  0
8139cp                 15404  0
i2c_i801                7122  0
rfkill                 12320  0
lib80211                3210  1 libipw
snd                    43847  16 snd_intel8x0,snd_seq_oss,snd_intel8x0m,snd_ac97_codec,snd_seq,snd_seq_device,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_timer
ehci_hcd               31594  0
iTCO_vendor_support     1453  1 iTCO_wdt
rsrc_nonstatic          8891  1 yenta_socket
mii                     3218  2 8139too,8139cp
firewire_ohci          20266  0
sr_mod                 13161  0
pcmcia_core            25643  2 yenta_socket,rsrc_nonstatic
intel_agp              23225  1
firewire_core          37529  1 firewire_ohci
crc_itu_t               1041  1 firewire_core
pcspkr                  1347  0
psmouse                56309  0
agpgart                23331  3 ttm,drm,intel_agp
container               1869  0
soundcore               5007  1 snd
led_class               1933  0
shpchp                 26592  0
usbcore               118921  4 usbhid,uhci_hcd,ehci_hcd
battery                 7328  0
i2c_core               15369  4 radeon,drm,i2c_algo_bit,i2c_i801
sg                     21079  0
ac                      2255  0
pci_hotplug            23492  1 shpchp
snd_page_alloc          5809  3 snd_intel8x0,snd_intel8x0m,snd_pcm
wmi                     4083  0
cdrom                  31625  1 sr_mod
serio_raw               3620  0
thermal                 9326  0
evdev                   6970  10
button                  3638  0
cpufreq_ondemand        6897  1
acpi_cpufreq            5599  0
freq_table              1955  2 cpufreq_ondemand,acpi_cpufreq
processor              25790  2 acpi_cpufreq
rtc_cmos                7504  0
rtc_core               12011  1 rtc_cmos
rtc_lib                 1450  1 rtc_core
sd_mod                 24101  3
ata_piix               17725  2
libata                135578  1 ata_piix
scsi_mod               78933  4 sr_mod,sg,sd_mod,libata
jfs                   163812  2

If more details are needed I can provide them.

Any hints or help are appreciated

Regards

Last edited by mbender (2010-03-02 13:51:35)

Offline

#2 2010-02-22 11:59:42

nybegynner
Member
From: Norway
Registered: 2010-02-07
Posts: 36

Re: [solved] Blacklisting of modules in rc.conf not working

I'm not shure, but maybe another module is using som of the blacklisted modules to in order to run properly, and overrides the blacklisting in rc.conf?

Offline

#3 2010-02-22 12:10:36

Vi0L0
Member
From: Poland
Registered: 2009-06-24
Posts: 1,349
Website

Re: [solved] Blacklisting of modules in rc.conf not working

I can confirm what mbender is saying.
@nybegynner: shouldn't blacklist work as blacklist? - so just don't load this modules, ever...

Offline

#4 2010-02-22 12:27:42

nybegynner
Member
From: Norway
Registered: 2010-02-07
Posts: 36

Re: [solved] Blacklisting of modules in rc.conf not working

Try putting the modules in th MOD_BLACKLIST-array, and reboot. I know it's deprecaded, but maybe it works temporarily.

Last edited by nybegynner (2010-02-22 12:29:22)

Offline

#5 2010-02-22 13:17:29

mbender
Member
Registered: 2008-07-13
Posts: 19

Re: [solved] Blacklisting of modules in rc.conf not working

A call of

grep -nr "MOD_BLACKLIST" /etc/

doesn't show any occurrences.
It occured in the old rc.sysinit however, so I assume this variable isn't evaluated anymore.

I am happy that Vi0L0 confirmed my observation, I was realy supprised that there wasn't already a post about this issue.

Btw, I second Vi0L0's opinion that blacklisted modules should not be loaded even if there are dependencies. In the past this was definitly true and modules that required blacklisted modules were not loaded at all.

Regards

Offline

#6 2010-02-22 13:43:22

loafer
Member
From: the pub
Registered: 2009-04-14
Posts: 1,772

Re: [solved] Blacklisting of modules in rc.conf not working

There are a couple of threads about this from a few years ago, perhaps they will still be of some assistance.

http://bbs.archlinux.org/viewtopic.php?id=42419

http://bbs.archlinux.org/viewtopic.php?id=41062


All men have stood for freedom...
For freedom is the man that will turn the world upside down.
Gerrard Winstanley.

Offline

#7 2010-02-22 14:17:56

stryder
Member
Registered: 2009-02-28
Posts: 500

Re: [solved] Blacklisting of modules in rc.conf not working

I had similar problems - a network card that needed dmfe but tulip always gets loaded no matter what I did. In the end I loaded dmfe in the initcpio image via mkinitcpio.conf and solved the problem. There can be a strong possibility that the initcpio image is the culprit as any blacklist will only take effect after the image. The suggestion to rmmod the offending modules first, rebuilding the initcpio images and maintaining the blacklist in rc.conf makes a lot of sense.

Offline

#8 2010-02-22 14:35:57

mbender
Member
Registered: 2008-07-13
Posts: 19

Re: [solved] Blacklisting of modules in rc.conf not working

stryder wrote:

The suggestion to rmmod the offending modules first, rebuilding the initcpio images and maintaining the blacklist in rc.conf makes a lot of sense.

Unfortunately this does not work for me sad.
I took a look at the posts been provided by loafer.
Then I used

modprobe -r

to remove the offending modules and rebuild my initial ramdisk with

mkinitcpio -p kernel26

.
The modules were still blacklisted in rc.conf.
I rebootet my system and the modules were still loaded.
I used

zcat /boot/kernel26.img | cpio -tv | grep modules

to take a look which modules are in the ramdisk and only the provide modules for my harddisk access were shown.
The only hooks provided in mkinitcpio.conf are 'base' and 'udev'.
I'll try to kick udev later on to see if it has some effect...

Offline

#9 2010-02-22 14:54:23

stryder
Member
Registered: 2009-02-28
Posts: 500

Re: [solved] Blacklisting of modules in rc.conf not working

dang. sad Sorry I can't be of further help. Before I hit on the initcpio route for my problem I was rmmoding using rc.local just so the card can work.

Last edited by stryder (2010-02-22 14:58:09)

Offline

#10 2010-02-22 15:11:40

mbender
Member
Registered: 2008-07-13
Posts: 19

Re: [solved] Blacklisting of modules in rc.conf not working

I removed udev from the hook array in mkinitcpio and rebuild my ramdiks, but it haven't changed a thing.
However, I tried to put those modules, that are to be blacklisted, with the command 'blacklist' into /etc/modprobe.d/modprobe.conf and they were not loaded.

In my opinion, this behaviour leads to two possible conclusions:
1. blacklisting in MODULES doesn't work at all and the blacklisting during system init ist done only by modprobe.conf
2. Blacklisting in MODULES work, but there is a program that loads modules immediate after the init-procedure's termination

I am puzzled.

Offline

#11 2010-02-22 15:21:24

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: [solved] Blacklisting of modules in rc.conf not working

Working as expected here.. just adding that for the sake of balance.

mbender/Vi0L0 - what architecture are you using? Are you using the stock initscripts package? Are your systems up to date?

Offline

#12 2010-02-22 15:42:07

mbender
Member
Registered: 2008-07-13
Posts: 19

Re: [solved] Blacklisting of modules in rc.conf not working

I am on i686.
I just started pacman -Suy again but there haven't been any new packages for me. Mirrorcheck tells me, that my mirror was synced about 4h ago.
I have some packages ignored, but no 'system-packages'.
As far as I know I've never tinkered with any of the initfiles. To be sure I reinstalled the package 'initscripts', which changed none of the files in /etc/.

Last edited by mbender (2010-02-22 15:46:23)

Offline

#13 2010-02-22 15:45:40

Vi0L0
Member
From: Poland
Registered: 2009-06-24
Posts: 1,349
Website

Re: [solved] Blacklisting of modules in rc.conf not working

tomk wrote:

mbender/Vi0L0 - what architecture are you using? Are you using the stock initscripts package? Are your systems up to date?

x86_64, yes, and yes.
The blacklist isn't important for me, at least not now. I just accidentally haven't un-blacklisted some earlier used module, and when i need that module 4 days ago and build it - i saw that it is loaded although it was figuring in modules array as blacklisted (!)... so i was surprised :>.
Edit: i have tested it, and looks like it's working fine now. The module that bypassed blacklist was fglrx, i don't have this module builded right now so i won't test it (rolling back to fglrx/catalyst is time-consuming so i rather not retest it now) - maybe that was some particular fglrx case <sigh>
Althought im using radeon module right now and if i will blacklist it - module won't be loaded, X won't start.
Anyhow [solved] for me.

Last edited by Vi0L0 (2010-02-22 16:18:36)

Offline

#14 2010-02-23 11:45:07

mbender
Member
Registered: 2008-07-13
Posts: 19

Re: [solved] Blacklisting of modules in rc.conf not working

As the workaround, to blacklist the unwanted modules in modprobe.conf, seems to work, it's not such a serious issue anymore for me. Nonetheless a not working blacklisting in rc.conf is a issue, althoug only some people seem affected.

I'll gladly provide more information if asked for, to help fixing this issue.

Regards

Offline

#15 2010-02-26 10:34:22

mbender
Member
Registered: 2008-07-13
Posts: 19

Re: [solved] Blacklisting of modules in rc.conf not working

I had some time to do a deeper research. I tinkered around in rc.sysinit and added calls to lsmod at different postitions. With this approach I reached following conclusion:

The code in lines 78 to 84 in rc.sysinit loads nearly all the modules for my system (rtc-Modules are loaded before, modules for hdd-access come from the init-ramdisk, cpufreq-modules are not loaded). This includes modules blacklisted in rc.conf but not those modules blacklisted in /etc/modprobe.d/*.

Without further research I would assume that udev doesn't care for the MODULES-Array in the rc.conf. So one should 'fix' udev or remove the blacklisting from rc.conf completly and leave blacklisting to /etc/modprobe.d/*.

I'm still curious if some special circumstances on my system lead to this behaviour or if the other users just don't use the blacklisting in rc.conf respectivly use it combined with blacklisting in /etc/modpobe.d/*.
I'm keeping my /etc/ in a git-repository and checkout the files I tinkered with after I'm finished. Therefore I guess that the chances of some modified configuration files are quite small. Anyway I'll check files if I get hints.

To avoid confusion and clearify my findings I post the 'culprit'

# Trigger udev uevents
 if /bin/pidof -o %PPID /sbin/udevd >/dev/null; then
   stat_busy "Triggering UDev uevents"
   /sbin/udevadm control --property=STARTUP=1
   /sbin/udevadm trigger
   stat_done
 fi

I'm still offering cooperation for dealing with this issue.
If this is no issue at all, I would be very happy if someone could (try to) explain this behaviour on my system (Yes, I like to solve riddles a lot...).

Best regards

edit: Typos

Last edited by mbender (2010-02-26 10:36:02)

Offline

#16 2010-02-28 19:13:35

mbender
Member
Registered: 2008-07-13
Posts: 19

Re: [solved] Blacklisting of modules in rc.conf not working

As there were no more (helpful) responses to my posts, I started to put all those modules that I don't want to have in appropriate foobar-blacklist.conf files in /etc/modprobe.d/ .
For some modules this works like a charm but there are other that are loaded nonetheless. sad
Until now these are  pcspkr, wmi, sg,  snd_seq_oss and snd_pcm_oss.
I have now clue why these modules are still being loaded. sad

While I was investigating, I found out, that the MOD_AUTOLOAD switch in rc.conf seems to have lost his purpose as well... So there's allways automatic loading of modules.

Offline

#17 2010-03-02 13:52:30

mbender
Member
Registered: 2008-07-13
Posts: 19

Re: [solved] Blacklisting of modules in rc.conf not working

I don't know why, but blacklisting in rc.conf and mod_autoload is now working as a charm.

Offline

#18 2010-04-22 14:38:18

Rad3k
Member
From: Poland
Registered: 2009-05-09
Posts: 36

Re: [solved] Blacklisting of modules in rc.conf not working

Well, for me it still doesn't work properly. I needed to blacklist ipv6 module in modprobe.d - previously it was blacklisted in rc.conf, with no effect. The module couldn't have been loaded from initpcio, I've checked that by booting with 'break' in kernel command line, then checking lsmod and /lib/modules - it wasn't there. Does anyone know where in the startup scripts is the code supposed to blacklist the modules from rc.conf? I've searched scripts for "modules", and all I've found is this snippet from rc.sysinit:

# Load modules from the MODULES array defined in rc.conf
if ! [ "$load_modules" = "off" ]; then
    if [ -f /proc/modules ]; then
        stat_busy "Loading Modules"
        for mod in "${MODULES[@]}"; do
            if [ "$mod" = "${mod#!}" ]; then
                /sbin/modprobe $mod
            fi
        done
        stat_done
    fi
fi

All it does is load modules from rc.conf skipping those prefixed with bang, it doesn't prevent anything else to load these modules.

Is there any difference between prefixing a module name with bang in rc.conf and not putting it there at all? If there is, where should I look for the code responsible for the difference?

Offline

Board footer

Powered by FluxBB