Gentoo Archives: gentoo-dev

From: "Robin H. Johnson" <robbat2@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] linux-info.eclass: lacking sources, config checks and module building
Date: Sun, 30 Aug 2009 17:53:10
Message-Id: robbat2-20090830T223818-065847896Z@orbis-terrarum.net
In Reply to: Re: [gentoo-dev] linux-info.eclass: lacking sources, config checks and module building by Mike Auty
1 On Sun, Aug 30, 2009 at 10:58:33PM +0100, Mike Auty wrote:
2 > Robin H. Johnson wrote:
3 > > FYI:
4 > > get_running_version is used in one single ebuild, in the entire tree:
5 > > sys-fs/evms/evms-2.5.5-r10.ebuild
6 > > And there it's only for a warning.
7 > Ok, I was just suggesting that if there was an intention to implement
8 > config.gz checks, they should only apply when people ask about the
9 > running version rather than the build version. Since that doesn't seem
10 > popular or even necessary, perhaps neither is the need to check config.gz?
11 The running version stuff may be needed to be used more than it is
12 presently.
13
14 If no kernel sources are present at all, all functions that check the
15 kernel version presently bail out. get_version is also at the very top
16 of linux-info's pkg_setup function, so it bails as well:
17 * Determining the location of the kernel source code
18 * Unable to find kernel sources at /usr/src/linux
19 ...
20
21 The existing state is:
22 - Force the user to install sources
23
24 Our choices are:
25 - `uname -r` output.
26 - Create an override environment variable for all the checks.
27
28 /proc/config.gz comes back here again, in that, we can use it as a
29 middle ground with `uname -r`, rather than having the environment
30 variable.
31
32 So from our discussion, I propose the following:
33 Finding the kernel version:
34 ---------------------------
35 0. (optional) give an env var to bypass entirely.
36 1. Use existing logic of /usr/src/linux, KERNEL_DIR et al.
37 2. Fall back to using the running version, with a warning.
38
39 Checking a configuration option, for non-module use:
40 ----------------------------------------------------
41 0. (optional) give an env var to make all checks non-fatal.
42 1. Use existing logic of .config from /usr/src/linux, KERNEL_DIR et al.
43 2. Fall back to /proc/config.gz if available.
44
45
46 > > The great majority of CONFIG_CHECK usage in the tree is fatal already.
47 > > It only actually needs to be fatal only when it's being used to build a
48 > > module.
49 > Ok, I see what you're suggesting now. When people want to build
50 > packages, but portage knows their kernel isn't setup to run them
51 > properly, then it should still build them, but warn them strongly about
52 > it (as opposed to currently, where it'll just die).
53 Two different cases here:
54 1. Portage knows their kernel is not setup correctly.
55 2. Portage cannot find out enough info.
56
57 It's #2 that bites on virtual machines and hardened servers, and is what
58 I'd like to fix.
59
60 > > This leaves us between hand-holding the basic user's kernel configuration
61 > > (exiting if the kernel config option is not enabled), and changing all
62 > > non-module instances in the tree to be non-fatal.
63 > Ok, so then the question is do we sacrifice correctness for fewer
64 > (invalid) bugs? Seems like a judgement call. For what it's worth, I'm
65 > not sure adding extra plumbing to allow smart users to bypass the checks
66 > is the right middle ground. I'd either leave it as is, or change the
67 > ebuilds to accurately reflect whether the userspace will build or not.
68 It's a one-liner to give an override making all checks non-fatal, with
69 the downside that it can't differentiate why the checks are being made.
70 So yes, in the case we should simply fix all of the ebuilds (after the
71 kernel source check is fixed as well).
72
73 > > If you're building modules, most of the time you're using linux-mod, not just
74 > > linux-info. There's no document or recommended behavior in the tree for the
75 > > above actually, and I'd like to introduce one.
76 > Sounds like a good idea, it might also be worth adding to the quizes, if
77 > existing devs are asking how it should be done? I guess that's a call
78 > on how common it is to have kernel config requirements on userspace...
79 142 packages inherit linux-mod.
80 130 packages use functions or the MODULE_NAMES code from linux-mod.
81 105 packages inherit linux-info.
82 11 packages inherit both linux-info AND linux-mod.
83
84 So I propose this as resolutions from the above:
85 1. USE=modules added to the base profile.
86 2. Every package that builds kernel modules must offer USE=modules,
87 which can be used to disable building the kernel modules, leaving a
88 pure userspace build of that package.
89
90 Most of the changes to the above can be done in the linux-mod eclass, so
91 I don't think we'll have to touch that many packages directly.
92
93 --
94 Robin Hugh Johnson
95 Gentoo Linux: Developer, Trustee & Infrastructure Lead
96 E-Mail : robbat2@g.o
97 GnuPG FP : 11AC BA4F 4778 E3F6 E4ED F38E B27B 944E 3488 4E85

Replies