Gentoo Archives: gentoo-user

From: Zac Medico <zmedico@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] How does Portage prioritze emerges in emerge world?
Date: Sat, 26 Nov 2005 16:09:57
Message-Id: 438886D7.3050201@gmail.com
In Reply to: [gentoo-user] How does Portage prioritze emerges in emerge world? by Holly Bostick
1 Holly Bostick wrote:
2 > OK, I take it back.
3 >
4 > I said that the situation of upgrading a kernel with the 'symlink' USE
5 > flag active occurring at the same time as a (particular) program needing
6 > to compile against a configured kernel was not likely to occur all that
7 > often, but I was wrong. It's happened again today, but with a different
8 > program than the ones I normally keep an eye on.
9 >
10 > The good thing is that I (think I) see what the problem is.
11 >
12 > The problem is that Portage emerges the new kernel before (almost)
13 > everything else, without regard for whether the 'symlink' USE flag is
14 > active, and whether or not any of the other programs proposed to emerge
15 > need to compile against a configured kernel source-- or rather, the
16 > currently-running kernel, which the symlink most likely pointed to
17 > before Portage changed it via a previous emerge.
18 >
19 > Honestly, there's really no reason (that I can see) to emerge a kernel
20 > source before everything else, since the kernel source is useless until
21 > at the very least configured, and preferably compiled and installed, and
22 > since you're in the middle of an emerge -uwhatever world, you can't
23 > reasonably configure and compile the new source until the entire
24 > operation is finished. Yeah, OK, technically you can, but it's not
25 > really something that an ordinary person would do, I think.
26
27 I like to manage the kernel sources myself so I always keep a kernel package in package.provided.
28
29 mkdir -p /etc/portage/profile
30 echo sys-kernel/gentoo-sources-2.6.14-r3 >> /etc/portage/profile/package.provided
31
32 >
33 > And if the 'symlink' USE flag is active, emerging the kernel sources
34 > before everything else-- which may include packages that must compile
35 > against a configured kernel, with the assumption that the
36 > /usr/src/symlink points to such a kernel, which it no longer does
37 > because the symlink has been changed during a previous emerge and you
38 > have not had time to configure the newly-emerged kernel-- is a real
39 > problem. I just had to open another term, su to root, run MC to change
40 > the symlink-- and got it wrong because I had a second unconfigured
41 > kernel (2.6.14-r2; 2.6.14-r3 was being installed) that I forgot I had
42 > not yet upgraded to), so had to change the link again to the *real*
43 > running kernel (2.6.14) and emerge --resume. And of course I'll have to
44 > eventually change the symlink back manually in order to actually manage
45 > the new kernel. Which means I have to remember to do that-- which is not
46 > the point of having the 'symlink' USE flag active.
47 >
48 > It seems to me that this could all be avoided if Portage emerged a new
49 > kernel *last* in the list if the 'symlink' USE flag is active for kernel
50 > emerges-- then everything in the list that needed a configured kernel
51 > would have one (the currently-running kernel), the emerge would complete
52 > normally, and the symlink would be changed at the end of the procedure
53 > so that my next operation could be to upgrade the kernel, which seems to
54 > me a reasonable and ordinary order of operation (emerge -u** world, then
55 > configure and compile new kernel and run module-rebuild).
56 >
57 > Am I doing things wrong, or is this a valid enhancement request for b.g.o?
58 >
59 > Holly
60
61 The portage developers will not add a special case for kernel packages, so any reordering/prioritization would have to be done in a generic way that is usable for any type of package. Also, it seems desireable to compile against the latest kernel that is installed.
62
63 Perhaps it would make sense to have a default kernel config that is used to configure the kernel sources automatically (make oldconfig; make modules_prepare) after a new kernel is installed? Something like this could be done ebuild postinst phase (when symlink is created). It is planned for future versions of portage to have pre/post phase hooks, which will allow users to define actions such as this via /etc/portage/bashrc:
64
65 http://thread.gmane.org/gmane.linux.gentoo.portage.devel/1107
66
67 Zac
68 --
69 gentoo-user@g.o mailing list

Replies

Subject Author
Re: [gentoo-user] How does Portage prioritze emerges in emerge world? Holly Bostick <motub@××××××.nl>