Gentoo Archives: gentoo-dev

From: Mike Gilbert <floppym@g.o>
To: Gentoo Dev <gentoo-dev@l.g.o>
Cc: kernel@g.o
Subject: [gentoo-dev] Guidance on adding kernel config checks to ebuilds
Date: Mon, 27 Sep 2021 16:10:48
Message-Id: CAJ0EP43KKP16vVB8Oj8L0XcKcJ=cG8V1YoTfzuVN-jsZpsr8iw@mail.gmail.com
1 I'm looking to solicit opinions on when it is appropriate for an
2 ebuild to check for kernel config options using linux-info.eclass. I
3 don't think we have any guidelines documented, instead leaving it up
4 to the "common sense" of package maintainers.
5
6 Adding linux-info calls to pkg_pretend or pkg_setup causes slowdowns
7 when running emerge, so we should do so only when there is a
8 compensating benefit. It doesn't make sense to check for kernel
9 options that are very commonly enabled. But what is "very common"?
10
11 An obvious example would be CONFIG_INET, which controls IPv4 support
12 in the kernel. It does not make sense to check for that in every
13 package that uses AF_INET sockets.
14
15 A less obvious example: a user filed a bug against net-misc/dhcpcd
16 today asking that we check for CONFIG_PACKET [1]. My first thought was
17 "why would you ever disable that?". The option description even says
18 "if unsure, say Y". However, I suppose it is technically possible to
19 run a Linux system with it disabled.
20
21 I think a reasonable rule of thumb would be to assume we can rely on
22 options that are enabled by "make defconfig". If the user chooses to
23 disable them, they are responsible for anything that breaks.
24
25 Thoughts?
26
27 [1] https://bugs.gentoo.org/815064

Replies