LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Building driver modules to work with Install kernels? (https://www.linuxquestions.org/questions/slackware-14/building-driver-modules-to-work-with-install-kernels-370169/)

Erik_FL 10-05-2005 09:04 PM

Building driver modules to work with Install kernels?
 
I have an unusual situation, where I have to use a special driver module "ft3xx" to access my hard disks. I managed to compile it under Slackware 10.1 by lots of experimenting.

Now I am using Slackware 10.2 and I have to use the "-f" option with "insmod" to load the driver. I'd like to recompile the driver for Slackware 10.2, using a configuration that will make it compatible with at least one of the kernels on the installation CD (preferably the default one).

The instructions that came with the driver are not very helpful, and simply say that I must recompile the Linux kernel, and then recompile the driver module.

Are there configuration files that can be used to replicate the kernels on the installation CDs? Where are the files located? Can I use those files to recompile my "ft3xx" driver module, without having to recompile the whole kernel first? Are there symbol table files, or other things needed in order to compile the driver module without recompiling the kernel?

shilo 10-06-2005 02:34 AM

To make sure I understand:

You need to compile a module for your hard disk

You did this for Slackware 10.1

You upgraded to Slackware 10.2, and I assume also upgraded your kernel at the same time?

Now, the driver that you previously compiled (for your old kernel) won't load (using your new kernel) unless you use insmod -f?

I would guess that all that is required is to recompile the driver while you have the new kernel running. Most third-party modules will use `uname -r` to figure out which kernel you are running and compile for that kernel.

Quote:

Are there configuration files that can be used to replicate the kernels on the installation CDs?
You don't even need the disk, it is most likely installed on your system as /boot/config (a symlink to the config for the kernel). Don't know how that will help, though (unless you are looking to compile the driver on a separate box and just want to be able to re-create the stock kernel on that box).

Erik_FL 10-06-2005 11:58 AM

Sorry I wasn't clearer in my first post.

I am running a kernel that I did compile myself.
I did recompile the driver to run with the 10.2 kernel.

The problem is if I boot the Slackware 10.2 Installation CD, it cannot see my hard disks.
I have to load the "ft3xx" driver in order to do that.

Since I compiled my own kernel, the "ft3xx" driver module I have will ONLY work with the kernel on my hard disk, and NOT the Slackware 10.2 Installation CD.

What I would like to do is build a version of "ft3xx.o" that can be loaded by the kernel on the Slackware 10.2 Installation CD. That will allow me to access the hard disks, or reinstall Linux in an emergency.

When I started out I had no "ft3xx" driver at all, and had to temporarily install another hard disk to compile Linux and build the driver.

I have an older copy of the "ft3xx" driver that I saved under Slackware 10.1. The Slackware 10.2 Installation CD kernel will load that driver if I use the "-f" switch. However, I'm kind of nervous about using that driver to do anything with my hard disks.

My first thought was to recompile Linux again, setting the options to the same as the kernel on the Installation CD, and then recompile the driver. The problem is I don't know the configuration of the kernel on the Installation CD. Instead of experimenting again, I thought I'd ask if there is a better way to build modules compatible with an existing kernel.

Alien Bob 10-06-2005 03:10 PM

Hi,

I wrote a SlackBuild script that should give you a Slackware package for your raid controller card.
Make sure you have installed the Slackware kernel sources for 2.4.31. Change directory to the kernel source directory and run
Code:

make oldconfig; make dep
Next, download all the stuff here: http://www.slackware.com/~alien/slac...s/ft3xx/build/ and then run
Code:

KVER=2.4.31 ./ft3xx.SlackBuild
in the download directory.

You'll end with a Slackware package in directory /tmp named ft3xx-1.00.0.19_2.4.31-i486-1.tgz , that contains the ft3xx.o.gz kernel module for the default Slackware 10.2 kernel (2.4.31).
Install that package using
Code:

installpkg /tmp/ft3xx-1.00.0.19_2.4.31-i486-1.tgz
so that the driver is installed - as a module!
This recipe only helps if your root filesystem is not located on your RAID device... because you can only load the ft3xx module after Slackware booted. In case you do need the module on boot, you could create an initrd file for the kernel, using the mkinitrd script, that contains the ft3xx module, and add something appropriate to /etc/lilo.conf.

Eric

Erik_FL 10-06-2005 09:05 PM

Eric,

Thanks, I'll give that a try.
My Linux system and boot loader is on the RAID disk.
I already made the initrd image and got the system booting.

I'm assuming I just need to grab the "ft3xx.o.gz" out of the package, so I can load it when I boot the Slackware 10.2 installation CD. I'll probably put it on a floppy so I can do that.
That was the missing piece, a driver I can load while the Installation CD is booted in case I have a problem.

The script you gave me appears to do a better job of selecting the CPU architecture. Was that the problem making the driver incompatible with the installation CD?

Regards,
Erik


All times are GMT -5. The time now is 11:04 AM.