Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
telling portage about a manually installed kernel
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
braver
n00b
n00b


Joined: 29 Dec 2006
Posts: 28

PostPosted: Sat Jan 13, 2007 3:14 am    Post subject: telling portage about a manually installed kernel Reply with quote

I've patched, compiled and installed my own kernel outside portage. How do I tell portage to use its headers/modules? For instance, it thinks the source is still in /usr/src/linux, although it's now elsewhere for the running kernel -- and so emerge nvidia-drivers fails, for example.

This leads to two situations --

(a) there's a totall ymanually compiled and installed kernel -- how do I tell portage about it? (current)

(b) I'm going to build a new kernel myself, different from gentoo's -- how do I prepare it for an ebuild? (future)

Cheers,
Alexy
Back to top
View user's profile Send private message
M1Sports20
Apprentice
Apprentice


Joined: 25 Mar 2004
Posts: 194
Location: Chicago, IL

PostPosted: Sat Jan 13, 2007 5:21 am    Post subject: Reply with quote

First I believe /usr/src/linux should always be a symbolic link pointing to the directory where the kernel is install. For example,
ln -s /kernel/dir /usr/src/linux

then emerge nvidia-drivers should work as long as your kernel is setup for it

(b.) http://www.gentoo.org/proj/en/devrel/handbook/handbook.xml?part=2&chap=1
Back to top
View user's profile Send private message
kraix
Tux's lil' helper
Tux's lil' helper


Joined: 20 Jun 2005
Posts: 93

PostPosted: Sat Jan 13, 2007 5:30 am    Post subject: Reply with quote

sorry M1Sports but you got it backwards

Quote:


ln -s /kernel/dir /usr/src/linux




It should go the other way around if I am reading the man page correctly

Quote:

ln [options] source [dest]
ln [options] source... directory


EDIT:
Otherwise he is completely correct though. Just gave the ln command wrong, which i do all the time myself also.
Back to top
View user's profile Send private message
whig
l33t
l33t


Joined: 27 Nov 2004
Posts: 973
Location: New Zealand

PostPosted: Sat Jan 13, 2007 5:54 am    Post subject: Reply with quote

I have this in /etc/portage/profile/package.provided, if there's a better way I would like to know.
Code:
sys-kernel/linux-headers-2.6.16
sys-kernel/gentoo-sources-2.6.11-r6
sys-apps/i2c-2.8.7

(I run kernel.org 2.6.19 not .16 or whatever)
Back to top
View user's profile Send private message
Jake
Veteran
Veteran


Joined: 31 Jul 2003
Posts: 1132

PostPosted: Sat Jan 13, 2007 5:59 am    Post subject: Reply with quote

Making the /usr/src/linux symlink will fix driver builds, but Portage still won't know about your kernel and will probably try to upgrade/install gentoo-sources. I believe the correct way to manually maintain a package is to unmerge the Portage version and add entries in package.provided and package.mask, although this probably isn't what you want to do. Portage just installs kernel sources for you. It's actually easier to use Portage than to do it completely manually. If you don't want the Gentoo patches, use sys-kernel/vanilla-sources. If you want something like mm, ck, or xen, they're all in Portage too.

Usually what I do for the symlink is keep my sources in /usr/src and make a relative link
Code:
# cd /usr/src/
# rm linux
# ln -s linux-2.6.xx.yy linux

For headers, use the version provided by Gentoo. Kernel headers are supposed to match the version of glibc built against them, not the currently installed kernel. As for what version to put in package.provided, if I haven't convinced to just use Portage, I would think the version you actually have installed would be best.
Back to top
View user's profile Send private message
madisonicus
Veteran
Veteran


Joined: 20 Sep 2006
Posts: 1130

PostPosted: Sat Jan 13, 2007 3:10 pm    Post subject: Reply with quote

Jake wrote:
Making the /usr/src/linux symlink will fix driver builds, but Portage still won't know about your kernel and will probably try to upgrade/install gentoo-sources.
Just add the -symlink USE flag, then portage wont touch your /usr/src/linux symlink.

-m
_________________
Please add [SOLVED] to your message title if you feel that your question has been answered.
------
Intel Q9300 Core2 Quad * Gigabyte GA-EP35C-DS3R
Samsung x360
AMD64 x2 4200+ * TF7050-M2 * HTPC
ZOTAC ION A-U Mini-ITX * HTPC
Back to top
View user's profile Send private message
aidanjt
Veteran
Veteran


Joined: 20 Feb 2005
Posts: 1118
Location: Rep. of Ireland

PostPosted: Sat Jan 13, 2007 7:33 pm    Post subject: Reply with quote

That's the problem, he didn't emerge *-sources, so portage doesn't know about it. Creating a symlink to the current sources will fix the problem for now, but any driver package you try to emerge will pull in current *-sources (varies depending on your profile).

If you want to go about writting your own ebuild for your flavour of sources, I suggest cracking open the ones already in portage to get an idea of how they work, and read up on this http://www.gentoo.org/proj/en/devrel/handbook/handbook.xml?part=2.
Back to top
View user's profile Send private message
i92guboj
Bodhisattva
Bodhisattva


Joined: 30 Nov 2004
Posts: 10315
Location: Córdoba (Spain)

PostPosted: Sat Jan 13, 2007 7:50 pm    Post subject: Reply with quote

As already suggested, it would be best to use portage to install vanilla-sources, they are unpatched, so you can apply any desired patch manually. If you need a concrete version, and the ebuild is not in portage, just copy one to an overlay. If you dont want to upgrade any further, mask all versions >sys-kernel/vanilla-sources-<your desired version> in package.mask.

I cant think of any reaon to download and manage it manually.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum