# FATAL: Kernel Too Old

## bluepass

Hey guys,

I'm hoping someone can help me out with this because it's giving me headaches. I've tried searching for an answer everywhere I could, but I found no solution.

Basically, I have a Gentoo 2.6 system installed in a VirtualBox machine. I intend to use the virtual machine for kernel modification/testing - that aspect is not important right now. The kernel I will be working on is the 2.4.30 I believe and it is the vanilla kernel. After going through a lot of trouble configuring and compiling this kernel, I booted into it and I receive the error:

 *Quote:*   

> FATAL: kernel too old
> 
> Kernel panic: Attempted to kill init!

 

I wasn't entirely sure of it, but reading through other posts of similar issues I came up with the conclusion that my toolchain was not able to work with the 2.4 kernel, so I added the "old-linux" USE flag and rebuilt the system on the working 2.6 Gentoo kernel. On top of that I used gcc-3.4.6 to compile - I know the kernel doesn't support gcc4, so I thought the safest way to go was using gcc-3.4 for the toolchain as well. But that still failed.

I have no idea what to do now so I'm asking the Gentoo gurus what's there that I can do to solve this problem? Do I have to start with a stage1 tarball? Is there an issue running 2.6 and 2.4 on the same system? Do I need different partitions for the different kernels? Please let me know how I can solve this issue.

Thanks in advance.

----------

## sera

2.4.30 is heavily outdated use 2.4.37.7 instead, get it from kernel.org.

 *2.4.source wrote:*   

> "GCC >= 4.2 miscompiles kernel 2.4, do not use it!"

  So 4.1 should be fine.

----------

## bluepass

Yes, I'm sorry, you're right - I was using vanilla-sources-2.4.37 and gcc-2.4.6.

Are you sure GCC 4.1 will work without issues? I thought they required some antique version of GCC to compile the 2.4 kernel.  :Smile: 

I'm going to give that a try right now, but I really doubt it is a compiler issue.

----------

## sera

 *bluepass wrote:*   

> Yes, I'm sorry, you're right - I was using vanilla-sources-2.4.37 and gcc-2.4.6.
> 
> Are you sure GCC 4.1 will work without issues? I thought they required some antique version of GCC to compile the 2.4 kernel. 

 

Isn't  3 years old antique enough?

 *Quote:*   

> I'm going to give that a try right now, but I really doubt it is a compiler issue.

 

Glibc is compiled against kernel headers. A fatal mismatch cause the error you see.

----------

## bluepass

Does that mean that I should symlink /usr/src/linux to the vanilla-sources-2.4.37 directory so that GCC grabs the headers from 2.4 as opposed to 2.6?

Could you be more specific in terms of what I need done? Right now my system is set up with gentoo-sources-2.6.* and the symlink is pointing to that. Are there any USE flags I should use asides from "old-linux" and "vanilla"?

Thanks for the help so far.

----------

## Cacklesmatter

 *bluepass wrote:*   

> Does that mean that I should symlink /usr/src/linux to the vanilla-sources-2.4.37 directory so that GCC grabs the headers from 2.4 as opposed to 2.6?
> 
> Could you be more specific in terms of what I need done? Right now my system is set up with gentoo-sources-2.6.* and the symlink is pointing to that. Are there any USE flags I should use asides from "old-linux" and "vanilla"?
> 
> Thanks for the help so far.

 

I'm confused. Are you building everything from your 2.6 box for your 2.4 vm? If so, won't it compile everything against your 2.6 headers?

----------

## bluepass

No - both kernels are running in the VM.

Inside 2.6 I'm building 2.4. The VM will dual boot between the two. 2.6 will be the development environment, while 2.4 is what is being tested.

I hope this clears it up.

----------

## sera

The confusion comes from your target not making a lot of sense. It's possible but why would you want that??

Best check some 2.4 to 2.6 upgrade guides. There should be still many left on the Internet. Then apply what's said there in the reverse direction.

Also you will most likely have to hack the init system if you want to dualboot using the same rootfs, /sys comes to mind.

----------

## LesCoke

would he want to use the cross compile method?  I think that would solve the header issue, he would be compiling against target headers instead of the native ones.

Otherwise, is there a mirror with old 2.4 portage?  how many packages have stopped supporting 2.4 kernels?

Les

----------

## sera

 *LesCoke wrote:*   

> would he want to use the cross compile method?  I think that would solve the header issue, he would be compiling against target headers instead of the native ones.
> 
> Otherwise, is there a mirror with old 2.4 portage?  how many packages have stopped supporting 2.4 kernels?
> 
> Les

 

It's hard to comment on that as I believe he doesn't want what he believes he wants. The purpose is far from clear with just knowing "for tests".

And yes userspace brings it's own complication with it.

----------

## lopb

Hi, 

      I have an old module for a 2.2 kernel, and i have no sources, is for an special card. What i need is to try load it in the 2.4.

I have the 2.4kernel compiled with 3.3gcc, butt i have this problem KERNEL IS TOO OLD

Is there a way to fix it?

thanks

----------

## NeddySeagoon

bluepass,

You will need to use devfs or a static /dev. udev will not work on a 2.4 kernel.

devfs was removed at 2.6.13

----------

## Mad Merlin

If you really want to play around with such an ancient kernel, I'd suggest you accompany it with suitably old userspace too. You can pull a portage snapshot out of CVS from say... 2005 or so, many of the required distfiles will be gone from the mirrors though, so you'll have to search for them. There should be similarly aged stage3 snapshots archived which you can do a fresh (stale) install from as well.

Here's the portage CVS: http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/

----------

## lopb

Hi, i did not try with the CVS yet

What i did was to emerge devfs with linux-kernel-headers 2.4 and re emerge sysvinit

And i still have the same problem

Any other ideas?

thanks a lot!

----------

## lopb

It's wotking 2.4 kernel on gentoo

thanks for ur help!

----------

