LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Make not working? Please help! (https://www.linuxquestions.org/questions/linux-general-1/make-not-working-please-help-340085/)

iansoundz 07-04-2005 11:51 PM

Make not working? Please help!
 
I got the following files sent to me with instructions as shown below:

Makefile (All it says in it is this : obj-m := sgi_hostid.o)
I also got the other two files as shown below:

sgi_hostid.c
license.lic

************************************************************
Below are the instructions I recieved with it:


Only written for 2.6.x linux kernel and
will not work on any other kernel version

written by examples from
http://www.diku.dk/hjemmesider/stude...tml/node3.html

make with: make -C /usr/src/linux-'uname -r` SUBDIRS=`pwd` modules

mimics SGI's hostid proc file entry /proc/sgi_sn/licenseID `

After compiling:

insmod ./sgi_hostid.ko

echo HOSTID >/proc/sgi_sn/licenseID

Where HOSTID is the host id defined in the flex license file.

************************************************************
Below is my problem:

I type this at BASH prompt: make -C /usr/src/linux-'uname -r` SUBDIRS=`pwd` modules

and this is all I get in return:

">"

That's it! I was expecting tons of output to flash by for a while and then return me to my prompt. Anyone have an idea why this is happening?

But then again how can I expect anything? Shouldn't there have ben a configure script? And how can i "insmod ./sgi_hostid.ko"??? The file that was sent to me is "sgi_hostid.c"

Do I obviously have some stuff missing or am I just ignorant?

BTW, I am tring to install and run a license server and these were the requirements for doing so.

Any help is greatly appreciated!

Simon Bridge 07-05-2005 12:40 AM

make -C /usr/src/linux-'uname -r` SUBDIRS=`pwd`

should be:

make -C /usr/src/linux-`uname -r` SUBDIRS=`pwd`

uname -r expands into your kernel version and writes this to stdout. To put it into a command you must inclose it in backquotes.

iansoundz 07-05-2005 12:57 AM

You're right but I get this now:

CC (M) /root/sgi_hostid.o
Building modules stage, 2
Modpost

***Warning: "preempt_schedule" [root/sgi_hostid.ko] undefined!

CC sgi_hostid.mod.o
LD sgi_hostid.ko

Make: Leaving directory `/usr/src/linux-2.6.8.1'

Is this a serious error? What should have I seen?
When I ls my /root directory I see both these files and a couple others. But according to the directions, wasn't it suppose to create the directory /proc/sgi_sn/licenseID ? It isn't there.

Perhaps my newbieness is shining through! ;-)

Nathanael 07-05-2005 03:46 AM

/proc is a directory which shows live info from your running kernel - the dir /proc/sgi_sn/licenseID will most likely appear once you insmod or modproge the modules you just built.
the make warning you got on your screen does not seem to be anything trivial. if it was a serious error it would exit with an error: message...

Simon Bridge 07-05-2005 04:23 AM

"warning" messages are usually fine. These come from gcc and tend not to get "fixed" because the compiler is actually quite picky and programmers need sleep sometimes too (like when the coffee runs out...)

It is telling you that the variable "preempt_schedule" is not defined in the module source. You can sometimes get away without defining variables right away. If it couldn't find a file it would return an "error: <filename> does not exist" ior similar message.

The acid test is to modpropbe the module as per instructions and see what happens.

iansoundz 07-05-2005 08:18 AM

Simon and Nathanael,

Thanks both. I may be green now....but who knows....maybe someday I'll be answering some of your questions!!!

iansoundz 07-05-2005 08:32 AM

Hmmm...geesh...insmod ./sgi_hostid.ko didn't work.

I get error inserting 'sgi_hostid.ko': Invalid module format!

Could this be because insmod expects sgi_hostid.o instead?

help!?

Simon Bridge 07-06-2005 04:12 AM

modprobe sgi_hostid

I think. You leave off the ending.
You left insmod looking for sgi_hostid.ko.o or variations.

Read the man pages for insmod and modprobe - they are amongst the simplest man pages there are so they are good for practising reading the technical documentation anyway.

if it still don't go - check with the instructions again - exactly what is the module name supposed to be?

modprobe -nv sgi_hostid

may supply info


All times are GMT -5. The time now is 08:33 AM.