Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 15 Jan 2017 10:30:47 -0800
From:      Adrian Chadd <adrian.chadd@gmail.com>
To:        Tijl Coosemans <tijl@freebsd.org>
Cc:        "current@freebsd.org" <current@freebsd.org>, Alexey Dokuchaev <danfe@freebsd.org>
Subject:   Re: Installing opt_*.h kernel headers
Message-ID:  <CAJ-VmomNa0dCKpPbMDY%2BOuWj%2BbhykmrTD-LyT5mOd%2BtXvrJ=kg@mail.gmail.com>
In-Reply-To: <20170115180858.19f828bf@kalimero.tijl.coosemans.org>
References:  <20170115180858.19f828bf@kalimero.tijl.coosemans.org>

next in thread | previous in thread | raw e-mail | index | archive | help
hi,

As much as I'd like to see everything be default-options and ABI
compliant, things like INET/INET6 throw that assumption under the bus
a bit.
(Yes, I'd love to see INET/INET6 be .ko's..)

So yes, I'd like to see a solution to this too. I think installing the
kernel config for the running kernel somewhere would be nice. No, not
/usr/include, because you want it cycled /with/ the kernel you just
installed. We already have the problem with /usr/lib/debug/ and where
it puts kernel modules.

We already have the 'one file' option, it's called 'kernel config',
and so maybe:

* store the kernel config with the built kernel;
* have config patched to 'just' generate the .h files from the given config, and
* let the build system use that if needed?

However - it all feels terrible. Ideally (hah), there'd be separate
submodules for vt/syscons and the modules would combine appropriately
to provide increasing functionality - but that's a lot to ask given
the complexity of the current system.

2c,



-adrian


On 15 January 2017 at 09:08, Tijl Coosemans <tijl@freebsd.org> wrote:
> Hi,
>
> The latest version of x11/nvidia-driver contains a call to a syscons
> function which is only available if the kernel config contains device
> sc (https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216050).  The call
> doesn't seem to be critical so I'd like to patch it like this:
>
> +#include "opt_syscons.h"
>  ...
> +#ifdef DEV_SC
>  syscons stuff here
> +#endif
>
> And add opt_syscons.h to SRCS in the module Makefile.
>
> This doesn't work however because sys/conf/kmod.mk creates empty opt_*.h
> files in the module build directory.  Only when KERNBUILDDIR is set does
> it create opt_*.h files as symlinks to the same file in KERNBUILDDIR.
> This means that to build this port correctly users would have to have a
> kernel build directory (even if they just need the nvidia driver and
> don't otherwise build kernels) and the ports tree would need some way to
> find it (using KERNCONF etc.).
>
> It would be better if these opt_*.h files were installed along with the
> kernel.  Somewhere in /usr/include or /boot/kernel(.old)?  Perhaps
> concatenated into one file?  Then kmod.mk could create symlinks to this
> file if KERNBUILDDIR is undefined.  Building a module directly from
> sys/modules would then also just work without .if !defined(KERNBUILDDIR)
> magic that several Makefiles contain.
> _______________________________________________
> freebsd-current@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJ-VmomNa0dCKpPbMDY%2BOuWj%2BbhykmrTD-LyT5mOd%2BtXvrJ=kg>