LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 11-29-2019, 09:48 AM   #1
mra90
LQ Newbie
 
Registered: May 2019
Posts: 15

Rep: Reputation: Disabled
Question KBUILD_MODNAME - how is it set?


Hi,

I noticed "lspci -v" shows module/driver names that doesn't exist in the module source code. I have figured out that these names are registered via "__pci_register_driver(driver, THIS_MODULE, KBUILD_MODNAME);"
And here is my question, how and where is KBUILD_MODNAME assigned with proper name?

I grep for KBUILD_MODNAME in the module source directory and I found it is being assigned to proper name in some .cmd file but these I created after compilation. So where is it done in the first place?

Thanks
 
Old 12-02-2019, 11:25 AM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,153

Rep: Reputation: 1265Reputation: 1265Reputation: 1265Reputation: 1265Reputation: 1265Reputation: 1265Reputation: 1265Reputation: 1265Reputation: 1265
The command line when compiling the module will define the name with "-DKBUILD_MODNAME=xxxxx" where the xxxxx comes from the basename of the module. It's set by one of the kernel build scripts, I think here:

https://elixir.bootlin.com/linux/v3....ile.build#L189
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
'KBUILD_MODNAME' undeclared (first use in this function) fachryonline Linux - Software 1 08-04-2015 09:47 PM
error: ‘KBUILD_MODNAME’ undeclared in function ‘pci_register_driver’ amio.praba@gmail.com Linux - Embedded & Single-board computer 0 06-30-2008 02:31 AM
xfree86 set to 0. It should be set to -10. jimsac Linux - Newbie 0 05-22-2004 06:08 AM
How to view set-user-ID and set-group-ID Xris718 Linux - General 7 01-10-2004 01:44 PM
How to set PATH How do I set PATH environment variable? Tranquil Linux - Newbie 3 11-02-2003 02:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 02:27 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration