Bug 89264

Summary: /etc/init.d/pcmcia coding error (w/ rebuilt kernel)
Product: [Retired] Red Hat Linux Reporter: Need Real Name <chagner>
Component: kernel-pcmcia-csAssignee: Arjan van de Ven <arjanv>
Status: CLOSED CURRENTRELEASE QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 9   
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-09-08 06:58:33 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Need Real Name 2003-04-22 01:18:20 UTC
Description of problem:
After rebuilding a kernel from the kernel-source rpm provided, I noticed that
the pcmcia modules were not being loaded (reverting to the original install
kernel still worked).  After hunting down a number of things, here's what I came
up with...

1. The kernel build/modules_install process creates a
/lib/modules/<kernel_tag>/pcmcia directory.  The original (installed)
/lib/modules/2.4.20-8/ does not have this directory.

2. The /etc/init.d/pcmcia script keys of the existence of this directory and
executes a different syntax for 'modprobe pcmcia_core.'  I thought it wasn't
possible (and I still think that), but calling 'modprobe pcmcia_core.o' will
fail (the '.o' shouldn't be there... see code below).

Here's the code block from the pcmcia script (with my comments added)...
if [ -d /lib/modules/preferred ] ; then
                PC=/lib/modules/preferred/pcmcia
            else
                PC=/lib/modules/`uname -r`/pcmcia
            fi
            KD=/lib/modules/`uname -r`/kernel/drivers/pcmcia
            # MY COMMENT: THIS IS WHERE IT WAS MESSED UP.
            # MY COMMENT: THE NEW KERNEL's modules directory had a 
            # MY COMMENT: top-level pcmcia dir which dropped into 
            # MY COMMENT: this first if block.
            # The elif block is the right one.
            if [ -d $PC ] ; then
                echo -n " modules"
                # MY COMMENT: how does this work? I think the .o
                # MY COMMENT: shouldn't be there.
                # MY COMMENT: Looking at the same script for Redhat 
                # MY COMMENT: 7.3, the lines have "$PC/" prefixing
                # MY COMMENT: the module name like so...
                # MY COMMENT: /sbin/modprobe $PC/pcmcia_core.o $CORE_OPTS
                # MY COMMENT: This makes _more_ sense, but I don't think
                # MY COMMENT: it'll work.
                /sbin/modprobe pcmcia_core.o $CORE_OPTS
                /sbin/modprobe $PCIC.o $PCIC_OPTS
                /sbin/modprobe ds.o
            elif [ -d $KD ] ; then
                /sbin/modprobe pcmcia_core
                /sbin/modprobe $PCIC
                /sbin/modprobe ds
            else
                echo $" module directory $PC not found."
                break
            fi

I can fix it either by modifying the script or blowing away the
/lib/modules/<kernel_tag>/pcmcia directory (since it just contains symlinks
to the kernel directory versions.

Version-Release number of selected component (if applicable):
Standard RedHat 9 (Shrike) release.

How reproducible:
Recompiling everything now... but, assuming the error is in the pcmcia script,
then it's not a kernel compilation error, it's a script logic error.

Steps to Reproduce:
1.
2.
3.
    
Actual results:


Expected results:


Additional info:

Comment 1 Bill Nottingham 2004-09-08 06:58:33 UTC
This was fixed in an update to FC1, and in current trees.