View previous topic :: View next topic |
Author |
Message |
braver n00b

Joined: 29 Dec 2006 Posts: 28
|
Posted: Sat Jan 13, 2007 3:14 am Post subject: telling portage about a manually installed kernel |
|
|
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 |
|
 |
M1Sports20 Apprentice

Joined: 25 Mar 2004 Posts: 194 Location: Chicago, IL
|
Posted: Sat Jan 13, 2007 5:21 am Post subject: |
|
|
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 |
|
 |
kraix Tux's lil' helper

Joined: 20 Jun 2005 Posts: 93
|
Posted: Sat Jan 13, 2007 5:30 am Post subject: |
|
|
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 |
|
 |
whig l33t

Joined: 27 Nov 2004 Posts: 973 Location: New Zealand
|
Posted: Sat Jan 13, 2007 5:54 am Post subject: |
|
|
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 |
|
 |
Jake Veteran

Joined: 31 Jul 2003 Posts: 1132
|
Posted: Sat Jan 13, 2007 5:59 am Post subject: |
|
|
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 |
|
 |
madisonicus Veteran


Joined: 20 Sep 2006 Posts: 1130
|
Posted: Sat Jan 13, 2007 3:10 pm Post subject: |
|
|
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 |
|
 |
aidanjt Veteran


Joined: 20 Feb 2005 Posts: 1118 Location: Rep. of Ireland
|
Posted: Sat Jan 13, 2007 7:33 pm Post subject: |
|
|
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 |
|
 |
i92guboj Bodhisattva


Joined: 30 Nov 2004 Posts: 10315 Location: Córdoba (Spain)
|
Posted: Sat Jan 13, 2007 7:50 pm Post subject: |
|
|
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 |
|
 |
|