public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Robin H. Johnson" <robbat2@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Subject: [gentoo-dev] linux-info.eclass: lacking sources, config checks and module building
Date: Sun, 30 Aug 2009 19:58:22 +0000	[thread overview]
Message-ID: <robbat2-20090830T192224-029701861Z@orbis-terrarum.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 2422 bytes --]

Seeing the debate raised in the udev thread about checking for the
kernel, I'd like to propose that we revise the linux-info.eclass.

linux-info already checks a number of locations:
- KBUILD_OUTPUT,
- KERNEL_DIR, which defaults to /usr/src/linux/
- OUTPUT_DIR, which defaults to /lib/modules/`uname -r`/build/

It does NOT check /proc/config.gz presently. The original logic against
not checking /proc was that we were targeting the kernel being built,
but that's moot given the use of `uname -r` in OUTPUT_DIR.

Additionally, linux-info.eclass already has provisions for non-fatally
checking for kernel config options, by prefixing them with a tilde.

In parallel to what we actually check, we have the issue of systems that
may not have ANY of the above, or ANY kernel sources whatsoever.
The most common amongst these are:
- Hardened systems
- Virtual Machines

Proposed solution:
------------------
We need to be able to reduce user error, so we cannot simply make it
trust the user by default. So I propose that we add an environment
variable (I'm not set on the name yet), eg:
EXTERNALLY_BUILT_KERNEL=1

This option will cause linux-info.eclass to consider ALL kernel option
checks non-fatal. That way we still get the warnings and logs, but it
does not stop the builds.

When is the above NOT enough?
-----------------------------
The only time that ANY kernel sources are required is when you are
building an out-of-tree module. For this purpose, they must be
configured.

The check for having configured kernel sources must only be executed
when the modules are about to be compiled. Putting it in pkg_preinst
would block use of binpkgs on (related) machines.

- If a package builds modules AND userspace, we should offer a way to
  build the userspace only, as the user can build their modules
  externally (or patch them into the kernel) [1]
- For packages that ONLY build modules, and no userspace at all, having
  EXTERNALLY_BUILT_KERNEL=1 means that they should error out? [2]
  (this case might be thrown into the above one).

Footnotes:
----------
1. This has already been requested for ipset, bug #274577.
2. What about documentation? Is that enough of userspace still?

-- 
Robin Hugh Johnson
Gentoo Linux: Developer, Trustee & Infrastructure Lead
E-Mail     : robbat2@gentoo.org
GnuPG FP   : 11AC BA4F 4778 E3F6 E4ED  F38E B27B 944E 3488 4E85

[-- Attachment #2: Type: application/pgp-signature, Size: 330 bytes --]

             reply	other threads:[~2009-08-30 14:49 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-30 19:58 Robin H. Johnson [this message]
2009-08-30 20:21 ` [gentoo-dev] linux-info.eclass: lacking sources, config checks and module building Mike Auty
2009-08-30 21:29   ` Robin H. Johnson
2009-08-30 21:58     ` Mike Auty
2009-08-30 23:02       ` Robin H. Johnson
2009-08-30 23:30         ` Mike Auty
2009-08-30 23:46           ` Robin H. Johnson
2009-08-31  0:00             ` Mike Auty
2009-08-31  0:27               ` Robin H. Johnson
2009-08-31  0:41                 ` Mike Auty
2009-08-31 22:43                   ` Mike Auty
2009-09-07  9:28 ` Daniel Drake
2009-09-07 10:42   ` Robin H. Johnson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=robbat2-20090830T192224-029701861Z@orbis-terrarum.net \
    --to=robbat2@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox