# external kernel modules access violation with >2.6.18 kernel

## Gentree

Mod edit: Changed title from nvidia-driver fails to compile on recent kernels.

Please see external kernel modules sandbox violation with >2.6.18 kernels for more info. --kallamej

nvidia-driver fails to compile on recent kernels >=2.6.18-rc6

this includes 2.6.18-mm3 and apparently 2.6.19-rc1

trivial two line patch to fix, so let's get this one early.

http://www.nvnews.net/vbulletin/attachment.php?s=0befb9b966b12e1f512385d2f79b5d7e&attachmentid=20931&d=1160297597

 :Cool: 

----------

## kfiaciarka

I use gentoo-sources-2.6.18 (final) and there is no problem with nvidia here  :Smile: 

----------

## Gentree

that's correct the problems starts in mm sources as I indicated above. Vanilla will be affected in 2.6.19 as also stated.

----------

## 0x001A4

so how does one go about applying this on their system?

----------

## Telexen

I use mm-sources 2.6.18-mm3 and it's got a problem with both the 88.74's and 96.25's. I'm terrible with portage overlays, maybe someone can provide us with an ebuild to apply this patch.

----------

## Bigun

 *0x001A4 wrote:*   

> so how does one go about applying this on their system?

 

Ditto, it's not everyday I apply diff patches

----------

## davlinx

I'd also appreciate tips for how to apply patches. I'm new to Gentoo, and desperately trying to get a new Core2Duo system (Asus P5B with Jmicron) running.  Got to the stage where VESA works, but I really want NVIDIA.

----------

## davlinx

Can anyone give tips on how to apply such patches please?  I'm still struggling here. I am using the 2.6.18-mm3

kernel as it is the only one I have found to solve the famous Jmicron problems on an Asus P5B. (2.6.18 final

didn't work for my setup). Thanks

----------

## kernelOfTruth

another solution for the not so experienced would be

```
FEATURES="-sandbox" emerge nvidia-drivers 
```

 kernel-build howto by Digital Hermit 

----------

## davlinx

Just saying thanks for trying to help now. I had to rebuild my system before trying this, and am still having problems, but will see if our local guru can help before posting details.  Will report back later with success/failure details.

----------

## Unlucky_Alf

New 9631 drivers should fix this. http://www.nvidia.com/object/linux_display_ia32_1.0-9631.html

----------

## bincache

Trying vanilla-sources-2.6.19 with nvidia-drivers-1.0.9631 I still get a sandbox access violation

9631-pkg0/usr/src/nv/nvidia.o /var/tmp/portage/x11-drivers/nvidia-drivers-1.0.9631/work/NVIDIA-Linux-x86-1.0-9631-pkg0/usr/src/nv/nvidia.mod.o

NVIDIA: left KBUILD.

>>> Source compiled.

--------------------------- ACCESS VIOLATION SUMMARY ---------------------------

LOG FILE = "/var/log/sandbox/sandbox-x11-drivers_-_nvidia-drivers-1.0.9631-17832.log"

open_wr:   /usr/src/linux-2.6.19/astest18126.out

open_wr:   /usr/src/linux-2.6.19/astest18130.out

open_wr:   /usr/src/linux-2.6.19/astest18137.out

open_wr:   /usr/src/linux-2.6.19/astest18141.out

--------------------------------------------------------------------------------

----------

## reub2000

Not working for me either. I'm using 2.6.19-ck2.

----------

## kernelOfTruth

try that one:

http://dev.gentoo.org/~dsd/genpatches/trunk/2.6.19/2900_astest-sandbox.patch

----------

## SKab

 *kernelOfTruth wrote:*   

> another solution for the not so experienced would be
> 
> ```
> FEATURES="-sandbox" emerge nvidia-drivers 
> ```
> ...

 

 :Smile:  This fixed my astest problem whit nvidia.

----------

## bincache

I tried the patch above but it does not exist.

Like many others I've resorted to using FEATURES="-sandbox"

but this isn't really a fix.

After all, the sandbox is there for our protection, disabling it isn't really a good thing.

Even if it is just disabled for one ebuild.

----------

## kernelOfTruth

```
Index: linux-2.6.19/scripts/Kbuild.include

===================================================================

--- linux-2.6.19.orig/scripts/Kbuild.include

+++ linux-2.6.19/scripts/Kbuild.include

@@ -66,9 +66,11 @@ as-option = $(shell if $(CC) $(CFLAGS) $

 # as-instr

 # Usage: cflags-y += $(call as-instr, instr, option1, option2)

 

-as-instr = $(shell if echo -e "$(1)" | $(AS) >/dev/null 2>&1 -W -Z -o astest$$$$.out ; \

+as-instr = $(shell if echo -e "$(1)" | $(AS) >/dev/null 2>&1 -W -Z -o \

+         $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/)astest$$$$.out ; \

          then echo "$(2)"; else echo "$(3)"; fi; \

-              rm -f astest$$$$.out)

+              rm -f \

+         $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/)astest$$$$.out)

 

 # cc-option

 # Usage: cflags-y += $(call cc-option, -march=winchip-c6, -march=i586)
```

----------

