LinuxQuestions.org
Visit Jeremy's Blog.
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 05-23-2006, 09:34 PM   #1
yhus
Member
 
Registered: May 2004
Posts: 75

Rep: Reputation: 15
kernel config


Hi,

How can I add a new module or submenu to kernel config menu? Do I need to modify Makefile or Config.in?

Thank you.

Jim
 
Old 05-23-2006, 10:03 PM   #2
perfect_circle
Senior Member
 
Registered: Oct 2004
Location: Athens, Greece
Distribution: Slackware, arch
Posts: 1,783

Rep: Reputation: 53
what exactly do you mean by adding?
have you created a new module or do you want to compile a standard kernel module that was disabled in your old kernel?
 
Old 05-23-2006, 10:33 PM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
I ran
make cloneconfig
make oldconfig
to generate a new .config file.

Then I noticed this in the Makefile
Code:
# Read in dependencies to all Kconfig* files, make sure to run
# oldconfig if changes are detected.
-include .kconfig.d

include .config

# If .config needs to be updated, it will be done via the dependency
# that autoconf has on .config.
# To avoid any implicit rule to kick in, define an empty command
.config .kconfig.d: ;

# If .config is newer than include/linux/autoconf.h, someone tinkered
# with it and forgot to run make oldconfig.
# If kconfig.d is missing then we are probarly in a cleaned tree so
# we execute the config step to be sure to catch updated Kconfig files
$(objtree)/include/linux/autoconf.h: .kconfig.d .config
        $(Q)mkdir -p include/linux
        $(Q)$(MAKE) -f $(srctree)/Makefile silentoldconfig
else
# Dummy target needed, because used as prerequisite
$(objtree)/include/linux/autoconf.h: ;
endif
I also looked in the kernels Documentation directory:
/usr/src/linux-2.6.16.13-4/Documentation/kbuild/modules.txt
/usr/src/linux-2.6.16.13-4/Documentation/HOWTO
/usr/src/linux-2.6.16.13-4/Documentation/kernel-docs.txt

After running "make pdfdocs"
/usr/src/linux-2.6.16.13-4/Documentation/DocBook/kernel-hacking.pdf

Be sure to work in a copy of the kernel source before you do your hacking. However, why not look at how ndiswrapper or nvidia produces externel loadable modules in the /lib/modules/ tree if your kernel module could be a loadable module using the standard kernel.

I hope I made at least some sense.
 
Old 05-23-2006, 10:49 PM   #4
yhus
Member
 
Registered: May 2004
Posts: 75

Original Poster
Rep: Reputation: 15
I have a new device driver module and I want to add it as SUPPORT_MY_NEW_DEVICE_DRIVER to the kernel config menu. By running make menuconfig, it displays existing modules and submenus. I can select or remove modules by keys, but how can I add a new module SUPPORT_MY_NEW_DEVICE_DRIVER to the menu?

Thanks.

Jim
 
Old 05-24-2006, 01:25 AM   #5
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Running "make oldconfig" will prompt for new items in the kernel. Then subsequently when you run "make xconfig" those items will show up.

What you need to do to get these items to show up when you run "make oldconfig" are explained on page 23 of the kernel_hacking.pdf document I mentioned in my previous post.

For most device modules, I still think that an external build process, such as nvidia and ndiswrapper uses to build a kernel module without the need to recompile the kernel is a better way to go. What kind of device is this for?

Last edited by jschiwal; 05-24-2006 at 01:38 AM.
 
Old 05-24-2006, 06:49 AM   #6
yhus
Member
 
Registered: May 2004
Posts: 75

Original Poster
Rep: Reputation: 15
After looking at kernel structure, I guess that kernel 2.6 is now using Kconfig (equivalent to Config.in in kernel 2.4, right??) for module / menu configuration. New modules should be added to Kconfig, is it correct?

Thank you.

Jim
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Can't run kernel config after APT kernel install rollo Debian 9 04-12-2006 05:06 PM
Kernel Config 2.6.x ewt3y Linux - Newbie 3 08-16-2005 06:29 AM
INFO: creating a special secured kernel (grsecurity kernel patch) w sysctl config markus1982 Linux - Security 0 05-25-2003 05:29 AM
I lost rmed my kernel config file. Anyway to create one from the kernel? severedhead Linux - Software 3 07-12-2002 07:54 PM
Kernel config G_dive23 Linux - General 1 02-07-2002 07:28 PM

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

All times are GMT -5. The time now is 08:16 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