LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
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 09-07-2012, 02:41 AM   #1
Alpha90
Member
 
Registered: Jul 2012
Posts: 45

Rep: Reputation: Disabled
Question Question about old added kernel modules when compiling a new kernel


Dear LinuxQuestions

I have a debian squeeze 6.0.5 distro which came with kernel 2.6.32 which left me with some incompatible hardware such as my sound and tuner card. Thinking I could fix the problem with a simple patch I downloaded a newer version of alsa and compiled it and added it into my kernel module and then I had sound. However I found my tuner card would not work at all with my kernel version but it would work with a newer version so I backported 3.2 onto my system which did not fix the problem as I found. After some research I discovered I would have to venture out of my distro's repository and seek to compile the kernel directly. I am just about to start that project however i have one hiccup that I need to fix. When i shutdown i notice a bunch of errors now that my system log just does not seem to log and furthermore they display oddly. The errors come out in a stairstep fashion such as.
error
error
error
error
error err
or error ..... etc.
All error messages point to kernel modules snd_"Something" such as snd_virtuoso which is the chip of my sound card hence my memory.

I did nothing to actually take the old modules out and i am pretty new to linux but very technical minded so I dont actually know if i need to do something to unload the old modules. Furthermore if i do not could having compiled and installed the sound subsystem have left behind erratic flotsam in my system. Modules duplicated by being integrated into the newer kernel that i am using rendering them basically trash. Or could i completely be on the wrong line of thinking
 
Old 09-10-2012, 12:28 AM   #2
deadeyes
Member
 
Registered: Aug 2006
Posts: 605

Rep: Reputation: 78
First I would always recommend using a precompiled kernel. Isn't there any fresher one out there?(maybe not in stable branch)

Also, when you update your kernel, the new modules will be placed in another directory.
/lib/modules/<kernel version>

So these won't give conflicts.

An issue might be the mix from the alsa version and kernel version.
 
Old 09-10-2012, 04:55 PM   #3
Alpha90
Member
 
Registered: Jul 2012
Posts: 45

Original Poster
Rep: Reputation: Disabled
Why shouldn't you compile a kernel yourself? I thought most pre-compiled kernels were bloated.
 
Old 09-11-2012, 08:35 AM   #4
sundialsvcs
Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 5,330

Rep: Reputation: 1100Reputation: 1100Reputation: 1100Reputation: 1100Reputation: 1100Reputation: 1100Reputation: 1100Reputation: 1100Reputation: 1100
Whether you compile it yourself or not, it is imperative that all of the available kernel-modules must be known to be compatible with it.

If you do compile your own kernel, I recommend the following procedure:
  1. Make a copy of the hidden .config file as a non-hidden, dated file in a subdirectory of /root. Write-protect the file after you have created it. Each time you recompile your kernel or make any changes, repeat this procedure. Never over-write any copy that you have made, even if you determine it was in error. (Rename erroneous files appropriately, but keep them.)
  2. Preserve the .config file: mv .config kernel_config (The temporary-name is unimportant ...)
  3. make distclean (This will destroy .config.)
  4. Rename it back, as a hidden file: mv kernel_config .config
  5. make && make modules && make install (or whatever build-sequence is called for)
  6. Explicitly check both the kernel directory and the modules directory to be sure that all files are recently-dated as expected.
  7. Make an entry, with a number-two pencil, in the loose-leaf notebook that you always keep beside the computer.

Remember that kernel modules are part of the kernel once they are loaded. Although version-guard checks do exist, you must not rely upon them completely.
 
Old 09-12-2012, 05:47 AM   #5
deadeyes
Member
 
Registered: Aug 2006
Posts: 605

Rep: Reputation: 78
Quote:
Originally Posted by Alpha90 View Post
Why shouldn't you compile a kernel yourself? I thought most pre-compiled kernels were bloated.
The kernel is bloated in a way that it has modules for almost everything.
However the kernel has loadable modules support.
So if you don't need a module, it will not be loaded.

Support is also easier to get when you are using your distros kernel.
More people have the same kernel so if you have issues they might already be documented.

You might think you will gain performance, however I doubt in most setups this "gain" will be noticeable and worth the effort(depending on the goal and your experience with linux).

Of course you can go with compiling a kernel. I am using Gentoo and do it all the time.
 
Old 09-12-2012, 09:04 AM   #6
sundialsvcs
Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 5,330

Rep: Reputation: 1100Reputation: 1100Reputation: 1100Reputation: 1100Reputation: 1100Reputation: 1100Reputation: 1100Reputation: 1100Reputation: 1100
To elaborate slightly ...

When a "stock" kernel is booting, first it "sort of comes halfway-up," far enough to unpack the contents of the "initial ram-disk," mount it under a minimal contrived shell, and let it run a bunch of hardware-discovery scripts provided by the distro vendor. These scripts select which loadable kernel modules to load, to support whatever hardware it detects. The loaded kernel, therefore, is not really so "bloated," but you still wind up having a bunch of kernel modules lying around. (Hey, if your computer happens to have a DECSystem token-ring card installed, your kernel is ready to use it! "On sale today!" )

You can, if you choose, determine what that set of modules turned out to be, and compile them into a customized kernel. You can also query the actual characteristics of your CPU, motherboard devices, and so on, and compile the kernel with options that are specific to that. Having done this, you can actually eliminate entirely the "halfway house."

The question is ... do you want to bother? Sure, it can be fun to have a system that boots in eleven seconds flat ... as mine (Gentoo) in fact do. But, most of my Linux systems remain booted for literally months at a time. The time it takes to reboot, therefore, is inconsequential to me. (Unless, of course, I can manage to get it down to ten seconds ... hmmm ... hackahackahackahack ... )

Last edited by sundialsvcs; 09-12-2012 at 09:06 AM.
 
Old 09-13-2012, 03:03 PM   #7
Alpha90
Member
 
Registered: Jul 2012
Posts: 45

Original Poster
Rep: Reputation: Disabled
Well my primary reasoning for wanting to compile my own kernel other than to fix my issue with alsa is to start to learn some of the mechanics behind optimizing a kernel with the hopes of building linux from scratch and possibly eventually write kernel modules. I did notice that taking verbose notes of all the changes i made was so useful in debugging a mistake i made
 
  


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
Compiling new kernel. What about new modules? checkmate3001 Linux - Kernel 4 01-25-2009 04:31 PM
compile kernel modules without compiling new kernel mariogarcia Linux - Kernel 1 06-01-2007 05:33 AM
/lib/modules/2.4.33.3/kernel/sound folder is missing after compiling kernel Paulo Ges Slackware - Installation 2 04-15-2007 08:42 PM
Modules in Kernel Compiling SlackwareInAZ Slackware 1 07-29-2005 05:10 AM
Compiling Modules for 2.6.6 kernel! Bigg Mike Linux - Newbie 9 06-09-2004 09:04 PM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration