Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 43213 - pcmcia-cs-3.2.7 init.d script should skip modprobe if already builtin to kernel
Summary: pcmcia-cs-3.2.7 init.d script should skip modprobe if already builtin to kernel
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Mobile Herd (OBSOLETE)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-28 10:48 UTC by Scott Taylor (RETIRED)
Modified: 2004-05-06 14:37 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
kernel config (.config,25.83 KB, text/plain)
2004-05-06 14:37 UTC, Donnie Berkholz (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Scott Taylor (RETIRED) gentoo-dev 2004-02-28 10:49:00 UTC
I've got the pcmcia_core and yenta_socket already built into my kernel, so they
don't need loaded by the /etc/init.d/pcmcia script, though its cardmgr is still
needed. This script only checks the modules though:
        if [ -z `fgrep "ds " /proc/modules | head -n1 | cut -c1` ] ; then
Since its builtin, it won't show up in the modules list so i always get these warnings:

  ewarn "'modprobe ${PCIC}' failed"
  ewarn "Trying alternative PCIC driver: ${PCIC_ALT}"

Not sure what the best method would be for knowing that these are already there.
Perhaps a grep on /proc/devices for "pcmcia" or [ -e /proc/bus/pccard ].
Either way... It would be nice to get rid of these inappropriate warnings.
Comment 1 Peter Johanson (RETIRED) gentoo-dev 2004-02-28 20:59:46 UTC
If you see the comment in /etc/conf.d/pcmcia, or if you notice the line in the init script where it does:
if [ -n "$PCIC" ]; then
   foo

then you'll see you can stop part of this behavior by setting PCIC=""
As for the other two, i'll see what can be more easily done to prevent this.
Comment 2 Scott Taylor (RETIRED) gentoo-dev 2004-02-28 23:25:38 UTC
/proc/bus/pccard is created in the ds.c:
ds.c:   proc_pccard = proc_mkdir("pccard", proc_bus);

Therefore, if that exists, no matter whether its builtin or was already loaded
by hand/script/hotplug/whatever then we know that "ds" is in memory and since
that has a dependancy on yenta_socket or whatever else already being in memory.
So, we can then skip over trying to load these as modules. And if down the road
someone decides to try running pcmcia as a module, so that test would fail and
it would try to load them as modules, and that eliminates the chance of
forgetting to uncomment some setting - it'd just plain work, and without ugly
error messages in both cases.

[ -e /proc/bus/pccard ] || if [ -z `fgrep "ds " /proc/modules | head -n1 | cut -c1` ] ; then

For that matter, with that logic holding true, there may not even be a need to
grep /proc/modules at all.

/sys/bus/pcmcia or /sys/class/pcmcia_socket would probably be just as effective.
Comment 3 Peter Johanson (RETIRED) gentoo-dev 2004-03-18 19:22:03 UTC
Okay, sorry for the delay. Just got this commited. Much prettier now. (: Please re-emerge pcmcia-cs and test away.
Comment 4 Donnie Berkholz (RETIRED) gentoo-dev 2004-05-06 14:35:24 UTC
This is actually causing ds to _never_ get modprobed on my laptop, which results in failure of pcmcia to start.
Comment 5 Donnie Berkholz (RETIRED) gentoo-dev 2004-05-06 14:37:55 UTC
Created attachment 30873 [details]
kernel config