1 |
Hi, |
2 |
|
3 |
[ I have discussed this with johnm on IRC but we didn't really come to a |
4 |
conclusion, so I'm posting here in hope of hearing other opinions too ] |
5 |
|
6 |
We have two new eclasses in the tree: linux-mod and linux-info. |
7 |
|
8 |
linux-mod relies upon and uses lots of linux-info and I think we've done a |
9 |
good job of making module installation smooth with that. |
10 |
|
11 |
I was under the impression that linux-info was designed to provide things like |
12 |
kernel version info and config checking to ebuilds - $KV is currently defined |
13 |
by portage, but we want to stop portage doing this, and have it done through |
14 |
an eclass. |
15 |
|
16 |
Currently, pretty much any function in linux-info relies on you having called |
17 |
the get_version so that it goes and looks at /usr/src/linux and parses the |
18 |
version info, etc. linux-mod handles this for you automatically. |
19 |
|
20 |
For ebuilds that directly inherit linux-info in order to get this kind of info |
21 |
(i.e. excluding the ones that go through linux-mod), 99.9% of them are going |
22 |
to need to call the "get_version" function from in that ebuild. |
23 |
|
24 |
So I think it makes much more sense for that to be called from an exported |
25 |
pkg_setup() in linux-info.eclass so that ebuilds do not have to worry. There |
26 |
are a few reasons for this: |
27 |
- Less work to do when converting all the ebuilds |
28 |
- Less confusion for people writing new ebuilds who aren't sure of what |
29 |
"get_version" does or who don't know that it makes things like ${KV_FULL} |
30 |
available |
31 |
- ${KV} was previously available hassle-free through portage and I think we |
32 |
should keep it as close to this as possible |
33 |
- I don't feel it makes _sense_ for the ebuild to have to call that function |
34 |
when its implied usage is to provide version info anyway, and there really |
35 |
aren't any other sensible uses. |
36 |
|
37 |
I think we should add a pkg_setup to linux-info.eclass which calls get_version |
38 |
which simply prepares variables such as $KV_FULL (2.6.10-rc3) and $KV_OUT_DIR |
39 |
(/usr/src/linux). Any ebuild inheriting this eclass directly is going to want |
40 |
to use those variables. |
41 |
(We will have to make sure this pkg_setup is not exported/executed if |
42 |
linux-mod has been inherited since linux-mod exports its own functions - but |
43 |
this is another issue that I think we can take care of fairly easily) |
44 |
|
45 |
Another alternative is to use the current linux-info as a base eclass (i.e. it |
46 |
just provides functions for use by other eclasses and is not designed to be |
47 |
inherited by actual ebuilds), and then to provide 2 interface classes: one for |
48 |
simplifying compilation/installation of modules, and another which provides |
49 |
simple kernel path/version information that is required by many ebuilds. |
50 |
|
51 |
This would involve: |
52 |
- Renaming the current linux-info to linux-base. |
53 |
- No ebuilds would directly inherit linux-base, this is only a support eclass |
54 |
- linux-mod would inherit linux-base (unchanged otherwise) |
55 |
- a new linux-info would be created, which inherits linux-base and provides |
56 |
pkg_setup to get the version/path info ready |
57 |
- all ebuilds that only require basic kernel info would inherit the new |
58 |
linux-info |
59 |
|
60 |
|
61 |
How does everyone feel about this? Hopefully I've raised 2 issues here: |
62 |
1. Should users really have to call get_version to get info that pretty much |
63 |
all users are going to need |
64 |
2. If we agree to automate the above, then should we form a base class |
65 |
hierachy or should we just hack linux-info a little |
66 |
|
67 |
I am prepared to do the work to get this in place - I think it is a sensible |
68 |
improvement to make. |
69 |
|
70 |
Thanks, |
71 |
Daniel |
72 |
|
73 |
-- |
74 |
gentoo-kernel@g.o mailing list |