1 |
On Tue, Jul 26, 2011 at 11:08:15PM +0200, Michał Górny wrote: |
2 |
> As Diego pointed out in bug #374807 [1], a simple package (not a kernel |
3 |
> module) should not enforce any kernel options during the build process. |
4 |
> As of no reply on the bug, I'm posting my question here. |
5 |
> |
6 |
> Should it just use '~' and warn then? Or should it re-do the checks |
7 |
> in pkg_preinst(), this time making the checks fatal? Or maybe it should |
8 |
> only perform them there? |
9 |
> |
10 |
> Also, I think I've seen ebuilds doing kernel checks in pkg_pretend(). I |
11 |
> did that once too but now I think that's wrong because kernel sources |
12 |
> are not guaranteed to be installed at that point. I am right? |
13 |
When packages other than kernel modules are being installed, there is |
14 |
absolutely no guarantee that kernel sources will ever be on the machine, |
15 |
esp. in larger deployments. There's also related cases (mainly on |
16 |
hardened) where it's impossible to check the actual kernel config, the |
17 |
data just isn't there. |
18 |
|
19 |
Do the checks exactly once, probably at pkg_preinst, and issue warnings |
20 |
if they fail due to not being set, or cannot be checked. At runtime, |
21 |
fail sensibly if the options in question aren't usable (autofs4, |
22 |
cgroups, devtmpfs should all be listed in /proc/filesystems). |
23 |
|
24 |
Failing during preinst isn't an option, for example if I'm installing |
25 |
while in a chroot in a different kernel (think of installing a Gentoo |
26 |
system, before the first reboot). |
27 |
|
28 |
-- |
29 |
Robin Hugh Johnson |
30 |
Gentoo Linux: Developer, Trustee & Infrastructure Lead |
31 |
E-Mail : robbat2@g.o |
32 |
GnuPG FP : 11AC BA4F 4778 E3F6 E4ED F38E B27B 944E 3488 4E85 |