Jump to content

Where is source code installed? [solved]


Recommended Posts

I downloaded kernel-2.6.8.1.12mdk-1-1mdk.src.rpm so that I can have the source code for my 2.6.8.1-12mdk kernel.

 

I'm trying to install a linux vme-memory access program that needs the source code in order to do a "make install". I keep getting errors that it can't find the kernel source code in the /lib/modules/2.6.8.1-12mdk/build" directory.

 

I installed the above rpm file, but it still can't find the source code in that directory. Does mandrake's source code install in a different directory? I can edit the Makefile file to point to a different directory for the source, but dont' know where that is (would it be /lib/modules/[kernel]/kernel?).

 

Also, I'm new to linux and especially to mandrake/mandriva. I've been working with fedora on a current project and had to switch to mandrake 10.1.

 

Thanks for any and all help!

 

[moved from Software by spinynorman - welcome to the board :)]

Edited by watkinb
Link to comment
Share on other sites

its been a long time since i attempted a kernel recompile but i think you can find the sources at /usr/src/linux. you can try either of this command to check (command might vary):

 

 $ rpm -ql  kernel-2.6.8.1.12mdk


$  rpm -qlp /<path to>/kernel-2.6.8.1.12mdk-1-1mdk.src.rpm

 

ciao!

Link to comment
Share on other sites

okay, I did a "urpmi kernel-source" and used the iso disk #3. It created a directory (linux-2.4.28-0.pre2.1mdk) and link (linux@).

 

Only problem is that if I do "uname -r" I get 2.6.8.1-12mdk, and the source code directory name is 2.4.28-0....

 

it put this in /usr/src. My vme-memory access software is looking at /lib/modules/2.6.8.1-12mdk/build - ORIGINAL.

 

Can anybody tell me how to do this? I'm guessing I can change the directory in the Makefiles, but I'm also wondering if there will be a lot of things I'll miss.

Link to comment
Share on other sites

I did get the source with urpmi, but it only pulled it from CD3. I don't have a working internet connection with it yet, (that's my next challenge, to find out what's wrong with that) so I can't set it up to search online yet.

 

When I used urpmi, like I said, it grabbed the wrong kernel versio from my disk. I'm going to try the other route through the mandrake configuration utility.

Link to comment
Share on other sites

I went to the mandrake control center, found the correct source and installed it. Thanks for the help guys!

 

I installed the module and it created another directory in /lib/modules/ called "[kernelversion]custom" with an "extra/" directory beneath that one that contains my module's .ko file. For some reason, when I type "modprobe [modulename]" it can't find the module, so I copied the "extra/" directory and contents to the /lib/modules/[kernelversion]/kernel/ directory. After that, it works fine. Only problem is if I reboot, and modprobe my module, the module loads, but if I try to run some of the commands associated with the module I get "file not found" errors from the command. If I do a make install and reinstall the module, then it works fine again until the next reboot. It acts like a file, dependency or something that's put in place during an install is removed when rebooted. Strange?? I'm sure I didn't explain my problem very clearly. If anybody needs clarification on something, let me know.

 

Another question while I have you on the line: The software I installed creates a module that I want to be loaded for any user account. I had successfully done this in fedora by editing /etc/profile and adding "modprobe [moduleName]". I did the same thing in mandrake, but until I get the above problem figured out, I can't verify that it's working. Can anybody give me advice on the best place/method of loading this module at boot time? [EDIT: Nevermind, found the answer for auto-loading modules here]

 

Thanks!

Edited by watkinb
Link to comment
Share on other sites

Okay, I think I found which file it can't find.

 

When I install the module, /dev/bus/vme/ctl is created. When these are present, my module works fine.

 

When I reboot, ./bus/vme/ctl aren't there.

 

Why would this disappear upon reboot?

Link to comment
Share on other sites

Okay, I think I found the command(s) that make the device file:

 

# mkdir /dev/bus/vme
# mknod --mode=666 /dev/bus/vme/ctl c 221 8

 

I think I know what's going on here. I executed this in a shell and then my commands that use the module work.

 

I created an executable (#!/bin/bash ?) file and put it in /usr/share/autostart and put in the commands above, thinking maybe I could manually create them as a work around, but when I rebooted it didn't work.

 

Anybody have any idea what's going on? I'm SOOOOO close to being finished with this... HELP!

Edited by watkinb
Link to comment
Share on other sites

You guys are scholars and gentlemen!

 

It worked! However, is this the best (and only) way to do this? It almost feels like a work-around. Bottom line is that it's working and that's just what I needed.

 

Thank you guys so much for your help, you don't know how much you've helped me out!

 

I know I haven't really asked for much, but I had run into a major problem with our unit testing setup at my company and have been fighting with my combination of Linux and other software for a couple of months. I've also been under a lot of pressure to get this resolved and it's these little problems that have been holding up progress on our project. Being a complete new-b to linux hasn't helped and our resident linux expert is completely tied up with other projects and couldn't help me.

 

Now I'll be able to move forward on test development and hopefully we'll be able to meet our delivery deadline.

Edited by watkinb
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...