Building drivers on EL4.0 - What happened to kernel-source?

Rick Stevens rstevens at vitalstream.com
Fri May 27 17:02:47 UTC 2005


Waldher, Travis R wrote:
> Ok.. I run a make mrproper - 
> 
> ********************************************************
> [root at b352590-es40 ~]# cd /usr/src/kernels/2.6.9-5.EL-i686/
> [root at b352590-es40 2.6.9-5.EL-i686]# uname -a
> Linux b352590-es40 2.6.9-5.EL #1 Wed Jan 5 19:22:18 EST 2005 i686 i686
> i386 GNU/Linux
> [root at b352590-es40 2.6.9-5.EL-i686]# make mrproper
> scripts/Makefile.clean:10: Documentation/DocBook/Makefile: No such file
> or directory
> make[1]: *** No rule to make target `Documentation/DocBook/Makefile'.
> Stop.
> make: *** [_mrproper_Documentation/DocBook] Error 2
> [root at b352590-es40 2.6.9-5.EL-i686]# ls -al
> total 404
> drwxr-xr-x  17 root root   4096 Feb 16 17:54 .
> drwxr-xr-x   6 root root   4096 Apr 11 22:29 ..
> drwxr-xr-x  24 root root   4096 Feb 16 17:53 arch
> -rw-r--r--   1 root root  48177 Jan  5 16:27 .config
> drwxr-xr-x   4 root root   4096 Feb 16 17:54 crypto
> drwxr-xr-x  45 root root   4096 Feb 16 17:55 drivers
> drwxr-xr-x  54 root root   4096 Feb 16 17:54 fs
> drwxr-xr-x  15 root root   4096 Feb 16 17:54 include
> drwxr-xr-x   2 root root   4096 Feb 16 17:54 init
> drwxr-xr-x   2 root root   4096 Feb 16 17:54 ipc
> drwxr-xr-x   3 root root   4096 Feb 16 17:55 kernel
> drwxr-xr-x   4 root root   4096 Feb 16 17:54 lib
> -rw-r--r--   1 root root  42210 Jan  5 16:27 Makefile
> drwxr-xr-x   2 root root   4096 Feb 16 17:54 mm
> -rw-r--r--   1 root root 159751 Jan  5 16:27 Module.symvers
> drwxr-xr-x  33 root root   4096 Feb 16 17:54 net
> drwxr-xr-x  10 root root   4096 May 26 19:08 scripts
> drwxr-xr-x   3 root root   4096 Feb 16 17:55 security
> drwxr-xr-x  15 root root   4096 Feb 16 17:54 sound
> drwxr-xr-x   2 root root   4096 Feb 16 17:54 usr
> [root at b352590-es40 2.6.9-5.EL-i686]#
> ********************************************************
> 
> Notice the error I receive, also notice that I am missing the
> "Documents" directory that was always there before with kernel 2.4.x.

You need to install the kernel source RPM.

> 
> So I go to check for missing packages:
> 
> *******************************************************
> [root at b352590-es40 2.6.9-5.EL-i686]# rpm -qa |grep kern
> kernel-utils-2.4-13.1.48
> kernel-devel-2.6.9-5.EL
> kernel-2.6.9-5.EL
> kernel-hugemem-devel-2.6.9-5.EL
> glibc-kernheaders-2.4-9.1.87
> kernel-2.6.9-6.37.EL
> kernel-smp-devel-2.6.9-5.EL
> kernel-devel-2.6.9-6.37.EL
> ********************************************************
> 
> I decide I'm missing kernel-source...
> 
> Problem is it doesn't seem to exist.
> 
> So what changed in 4.0, and how do I now build network card drivers etc.
> if I can't run makes as "normal".

As I noted in my previous post, 2.6 kernels are a bit different (not a
lot, but some).  I've not seen RHEL4 up close (well, I've seen CentOS4)
and they adhere to the FC2 and FC3 way of doing things.  That means that
there is no kernel-source-whatever.rpm.  You have to download and
install the kernel source RPM (called "kernel-version.src.rpm").  Once
you've installe that, then you have to do this:

	cd /usr/src/redhat/SPECS
	rpmbuild -bp --target=i386 kernel-2.6

Once that's done, there is a full kernel source tree in
/usr/src/redhat/BUILD/kernel-2.6.  What I usually do to make it look
more familiar is to:

	cd /usr/src/redhat/BUILD/kernel-2.6
	mv linux-shortversion /usr/src/linux-longversion

"shortversion" is usually something like "2.6.11" (the major release
number).  "longversion" would include the patch level ("2.6.11-1.27").
 From that you can do the normal 2.6 kernel build by:

	cd /usr/src/linux-longversion
	(edit makefile and correct the "EXTRAVERSION" bit)
	cp /boot/config-longverion .config
	make oldconfig  --OR--  make [x|menu]config
	make modules --OR-- make bzImage --OR-- make install
----------------------------------------------------------------------
- Rick Stevens, Senior Systems Engineer     rstevens at vitalstream.com -
- VitalStream, Inc.                       http://www.vitalstream.com -
-                                                                    -
-      Always remember you're unique, just like everyone else.       -
----------------------------------------------------------------------




More information about the Redhat-install-list mailing list