Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
SpaceferretOffline
Post subject: RE: nividia-kernel-source does not build with 38-kernel  PostPosted: 17.03.2011, 04:53



Joined: 2010-09-13
Posts: 97

Status: Offline
I'm using towo's kernel and it works like charm,towo is genius. towo for president !
 
 View user's profile Send private message  
Reply with quote Back to top
mirixOffline
Post subject: RE: nividia-kernel-source does not build with 38-kernel  PostPosted: 17.03.2011, 15:07



Joined: 2010-10-25
Posts: 28

Status: Offline
Someone has requested from me to explain how I built a custom aptosid kernel. I think it is a good idea. Mostly because of two reasons:

1. Even if the aptosid documentation is excellent, things not always work by the book.

2. Most likely, there are better ways to do it that the one I found and therefore the developers can suggest how to do things in a more proper way.

OK, let's see if I remember what I did. I followed these instructions:

http://www.aptosid.com/index.php?module ... osidKernel

However, as mentioned, not everything worked as expected (most likely due to my lack of knowledge and expertise, also keep in mind that I use the amd64 version which is typically more troublesome):

1.- As root, edit your /etc/apt/sources.list.d/aptosid.list and remove the # in front of the line saying:

      Code:
deb-src http://aptosid.com/debian/ sid main fix.main


Then as root update your apt:

      Code:
 apt-get update


2. Cd to /usr/src and grab the source:

      Code:
 apt-get source linux-image-2.6-aptosid-$arch


(replace $arch with the arch you actually want, in my case amd64)

NOTE: In order to work in /usr/src you should be either a member of the src group (recommended) or root (not recommended). If you make yourself a member of src, you will need to to log out for the changes to take effect. I personally use sudo (not recommended)

This will download and decompress several files. Right know this should result in a directory called linux-aptosid-2.6-2.6.38.

NOTE: The sid and aptosid repos are very dynamic entities. Eventually downloading may fail or not give the expected results. In such a case, the solution is retrying later.

3. As root, install the needed files:

      Code:
apt-get install fakeroot build-essential devscripts libncurses5 libncurses5-dev
apt-get build-dep linux-2.6


4. Then I tried to build the kernel, but, apparently, there is a problem with the development versions of binutils. Bugs are reported for 2.21.0.20110302-1, but in my experience the current 2.21.0.20110302-2 also gives troubles.

I downloaded the stable version from here http://ftp.gnu.org/gnu/binutils/binutils-2.21.tar.bz2, decompressed it and installed by the usual ./configure, make, sudo make install.

NOTE: You can skip this step and check if kernel building works for you.

5. Cd into /usr/src/linux-aptosid-2.6-2.6.38

NOTE: If you wish, you can create a symbolic link called /usr/src/linux pointing to /usr/src/linux-aptosid-2.6-2.6.38

6. Now you can apply the patches you need or revert the patches that are harmful for you. In my case:

      Code:
patch -Rp1 < debian/patches/features/bkl/0019-BKL-That-s-all-folks.patch


The BKL headers are needed to compile the Nvidia drivers 260.19.44 and so I reverted the patch that removes them.

7. At this stage I tried to build the official kernel package, for me:

      Code:
cp /boot/config-2.6.38-0.slh.2-aptosid-amd64 .config


NOTE: This assumes you have the kernel package installed from the repos. The config file from 2.6.37 does not work with 2.6.38

      Code:
fakeroot make -f debian/rules.gen binary-arch_amd64_none_aptosid-amd64


However, this complains about a non-empty thing (I do not remember very well ) and suggests running "make mrproper"

I did that, which resulted in the debian directory being deleted. Therefore, this method is not going to work for me anymore.

8. I switched to the classic method:

      Code:
make mrproper
cp /boot/config-2.6.38-0.slh.2-aptosid-amd64 .config
make menuconfig


(in processor type and blah-blah-blah I chose the processor type "core 2 or newer Xenon" and saved the new config file)

      Code:
sudo fakeroot make-kpkg --append-to-version "-core2-aptosid" --us --uc --initrd kernel_image kernel_headers


NOTE: Apparently this is deprecated, but I do not know better. This works anyway.

9. And we install the packages:

      Code:
cd..
sudo dpkg -i linux-headers-2.6.38-core2-aptosid_2.6.38-core2-aptosid-10.00.Custom_amd64.deb linux-image-2.6.38-core2-aptosid_2.6.38-core2-aptosid-10.00.Custom_amd64.deb


NOTE: In my case the VirtualBox module was rebuilt automatically because I had installed dkms. However, keep in mind that dkms is not installed by default in aptosid.

10. I rebooted but X did not start because I had blacklisted nouveau and configured nvidia. I installed the Nvidia proprietary driver and rebooted. All was working fine.

NOTE: Keep in mind that now it is recommended to create /etc/X11/xorg.conf.d/20-nvidia.conf rather than /etc/X11/xorg.conf. This is explained here: http://manual.aptosid.com/en/gpu-en.htm

Then people ask me about performance and so on. I have no clue. I have not done any benchmarking and I "feel" no difference between aptosid with the standard kernel 2.6.37 and the custom 2.6.38 I built.

NOTE: I had already applied the Lennart Poettering method to 2.6.37 (alternative/complementary to the Mike Galbraith 200-lines "doing wonders" script).


ERRATA: I believe muchan is absolutely right. I have created a src directory in my home directory and did the compilation from there. Everything works and you don't need to be root at all until the final installation step (dpkg -i).


UPDATE: For the aptosid kernel 2.6.38-3 the location of the bkl patch has changed. If you need to revert the patch you should now run:

      Code:
patch -Rp1 < /home/mirix/src/linux-aptosid-2.6-2.6.38/debian/patches/features/linux-2.6/bkl/0016-BKL-That-s-all-folks.patch



[Edit by BelaLugosi: Just added some codeboxes to make it more readable]


Last edited by mirix on 18.03.2011, 15:54; edited 5 times in total
 
 View user's profile Send private message  
Reply with quote Back to top
frapelliOffline
Post subject: Re: RE: nividia-kernel-source does not build with 38-kernel  PostPosted: 17.03.2011, 15:09



Joined: 2011-01-09
Posts: 11

Status: Offline
      Spaceferret wrote:
I'm using towo's kernel and it works like charm,towo is genius. towo for president !


How do you install towo's kernel?

Thanks
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
mirixOffline
Post subject: RE: Re: RE: nividia-kernel-source does not build with 38-ker  PostPosted: 17.03.2011, 17:05



Joined: 2010-10-25
Posts: 28

Status: Offline
frapelli,

you download the kernel image and headers from there (amd64):

http://frickelplatz.de/debian/dists/uns ... 64/kernel/

or there (x86):

http://frickelplatz.de/debian/dists/uns ... 86/kernel/

and you install them with dpkg -i nameofthekernelimage.deb nameofthekernelheaders.deb

unless, of course, if you want to add the repos...
 
 View user's profile Send private message  
Reply with quote Back to top
muchan
Post subject:   PostPosted: 17.03.2011, 18:37
Moderator


Joined: 2010-09-11
Posts: 468

      Quote:


2. Cd to /usr/src and grab the source:

      Code:

 apt-get source linux-image-2.6-aptosid-$arch


(replace $arch with the arch you actually want, in my case amd64)

NOTE: In order to work in /usr/src you should be either a member of the src group (recommended) or root (not recommended). If you make yourself a member of src, you will need to to log out for the changes to take effect. I personally use sudo (not recommended)


AFAIK, downloading directly to /usr/src and build there is not good.
I think it is the destination folder where headers should be installed from the header package
as the result of build+install.
Instead, you should download and build as user, in private directry, and only install it as root.

(But I'm not a kernel hacker, so leave the topic to people who knows more)
 
 View user's profile Send private message  
Reply with quote Back to top
Ilinsekt
Post subject:   PostPosted: 17.03.2011, 18:57



Joined: 2010-10-29
Posts: 43

Towo uploaded a new version of nvidia-kernel-source to frickelplatz, which builds against 2.6.38-aptosid. However, oxygen-gtk looks _really_ crappy with this driver version (260.xx with nvidia-kernel-source from towo, the rest from sid) I had 270.xx from frickel until now.
 
 View user's profile Send private message  
Reply with quote Back to top
Sprinter1Offline
Post subject:   PostPosted: 18.03.2011, 07:33



Joined: 2010-09-13
Posts: 17
Location: Hamburg
Status: Offline
towo now also have 270.xx on frickelplatz which build against 2.6.38. So no need to use 260.xx

Sprinter
 
 View user's profile Send private message  
Reply with quote Back to top
mirixOffline
Post subject:   PostPosted: 18.03.2011, 15:52



Joined: 2010-10-25
Posts: 28

Status: Offline
ERRATA: I believe muchan is absolutely right. I have created a src directory in my home directory and did the compilation from there. Everything works and you don't need to be root at all until the final installation step (dpkg -i).

UPDATE: For the aptosid kernel 2.6.38-3 the location of the bkl patch has changed. If you need to revert the patch you should now run:

patch -Rp1 < /home/mirix/src/linux-aptosid-2.6-2.6.38/debian/patches/features/linux-2.6/bkl/0016-BKL-That-s-all-folks.patch
 
 View user's profile Send private message  
Reply with quote Back to top
spacepenguinOffline
Post subject:   PostPosted: 18.03.2011, 18:21



Joined: 2010-09-11
Posts: 98
Location: Germany
Status: Offline
Thanks towo!

BTW: I don't think it's the right way to spoon-feed the nvidia users. I would rather change distribution than my graphics card if they don't harmonize... Nouveau by now is no option with KDE.

_________________
Susan | Hardware: SysProfile | 32bit
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
LatOffline
Post subject: Re: RE: nividia-kernel-source does not build with 38-kernel  PostPosted: 20.03.2011, 02:07



Joined: 2010-09-19
Posts: 166

Status: Offline
      mirix wrote:
4. Then I tried to build the kernel, but, apparently, there is a problem with the development versions of binutils. Bugs are reported for 2.21.0.20110302-1, but in my experience the current 2.21.0.20110302-2 also gives troubles.

I downloaded the stable version from here http://ftp.gnu.org/gnu/binutils/binutils-2.21.tar.bz2, decompressed it and installed by the usual ./configure, make, sudo make install.
this make install really worries me. The dpkg database doesn't know about this handmade install. One should try to get the debian source and substitute the source with the upstream source, leaving the debian folder untouched.

Also, I thought BKL was removed in 2.6.37. can someone explain me this?
 
 View user's profile Send private message  
Reply with quote Back to top
muchan
Post subject: RE: Re: RE: nividia-kernel-source does not build with 38-ker  PostPosted: 20.03.2011, 10:46
Moderator


Joined: 2010-09-11
Posts: 468

      Lat wrote:

Also, I thought BKL was removed in 2.6.37. can someone explain me this?

http://aptosid.com/index.php?name=PNphp ... =6285#6285
 
 View user's profile Send private message  
Reply with quote Back to top
mirixOffline
Post subject: RE: Re: RE: nividia-kernel-source does not build with 38-ker  PostPosted: 20.03.2011, 10:51



Joined: 2010-10-25
Posts: 28

Status: Offline
Lat, you are right. There are several solutions to that problem. I guess the easiest one would be downgrading binutils by configuring apt. The problem I see is that only 2.20 is available from the repos:

http://packages.debian.org/search?keywords=binutils

Yet another option would be building your own Debian packages from the 2.21 sources.
 
 View user's profile Send private message  
Reply with quote Back to top
frapelliOffline
Post subject:   PostPosted: 20.03.2011, 12:13



Joined: 2011-01-09
Posts: 11

Status: Offline
I have installed towo kernel, how can I prevent installation of new kernels in dist-upgrade?

In the manual I find:

echo package hold|dpkg --set-selections

I suppose it hold the old kernel, but does'nt stop installation of the new ones.

AND, in case, what am I supposed to write instead of "package"?

Thanks
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
mirixOffline
Post subject: RE: Re: RE: nividia-kernel-source does not build with 38-ker  PostPosted: 20.03.2011, 12:31



Joined: 2010-10-25
Posts: 28

Status: Offline
I have found a patch for binutils-2_21-branch (Debian-version: 2.21.0.20110302-1):

http://www.spinics.net/lists/linux-next/msg14159.html

https://patchwork.kernel.org/patch/621001/

I have not tried it and I don't know if it would be suitable to patch the 2.21.0.20110302-2 Debian sources...

But, I guess that, if it works, rebuilding the binutils package from patched Debian sources would be the best way to go.
 
 View user's profile Send private message  
Reply with quote Back to top
sunuOffline
Post subject: RE: Re: RE: nividia-kernel-source does not build with 38-ker  PostPosted: 20.03.2011, 14:01



Joined: 2010-09-11
Posts: 11

Status: Offline
Much simpler solution to all these:

http://www.nvnews.net/vbulletin/showthread.php?t=160714
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 12 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by Zafenio