How to compile a loadable module for an older kernel version!???

How to compile a loadable module for an older kernel version!???

Post by Gard Bjerin » Thu, 18 Jan 2001 11:59:54



Hello folks,

I have a situation where our development system is Linux version 2.2.5-22,
and the target (embedded) system is version 2.2.12-1.

We have a loadable module (driver for EtherExpress 100/Pro; e100.o) that
must be runned on the 2.2.12-1 target system.

However, we can only compile the driver on our host/development system, and
when compiling the module version will then be 2.2.5-22.

So, on the target system, when trying to

    insmod e100.o

I just get an error message complaining about wrong kernel version.

** QUESTION:  How can I, on my 2.2.5-22 system, compile a module with kernel
version number 2.2.12-1 !???????

(I have tried to compile with include-directory set to the old 2.2.12
include files, and LINUX_VERSION_CODE is there defined as 131596 = 2.2.12
... compilation is OK, but have no effect on the )

Thanx for any help,

-Gard Bjering

 
 
 

How to compile a loadable module for an older kernel version!???

Post by Linux Use » Thu, 18 Jan 2001 15:36:22


Hello,

I've done it this way before, might work for you.

1. Install the source for the kernel you want to build for, i.e. 2.2.12-1

2. Change your /usr/src/linux symlink to point to 2.2.12-1

3. cd /usr/src/linux. make include/linux/version.h

4. then compile your module with gcc -DMODULE -D__KERNEL__ -O6 -c driver.c

Cheers,
        Jim H


> Hello folks,

> I have a situation where our development system is Linux version 2.2.5-22,
> and the target (embedded) system is version 2.2.12-1.

> We have a loadable module (driver for EtherExpress 100/Pro; e100.o) that
> must be runned on the 2.2.12-1 target system.

> However, we can only compile the driver on our host/development system,
> and when compiling the module version will then be 2.2.5-22.

> So, on the target system, when trying to

>     insmod e100.o

> I just get an error message complaining about wrong kernel version.

> ** QUESTION:  How can I, on my 2.2.5-22 system, compile a module with
> kernel version number 2.2.12-1 !???????

> (I have tried to compile with include-directory set to the old 2.2.12
> include files, and LINUX_VERSION_CODE is there defined as 131596 = 2.2.12
> ... compilation is OK, but have no effect on the )

> Thanx for any help,

> -Gard Bjering


 
 
 

How to compile a loadable module for an older kernel version!???

Post by Gard Bjerin » Thu, 18 Jan 2001 17:22:40


Hi Jim,

It worked, thanx alot!!

-Gard


> Hello,

> I've done it this way before, might work for you.

> 1. Install the source for the kernel you want to build for, i.e. 2.2.12-1

> 2. Change your /usr/src/linux symlink to point to 2.2.12-1

> 3. cd /usr/src/linux. make include/linux/version.h

> 4. then compile your module with gcc -DMODULE -D__KERNEL__ -O6 -c driver.c

> Cheers,
>         Jim H


> > Hello folks,

> > I have a situation where our development system is Linux version
2.2.5-22,
> > and the target (embedded) system is version 2.2.12-1.

> > We have a loadable module (driver for EtherExpress 100/Pro; e100.o) that
> > must be runned on the 2.2.12-1 target system.

> > However, we can only compile the driver on our host/development system,
> > and when compiling the module version will then be 2.2.5-22.

> > So, on the target system, when trying to

> >     insmod e100.o

> > I just get an error message complaining about wrong kernel version.

> > ** QUESTION:  How can I, on my 2.2.5-22 system, compile a module with
> > kernel version number 2.2.12-1 !???????

> > (I have tried to compile with include-directory set to the old 2.2.12
> > include files, and LINUX_VERSION_CODE is there defined as 131596 =
2.2.12
> > ... compilation is OK, but have no effect on the )

> > Thanx for any help,

> > -Gard Bjering