Re: Loading modules

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



KERNELPTR := /lib/modules/$(shell uname -r)/build
KERNELSRC := $(shell if [ -e $(KERNELPTR) ]; then echo $(KERNELPTR); fi)
ifeq ($(KERNELSRC),)
$(error $(KERNELPTR) not found)
endif
PWD := $(shell pwd)
INSTALLDIR := /lib/modules/$(shell uname -r)/FOLDERNAME
TARGETS = load1.ko load2.ko

all:
        $(MAKE) -C $(KERNELSRC) SUBDIRS=$(PWD) modules

install: all
        $(INSTALL) -d $(INSTALLDIR)
        $(INSTALL) -m 0744 $(TARGETS) $(INSTALLDIR)
        $(DEPMOD) -a

Try loading them this way. If that does not work, can you use insmod instead?

Dinesh

Kamal gupta wrote:
I did create the makefile like that. Then I copied my *.ko files to /lib/modules/KERNEL_VERSION/kernel.. but when I tried to run "depmod -a", I am getting this (Loop detected) error. If, I dont run depmod before modprobe then modprobe cant able to find that module. Am I missing something ?

On 7/6/07, *Dinesh* <dbhat@xxxxxxxxx <mailto:dbhat@xxxxxxxxx>> wrote:

    You will have to specify the following in the Makefile to enforce
    dependency.

    obj-m := load1.o load2.o

    You do not have to club all of the code into one main file for this
    thing. You should be fine using a Makefile.

    Dinesh


    Kamal gupta wrote:
     > Hi
     >
     > How can we load files that are interdependent upon each other. I am
     > using modprobe but it fails saying LOOP DETECTED. Do I need to
    club all
     > of my code in one file or there is some alternative ?
     >
     > Thanks in advance
     > --
     > Kamal Kant Gupta



    --
    To unsubscribe from this list: send an email with
    "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
    <mailto:ecartis@xxxxxxxxxxxx>
    Please read the FAQ at http://kernelnewbies.org/FAQ




--
Kamal Kant Gupta



--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux