watkinb Posted May 10, 2005 Report Share Posted May 10, 2005 (edited) 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 May 13, 2005 by watkinb Quote Link to comment Share on other sites More sharing options...
ramfree17 Posted May 10, 2005 Report Share Posted May 10, 2005 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! Quote Link to comment Share on other sites More sharing options...
aioshin Posted May 11, 2005 Report Share Posted May 11, 2005 if you installed the src-rpm, you can find it at /usr/src Quote Link to comment Share on other sites More sharing options...
watkinb Posted May 11, 2005 Author Report Share Posted May 11, 2005 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. Quote Link to comment Share on other sites More sharing options...
durvish Posted May 11, 2005 Report Share Posted May 11, 2005 you need to get your source (that matches your current kernel) via urpmi after setting up your sources with Easy-Urpmi ( the link is at the top of the board! Quote Link to comment Share on other sites More sharing options...
watkinb Posted May 11, 2005 Author Report Share Posted May 11, 2005 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. Quote Link to comment Share on other sites More sharing options...
durvish Posted May 11, 2005 Report Share Posted May 11, 2005 if that kernel source was on the disk then the install kernel version matching that source is on the disk, go to mcc install and search for that kernel and install it to match the source Quote Link to comment Share on other sites More sharing options...
solarian Posted May 11, 2005 Report Share Posted May 11, 2005 or you can do a direct install from CD3, the needed kernel source rpm is there in the media folder Quote Link to comment Share on other sites More sharing options...
durvish Posted May 11, 2005 Report Share Posted May 11, 2005 yup Quote Link to comment Share on other sites More sharing options...
watkinb Posted May 12, 2005 Author Report Share Posted May 12, 2005 (edited) 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 May 12, 2005 by watkinb Quote Link to comment Share on other sites More sharing options...
watkinb Posted May 12, 2005 Author Report Share Posted May 12, 2005 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? Quote Link to comment Share on other sites More sharing options...
watkinb Posted May 12, 2005 Author Report Share Posted May 12, 2005 (edited) 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 May 12, 2005 by watkinb Quote Link to comment Share on other sites More sharing options...
ramfree17 Posted May 12, 2005 Report Share Posted May 12, 2005 put the invocation of your script at the end of /etc/rc.local so the system will create it at every bootup. ciao! Quote Link to comment Share on other sites More sharing options...
watkinb Posted May 13, 2005 Author Report Share Posted May 13, 2005 Thanks, I'll give it a shot. I was doing some internet searches yesterday and was thinking that (if your suggestion doesn't work) udev might be to blame? Quote Link to comment Share on other sites More sharing options...
watkinb Posted May 13, 2005 Author Report Share Posted May 13, 2005 (edited) 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 May 13, 2005 by watkinb Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.