LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 03-16-2008, 03:55 AM   #1
botzkoz
LQ Newbie
 
Registered: Mar 2008
Posts: 6

Rep: Reputation: 0
Multiple kernels with different modules


Hi all,

I need multiple linux kernels, but for all kernel I want to have different modules.

When I try to recompile my original kernel (of Slackware 12) I change some exclude some modules and make some changes in the kernel. After that reboot with new kernel, but it stuck . I try to reboot with original one but there ware errors (missing or invalid modules).

I reinstall Slackware and try to change only the type of the CPU and recompile only the kernel (no module changes). After reboot with new kernel I receive some errors and modules (of the original kernel) was not loaded.

So I need to have different kernels with different modules. Please tell me how to compile new kernel with it's own modules?
 
Old 03-16-2008, 09:36 AM   #2
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: Tupelo, MS
Distribution: Gentoo
Posts: 6,926

Rep: Reputation: 124Reputation: 124
Welcome to LQ!

You didn't state how/where you rebuilt your kernel.

Follow my Kernel Rebuild Guide this time.

If you wish to start with the Slackware kernel configuration options,
and just change some of them, cp that configuration file to the
path of your new kernel source, such as:
Code:
cp /usr/src/linux-2.6.21.5/.config /home/mingdao/kernel/linux-2.6.24.3/
then run "make xconfig" and make your changes, save the file, then finish
following that guide.
 
Old 03-16-2008, 10:03 AM   #3
raskin
Senior Member
 
Registered: Sep 2005
Location: Russia
Distribution: NixOS (http://nixos.org)
Posts: 1,893

Rep: Reputation: 68
I assume you used menuconfig, right?
First, do not forget to add distinct local suffix to each uild, so its module directory is distinct from all the others. Second, for a life with much less problems, if you are not experienced with kernel builds, find out what modules are loaded on your machine, check web for wat modules are needed to recognize your HDD/mount your root FS (they are at the ottom of the list) and compile them into the kernel. Distribution provides initrd with each kernel, and that ramdrive has all the drivers needed (and it is loaded by GRUB using BIOS calls). But surely initrd drivers match shipped kernel, but fail to load if you replace the kernel.It would be OK once you mount root FS and get to use /lib/modules, but you need to access HDD for that. You can start reading /documentation on initrd/initramfs now, but do use distriution default (and ignore any errors with module loading) until you are absolutely sure that the kernel is built right.
 
Old 03-16-2008, 10:15 AM   #4
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: Tupelo, MS
Distribution: Gentoo
Posts: 6,926

Rep: Reputation: 124Reputation: 124
To clarify what raskin said, if you use the same kernel version,
then you will have to append a local version to the kernel. Look
in /lib/modules/ and you will see something like:
Code:
mingdao@silas:~$ ls -l /lib/modules/
total 16
drwxr-xr-x 3 root root 4096 2008-02-11 08:02 2.6.23.15/
drwxr-xr-x 3 root root 4096 2008-03-15 18:43 2.6.23.15-smp/
drwxr-xr-x 3 root root 4096 2008-03-15 17:11 2.6.24.2/
drwxr-xr-x 3 root root 4096 2008-03-15 19:18 2.6.24.3/
Those are different kernels that have their own set of modules.
Since there are two 2.6.23.15 kernel versions, you see one of
then has a local version of -smp appended to it.

I'd recommend getting the latest stable kernel source from kernel.org
and either building it yourself, or starting with the .config file
from your present working kernel as stated above. Also build your new
kernel under your users /home/<username> directory.

If you rebuilt the kernel that your OS came with, and did not append
a local version string, you have written over the modules and now you
will need to fix that.
 
Old 03-16-2008, 10:45 AM   #5
botzkoz
LQ Newbie
 
Registered: Mar 2008
Posts: 6

Original Poster
Rep: Reputation: 0
Ok, but how to add local version to the kernel - just to copy original one i new directory with name something like "linux-2.6.21.5_local", or I can add some additional parameter to make bzImage?

10x for your answers .
 
Old 03-16-2008, 11:47 AM   #6
botzkoz
LQ Newbie
 
Registered: Mar 2008
Posts: 6

Original Poster
Rep: Reputation: 0
Ok, I think I found it (General setup->Local version)
 
Old 03-16-2008, 07:26 PM   #7
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: Tupelo, MS
Distribution: Gentoo
Posts: 6,926

Rep: Reputation: 124Reputation: 124
Yes, go to the "Local version - append to kernel release (LOCALVERSION)" and press enter,
then it will allow you to type the name you want to append to your local version. You need
not enter a - or _ as the kernel will put the - there for you.
 
  


Reply

Tags
kernel, modules, multiple


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
Modules & custom kernels adrianlarsson Linux - Newbie 2 01-17-2007 01:03 PM
Linux kernels and modules issue snalion Linux - Newbie 3 09-23-2006 05:41 PM
2 kernels 1 set of lib/modules?? fred22 Linux - General 2 02-24-2005 02:31 AM
/etc/modules when booting multiple kernels cbirdlinux Linux - General 2 07-22-2004 05:57 PM
Modules and 2.6test kernels rch Linux - General 3 11-11-2003 09:39 PM


All times are GMT -5. The time now is 10:12 PM.

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