List Info

Thread: Re: why doesn't the kernel in /usr/src/kernels/whatever ever compile




Re: why doesn't the kernel in /usr/src/kernels/whatever ever compile
user name
2007-07-19 08:36:06
t35t0r wrote:
> On 7/12/07, Jarod Wilson <jwilsonredhat.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-man
ual/Deployment_Guide-en-US/ch-kernel.html#s1-kernel-packages

>>
> 
> It doesn't work:
> 
> [rootsquid 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
> [rootsquid 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
> [rootsquid 2.6.18-8.el5-i686]# make distclean
> scripts/Makefile.clean:17:
>
/usr/src/kernels/2.6.18-8.el5-i686/drivers/infiniband/ulp/sr
p/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/enterpr
ise/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://m
irrors.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
jwilsonredhat.com



_______________________________________________
rhelv5-list mailing list
rhelv5-listredhat.com
h
ttps://www.redhat.com/mailman/listinfo/rhelv5-list

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )