# Why linux-2.6.20 - 21 can't compile any more? ACUTE TROUBLE!

## yendy

I had reliable configuration of wlan-ng (together with gentoo-sources-2.6.21) on my box for 2 or more years but after recent 'emerge system' everything stoped working  :Sad:  The modules could't load, so at first I tried to re-compile the kernel. 

But the second grim surprise was the kernel consistently failed to compile. Switching (gcc-config) among all 3  versions of gcc present on my system turned out to be irrelevant. So I thought sources were spoiled and wanted to re-emerge the kernel. NO WAY! The ebuild was previously marked as stable but now "gentoo-sources-2.6.21 ebuild does not exist"! 

Problem is, wlan-ng can only cooperate with kernel versions 2.6.20 - 2.6.21, so I looked up for the other ebuild from within this range. The only one I found was unstable gentoo-sources-2.6.20-r10. I emerged it, did 'make oldconfig' etc. and started to compile, and... THE SAME linux shame!!! It again can not compile, the same ugly problem and no remedies could help:

```
11:00:18 linux # make -j2

  CHK     include/linux/version.h

  CHK     include/linux/utsrelease.h

  CC      scripts/mod/empty.o

  HOSTCC  scripts/mod/mk_elfconfig

  HOSTCC  scripts/kallsyms

  MKELF   scripts/mod/elfconfig.h

  HOSTCC  scripts/mod/file2alias.o

  HOSTCC  scripts/mod/modpost.o

  HOSTCC  scripts/mod/sumversion.o

scripts/mod/sumversion.c: In function 'get_src_version':

scripts/mod/sumversion.c:384: error: 'PATH_MAX' undeclared (first use in this function)

scripts/mod/sumversion.c:384: error: (Each undeclared identifier is reported only once

scripts/mod/sumversion.c:384: error: for each function it appears in.)

scripts/mod/sumversion.c:384: warning: unused variable 'filelist'

make[2]: *** [scripts/mod/sumversion.o] Error 1

make[1]: *** [scripts/mod] Error 2

make[1]: *** Waiting for unfinished jobs....

make: *** [scripts] Error 2

11:00:23 linux # ls -l linux

ls: cannot access linux: No such file or directory

11:00:41 linux # ls -l ../linux

lrwxrwxrwx 1 root root 23 May  7 10:59 ../linux -> linux-2.6.20-gentoo-r10

11:00:46 linux #
```

Of course, the other present in the Portage stable kernel versions compile smoothly. (So, why just THESE 2.6.20, 2.6.21 kernels can not???) But unfortunately these versions do not fall within range 2.6.20 - 21 as only workable with linux-wlan-ng-modules. (The ebuild "linux-wlan-ng-modules" refuses to be emerged neither with kernel 2.6.28 nor 2.6.16, both the stable ebuilds.)

I have usb wireless stick Prism2 that never complains under MS Windows, even a bit! So the more it is frustrating Gentoo failed so acutely...  :Sad: 

----------

## Hu

You are no longer able to compile a userspace helper program, because it does not properly include the headers it needs.  I suspect a glibc upgrade trimmed the set of implicitly included headers, which caused this tool to break.  It was already fixed in newer versions.  However, since it ships with the kernel, you are using an old and still broken version.  It looks like a simple fix, if you want to patch the source file to make it work.  Based on the commit message, I suspect that commit fc31c771 fixes your problem.

There are various reasons you should upgrade your kernel anyway.  Is there no way to get support for your wireless device in newer kernels?

----------

## yendy

 *Hu wrote:*   

> It looks like a simple fix, if you want to patch the source file to make it work.  Based on the commit message, I suspect that commit fc31c771 fixes your problem.

 

Thank you very much! But how best to apply this fix? As usual patch? I never used such fixes so far... (Never had to.)

 *Hu wrote:*   

> There are various reasons you should upgrade your kernel anyway.  Is there no way to get support for your wireless device in newer kernels?

 In the kernel version 2.6.28 there is an option "STAGING DRIVERS" (I could misquote a little) where I found wlan-ng, but it didn't work. Maybe I did something wrong but it is not documented in any way. (I treated it as a replacement of linux-wlan-ng-modules, the external prism_usb and/or wlan modules provider so far, but leaving other linux-wlan-ng-...  ebuilds intact, e.g. linux-wlan-ng-firmware etc., together with the previous configuration files, scripts. When loaded it hangs the system... Maybe somebody knows how to use these 'staging drivers'? They need some external userspace programs and firmware, don't they?)

 *Hu wrote:*   

> I suspect a glibc upgrade trimmed the set of implicitly included headers, which caused this tool to break.

 

BTW, first of all why was the problem of loading modules, that made me touch kernel sources at all? Something has changed radically after the last 'emerge system'... Was it the migration from /etc/modules.d to /etc/modprobe.d? Could it be the case?  As the remedy would you recommend simply to move all files from /etc/modules.d to /etc/modprobe.d?

----------

## Hu

Yes, feeding that change to patch should work.  The file is relatively unchanged over time, so the hunk still matches.

I do not use that wireless device, so I cannot comment on the appropriate way to get it working.

I am not quite sure what module loading problem you mean.  The failure came while building a shipped tool that make decided needed to be built or rebuilt.  I am not familiar with the wireless drivers you are using, so I cannot say why you need to build the kernel again, or even if you need to do so.

----------

## Simba7

Isn't there a MAJOR security problem with that series of kernel?

----------

## pappy_mcfae

Yes, there is a security issue with <2.6.22.19 or <2.6.22-gentoo-r10. I don't recommend anyone use anything less than those two kernel versions.

You can get ebuilds for older (dead) kernel versions here. If you wish to use the .22 headers, you can enter make headers_install in that source directory, and follow it up with emerge -av glibc. I don't see that causing any issues.

Blessed be!

Pappy

----------

## yendy

 *Hu wrote:*   

> I am not quite sure what module loading problem you mean.

 After the last doing "emerge system" (the first for 2-3 months) on the reboot no module was loaded! On the booting console there was series of error messages about not present modules etc... I like to have almost everything compiled into kernel's monolith so these missing modules didn't hurt too much, but I faced a new challenge anyway...

----------

## yendy

 *pappy_mcfae wrote:*   

> Yes, there is a security issue with <2.6.22.19 or <2.6.22-gentoo-r10. I don't recommend anyone use anything less than those two kernel versions.

 

Excuse me but I'm little confused how you mean "less than"... Do you mean versions within the same slot 2.6.22 ??  So, the versions like 2.6.20 or 2.6.21 are ok?

If not, please say sth more about the seriousness of the threat?

----------

## sera

modules don't load: Have you maybe disabled auto loader support in your kernel?

I had a prism2 or 2.5 many years back. Used the HostAP driver with 2.4 and 2.6 kernels. Was probably the most popular wlan driver ever.

----------

## pappy_mcfae

 *yendy wrote:*   

>  *pappy_mcfae wrote:*   Yes, there is a security issue with <2.6.22.19 or <2.6.22-gentoo-r10. I don't recommend anyone use anything less than those two kernel versions. 
> 
> Excuse me but I'm little confused how you mean "less than"... Do you mean versions within the same slot 2.6.22 ??  So, the versions like 2.6.20 or 2.6.21 are ok?
> 
> If not, please say sth more about the seriousness of the threat?

 

Yes. It's called the root exploit, and it was fixed with 2.6.22.19 and 2.6.22-gentoo-r10. Any other unpatched kernel versions <2.6.22.19 or <2.6.22-gentoo-r10 are vulnerable to this issue. There is a patch that is readily available. I'm not quite sure about the seriousness of the issue, but NeddySeagoon is. 

Blessed be!

Pappy

----------

## yendy

 *sera wrote:*   

> modules don't load: Have you maybe disabled auto loader support in your kernel

 No, this was definitely not the case. I touched kernel at all only afterwards.

 *sera wrote:*   

> I had a prism2 or 2.5 many years back. Used the HostAP driver with 2.4 and 2.6 kernels. Was probably the most popular wlan driver ever.

 

But please take the notion quoted below, taken from the link above: *Quote:*   

> Native PCI cards using Prism2.5/3 are also supported, but USB cards based on
> 
> Prism2.5/3 chipset are not supported in this version.

 

Yes, I have USB stick.

----------

