LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-25-2010, 02:41 PM   #1
kakaburra
LQ Newbie
 
Registered: Feb 2009
Distribution: Slackware 13.0 x86_64
Posts: 12

Rep: Reputation: 0
can kernel from one o.s be used as is in another?


Can linux kernel from one O.S (say Fedora) be used in another (say Slackware) without any changes?

because Slackware doesn't provide latest kernel packages and I've never compiled kernel before
 
Old 01-25-2010, 02:53 PM   #2
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
Technically: 'sort of'.

My suggestion, assuming you want to use your fedora kernel configuration in your slackware OS, would be to copy your kernel .config file from fedora, over into the freshly extracted kernel sourcecode which you (should) have on your slackware system, and recompile the kernel.
This will eliminate the need for you to wholly configure the entire kernel by hand, if that's what you're trying to avoid.

So:
1) extract a fresh kernel sourcecode archive in /usr/src/whatever on Slackware.
2) get your .config file from your fedora kernel, and stick it into the new folder where your slack kernel source just got extracted to.
3) enter the folder, and do "make" and "make modules_install" and then copy the brand new kernel image into /boot and run your LILO or GRUB configuration as required.

POTENTIAL PROBLEMS:
1) If the fedora kernel is patched (or broken) in such a way that the .config file and a vanilla kernel source, do not like each other, then you will want to use a fedora kernel source instead of a vanilla kernelk source from kernel.org.

AS AN EXAMPLE:

I just installed Gentoo last night. When I got to the part where it wanted me to install and build my kernel, I did precisely what I suggested you to do; I copied my kernel config file from my Slackware OS, over into a freshly extracted kernel source on the new Gentoo install, and did "make" and "make modules_install".

Hope this helps!

Sasha
 
Old 01-25-2010, 03:01 PM   #3
kakaburra
LQ Newbie
 
Registered: Feb 2009
Distribution: Slackware 13.0 x86_64
Posts: 12

Original Poster
Rep: Reputation: 0
@GrapefruiTgirl

Thanks, but can I just copy-paste the Fedora kernel and boot Slackware from it? Will it work??
 
Old 01-25-2010, 03:21 PM   #4
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
Hmmm.
Well.. If you copy the kernel bzimage, AND the /lib/modules/$(uname -r) folder, and put them in place in the Slackware system... And execute `depmod -A` .... And configure the bootloader.. Well, it should work.. It isn't really much different than installing a default Slackware kernel instead.

I'm not giving you any guarantee because this really is not normal, particularly the part about the kernel coming from Fedora. But try it and see! Worst case scenario: It won't boot, and you'll need to boot up using your Slackware CD -- no big deal.

May I ask though, WHY do you exactly wish to do this? What is so desirable about the Fedora kernel in question?

Sasha
 
Old 01-25-2010, 03:32 PM   #5
ricstirato
Member
 
Registered: Jan 2004
Location: Gießen, Germany
Distribution: Xubuntu 12.04, Mythbuntu, Ubuntu Server 12.04
Posts: 174

Rep: Reputation: 24
You would at least need the kernel itself, the according directory under /lib/modules, probably the initrd.
Then edit your [grub|lilo] configuration to boot the kernel.
During boot, pray that the initrd of Fedora (and maybe from a different machine) will work with Slackware on your desired machine.
After successful boot, pray that Slackware does not expect certain kernel patches fedora does not have, and that Fedora does not have any patches conflicting with whatever you run on Slackware ...

Why do you want latest version? Doesn't Slackware provide security updates? Is there any hardware support missing? Or is it just because it's there?

In short: if you are afraid of compiling your own kernel (which is in fact really simple and well documented), keep your fingers off things that are definitely not clearly documented anywhere.
 
Old 01-25-2010, 03:32 PM   #6
kakaburra
LQ Newbie
 
Registered: Feb 2009
Distribution: Slackware 13.0 x86_64
Posts: 12

Original Poster
Rep: Reputation: 0
@GrapefruiTgirl

Hmm.. I'll try it in virtualbox. Well, nothing special about Fedora kernel except that its 2.6.31.*. I just wanted a quick way to get new kernel without the time-consuming compilation.
 
