Re: Installing opt_*.h kernel headers

From: Adrian Chadd <adrian.chadd_at_gmail.com>
Date: Sun, 15 Jan 2017 10:30:47 -0800
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_at_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_at_freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscribe_at_freebsd.org"
Received on Sun Jan 15 2017 - 17:30:51 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:09 UTC