[CentOS] CentOS4 and older megaraid - SOLVED

Tue Aug 16 21:05:44 UTC 2005
Craig White <craigwhite at azapple.com>

On Sat, 2005-08-13 at 23:47 -0700, Craig White wrote:
> On Sat, 2005-08-13 at 22:08 -0700, Craig White wrote:
> > On Sat, 2005-08-13 at 21:48 -0600, William wrote:
> 
> > > If you're interested in what I have, here's an archive link to one of my 
> > > older posts on this very topic:
> > > http://lists.centos.org/pipermail/centos/2005-August/009501.html
> > ----
> > that sounds simple enough...I've got a CentOS 4 system that I'm updating
> > right now before I download the module source and compile it. Let's see
> > how far I get.
> ----
> I'm sort of stuck where you are...
> 
> anyone to toss a bone here on compiling kernel modules
> 
> I'm following the release notes:
> Note
> An exploded source tree is not required to build kernel modules against
> the currently in-use kernel.
> 
> For example, to build the foo.ko module, create the following file
> (named Makefile) in the directory containing the foo.c file:
> 
> 
> obj-m    := foo.o
> 
> KDIR    := /lib/modules/$(shell uname -r)/build
> PWD    := $(shell pwd)
> 
> default:
>     $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
> 
> so 
> # ls -l
> total 204
> -rw-r--r--  1 root root    137 Aug 13 23:36 Makefile
> -rw-r--r--  1 root root    140 Aug 13 23:33 Makefile~
> -rw-r--r--  1 root root 118447 Jun 24 12:42 megaraid.c
> -rw-r--r--  1 root root  29506 Jun 24 12:42 megaraid.h
> -rw-r--r--  1 root root   2808 Jun 24 13:04 scsi.h
> -rw-r--r--  1 root root   4146 Jun 24 13:05 scsi_obsolete.h
> -rw-r--r--  1 root root    215 Jun 24 13:05 scsi_typedefs.h
> 
> # cat Makefile
> obj-m   := megaraid.o
> 
> KDIR    := /lib/modules/2.6.9-11.ELsmp/build
> PWD     := $(shell pwd)
> 
> default:
>         $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
> 
> then running the following...I'm shooting blanks...
> 
> # make -w
> make: Entering directory `/usr/src/megaraid'
> make -C /lib/modules/2.6.9-11.ELsmp/build SUBDIRS=/usr/src/megaraid modules
> make[1]: Entering directory `/lib/modules/2.6.9-11.ELsmp/build'
> make[1]: *** No rule to make target `modules'.  Stop.
> make[1]: Leaving directory `/lib/modules/2.6.9-11.ELsmp/build'
> make: *** [default] Error 2
> make: Leaving directory `/usr/src/megaraid'
> 
> Anyone care to toss a bone my way?
----
Solved

yum install kernel-devel didn't work because like a moron, I was in smp
kernel and so I needed to yum install kernel-smp-devel which then made
it all work but of course the boot cd is a uni-processor so I will have
to wait until I can reboot the production machine into a uni-processor
mode to compile a suitable module to test

Craig