[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [rhelv5-list] why doesn't the kernel in /usr/src/kernels/whatever ever compile



t35t0r wrote:
> On 7/12/07, Jarod Wilson <jwilson redhat com> wrote:
>> t35t0r wrote:
>>
>> The bits in /usr/src/kernels/ come from the kernel-devel package. The
>> rest of the story can be found here:
>>
>> http://www.redhat.com/docs/manuals/enterprise/RHEL-5-manual/Deployment_Guide-en-US/ch-kernel.html#s1-kernel-packages
>>
> 
> It doesn't work:
> 
> [root squid 2.6.18-8.el5-i686]# rpm -qa | grep kernel
> kernel-2.6.18-8.el5
> kernel-headers-2.6.18-8.el5
> kernel-devel-2.6.18-8.el5
> [root squid 2.6.18-8.el5-i686]# make -j3
>  CHK     include/linux/version.h
>  CHK     include/linux/utsrelease.h
> make[1]: *** No rule to make target `init/main.o', needed by
> `init/built-in.o'.  Stop.
> make: *** [init] Error 2
> make: *** Waiting for unfinished jobs....
> make[1]: *** No rule to make target `usr/gen_init_cpio.c', needed by
> `usr/gen_init_cpio'.  Stop.
> make: *** [usr] Error 2
> [root squid 2.6.18-8.el5-i686]# make distclean
> scripts/Makefile.clean:17:
> /usr/src/kernels/2.6.18-8.el5-i686/drivers/infiniband/ulp/srp/Makefile:

Erm, did you read the stuff at the link I provided? You're trying to
compile the bits from the kernel-devel package. Cut-n-paste from the link:

----8<----
kernel-devel — Contains the kernel headers and makefiles sufficient to
build modules against the kernel package
----8<----

I suppose that's perhaps not entirely clear, so let me try to clarify.
The bits from kernel-devel are NOT full kernel sources that you can use
to build an entire kernel. Further down on the same page:

----8<----
The kernel-source package has been removed and replaced with an RPM that
can only be retrieved from Red Hat Network. This *.src.rpm package must
then be rebuilt locally using the rpmbuild command. For more information
on obtaining and installing the kernel source package, refer to the
latest updated Release Notes (including all updates) at
http://www.redhat.com/docs/manuals/enterprise/RHEL-5-manual/index.html
----8<----

Also maybe not entirely clear, I suppose. But you need the src.rpm. To
match the other kernel-* bits you have installed already, you're looking
for the rpm kernel-2.6.18-8.el5.src.rpm, which as the above excerpt
says, can be found on RHN, but can also be found on any site that
mirrors Red Hat's ftp server. For example:

http://mirrors.kernel.org/redhat/redhat/linux/enterprise/5Server/en/os/SRPMS/kernel-2.6.18-8.el5.src.rpm

Then (similar to what coop suggested, but tweaked slightly to try to
match your environment):

# rpm -ivh kernel-2.6.18-8.el5.src.rpm
# cd /usr/src/redhat/SPECS
# rpmbuild -bp --target i686 kernel-2.6.spec
# cd /usr/src/redhat/BUILD/kernel-2.6.18/linux-2.6.18.i686/

And you should be left with a full RHEL5 kernel source tree in that last
directory there, exactly as used to build the RHEL5 GA kernel. Adjust to
taste if you're building as non-root (a good idea) and/or with different
rpm paths set up (necessary for non-root builds unless you change perms
on /usr/src/redhat/*), but those are the defaults above.

Hope this helps clear things up.

-- 
Jarod Wilson
jwilson redhat com


Attachment: signature.asc
Description: OpenPGP digital signature


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]