Bug 14832

Summary: trivia -- 2.2.16-12 pcmcia-cs won't build correctly
Product: [Retired] Red Hat Raw Hide Reporter: Michael Tokarev <mjt>
Component: kernelAssignee: Michael K. Johnson <johnsonm>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 1.0CC: johnsonm
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-08-02 18:17:14 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Michael Tokarev 2000-07-29 01:51:23 UTC
When building, pcmcia-cs by default configures to use running
kernel "for reference", not newly compiled.  So, e.g. if I have
running 2.2.16-8, pcmcia modules will be compiled for it and
installed into /var/tmp/kernel-root/lib/modules/2.2.18-6 (exactly
what I have here :).
Just forgotten --srctree option to pcmcia Configure
in kernel.spec file...

Comment 1 Michael K. Johnson 2000-08-01 18:55:21 UTC
Try 2.2.16-17 from the Pinstripe beta; I see --srcdir in that .spec file.

Comment 2 Michael Tokarev 2000-08-02 18:17:14 UTC
That's strange :) ...  but I don't see any changes in BuildPCMCIA function
in 2.2.16-17, from ftp.redhat.com:/pub/beta/pinstripe/SRPMS/i386/SRPMS:

...
    (cd pcmcia-cs-%{pcmciaver};
     ./Configure -n --kernel=$RPM_BUILD_DIR/linux \
                    --target=$RPM_BUILD_ROOT \
                    --moddir=/lib/modules/%{KVERREL}$1 \
                    --notrust \
                    --cardbus \
                    --nopnp \
                    --sysv \
                    --rcdir=/etc/rc.d
    )
    make CC="$KERNELCC" MAKE="make -j $NRPROC" -C pcmcia-cs-%{pcmciaver} all
    mkdir -p $RPM_BUILD_ROOT/lib/modules/%{KVERREL}$1/pcmcia
    make -C pcmcia-cs-%{pcmciaver}
PREFIX=$RPM_BUILD_ROOTMANDIR=${RPM_BUILD_ROOT}/%{_mandir} install
...

And, moreover, there is no such option -- --srcdir.  There is --kernel=PATH
option (that may be messed up with non-existed --srcdir), and --srctree.
First is to specify where to find kernel source (/usr/src/linux by default),
and the second it to specify that Configure should read kernel parameters
from that directory and not from the running kernel as by default.  It is
strange for me that pcmcia configures from running kernel and not from
sources by default, but that's another story.

Anyway, this whole fragment should better be rewritten as:

...
    cd pcmcia-cs-%{pcmciaver}
     ./Configure -n --kernel=$RPM_BUILD_DIR/linux \
                    --srctree \
                    --target=$RPM_BUILD_ROOT \
                    --moddir=/lib/modules/%{KVERREL}$1 \
                    --notrust \
                    --cardbus \
                    --nopnp \
                    --sysv \
                    --rcdir=/etc/rc.d
    make CC="$KERNELCC" MAKE="make -j $NRPROC" all
    mkdir -p $RPM_BUILD_ROOT/lib/modules/%{KVERREL}$1/pcmcia
    make PREFIX=$RPM_BUILD_ROOTMANDIR=${RPM_BUILD_ROOT}/%{_mandir} install
    cd ..
...

This is just a matter of taste at the end.  But note the --srctree option.

Also, there are additional options also that can be considered, especially
while there is a version of gcc exists that can't compile kernel, and
sometimes we need to specify/use another cc:

  --cc=PATH          use another C compiler
  --ld=PATH          use another linker
  --uflags=FLAGS     set compiler flags for user-mode tools
  --kflags=FLAGS     set compiler flags for kernel modules

Thus, --cc="$KERNELCC -D__KERNEL__ -I`pwd`/../include" can be used,
and --uflags="$RPM_OPT_FLAGS". (note two dots -- .. -- in -I flag for --cc).



Comment 3 Michael Tokarev 2000-08-14 16:57:03 UTC
Ok, in 2.2.16-21 it is fixed:

 * Sat Jul 29 2000 Florian La Roche <Florian.LaRoche@redhat.de>

 - add "--srctree" to pcmcia configuration to use the kernel source
   instead of the running kernel for pcmcia configuration

Thanks, Florian!