Re: Building a new module from an existing one

From: Richard B. Johnson (root@chaos.analogic.com)
Date: Thu Feb 22 2001 - 13:22:10 EST


On Thu, 22 Feb 2001, Marcus Ramos wrote:

> Hello,
>
> I plan to make a few changes to 3c90x.c (Ethhernet driver) located at
> /usr/src/linux-2.2.16/drivers/net, in RH7. Since the correspondent
> object file 3c90x.o resides in /lib/modules/2.2.16-20/net, I ask: how
> shall I proceed in order to have the C file properly compiled and placed
> in the right place, so that the modified version replaces the previous
> one after system boot up ?
>
> Thanks in advance,
> Marcus.
>

I assume this is serious. Therefore, I answer.

cd /usr/src/linux-2.2.16
make modules
make modules_install

You should be able to test your changes without having to reboot
and without overwriting the existing (working) driver. If you are
doing a lot of work, I suggest you make a script:

#!/bin/bash
ifconfig eth0 down
rmmod 3c90x
insmod /usr/src/linux-2.2.16/drivers/net/3c90x.o
ifconfig eth0 xx.xx.xx.xx netmask mm.mm.mm.mm broadcast bb.bb.bb.bb
route add -net xx.xx.xx.0 netmask mm.mm.mm.mm broadcast dev eth0
route add default gw (etc)

Once you have verified that your revised driver works as intended,
then you do `make modules_install` to put it into the correct place
for the next boot.

Cheers,
Dick Johnson

Penguin : Linux version 2.4.1 on an i686 machine (799.53 BogoMips).

"Memory is like gasoline. You use it up when you are running. Of
course you get it all back when you reboot..."; Actual explanation
obtained from the Micro$oft help desk.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Feb 23 2001 - 21:00:28 EST