Bug 14832 - trivia -- 2.2.16-12 pcmcia-cs won't build correctly
trivia -- 2.2.16-12 pcmcia-cs won't build correctly
Status: CLOSED RAWHIDE
Product: Red Hat Raw Hide
Classification: Retired
Component: kernel (Show other bugs)
1.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Michael K. Johnson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-07-28 21:51 EDT by Michael Tokarev
Modified: 2008-05-01 11:37 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-08-02 14:17:14 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Michael Tokarev 2000-07-28 21:51:23 EDT
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 14:55:21 EDT
Try 2.2.16-17 from the Pinstripe beta; I see --srcdir in that .spec file.
Comment 2 Michael Tokarev 2000-08-02 14:17:14 EDT
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 12:57:03 EDT
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!

Note You need to log in before you can comment on or make changes to this bug.