Hello, Freeman Zhang. copying 'Module.symvers' to sculld folder solved the problem. Thank you, man. Now I wonder what is the proper way to export "Module.symvers" information to the outside so that modules that use it do not have to copy that file into their directory. for example, what do pci and usb buses do in this case?
On Sun, Mar 12, 2017 at 09:42:36PM +0330, Ali Aminian wrote:
Hello, Freeman Zhang. copying 'Module.symvers' to sculld folder solved the problem. Thank you, man.
Now I wonder what is the proper way to export "Module.symvers" information to the outside so that modules that use it do not have to copy that file into their directory. for example, what do pci and usb buses do in this case?
'depmod' handles all of this when you install a kernel and its modules. hope this helps, greg k-h
Hi Greg, On 3/13/17 3:03 AM, Greg KH wrote:
'depmod' handles all of this when you install a kernel and its modules.
Thanks for that information, now I take 'depmod' seriously and stop making up inelegant methods. I studied the 'kmod', both its behaviors and codes, and got plenty of ideas about module symbol stuff. However, I am still wondering why copy Module.symvers file works too, at building time?
step 1. build lddbus, generate `*.ko` and `Module.symvers` step 2. copy `Module.symvers` located in lddbus directory to sculld directory step 3. build sculld
All the best! Freeman
On Mon, Mar 13, 2017 at 12:19:58PM +0800, Freeman Zhang wrote:
Hi Greg,
On 3/13/17 3:03 AM, Greg KH wrote:
'depmod' handles all of this when you install a kernel and its modules.
Thanks for that information, now I take 'depmod' seriously and stop making up inelegant methods. I studied the 'kmod', both its behaviors and codes, and got plenty of ideas about module symbol stuff.
However, I am still wondering why copy Module.symvers file works too, at building time?
Because that is what depmod creates, you probably didn't change much, if anything, from the kernel version you copied it from. But don't do that, it is probably wrong. thanks, greg k-h
<snip>
Now I wonder what is the proper way to export "Module.symvers" information to the outside so that modules that use it do not have to copy that file into their directory.
If you use a top-level Makefile like the one below it will create the necessary Module.symvers file. I am not sure if this is the correct or recommended way, I had kernel modules in separate directories a long while back when I was learning+testing and this worked for me. obj-m := lddbus/ sculld/ KERNELDIR ?= /lib/modules/$(shell uname -r)/build PWD := $(shell pwd) all: $(MAKE) -C $(KERNELDIR) M=$(PWD) modules clean: $(MAKE) -C $(KERNELDIR) M=$(PWD) clean Hope this helps - Aruna
participants (4)
-
Ali Aminian -
Aruna Hewapathirane -
Freeman Zhang -
Greg KH