April 21, 2015, 10:34:07 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Visit our home page for VL info. To search the old message board go to The first VL forum is temporarily offline until we can find a host for it. Thanks for your patience.
Now powered by KnowledgeDex.
   Home   Help Search Login Register  
Please support VectorLinux!
Pages: [1]
Author Topic: VL6 Kernel compilation general question (and alsa driver especial)  (Read 2819 times)
Posts: 3

« on: June 09, 2009, 02:39:26 am »

Hi everybody,

I'm new to vectorlinux but have already some experience with linux.
I have some questions regarding kernel compilation within vectorlinux.
By the way I'm using VL6.0 light.

My goal is to add the magic SysRq feature and processor specific optimizations to my kernel.

Let's start with the generic questions:
1) What is the /usr/src/build- directory for?
It seems to me that it's use is to patch a vanilla kernel for use within VL.
But when I only want to change some features from the delivered kernel it should be O.K. to work inside the /usr/src/linux- directory. This sources should already include all patches and adaptions for VL.
Is this right or am I wrong?

2) When do I need to recompile the kernel modules?
I've read that there is a kind of compatibility layer which allows to link modules to newer kernels - which of course works only up to a certain amount and of course only when the processor type (for example x86) remains the same.

My question targets more to the goal I've described above:
When I only add or remove some kernel features and activate processor specific optimizations (for example target processor PII) will I need to recompile the kernel modules?
I've tried to install only the recompiled kernel without new modules and the new kernel seemed to be happy with the original (old) VL kernel modules.
Is there a kind of rule when I can keep the old modules?

Now the specific question:
When I compiles and installed the new kernel and modules it worked quite well with one exception:
my soundcard refuses to work.
There are no error messaged during boot time - even ALSA tells [OK] during boot process.
But as soon as I start an audio app (for example alsamixer) I get an error message: snd_ctl_open error: no such file or directory. I'm also missing the devices /dev/snd and /dev/pcm
As soon as I switch back to the original kernel (and modules) the sound is O.K. again (I've installed both kernels by the way).

Here are the steps I've taken to build and install my custom kernel:
  • installed the kernel sources from cd for kernel
  • made a #chown -R MYUSERNAME /usr/src/linux-
  • switched to MYUSER and dived into /usr/src/linux-
  • entered $make menuconfig
  • activated the Magic SysRq feature, changed the target processor and made a local apped "rb" to have the new and the original kernels
  • entered $make
  • waited quite long
  • changed to root
  • entered #make modules_install
  • installed the new kernel by with #cp arch/i386/boot/bzImage /boot/vmlinuz- and #cp boot/
  • added the new kernel to /etc/lilo.conf
  • updated lilo by entering #lilo

Seems that the alsa drivers need to be compiled somehow else - but how?
Normally alsa is included in the 2.6x kernel as far as I know.
During my kernel make only the module soundcore.ko is built.
What's the missing step?
The only thing I've seen is that only sound support is activated as module in the kernel config untility (based on the original VL kernel config). The alsa and oss drivers are not activated.
How were the sound drivers been built for the original VL kernel?

I've already searched the whole forum a couple of times but only found that there once was a how-to for VL kernel compilation which isn't there anymore.
I've already tried to relink the symbols vmlinuz and in /boot to the new kernel which was mentioned in the forum as solution for a sound problem after kernel compilation. But it didn't help for me.

Sorry for this bunch of questions but I suppose others are interested too.
Thanks a lot in advance!!
« Last Edit: June 09, 2009, 02:46:42 am by bootcommander » Logged
Posts: 20

« Reply #1 on: June 09, 2009, 03:22:00 pm »

Hello, i too had troubles with alsa after recompiling the kernel, i solved it by reinstalling all alsa-packs in gslapt, try that, good luck!
Posts: 3

« Reply #2 on: June 11, 2009, 12:10:57 pm »

Hi everybody,

thanks for your reply OldNoob!
I've tried your recommendation. Unfortunately it didn't work  Sad

But I found an answer to my question #2: when do I need to recompile the kernel-modules and when can I keep the old modules:

Recompilation of the kernel-modules is only required
  • when the target processor familly completely changes. This means if you change from x86 to ARM you'll need (of course) to recompile. Not so quite clear: if you change from a newer x86 derivate to a older x86 derivate you'll also need to recompile. To give an example: if the modules have been compiled for an PIV an should be used on a 486 you'll need to recompile the modules. Reason: the old processor does not support some machine codes only the newer one has
  • when the kernel interface has changed from one kernel to another you'll also need to recompile the kernel modules.

There are interesting things you can learn from this:
  • If you have compiled the modules for a 486 and want to run it on a PIV optimized kernel you could keep the modules!! Of course you'll lose the optimizations.
  • If you have kernel modules from an older (for example predecessor) kernel and the interface has not changed since, you can also use these kernel modules. However you have to force the use of the modules by entering modprobe -f mymodulesname. Otherwise modprobe will complain.
    This is the actual case which is true for my kernel: I have appeded a localversion to the (very same) kernel and have optimized the kernel for a PII. This means I have a different x86 processors for the kernel and the (sound)-modules.

What I did now is
  • I've copied the sound-modules from the original kernel-modules to my kernel-modules (because these modules have not been built by the makefile - see my first post).
  • I entered depmod as root to build the module dependencies.
When I now do a modprobe snd_es1938 (my sounddriver) I get an error message "Invalid module format" due to the localversion mismatch => The modules are not loaded => I've no sound.
When I enter a modprobe -f snd_es1938 the modules get loaded and my sound works!!!! Great thing  Cheesy

This means: if I had not appended a localversion to the kernel I would not have the problems I have now.

Here's the reference if you want to dive in further:

So the following question remain:
- what is the /usr/src/build- directory for?
- how have the alsa drivers been build for the original kernel. They're not active in the original kernel config file!! So they must have been build somehow else! I've not yet figured out how.
Posts: 2504

« Reply #3 on: June 11, 2009, 02:17:01 pm »

So the following question remain:
- what is the /usr/src/build- directory for?
- how have the alsa drivers been build for the original kernel. They're not active in the original kernel config file!! So they must have been build somehow else! I've not yet figured out how.
the /usr/src/build- dir is just another way to build the kernel.

the alsa drivers are built with the alsa-driver source code.
Posts: 3

« Reply #4 on: June 12, 2009, 09:37:51 am »


once again news:
I've figured it finally out, how to get the sound working.
Here's what I had to do additionally to kernel compilation as descibed in my first post:

  • Start the system with the new kernel
  • change as root into directory /usr/doc/alsa-driver-1.0.19
  • start the script #sh alsa-driver.SlackBuild
  • wait a little
  • now you'll find the packaged alsa-driver in the directory /usr/doc. It's named alsa-driver- in my case. The name varies with the locale you appended to the kernel.
  • now just install the drivers with installpkg alsa-driver-

Now you should have working sound. At least it worked for me!

The reason why I had no sound after compiling and installing my kernel is, that the alsa drivers are not built when you build a new kernel based on the VL6.0 kernel-config. Only basic sound support (soundcore.ko) for external drivers is built by the VL6.0 kernel-config.
The alsa drivers have to be built seperate and that's what the script does.

That's it so far.

Cheers bootcommander  Cheesy
Pages: [1]
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!