Old 01-25-2010, 03:42 PM   #7
kakaburra
LQ Newbie
 
Registered: Feb 2009
Distribution: Slackware 13.0 x86_64
Posts: 12

Original Poster
Rep: Reputation: 0
@ricstirato
Thanks..

Quote:
Originally Posted by ricstirato View Post
Why do you want latest version? Doesn't Slackware provide security updates? Is there any hardware support missing? Or is it just because it's there?
Well, i couldn't read temperature sensors. That bug was fixed in 2.6.31.*
 
Old 01-25-2010, 03:51 PM   #8
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
That's something I totally neglected to consider: an initrd, if there is one.
I don't use them, so if the fedora kernel is configured to use one, you will need that too as mentioned above. And yes, cross your fingers!!

I think that unless you are on a really slow machine, you could have compiled a kernel by now but I am curious to see if this works for you, so good luck!

Sasha
 
Old 01-25-2010, 03:58 PM   #9
kakaburra
LQ Newbie
 
Registered: Feb 2009
Distribution: Slackware 13.0 x86_64
Posts: 12

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by GrapefruiTgirl View Post

I think that unless you are on a really slow machine, you could have compiled a kernel by now but I am curious to see if this works for you, so good luck!

Sasha
Since I've never compiled a kernel before, I need to figure it out, and it will take time.. ... i'll certainly try that, thanks..
 
Old 01-25-2010, 08:35 PM   #10
jefro
Moderator
 
Registered: Mar 2008
Posts: 15,374

Rep: Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198
"A new kernel" ???

What is wrong with the old one?

As above building your own from sources like possible Gentoo or Linux from scratch will provide the most exact kernel for your situation.

Distro's tend to be good for many people. Distro's offer a way to keep packages and dependency's closely matched. A kernel will not simply allow you to have the latest whatever by itself.

Your question almost can't be answered. Both yes and no may be correct. We'd need to know much more about this to be sure. It could be that a generic kernel could be swapped and work.

From Slackware.
"There are two kinds of kernels in Slackware -- the huge kernels, which
contain support for just about every driver in the Linux kernel. These are
primarily intended to be used for installation, but there's no real reason
that you couldn't continue to run them after you have installed. The
other type of kernel is the generic kernel, in which nearly every driver
is built as a module. To use a generic kernel you'll need to build an
initrd to load your filesystem module and possibly your drive controller
or other drivers needed at boot time, configure LILO to load the initrd at
boot, and reinstall LILO. See the docs in /boot after installing for more
information. Slackware's Linux kernels come in both SMP and non-SMP types
now. The SMP kernel supports multiple processors, multi-core CPUs,
HyperThreading, and about every other optimization available. In our own
testing this kernel has proven to be fast, stable, and reliable. We
recommend using the SMP kernel even on single processor machines if it
will run on them."

Last edited by jefro; 01-25-2010 at 08:40 PM.
 
Old 01-26-2010, 10:16 AM   #11
kakaburra
LQ Newbie
 
Registered: Feb 2009
Distribution: Slackware 13.0 x86_64
Posts: 12

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by jefro View Post
"A new kernel" ???

What is wrong with the old one?
well, as I said earlier, the old one has a bug which is fixed in the new one...
 
  


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
upgrading Fedora Core 3 kernel 2.6.9-1.667 to 2.6.26.3 manually+kernel panic error LinuxLovinNoob Linux - Newbie 7 12-17-2008 09:45 PM
LXer: Howto: build Linux kernel module against installed kernel w/o full kernel source tree LXer Syndicated Linux News 0 09-03-2006 09:21 PM
Kernel 2.4 in Zipslack (Waring: unable to open an initial console | Kernel Panic...) kurtamos Linux - General 2 05-10-2006 01:58 PM
kernel includes at /usr/src/linux/include do not match current kernel. blanny Red Hat 1 03-09-2006 08:53 AM
Kernel-Patch Debian Logo 2.6.2 not correctly working for custom kernel 2.6.11 smp deepclutch Debian 3 06-27-2005 04:59 AM


All times are GMT -5. The time now is 09:59 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration