# Looking for location of module

## dman777

I'm a little rusty on compileing. I am trying to install the AMD K10 thermal sensor driver. I compiled it and did a 'make install' to install it. I'm not sure the location of it so I can modprobe it. Can tell me? Here's the output:

```
localhost Downloads # make

make[1]: Entering directory `/usr/src/linux-2.6.31-gentoo-r6'

  CC [M]  /home/one/Downloads/k10temp.o

  Building modules, stage 2.

  MODPOST 1 modules

  CC      /home/one/Downloads/k10temp.mod.o

  LD [M]  /home/one/Downloads/k10temp.ko

make[1]: Leaving directory `/usr/src/linux-2.6.31-gentoo-r6'

localhost Downloads # make install

cp k10temp.ko /lib/modules/2.6.31-gentoo-r6/kernel/drivers/hwmon

depmod -a -F /lib/modules/2.6.31-gentoo-r6/build/System.map 2.6.31-gentoo-r6
```

----------

## krinn

that's a strange query dman777

You're are asking us where the module is install and showing the location...

```
/lib/modules/2.6.31-gentoo-r6/kernel/drivers/hwmon
```

and you wish that location to modprobe it, but you don't have to care about it as modprobe k10temp will search, find and load it for you.

Even on a simple reboot, udev will load it for you.

Really it's the info you were looking for ?

----------

## dman777

```
localhost drivers # pwd

/lib/modules/2.6.31-gentoo-r6/kernel/drivers

localhost drivers # lr

total 12

drwxr-xr-x 3 root root 4096 Jan 27 04:40 .

drwxr-xr-x 4 root root 4096 Jan 27 04:40 ..

drwxr-xr-x 2 root root 4096 Jan 27 04:40 scsi

localhost drivers # modprobe k10temp

FATAL: Module k10temp not found.

localhost drivers # 
```

```
localhost conf.d # find / -name "k10temp*"

/home/one/Downloads/k10temp.c

/home/one/Downloads/k10temp.mod.o

/home/one/Downloads/.tmp_versions/k10temp.mod

/home/one/Downloads/k10temp.mod.c

/home/one/Downloads/k10temp.ko

/home/one/Downloads/k10temp.o

localhost conf.d #
```

I'm rusty at this so I apologize. I don't understand, in the output of make install it shows 

```
cp k10temp.ko /lib/modules/2.6.31-gentoo-r6/kernel/drivers/hwmon 
```

but hwmon does not exist in this location. Modprobe isn't finding it's file.

----------

## krinn

remember if cp a file to a directory that doesn't exist, the file will be rename...

So

cp k10temp.ko /lib/modules/2.6.31-gentoo-r6/kernel/drivers/hwmon when hwmon isn't a directory will create the file hwmon in ...../drivers

and it could be the case because if you don't have any others hwmon module, kernel could have just didn't create the directory.

and i suppose "lr" is a shortcut for ls just directory ?

check hwmon file presence...

----------

## dman777

ya, it's no where to be found. not even renamed. i copied the .ko file from it's original make location to where modprobe searches(as stated in it's man page) but still no success:

```
localhost 2.6.31-gentoo-r6 # pwd

/lib/modules/2.6.31-gentoo-r6

localhost 2.6.31-gentoo-r6 # ls -al

total 96

drwxr-xr-x 6 root root 4096 Jan 27 05:15 .

drwxr-xr-x 3 root root 4096 Jan 17 00:53 ..

lrwxrwxrwx 1 root root   31 Jan 17 00:53 build -> /usr/src/linux-2.6.31-gentoo-r6

drwxr-xr-x 2 root root 4096 Jan 27 05:15 hwmon

-rw-r--r-- 1 root root 9012 Jan 27 05:09 k10temp.ko

drwxr-xr-x 4 root root 4096 Jan 27 04:40 kernel

drwxr-xr-x 2 root root 4096 Jan 23 12:13 misc

-rw-r--r-- 1 root root  169 Jan 27 04:40 modules.alias

-rw-r--r-- 1 root root  155 Jan 27 04:40 modules.alias.bin

-rw-r--r-- 1 root root   69 Jan 27 04:40 modules.ccwmap

-rw-r--r-- 1 root root  230 Jan 27 04:40 modules.dep

-rw-r--r-- 1 root root  312 Jan 27 04:40 modules.dep.bin

-rw-r--r-- 1 root root   73 Jan 27 04:40 modules.ieee1394map

-rw-r--r-- 1 root root  141 Jan 27 04:40 modules.inputmap

-rw-r--r-- 1 root root   81 Jan 27 04:40 modules.isapnpmap

-rw-r--r-- 1 root root   74 Jan 27 04:40 modules.ofmap

-rw-r--r-- 1 root root   72 Jan 27 04:40 modules.order

-rw-r--r-- 1 root root  281 Jan 27 04:40 modules.pcimap

-rw-r--r-- 1 root root   43 Jan 27 04:40 modules.seriomap

-rw-r--r-- 1 root root   86 Jan 27 04:40 modules.symbols

-rw-r--r-- 1 root root   44 Jan 27 04:40 modules.symbols.bin

-rw-r--r-- 1 root root  189 Jan 27 04:40 modules.usbmap

lrwxrwxrwx 1 root root   31 Jan 27 04:40 source -> /usr/src/linux-2.6.31-gentoo-r6

drwxr-xr-x 2 root root 4096 Jan 25 20:57 video

localhost 2.6.31-gentoo-r6 # !mod

modprobe k10temp.ko

FATAL: Module k10temp.ko not found.

localhost 2.6.31-gentoo-r6 # modprobe k10temp   

FATAL: Module k10temp not found.

localhost 2.6.31-gentoo-r6 # 

```

 *Quote:*   

> 
> 
> modprobe  looks  in  the  module  directory  /lib/mod-
> 
>        ules/`uname  -r`  for  all  the modules and other files

 

is my modprobe broke? i did a ldconfig and revdep-rebuild to try and fix but no success.

----------

## krinn

 *dman777 wrote:*   

> 
> 
> ```
> 
> drwxr-xr-x 2 root root 4096 Jan 27 05:15 hwmon
> ...

 

well it's there, and should be in hwmon instead. But that seems really odd yeah.

try do it by hands, because something really get wrong there.

You have 

1/ /lib/modules/2.6.31-gentoo-r6/hwmon directory and this directory shoudn't exist

2/ /lib/modules/2.6.31-gentoo-r6/k10temp and this file should be in its proper place

try that :

```

mkdir -p /lib/modules/2.6.31-gentoo-r6/kernel/drivers/hwmon

mv /lib/modules/2.6.31-gentoo-r6/k10temp.ko /lib/modules/2.6.31-gentoo-r6/kernel/drivers/hwmon

depmod -a -F /lib/modules/2.6.31-gentoo-r6/build/System.map 2.6.31-gentoo-r6

```

----------

## dman777

my apologies, i put those there manually to try and get modprobe to see the module. i did what you stated before to no success. however, i did what you stated again and ran depmod and had success. before i didn't run depmod, so i guess that was the problem.

thank you,

-dman

----------

