Reconfigure kernel for module dmx3191d.ko

Malcolm Candlish bm at candlish.uklinux.net
Tue Feb 15 10:37:07 UTC 2005


Dear Mr Howarth,

Firstly, may I thank you for going to so much trouble on my behalf, I
really do appreciate all of this!

You were quite right, I was using kernel 2.6.9-prep. Therefore think I
am better to start with a new downloaded kernel. Please give me a little
time to do this when I have time available.

Best wishes & thanks,

Malcolm Candlish. 

>> You are probably running kernel 2.6.9-1.667 but have built modules
for 
>> kernel 2.6.9-prep. Why not follow the instructions at 
>> http://crab-lab.zool.ohiou.edu/kevin/kernel-compilation-tutorial-en/
to 
>> build yourself a full new kernel with this module included? Or
follow 
>> the instructions in the release notes to build the module out-of-
tree?


Elaborating on this, here's how I built the dmx3191d.ko module using
the 
out-of-tree method.

1. Grab the source for the module:
(a) $ rpm -ivh ../kernel-2.6.10-1.760_FC3.src.rpm
     [ I have a local RPM build area ~/BUILD so I don't need to
       do this as root ]
(b) $ cd ~/BUILD/SPECS/
(c) $ rpmbuild -bp --target i686 kernel-2.6.spec
     [ you'll need to change the target to x86_64 ]
(d) $ mkdir ~/temp; cd ~/temp
(e) Copy the following files from 
~/BUILD/BUILD/kernel-2.6.10/linux-2.6.10/drivers/scsi to ~/temp:

     dmx3191d.c
     scsi.h
     NCR5380.c
     NCR5380.h
     scsi_obsolete.h
     scsi_typedefs.h

     (FWIW, I arrived at this list of files by first copying just
     the dmx3191d.c file and attempting the "Build module" phase below
     until no more errors were found when building the module)

2. Create a Makefile for the module in ~/temp.

    Appropriate Makefile is attached. This is basically the one
suggested
    in the FC3 release notes, with an "install" section added to put the
    module in the right place.

3. Build module

    Just run "make" in the ~/temp directory:

     $ make
     make -C /lib/modules/2.6.10-1.760_FC3/build 
SUBDIRS=/nis-home/phowarth/temp modules
     make[1]: Entering directory `/lib/modules/2.6.10-1.760_FC3/build'
       CC [M]  /nis-home/phowarth/temp/dmx3191d.o
     /nis-home/phowarth/temp/NCR5380.c:628: warning: 
'NCR5380_print_options' defined but not used
     /nis-home/phowarth/temp/NCR5380.c:351: warning: 'phases' defined 
but not used
     /nis-home/phowarth/temp/NCR5380.c:571: warning:
'NCR5380_probe_irq' 
defined but not used
       Building modules, stage 2.
       MODPOST
       CC      /nis-home/phowarth/temp/dmx3191d.mod.o
       LD [M]  /nis-home/phowarth/temp/dmx3191d.ko
     make[1]: Leaving directory `/lib/modules/2.6.10-1.760_FC3/build'

4. Install module

    $ su
    # make install
    make -C /lib/modules/2.6.10-1.760_FC3/build 
SUBDIRS=/nis-home/phowarth/temp modules_install
    make[1]: Entering directory `/lib/modules/2.6.10-1.760_FC3/build'
      INSTALL /nis-home/phowarth/temp/dmx3191d.ko
    make[1]: Leaving directory `/lib/modules/2.6.10-1.760_FC3/build'
    # /sbin/depmod -a

5. Load module

    At this point, "modprobe dmx3191d" should work.

Paul.
-------------- next part --------------
obj-m    := dmx3191d.o

KDIR    := /lib/modules/$(shell uname -r)/build
PWD    := $(shell pwd)

default:
	$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules

install: dmx3191d.ko
	$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules_install
	strip -g /lib/modules/$(shell uname -r)/extra/dmx3191d.ko

------------------------------
-- 
Malcolm Candlish <bm at candlish.uklinux.net>




More information about the fedora-list mailing list