LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-17-2007, 10:23 PM   #1
der_11
Member
 
Registered: Jun 2007
Location: Canada
Distribution: Slackware 12.0, Fedora 7
Posts: 40

Rep: Reputation: 15
Using a custom kernel


I have just compiled a custom kernel for my personal use and so far I have it running from the /boot directory in my Xubuntu root partition.

I have partitioned my system as so:

/dev/hda1 swap 1Gb
/dev/hda2 ext2 30Gb (Xubuntu)
/dev/hda3 ext2 15Gb (Debian)
/dev/hda4 ext2 15Gb (Slackware)

The problem is they all run off of a different kernel. What I would like is to have each distro run off the kernel I compiled. I just have no idea on how to accomplish this.

I'm using the grub boot loader. If that makes a difference.

Thanks in advance.
 
Old 07-17-2007, 10:35 PM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
IIRC a kernel knows what the root filesystem is from the environment that it was compiled in so you probably can't use the same kernel file to boot each distro. You should be able to take the .config file and use it to build a kernel in each of the distros that you have installed. Then you just need to add the entries to grub so they can be booted.
 
Old 07-17-2007, 11:32 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
It would be easier to do that if you had a common /boot partition. However, you could alter your menu.lst file for the other distro's so that they use the same kernel and initrd file.

Change the entries from something like this:
Code:
title openSUSE 10.2 - 2.6.18.8-0.5
    root (hd0,4)
    kernel /boot/vmlinuz-2.6.18.8-0.5-default root=/dev/hda5 vga=791 nolapic resume=/dev/hda2 splash=silent showopts elevator=
    initrd /boot/initrd-2.6.18.8-0.5-default
To something like this:
Code:
title openSUSE 10.2 - 2.6.18.8-0.5
    root (hd0,4)
    kernel (hd0,2)/boot/vmlinuz-2.6.18.8-0.5-default root=/dev/hda5 vga=791 nolapic resume=/dev/hda2 splash=silent showopts elevator=
    initrd (hd0,2)/boot/initrd-2.6.18.8-0.5-default
That way, the kernel will be loaded from the partition on /dev/hda3 even though the root directory is on /dev/hda5 (in this hypothetical example). If the boot directory is mounted on its own partition, then the entries would look more like:
Code:
title openSUSE 10.2 - 2.6.18.8-0.5
    root (hd0,4)
    kernel (hd0,2)/vmlinuz-2.6.18.8-0.5-default root=/dev/hda5 vga=791 nolapic resume=/dev/hda2 splash=silent showopts elevator=
    initrd (hd0,4)/initrd-2.6.18.8-0.5-default
Also, only run grub-config when using the same distro. That way you don't keep changing the MBR and using a different menu.lst file. You can cut & paste the menu.lst sections you need from the other disto's to the /boot/grub/menu.lst file that you use, and then edit the kernel & initrd entries.
 
  


Reply

Tags
kernel



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating custom headers to match a custom kernel utanja Debian 2 06-08-2007 03:15 PM
Custom kernel image on custom slack build using CUSS nykey Slackware 2 07-15-2006 03:05 AM
Kernel-Patch Debian Logo 2.6.2 not correctly working for custom kernel 2.6.11 smp deepclutch Debian 3 06-27-2005 03:59 AM
New FAQ topic: Should I edit my kernel configuration?/Should I build a custom kernel? chort *BSD 10 09-10-2004 11:15 PM
Slackware 10, custom 2.6.7 kernel, lilo, loads kernel very slowly entropyv Slackware 3 08-19-2004 06:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:50 PM.

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