LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Laptop and Netbook (https://www.linuxquestions.org/questions/linux-laptop-and-netbook-25/)
-   -   Questions about the compiling process (https://www.linuxquestions.org/questions/linux-laptop-and-netbook-25/questions-about-the-compiling-process-629304/)

CoffeeKing!!! 03-19-2008 06:06 PM

Questions about the compiling process
 
I have a syntek webcam driver and did the following:

$ make
$ sudo modprobe videodev
$ sudo modprobe v4l1-compat
$ sudo insmod stk11xx.ko

(the insmod line won't work unless I'm in the Stk... directory.) The others I can do from home.

gksu gedit /etc/modules:
videodev
v4l1-compat
stk11xx.ko (was it necessary to add this one?)

gksu gedit /etc/rc.local:
home/<my user name >/syntekdriver/trunk/driver/st k11xx.ko

As of now the syntek driver is located on my desktop so this line:"
gksu gedit /etc/rc.local:"
is actually
/home/my name/Desktop/stk11xx-1.3.1/st k11xx.ko

After running all of these commands in order i can get the camera to turn on, even after a reboot.

1.Should I have untarred the module into another directory?

2.why was I able to use different directories for the insmod and modprobe commands?

3. Exactly what are videodev and v4l1-compat?

4. Was it really necessary to put the driver into the modules script?

Brian1 03-19-2008 06:31 PM

If you place the built module under your /lib/modules/running-kernel_version/extra. If extra does not exist create it. Then place the built module file in there. Now run the comnad ' depmod -a '. This will rebuild the system.map file so no modprobe can be used to call the module. modprobe only works with the system.map. So one does need to know where the module is. insmod command needs to know the exact path to the module and must use the full name with extension. modprobe does not require the extension. autoloading of the modules can be done many ways. It varies from distro to distro to how one can do it. Posting the distro in question may help define a good place to put those modules to be loaded on start. For question 3 they are modules. I would google ' linux module ' to get a better description than I can put it.

Brian

CoffeeKing!!! 03-19-2008 09:29 PM

Thanks Brian,
I'm running Kubuntu 2.6.20-16-generic

1.What is the history of the "running-kernel_version/extra" directory?

2. I'm guessing that if I had built the stk11 module in this new folder and ran depmod, it would have tried to create a map of the module - and the modules it depends on- and then, modprobe would load the module for me?

3. If depmod had been succesful would i have had to put that insmod in the rc.local file?

4. Why did I have to change directories for the first two modprobes and then the insmod. The modprobes were done in the drivers directory and the last could only be done from /myname@???

Thanks alot to anyone who answers these questions.

Brian1 03-20-2008 03:57 PM

1 A few modules I have are placed in a directory called extra. Doesn't really matter exactly. Can be in any directory under kernel in the /lib/modules/running_kernel_version_number. Like mine /lib/modules/2.6.24.3/extra

2 You don't have to build the module in that directory. I build all mine in my home directory under a temp directory. Most modules compile as so.
./configure - This command script is used to verify you have all required dependencies.
make - This compile the source code
make install - Places the module in your /lib/modules/{kernel-version} and runs the depmod -a command to rebuild the system.map file. Not all do this command or all of it. The Makefile in the source may have other sections like uninstall and clean and others. All differ slightly.

3 After you place the module in /lib/modules/{kernel-version}/extra and ran depmod -a then you can use the modprobe command to call it without the .ko extension of course.

4 modprobe uses the system.map file to locate the location of the modules. You can use the modprobe command anywhere and call the module needed.

Brian


All times are GMT -5. The time now is 06:20 AM.